diff --git a/.versions b/.versions index 8134e76..027d425 100644 --- a/.versions +++ b/.versions @@ -1,4 +1,4 @@ -awsp:handsontable@0.15.0 +awsp:handsontable@0.16.1 base64@1.0.3 binary-heap@1.0.3 callback-hook@1.0.3 @@ -9,7 +9,7 @@ geojson-utils@1.0.3 id-map@1.0.3 jquery@1.11.3_2 json@1.0.3 -local-test:awsp:handsontable@0.15.0 +local-test:awsp:handsontable@0.16.1 logging@1.0.7 meteor@1.1.6 minimongo@1.0.8 diff --git a/README.md b/README.md index f6ea7fe..ba19df7 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -# Meteor Handsontable (@version 0.15.0) -This package uses the latest version of Handsontable (currently @version 0.23.0) in MeteorJS. +# Meteor Handsontable (@version 0.16.1) +This package uses the latest version of Handsontable (currently @version 0.24.1) in MeteorJS. ## Installation @@ -15,7 +15,7 @@ meteor add awsp:handsontable ## Important Notes -This package contains the latest yet slightly modified version of Handsontable (version 0.23.0). Minor change has been made to the UI as well. +This package contains the latest yet slightly modified version of Handsontable (version 0.24.1). Minor change has been made to the UI as well. The new version of Handsontable no longer necessary requires jQuery to work. In order to introduce the latest Handsontable to Meteor, a minimum of modification was made to Handsontable in this package to fix some of the conflicts when used in Meteor. @@ -50,7 +50,7 @@ $("#hot3").handsontable({ }); ``` -## Formula Support (Updated Jan 17, 2016) +## Known Issue - Formula Support (Updated Jan 17, 2016) Starting from package version 0.7.0, you could also enable formulas in Handsontable. This package uses the default styling from Handsontable and RuleJS. However, you can always customize to your own by changing the following 2 classes in CSS. @@ -79,6 +79,7 @@ Formula support does not work with autofilling with Handsontable 0.14+. ## Release Notes +* Version 0.16.1 - Update Handsontable version to 0.24.1. * Version 0.15.0 - Update Handsontable version to 0.23.0. * Version 0.12.3 - Update Handsontable version to 0.20.3. * Version 0.12.2 - Update Handsontable version to 0.20.2. @@ -104,7 +105,7 @@ https://github.com/awsp/handsontable-meteor ## Versions Tracking -* Handsontable - 0.23.0 [Release Notes](https://github.com/handsontable/handsontable/releases) [New license](http://handsontable.com/static/licenses/v1/open-source-license.pdf?_ga=1.992503.778804082.1429430347) +* Handsontable - 0.24.1 [Release Notes](https://github.com/handsontable/handsontable/releases) [New license](http://handsontable.com/static/licenses/v1/open-source-license.pdf?_ga=1.992503.778804082.1429430347) * ruleJS - 0.0.5 diff --git a/bower.json b/bower.json index 71259ef..07ba718 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "awsp:handsontable", "main": "package.js", - "version": "0.15.0", + "version": "0.16.1", "homepage": "https://github.com/awsp/handsontable-meteor", "authors": [ "awsp " @@ -21,6 +21,6 @@ "tests" ], "dependencies": { - "handsontable": "~0.23.0" + "handsontable": "~0.24.1" } } diff --git a/bower_components/handsontable/.bower.json b/bower_components/handsontable/.bower.json index 296ffae..b001115 100644 --- a/bower_components/handsontable/.bower.json +++ b/bower_components/handsontable/.bower.json @@ -1,7 +1,7 @@ { "name": "handsontable", "description": "Spreadsheet-like data grid editor that provides copy/paste functionality compatible with Excel/Google Docs", - "version": "0.23.0", + "version": "0.24.1", "main": [ "./dist/handsontable.js", "./dist/handsontable.css" @@ -46,13 +46,13 @@ "devDependencies": { "chroma-js": "~0.5.6" }, - "_release": "0.23.0", + "_release": "0.24.1", "_resolution": { "type": "version", - "tag": "0.23.0", - "commit": "bd213ff49a66013e68c440244219e9ebaa7742d8" + "tag": "0.24.1", + "commit": "63c47b756de2629fcb0409ac8c960104e893670d" }, "_source": "git://github.com/handsontable/handsontable.git", - "_target": "~0.23.0", + "_target": "~0.24.1", "_originalSource": "handsontable" } \ No newline at end of file diff --git a/bower_components/handsontable/bower.json b/bower_components/handsontable/bower.json index 5fff28f..4a03dfa 100644 --- a/bower_components/handsontable/bower.json +++ b/bower_components/handsontable/bower.json @@ -1,7 +1,7 @@ { "name": "handsontable", "description": "Spreadsheet-like data grid editor that provides copy/paste functionality compatible with Excel/Google Docs", - "version": "0.23.0", + "version": "0.24.1", "main": ["./dist/handsontable.js", "./dist/handsontable.css"], "homepage": "http://handsontable.com/", "repository": { diff --git a/bower_components/handsontable/dist/handsontable.full.js b/bower_components/handsontable/dist/handsontable.full.js index 7d2c554..453f098 100644 --- a/bower_components/handsontable/dist/handsontable.full.js +++ b/bower_components/handsontable/dist/handsontable.full.js @@ -1264,7 +1264,7 @@ var Walkontable = function Walkontable(settings) { 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){ +},{"event":8,"helpers/dom/element":45,"helpers/object":51,"helpers/string":53,"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() { @@ -1409,7 +1409,8 @@ 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)) { + var referenceTABLE = closest(TD, ['TABLE']); + if (TD && isChildOf(TD, TABLE) && referenceTABLE == TABLE) { cell.coords = this.instance.wtTable.getCoords(TD); cell.TD = TD; } else if (hasClass(elem, 'wtBorder') && hasClass(elem, 'current')) { @@ -1549,6 +1550,12 @@ var $WalkontableOverlay = WalkontableOverlay; shouldBeRendered: function() { return true; }, + updateTrimmingContainer: function() { + this.trimmingContainer = getTrimmingContainer(this.hider.parentNode.parentNode); + }, + updateMainScrollableElement: function() { + this.mainTableScrollableElement = getScrollableElement(this.wot.wtTable.TABLE); + }, makeClone: function(direction) { if ($WalkontableOverlay.CLONE_TYPES.indexOf(direction) === -1) { throw new Error('Clone type "' + direction + '" is not supported.'); @@ -1629,7 +1636,7 @@ var $WalkontableOverlay = WalkontableOverlay; window.WalkontableOverlay = WalkontableOverlay; //# -},{"eventManager":41,"helpers/dom/element":45,"helpers/object":50}],12:[function(require,module,exports){ +},{"eventManager":41,"helpers/dom/element":45,"helpers/object":51}],12:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { WalkontableDebugOverlay: {get: function() { @@ -1674,7 +1681,8 @@ var $__0 = ($___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47 outerWidth = $__0.outerWidth, innerHeight = $__0.innerHeight, removeClass = $__0.removeClass, - setOverlayPosition = $__0.setOverlayPosition; + setOverlayPosition = $__0.setOverlayPosition, + resetCssTransform = $__0.resetCssTransform; 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); @@ -1710,6 +1718,7 @@ var $WalkontableLeftOverlay = WalkontableLeftOverlay; setOverlayPosition(overlayRoot, finalLeft, finalTop); } else { headerPosition = this.getScrollPosition(); + resetCssTransform(overlayRoot); } this.adjustHeaderBordersPosition(headerPosition); this.adjustElementsSize(); @@ -1735,6 +1744,7 @@ var $WalkontableLeftOverlay = WalkontableLeftOverlay; }, adjustElementsSize: function() { var force = arguments[0] !== (void 0) ? arguments[0] : false; + this.updateTrimmingContainer(); if (this.needFullRender || force) { this.adjustRootElementSize(); this.adjustRootChildrenSize(); @@ -1754,6 +1764,8 @@ var $WalkontableLeftOverlay = WalkontableLeftOverlay; var height = this.wot.wtViewport.getWorkspaceHeight() - scrollbarHeight; height = Math.min(height, innerHeight(this.wot.wtTable.wtRootElement)); overlayRootStyle.height = height + 'px'; + } else { + overlayRootStyle.height = ''; } this.clone.wtTable.holder.style.height = overlayRootStyle.height; tableWidth = outerWidth(this.clone.wtTable.TABLE); @@ -1863,7 +1875,8 @@ var $__0 = ($___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47 outerHeight = $__0.outerHeight, innerWidth = $__0.innerWidth, removeClass = $__0.removeClass, - setOverlayPosition = $__0.setOverlayPosition; + setOverlayPosition = $__0.setOverlayPosition, + resetCssTransform = $__0.resetCssTransform; 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); @@ -1899,6 +1912,7 @@ var $WalkontableTopOverlay = WalkontableTopOverlay; setOverlayPosition(overlayRoot, finalLeft, finalTop); } else { headerPosition = this.getScrollPosition(); + resetCssTransform(overlayRoot); } this.adjustHeaderBordersPosition(headerPosition); this.adjustElementsSize(); @@ -1925,6 +1939,7 @@ var $WalkontableTopOverlay = WalkontableTopOverlay; }, adjustElementsSize: function() { var force = arguments[0] !== (void 0) ? arguments[0] : false; + this.updateTrimmingContainer(); if (this.needFullRender || force) { this.adjustRootElementSize(); this.adjustRootChildrenSize(); @@ -1944,6 +1959,8 @@ var $WalkontableTopOverlay = WalkontableTopOverlay; var width = this.wot.wtViewport.getWorkspaceWidth() - scrollbarWidth; width = Math.min(width, innerWidth(this.wot.wtTable.wtRootElement)); overlayRootStyle.width = width + 'px'; + } else { + overlayRootStyle.width = ''; } this.clone.wtTable.holder.style.width = overlayRootStyle.width; tableHeight = outerHeight(this.clone.wtTable.TABLE); @@ -2054,7 +2071,8 @@ var $___46__46__47__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__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; + setOverlayPosition = $__0.setOverlayPosition, + resetCssTransform = $__0.resetCssTransform; 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); @@ -2066,6 +2084,7 @@ var $WalkontableTopLeftCornerOverlay = WalkontableTopLeftCornerOverlay; return (this.wot.getSetting('fixedRowsTop') || this.wot.getSetting('columnHeaders').length) && (this.wot.getSetting('fixedColumnsLeft') || this.wot.getSetting('rowHeaders').length) ? true : false; }, resetFixedPosition: function() { + this.updateTrimmingContainer(); if (!this.wot.wtTable.holder.parentNode) { return; } @@ -2092,6 +2111,8 @@ var $WalkontableTopLeftCornerOverlay = WalkontableTopLeftCornerOverlay; } } setOverlayPosition(overlayRoot, finalLeft, finalTop); + } else { + resetCssTransform(overlayRoot); } overlayRoot.style.height = (tableHeight === 0 ? tableHeight : tableHeight + 4) + 'px'; overlayRoot.style.width = (tableWidth === 0 ? tableWidth : tableWidth + 4) + 'px'; @@ -2181,6 +2202,7 @@ var WalkontableOverlays = function WalkontableOverlays(wotInstance) { this.verticalScrolling = false; this.horizontalScrolling = false; this.delegatedScrollCallback = false; + this.registeredListeners = []; this.registerListeners(); }; ($traceurRuntime.createClass)(WalkontableOverlays, { @@ -2204,51 +2226,52 @@ var WalkontableOverlays = function WalkontableOverlays(wotInstance) { }, registerListeners: function() { var $__3 = this; - this.eventManager.addEventListener(document.documentElement, 'keydown', (function(event) { + var topOverlayScrollable = this.topOverlay.mainTableScrollableElement; + var leftOverlayScrollable = this.leftOverlay.mainTableScrollableElement; + var listenersToRegister = []; + listenersToRegister.push([document.documentElement, 'keydown', (function(event) { return $__3.onKeyDown(event); - })); - this.eventManager.addEventListener(document.documentElement, 'keyup', (function() { + })]); + listenersToRegister.push([document.documentElement, 'keyup', (function() { return $__3.onKeyUp(); - })); - this.eventManager.addEventListener(document, 'visibilitychange', (function() { + })]); + listenersToRegister.push([document, 'visibilitychange', (function() { return $__3.onKeyUp(); - })); - var topOverlayScrollable = this.topOverlay.mainTableScrollableElement; - var leftOverlayScrollable = this.leftOverlay.mainTableScrollableElement; - this.eventManager.addEventListener(topOverlayScrollable, 'scroll', (function(event) { + })]); + listenersToRegister.push([topOverlayScrollable, 'scroll', (function(event) { return $__3.onTableScroll(event); - })); + })]); if (topOverlayScrollable !== leftOverlayScrollable) { - this.eventManager.addEventListener(leftOverlayScrollable, 'scroll', (function(event) { + listenersToRegister.push([leftOverlayScrollable, 'scroll', (function(event) { return $__3.onTableScroll(event); - })); + })]); } if (this.topOverlay.needFullRender) { - this.eventManager.addEventListener(this.topOverlay.clone.wtTable.holder, 'scroll', (function(event) { + listenersToRegister.push([this.topOverlay.clone.wtTable.holder, 'scroll', (function(event) { return $__3.onTableScroll(event); - })); - this.eventManager.addEventListener(this.topOverlay.clone.wtTable.holder, 'wheel', (function(event) { + })]); + listenersToRegister.push([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) { + listenersToRegister.push([this.bottomOverlay.clone.wtTable.holder, 'scroll', (function(event) { return $__3.onTableScroll(event); - })); - this.eventManager.addEventListener(this.bottomOverlay.clone.wtTable.holder, 'wheel', (function(event) { + })]); + listenersToRegister.push([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) { + listenersToRegister.push([this.leftOverlay.clone.wtTable.holder, 'scroll', (function(event) { return $__3.onTableScroll(event); - })); - this.eventManager.addEventListener(this.leftOverlay.clone.wtTable.holder, 'wheel', (function(event) { + })]); + listenersToRegister.push([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) { + listenersToRegister.push([window, 'wheel', (function(event) { var overlay; var deltaY = event.wheelDeltaY || event.deltaY; var deltaX = event.wheelDeltaX || event.deltaX; @@ -2266,7 +2289,18 @@ var WalkontableOverlays = function WalkontableOverlays(wotInstance) { } else if (overlay == 'bottom' && deltaY !== 0) { event.preventDefault(); } - })); + })]); + } + while (listenersToRegister.length) { + var listener = listenersToRegister.pop(); + this.eventManager.addEventListener(listener[0], listener[1], listener[2]); + this.registeredListeners.push(listener); + } + }, + deregisterListeners: function() { + while (this.registeredListeners.length) { + var listener = this.registeredListeners.pop(); + this.eventManager.removeEventListener(listener[0], listener[1], listener[2]); } }, onTableScroll: function(event) { @@ -2484,6 +2518,16 @@ var WalkontableOverlays = function WalkontableOverlays(wotInstance) { this.leftOverlay.clone.wtTable.holder.scrollTop = master.scrollTop; } }, + updateMainScrollableElements: function() { + this.deregisterListeners(); + this.leftOverlay.updateMainScrollableElement(); + this.topOverlay.updateMainScrollableElement(); + if (this.bottomOverlay.needFullRender) { + this.bottomOverlay.updateMainScrollableElement(); + } + this.scrollableElement = getScrollableElement(this.wot.wtTable.TABLE); + this.registerListeners(); + }, destroy: function() { this.eventManager.destroy(); this.topOverlay.destroy(); @@ -2559,7 +2603,7 @@ var WalkontableOverlays = function WalkontableOverlays(wotInstance) { window.WalkontableOverlays = WalkontableOverlays; //# -},{"eventManager":41,"helpers/dom/element":45,"helpers/unicode":53}],17:[function(require,module,exports){ +},{"eventManager":41,"helpers/dom/element":45,"helpers/unicode":54}],17:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { WalkontableScroll: {get: function() { @@ -2741,7 +2785,7 @@ var WalkontableScroll = function WalkontableScroll(wotInstance) { window.WalkontableScroll = WalkontableScroll; //# -},{"helpers/dom/element":45,"helpers/number":49}],18:[function(require,module,exports){ +},{"helpers/dom/element":45,"helpers/number":50}],18:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { WalkontableSelection: {get: function() { @@ -4125,6 +4169,7 @@ var $__shims_47_classes__, $__helpers_47_array__, $__helpers_47_browser__, $__helpers_47_data__, + $__helpers_47_feature__, $__helpers_47_function__, $__helpers_47_mixed__, $__helpers_47_number__, @@ -4153,6 +4198,7 @@ if (!Handsontable.hooks) { 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 featureHelpers = ($__helpers_47_feature__ = require("helpers/feature"), $__helpers_47_feature__ && $__helpers_47_feature__.__esModule && $__helpers_47_feature__ || {default: $__helpers_47_feature__}); 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__}); @@ -4162,11 +4208,11 @@ var stringHelpers = ($__helpers_47_string__ = require("helpers/string"), $__help 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 HELPERS = [arrayHelpers, browserHelpers, dataHelpers, featureHelpers, functionHelpers, mixedHelpers, numberHelpers, objectHelpers, settingHelpers, stringHelpers, unicodeHelpers]; var DOM = [domHelpers, domEventHelpers]; -Handsontable.buildDate = 'Fri Feb 19 2016 12:38:26 GMT+0100 (CET)'; +Handsontable.buildDate = 'Wed Mar 16 2016 12:23:01 GMT+0100 (CET)'; Handsontable.packageName = 'handsontable'; -Handsontable.version = '0.23.0'; +Handsontable.version = '0.24.1'; var baseVersion = '@@baseVersion'; if (!/^@@/.test(baseVersion)) { Handsontable.baseVersion = baseVersion; @@ -4193,7 +4239,7 @@ arrayHelpers.arrayEach(DOM, (function(helper) { })); //# -},{"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":91,"shims/classes":98}],24:[function(require,module,exports){ +},{"cellTypes":24,"core":25,"es6collections":"es6collections","helpers/array":42,"helpers/browser":43,"helpers/data":44,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/feature":47,"helpers/function":48,"helpers/mixed":49,"helpers/number":50,"helpers/object":51,"helpers/setting":52,"helpers/string":53,"helpers/unicode":54,"pluginHooks":57,"plugins":58,"plugins/jqueryHandsontable":1,"renderers/_cellDecorator":92,"shims/classes":99}],24:[function(require,module,exports){ "use strict"; var $__helpers_47_browser__, $__editors__, @@ -4216,6 +4262,7 @@ var $__helpers_47_browser__, $__renderers_47_textRenderer__, $__validators_47_autocompleteValidator__, $__validators_47_dateValidator__, + $__validators_47_timeValidator__, $__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; @@ -4238,6 +4285,7 @@ var PasswordRenderer = ($__renderers_47_passwordRenderer__ = require("renderers/ 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 TimeValidator = ($__validators_47_timeValidator__ = require("validators/timeValidator"), $__validators_47_timeValidator__ && $__validators_47_timeValidator__.__esModule && $__validators_47_timeValidator__ || {default: $__validators_47_timeValidator__}).TimeValidator; 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 = { @@ -4264,6 +4312,11 @@ Handsontable.DateCell = { validator: Handsontable.DateValidator, renderer: getRenderer('autocomplete') }; +Handsontable.TimeCell = { + editor: getEditorConstructor('text'), + validator: Handsontable.TimeValidator, + renderer: getRenderer('text') +}; Handsontable.HandsontableCell = { editor: getEditorConstructor('handsontable'), renderer: getRenderer('autocomplete') @@ -4281,6 +4334,7 @@ Handsontable.DropdownCell = { Handsontable.cellTypes = { text: Handsontable.TextCell, date: Handsontable.DateCell, + time: Handsontable.TimeCell, numeric: Handsontable.NumericCell, checkbox: Handsontable.CheckboxCell, autocomplete: Handsontable.AutocompleteCell, @@ -4294,7 +4348,7 @@ Handsontable.cellLookup = {validator: { }}; //# -},{"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":90,"renderers/autocompleteRenderer":92,"renderers/checkboxRenderer":93,"renderers/htmlRenderer":94,"renderers/numericRenderer":95,"renderers/passwordRenderer":96,"renderers/textRenderer":97,"validators/autocompleteValidator":102,"validators/dateValidator":103,"validators/numericValidator":104}],25:[function(require,module,exports){ +},{"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":91,"renderers/autocompleteRenderer":93,"renderers/checkboxRenderer":94,"renderers/htmlRenderer":95,"renderers/numericRenderer":96,"renderers/passwordRenderer":97,"renderers/textRenderer":98,"validators/autocompleteValidator":104,"validators/dateValidator":105,"validators/numericValidator":106,"validators/timeValidator":107}],25:[function(require,module,exports){ "use strict"; var $__numeral__, $__helpers_47_dom_47_element__, @@ -4456,11 +4510,12 @@ Handsontable.Core = function Core(rootElement, userSettings) { selection.refreshBorders(); break; case 'remove_col': + var logicalColumnIndex = translateColIndex(index); datamap.removeCol(index, amount); for (var row$__20 = 0, len$__21 = instance.countSourceRows(); row$__20 < len$__21; row$__20++) { if (priv.cellSettings[row$__20]) { - priv.cellSettings[row$__20].splice(index, amount); + priv.cellSettings[row$__20].splice(logicalColumnIndex, amount); } } var fixedColumnsLeft = instance.getSettings().fixedColumnsLeft; @@ -4468,17 +4523,16 @@ Handsontable.Core = function Core(rootElement, userSettings) { instance.getSettings().fixedColumnsLeft -= Math.min(amount, fixedColumnsLeft - index); } if (Array.isArray(instance.getSettings().colHeaders)) { - if (typeof index == 'undefined') { - index = -1; + if (typeof logicalColumnIndex == 'undefined') { + logicalColumnIndex = -1; } - instance.getSettings().colHeaders.splice(index, amount); + instance.getSettings().colHeaders.splice(logicalColumnIndex, amount); } grid.adjustRowsAndCols(); selection.refreshBorders(); break; default: throw new Error('There is no such action "' + action + '"'); - break; } if (!keepEmptyRows) { grid.adjustRowsAndCols(); @@ -5000,8 +5054,7 @@ Handsontable.Core = function Core(rootElement, userSettings) { } 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); + var cellProperties = instance.getCellMeta(row, col); 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; @@ -5110,8 +5163,10 @@ Handsontable.Core = function Core(rootElement, userSettings) { }); }, 0)); } else { - cellProperties.valid = true; - done(cellProperties.valid); + instance._registerTimeout(setTimeout(function() { + cellProperties.valid = true; + done(cellProperties.valid); + }, 0)); } }; function setDataInputToArray(row, propOrCol, value) { @@ -5231,6 +5286,9 @@ Handsontable.Core = function Core(rootElement, userSettings) { } else { instance.dataType = 'object'; } + if (datamap) { + datamap.destroy(); + } datamap = new DataMap(instance, priv, GridSettings); dataSource.data = data; dataSource.dataType = instance.dataType; @@ -5309,8 +5367,10 @@ Handsontable.Core = function Core(rootElement, userSettings) { proto = priv.columnSettings[i].prototype; if (GridSettings.prototype.columns) { column = GridSettings.prototype.columns[i]; - extend(proto, column); - extend(proto, expandType(column)); + if (column) { + extend(proto, column); + extend(proto, expandType(column)); + } } } } @@ -5331,12 +5391,31 @@ Handsontable.Core = function Core(rootElement, userSettings) { addClass(instance.rootElement, settings.className); } } - if (typeof settings.height != 'undefined') { - var height = settings.height; - if (typeof height == 'function') { - height = height(); + var currentHeight = instance.rootElement.style.height; + if (currentHeight !== '') { + currentHeight = parseInt(instance.rootElement.style.height, 10); + } + var height = settings.height; + if (typeof height == 'function') { + height = height(); + } + if (init) { + var initialStyle = instance.rootElement.getAttribute('style'); + if (initialStyle) { + instance.rootElement.setAttribute('data-initialstyle', instance.rootElement.getAttribute('style')); + } + } + if (height === null) { + var initialStyle$__22 = instance.rootElement.getAttribute('data-initialstyle'); + if (initialStyle$__22 && (initialStyle$__22.indexOf('height') > -1 || initialStyle$__22.indexOf('overflow') > -1)) { + instance.rootElement.setAttribute('style', initialStyle$__22); + } else { + instance.rootElement.style.height = ''; + instance.rootElement.style.overflow = ''; } + } else if (height !== void 0) { instance.rootElement.style.height = height + 'px'; + instance.rootElement.style.overflow = 'hidden'; } if (typeof settings.width != 'undefined') { var width = settings.width; @@ -5345,9 +5424,6 @@ Handsontable.Core = function Core(rootElement, userSettings) { } instance.rootElement.style.width = width + 'px'; } - if (height) { - instance.rootElement.style.overflow = 'hidden'; - } if (!init) { Handsontable.hooks.run(instance, 'afterUpdateSettings'); } @@ -5356,6 +5432,9 @@ Handsontable.Core = function Core(rootElement, userSettings) { instance.forceFullRender = true; selection.refreshBorders(null, true); } + if (!init && instance.view && (currentHeight === '' || height === '' || height === void 0) && currentHeight !== height) { + instance.view.wt.wtOverlays.updateMainScrollableElements(); + } }; this.getValue = function() { var sel = instance.getSelected(); @@ -5868,8 +5947,11 @@ Handsontable.Core = function Core(rootElement, userSettings) { } } } - priv = null; + if (datamap) { + datamap.destroy(); + } datamap = null; + priv = null; grid = null; selection = null; editorManager = null; @@ -6067,12 +6149,13 @@ DefaultSettings.prototype = { trimRows: void 0, rowHeaderWidth: void 0, columnHeaderHeight: void 0, - observeChanges: void 0 + observeChanges: void 0, + sortFunction: 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":90,"tableView":99}],26:[function(require,module,exports){ +},{"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":50,"helpers/object":51,"helpers/setting":52,"helpers/string":53,"numeral":"numeral","plugins":58,"renderers":91,"tableView":100}],26:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { DataMap: {get: function() { @@ -6085,6 +6168,7 @@ var $__SheetClip__, $__helpers_47_setting__, $__helpers_47_object__, $__helpers_47_array__, + $__utils_47_interval__, $__helpers_47_number__, $__multiMap__; var SheetClip = ($__SheetClip__ = require("SheetClip"), $__SheetClip__ && $__SheetClip__.__esModule && $__SheetClip__ || {default: $__SheetClip__}).default; @@ -6096,19 +6180,26 @@ var $__3 = ($__helpers_47_object__ = require("helpers/object"), $__helpers_47_ob 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 Interval = ($__utils_47_interval__ = require("utils/interval"), $__utils_47_interval__ && $__utils_47_interval__.__esModule && $__utils_47_interval__ || {default: $__utils_47_interval__}).Interval; 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) { + var $__8 = this; this.instance = instance; this.priv = priv; this.GridSettings = GridSettings; this.dataSource = this.instance.getSettings().data; + this.cachedLength = null; + this.latestSourceRowsCount = 0; if (this.dataSource[0]) { this.duckSchema = this.recursiveDuckSchema(this.dataSource[0]); } else { this.duckSchema = {}; } this.createMap(); + this.interval = Interval.create((function() { + return $__8.clearLengthCache(); + }), '15fps'); } DataMap.prototype.DESTINATION_RENDERER = 1; DataMap.prototype.DESTINATION_CLIPBOARD_GENERATOR = 2; @@ -6173,7 +6264,7 @@ DataMap.prototype.propToCol = function(prop) { } else { col = this.propToColCache.get(prop); } - col = Handsontable.hooks.run(this.instance, 'modifyCol', col); + col = Handsontable.hooks.run(this.instance, 'unmodifyCol', col); return col; }; DataMap.prototype.getSchema = function() { @@ -6269,12 +6360,16 @@ DataMap.prototype.removeRow = function(index, amount) { } index = (this.instance.countSourceRows() + index) % this.instance.countSourceRows(); var logicRows = this.physicalRowsToLogical(index, amount); + var descendingLogicRows = logicRows.slice(0).sort(function(a, b) { + return b - a; + }); 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) { + var newData; + newData = data.filter(function(row, index) { return logicRows.indexOf(index) == -1; }); data.length = 0; @@ -6293,16 +6388,38 @@ DataMap.prototype.removeCol = function(index, amount) { index = -amount; } index = (this.instance.countCols() + index) % this.instance.countCols(); - var actionWasNotCancelled = Handsontable.hooks.run(this.instance, 'beforeRemoveCol', index, amount); + var logicColumns = this.physicalColumnsToLogical(index, amount); + var descendingLogicColumns = logicColumns.slice(0).sort(function(a, b) { + return b - a; + }); + var actionWasNotCancelled = Handsontable.hooks.run(this.instance, 'beforeRemoveCol', index, amount, logicColumns); if (actionWasNotCancelled === false) { return; } + var isTableUniform = true; + var removedColumnsCount = descendingLogicColumns.length; var data = this.dataSource; - for (var r = 0, - rlen = this.instance.countSourceRows(); r < rlen; r++) { - data[r].splice(index, amount); + for (var c = 0; c < removedColumnsCount; c++) { + if (isTableUniform && logicColumns[0] !== logicColumns[c] - c) { + isTableUniform = false; + } + } + if (isTableUniform) { + for (var r = 0, + rlen = this.instance.countSourceRows(); r < rlen; r++) { + data[r].splice(logicColumns[0], amount); + } + } else { + for (var r$__9 = 0, + rlen$__10 = this.instance.countSourceRows(); r$__9 < rlen$__10; r$__9++) { + for (var c$__11 = 0; c$__11 < removedColumnsCount; c$__11++) { + data[r$__9].splice(descendingLogicColumns[c$__11], 1); + } + } + for (var c$__12 = 0; c$__12 < removedColumnsCount; c$__12++) { + this.priv.columnSettings.splice(logicColumns[c$__12], 1); + } } - this.priv.columnSettings.splice(index, amount); Handsontable.hooks.run(this.instance, 'afterRemoveCol', index, amount); this.instance.forceFullRender = true; }; @@ -6402,6 +6519,19 @@ DataMap.prototype.physicalRowsToLogical = function(index, amount) { } return logicRows; }; +DataMap.prototype.physicalColumnsToLogical = function(index, amount) { + var totalCols = this.instance.countCols(); + var physicalCol = (totalCols + index) % totalCols; + var logicalCols = []; + var colsToRemove = amount; + while (physicalCol < totalCols && colsToRemove) { + var col = Handsontable.hooks.run(this.instance, 'modifyCol', physicalCol); + logicalCols.push(col); + colsToRemove--; + physicalCol++; + } + return logicalCols; +}; DataMap.prototype.clear = function() { for (var r = 0; r < this.instance.countSourceRows(); r++) { for (var c = 0; c < this.instance.countCols(); c++) { @@ -6409,16 +6539,32 @@ DataMap.prototype.clear = function() { } } }; +DataMap.prototype.clearLengthCache = function() { + this.cachedLength = null; +}; DataMap.prototype.getLength = function() { - var $__7 = this; + var $__8 = 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--; - } - })); + var reValidate = false; + this.interval.start(); + if (length !== this.latestSourceRowsCount) { + reValidate = true; + } + this.latestSourceRowsCount = length; + if (this.cachedLength === null || reValidate) { + rangeEach(length - 1, (function(row) { + row = Handsontable.hooks.run($__8.instance, 'modifyRow', row); + if (row === null) { + --length; + } + })); + this.cachedLength = length; + } else { + length = this.cachedLength; + } + } else { + this.interval.stop(); } return length; }; @@ -6469,11 +6615,21 @@ DataMap.prototype.getText = function(start, end) { DataMap.prototype.getCopyableText = function(start, end) { return SheetClip.stringify(this.getRange(start, end, this.DESTINATION_CLIPBOARD_GENERATOR)); }; +DataMap.prototype.destroy = function() { + this.interval.stop(); + this.interval = null; + this.instance = null; + this.priv = null; + this.GridSettings = null; + this.dataSource = null; + this.cachedLength = null; + this.duckSchema = null; +}; ; 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){ +},{"SheetClip":"SheetClip","helpers/array":42,"helpers/data":44,"helpers/number":50,"helpers/object":51,"helpers/setting":52,"multiMap":56,"utils/interval":102}],27:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { DataSource: {get: function() { @@ -6562,7 +6718,7 @@ var DataSource = function DataSource(hotInstance) { ; //# -},{"helpers/array":42,"helpers/data":44,"helpers/number":49,"helpers/object":50,"helpers/setting":51}],28:[function(require,module,exports){ +},{"helpers/array":42,"helpers/data":44,"helpers/number":50,"helpers/object":51,"helpers/setting":52}],28:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { EditorManager: {get: function() { @@ -6858,7 +7014,7 @@ function EditorManager(instance, priv, selection) { } //# -},{"3rdparty/walkontable/src/cell/coords":5,"editors":29,"eventManager":41,"helpers/dom/event":46,"helpers/unicode":53}],29:[function(require,module,exports){ +},{"3rdparty/walkontable/src/cell/coords":5,"editors":29,"eventManager":41,"helpers/dom/event":46,"helpers/unicode":54}],29:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { registerEditor: {get: function() { @@ -6940,7 +7096,7 @@ function hasEditor(editorName) { } //# -},{"helpers/string":52}],30:[function(require,module,exports){ +},{"helpers/string":53}],30:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { BaseEditor: {get: function() { @@ -7153,7 +7309,7 @@ BaseEditor.prototype.checkEditorSection = function() { }; //# -},{"3rdparty/walkontable/src/cell/coords":5,"helpers/mixed":48}],31:[function(require,module,exports){ +},{"3rdparty/walkontable/src/cell/coords":5,"helpers/mixed":49}],31:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { AutocompleteEditor: {get: function() { @@ -7417,7 +7573,7 @@ AutocompleteEditor.prototype.allowKeyEventPropagation = function(keyCode) { 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){ +},{"editors":29,"handsontableEditor":35,"helpers/array":42,"helpers/dom/element":45,"helpers/mixed":49,"helpers/unicode":54}],32:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { CheckboxEditor: {get: function() { @@ -7641,7 +7797,7 @@ var $DateEditor = DateEditor; 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){ +},{"editors":29,"eventManager":41,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/object":51,"helpers/unicode":54,"moment":"moment","pikaday":"pikaday","textEditor":40}],34:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { DropdownEditor: {get: function() { @@ -7828,7 +7984,7 @@ HandsontableEditor.prototype.assignHooks = function() { 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){ +},{"editors":29,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/object":51,"helpers/unicode":54,"textEditor":40}],36:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { MobileTextEditor: {get: function() { @@ -8087,7 +8243,7 @@ MobileTextEditor.prototype.destroy = function() { 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){ +},{"_baseEditor":30,"editors":29,"eventManager":41,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/unicode":54}],37:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { NumericEditor: {get: function() { @@ -8381,7 +8537,7 @@ SelectEditor.prototype.getEditedCell = function() { registerEditor('select', SelectEditor); //# -},{"_baseEditor":30,"editors":29,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/unicode":53}],40:[function(require,module,exports){ +},{"_baseEditor":30,"editors":29,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/unicode":54}],40:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { TextEditor: {get: function() { @@ -8636,7 +8792,7 @@ TextEditor.prototype.refreshDimensions = function() { if (cssTransformOffset && cssTransformOffset != -1) { this.textareaParentStyle[cssTransformOffset[0]] = cssTransformOffset[1]; } else { - resetCssTransform(this.textareaParentStyle); + resetCssTransform(this.TEXTAREA_PARENT); } this.textareaParentStyle.top = editTop + 'px'; this.textareaParentStyle.left = editLeft + 'px'; @@ -8699,7 +8855,7 @@ TextEditor.prototype.destroy = function() { 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){ +},{"_baseEditor":30,"autoResize":"autoResize","editors":29,"eventManager":41,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/unicode":54}],41:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { EventManager: {get: function() { @@ -8711,12 +8867,12 @@ Object.defineProperties(exports, { __esModule: {value: true} }); var $__helpers_47_dom_47_element__, - $__helpers_47_browser__, + $__helpers_47_feature__, $__helpers_47_dom_47_event__; 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 isWebComponentSupportedNatively = ($__helpers_47_feature__ = require("helpers/feature"), $__helpers_47_feature__ && $__helpers_47_feature__.__esModule && $__helpers_47_feature__ || {default: $__helpers_47_feature__}).isWebComponentSupportedNatively; var _stopImmediatePropagation = ($__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__}).stopImmediatePropagation; var EventManager = function EventManager() { var context = arguments[0] !== (void 0) ? arguments[0] : null; @@ -8904,7 +9060,7 @@ function eventManager(context) { } //# -},{"helpers/browser":43,"helpers/dom/element":45,"helpers/dom/event":46}],42:[function(require,module,exports){ +},{"helpers/dom/element":45,"helpers/dom/event":46,"helpers/feature":47}],42:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { to2dArray: {get: function() { @@ -9081,15 +9237,6 @@ Object.defineProperties(exports, { 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); @@ -9114,39 +9261,6 @@ function isMobileBrowser(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 = 't
t'; - var CAPTION = document.createElement('CAPTION'); - CAPTION.innerHTML = 'c
c
c
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){ @@ -9278,7 +9392,7 @@ function cellMethodLookupFactory(methodName, allowUndefined) { } //# -},{"object":50}],45:[function(require,module,exports){ +},{"object":51}],45:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { closest: {get: function() { @@ -9410,20 +9524,15 @@ Object.defineProperties(exports, { isOutsideInput: {get: function() { return isOutsideInput; }}, - requestAnimationFrame: {get: function() { - return requestAnimationFrame; - }}, - cancelAnimationFrame: {get: function() { - return cancelAnimationFrame; - }}, __esModule: {value: true} }); -var $___46__46__47_browser__; +var $___46__46__47_browser__, + $___46__46__47_feature__; 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; + isSafari = $__0.isSafari; +var hasCaptionProblem = ($___46__46__47_feature__ = require("../feature"), $___46__46__47_feature__ && $___46__46__47_feature__.__esModule && $___46__46__47_feature__ || {default: $___46__46__47_feature__}).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)) { @@ -9949,10 +10058,10 @@ function getCssTransform(element) { return -1; } function resetCssTransform(element) { - if (element.transform && element.transform !== '') { - element.transform = ''; - } else if (element['-webkit-transform'] && element['-webkit-transform'] !== '') { - element['-webkit-transform'] = ''; + if (element.style.transform && element.style.transform !== '') { + element.style.transform = ''; + } else if (element.style['-webkit-transform'] && element.style['-webkit-transform'] !== '') { + element.style['-webkit-transform'] = ''; } } function isInput(element) { @@ -9962,39 +10071,9 @@ function isInput(element) { 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){ +},{"../browser":43,"../feature":47}],46:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { stopImmediatePropagation: {get: function() { @@ -10048,6 +10127,116 @@ function pageY(event) { //# },{"element":45}],47:[function(require,module,exports){ "use strict"; +Object.defineProperties(exports, { + requestAnimationFrame: {get: function() { + return requestAnimationFrame; + }}, + cancelAnimationFrame: {get: function() { + return cancelAnimationFrame; + }}, + isTouchSupported: {get: function() { + return isTouchSupported; + }}, + isWebComponentSupportedNatively: {get: function() { + return isWebComponentSupportedNatively; + }}, + hasCaptionProblem: {get: function() { + return hasCaptionProblem; + }}, + getComparisonFunction: {get: function() { + return getComparisonFunction; + }}, + __esModule: {value: true} +}); +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); +} +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 = 't
t'; + var CAPTION = document.createElement('CAPTION'); + CAPTION.innerHTML = 'c
c
c
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; +} +var comparisonFunction; +function getComparisonFunction(language) { + var options = arguments[1] !== (void 0) ? arguments[1] : {}; + if (comparisonFunction) { + return comparisonFunction; + } + if (typeof Intl === 'object') { + comparisonFunction = new Intl.Collator(language, options).compare; + } else if (typeof String.prototype.localeCompare === 'function') { + comparisonFunction = (function(a, b) { + return (a + '').localeCompare(b); + }); + } else { + comparisonFunction = (function(a, b) { + if (a === b) { + return 0; + } + return a > b ? -1 : 1; + }); + } + return comparisonFunction; +} + +//# +},{}],48:[function(require,module,exports){ +"use strict"; Object.defineProperties(exports, { proxy: {get: function() { return proxy; @@ -10215,7 +10404,7 @@ function curryRight(func) { } //# -},{"array":42}],48:[function(require,module,exports){ +},{"array":42}],49:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { stringify: {get: function() { @@ -10243,7 +10432,7 @@ function stringify(value) { } //# -},{}],49:[function(require,module,exports){ +},{}],50:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { isNumeric: {get: function() { @@ -10297,7 +10486,7 @@ function valueAccordingPercent(value, percent) { } //# -},{}],50:[function(require,module,exports){ +},{}],51:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { duckSchema: {get: function() { @@ -10510,7 +10699,7 @@ function getProperty(object, name) { } //# -},{"array":42}],51:[function(require,module,exports){ +},{"array":42}],52:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { columnFactory: {get: function() { @@ -10532,7 +10721,7 @@ function columnFactory(GridSettings, conflictList) { } //# -},{"object":50}],52:[function(require,module,exports){ +},{"object":51}],53:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { toUpperCaseFirst: {get: function() { @@ -10647,7 +10836,7 @@ function padStart(string, maxLength) { ; //# -},{"mixed":48,"number":49}],53:[function(require,module,exports){ +},{"mixed":49,"number":50}],54:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { KEY_CODES: {get: function() { @@ -10736,7 +10925,7 @@ function isKey(keyCode, baseCode) { } //# -},{"array":42}],54:[function(require,module,exports){ +},{"array":42}],55:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { localHooks: {get: function() { @@ -10781,7 +10970,7 @@ Handsontable.utils = Handsontable.utils || {}; Handsontable.utils.localHooks = localHooks; //# -},{"helpers/array":42,"helpers/object":50}],55:[function(require,module,exports){ +},{"helpers/array":42,"helpers/object":51}],56:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { MultiMap: {get: function() { @@ -10833,7 +11022,7 @@ function MultiMap() { } //# -},{}],56:[function(require,module,exports){ +},{}],57:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { Hooks: {get: function() { @@ -10843,7 +11032,7 @@ Object.defineProperties(exports, { }); 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 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', 'unmodifyCol', '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() { @@ -10984,7 +11173,7 @@ Handsontable.utils = Handsontable.utils || {}; Handsontable.utils.Hooks = Hooks; //# -},{"helpers/array":42,"helpers/object":50}],57:[function(require,module,exports){ +},{"helpers/array":42,"helpers/object":51}],58:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { registerPlugin: {get: function() { @@ -11056,7 +11245,7 @@ function getPluginName(hotInstance, plugin) { ; //# -},{"helpers/object":50,"helpers/string":52}],58:[function(require,module,exports){ +},{"helpers/object":51,"helpers/string":53}],59:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { default: {get: function() { @@ -11189,7 +11378,7 @@ var $__default = BasePlugin; Handsontable.plugins.BasePlugin = BasePlugin; //# -},{"helpers/array":42,"helpers/object":50,"plugins":57}],59:[function(require,module,exports){ +},{"helpers/array":42,"helpers/object":51,"plugins":58}],60:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { AutoColumnSize: {get: function() { @@ -11199,6 +11388,7 @@ Object.defineProperties(exports, { }); var $___46__46__47__95_base__, $___46__46__47__46__46__47_helpers_47_array__, + $___46__46__47__46__46__47_helpers_47_feature__, $___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__, @@ -11211,33 +11401,33 @@ var BasePlugin = ($___46__46__47__95_base__ = require("_base"), $___46__46__47__ 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__}), +var $__2 = ($___46__46__47__46__46__47_helpers_47_feature__ = require("helpers/feature"), $___46__46__47__46__46__47_helpers_47_feature__ && $___46__46__47__46__46__47_helpers_47_feature__.__esModule && $___46__46__47__46__46__47_helpers_47_feature__ || {default: $___46__46__47__46__46__47_helpers_47_feature__}), cancelAnimationFrame = $__2.cancelAnimationFrame, - requestAnimationFrame = $__2.requestAnimationFrame, - isVisible = $__2.isVisible; + requestAnimationFrame = $__2.requestAnimationFrame; +var isVisible = ($___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__}).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 $__5 = ($___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 = $__5.isObject, + objectEach = $__5.objectEach; +var $__6 = ($___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 = $__6.valueAccordingPercent, + rangeEach = $__6.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; + var $__11 = 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); + return $__11.hot.getDataAtCell(row, col); })); this.firstCalculation = true; this.inProgress = false; this.addHook('beforeColumnResize', (function(col, size, isDblClick) { - return $__10.onBeforeColumnResize(col, size, isDblClick); + return $__11.onBeforeColumnResize(col, size, isDblClick); })); }; var $AutoColumnSize = AutoColumnSize; @@ -11246,7 +11436,7 @@ var $AutoColumnSize = AutoColumnSize; return this.hot.getSettings().autoColumnSize !== false && !this.hot.getSettings().colWidths; }, enablePlugin: function() { - var $__10 = this; + var $__11 = this; if (this.enabled) { return; } @@ -11256,16 +11446,16 @@ var $AutoColumnSize = AutoColumnSize; this.samplesGenerator.customSampleCount = parseInt(samplingRatio, 10); } this.addHook('afterLoadData', (function() { - return $__10.onAfterLoadData(); + return $__11.onAfterLoadData(); })); this.addHook('beforeChange', (function(changes) { - return $__10.onBeforeChange(changes); + return $__11.onBeforeChange(changes); })); this.addHook('beforeRender', (function(force) { - return $__10.onBeforeRender(force); + return $__11.onBeforeRender(force); })); this.addHook('modifyColWidth', (function(width, col) { - return $__10.getColumnWidth(col, width); + return $__11.getColumnWidth(col, width); })); $traceurRuntime.superGet(this, $AutoColumnSize.prototype, "enablePlugin").call(this); }, @@ -11282,7 +11472,7 @@ var $AutoColumnSize = AutoColumnSize; to: this.hot.countRows() - 1 }; var force = arguments[2] !== (void 0) ? arguments[2] : false; - var $__10 = this; + var $__11 = this; if (typeof colRange === 'number') { colRange = { from: colRange, @@ -11296,16 +11486,16 @@ var $AutoColumnSize = AutoColumnSize; }; } 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); + if (force || ($__11.widths[col] === void 0 && !$__11.hot._getColWidthFromSettings(col))) { + var samples = $__11.samplesGenerator.generateColumnSamples(col, rowRange); samples.forEach((function(sample, col) { - return $__10.ghostTable.addColumn(col, sample); + return $__11.ghostTable.addColumn(col, sample); })); } })); if (this.ghostTable.columns.length) { this.ghostTable.getWidths((function(col, width) { - return $__10.widths[col] = width; + return $__11.widths[col] = width; })); this.ghostTable.clean(); } @@ -11315,18 +11505,18 @@ var $AutoColumnSize = AutoColumnSize; from: 0, to: this.hot.countRows() - 1 }; - var $__10 = this; + var $__11 = this; var current = 0; var length = this.hot.countCols() - 1; var timer = null; this.inProgress = true; var loop = (function() { - if (!$__10.hot) { + if (!$__11.hot) { cancelAnimationFrame(timer); - $__10.inProgress = false; + $__11.inProgress = false; return; } - $__10.calculateColumnsWidth({ + $__11.calculateColumnsWidth({ from: current, to: Math.min(current + $AutoColumnSize.CALCULATION_STEP, length) }, rowRange); @@ -11335,10 +11525,10 @@ var $AutoColumnSize = AutoColumnSize; 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(); + $__11.inProgress = false; + $__11.hot.view.wt.wtOverlays.adjustElementsSize(true); + if ($__11.hot.view.wt.wtOverlays.leftOverlay.needFullRender) { + $__11.hot.view.wt.wtOverlays.leftOverlay.clone.draw(); } } }); @@ -11430,21 +11620,21 @@ var $AutoColumnSize = AutoColumnSize; } }, onAfterLoadData: function() { - var $__10 = this; + var $__11 = this; if (this.hot.view) { this.recalculateAllColumnsWidth(); } else { setTimeout((function() { - if ($__10.hot) { - $__10.recalculateAllColumnsWidth(); + if ($__11.hot) { + $__11.recalculateAllColumnsWidth(); } }), 0); } }, onBeforeChange: function(changes) { - var $__10 = this; + var $__11 = this; arrayEach(changes, (function(data) { - return $__10.widths[$__10.hot.propToCol(data[1])] = void 0; + return $__11.widths[$__11.hot.propToCol(data[1])] = void 0; })); }, onBeforeColumnResize: function(col, size, isDblClick) { @@ -11470,7 +11660,7 @@ var $AutoColumnSize = AutoColumnSize; 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":100,"utils/samplesGenerator":101}],60:[function(require,module,exports){ +},{"3rdparty/walkontable/src/calculator/viewportColumns":3,"_base":59,"helpers/array":42,"helpers/dom/element":45,"helpers/feature":47,"helpers/number":50,"helpers/object":51,"helpers/string":53,"plugins":58,"utils/ghostTable":101,"utils/samplesGenerator":103}],61:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { AutoRowSize: {get: function() { @@ -11480,6 +11670,7 @@ Object.defineProperties(exports, { }); var $___46__46__47__95_base__, $___46__46__47__46__46__47_helpers_47_array__, + $___46__46__47__46__46__47_helpers_47_feature__, $___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__, @@ -11491,32 +11682,32 @@ var BasePlugin = ($___46__46__47__95_base__ = require("_base"), $___46__46__47__ 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__}), +var $__2 = ($___46__46__47__46__46__47_helpers_47_feature__ = require("helpers/feature"), $___46__46__47__46__46__47_helpers_47_feature__ && $___46__46__47__46__46__47_helpers_47_feature__.__esModule && $___46__46__47__46__46__47_helpers_47_feature__ || {default: $___46__46__47__46__46__47_helpers_47_feature__}), cancelAnimationFrame = $__2.cancelAnimationFrame, - requestAnimationFrame = $__2.requestAnimationFrame, - isVisible = $__2.isVisible; + requestAnimationFrame = $__2.requestAnimationFrame; +var isVisible = ($___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__}).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 $__5 = ($___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 = $__5.isObject, + objectEach = $__5.objectEach; +var $__6 = ($___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 = $__6.valueAccordingPercent, + rangeEach = $__6.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; + var $__10 = 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); + return $__10.hot.getDataAtCell(row, col); })); this.firstCalculation = true; this.inProgress = false; this.addHook('beforeRowResize', (function(row, size, isDblClick) { - return $__9.onBeforeRowResize(row, size, isDblClick); + return $__10.onBeforeRowResize(row, size, isDblClick); })); }; var $AutoRowSize = AutoRowSize; @@ -11525,7 +11716,7 @@ var $AutoRowSize = AutoRowSize; return this.hot.getSettings().autoRowSize === true || isObject(this.hot.getSettings().autoRowSize); }, enablePlugin: function() { - var $__9 = this; + var $__10 = this; if (this.enabled) { return; } @@ -11535,28 +11726,28 @@ var $AutoRowSize = AutoRowSize; this.samplesGenerator.customSampleCount = parseInt(samplingRatio, 10); } this.addHook('afterLoadData', (function() { - return $__9.onAfterLoadData(); + return $__10.onAfterLoadData(); })); this.addHook('beforeChange', (function(changes) { - return $__9.onBeforeChange(changes); + return $__10.onBeforeChange(changes); })); this.addHook('beforeColumnMove', (function() { - return $__9.recalculateAllRowsHeight(); + return $__10.recalculateAllRowsHeight(); })); this.addHook('beforeColumnResize', (function() { - return $__9.recalculateAllRowsHeight(); + return $__10.recalculateAllRowsHeight(); })); this.addHook('beforeColumnSort', (function() { - return $__9.clearCache(); + return $__10.clearCache(); })); this.addHook('beforeRender', (function(force) { - return $__9.onBeforeRender(force); + return $__10.onBeforeRender(force); })); this.addHook('beforeRowMove', (function(rowStart, rowEnd) { - return $__9.onBeforeRowMove(rowStart, rowEnd); + return $__10.onBeforeRowMove(rowStart, rowEnd); })); this.addHook('modifyRowHeight', (function(height, row) { - return $__9.getRowHeight(row, height); + return $__10.getRowHeight(row, height); })); $traceurRuntime.superGet(this, $AutoRowSize.prototype, "enablePlugin").call(this); }, @@ -11573,7 +11764,7 @@ var $AutoRowSize = AutoRowSize; to: this.hot.countCols() - 1 }; var force = arguments[2] !== (void 0) ? arguments[2] : false; - var $__9 = this; + var $__10 = this; if (typeof rowRange === 'number') { rowRange = { from: rowRange, @@ -11587,16 +11778,16 @@ var $AutoRowSize = AutoRowSize; }; } rangeEach(rowRange.from, rowRange.to, (function(row) { - if (force || $__9.heights[row] === void 0) { - var samples = $__9.samplesGenerator.generateRowSamples(row, colRange); + if (force || $__10.heights[row] === void 0) { + var samples = $__10.samplesGenerator.generateRowSamples(row, colRange); samples.forEach((function(sample, row) { - return $__9.ghostTable.addRow(row, sample); + return $__10.ghostTable.addRow(row, sample); })); } })); if (this.ghostTable.rows.length) { this.ghostTable.getHeights((function(row, height) { - return $__9.heights[row] = height; + return $__10.heights[row] = height; })); this.ghostTable.clean(); } @@ -11606,18 +11797,18 @@ var $AutoRowSize = AutoRowSize; from: 0, to: this.hot.countCols() - 1 }; - var $__9 = this; + var $__10 = this; var current = 0; var length = this.hot.countRows() - 1; var timer = null; this.inProgress = true; var loop = (function() { - if (!$__9.hot) { + if (!$__10.hot) { cancelAnimationFrame(timer); - $__9.inProgress = false; + $__10.inProgress = false; return; } - $__9.calculateRowsHeight({ + $__10.calculateRowsHeight({ from: current, to: Math.min(current + $AutoRowSize.CALCULATION_STEP, length) }, colRange); @@ -11626,10 +11817,10 @@ var $AutoRowSize = AutoRowSize; 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(); + $__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(); } } }); @@ -11698,7 +11889,7 @@ var $AutoRowSize = AutoRowSize; this.heights.length = 0; }, clearCacheByRange: function(range) { - var $__9 = this; + var $__10 = this; if (typeof range === 'number') { range = { from: range, @@ -11706,7 +11897,7 @@ var $AutoRowSize = AutoRowSize; }; } rangeEach(Math.min(range.from, range.to), Math.max(range.from, range.to), (function(row) { - return $__9.heights[row] = void 0; + return $__10.heights[row] = void 0; })); }, isNeedRecalculate: function() { @@ -11747,13 +11938,13 @@ var $AutoRowSize = AutoRowSize; return size; }, onAfterLoadData: function() { - var $__9 = this; + var $__10 = this; if (this.hot.view) { this.recalculateAllRowsHeight(); } else { setTimeout((function() { - if ($__9.hot) { - $__9.recalculateAllRowsHeight(); + if ($__10.hot) { + $__10.recalculateAllRowsHeight(); } }), 0); } @@ -11788,7 +11979,7 @@ var $AutoRowSize = AutoRowSize; 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":100,"utils/samplesGenerator":101}],61:[function(require,module,exports){ +},{"_base":59,"helpers/array":42,"helpers/dom/element":45,"helpers/feature":47,"helpers/number":50,"helpers/object":51,"helpers/string":53,"plugins":58,"utils/ghostTable":101,"utils/samplesGenerator":103}],62:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { Autofill: {get: function() { @@ -12064,7 +12255,7 @@ function settingsFactory(settings) { Handsontable.Autofill = Autofill; //# -},{"3rdparty/walkontable/src/cell/coords":5,"eventManager":41,"helpers/dom/element":45,"plugins":57}],62:[function(require,module,exports){ +},{"3rdparty/walkontable/src/cell/coords":5,"eventManager":41,"helpers/dom/element":45,"plugins":58}],63:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { ColumnSorting: {get: function() { @@ -12323,6 +12514,27 @@ var $ColumnSorting = ColumnSorting; return 0; }; }, + numericSort: function(sortOrder) { + return function(a, b) { + var parsedA = parseFloat(a[1]); + var parsedB = parseFloat(b[1]); + if (parsedA === parsedB || (isNaN(parsedA) && isNaN(parsedB))) { + return 0; + } + if (isNaN(parsedA)) { + return 1; + } + if (isNaN(parsedB)) { + return -1; + } + if (parsedA < parsedB) { + return sortOrder ? -1 : 1; + } else if (parsedA > parsedB) { + return sortOrder ? 1 : -1; + } + return 0; + }; + }, sort: function() { if (typeof this.hot.sortOrder == 'undefined') { this.hot.sortIndex.length = 0; @@ -12337,12 +12549,19 @@ var $ColumnSorting = ColumnSorting; this.hot.sortIndex.push([i, this.hot.getDataAtCell(i, this.hot.sortColumn)]); } colMeta = this.hot.getCellMeta(0, this.hot.sortColumn); - switch (colMeta.type) { - case 'date': - sortFunction = this.dateSort; - break; - default: - sortFunction = this.defaultSort; + if (colMeta.sortFunction) { + sortFunction = colMeta.sortFunction; + } else { + switch (colMeta.type) { + case 'date': + sortFunction = this.dateSort; + break; + case 'numeric': + sortFunction = this.numericSort; + 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++) { @@ -12443,7 +12662,7 @@ var $ColumnSorting = ColumnSorting; registerPlugin('columnSorting', ColumnSorting); //# -},{"_base":58,"eventManager":41,"helpers/array":42,"helpers/dom/element":45,"plugins":57}],63:[function(require,module,exports){ +},{"_base":59,"eventManager":41,"helpers/array":42,"helpers/dom/element":45,"plugins":58}],64:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { CommentEditor: {get: function() { @@ -12531,7 +12750,7 @@ var $CommentEditor = CommentEditor; ; //# -},{"helpers/dom/element":45}],64:[function(require,module,exports){ +},{"helpers/dom/element":45}],65:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { Comments: {get: function() { @@ -12826,7 +13045,7 @@ var $Comments = Comments; 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){ +},{"3rdparty/walkontable/src/cell/coords":5,"_base":59,"commentEditor":64,"eventManager":41,"helpers/dom/element":45,"plugins":58}],66:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { CommandExecutor: {get: function() { @@ -12899,7 +13118,7 @@ function findSubCommand(subCommandName, subCommands) { ; //# -},{"helpers/array":42}],66:[function(require,module,exports){ +},{"helpers/array":42}],67:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { ContextMenu: {get: function() { @@ -13093,7 +13312,7 @@ 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){ +},{"_base":59,"commandExecutor":66,"eventManager":41,"helpers/array":42,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/object":51,"itemsFactory":69,"menu":70,"plugins":58,"predefinedItems":71}],68:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { Cursor: {get: function() { @@ -13173,7 +13392,7 @@ Handsontable.plugins.utils = Handsontable.plugins.utils || {}; Handsontable.plugins.utils.Cursor = Cursor; //# -},{"helpers/dom/element":45,"helpers/dom/event":46}],68:[function(require,module,exports){ +},{"helpers/dom/element":45,"helpers/dom/event":46}],69:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { ItemsFactory: {get: function() { @@ -13292,7 +13511,7 @@ function getItems() { ; //# -},{"helpers/array":42,"helpers/object":50,"predefinedItems":70}],69:[function(require,module,exports){ +},{"helpers/array":42,"helpers/object":51,"predefinedItems":71}],70:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { Menu: {get: function() { @@ -13414,6 +13633,7 @@ var $Menu = Menu; }], renderAllRows: true, fragmentSelection: 'cell', + disableVisualSelection: 'area', beforeKeyDown: (function(event) { return $__11.onBeforeKeyDown(event); }), @@ -13455,7 +13675,7 @@ var $Menu = Menu; }, openSubMenu: function(row) { if (!this.hotMenu) { - return; + return false; } var cell = this.hotMenu.getCell(row, 0); this.closeAllSubMenus(); @@ -13802,7 +14022,7 @@ 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){ +},{"cursor":68,"eventManager":41,"helpers/array":42,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/function":48,"helpers/object":51,"helpers/unicode":54,"mixins/localHooks":55,"predefinedItems":71,"utils":72}],71:[function(require,module,exports){ "use strict"; var $__4; Object.defineProperties(exports, { @@ -13959,7 +14179,8 @@ var _predefinedItems = ($__4 = {}, Object.defineProperty($__4, SEPARATOR, { } 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; + var onlyOneColumn = this.countCols() == 1; + return selected[1] < 0 || this.countCols() >= this.getSettings().maxCols || (!onlyOneColumn && rowSelected); }, hidden: function() { return !this.getSettings().allowInsertColumn; @@ -13985,7 +14206,8 @@ var _predefinedItems = ($__4 = {}, Object.defineProperty($__4, SEPARATOR, { } 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; + var onlyOneColumn = this.countCols() == 1; + return selected[1] < 0 || this.countCols() >= this.getSettings().maxCols || (!onlyOneColumn && rowSelected); }, hidden: function() { return !this.getSettings().allowInsertColumn; @@ -14359,7 +14581,7 @@ var _predefinedItems = ($__4 = {}, Object.defineProperty($__4, SEPARATOR, { }), $__4); //# -},{"helpers/number":49,"helpers/object":50,"utils":71}],71:[function(require,module,exports){ +},{"helpers/number":50,"helpers/object":51,"utils":72}],72:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { normalizeSelection: {get: function() { @@ -14498,7 +14720,7 @@ function markLabelAsSelected(label) { } //# -},{"helpers/dom/element":45}],72:[function(require,module,exports){ +},{"helpers/dom/element":45}],73:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { ContextMenuCopyPaste: {get: function() { @@ -14630,7 +14852,7 @@ var $ContextMenuCopyPaste = ContextMenuCopyPaste; registerPlugin('contextMenuCopyPaste', ContextMenuCopyPaste); //# -},{"_base":58,"eventManager":41,"helpers/array":42,"helpers/dom/element":45,"plugins":57,"zeroclipboard":"zeroclipboard"}],73:[function(require,module,exports){ +},{"_base":59,"eventManager":41,"helpers/array":42,"helpers/dom/element":45,"plugins":58,"zeroclipboard":"zeroclipboard"}],74:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { CopyPastePlugin: {get: function() { @@ -14833,7 +15055,7 @@ 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){ +},{"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":48,"helpers/number":50,"helpers/unicode":54,"plugins":58}],75:[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__, @@ -15170,7 +15392,7 @@ Handsontable.hooks.add('afterInit', function() { Handsontable.CustomBorders = CustomBorders; //# -},{"3rdparty/walkontable/src/cell/range":6,"3rdparty/walkontable/src/selection":18,"plugins":57}],75:[function(require,module,exports){ +},{"3rdparty/walkontable/src/cell/range":6,"3rdparty/walkontable/src/selection":18,"plugins":58}],76:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { DragToScroll: {get: function() { @@ -15258,7 +15480,7 @@ Handsontable.hooks.add('afterOnCellCornerMouseDown', function() { Handsontable.plugins.DragToScroll = DragToScroll; //# -},{"eventManager":41,"plugins":57}],76:[function(require,module,exports){ +},{"eventManager":41,"plugins":58}],77:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { ManualColumnFreeze: {get: function() { @@ -15272,6 +15494,8 @@ var BasePlugin = ($___46__46__47__95_base__ = require("_base"), $___46__46__47__ 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); + this.manualColumnMovePlugin = null; + this.frozenColumnsBasePositions = []; }; var $ManualColumnFreeze = ManualColumnFreeze; ($traceurRuntime.createClass)(ManualColumnFreeze, { @@ -15291,26 +15515,21 @@ var $ManualColumnFreeze = ManualColumnFreeze; })); $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; }, + getManualColumnMovePlugin: function() { + if (!this.manualColumnMovePlugin) { + this.manualColumnMovePlugin = this.hot.getPlugin('manualColumnMove'); + } + return this.manualColumnMovePlugin; + }, onModifyCol: function(column) { - if (this.hot.manualColumnPositionsPluginUsages.length > 1) { + if (this.getManualColumnMovePlugin().isEnabled()) { return column; } - return this.getModifiedColumnIndex(column); - }, - getModifiedColumnIndex: function(column) { - return this.hot.manualColumnPositions[column]; + return this.getLogicalColumnIndex(column); }, addContextMenuEntry: function(defaultOptions) { var _this = this; @@ -15342,9 +15561,10 @@ var $ManualColumnFreeze = ManualColumnFreeze; if (column <= this.fixedColumnsCount - 1) { return; } - var modifiedColumn = this.getModifiedColumnIndex(column) || column; - this.checkPositionData(modifiedColumn); - this.modifyColumnOrder(modifiedColumn, column, null, 'freeze'); + if (column !== this.getLogicalColumnIndex(column)) { + this.frozenColumnsBasePositions[this.fixedColumnsCount] = column; + } + this.changeColumnPositions(column, this.fixedColumnsCount); this.addFixedColumn(); this.hot.view.wt.wtOverlays.leftOverlay.refresh(); this.hot.view.wt.wtOverlays.adjustElementsSize(); @@ -15354,9 +15574,7 @@ var $ManualColumnFreeze = ManualColumnFreeze; return; } var returnCol = this.getBestColumnReturnPosition(column); - var modifiedColumn = this.getModifiedColumnIndex(column) || column; - this.checkPositionData(modifiedColumn); - this.modifyColumnOrder(modifiedColumn, column, returnCol, 'unfreeze'); + this.changeColumnPositions(column, returnCol); this.removeFixedColumn(); this.hot.view.wt.wtOverlays.leftOverlay.refresh(); this.hot.view.wt.wtOverlays.adjustElementsSize(); @@ -15369,53 +15587,42 @@ var $ManualColumnFreeze = ManualColumnFreeze; 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); + getBestColumnReturnPosition: function(column) { + var i = this.fixedColumnsCount; + var j = this.getLogicalColumnIndex(i); + var initialCol; + if (this.frozenColumnsBasePositions[column] == null) { + initialCol = this.getLogicalColumnIndex(column); + while (j < initialCol) { + i++; + j = this.getLogicalColumnIndex(i); } } 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; + initialCol = this.frozenColumnsBasePositions[column]; + this.frozenColumnsBasePositions[column] = void 0; + while (j <= initialCol) { + i++; + j = this.getLogicalColumnIndex(i); } + i = j; } + return i - 1; }, - 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]); - } + getVisibleColumnIndex: function(column) { + return this.getManualColumnMovePlugin().getVisibleColumnIndex(column); }, - 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; + getLogicalColumnIndex: function(column) { + return this.getManualColumnMovePlugin().getLogicalColumnIndex(column); + }, + changeColumnPositions: function(sourceColumn, destinationColumn) { + this.getManualColumnMovePlugin().changeColumnPositions(sourceColumn, destinationColumn); } }, {}, BasePlugin); ; registerPlugin('manualColumnFreeze', ManualColumnFreeze); //# -},{"_base":58,"plugins":57}],77:[function(require,module,exports){ +},{"_base":59,"plugins":58}],78:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { ManualColumnMove: {get: function() { @@ -15423,267 +15630,336 @@ Object.defineProperties(exports, { }}, __esModule: {value: true} }); -var $___46__46__47__46__46__47_helpers_47_dom_47_element__, +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_helpers_47_array__, + $___46__46__47__46__46__47_helpers_47_number__, $___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 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 $__2 = ($___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 = $__2.arrayEach, + arrayMap = $__2.arrayMap; +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 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 $__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__}), + pageX = $__5.pageX, + pageY = $__5.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 privatePool = new WeakMap(); +var ManualColumnMove = function ManualColumnMove(hotInstance) { + var $__7 = this; + $traceurRuntime.superConstructor($ManualColumnMove).call(this, hotInstance); + privatePool.set(this, { + guideClassName: 'manualColumnMoverGuide', + handleClassName: 'manualColumnMover', + startOffset: null, + pressed: null, + startCol: null, + endCol: null, + currentCol: null, + startX: null, + startY: null + }); + this.guideElement = null; + this.handleElement = null; + this.currentTH = null; + this.columnPositions = []; + this.eventManager = eventManagerObject(this); + this.addHook('init', (function() { + return $__7.onInit(); + })); +}; +var $ManualColumnMove = ManualColumnMove; +($traceurRuntime.createClass)(ManualColumnMove, { + isEnabled: function() { + return !!this.hot.getSettings().manualColumnMove; + }, + enablePlugin: function() { + var $__7 = this; + var priv = privatePool.get(this); + var initialSettings = this.hot.getSettings().manualColumnMove; + var loadedManualColumnPositions = this.loadManualColumnPositions(); + this.handleElement = document.createElement('DIV'); + this.handleElement.className = priv.handleClassName; + this.guideElement = document.createElement('DIV'); + this.guideElement.className = priv.guideClassName; + this.addHook('modifyCol', (function(col) { + return $__7.onModifyCol(col); + })); + this.addHook('unmodifyCol', (function(col) { + return $__7.onUnmodifyCol(col); + })); + this.addHook('afterRemoveCol', (function(index, amount) { + return $__7.onAfterRemoveCol(index, amount); + })); + this.addHook('afterCreateCol', (function(index, amount) { + return $__7.onAfterCreateCol(index, amount); + })); + this.registerEvents(); + if (typeof loadedManualColumnPositions != 'undefined') { + this.columnPositions = loadedManualColumnPositions; + } else if (Array.isArray(initialSettings)) { + this.columnPositions = initialSettings; + } else if (!initialSettings || this.columnPositions === void 0) { + this.columnPositions = []; + } + $traceurRuntime.superGet(this, $ManualColumnMove.prototype, "enablePlugin").call(this); + }, + updatePlugin: function() { + this.disablePlugin(); + this.enablePlugin(); + $traceurRuntime.superGet(this, $ManualColumnMove.prototype, "updatePlugin").call(this); + }, + disablePlugin: function() { + var pluginSetting = this.hot.getSettings().manualColumnMove; + if (Array.isArray(pluginSetting)) { + this.unregisterEvents(); + this.columnPositions = []; + } + $traceurRuntime.superGet(this, $ManualColumnMove.prototype, "disablePlugin").call(this); + }, + registerEvents: function() { + var $__7 = this; + this.eventManager.addEventListener(this.hot.rootElement, 'mouseover', (function(event) { + return $__7.onMouseOver(event); + })); + this.eventManager.addEventListener(this.hot.rootElement, 'mousedown', (function(event) { + return $__7.onMouseDown(event); + })); + this.eventManager.addEventListener(window, 'mousemove', (function(event) { + return $__7.onMouseMove(event); + })); + this.eventManager.addEventListener(window, 'mouseup', (function(event) { + return $__7.onMouseUp(event); + })); + }, + unregisterEvents: function() { + this.eventManager.clear(); + }, + saveManualColumnPositions: function() { + Handsontable.hooks.run(this.hot, 'persistentStateSave', 'manualColumnPositions', this.columnPositions); + }, + loadManualColumnPositions: function() { var storedState = {}; - Handsontable.hooks.run(instance, 'persistentStateLoad', 'manualColumnPositions', storedState); + Handsontable.hooks.run(this.hot, 'persistentStateLoad', 'manualColumnPositions', storedState); return storedState.value; - }; - function setupHandlePosition(TH) { - instance = this; - currentTH = TH; - var col = this.view.wt.wtTable.getCoords(TH).col; + }, + completeSettingsArray: function() { + var $__7 = this; + var columnCount = this.hot.countCols(); + if (this.columnPositions.length === columnCount) { + return; + } + rangeEach(0, columnCount - 1, (function(i) { + if ($__7.columnPositions.indexOf(i) === -1) { + $__7.columnPositions.push(i); + } + })); + }, + setupHandlePosition: function(TH) { + var priv = privatePool.get(this); + var col = this.hot.view.wt.wtTable.getCoords(TH).col; + this.currentTH = TH; 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); + var box = this.currentTH.getBoundingClientRect(); + priv.currentCol = col; + priv.startOffset = box.left; + this.handleElement.style.top = box.top + 'px'; + this.handleElement.style.left = priv.startOffset + 'px'; + this.hot.rootElement.appendChild(this.handleElement); } - } - function refreshHandlePosition(TH, delta) { + }, + refreshHandlePosition: function(TH, delta) { var box = TH.getBoundingClientRect(); var handleWidth = 6; if (delta > 0) { - handle.style.left = (box.left + box.width - handleWidth) + 'px'; + this.handleElement.style.left = (box.left + box.width - handleWidth) + 'px'; } else { - handle.style.left = box.left + 'px'; + this.handleElement.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) { + }, + setupGuidePosition: function() { + var box = this.currentTH.getBoundingClientRect(); + var priv = privatePool.get(this); + addClass(this.handleElement, 'active'); + addClass(this.guideElement, 'active'); + this.guideElement.style.width = box.width + 'px'; + this.guideElement.style.height = this.hot.view.maximumVisibleElementHeight(0) + 'px'; + this.guideElement.style.top = this.handleElement.style.top; + this.guideElement.style.left = priv.startOffset + 'px'; + this.hot.rootElement.appendChild(this.guideElement); + }, + refreshGuidePosition: function(diff) { + var priv = privatePool.get(this); + this.guideElement.style.left = priv.startOffset + diff + 'px'; + }, + hideHandleAndGuide: function() { + removeClass(this.handleElement, 'active'); + removeClass(this.guideElement, 'active'); + }, + checkColumnHeader: function(element) { + if (element != this.hot.rootElement) { var parent = element.parentNode; if (parent.tagName === 'THEAD') { return true; } - return checkColumnHeader.call(this, parent); + return this.checkColumnHeader(parent); } return false; - }; - var getTHFromTargetElement = function(element) { + }, + createPositionData: function(len) { + var positionArr = this.columnPositions; + if (positionArr.length < len) { + rangeEach(positionArr.length, len - 1, (function(i) { + positionArr[i] = i; + })); + } + }, + getTHFromTargetElement: function(element) { if (element.tagName != 'TABLE') { if (element.tagName == 'TH') { return element; } else { - return getTHFromTargetElement(element.parentNode); + return this.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; - } + }, + changeColumnPositions: function(columnIndex, destinationIndex) { + var maxLength = Math.max(columnIndex, destinationIndex); + if (maxLength > this.columnPositions.length - 1) { + this.createPositionData(maxLength + 1); } - }; - 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']; + this.columnPositions.splice(destinationIndex, 0, this.columnPositions.splice(columnIndex, 1)[0]); + }, + getVisibleColumnIndex: function(column) { + if (column > this.columnPositions.length - 1) { + this.createPositionData(column); + } + return this.columnPositions.indexOf(column); + }, + getLogicalColumnIndex: function(column) { + return this.columnPositions[column]; + }, + onMouseOver: function(event) { + var priv = privatePool.get(this); + if (this.checkColumnHeader(event.target)) { + var th = this.getTHFromTargetElement(event.target); + if (th) { + if (priv.pressed) { + var col = this.hot.view.wt.wtTable.getCoords(th).col; + if (col >= 0) { + priv.endCol = col; + this.refreshHandlePosition(th, priv.endCol - priv.startCol); + } } else { - instance.manualColumnPositionsPluginUsages.push('manualColumnMove'); - } - unbindEvents.call(this); - bindEvents.call(this); - if (this.manualColumnPositions && this.manualColumnPositions.length > 0) { - this.forceFullRender = true; - this.render(); + this.setupHandlePosition(th); } } - } 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]; + }, + onMouseDown: function(event) { + var priv = privatePool.get(this); + if (hasClass(event.target, priv.handleClassName)) { + priv.startX = pageX(event); + this.setupGuidePosition(); + priv.pressed = this.hot; + priv.startCol = priv.currentCol; + priv.endCol = priv.currentCol; } - return col; - }; - this.afterRemoveCol = function(index, amount) { - if (!this.getSettings().manualColumnMove) { + }, + onMouseMove: function(event) { + var priv = privatePool.get(this); + if (priv.pressed) { + this.refreshGuidePosition(pageX(event) - priv.startX); + } + }, + onMouseUp: function(event) { + var priv = privatePool.get(this); + if (priv.pressed) { + this.hideHandleAndGuide(); + priv.pressed = false; + this.createPositionData(this.hot.countCols()); + this.changeColumnPositions(priv.startCol, priv.endCol); + Handsontable.hooks.run(this.hot, 'beforeColumnMove', priv.startCol, priv.endCol); + this.hot.forceFullRender = true; + this.hot.view.render(); + this.saveManualColumnPositions(); + Handsontable.hooks.run(this.hot, 'afterColumnMove', priv.startCol, priv.endCol); + this.setupHandlePosition(this.currentTH); + } + }, + onModifyCol: function(col) { + if (typeof this.getVisibleColumnIndex(col) == -1) { + this.createPositionData(col + 1); + } + return this.getLogicalColumnIndex(col); + }, + onUnmodifyCol: function(col) { + if (typeof this.getVisibleColumnIndex(col) == -1) { + this.createPositionData(col + 1); + } + return this.getVisibleColumnIndex(col); + }, + onAfterRemoveCol: function(index, amount) { + if (!this.isEnabled()) { return; } - var rmindx, - colpos = this.manualColumnPositions; + var rmindx; + var colpos = this.columnPositions; rmindx = colpos.splice(index, amount); - colpos = colpos.map(function(colpos) { + colpos = arrayMap(colpos, function(value, index) { var i, - newpos = colpos; - for (i = 0; i < rmindx.length; i++) { - if (colpos > rmindx[i]) { + newpos = value; + arrayEach(rmindx, (function(elem, index) { + if (value > elem) { newpos--; } - } + })); return newpos; }); - this.manualColumnPositions = colpos; - }; - this.afterCreateCol = function(index, amount) { - if (!this.getSettings().manualColumnMove) { + this.columnPositions = colpos; + }, + onAfterCreateCol: function(index, amount) { + if (!this.isEnabled()) { return; } - var colpos = this.manualColumnPositions; + var colpos = this.columnPositions; if (!colpos.length) { return; } var addindx = []; - for (var i = 0; i < amount; i++) { + rangeEach(0, amount - 1, (function(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 = arrayMap(colpos, function(value, ind) { + return (value >= index) ? (value + amount) : value; }); 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); + this.columnPositions = colpos; + }, + onInit: function() { + this.completeSettingsArray(); + } +}, {}, BasePlugin); +; +registerPlugin('manualColumnMove', ManualColumnMove); Handsontable.hooks.register('beforeColumnMove'); Handsontable.hooks.register('afterColumnMove'); +Handsontable.hooks.register('unmodifyCol'); //# -},{"eventManager":41,"helpers/dom/element":45,"helpers/dom/event":46,"plugins":57}],78:[function(require,module,exports){ +},{"_base.js":59,"eventManager":41,"helpers/array":42,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/number":50,"plugins":58}],79:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { ManualColumnResize: {get: function() { @@ -15944,7 +16220,7 @@ var $ManualColumnResize = ManualColumnResize; registerPlugin('manualColumnResize', ManualColumnResize); //# -},{"_base.js":58,"eventManager":41,"helpers/dom/element":45,"helpers/dom/event":46,"plugins":57}],79:[function(require,module,exports){ +},{"_base.js":59,"eventManager":41,"helpers/dom/element":45,"helpers/dom/event":46,"plugins":58}],80:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { ManualRowMove: {get: function() { @@ -15952,221 +16228,321 @@ Object.defineProperties(exports, { }}, __esModule: {value: true} }); -var $___46__46__47__46__46__47_helpers_47_dom_47_element__, +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_helpers_47_array__, + $___46__46__47__46__46__47_helpers_47_number__, $___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 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 $__2 = ($___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 = $__2.arrayEach, + arrayMap = $__2.arrayMap; +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 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 $__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__}), + pageX = $__5.pageX, + pageY = $__5.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); +var privatePool = new WeakMap(); +var ManualRowMove = function ManualRowMove(hotInstance) { + $traceurRuntime.superConstructor($ManualRowMove).call(this, hotInstance); + privatePool.set(this, { + guideClassName: 'manualRowMoverGuide', + handleClassName: 'manualRowMover', + startOffset: null, + pressed: null, + startRow: null, + endRow: null, + currentRow: null, + startX: null, + startY: null + }); + this.guideElement = null; + this.handleElement = null; + this.currentTH = null; + this.rowPositions = []; + this.eventManager = eventManagerObject(this); +}; +var $ManualRowMove = ManualRowMove; +($traceurRuntime.createClass)(ManualRowMove, { + isEnabled: function() { + return !!this.hot.getSettings().manualRowMove; + }, + enablePlugin: function() { + var $__7 = this; + var priv = privatePool.get(this); + var initialSettings = this.hot.getSettings().manualRowMove; + var loadedManualRowPositions = this.loadManualRowPositions(); + this.handleElement = document.createElement('DIV'); + this.handleElement.className = priv.handleClassName; + this.guideElement = document.createElement('DIV'); + this.guideElement.className = priv.guideClassName; + this.addHook('modifyRow', (function(row) { + return $__7.onModifyRow(row); + })); + this.addHook('afterRemoveRow', (function(index, amount) { + return $__7.onAfterRemoveRow(index, amount); + })); + this.addHook('afterCreateRow', (function(index, amount) { + return $__7.onAfterCreateRow(index, amount); + })); + this.addHook('init', (function() { + return $__7.onInit(); + })); + this.registerEvents(); + if (typeof loadedManualRowPositions != 'undefined') { + this.rowPositions = loadedManualRowPositions; + } else if (Array.isArray(initialSettings)) { + this.rowPositions = initialSettings; + } else if (!initialSettings || this.rowPositions === void 0) { + this.rowPositions = []; + } + $traceurRuntime.superGet(this, $ManualRowMove.prototype, "enablePlugin").call(this); + }, + updatePlugin: function() { + this.disablePlugin(); + this.enablePlugin(); + $traceurRuntime.superGet(this, $ManualRowMove.prototype, "updatePlugin").call(this); + }, + disablePlugin: function() { + var pluginSetting = this.hot.getSettings().manualRowMove; + if (Array.isArray(pluginSetting)) { + this.unregisterEvents(); + this.rowPositions = []; + } + $traceurRuntime.superGet(this, $ManualRowMove.prototype, "disablePlugin").call(this); + }, + registerEvents: function() { + var $__7 = this; + this.eventManager.addEventListener(this.hot.rootElement, 'mouseover', (function(event) { + return $__7.onMouseOver(event); + })); + this.eventManager.addEventListener(this.hot.rootElement, 'mousedown', (function(event) { + return $__7.onMouseDown(event); + })); + this.eventManager.addEventListener(window, 'mousemove', (function(event) { + return $__7.onMouseMove(event); + })); + this.eventManager.addEventListener(window, 'mouseup', (function(event) { + return $__7.onMouseUp(event); + })); + }, + unregisterEvents: function() { + this.eventManager.clear(); + }, + saveManualRowPositions: function() { + Handsontable.hooks.run(this.hot, 'persistentStateSave', 'manualRowPositions', this.rowPositions); + }, + loadManualRowPositions: function() { + var storedState = {}; + Handsontable.hooks.run(this.hot, 'persistentStateLoad', 'manualRowPositions', storedState); return storedState.value; - }; - function setupHandlePosition(TH) { - var instance = this; - currentTH = TH; - var row = this.view.wt.wtTable.getCoords(TH).row; + }, + completeSettingsArray: function() { + var $__7 = this; + var rowCount = this.hot.countRows(); + if (this.rowPositions.length === rowCount) { + return; + } + rangeEach(0, rowCount - 1, (function(i) { + if ($__7.rowPositions.indexOf(i) === -1) { + $__7.rowPositions.push(i); + } + })); + }, + setupHandlePosition: function(TH) { + var priv = privatePool.get(this); + var row = this.hot.view.wt.wtTable.getCoords(TH).row; + this.currentTH = TH; 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); + var box = this.currentTH.getBoundingClientRect(); + priv.currentRow = row; + priv.startOffset = box.top; + this.handleElement.style.top = priv.startOffset + 'px'; + this.handleElement.style.left = box.left + 'px'; + this.hot.rootElement.appendChild(this.handleElement); } - } - function refreshHandlePosition(TH, delta) { + }, + refreshHandlePosition: function(TH, delta) { var box = TH.getBoundingClientRect(); var handleHeight = 6; if (delta > 0) { - handle.style.top = (box.top + box.height - handleHeight) + 'px'; + this.handleElement.style.top = (box.top + box.height - handleHeight) + 'px'; } else { - handle.style.top = box.top + 'px'; + this.handleElement.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) { + }, + setupGuidePosition: function() { + var box = this.currentTH.getBoundingClientRect(); + var priv = privatePool.get(this); + addClass(this.handleElement, 'active'); + addClass(this.guideElement, 'active'); + this.guideElement.style.height = box.height + 'px'; + this.guideElement.style.width = this.hot.view.maximumVisibleElementWidth(0) + 'px'; + this.guideElement.style.top = priv.startOffset + 'px'; + this.guideElement.style.left = this.handleElement.style.left; + this.hot.rootElement.appendChild(this.guideElement); + }, + refreshGuidePosition: function(diff) { + var priv = privatePool.get(this); + this.guideElement.style.top = priv.startOffset + diff + 'px'; + }, + hideHandleAndGuide: function() { + removeClass(this.handleElement, 'active'); + removeClass(this.guideElement, 'active'); + }, + checkRowHeader: function(element) { + if (element != this.hot.rootElement) { var parent = element.parentNode; - if (parent.tagName == 'TBODY') { + if (parent.tagName === 'TBODY') { return true; } - return checkRowHeader.call(this, parent); + return this.checkRowHeader(parent); } return false; - }; - var getTHFromTargetElement = function(element) { + }, + createPositionData: function(len) { + var positionArr = this.rowPositions; + if (positionArr.length < len) { + rangeEach(positionArr.length, len - 1, (function(i) { + positionArr[i] = i; + })); + } + }, + getTHFromTargetElement: function(element) { if (element.tagName != 'TABLE') { if (element.tagName == 'TH') { return element; } else { - return getTHFromTargetElement(element.parentNode); + return this.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); - } + }, + changeRowPositions: function(rowIndex, destinationIndex) { + var maxLength = Math.max(rowIndex, destinationIndex); + if (maxLength > this.rowPositions.length - 1) { + this.createPositionData(maxLength + 1); + } + this.rowPositions.splice(destinationIndex, 0, this.rowPositions.splice(rowIndex, 1)[0]); + }, + getVisibleRowIndex: function(row) { + if (row > this.rowPositions.length - 1) { + this.createPositionData(row); + } + return this.rowPositions.indexOf(row); + }, + getLogicalRowIndex: function(row) { + return this.rowPositions[row]; + }, + onMouseOver: function(event) { + var priv = privatePool.get(this); + if (this.checkRowHeader(event.target)) { + var th = this.getTHFromTargetElement(event.target); + if (th) { + if (priv.pressed) { + priv.endRow = this.hot.view.wt.wtTable.getCoords(th).row; + this.refreshHandlePosition(th, priv.endRow - priv.startRow); + } else { + this.setupHandlePosition(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(); + }, + onMouseDown: function(event) { + var priv = privatePool.get(this); + if (hasClass(event.target, priv.handleClassName)) { + priv.startY = pageY(event); + this.setupGuidePosition(); + priv.pressed = this.hot; + priv.startRow = priv.currentRow; + priv.endRow = priv.currentRow; + } + }, + onMouseMove: function(event) { + var priv = privatePool.get(this); + if (priv.pressed) { + this.refreshGuidePosition(pageY(event) - priv.startY); + } + }, + onMouseUp: function(event) { + var priv = privatePool.get(this); + if (priv.pressed) { + this.hideHandleAndGuide(); + priv.pressed = false; + this.createPositionData(this.hot.countRows()); + this.changeRowPositions(priv.startRow, priv.endRow); + Handsontable.hooks.run(this.hot, 'beforeRowMove', priv.startRow, priv.endRow); + this.hot.forceFullRender = true; + this.hot.view.render(); + this.saveManualRowPositions(); + Handsontable.hooks.run(this.hot, 'afterRowMove', priv.startRow, priv.endRow); + this.setupHandlePosition(this.currentTH); + } + }, + onModifyRow: function(row) { + if (typeof this.getVisibleRowIndex(row) === 'undefined') { + this.createPositionData(row + 1); + } + return this.getLogicalRowIndex(row); + }, + onAfterRemoveRow: function(index, amount) { + if (!this.isEnabled()) { + return; + } + var rmindx; + var rowpos = this.rowPositions; + rmindx = rowpos.splice(index, amount); + rowpos = arrayMap(rowpos, function(value, index) { + var newpos = value; + arrayEach(rmindx, (function(elem, index) { + if (value > elem) { + newpos--; } - } - } else { - var pluginUsagesIndex = instance.manualRowPositionsPluginUsages ? instance.manualRowPositionsPluginUsages.indexOf('manualColumnMove') : -1; - if (pluginUsagesIndex > -1) { - unbindEvents.call(this); - instance.manualRowPositions = []; - instance.manualRowPositionsPluginUsages[pluginUsagesIndex] = void 0; - } + })); + return newpos; + }); + this.rowPositions = rowpos; + }, + onAfterCreateRow: function(index, amount) { + if (!this.isEnabled()) { + return; } - }; - 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]; + var rowpos = this.rowPositions; + if (!rowpos.length) { + return; } - 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); + var addindx = []; + for (var i = 0; i < amount; i++) { + addindx.push(index + i); + } + if (index >= rowpos.length) { + rowpos.concat(addindx); + } else { + rowpos = arrayMap(rowpos, function(value, ind) { + return (value >= index) ? (value + amount) : value; + }); + rowpos.splice.apply(rowpos, [index, 0].concat(addindx)); + } + this.rowPositions = rowpos; + }, + onInit: function() { + this.completeSettingsArray(); + } +}, {}, BasePlugin); +; +registerPlugin('ManualRowMove', ManualRowMove); 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){ +},{"_base.js":59,"eventManager":41,"helpers/array":42,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/number":50,"plugins":58}],81:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { ManualRowResize: {get: function() { @@ -16407,7 +16783,7 @@ var $ManualRowResize = ManualRowResize; registerPlugin('manualRowResize', ManualRowResize); //# -},{"_base.js":58,"eventManager":41,"helpers/dom/element":45,"helpers/dom/event":46,"plugins":57}],81:[function(require,module,exports){ +},{"_base.js":59,"eventManager":41,"helpers/dom/element":45,"helpers/dom/event":46,"plugins":58}],82:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { MergeCells: {get: function() { @@ -16945,7 +17321,7 @@ 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){ +},{"3rdparty/walkontable/src/cell/coords":5,"3rdparty/walkontable/src/cell/range":6,"3rdparty/walkontable/src/table":20,"helpers/dom/event":46,"plugins":58}],83:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { MultipleSelectionHandles: {get: function() { @@ -17232,7 +17608,7 @@ var $MultipleSelectionHandles = MultipleSelectionHandles; registerPlugin('multipleSelectionHandles', MultipleSelectionHandles); //# -},{"_base":58,"eventManager":41,"helpers/dom/element":45,"plugins":57}],83:[function(require,module,exports){ +},{"_base":59,"eventManager":41,"helpers/dom/element":45,"plugins":58}],84:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { DataObserver: {get: function() { @@ -17287,7 +17663,7 @@ mixin(DataObserver, localHooks); ; //# -},{"../../helpers/object":50,"../../mixins/localHooks":54,"jsonpatch":"jsonpatch","utils":85}],84:[function(require,module,exports){ +},{"../../helpers/object":51,"../../mixins/localHooks":55,"jsonpatch":"jsonpatch","utils":86}],85:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { ObserveChanges: {get: function() { @@ -17431,7 +17807,7 @@ var $ObserveChanges = ObserveChanges; registerPlugin('observeChanges', ObserveChanges); //# -},{"_base":58,"dataObserver":83,"helpers/array":42,"jsonpatch":"jsonpatch","plugins":57}],85:[function(require,module,exports){ +},{"_base":59,"dataObserver":84,"helpers/array":42,"jsonpatch":"jsonpatch","plugins":58}],86:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { cleanPatches: {get: function() { @@ -17490,7 +17866,7 @@ function parsePath(path) { } //# -},{"../../helpers/array":42}],86:[function(require,module,exports){ +},{"../../helpers/array":42}],87:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { HandsontablePersistentState: {get: function() { @@ -17602,7 +17978,7 @@ Handsontable.hooks.add('beforeInit', htPersistentState.init); Handsontable.hooks.add('afterUpdateSettings', htPersistentState.init); //# -},{"plugins":57}],87:[function(require,module,exports){ +},{"plugins":58}],88:[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__; @@ -17710,7 +18086,7 @@ Handsontable.hooks.add('afterInit', init); Handsontable.hooks.add('afterUpdateSettings', init); //# -},{"helpers/dom/element":45,"renderers":90}],88:[function(require,module,exports){ +},{"helpers/dom/element":45,"renderers":91}],89:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { TouchScroll: {get: function() { @@ -17823,13 +18199,19 @@ var $TouchScroll = TouchScroll; registerPlugin('touchScroll', TouchScroll); //# -},{"_base":58,"helpers/dom/element":45,"plugins":57}],89:[function(require,module,exports){ +},{"_base":59,"helpers/dom/element":45,"plugins":58}],90:[function(require,module,exports){ "use strict"; -var $___46__46__47__46__46__47_helpers_47_object__, +var $___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_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 arrayMap = ($___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__}).arrayMap; +var $__1 = ($___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 = $__1.rangeEach, + rangeEachReverse = $__1.rangeEachReverse; +var $__2 = ($___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 = $__2.inherit, + deepClone = $__2.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; @@ -17865,24 +18247,33 @@ Handsontable.UndoRedo = function(instance) { plugin.done(action); }); instance.addHook('beforeRemoveCol', function(index, amount) { - var originalData = plugin.instance.getSourceData(); + var originalData = plugin.instance.getData(); index = (plugin.instance.countCols() + index) % plugin.instance.countCols(); var removedData = []; - for (var i = 0, - len = originalData.length; i < len; i++) { + var headers = []; + var indexes = []; + rangeEach(0, originalData.length - 1, (function(i) { removedData[i] = originalData[i].slice(index, index + amount); - } - var headers; + })); + rangeEach(0, amount - 1, (function(i) { + indexes.push(instance.runHooks('modifyCol', index + i)); + })); if (Array.isArray(instance.getSettings().colHeaders)) { - headers = instance.getSettings().colHeaders.slice(index, index + removedData.length); + rangeEach(0, amount - 1, (function(i) { + headers.push(instance.getSettings().colHeaders[instance.runHooks('modifyCol', index + i)] || null); + })); } - var action = new Handsontable.UndoRedo.RemoveColumnAction(index, removedData, headers); + var manualColumnMovePlugin = plugin.instance.getPlugin('manualColumnMove'); + var action = new Handsontable.UndoRedo.RemoveColumnAction(indexes, removedData, headers, manualColumnMovePlugin ? manualColumnMovePlugin.columnPositions : []); plugin.done(action); }); instance.addHook('beforeCellAlignment', function(stateBefore, range, type, alignment) { var action = new Handsontable.UndoRedo.CellAlignmentAction(stateBefore, range, type, alignment); plugin.done(action); }); + instance.addHook('beforeFilter', function(formulaStacks) { + plugin.done(new Handsontable.UndoRedo.FiltersAction(formulaStacks)); + }); }; Handsontable.UndoRedo.prototype.done = function(action) { if (!this.ignoreNewActions) { @@ -18034,34 +18425,63 @@ Handsontable.UndoRedo.CellAlignmentAction.prototype.redo = function(instance, un instance.addHookOnce('afterRender', undoneCallback); instance.render(); }; -Handsontable.UndoRedo.RemoveColumnAction = function(index, data, headers) { - this.index = index; +Handsontable.UndoRedo.RemoveColumnAction = function(indexes, data, headers, columnPositions) { + this.indexes = indexes; this.data = data; this.amount = this.data[0].length; this.headers = headers; + this.columnPositions = columnPositions.slice(0); }; 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++) { + var $__4 = this; + var row; + var ascendingIndexes = this.indexes.slice(0).sort(); + var sortByIndexes = (function(elem, j, arr) { + return arr[$__4.indexes.indexOf(ascendingIndexes[j])]; + }); + var sortedData = []; + rangeEach(0, this.data.length - 1, (function(i) { + sortedData[i] = arrayMap($__4.data[i], sortByIndexes); + })); + var sortedHeaders = []; + sortedHeaders = arrayMap(this.headers, sortByIndexes); + rangeEach(0, this.data.length - 1, (function(i) { row = instance.getSourceDataAtRow(i); - spliceArgs = [this.index, 0]; - Array.prototype.push.apply(spliceArgs, this.data[i]); - Array.prototype.splice.apply(row, spliceArgs); - } + rangeEach(0, ascendingIndexes.length - 1, (function(j) { + row.splice(ascendingIndexes[j], 0, sortedData[i][j]); + })); + })); if (typeof this.headers != 'undefined') { - spliceArgs = [this.index, 0]; - Array.prototype.push.apply(spliceArgs, this.headers); - Array.prototype.splice.apply(instance.getSettings().colHeaders, spliceArgs); + rangeEach(0, sortedHeaders.length - 1, (function(j) { + instance.getSettings().colHeaders.splice(ascendingIndexes[j], 0, sortedHeaders[j]); + })); + } + if (instance.getPlugin('manualColumnMove')) { + instance.getPlugin('manualColumnMove').columnPositions = this.columnPositions; } 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); + instance.alter('remove_col', instance.runHooks('unmodifyCol', this.indexes[0]), this.amount); +}; +Handsontable.UndoRedo.FiltersAction = function(formulaStacks) { + this.formulaStacks = formulaStacks; +}; +inherit(Handsontable.UndoRedo.FiltersAction, Handsontable.UndoRedo.Action); +Handsontable.UndoRedo.FiltersAction.prototype.undo = function(instance, undoneCallback) { + var filters = instance.getPlugin('filters'); + instance.addHookOnce('afterRender', undoneCallback); + filters.formulaCollection.importAllFormulas(this.formulaStacks.slice(0, this.formulaStacks.length - 1)); + filters.filter(); +}; +Handsontable.UndoRedo.FiltersAction.prototype.redo = function(instance, redoneCallback) { + var filters = instance.getPlugin('filters'); + instance.addHookOnce('afterRender', redoneCallback); + filters.formulaCollection.importAllFormulas(this.formulaStacks); + filters.filter(); }; function init() { var instance = this; @@ -18129,7 +18549,7 @@ Handsontable.hooks.add('afterInit', init); Handsontable.hooks.add('afterUpdateSettings', init); //# -},{"helpers/dom/event":46,"helpers/object":50}],90:[function(require,module,exports){ +},{"helpers/array":42,"helpers/dom/event":46,"helpers/number":50,"helpers/object":51}],91:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { registerRenderer: {get: function() { @@ -18174,7 +18594,7 @@ function hasRenderer(rendererName) { ; //# -},{"helpers/string":52}],91:[function(require,module,exports){ +},{"helpers/string":53}],92:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { cellDecorator: {get: function() { @@ -18216,7 +18636,7 @@ function cellDecorator(instance, TD, row, col, prop, value, cellProperties) { } //# -},{"helpers/dom/element":45,"renderers":90}],92:[function(require,module,exports){ +},{"helpers/dom/element":45,"renderers":91}],93:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { autocompleteRenderer: {get: function() { @@ -18273,7 +18693,7 @@ function autocompleteRenderer(instance, TD, row, col, prop, value, cellPropertie registerRenderer('autocomplete', autocompleteRenderer); //# -},{"3rdparty/walkontable/src/cell/coords":5,"eventManager":41,"helpers/dom/element":45,"renderers":90}],93:[function(require,module,exports){ +},{"3rdparty/walkontable/src/cell/coords":5,"eventManager":41,"helpers/dom/element":45,"renderers":91}],94:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { checkboxRenderer: {get: function() { @@ -18348,8 +18768,9 @@ function checkboxRenderer(instance, TD, row, col, prop, value, cellProperties) { if (cellProperties.readOnly) { eventManager.addEventListener(input, 'click', preventDefault); } else { - eventManager.addEventListener(input, 'mousedown', stopPropagation); - eventManager.addEventListener(input, 'mouseup', stopPropagation); + eventManager.addEventListener(input, 'mouseup', (function() { + return setTimeout(instance.listen, 10); + })); eventManager.addEventListener(input, 'change', (function(event) { instance.setDataAtRowProp(row, prop, event.target.checked ? cellProperties.checkedTemplate : cellProperties.uncheckedTemplate); })); @@ -18417,6 +18838,7 @@ function createInput() { input.className = 'htCheckboxRendererInput'; input.type = 'checkbox'; input.setAttribute('autocomplete', 'off'); + input.setAttribute('tabindex', '-1'); return input.cloneNode(false); } function createLabel(text) { @@ -18430,7 +18852,7 @@ function preventDefault(event) { } //# -},{"eventManager":41,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/string":52,"helpers/unicode":53,"renderers":90}],94:[function(require,module,exports){ +},{"eventManager":41,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/string":53,"helpers/unicode":54,"renderers":91}],95:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { htmlRenderer: {get: function() { @@ -18455,7 +18877,7 @@ function htmlRenderer(instance, TD, row, col, prop, value, cellProperties) { registerRenderer('html', htmlRenderer); //# -},{"helpers/dom/element":45,"renderers":90}],95:[function(require,module,exports){ +},{"helpers/dom/element":45,"renderers":91}],96:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { numericRenderer: {get: function() { @@ -18487,7 +18909,7 @@ function numericRenderer(instance, TD, row, col, prop, value, cellProperties) { registerRenderer('numeric', numericRenderer); //# -},{"helpers/dom/element":45,"helpers/number":49,"numeral":"numeral","renderers":90}],96:[function(require,module,exports){ +},{"helpers/dom/element":45,"helpers/number":50,"numeral":"numeral","renderers":91}],97:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { passwordRenderer: {get: function() { @@ -18514,7 +18936,7 @@ function passwordRenderer(instance, TD, row, col, prop, value, cellProperties) { registerRenderer('password', passwordRenderer); //# -},{"helpers/dom/element":45,"renderers":90}],97:[function(require,module,exports){ +},{"helpers/dom/element":45,"renderers":91}],98:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { textRenderer: {get: function() { @@ -18557,7 +18979,7 @@ function textRenderer(instance, TD, row, col, prop, value, cellProperties) { registerRenderer('text', textRenderer); //# -},{"helpers/dom/element":45,"helpers/mixed":48,"renderers":90}],98:[function(require,module,exports){ +},{"helpers/dom/element":45,"helpers/mixed":49,"renderers":91}],99:[function(require,module,exports){ "use strict"; (function(global) { 'use strict'; @@ -18825,7 +19247,20 @@ registerRenderer('text', textRenderer); 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.'); + valueToSpread[$toProperty(Symbol.iterator)] = function() { + var value = this; + var length = value.length; + var index = 0; + return {next: function() { + var result = {done: true}; + if (index < length) { + result.done = false; + result.value = value[index]; + ++index; + } + return result; + }}; + }; } var iter = valueToSpread[$toProperty(Symbol.iterator)](); while (!(iterResult = iter.next()).done) { @@ -18940,7 +19375,7 @@ registerRenderer('text', textRenderer); })(); //# -},{}],99:[function(require,module,exports){ +},{}],100:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { TableView: {get: function() { @@ -19127,7 +19562,9 @@ function TableView(instance) { preventOverflow: (function() { return $__6.settings.preventOverflow; }), - stretchH: this.settings.stretchH, + stretchH: function() { + return that.settings.stretchH; + }, data: instance.getDataAtCell, totalRows: (function() { return instance.countRows(); @@ -19463,7 +19900,7 @@ TableView.prototype.destroy = function() { ; //# -},{"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}],100:[function(require,module,exports){ +},{"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}],101:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { GhostTable: {get: function() { @@ -19688,7 +20125,83 @@ Handsontable.utils = Handsontable.utils || {}; Handsontable.utils.GhostTable = GhostTable; //# -},{"helpers/array":42,"helpers/dom/element":45,"helpers/mixed":48,"helpers/number":49,"helpers/object":50}],101:[function(require,module,exports){ +},{"helpers/array":42,"helpers/dom/element":45,"helpers/mixed":49,"helpers/number":50,"helpers/object":51}],102:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + Interval: {get: function() { + return Interval; + }}, + __esModule: {value: true} +}); +var $___46__46__47_helpers_47_feature__, + $___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_feature__ = require("helpers/feature"), $___46__46__47_helpers_47_feature__ && $___46__46__47_helpers_47_feature__.__esModule && $___46__46__47_helpers_47_feature__ || {default: $___46__46__47_helpers_47_feature__}), + requestAnimationFrame = $__0.requestAnimationFrame, + cancelAnimationFrame = $__0.cancelAnimationFrame; +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 Interval = function Interval(func, delay) { + var $__5 = this; + this.timer = null; + this.func = func; + this.delay = parseDelay(delay); + this.stopped = true; + this._then = null; + this._callback = (function() { + return $__5.__callback(); + }); +}; +var $Interval = Interval; +($traceurRuntime.createClass)(Interval, { + start: function() { + if (this.stopped) { + this._then = Date.now(); + this.stopped = false; + this.timer = requestAnimationFrame(this._callback); + } + return this; + }, + stop: function() { + if (!this.stopped) { + this.stopped = true; + cancelAnimationFrame(this.timer); + this.timer = null; + } + return this; + }, + __callback: function() { + this.timer = requestAnimationFrame(this._callback); + if (this.delay) { + var now = Date.now(); + var elapsed = now - this._then; + if (elapsed > this.delay) { + this._then = now - (elapsed % this.delay); + this.func(); + } + } else { + this.func(); + } + } +}, {create: function(func, delay) { + return new $Interval(func, delay); + }}); +; +function parseDelay(delay) { + if (typeof delay === 'string' && /fps$/.test(delay)) { + delay = 1000 / parseInt(delay.replace('fps', '') || 0, 10); + } + return delay; +} +Handsontable.utils = Handsontable.utils || {}; +Handsontable.utils.Interval = Interval; + +//# +},{"helpers/array":42,"helpers/feature":47,"helpers/mixed":49,"helpers/number":50,"helpers/object":51}],103:[function(require,module,exports){ "use strict"; var $__7; Object.defineProperties(exports, { @@ -19824,7 +20337,7 @@ Handsontable.utils = Handsontable.utils || {}; Handsontable.utils.SamplesGenerator = SamplesGenerator; //# -},{"helpers/array":42,"helpers/dom/element":45,"helpers/mixed":48,"helpers/number":49,"helpers/object":50}],102:[function(require,module,exports){ +},{"helpers/array":42,"helpers/dom/element":45,"helpers/mixed":49,"helpers/number":50,"helpers/object":51}],104:[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; @@ -19859,7 +20372,7 @@ function process(value, callback) { } //# -},{"helpers/mixed":48}],103:[function(require,module,exports){ +},{"helpers/mixed":49}],105:[function(require,module,exports){ "use strict"; var $__moment__, $___46__46__47_editors__; @@ -19909,7 +20422,7 @@ var correctFormat = function correctFormat(value, dateFormat) { }; //# -},{"editors":29,"moment":"moment"}],104:[function(require,module,exports){ +},{"editors":29,"moment":"moment"}],106:[function(require,module,exports){ "use strict"; Handsontable.NumericValidator = function(value, callback) { if (value == null) { @@ -19925,7 +20438,54 @@ Handsontable.NumericValidator = function(value, callback) { }; //# -},{}],"SheetClip":[function(require,module,exports){ +},{}],107:[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; +var STRICT_FORMATS = ['YYYY-MM-DDTHH:mm:ss.SSSZ']; +Handsontable.TimeValidator = function(value, callback) { + var valid = true; + var timeFormat = this.timeFormat || 'h:mm:ss a'; + if (value === null) { + value = ''; + } + if (typeof value === 'number') { + value = ("" + value); + } + if (/^\d{9,10}$/.test(value)) { + value = new Date(parseInt((value + "000"), 10)); + } else if (/^\d{13}$/.test(value)) { + value = new Date(parseInt(value, 10)); + } + var date = moment(value, STRICT_FORMATS, true).isValid() ? moment(new Date(value)) : moment(value, timeFormat); + var isValidTime = date.isValid(); + var isValidFormat = moment(value, timeFormat, true).isValid(); + if (this.allowEmpty && value === '') { + isValidTime = true; + isValidFormat = true; + } + if (!isValidTime) { + valid = false; + } + if (!isValidTime && isValidFormat) { + valid = true; + } + if (isValidTime && !isValidFormat) { + if (this.correctFormat === true) { + var correctedValue = date.format(timeFormat); + this.instance.setDataAtCell(this.row, this.col, correctedValue, 'timeValidator'); + valid = true; + } else { + valid = false; + } + } + callback(valid); +}; + +//# +},{"editors":29,"moment":"moment"}],"SheetClip":[function(require,module,exports){ "use strict"; (function(global) { "use strict"; @@ -20986,7 +21546,7 @@ if (typeof exports !== "undefined") { //# },{}],"moment":[function(require,module,exports){ //! moment.js -//! version : 2.11.1 +//! version : 2.11.2 //! authors : Tim Wood, Iskren Chernev, Moment.js contributors //! license : MIT //! momentjs.com @@ -22803,7 +23363,7 @@ if (typeof exports !== "undefined") { } // ASP.NET json date format regex - var aspNetRegex = /(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/; + var aspNetRegex = /^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?\d*)?$/; // 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 @@ -24558,7 +25118,7 @@ if (typeof exports !== "undefined") { // Side effect imports - utils_hooks__hooks.version = '2.11.1'; + utils_hooks__hooks.version = '2.11.2'; setHookCallback(local__createLocal); @@ -28791,5 +29351,5 @@ if (typeof exports !== "undefined") { })(function() { return this || window; }()); -},{}]},{},[23,59,61,60,62,83,84,85,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,86,87,88,89,102,103,104,92,93,94,95,96,97,31,35,32,33,40,34,36,37,38,39])("zeroclipboard") +},{}]},{},[23,60,62,61,63,84,85,86,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,87,88,89,90,104,105,106,107,93,94,95,96,97,98,31,35,32,33,40,34,36,37,38,39])("zeroclipboard") }); \ No newline at end of file diff --git a/bower_components/handsontable/dist/handsontable.full.min.js b/bower_components/handsontable/dist/handsontable.full.min.js index 18ed35a..89ea249 100644 --- a/bower_components/handsontable/dist/handsontable.full.min.js +++ b/bower_components/handsontable/dist/handsontable.full.min.js @@ -24,26 +24,26 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.Handsontable=e()}}(function(){var e;return function(e,t,n){return function o(e,t,n){function r(a,l){if(!t[a]){if(!e[a]){var u="function"==typeof require&&require;if(!l&&u)return u(a,!0);if(i)return i(a,!0);if(s[a]&&"undefined"!=typeof window[s[a]])return window[s[a]];var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var d=t[a]={exports:{}};e[a][0].call(d.exports,function(t){var n=e[a][1][t];return r(n?n:t)},d,d.exports,o,e,t,n)}return t[a].exports}for(var i="function"==typeof require&&require,s=JSON.parse('{"zeroclipboard":"ZeroClipboard","moment":"moment","pikaday":"Pikaday"}')||{},a=0;a1)for(t=1,o=arguments.length;o>t;t++)r.push(arguments[t]);if(l){if("undefined"==typeof l[e])throw new Error("Handsontable do not provide action: "+e);i=l[e].apply(l,r),"destroy"===e&&a.removeData()}return i}}(window,jQuery,Handsontable)},{}],2:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableBorder:{get:function(){return y}},__esModule:{value:!0}});var o,r,i,s,a,l=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),u=l.getComputedStyle,c=l.getTrimmingContainer,d=l.innerWidth,h=l.innerHeight,f=l.offset,p=l.outerHeight,g=l.outerWidth,m=(r=e("helpers/dom/event"),r&&r.__esModule&&r||{"default":r}).stopImmediatePropagation,v=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).EventManager,w=(s=e("cell/coords"),s&&s.__esModule&&s||{"default":s}).WalkontableCellCoords,y=((a=e("overlay/_base.js"),a&&a.__esModule&&a||{"default":a}).WalkontableOverlay,function(e,t){t&&(this.eventManager=new v(e),this.instance=e,this.wot=e,this.settings=t,this.mouseDown=!1,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(t),this.registerListeners())});$traceurRuntime.createClass(y,{registerListeners:function(){var e=this;this.eventManager.addEventListener(document.body,"mousedown",function(){return e.onMouseDown()}),this.eventManager.addEventListener(document.body,"mouseup",function(){return e.onMouseUp()});for(var t=this,n=function(n,o){t.eventManager.addEventListener(t.main.childNodes[n],"mouseenter",function(t){return e.onMouseEnter(t,e.main.childNodes[n])})},o=0,r=this.main.childNodes.length;r>o;o++)n(o,r)},onMouseDown:function(){this.mouseDown=!0},onMouseUp:function(){this.mouseDown=!1},onMouseEnter:function(e,t){function n(e){return e.clientYMath.ceil(i.top+i.height)?!0:e.clientXMath.ceil(i.left+i.width)?!0:void 0}function o(e){n(e)&&(r.eventManager.removeEventListener(document.body,"mousemove",o),t.style.display="block")}if(this.mouseDown&&this.wot.getSetting("hideBorderOnMouseDownOver")){e.preventDefault(),m(e);var r=this,i=t.getBoundingClientRect();t.style.display="none",this.eventManager.addEventListener(document.body,"mousemove",o)}},createBorders:function(e){this.main=document.createElement("div");var t=["top","left","bottom","right","corner"],n=this.main.style;n.position="absolute",n.top=0,n.left=0;for(var o=0;5>o;o++){var r=t[o],i=document.createElement("div");i.className="wtBorder "+(this.settings.className||""),this.settings[r]&&this.settings[r].hide&&(i.className+=" hidden"),n=i.style,n.backgroundColor=this.settings[r]&&this.settings[r].color?this.settings[r].color:e.border.color,n.height=this.settings[r]&&this.settings[r].width?this.settings[r].width+"px":e.border.width+"px",n.width=this.settings[r]&&this.settings[r].width?this.settings[r].width+"px":e.border.width+"px",this.main.appendChild(i)}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(" "),Handsontable.mobileBrowser&&this.createMultipleSelectorHandles(),this.disappear(),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 e=10,t=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 n={position:"absolute",height:t+"px",width:t+"px","border-radius":parseInt(t/1.5,10)+"px"};for(var o in n)n.hasOwnProperty(o)&&(this.selectionHandles.styles.bottomRightHitArea[o]=n[o],this.selectionHandles.styles.topLeftHitArea[o]=n[o]);var r={position:"absolute",height:e+"px",width:e+"px","border-radius":parseInt(e/1.5,10)+"px",background:"#F5F5FF",border:"1px solid #4285c8"};for(var i in r)r.hasOwnProperty(i)&&(this.selectionHandles.styles.bottomRight[i]=r[i],this.selectionHandles.styles.topLeft[i]=r[i]);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(e,t){return!this.wot.selections.area.cellRange||e==this.wot.selections.area.cellRange.to.row&&t==this.wot.selections.area.cellRange.to.col?!1:!0},updateMultipleSelectionHandlesPosition:function(e,t,n,o,r,i){var s=parseInt(this.selectionHandles.styles.topLeft.width,10),a=parseInt(this.selectionHandles.styles.topLeftHitArea.width,10);this.selectionHandles.styles.topLeft.top=parseInt(n-s,10)+"px",this.selectionHandles.styles.topLeft.left=parseInt(o-s,10)+"px",this.selectionHandles.styles.topLeftHitArea.top=parseInt(n-a/4*3,10)+"px",this.selectionHandles.styles.topLeftHitArea.left=parseInt(o-a/4*3,10)+"px",this.selectionHandles.styles.bottomRight.top=parseInt(n+i,10)+"px",this.selectionHandles.styles.bottomRight.left=parseInt(o+r,10)+"px",this.selectionHandles.styles.bottomRightHitArea.top=parseInt(n+i-a/4,10)+"px",this.selectionHandles.styles.bottomRightHitArea.left=parseInt(o+r-a/4,10)+"px",this.settings.border.multipleSelectionHandlesVisible&&this.settings.border.multipleSelectionHandlesVisible()?(this.selectionHandles.styles.topLeft.display="block",this.selectionHandles.styles.topLeftHitArea.display="block",this.isPartRange(e,t)?(this.selectionHandles.styles.bottomRight.display="none",this.selectionHandles.styles.bottomRightHitArea.display="none"):(this.selectionHandles.styles.bottomRight.display="block",this.selectionHandles.styles.bottomRightHitArea.display="block")):(this.selectionHandles.styles.topLeft.display="none",this.selectionHandles.styles.bottomRight.display="none",this.selectionHandles.styles.topLeftHitArea.display="none",this.selectionHandles.styles.bottomRightHitArea.display="none"),e==this.wot.wtSettings.getSetting("fixedRowsTop")||t==this.wot.wtSettings.getSetting("fixedColumnsLeft")?(this.selectionHandles.styles.topLeft.zIndex="9999",this.selectionHandles.styles.topLeftHitArea.zIndex="9999"):(this.selectionHandles.styles.topLeft.zIndex="",this.selectionHandles.styles.topLeftHitArea.zIndex="")},appear:function(e){if(!this.disabled){var t,n,o,r,i,s,a,l,m,v,y,b,C,R,_,S,E,T,M;M=this.wot.wtTable.getRenderedRowsCount();for(var O=0;M>O;O++){var k=this.wot.wtTable.rowFilter.renderedToSource(O);if(k>=e[0]&&k<=e[2]){C=k;break}}for(var H=M-1;H>=0;H--){var D=this.wot.wtTable.rowFilter.renderedToSource(H);if(D>=e[0]&&D<=e[2]){_=D;break}}M=this.wot.wtTable.getRenderedColumnsCount();for(var x=0;M>x;x++){var A=this.wot.wtTable.columnFilter.renderedToSource(x);if(A>=e[1]&&A<=e[3]){R=A;break}}for(var P=M-1;P>=0;P--){var N=this.wot.wtTable.columnFilter.renderedToSource(P);if(N>=e[1]&&N<=e[3]){S=N;break}}if(void 0===C||void 0===R)return void this.disappear();t=C!==_||R!==S,n=this.wot.wtTable.getCell(new w(C,R)),o=t?this.wot.wtTable.getCell(new w(_,S)):n,r=f(n),i=t?f(o):r,s=f(this.wot.wtTable.TABLE),l=r.top,y=i.top+p(o)-l,v=r.left,b=i.left+g(o)-v,a=l-s.top-1,m=v-s.left-1;var L=u(n);parseInt(L.borderTopWidth,10)>0&&(a+=1,y=y>0?y-1:0),parseInt(L.borderLeftWidth,10)>0&&(m+=1,b=b>0?b-1:0),this.topStyle.top=a+"px",this.topStyle.left=m+"px",this.topStyle.width=b+"px",this.topStyle.display="block",this.leftStyle.top=a+"px",this.leftStyle.left=m+"px",this.leftStyle.height=y+"px",this.leftStyle.display="block";var W=Math.floor(this.settings.border.width/2);this.bottomStyle.top=a+y-W+"px",this.bottomStyle.left=m+"px",this.bottomStyle.width=b+"px",this.bottomStyle.display="block",this.rightStyle.top=a+"px",this.rightStyle.left=m+b-W+"px",this.rightStyle.height=y+1+"px",this.rightStyle.display="block",Handsontable.mobileBrowser||!this.hasSetting(this.settings.border.cornerVisible)||this.isPartRange(_,S)?this.cornerStyle.display="none":(this.cornerStyle.top=a+y-4+"px",this.cornerStyle.left=m+b-4+"px",this.cornerStyle.borderRightWidth=this.cornerDefaultStyle.borderWidth,this.cornerStyle.width=this.cornerDefaultStyle.width,this.cornerStyle.display="block",E=c(this.wot.wtTable.TABLE),S===this.wot.getSetting("totalColumns")-1&&(T=o.offsetLeft+g(o)>=d(E),T&&(this.cornerStyle.left=Math.floor(m+b-3-parseInt(this.cornerDefaultStyle.width)/2)+"px",this.cornerStyle.borderRightWidth=0)),_===this.wot.getSetting("totalRows")-1&&(T=o.offsetTop+p(o)>=h(E),T&&(this.cornerStyle.top=Math.floor(a+y-3-parseInt(this.cornerDefaultStyle.height)/2)+"px",this.cornerStyle.borderBottomWidth=0))),Handsontable.mobileBrowser&&this.updateMultipleSelectionHandlesPosition(C,R,a,m,b,y)}},disappear:function(){this.topStyle.display="none",this.leftStyle.display="none",this.bottomStyle.display="none",this.rightStyle.display="none",this.cornerStyle.display="none",Handsontable.mobileBrowser&&(this.selectionHandles.styles.topLeft.display="none",this.selectionHandles.styles.bottomRight.display="none")},hasSetting:function(e){return"function"==typeof e?e():!!e}},{}),window.WalkontableBorder=y},{"cell/coords":5,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,"overlay/_base.js":11}],3:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableViewportColumnsCalculator:{get:function(){return r}},__esModule:{value:!0}});var o=new WeakMap,r=function(e,t,n,r,i,s,a){var l=void 0!==arguments[7]?arguments[7]:function(e){return e};o.set(this,{viewportWidth:e,scrollOffset:t,totalColumns:n,columnWidthFn:r,overrideFn:i,onlyFullyVisible:s,stretchingColumnWidthFn:l}),this.count=0,this.startColumn=null,this.endColumn=null,this.startPosition=null,this.stretchAllRatio=0,this.stretchLastWidth=0,this.stretch=a,this.totalTargetWidth=0,this.needVerifyLastColumnWidth=!0,this.stretchAllColumnsWidth=[],this.calculate()},i=r;$traceurRuntime.createClass(r,{calculate:function(){for(var e,t=0,n=!0,r=[],i=o.get(this),s=i.onlyFullyVisible,a=i.overrideFn,l=i.scrollOffset,u=i.totalColumns,c=i.viewportWidth,d=0;u>d;d++)if(e=this._getColumnWidth(d),l>=t&&!s&&(this.startColumn=d),t>=l&&l+c>=t+e&&(null==this.startColumn&&(this.startColumn=d),this.endColumn=d),r.push(t),t+=e,s||(this.endColumn=d),t>=l+c){n=!1;break}if(this.endColumn===u-1&&n)for(this.startColumn=this.endColumn;this.startColumn>0;){var h=r[this.endColumn]+e-r[this.startColumn-1];if((c>=h||!s)&&this.startColumn--,h>c)break}null!==this.startColumn&&a&&a(this),this.startPosition=r[this.startColumn],void 0==this.startPosition&&(this.startPosition=null),null!==this.startColumn&&(this.count=this.endColumn-this.startColumn+1)},refreshStretching:function(e){if("none"!==this.stretch){this.totalTargetWidth=e;for(var t=o.get(this),n=t.totalColumns,r=0,i=0;n>i;i++){var s=this._getColumnWidth(i),a=t.stretchingColumnWidthFn(void 0,i);"number"==typeof a?e-=a:r+=s}var l=e-r;if("all"===this.stretch&&l>0)this.stretchAllRatio=e/r,this.stretchAllColumnsWidth=[],this.needVerifyLastColumnWidth=!0;else if("last"===this.stretch&&e!==1/0){var u=this._getColumnWidth(n-1),c=l+u;this.stretchLastWidth=c>=0?c:u}}},getStretchedColumnWidth:function(e,t){var n=null;return"all"===this.stretch&&0!==this.stretchAllRatio?n=this._getStretchedAllColumnWidth(e,t):"last"===this.stretch&&0!==this.stretchLastWidth&&(n=this._getStretchedLastColumnWidth(e)),n},_getStretchedAllColumnWidth:function(e,t){var n=0,r=o.get(this),i=r.totalColumns;if(!this.stretchAllColumnsWidth[e]){var s=Math.round(t*this.stretchAllRatio),a=r.stretchingColumnWidthFn(s,e);void 0===a?this.stretchAllColumnsWidth[e]=s:this.stretchAllColumnsWidth[e]=isNaN(a)?this._getColumnWidth(e):a}if(this.stretchAllColumnsWidth.length===i&&this.needVerifyLastColumnWidth){this.needVerifyLastColumnWidth=!1;for(var l=0;lf;f++){var p=l(f);if(void 0===p&&(p=i.DEFAULT_HEIGHT),u>=e&&!s&&(this.startRow=f),e>=u&&u+d-h>=e+p&&(null===this.startRow&&(this.startRow=f),this.endRow=f),n.push(e),e+=p,s||(this.endRow=f),e>=u+d-h){t=!1;break}}if(this.endRow===c-1&&t)for(this.startRow=this.endRow;this.startRow>0;){var g=n[this.endRow]+p-n[this.startRow-1];if((d-h>=g||!s)&&this.startRow--,g>=d-h)break}null!==this.startRow&&a&&a(this),this.startPosition=n[this.startRow],void 0==this.startPosition&&(this.startPosition=null),null!==this.startRow&&(this.count=this.endRow-this.startRow+1)}},{get DEFAULT_HEIGHT(){return 23}}),window.WalkontableViewportRowsCalculator=r},{}],5:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableCellCoords:{get:function(){return o}},__esModule:{value:!0}});var o=function(e,t){"undefined"!=typeof e&&"undefined"!=typeof t?(this.row=e,this.col=t):(this.row=null,this.col=null)};$traceurRuntime.createClass(o,{isValid:function(e){return this.row<0||this.col<0?!1:this.row>=e.getSetting("totalRows")||this.col>=e.getSetting("totalColumns")?!1:!0},isEqual:function(e){return e===this?!0:this.row===e.row&&this.col===e.col},isSouthEastOf:function(e){return this.row>=e.row&&this.col>=e.col},isNorthWestOf:function(e){return this.row<=e.row&&this.col<=e.col},isSouthWestOf:function(e){return this.row>=e.row&&this.col<=e.col},isNorthEastOf:function(e){return this.row<=e.row&&this.col>=e.col}},{}),window.WalkontableCellCoords=o},{}],6:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableCellRange:{get:function(){return i}},__esModule:{value:!0}});var o,r=(o=e("cell/coords"),o&&o.__esModule&&o||{"default":o}).WalkontableCellCoords,i=function(e,t,n){this.highlight=e,this.from=t,this.to=n},s=i;$traceurRuntime.createClass(i,{isValid:function(e){return this.from.isValid(e)&&this.to.isValid(e)},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(e){var t=this.getTopLeftCorner(),n=this.getBottomRightCorner();return e.row<0&&(e.row=0),e.col<0&&(e.col=0),t.row<=e.row&&n.row>=e.row&&t.col<=e.col&&n.col>=e.col},includesRange:function(e){return this.includes(e.getTopLeftCorner())&&this.includes(e.getBottomRightCorner())},isEqual:function(e){return Math.min(this.from.row,this.to.row)==Math.min(e.from.row,e.to.row)&&Math.max(this.from.row,this.to.row)==Math.max(e.from.row,e.to.row)&&Math.min(this.from.col,this.to.col)==Math.min(e.from.col,e.to.col)&&Math.max(this.from.col,this.to.col)==Math.max(e.from.col,e.to.col)},overlaps:function(e){return e.isSouthEastOf(this.getTopLeftCorner())&&e.isNorthWestOf(this.getBottomRightCorner())},isSouthEastOf:function(e){return this.getTopLeftCorner().isSouthEastOf(e)||this.getBottomRightCorner().isSouthEastOf(e)},isNorthWestOf:function(e){return this.getTopLeftCorner().isNorthWestOf(e)||this.getBottomRightCorner().isNorthWestOf(e)},expand:function(e){var t=this.getTopLeftCorner(),n=this.getBottomRightCorner();return e.rown.row||e.col>n.col?(this.from=new r(Math.min(t.row,e.row),Math.min(t.col,e.col)),this.to=new r(Math.max(n.row,e.row),Math.max(n.col,e.col)),!0):!1},expandByRange:function(e){if(this.includesRange(e)||!this.overlaps(e))return!1;var t=this.getTopLeftCorner(),n=this.getBottomRightCorner(),o=(this.getTopRightCorner(),this.getBottomLeftCorner(),e.getTopLeftCorner()),i=e.getBottomRightCorner(),a=Math.min(t.row,o.row),l=Math.min(t.col,o.col),u=Math.max(n.row,i.row),c=Math.max(n.col,i.col),d=new r(a,l),h=new r(u,c),f=new s(d,d,h).isCorner(this.from,e),p=e.isEqual(new s(d,d,h));return f&&!p&&(this.from.col>d.col&&(d.col=c,h.col=l),this.from.row>d.row&&(d.row=u,h.row=a)),this.from=d,this.to=h,!0},getDirection:function(){return this.from.isNorthWestOf(this.to)?"NW-SE":this.from.isNorthEastOf(this.to)?"NE-SW":this.from.isSouthEastOf(this.to)?"SE-NW":this.from.isSouthWestOf(this.to)?"SW-NE":void 0},setDirection:function(e){switch(e){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()}},getTopLeftCorner:function(){return new r(Math.min(this.from.row,this.to.row),Math.min(this.from.col,this.to.col))},getBottomRightCorner:function(){return new r(Math.max(this.from.row,this.to.row),Math.max(this.from.col,this.to.col))},getTopRightCorner:function(){return new r(Math.min(this.from.row,this.to.row),Math.max(this.from.col,this.to.col))},getBottomLeftCorner:function(){return new r(Math.max(this.from.row,this.to.row),Math.min(this.from.col,this.to.col))},isCorner:function(e,t){return t&&t.includes(e)&&(this.getTopLeftCorner().isEqual(new r(t.from.row,t.from.col))||this.getTopRightCorner().isEqual(new r(t.from.row,t.to.col))||this.getBottomLeftCorner().isEqual(new r(t.to.row,t.from.col))||this.getBottomRightCorner().isEqual(new r(t.to.row,t.to.col)))?!0:e.isEqual(this.getTopLeftCorner())||e.isEqual(this.getTopRightCorner())||e.isEqual(this.getBottomLeftCorner())||e.isEqual(this.getBottomRightCorner())},getOppositeCorner:function(e,t){if(!(e instanceof r))return!1;if(t&&t.includes(e)){if(this.getTopLeftCorner().isEqual(new r(t.from.row,t.from.col)))return this.getBottomRightCorner();if(this.getTopRightCorner().isEqual(new r(t.from.row,t.to.col)))return this.getBottomLeftCorner();if(this.getBottomLeftCorner().isEqual(new r(t.to.row,t.from.col)))return this.getTopRightCorner();if(this.getBottomRightCorner().isEqual(new r(t.to.row,t.to.col)))return this.getTopLeftCorner()}return e.isEqual(this.getBottomRightCorner())?this.getTopLeftCorner():e.isEqual(this.getTopLeftCorner())?this.getBottomRightCorner():e.isEqual(this.getTopRightCorner())?this.getBottomLeftCorner():e.isEqual(this.getBottomLeftCorner())?this.getTopRightCorner():void 0},getBordersSharedWith:function(e){if(!this.includesRange(e))return[];var t={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)},n={top:Math.min(e.from.row,e.to.row),bottom:Math.max(e.from.row,e.to.row),left:Math.min(e.from.col,e.to.col),right:Math.max(e.from.col,e.to.col)},o=[];return t.top==n.top&&o.push("top"),t.right==n.right&&o.push("right"),t.bottom==n.bottom&&o.push("bottom"),t.left==n.left&&o.push("left"),o},getInner:function(){for(var e=this.getTopLeftCorner(),t=this.getBottomRightCorner(),n=[],o=e.row;o<=t.row;o++)for(var i=e.col;i<=t.col;i++)this.from.row===o&&this.from.col===i||this.to.row===o&&this.to.col===i||n.push(new r(o,i));return n},getAll:function(){for(var e=this.getTopLeftCorner(),t=this.getBottomRightCorner(),n=[],o=e.row;o<=t.row;o++)for(var i=e.col;i<=t.col;i++)e.row===o&&e.col===i?n.push(e):t.row===o&&t.col===i?n.push(t):n.push(new r(o,i));return n},forAll:function(e){for(var t=this.getTopLeftCorner(),n=this.getBottomRightCorner(),o=t.row;o<=n.row;o++)for(var r=t.col;r<=n.col;r++){var i=e(o,r);if(i===!1)return}}},{}),window.WalkontableCellRange=i},{"cell/coords":5}],7:[function(e,t,n){"use strict";Object.defineProperties(n,{Walkontable:{get:function(){return x}},__esModule:{value:!0}});var o,r,i,s,a,l,u,c,d,h,f,p,g,m,v=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),w=v.addClass,y=v.fastInnerText,b=v.isVisible,C=v.removeClass,R=(r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}).objectEach,_=(i=e("helpers/string"),i&&i.__esModule&&i||{"default":i}),S=_.toUpperCaseFirst,E=_.randomString,T=(s=e("event"),s&&s.__esModule&&s||{"default":s}).WalkontableEvent,M=(a=e("overlays"),a&&a.__esModule&&a||{"default":a}).WalkontableOverlays,O=(l=e("scroll"),l&&l.__esModule&&l||{"default":l}).WalkontableScroll,k=(u=e("settings"),u&&u.__esModule&&u||{"default":u}).WalkontableSettings,H=(c=e("table"),c&&c.__esModule&&c||{"default":c}).WalkontableTable,D=(d=e("viewport"),d&&d.__esModule&&d||{"default":d}).WalkontableViewport,x=((h=e("overlay/_base.js"),h&&h.__esModule&&h||{"default":h}).WalkontableOverlay,(f=e("overlay/top.js"),f&&f.__esModule&&f||{"default":f}).WalkontableTopOverlay,(p=e("overlay/left.js"),p&&p.__esModule&&p||{"default":p}).WalkontableLeftOverlay,(g=e("overlay/debug.js"),g&&g.__esModule&&g||{"default":g}).WalkontableDebugOverlay,(m=e("overlay/topLeftCorner.js"),m&&m.__esModule&&m||{"default":m}).WalkontableTopLeftCornerOverlay,function(e){var t=[];if(this.guid="wt_"+E(),e.cloneSource?(this.cloneSource=e.cloneSource,this.cloneOverlay=e.cloneOverlay,this.wtSettings=e.cloneSource.wtSettings,this.wtTable=new H(this,e.table,e.wtRootElement),this.wtScroll=new O(this),this.wtViewport=e.cloneSource.wtViewport,this.wtEvent=new T(this),this.selections=this.cloneSource.selections):(this.wtSettings=new k(this,e),this.wtTable=new H(this,e.table),this.wtScroll=new O(this),this.wtViewport=new D(this),this.wtEvent=new T(this),this.selections=this.getSetting("selections"),this.wtOverlays=new M(this),this.exportSettingsAsClassNames()),this.wtTable.THEAD.childNodes.length&&this.wtTable.THEAD.childNodes[0].childNodes.length){for(var n=0,o=this.wtTable.THEAD.childNodes[0].childNodes.length;o>n;n++)t.push(this.wtTable.THEAD.childNodes[0].childNodes[n].innerHTML);this.getSetting("columnHeaders").length||this.update("columnHeaders",[function(e,n){y(n,t[e])}])}this.drawn=!1,this.drawInterrupted=!1});$traceurRuntime.createClass(x,{draw:function(){var e=void 0!==arguments[0]?arguments[0]:!1;return this.drawInterrupted=!1,e||b(this.wtTable.TABLE)?this.wtTable.draw(e):this.drawInterrupted=!0,this},getCell:function(e){var t=void 0!==arguments[1]?arguments[1]:!1;if(!t)return this.wtTable.getCell(e);var n=this.wtSettings.getSetting("totalRows"),o=this.wtSettings.getSetting("fixedRowsTop"),r=this.wtSettings.getSetting("fixedRowsBottom"),i=this.wtSettings.getSetting("fixedColumnsLeft");if(e.row=n-r){if(this.wtOverlays.bottomLeftCornerOverlay.clone)return this.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.getCell(e)}else{if(e.coln-r&&this.wtOverlays.bottomOverlay.clone)return this.wtOverlays.bottomOverlay.clone.wtTable.getCell(e)}return this.wtTable.getCell(e)},update:function(e,t){return this.wtSettings.update(e,t)},scrollVertical:function(e){return this.wtOverlays.topOverlay.scrollTo(e),this.getSetting("onScrollVertically"),this},scrollHorizontal:function(e){return this.wtOverlays.leftOverlay.scrollTo(e),this.getSetting("onScrollHorizontally"),this},scrollViewport:function(e){return this.wtScroll.scrollViewport(e),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(e){return this.cloneOverlay?this.cloneOverlay.type===e:!1},exportSettingsAsClassNames:function(){var e=this,t={rowHeaders:["array"],columnHeaders:["array"]},n=[],o=[];R(t,function(t,r){t.indexOf("array")>-1&&e.getSetting(r).length&&o.push("ht"+S(r)),n.push("ht"+S(r))}),C(this.wtTable.wtRootElement.parentNode,n),w(this.wtTable.wtRootElement.parentNode,o)},getSetting:function(e,t,n,o,r){return this.wtSettings.getSetting(e,t,n,o,r)},hasSetting:function(e){return this.wtSettings.has(e)},destroy:function(){this.wtOverlays.destroy(),this.wtEvent.destroy()}},{}),window.Walkontable=x},{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(e,t,n){"use strict";function o(e){var t=this,n=c(e);this.instance=e;var o=[null,null];this.dblClickTimeout=[null,null];var r,i=function(e){var n=t.parentCell(e.realTarget);l(e.realTarget,"corner")?t.instance.getSetting("onCellCornerMouseDown",e,e.realTarget):n.TD&&t.instance.hasSetting("onCellMouseDown")&&t.instance.getSetting("onCellMouseDown",e,n.coords,n.TD,t.instance),2!==e.button&&n.TD&&(o[0]=n.TD,clearTimeout(t.dblClickTimeout[0]),t.dblClickTimeout[0]=setTimeout(function(){o[0]=null},1e3))},s=function(e){t.instance.touchMoving=!0},d=function(e){n.addEventListener(this,"touchmove",s),t.checkIfTouchMove=setTimeout(function(){return t.instance.touchMoving===!0?(t.instance.touchMoving=void 0,void n.removeEventListener("touchmove",s,!1)):void i(e)},30)},h=function(e){var n,o,r;t.instance.hasSetting("onCellMouseOver")&&(n=t.instance.wtTable.TABLE,o=a(e.realTarget,["TD","TH"],n),r=t.instance.cloneSource||t.instance,o&&o!==r.lastMouseOver&&u(o,n)&&(r.lastMouseOver=o,t.instance.getSetting("onCellMouseOver",e,t.instance.wtTable.getCoords(o),o,t.instance)))},f=function(e){if(2!==e.button){var n=t.parentCell(e.realTarget);n.TD===o[0]&&n.TD===o[1]?(l(e.realTarget,"corner")?t.instance.getSetting("onCellCornerDblClick",e,n.coords,n.TD,t.instance):t.instance.getSetting("onCellDblClick",e,n.coords,n.TD,t.instance),o[0]=null,o[1]=null):n.TD===o[0]&&(o[1]=n.TD,clearTimeout(t.dblClickTimeout[1]),t.dblClickTimeout[1]=setTimeout(function(){o[1]=null},500))}},p=function(e){clearTimeout(r),e.preventDefault(),f(e)};if(n.addEventListener(this.instance.wtTable.holder,"mousedown",i),n.addEventListener(this.instance.wtTable.TABLE,"mouseover",h),n.addEventListener(this.instance.wtTable.holder,"mouseup",f),this.instance.wtTable.holder.parentNode.parentNode&&Handsontable.mobileBrowser&&!t.instance.wtTable.isWorkingOnClone()){var g="."+this.instance.wtTable.holder.parentNode.className.split(" ").join(".");n.addEventListener(this.instance.wtTable.holder,"touchstart",function(e){t.instance.touchApplied=!0,u(e.target,g)&&d.call(e.target,e)}),n.addEventListener(this.instance.wtTable.holder,"touchend",function(e){t.instance.touchApplied=!1,u(e.target,g)&&p.call(e.target,e)}),t.instance.momentumScrolling||(t.instance.momentumScrolling={}),n.addEventListener(this.instance.wtTable.holder,"scroll",function(e){clearTimeout(t.instance.momentumScrolling._timeout),t.instance.momentumScrolling.ongoing||t.instance.getSetting("onBeforeTouchScroll"),t.instance.momentumScrolling.ongoing=!0,t.instance.momentumScrolling._timeout=setTimeout(function(){t.instance.touchApplied||(t.instance.momentumScrolling.ongoing=!1,t.instance.getSetting("onAfterMomentumScroll"))},200)})}n.addEventListener(window,"resize",function(){"none"!==t.instance.getSetting("stretchH")&&t.instance.draw()}),this.destroy=function(){clearTimeout(this.dblClickTimeout[0]),clearTimeout(this.dblClickTimeout[1]),n.destroy()}}Object.defineProperties(n,{WalkontableEvent:{get:function(){return o}},__esModule:{value:!0}});var r,i,s=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),a=s.closest,l=s.hasClass,u=s.isChildOf,c=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager;o.prototype.parentCell=function(e){var t={},n=this.instance.wtTable.TABLE,o=a(e,["TD","TH"],n);return o&&u(o,n)?(t.coords=this.instance.wtTable.getCoords(o),t.TD=o):l(e,"wtBorder")&&l(e,"current")?(t.coords=this.instance.selections.current.cellRange.highlight,t.TD=this.instance.wtTable.getCell(t.coords)):l(e,"wtBorder")&&l(e,"area")&&this.instance.selections.area.cellRange&&(t.coords=this.instance.selections.area.cellRange.to,t.TD=this.instance.wtTable.getCell(t.coords)),t},window.WalkontableEvent=o},{eventManager:41,"helpers/dom/element":45}],9:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableColumnFilter:{get:function(){return o}},__esModule:{value:!0}});var o=function(e,t,n){this.offset=e,this.total=t,this.countTH=n};$traceurRuntime.createClass(o,{offsetted:function(e){return e+this.offset},unOffsetted:function(e){return e-this.offset},renderedToSource:function(e){return this.offsetted(e)},sourceToRendered:function(e){return this.unOffsetted(e)},offsettedTH:function(e){return e-this.countTH},unOffsettedTH:function(e){return e+this.countTH},visibleRowHeadedColumnToSourceColumn:function(e){return this.renderedToSource(this.offsettedTH(e))}, -sourceColumnToVisibleRowHeadedColumn:function(e){return this.unOffsettedTH(this.sourceToRendered(e))}},{}),window.WalkontableColumnFilter=o},{}],10:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableRowFilter:{get:function(){return o}},__esModule:{value:!0}});var o=function(e,t,n){this.offset=e,this.total=t,this.countTH=n};$traceurRuntime.createClass(o,{offsetted:function(e){return e+this.offset},unOffsetted:function(e){return e-this.offset},renderedToSource:function(e){return this.offsetted(e)},sourceToRendered:function(e){return this.unOffsetted(e)},offsettedTH:function(e){return e-this.countTH},unOffsettedTH:function(e){return e+this.countTH},visibleColHeadedRowToSourceRow:function(e){return this.renderedToSource(this.offsettedTH(e))},sourceRowToVisibleColHeadedRow:function(e){return this.unOffsettedTH(this.sourceToRendered(e))}},{}),window.WalkontableRowFilter=o},{}],11:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableOverlay:{get:function(){return h}},__esModule:{value:!0}});var o,r,i,s=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),a=s.getScrollableElement,l=s.getTrimmingContainer,u=(r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}).defineGetter,c=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager,d={},h=function(e){u(this,"wot",e,{writable:!1}),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=l(this.hider.parentNode.parentNode),this.needFullRender=this.shouldBeRendered(),this.areElementSizesAdjusted=!1},f=h;$traceurRuntime.createClass(h,{shouldBeRendered:function(){return!0},makeClone:function(e){if(-1===f.CLONE_TYPES.indexOf(e))throw new Error('Clone type "'+e+'" is not supported.');var t=document.createElement("DIV"),n=document.createElement("TABLE");t.className="ht_clone_"+e+" handsontable",t.style.position="absolute",t.style.top=0,t.style.left=0,t.style.overflow="hidden",n.className=this.wot.wtTable.TABLE.className,t.appendChild(n),this.type=e,this.wot.wtTable.wtRootElement.parentNode.appendChild(t);var o=this.wot.getSetting("preventOverflow");return o===!0||"horizontal"===o&&this.type===f.CLONE_TOP||"vertical"===o&&this.type===f.CLONE_LEFT?this.mainTableScrollableElement=window:this.mainTableScrollableElement=a(this.wot.wtTable.TABLE),new Walkontable({cloneSource:this.wot,cloneOverlay:this,table:n})},refresh:function(){var e=void 0!==arguments[0]?arguments[0]:!1,t=this.shouldBeRendered();this.clone&&(this.needFullRender||t)&&this.clone.draw(e),this.needFullRender=t},destroy:function(){c(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[f.CLONE_TOP,f.CLONE_BOTTOM,f.CLONE_LEFT,f.CLONE_TOP_LEFT_CORNER,f.CLONE_BOTTOM_LEFT_CORNER,f.CLONE_DEBUG]},registerOverlay:function(e,t){if(-1===f.CLONE_TYPES.indexOf(e))throw new Error("Unsupported overlay ("+e+").");d[e]=t},createOverlay:function(e,t){return new d[e](t)},isOverlayTypeOf:function(e,t){return e&&d[t]?e instanceof d[t]:!1}}),window.WalkontableOverlay=h},{eventManager:41,"helpers/dom/element":45,"helpers/object":50}],12:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableDebugOverlay:{get:function(){return a}},__esModule:{value:!0}});var o,r,i=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}).addClass,s=(r=e("_base"),r&&r.__esModule&&r||{"default":r}).WalkontableOverlay,a=function(e){$traceurRuntime.superConstructor(l).call(this,e),this.clone=this.makeClone(s.CLONE_DEBUG),this.clone.wtTable.holder.style.opacity=.4,this.clone.wtTable.holder.style.textShadow="0 0 2px #ff0000",i(this.clone.wtTable.holder.parentNode,"wtDebugVisible")},l=a;$traceurRuntime.createClass(a,{},{},s),window.WalkontableDebugOverlay=a,s.registerOverlay(s.CLONE_DEBUG,a)},{_base:11,"helpers/dom/element":45}],13:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableLeftOverlay:{get:function(){return m}},__esModule:{value:!0}});var o,r,i=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),s=i.addClass,a=i.getScrollbarWidth,l=i.getScrollLeft,u=i.getWindowScrollTop,c=i.hasClass,d=i.outerWidth,h=i.innerHeight,f=i.removeClass,p=i.setOverlayPosition,g=(r=e("_base"),r&&r.__esModule&&r||{"default":r}).WalkontableOverlay,m=function(e){$traceurRuntime.superConstructor(v).call(this,e),this.clone=this.makeClone(g.CLONE_LEFT)},v=m;$traceurRuntime.createClass(m,{shouldBeRendered:function(){return this.wot.getSetting("fixedColumnsLeft")||this.wot.getSetting("rowHeaders").length?!0:!1},resetFixedPosition:function(){if(this.needFullRender&&this.wot.wtTable.holder.parentNode){var e=this.clone.wtTable.holder.parentNode,t=0,n=this.wot.getSetting("preventOverflow");if(this.trimmingContainer!==window||n&&"horizontal"===n)t=this.getScrollPosition();else{var o,r,i=this.wot.wtTable.hider.getBoundingClientRect(),s=Math.ceil(i.left),a=Math.ceil(i.right);r=this.wot.wtTable.hider.style.top,r=""===r?0:r,o=0>s&&a-e.offsetWidth>0?-s:0,t=o,o+="px",p(e,o,r)}this.adjustHeaderBordersPosition(t),this.adjustElementsSize()}},setScrollPosition:function(e){this.mainTableScrollableElement===window?window.scrollTo(e,u()):this.mainTableScrollableElement.scrollLeft=e},onScroll:function(){this.wot.getSetting("onScrollVertically")},sumCellSizes:function(e,t){for(var n=0,o=this.wot.wtSettings.defaultColumnWidth;t>e;)n+=this.wot.wtTable.getStretchedColumnWidth(e)||o,e++;return n},adjustElementsSize:function(){var e=void 0!==arguments[0]?arguments[0]:!1;(this.needFullRender||e)&&(this.adjustRootElementSize(),this.adjustRootChildrenSize(),e||(this.areElementSizesAdjusted=!0))},adjustRootElementSize:function(){var e,t=this.wot.wtTable.holder,n=t.clientHeight===t.offsetHeight?0:a(),o=this.clone.wtTable.holder.parentNode,r=o.style,i=this.wot.getSetting("preventOverflow");if(this.trimmingContainer!==window||"vertical"===i){var s=this.wot.wtViewport.getWorkspaceHeight()-n;s=Math.min(s,h(this.wot.wtTable.wtRootElement)),r.height=s+"px"}this.clone.wtTable.holder.style.height=r.height,e=d(this.clone.wtTable.TABLE),r.width=(0===e?e:e+4)+"px"},adjustRootChildrenSize:function(){var e=a();this.clone.wtTable.hider.style.height=this.hider.style.height,this.clone.wtTable.holder.style.height=this.clone.wtTable.holder.parentNode.style.height,0===e&&(e=30),this.clone.wtTable.holder.style.width=parseInt(this.clone.wtTable.holder.parentNode.style.width,10)+e+"px"},applyToDOM:function(){var e=this.wot.getSetting("totalColumns");if(this.areElementSizesAdjusted||this.adjustElementsSize(),"number"==typeof this.wot.wtViewport.columnsRenderCalculator.startPosition)this.spreader.style.left=this.wot.wtViewport.columnsRenderCalculator.startPosition+"px";else{if(0!==e)throw new Error("Incorrect value of the columnsRenderCalculator");this.spreader.style.left="0"}this.spreader.style.right="",this.needFullRender&&this.syncOverlayOffset()},syncOverlayOffset:function(){"number"==typeof this.wot.wtViewport.rowsRenderCalculator.startPosition?this.clone.wtTable.spreader.style.top=this.wot.wtViewport.rowsRenderCalculator.startPosition+"px":this.clone.wtTable.spreader.style.top=""},scrollTo:function(e,t){var n=this.getTableParentOffset(),o=this.wot.cloneSource?this.wot.cloneSource:this.wot,r=o.wtTable.holder,i=0;t&&r.offsetWidth!==r.clientWidth&&(i=a()),t?(n+=this.sumCellSizes(0,e+1),n-=this.wot.wtViewport.getViewportWidth()):n+=this.sumCellSizes(this.wot.getSetting("fixedColumnsLeft"),e),n+=i,this.setScrollPosition(n)},getTableParentOffset:function(){var e=this.wot.getSetting("preventOverflow"),t=0;return e||this.trimmingContainer!==window||(t=this.wot.wtTable.holderOffset.left),t},getScrollPosition:function(){return l(this.mainTableScrollableElement)},adjustHeaderBordersPosition:function(e){var t=this.wot.wtTable.holder.parentNode,n=this.wot.getSetting("rowHeaders"),o=this.wot.getSetting("fixedColumnsLeft");if(o&&!n.length)s(t,"innerBorderLeft");else if(!o&&n.length){var r=c(t,"innerBorderLeft");e?s(t,"innerBorderLeft"):f(t,"innerBorderLeft"),(!r&&e||r&&!e)&&this.wot.wtOverlays.adjustElementsSize()}}},{},g),window.WalkontableLeftOverlay=m,g.registerOverlay(g.CLONE_LEFT,m)},{_base:11,"helpers/dom/element":45}],14:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableTopOverlay:{get:function(){return m}},__esModule:{value:!0}});var o,r,i=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),s=i.addClass,a=i.getScrollbarWidth,l=i.getScrollTop,u=i.getWindowScrollLeft,c=i.hasClass,d=i.outerHeight,h=i.innerWidth,f=i.removeClass,p=i.setOverlayPosition,g=(r=e("_base"),r&&r.__esModule&&r||{"default":r}).WalkontableOverlay,m=function(e){$traceurRuntime.superConstructor(v).call(this,e),this.clone=this.makeClone(g.CLONE_TOP)},v=m;$traceurRuntime.createClass(m,{shouldBeRendered:function(){return this.wot.getSetting("fixedRowsTop")||this.wot.getSetting("columnHeaders").length?!0:!1},resetFixedPosition:function(){if(this.needFullRender&&this.wot.wtTable.holder.parentNode){var e=this.clone.wtTable.holder.parentNode,t=0,n=this.wot.getSetting("preventOverflow");if(this.trimmingContainer!==window||n&&"vertical"===n)t=this.getScrollPosition();else{var o,r,i=this.wot.wtTable.hider.getBoundingClientRect(),s=Math.ceil(i.top),a=Math.ceil(i.bottom);o=this.wot.wtTable.hider.style.left,o=""===o?0:o,r=0>s&&a-e.offsetHeight>0?-s:0,t=r,r+="px",p(e,o,r)}this.adjustHeaderBordersPosition(t),this.adjustElementsSize()}},setScrollPosition:function(e){this.mainTableScrollableElement===window?window.scrollTo(u(),e):this.mainTableScrollableElement.scrollTop=e},onScroll:function(){this.wot.getSetting("onScrollHorizontally")},sumCellSizes:function(e,t){for(var n=0,o=this.wot.wtSettings.settings.defaultRowHeight;t>e;){var r=this.wot.wtTable.getRowHeight(e);n+=void 0===r?o:r,e++}return n},adjustElementsSize:function(){var e=void 0!==arguments[0]?arguments[0]:!1;(this.needFullRender||e)&&(this.adjustRootElementSize(),this.adjustRootChildrenSize(),e||(this.areElementSizesAdjusted=!0))},adjustRootElementSize:function(){var e,t=this.wot.wtTable.holder,n=t.clientWidth===t.offsetWidth?0:a(),o=this.clone.wtTable.holder.parentNode,r=o.style,i=this.wot.getSetting("preventOverflow");if(this.trimmingContainer!==window||"horizontal"===i){var s=this.wot.wtViewport.getWorkspaceWidth()-n;s=Math.min(s,h(this.wot.wtTable.wtRootElement)),r.width=s+"px"}this.clone.wtTable.holder.style.width=r.width,e=d(this.clone.wtTable.TABLE),r.height=(0===e?e:e+4)+"px"},adjustRootChildrenSize:function(){var e=a();this.clone.wtTable.hider.style.width=this.hider.style.width,this.clone.wtTable.holder.style.width=this.clone.wtTable.holder.parentNode.style.width,0===e&&(e=30),this.clone.wtTable.holder.style.height=parseInt(this.clone.wtTable.holder.parentNode.style.height,10)+e+"px"},applyToDOM:function(){var e=this.wot.getSetting("totalRows");if(this.areElementSizesAdjusted||this.adjustElementsSize(),"number"==typeof this.wot.wtViewport.rowsRenderCalculator.startPosition)this.spreader.style.top=this.wot.wtViewport.rowsRenderCalculator.startPosition+"px";else{if(0!==e)throw new Error("Incorrect value of the rowsRenderCalculator");this.spreader.style.top="0"}this.spreader.style.bottom="",this.needFullRender&&this.syncOverlayOffset()},syncOverlayOffset:function(){"number"==typeof this.wot.wtViewport.columnsRenderCalculator.startPosition?this.clone.wtTable.spreader.style.left=this.wot.wtViewport.columnsRenderCalculator.startPosition+"px":this.clone.wtTable.spreader.style.left=""},scrollTo:function(e,t){var n=this.getTableParentOffset(),o=this.wot.cloneSource?this.wot.cloneSource:this.wot,r=o.wtTable.holder,i=0;if(t&&r.offsetHeight!==r.clientHeight&&(i=a()),t){var s=this.wot.getSetting("fixedRowsBottom"),l=(this.wot.getSetting("fixedRowsTop"),this.wot.getSetting("totalRows"));n+=this.sumCellSizes(0,e+1),n-=this.wot.wtViewport.getViewportHeight()-this.sumCellSizes(l-s,l),n+=1}else n+=this.sumCellSizes(this.wot.getSetting("fixedRowsTop"),e);n+=i,this.setScrollPosition(n)},getTableParentOffset:function(){return this.mainTableScrollableElement===window?this.wot.wtTable.holderOffset.top:0},getScrollPosition:function(){return l(this.mainTableScrollableElement)},adjustHeaderBordersPosition:function(e){if(0===this.wot.getSetting("fixedRowsTop")&&this.wot.getSetting("columnHeaders").length>0){var t=this.wot.wtTable.holder.parentNode,n=c(t,"innerBorderTop");e||0===this.wot.getSetting("totalRows")?s(t,"innerBorderTop"):f(t,"innerBorderTop"),(!n&&e||n&&!e)&&this.wot.wtOverlays.adjustElementsSize()}if(0===this.wot.getSetting("rowHeaders").length){var o=this.clone.wtTable.THEAD.querySelectorAll("th:nth-of-type(2)");if(o)for(var r=0;ru&&d-e.offsetWidth>0&&(h=-u+"px"),o&&"horizontal"!==o||0>i&&c-e.offsetHeight>0&&(f=-i+"px"),l(e,h,f)}e.style.height=(0===t?t:t+4)+"px",e.style.width=(0===n?n:n+4)+"px"}}},{},u),window.WalkontableTopLeftCornerOverlay=c,u.registerOverlay(u.CLONE_TOP_LEFT_CORNER,c)},{_base:11,"helpers/dom/element":45}],16:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableOverlays:{get:function(){return f}},__esModule:{value:!0}});var o,r,i,s=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),a=s.getScrollableElement,l=s.getScrollbarWidth,u=s.getScrollLeft,c=s.getScrollTop,d=(r=e("helpers/unicode"),r&&r.__esModule&&r||{"default":r}).isKey,h=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).EventManager,f=function(e){this.wot=e,this.instance=this.wot,this.eventManager=new h(this.wot),this.wot.update("scrollbarWidth",l()),this.wot.update("scrollbarHeight",l()),this.scrollableElement=a(this.wot.wtTable.TABLE),this.topOverlay=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_TOP,this.wot),"undefined"==typeof WalkontableBottomOverlay?this.bottomOverlay={needFullRender:!1}:this.bottomOverlay=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_BOTTOM,this.wot),this.leftOverlay=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_LEFT,this.wot),this.topOverlay.needFullRender&&this.leftOverlay.needFullRender&&(this.topLeftCornerOverlay=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_TOP_LEFT_CORNER,this.wot)),this.bottomOverlay.needFullRender&&this.leftOverlay.needFullRender&&"undefined"!=typeof WalkontableBottomLeftCornerOverlay?this.bottomLeftCornerOverlay=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER,this.wot):this.bottomLeftCornerOverlay={needFullRender:!1},this.wot.getSetting("debug")&&(this.debug=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_DEBUG,this.wot)),this.destroyed=!1,this.keyPressed=!1,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.pendingScrollCallbacks={master:{top:0,left:0},top:{left:0},bottom:{left:0},left:{top:0}},this.verticalScrolling=!1,this.horizontalScrolling=!1,this.delegatedScrollCallback=!1,this.registerListeners()};$traceurRuntime.createClass(f,{refreshAll:function(){if(this.wot.drawn){if(!this.wot.wtTable.holder.parentNode)return void this.destroy();this.wot.draw(!0),this.verticalScrolling&&this.leftOverlay.onScroll(),this.horizontalScrolling&&this.topOverlay.onScroll(),this.verticalScrolling=!1,this.horizontalScrolling=!1}},registerListeners:function(){var e=this;this.eventManager.addEventListener(document.documentElement,"keydown",function(t){return e.onKeyDown(t)}),this.eventManager.addEventListener(document.documentElement,"keyup",function(){return e.onKeyUp()}),this.eventManager.addEventListener(document,"visibilitychange",function(){return e.onKeyUp()});var t=this.topOverlay.mainTableScrollableElement,n=this.leftOverlay.mainTableScrollableElement;this.eventManager.addEventListener(t,"scroll",function(t){return e.onTableScroll(t)}),t!==n&&this.eventManager.addEventListener(n,"scroll",function(t){return e.onTableScroll(t)}),this.topOverlay.needFullRender&&(this.eventManager.addEventListener(this.topOverlay.clone.wtTable.holder,"scroll",function(t){return e.onTableScroll(t)}),this.eventManager.addEventListener(this.topOverlay.clone.wtTable.holder,"wheel",function(t){return e.onTableScroll(t)})),this.bottomOverlay.needFullRender&&(this.eventManager.addEventListener(this.bottomOverlay.clone.wtTable.holder,"scroll",function(t){return e.onTableScroll(t)}),this.eventManager.addEventListener(this.bottomOverlay.clone.wtTable.holder,"wheel",function(t){return e.onTableScroll(t)})),this.leftOverlay.needFullRender&&(this.eventManager.addEventListener(this.leftOverlay.clone.wtTable.holder,"scroll",function(t){return e.onTableScroll(t)}),this.eventManager.addEventListener(this.leftOverlay.clone.wtTable.holder,"wheel",function(t){return e.onTableScroll(t)})),this.topOverlay.trimmingContainer!==window&&this.leftOverlay.trimmingContainer!==window&&this.eventManager.addEventListener(window,"wheel",function(t){var n,o=t.wheelDeltaY||t.deltaY,r=t.wheelDeltaX||t.deltaX;e.topOverlay.clone.wtTable.holder.contains(t.realTarget)?n="top":e.bottomOverlay.clone&&e.bottomOverlay.clone.wtTable.holder.contains(t.realTarget)?n="bottom":e.leftOverlay.clone.wtTable.holder.contains(t.realTarget)&&(n="left"),"top"==n&&0!==o?t.preventDefault():"left"==n&&0!==r?t.preventDefault():"bottom"==n&&0!==o&&t.preventDefault()})},onTableScroll:function(e){if(!Handsontable.mobileBrowser){var t=this.leftOverlay.mainTableScrollableElement,n=this.topOverlay.mainTableScrollableElement,o=e.target;this.keyPressed&&(n!==window&&o!==window&&!e.target.contains(n)||t!==window&&o!==window&&!e.target.contains(t))||("scroll"===e.type?this.syncScrollPositions(e):this.translateMouseWheelToScroll(e))}},onKeyDown:function(e){this.keyPressed=d(e.keyCode,"ARROW_UP|ARROW_RIGHT|ARROW_DOWN|ARROW_LEFT")},onKeyUp:function(){this.keyPressed=!1},translateMouseWheelToScroll:function(e){var t,n=this.topOverlay.clone.wtTable.holder,o=this.bottomOverlay.clone?this.bottomOverlay.clone.wtTable.holder:null,r=this.leftOverlay.clone.wtTable.holder,i={type:"wheel"},s=e.target,a=e.wheelDeltaY||-1*e.deltaY,l=e.wheelDeltaX||-1*e.deltaX;for(1===e.deltaMode&&(a=120*a,l=120*l);s!=document&&null!=s;){if(s.className.indexOf("wtHolder")>-1){t=s;break}s=s.parentNode}return i.target=t,t==n?this.syncScrollPositions(i,-.2*a):t==o?this.syncScrollPositions(i,-.2*a):t==r&&this.syncScrollPositions(i,-.2*l),!1},syncScrollPositions:function(e){var t=void 0!==arguments[1]?arguments[1]:null;if(!this.destroyed){if(0===arguments.length)return void this.syncScrollWithMaster();var n,o,r,i=this.leftOverlay.mainTableScrollableElement,s=this.topOverlay.mainTableScrollableElement,a=e.target,l=0,d=!1,h=!1,f=this.wot.getSetting("preventOverflow");this.topOverlay.needFullRender&&(n=this.topOverlay.clone.wtTable.holder),this.bottomOverlay.needFullRender&&(r=this.bottomOverlay.clone.wtTable.holder),this.leftOverlay.needFullRender&&(o=this.leftOverlay.clone.wtTable.holder),a===document&&(a=window),a===i||a===s?(l=u(f?this.scrollableElement:a),this.horizontalScrolling=!0,this.overlayScrollPositions.master.left=l,d=!0,this.pendingScrollCallbacks.master.left>0?this.pendingScrollCallbacks.master.left--:(n&&n.scrollLeft!==l&&(null==t&&this.pendingScrollCallbacks.top.left++,n.scrollLeft=l,h=i!==window),r&&r.scrollLeft!==l&&(null==t&&this.pendingScrollCallbacks.bottom.left++,r.scrollLeft=l,h=i!==window)),l=c(a),this.verticalScrolling=!0,this.overlayScrollPositions.master.top=l,d=!0,this.pendingScrollCallbacks.master.top>0?this.pendingScrollCallbacks.master.top--:o&&o.scrollTop!==l&&(null==t&&this.pendingScrollCallbacks.left.top++,o.scrollTop=l,h=s!==window)):a===r?(l=u(a),this.horizontalScrolling=!0,this.overlayScrollPositions.bottom.left=l,d=!0,this.pendingScrollCallbacks.bottom.left>0?this.pendingScrollCallbacks.bottom.left--:(null==t&&this.pendingScrollCallbacks.master.left++,i.scrollLeft=l,n&&n.scrollLeft!==l&&(null==t&&this.pendingScrollCallbacks.top.left++,n.scrollLeft=l,h=s!==window)),null!==t&&(d=!0,s.scrollTop+=t)):a===n?(l=u(a),this.horizontalScrolling=!0,this.overlayScrollPositions.top.left=l,d=!0,this.pendingScrollCallbacks.top.left>0?this.pendingScrollCallbacks.top.left--:(null==t&&this.pendingScrollCallbacks.master.left++,i.scrollLeft=l),null!==t&&(d=!0,s.scrollTop+=t),r&&r.scrollLeft!==l&&(null==t&&this.pendingScrollCallbacks.bottom.left++,r.scrollLeft=l,h=s!==window)):a===o&&(l=c(a),this.overlayScrollPositions.left.top!==l&&(this.verticalScrolling=!0,this.overlayScrollPositions.left.top=l,d=!0,this.pendingScrollCallbacks.left.top>0?this.pendingScrollCallbacks.left.top--:(null==t&&this.pendingScrollCallbacks.master.top++,s.scrollTop=l)),null!==t&&(d=!0,s.scrollLeft+=t)),!this.keyPressed&&d&&"scroll"===e.type&&(this.delegatedScrollCallback?this.delegatedScrollCallback=!1:this.refreshAll(),h&&(this.delegatedScrollCallback=!0))}},syncScrollWithMaster:function(){var e=this.topOverlay.mainTableScrollableElement;this.topOverlay.needFullRender&&(this.topOverlay.clone.wtTable.holder.scrollLeft=e.scrollLeft),this.leftOverlay.needFullRender&&(this.leftOverlay.clone.wtTable.holder.scrollTop=e.scrollTop)},destroy:function(){this.eventManager.destroy(),this.topOverlay.destroy(),this.bottomOverlay.clone&&this.bottomOverlay.destroy(),this.leftOverlay.destroy(),this.topLeftCornerOverlay&&this.topLeftCornerOverlay.destroy(),this.bottomLeftCornerOverlay&&this.bottomLeftCornerOverlay.clone&&this.bottomLeftCornerOverlay.destroy(),this.debug&&this.debug.destroy(),this.destroyed=!0},refresh:function(){var e=void 0!==arguments[0]?arguments[0]:!1;if(this.topOverlay.areElementSizesAdjusted&&this.leftOverlay.areElementSizesAdjusted){var t=this.wot.wtTable.wtRootElement.parentNode||this.wot.wtTable.wtRootElement,n=t.clientWidth,o=t.clientHeight;(n!==this.spreaderLastSize.width||o!==this.spreaderLastSize.height)&&(this.spreaderLastSize.width=n,this.spreaderLastSize.height=o,this.adjustElementsSize())}this.bottomOverlay.clone&&this.bottomOverlay.refresh(e),this.leftOverlay.refresh(e),this.topOverlay.refresh(e),this.topLeftCornerOverlay&&this.topLeftCornerOverlay.refresh(e),this.bottomLeftCornerOverlay&&this.bottomLeftCornerOverlay.clone&&this.bottomLeftCornerOverlay.refresh(e),this.debug&&this.debug.refresh(e)},adjustElementsSize:function(){var e=void 0!==arguments[0]?arguments[0]:!1,t=this.wot.getSetting("totalColumns"),n=this.wot.getSetting("totalRows"),o=this.wot.wtViewport.getRowHeaderWidth(),r=this.wot.wtViewport.getColumnHeaderHeight(),i=this.wot.wtTable.hider.style;i.width=o+this.leftOverlay.sumCellSizes(0,t)+"px",i.height=r+this.topOverlay.sumCellSizes(0,n)+1+"px",this.topOverlay.adjustElementsSize(e),this.leftOverlay.adjustElementsSize(e),this.bottomOverlay.clone&&this.bottomOverlay.adjustElementsSize(e)},applyToDOM:function(){this.topOverlay.areElementSizesAdjusted&&this.leftOverlay.areElementSizesAdjusted||this.adjustElementsSize(),this.topOverlay.applyToDOM(),this.bottomOverlay.clone&&this.bottomOverlay.applyToDOM(),this.leftOverlay.applyToDOM()}},{}),window.WalkontableOverlays=f},{eventManager:41,"helpers/dom/element":45,"helpers/unicode":53}],17:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableScroll:{get:function(){return p}},__esModule:{value:!0}});var o,r,i=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),s=i.innerHeight,a=i.innerWidth,l=i.getScrollLeft,u=i.getScrollTop,c=i.offset,d=(r=e("helpers/number"),r&&r.__esModule&&r||{"default":r}),h=d.rangeEach,f=d.rangeEachReverse,p=function(e){this.wot=e,this.instance=e};$traceurRuntime.createClass(p,{scrollViewport:function(e){if(this.wot.drawn){var t=this._getVariables(),n=t.topOverlay,o=t.leftOverlay,r=t.totalRows,i=t.totalColumns,s=t.fixedRowsTop,a=t.fixedRowsBottom,l=t.fixedColumnsLeft;if(e.row<0||e.row>r-1)throw new Error("row "+e.row+" does not exist");if(e.col<0||e.col>i-1)throw new Error("column "+e.col+" does not exist");e.row>=s&&e.rowthis.getLastVisibleRow()&&e.row=l&&e.colthis.getLastVisibleColumn()&&o.scrollTo(e.col,!0)}},getFirstVisibleRow:function(){var e=this._getVariables(),t=e.topOverlay,n=e.wtTable,o=e.wtViewport,r=e.totalRows,i=e.fixedRowsTop,a=n.getFirstVisibleRow();if(t.mainTableScrollableElement===window){var l=c(n.wtRootElement),d=s(n.hider),h=s(window),p=u(window);if(l.top+d-h<=p){var g=o.getColumnHeaderHeight();g+=t.sumCellSizes(0,i),f(r,1,function(e){return g+=t.sumCellSizes(e-1,e),l.top+d-g<=p?(a=e,!1):void 0})}}return a},getLastVisibleRow:function(){var e=this._getVariables(),t=e.topOverlay,n=e.wtTable,o=e.wtViewport,r=e.totalRows,i=n.getLastVisibleRow();if(t.mainTableScrollableElement===window){var a=c(n.wtRootElement),l=s(window),d=u(window);if(a.top>d){var f=o.getColumnHeaderHeight();h(1,r,function(e){return f+=t.sumCellSizes(e-1,e),a.top+f-d>=l?(i=e-2,!1):void 0})}}return i},getFirstVisibleColumn:function(){var e=this._getVariables(),t=e.leftOverlay,n=e.wtTable,o=e.wtViewport,r=e.totalColumns,i=(e.fixedColumnsLeft,n.getFirstVisibleColumn());if(t.mainTableScrollableElement===window){var s=c(n.wtRootElement),u=a(n.hider),d=a(window),h=l(window);if(s.left+u-d<=h){var p=o.getRowHeaderWidth();f(r,1,function(e){return p+=t.sumCellSizes(e-1,e),s.left+u-p<=h?(i=e,!1):void 0})}}return i},getLastVisibleColumn:function(){var e=this._getVariables(),t=e.leftOverlay,n=e.wtTable,o=e.wtViewport,r=e.totalColumns,i=n.getLastVisibleColumn();if(t.mainTableScrollableElement===window){var s=c(n.wtRootElement),u=a(window),d=l(window);if(s.left>d){var f=o.getRowHeaderWidth();h(1,r,function(e){return f+=t.sumCellSizes(e-1,e),s.left+f-d>=u?(i=e-2,!1):void 0})}}return i},_getVariables:function(){var e=this.wot,t=e.wtOverlays.topOverlay,n=e.wtOverlays.leftOverlay,o=e.wtTable,r=e.wtViewport,i=e.getSetting("totalRows"),s=e.getSetting("totalColumns"),a=e.getSetting("fixedRowsTop"),l=e.getSetting("fixedRowsBottom"),u=e.getSetting("fixedColumnsLeft");return{topOverlay:t,leftOverlay:n,wtTable:o,wtViewport:r,totalRows:i,totalColumns:s,fixedRowsTop:a,fixedRowsBottom:l,fixedColumnsLeft:u}}},{}),window.WalkontableScroll=p},{"helpers/dom/element":45,"helpers/number":49}],18:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableSelection:{get:function(){return d}},__esModule:{value:!0}});var o,r,i,s,a=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}).addClass,l=(r=e("border"),r&&r.__esModule&&r||{"default":r}).WalkontableBorder,u=(i=e("cell/coords"),i&&i.__esModule&&i||{"default":i}).WalkontableCellCoords,c=(s=e("cell/range"),s&&s.__esModule&&s||{"default":s}).WalkontableCellRange,d=function(e,t){this.settings=e,this.cellRange=t||null,this.instanceBorders={}};$traceurRuntime.createClass(d,{getBorder:function(e){return this.instanceBorders[e.guid]?this.instanceBorders[e.guid]:void(this.instanceBorders[e.guid]=new l(e,this.settings))},isEmpty:function(){return null===this.cellRange},add:function(e){this.isEmpty()?this.cellRange=new c(e,e,e):this.cellRange.expand(e)},replace:function(e,t){if(!this.isEmpty()){if(this.cellRange.from.isEqual(e))return this.cellRange.from=t,!0;if(this.cellRange.to.isEqual(e))return this.cellRange.to=t,!0}return!1},clear:function(){this.cellRange=null},getCorners:function(){var e=this.cellRange.getTopLeftCorner(),t=this.cellRange.getBottomRightCorner();return[e.row,e.col,t.row,t.col]},addClassAtCoords:function(e,t,n,o){var r=e.wtTable.getCell(new u(t,n));"object"==typeof r&&a(r,o)},draw:function(e){if(this.isEmpty()){if(this.settings.border){var t=this.getBorder(e);t&&t.disappear()}}else{for(var n,o,r,i=e.wtTable.getRenderedRowsCount(),s=e.wtTable.getRenderedColumnsCount(),l=this.getCorners(),u=0;s>u;u++)o=e.wtTable.columnFilter.renderedToSource(u),o>=l[1]&&o<=l[3]&&(r=e.wtTable.getColumnHeader(o),r&&this.settings.highlightColumnClassName&&a(r,this.settings.highlightColumnClassName));for(var c=0;i>c;c++){n=e.wtTable.rowFilter.renderedToSource(c),n>=l[0]&&n<=l[2]&&(r=e.wtTable.getRowHeader(n),r&&this.settings.highlightRowClassName&&a(r,this.settings.highlightRowClassName));for(var d=0;s>d;d++)o=e.wtTable.columnFilter.renderedToSource(d),n>=l[0]&&n<=l[2]&&o>=l[1]&&o<=l[3]?this.settings.className&&this.addClassAtCoords(e,n,o,this.settings.className):n>=l[0]&&n<=l[2]?this.settings.highlightRowClassName&&this.addClassAtCoords(e,n,o,this.settings.highlightRowClassName):o>=l[1]&&o<=l[3]&&this.settings.highlightColumnClassName&&this.addClassAtCoords(e,n,o,this.settings.highlightColumnClassName)}if(e.getSetting("onBeforeDrawBorders",l,this.settings.className),this.settings.border){var h=this.getBorder(e);h&&h.appear(l)}}}},{}),window.WalkontableSelection=d},{border:2,"cell/coords":5,"cell/range":6,"helpers/dom/element":45}],19:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableSettings:{get:function(){return i}},__esModule:{value:!0}});var o,r=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}).fastInnerText,i=function(e,t){var n=this;this.wot=e,this.instance=e,this.defaults={table:void 0,debug:!1,externalRowCalculator:!1,stretchH:"none",currentRowClassName:null,currentColumnClassName:null,preventOverflow:function(){return!1},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(e,t,o){var i=n.getSetting("data",e,t);r(o,void 0===i||null===i?"":i)},columnWidth:function(e){},rowHeight:function(e){},defaultRowHeight:23,defaultColumnWidth:50,selections:null,hideBorderOnMouseDownOver:!1,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(e){return e},scrollbarWidth:10,scrollbarHeight:10,renderAllRows:!1,groups:!1,rowHeaderWidth:null,columnHeaderHeight:null},this.settings={};for(var o in this.defaults)if(this.defaults.hasOwnProperty(o))if(void 0!==t[o])this.settings[o]=t[o];else{if(void 0===this.defaults[o])throw new Error('A required setting "'+o+'" was not provided');this.settings[o]=this.defaults[o]}};$traceurRuntime.createClass(i,{update:function(e,t){if(void 0===t)for(var n in e)e.hasOwnProperty(n)&&(this.settings[n]=e[n]);else this.settings[e]=t;return this.wot},getSetting:function(e,t,n,o,r){ -return"function"==typeof this.settings[e]?this.settings[e](t,n,o,r):void 0!==t&&Array.isArray(this.settings[e])?this.settings[e][t]:this.settings[e]},has:function(e){return!!this.settings[e]}},{}),window.WalkontableSettings=i},{"helpers/dom/element":45}],20:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableTable:{get:function(){return _}},__esModule:{value:!0}});var o,r,i,s,a,l,u=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),c=u.getStyle,d=u.getTrimmingContainer,h=u.hasClass,f=u.index,p=u.offset,g=u.removeClass,m=u.removeTextNodes,v=u.overlayContainsElement,w=u.closest,y=(r=e("cell/coords"),r&&r.__esModule&&r||{"default":r}).WalkontableCellCoords,b=((i=e("cell/range"),i&&i.__esModule&&i||{"default":i}).WalkontableCellRange,(s=e("filter/column"),s&&s.__esModule&&s||{"default":s}).WalkontableColumnFilter),C=(a=e("filter/row"),a&&a.__esModule&&a||{"default":a}).WalkontableRowFilter,R=(l=e("tableRenderer"),l&&l.__esModule&&l||{"default":l}).WalkontableTableRenderer,_=function(e,t){this.wot=e,this.instance=this.wot,this.TABLE=t,this.TBODY=null,this.THEAD=null,this.COLGROUP=null,this.tableOffset=0,this.holderOffset=0,m(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(_,{fixTableDomTree:function(){this.TBODY=this.TABLE.querySelector("tbody"),this.TBODY||(this.TBODY=document.createElement("tbody"),this.TABLE.appendChild(this.TBODY)),this.THEAD=this.TABLE.querySelector("thead"),this.THEAD||(this.THEAD=document.createElement("thead"),this.TABLE.insertBefore(this.THEAD,this.TBODY)),this.COLGROUP=this.TABLE.querySelector("colgroup"),this.COLGROUP||(this.COLGROUP=document.createElement("colgroup"),this.TABLE.insertBefore(this.COLGROUP,this.THEAD)),this.wot.getSetting("columnHeaders").length&&!this.THEAD.childNodes.length&&this.THEAD.appendChild(document.createElement("TR"))},createSpreader:function(e){var t,n=e.parentNode;return n&&1===n.nodeType&&h(n,"wtHolder")||(t=document.createElement("div"),t.className="wtSpreader",n&&n.insertBefore(t,e),t.appendChild(e)),t.style.position="relative",t},createHider:function(e){var t,n=e.parentNode;return n&&1===n.nodeType&&h(n,"wtHolder")||(t=document.createElement("div"),t.className="wtHider",n&&n.insertBefore(t,e),t.appendChild(e)),t},createHolder:function(e){var t,n=e.parentNode;return n&&1===n.nodeType&&h(n,"wtHolder")||(t=document.createElement("div"),t.style.position="relative",t.className="wtHolder",n&&n.insertBefore(t,e),this.isWorkingOnClone()||(t.parentNode.className+="ht_master handsontable"),t.appendChild(e)),t},alignOverlaysWithTrimmingContainer:function(){var e=d(this.wtRootElement);if(!this.isWorkingOnClone())if(this.holder.parentNode.style.position="relative",e===window){var t=this.wot.getSetting("preventOverflow");t||(this.holder.style.overflow="visible",this.wtRootElement.style.overflow="visible")}else this.holder.style.width=c(e,"width"),this.holder.style.height=c(e,"height"),this.holder.style.overflow=""},isWorkingOnClone:function(){return!!this.wot.cloneSource},draw:function(e){var t=this.instance.getSetting("totalRows");if(this.isWorkingOnClone()||(this.holderOffset=p(this.holder),e=this.wot.wtViewport.createRenderCalculators(e)),e)this.isWorkingOnClone()||this.wot.wtViewport.createVisibleCalculators(),this.wot.wtOverlays&&this.wot.wtOverlays.refresh(!0);else{this.isWorkingOnClone()?this.tableOffset=this.wot.cloneSource.wtTable.tableOffset:this.tableOffset=p(this.TABLE);var n;n=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)?0:WalkontableOverlay.isOverlayTypeOf(this.instance.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM)||WalkontableOverlay.isOverlayTypeOf(this.instance.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER)?Math.max(t-this.wot.getSetting("fixedRowsBottom"),0):this.wot.wtViewport.rowsRenderCalculator.startRow;var o;o=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)?0:this.wot.wtViewport.columnsRenderCalculator.startColumn,this.rowFilter=new C(n,t,this.wot.getSetting("columnHeaders").length),this.columnFilter=new b(o,this.wot.getSetting("totalColumns"),this.wot.getSetting("rowHeaders").length),this._doDraw(),this.alignOverlaysWithTrimmingContainer()}return this.refreshSelections(e),this.isWorkingOnClone()||(this.wot.wtOverlays.topOverlay.resetFixedPosition(),this.wot.wtOverlays.bottomOverlay.clone&&this.wot.wtOverlays.bottomOverlay.resetFixedPosition(),this.wot.wtOverlays.leftOverlay.resetFixedPosition(),this.wot.wtOverlays.topLeftCornerOverlay&&this.wot.wtOverlays.topLeftCornerOverlay.resetFixedPosition(),this.instance.wtOverlays.bottomLeftCornerOverlay&&this.instance.wtOverlays.bottomLeftCornerOverlay.clone&&this.wot.wtOverlays.bottomLeftCornerOverlay.resetFixedPosition()),this.wot.drawn=!0,this},_doDraw:function(){var e=new R(this);e.render()},removeClassFromCells:function(e){for(var t=this.TABLE.querySelectorAll("."+e),n=0,o=t.length;o>n;n++)g(t[n],e)},refreshSelections:function(e){if(this.wot.selections){var t=this.wot.selections.length;if(e)for(var n=0;t>n;n++)this.wot.selections[n].settings.className&&this.removeClassFromCells(this.wot.selections[n].settings.className),this.wot.selections[n].settings.highlightRowClassName&&this.removeClassFromCells(this.wot.selections[n].settings.highlightRowClassName),this.wot.selections[n].settings.highlightColumnClassName&&this.removeClassFromCells(this.wot.selections[n].settings.highlightColumnClassName);for(var o=0;t>o;o++)this.wot.selections[o].draw(this.wot,e)}},getCell:function(e){if(this.isRowBeforeRenderedRows(e.row))return-1;if(this.isRowAfterRenderedRows(e.row))return-2;var t=this.TBODY.childNodes[this.rowFilter.sourceToRendered(e.row)];return t?t.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(e.col)]:void 0},getColumnHeader:function(e){var t=void 0!==arguments[1]?arguments[1]:0,n=this.THEAD.childNodes[t];return n?n.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(e)]:void 0},getRowHeader:function(e){if(0===this.columnFilter.sourceColumnToVisibleRowHeadedColumn(0))return null;var t=this.TBODY.childNodes[this.rowFilter.sourceToRendered(e)];return t?t.childNodes[0]:void 0},getCoords:function(e){"TD"!==e.nodeName&&"TH"!==e.nodeName&&(e=w(e,["TD","TH"]));var t=e.parentNode,n=t.parentNode,o=f(t),r=e.cellIndex;return v(WalkontableOverlay.CLONE_TOP_LEFT_CORNER,e)||v(WalkontableOverlay.CLONE_TOP,e)?"THEAD"===n.nodeName&&(o-=n.childNodes.length):o=n===this.THEAD?this.rowFilter.visibleColHeadedRowToSourceRow(o):this.rowFilter.renderedToSource(o),r=v(WalkontableOverlay.CLONE_TOP_LEFT_CORNER,e)||v(WalkontableOverlay.CLONE_LEFT,e)?this.columnFilter.offsettedTH(r):this.columnFilter.visibleRowHeadedColumnToSourceColumn(r),new y(o,r)},getTrForRow:function(e){return this.TBODY.childNodes[this.rowFilter.sourceToRendered(e)]},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(e){return this.rowFilter.sourceToRendered(e)<0&&e>=0},isRowAfterViewport:function(e){return this.rowFilter.sourceToRendered(e)>this.getLastVisibleRow()},isRowAfterRenderedRows:function(e){return this.rowFilter.sourceToRendered(e)>this.getLastRenderedRow()},isColumnBeforeViewport:function(e){return this.columnFilter.sourceToRendered(e)<0&&e>=0},isColumnAfterViewport:function(e){return this.columnFilter.sourceToRendered(e)>this.getLastVisibleColumn()},isLastRowFullyVisible:function(){return this.getLastVisibleRow()===this.getLastRenderedRow()},isLastColumnFullyVisible:function(){return this.getLastVisibleColumn()===this.getLastRenderedColumn()},getRenderedColumnsCount:function(){var e=this.wot.wtViewport.columnsRenderCalculator.count,t=this.wot.getSetting("totalColumns");if(this.wot.isOverlayName(WalkontableOverlay.CLONE_DEBUG))e=t;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"),t);return e},getRenderedRowsCount:function(){var e=this.wot.wtViewport.rowsRenderCalculator.count,t=this.wot.getSetting("totalRows");return this.wot.isOverlayName(WalkontableOverlay.CLONE_DEBUG)?e=t:this.wot.isOverlayName(WalkontableOverlay.CLONE_TOP)||this.wot.isOverlayName(WalkontableOverlay.CLONE_TOP_LEFT_CORNER)?e=Math.min(this.wot.getSetting("fixedRowsTop"),t):(this.wot.isOverlayName(WalkontableOverlay.CLONE_BOTTOM)||this.wot.isOverlayName(WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER))&&(e=Math.min(this.wot.getSetting("fixedRowsBottom"),t)),e},getVisibleRowsCount:function(){return this.wot.wtViewport.rowsVisibleCalculator.count},allRowsInViewport:function(){return this.wot.getSetting("totalRows")==this.getVisibleRowsCount()},getRowHeight:function(e){var t=this.wot.wtSettings.settings.rowHeight(e),n=this.wot.wtViewport.oversizedRows[e];return void 0!==n&&(t=void 0===t?n:Math.max(t,n)),t},getColumnHeaderHeight:function(e){var t=this.wot.wtSettings.settings.defaultRowHeight,n=this.wot.wtViewport.oversizedColumnHeaders[e];return void 0!==n&&(t=t?Math.max(t,n):n),t},getVisibleColumnsCount:function(){return this.wot.wtViewport.columnsVisibleCalculator.count},allColumnsInViewport:function(){return this.wot.getSetting("totalColumns")==this.getVisibleColumnsCount()},getColumnWidth:function(e){var t=this.wot.wtSettings.settings.columnWidth;return"function"==typeof t?t=t(e):"object"==typeof t&&(t=t[e]),t||this.wot.wtSettings.settings.defaultColumnWidth},getStretchedColumnWidth:function(e){var t=this.getColumnWidth(e),n=null==t?this.instance.wtSettings.settings.defaultColumnWidth:t,o=this.wot.wtViewport.columnsRenderCalculator;if(o){var r=o.getStretchedColumnWidth(e,n);r&&(n=r)}return n}},{}),window.WalkontableTable=_},{"cell/coords":5,"cell/range":6,"filter/column":9,"filter/row":10,"helpers/dom/element":45,tableRenderer:21}],21:[function(e,t,n){"use strict";function o(e,t){var n=document.createElement("TH");return t.insertBefore(n,e),t.removeChild(e),n}function r(e,t){var n=document.createElement("TD");return t.insertBefore(n,e),t.removeChild(e),n}Object.defineProperties(n,{WalkontableTableRenderer:{get:function(){return f}},__esModule:{value:!0}});var i,s=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),a=s.addClass,l=s.empty,u=s.getScrollbarWidth,c=s.hasClass,d=s.innerHeight,h=s.outerWidth,f=function(e){this.wtTable=e,this.wot=e.instance,this.instance=e.instance,this.rowFilter=e.rowFilter,this.columnFilter=e.columnFilter,this.TABLE=e.TABLE,this.THEAD=e.THEAD,this.TBODY=e.TBODY,this.COLGROUP=e.COLGROUP,this.rowHeaders=[],this.rowHeaderCount=0,this.columnHeaders=[],this.columnHeaderCount=0,this.fixedRowsTop=0,this.fixedRowsBottom=0};$traceurRuntime.createClass(f,{render:function(){this.wtTable.isWorkingOnClone()||this.wot.getSetting("beforeDraw",!0),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 e,t=this.wtTable.getRenderedColumnsCount(),n=this.wtTable.getRenderedRowsCount(),o=this.wot.getSetting("totalColumns"),r=this.wot.getSetting("totalRows"),i=!1;if((WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER))&&(this.columnHeaders=[],this.columnHeaderCount=0),o>0&&(this.adjustAvailableNodes(),i=!0,this.renderColumnHeaders(),this.renderRows(r,n,t),this.wtTable.isWorkingOnClone()||(e=this.wot.wtViewport.getWorkspaceWidth(),this.wot.wtViewport.containerWidth=null),this.adjustColumnHeaderHeights(),this.adjustColumnWidths(t),this.markOversizedColumns()),i||this.adjustAvailableNodes(),this.removeRedundantRows(n),(!this.wtTable.isWorkingOnClone()||this.wot.isOverlayName(WalkontableOverlay.CLONE_BOTTOM))&&this.markOversizedRows(),this.wtTable.isWorkingOnClone())this.wot.isOverlayName(WalkontableOverlay.CLONE_BOTTOM)&&this.wot.cloneSource.wtOverlays.adjustElementsSize();else{this.wot.wtViewport.createVisibleCalculators(),this.wot.wtOverlays.refresh(!1);var s=h(this.wtTable.hider),a=h(this.wtTable.TABLE);if(0!==s&&a!==s&&this.adjustColumnWidths(t),this.wot.wtOverlays.applyToDOM(),e!==this.wot.wtViewport.getWorkspaceWidth()){this.wot.wtViewport.containerWidth=null;var l=this.wtTable.getFirstRenderedColumn(),u=this.wtTable.getLastRenderedColumn(),c=this.wot.getSetting("rowHeaderWidth");if(null!=c)for(var d=0;df;f++){var p=this.wtTable.getStretchedColumnWidth(f),g=this.columnFilter.sourceToRendered(f);this.COLGROUP.childNodes[g+this.rowHeaderCount].style.width=p+"px"}}this.wot.getSetting("onDraw",!0)}},removeRedundantRows:function(e){for(;this.wtTable.tbodyChildrenLength>e;)this.TBODY.removeChild(this.TBODY.lastChild),this.wtTable.tbodyChildrenLength--},renderRows:function(e,t,n){for(var o,r,i=0,s=this.rowFilter.renderedToSource(i),a=this.wtTable.isWorkingOnClone();e>s&&s>=0&&(i>1e3&&console.error("Security brake: Too much TRs. Please define height for your table, which will enforce scrollbars."),void 0===t||i!==t);){if(r=this.getOrCreateTrForRow(i,r),this.renderRowHeaders(s,r),this.adjustColumns(r,n+this.rowHeaderCount),o=this.renderCells(s,r,n),(!a||this.wot.isOverlayName(WalkontableOverlay.CLONE_BOTTOM))&&this.resetOversizedRow(s),r.firstChild){var l=this.wot.wtTable.getRowHeight(s);l?(l--,r.firstChild.style.height=l+"px"):r.firstChild.style.height=""}i++,s=this.rowFilter.renderedToSource(i)}},resetOversizedRow:function(e){this.wot.getSetting("externalRowCalculator")||this.wot.wtViewport.oversizedRows&&this.wot.wtViewport.oversizedRows[e]&&(this.wot.wtViewport.oversizedRows[e]=void 0)},markOversizedRows:function(){if(!this.wot.getSetting("externalRowCalculator")){var e,t,n,o,r,i=this.instance.wtTable.TBODY.childNodes.length,s=i*this.instance.wtSettings.settings.defaultRowHeight,a=d(this.instance.wtTable.TBODY)-1;this.instance.getSetting("totalRows");if(s!==a||this.instance.getSetting("fixedRowsBottom"))for(;i;)i--,n=this.instance.wtTable.rowFilter.renderedToSource(i),e=this.instance.wtTable.getRowHeight(n),o=this.instance.wtTable.getTrForRow(n),r=o.querySelector("th"),t=r?d(r):d(o)-1,(!e&&this.instance.wtSettings.settings.defaultRowHeighte)&&(this.instance.wtViewport.oversizedRows[n]=++t)}},markOversizedColumns:function(){var e=this.wot.getOverlayName();if(this.columnHeaderCount&&!this.wot.wtViewport.isMarkedOversizedColumn[e]&&!this.wtTable.isWorkingOnClone()){for(var t=this.wtTable.getRenderedColumnsCount(),n=0;no;o++)this.markIfOversizedColumnHeader(o);this.wot.wtViewport.isMarkedOversizedColumn[e]=!0}},adjustColumnHeaderHeights:function(){for(var e=this.wot.getSetting("columnHeaders"),t=this.wot.wtTable.THEAD.childNodes,n=this.wot.wtViewport.oversizedColumnHeaders,o=0,r=e.length;r>o;o++)if(n[o]){if(0===t[o].childNodes.length)return;t[o].childNodes[0].style.height=n[o]+"px"}},markIfOversizedColumnHeader:function(e){for(var t,n,o,r=this.wot.wtTable.columnFilter.renderedToSource(e),i=this.columnHeaderCount,s=this.wot.wtSettings.settings.defaultRowHeight,a=this.wot.getSetting("columnHeaderHeight")||[];i;)i--,t=this.wot.wtTable.getColumnHeaderHeight(i),n=this.wot.wtTable.getColumnHeader(r,i),n&&(o=d(n),(!t&&o>s||o>t)&&(this.wot.wtViewport.oversizedColumnHeaders[i]=o),this.wot.wtViewport.oversizedColumnHeaders[i]<(a[i]||a)&&(this.wot.wtViewport.oversizedColumnHeaders[i]=a[i]||a))},renderCells:function(e,t,n){for(var o,i,s=0;n>s;s++)i=this.columnFilter.renderedToSource(s),o=0===s?t.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(i)]:o.nextSibling,"TH"==o.nodeName&&(o=r(o,t)),c(o,"hide")||(o.className=""),o.removeAttribute("style"),this.wot.wtSettings.settings.cellRenderer(e,i,o);return o},adjustColumnWidths:function(e){var t=0,n=this.wot.cloneSource?this.wot.cloneSource:this.wot,o=n.wtTable.holder;o.offsetHeights;s++){var a=this.wtTable.getStretchedColumnWidth(this.columnFilter.renderedToSource(s));this.COLGROUP.childNodes[s+this.rowHeaderCount].style.width=a+"px"}},appendToTbody:function(e){this.TBODY.appendChild(e),this.wtTable.tbodyChildrenLength++},getOrCreateTrForRow:function(e,t){var n;return e>=this.wtTable.tbodyChildrenLength?(n=this.createRow(),this.appendToTbody(n)):n=0===e?this.TBODY.firstChild:t.nextSibling,n.className&&n.removeAttribute("class"),n},createRow:function(){for(var e=document.createElement("TR"),t=0;to;o++){var r=this.columnFilter.renderedToSource(o);this.renderColumnHeader(t,r,n.childNodes[o+this.rowHeaderCount])}},adjustColGroups:function(){for(var e=this.wtTable.getRenderedColumnsCount();this.wtTable.colgroupChildrenLengthe+this.rowHeaderCount;)this.COLGROUP.removeChild(this.COLGROUP.lastChild),this.wtTable.colgroupChildrenLength--;this.rowHeaderCount&&a(this.COLGROUP.childNodes[0],"rowHeader")},adjustThead:function(){var e=this.wtTable.getRenderedColumnsCount(),t=this.THEAD.firstChild;if(this.columnHeaders.length){for(var n=0,o=this.columnHeaders.length;o>n;n++){for(t=this.THEAD.childNodes[n],t||(t=document.createElement("TR"),this.THEAD.appendChild(t)),this.theadChildrenLength=t.childNodes.length;this.theadChildrenLengthe+this.rowHeaderCount;)t.removeChild(t.lastChild),this.theadChildrenLength--}var r=this.THEAD.childNodes.length;if(r>this.columnHeaders.length)for(var i=this.columnHeaders.length;r>i;i++)this.THEAD.removeChild(this.THEAD.lastChild)}else t&&l(t)},getTrForColumnHeaders:function(e){return this.THEAD.childNodes[e]},renderColumnHeader:function(e,t,n){return n.className="",n.removeAttribute("style"),this.columnHeaders[e](t,n,e)},adjustColumns:function(e,t){for(var n=e.childNodes.length;t>n;){var o=document.createElement("TD");e.appendChild(o),n++}for(;n>t;)e.removeChild(e.lastChild),n--},removeRedundantColumns:function(e){for(;this.wtTable.tbodyChildrenLength>e;)this.TBODY.removeChild(this.TBODY.lastChild),this.wtTable.tbodyChildrenLength--}},{}),window.WalkontableTableRenderer=f},{"helpers/dom/element":45}],22:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableViewport:{get:function(){return m}},__esModule:{value:!0}});var o,r,i,s,a=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),l=a.getScrollbarWidth,u=(a.getScrollTop,a.getStyle),c=a.offset,d=a.outerHeight,h=a.outerWidth,f=(r=e("eventManager"),r&&r.__esModule&&r||{"default":r}).EventManager,p=(i=e("calculator/viewportColumns"),i&&i.__esModule&&i||{"default":i}).WalkontableViewportColumnsCalculator,g=(s=e("calculator/viewportRows"),s&&s.__esModule&&s||{"default":s}).WalkontableViewportRowsCalculator,m=function(e){var t=this;this.wot=e,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 f(this.wot),this.eventManager.addEventListener(window,"resize",function(){t.clientHeight=t.getWorkspaceHeight()})};$traceurRuntime.createClass(m,{getWorkspaceHeight:function(){var e,t=this.instance.wtOverlays.topOverlay.trimmingContainer,n=0;return t===window?n=document.documentElement.clientHeight:(e=d(t),n=e>0&&t.clientHeight>0?t.clientHeight:1/0),n},getWorkspaceWidth:function(){var e,t,n=this.wot.getSetting("totalColumns"),o=this.instance.wtOverlays.leftOverlay.trimmingContainer,r=this.wot.getSetting("stretchH"),i=document.documentElement.offsetWidth,s=this.wot.getSetting("preventOverflow");return s?h(this.instance.wtTable.wtRootElement):(e=Handsontable.freezeOverlays?Math.min(i-this.getWorkspaceOffset().left,i):Math.min(this.getContainerFillWidth(),i-this.getWorkspaceOffset().left,i),o===window&&n>0&&this.sumColumnWidths(0,n-1)>e?document.documentElement.clientWidth:o!==window&&(t=u(this.instance.wtOverlays.leftOverlay.trimmingContainer,"overflow"),"scroll"==t||"hidden"==t||"auto"==t)?Math.max(e,o.clientWidth):"none"!==r&&r?e:Math.max(e,h(this.instance.wtTable.TABLE)))},hasVerticalScroll:function(){return this.getWorkspaceActualHeight()>this.getWorkspaceHeight()},hasHorizontalScroll:function(){return this.getWorkspaceActualWidth()>this.getWorkspaceWidth()},sumColumnWidths:function(e,t){for(var n=0;t>e;)n+=this.wot.wtTable.getColumnWidth(e),e++;return n},getContainerFillWidth:function(){if(this.containerWidth)return this.containerWidth;var e,t,n=this.instance.wtTable.holder;return t=document.createElement("div"),t.style.width="100%",t.style.height="1px",n.appendChild(t),e=t.offsetWidth,this.containerWidth=e,n.removeChild(t),e},getWorkspaceOffset:function(){return c(this.wot.wtTable.TABLE)},getWorkspaceActualHeight:function(){return d(this.wot.wtTable.TABLE)},getWorkspaceActualWidth:function(){return h(this.wot.wtTable.TABLE)||h(this.wot.wtTable.TBODY)||h(this.wot.wtTable.THEAD)},getColumnHeaderHeight:function(){return isNaN(this.columnHeaderHeight)&&(this.columnHeaderHeight=d(this.wot.wtTable.THEAD)),this.columnHeaderHeight},getViewportHeight:function(){var e,t=this.getWorkspaceHeight();return t===1/0?t:(e=this.getColumnHeaderHeight(),e>0&&(t-=e),t)},getRowHeaderWidth:function(){var e=this.instance.getSetting("rowHeaderWidth"),t=this.instance.getSetting("rowHeaders");if(e){this.rowHeaderWidth=0;for(var n=0,o=t.length;o>n;n++)this.rowHeaderWidth+=e[n]||e}if(this.wot.cloneSource)return this.wot.cloneSource.wtViewport.getRowHeaderWidth();if(isNaN(this.rowHeaderWidth))if(t.length){var r=this.instance.wtTable.TABLE.querySelector("TH");this.rowHeaderWidth=0;for(var i=0,s=t.length;s>i;i++)r?(this.rowHeaderWidth+=h(r),r=r.nextSibling):this.rowHeaderWidth+=50}else this.rowHeaderWidth=0;return this.rowHeaderWidth},getViewportWidth:function(){var e,t=this.getWorkspaceWidth();return t===1/0?t:(e=this.getRowHeaderWidth(),e>0?t-e:t)},createRowsCalculator:function(){var e,t,n,o,r,i,s,a=void 0!==arguments[0]?arguments[0]:!1,u=this;return this.rowHeaderWidth=NaN,e=this.wot.wtSettings.settings.renderAllRows?1/0:this.getViewportHeight(),t=this.wot.wtOverlays.topOverlay.getScrollPosition()-this.wot.wtOverlays.topOverlay.getTableParentOffset(),0>t&&(t=0),n=this.wot.getSetting("fixedRowsTop"),r=this.wot.getSetting("fixedRowsBottom"),s=this.wot.getSetting("totalRows"),n&&(i=this.wot.wtOverlays.topOverlay.sumCellSizes(0,n),t+=i,e-=i),r&&this.wot.wtOverlays.bottomOverlay.clone&&(i=this.wot.wtOverlays.bottomOverlay.sumCellSizes(s-r,s),e-=i),o=this.wot.wtTable.holder.clientHeight===this.wot.wtTable.holder.offsetHeight?0:l(),new g(e,t,this.wot.getSetting("totalRows"),function(e){return u.wot.wtTable.getRowHeight(e)},a?null:this.wot.wtSettings.settings.viewportRowCalculatorOverride,a,o)},createColumnsCalculator:function(){var e,t,n=void 0!==arguments[0]?arguments[0]:!1,o=this,r=this.getViewportWidth();if(this.columnHeaderHeight=NaN,e=this.wot.wtOverlays.leftOverlay.getScrollPosition()-this.wot.wtOverlays.leftOverlay.getTableParentOffset(),0>e&&(e=0),t=this.wot.getSetting("fixedColumnsLeft")){var i=this.wot.wtOverlays.leftOverlay.sumCellSizes(0,t);e+=i,r-=i}return this.wot.wtTable.holder.clientWidth!==this.wot.wtTable.holder.offsetWidth&&(r-=l()),new p(r,e,this.wot.getSetting("totalColumns"),function(e){return o.wot.wtTable.getColumnWidth(e)},n?null:this.wot.wtSettings.settings.viewportColumnCalculatorOverride,n,this.wot.getSetting("stretchH"),function(e,t){return o.wot.getSetting("onBeforeStretchingColumnWidth",e,t)})},createRenderCalculators:function(){var e=void 0!==arguments[0]?arguments[0]:!1;if(e){var t=this.createRowsCalculator(!0),n=this.createColumnsCalculator(!0);this.areAllProposedVisibleRowsAlreadyRendered(t)&&this.areAllProposedVisibleColumnsAlreadyRendered(n)||(e=!1)}return e||(this.rowsRenderCalculator=this.createRowsCalculator(),this.columnsRenderCalculator=this.createColumnsCalculator()),this.rowsVisibleCalculator=null,this.columnsVisibleCalculator=null,e},createVisibleCalculators:function(){this.rowsVisibleCalculator=this.createRowsCalculator(!0),this.columnsVisibleCalculator=this.createColumnsCalculator(!0)},areAllProposedVisibleRowsAlreadyRendered:function(e){return this.rowsVisibleCalculator?e.startRow0?!1:e.endRow>this.rowsRenderCalculator.endRow||e.endRow===this.rowsRenderCalculator.endRow&&e.endRow0?!1:e.endColumn>this.columnsRenderCalculator.endColumn||e.endColumn===this.columnsRenderCalculator.endColumn&&e.endColumn=0;s--)if(null===e[s])e.splice(s,1);else{var a=e[s][0],l=d.propToCol(e[s][1]),u=m.runHooks("modifyCol",l),c=m.getCellMeta(a,u);if("numeric"===c.type&&"string"==typeof e[s][3]&&e[s][3].length>0&&(/^-?[\d\s]*(\.|\,)?\d*$/.test(e[s][3])||c.format)){var h=e[s][3].length;"undefined"==typeof c.language?R.language("en"):e[s][3].indexOf(".")===h-3&&-1===e[s][3].indexOf(",")?R.language("en"):R.language(c.language),R.validate(e[s][3])&&(e[s][3]=R().unformat(e[s][3]))}m.getCellValidator(c)&&(i.addValidatorToQueue(),m.validateCell(e[s][3],c,function(t,n){return function(o){if("boolean"!=typeof o)throw new Error("Validation error: result is not boolean");o===!1&&n.allowInvalid===!1&&(e.splice(t,1),n.valid=!0,--t),i.removeValidatorFormQueue()}}(s,c),t))}i.checkIfQueueIsEmpty()}function r(e,t){var n=e.length-1;if(!(0>n)){for(;n>=0;n--)if(null!==e[n]){if(null!=e[n][2]||null!=e[n][3]){if(c.settings.allowInsertRow)for(;e[n][0]>m.countRows()-1;)d.createRow();if("array"===m.dataType&&c.settings.allowInsertColumn)for(;d.propToCol(e[n][1])>m.countCols()-1;)d.createCol();d.set(e[n][0],e[n][1],e[n][3])}}else e.splice(n,1);m.forceFullRender=!0,f.adjustRowsAndCols(),Handsontable.hooks.run(m,"beforeChangeRender",e,t),p.refreshBorders(null,!0),m.view.wt.wtOverlays.adjustElementsSize(),Handsontable.hooks.run(m,"afterChange",e,t||"edit")}}function i(e,t,n){return"object"==typeof e?e:[[e,t,n]]}function s(e){if(e.hasOwnProperty("type")){var t,n={};if("object"==typeof e.type)t=e.type;else if("string"==typeof e.type&&(t=Handsontable.cellTypes[e.type],void 0===t))throw new Error('You declared cell type "'+e.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 o in t)t.hasOwnProperty(o)&&!e.hasOwnProperty(o)&&(n[o]=t[o]);return n}}function a(e){return Handsontable.hooks.run(m,"modifyRow",e)}function l(e){return Handsontable.hooks.run(m,"modifyCol",e)}function u(){throw new Error("This method cannot be called because this Handsontable instance has been destroyed")}var c,d,h,f,p,g,m=this,v=function(){},w=D(m);A(v.prototype,Q.prototype),A(v.prototype,t),A(v.prototype,s(t)),this.rootElement=e,this.isHotTableEnv=T(this.rootElement),Handsontable.eventManager.isHotTableEnv=this.isHotTableEnv,this.container=document.createElement("DIV"),this.renderCall=!1,e.insertBefore(this.container,e.firstChild),this.guid="ht_"+F(),h=new U(m),this.rootElement.id&&"ht_"!==this.rootElement.id.substring(0,3)||(this.rootElement.id=this.guid),c={cellSettings:[],columnSettings:[],columnsSettingConflicts:["data","width"],settings:new v,selRange:null,isPopulated:null,scrollable:null,firstRun:!0},f={alter:function(e,t,n,o,r){function i(e,t,n,o){var r=function(){var e;return"array"===o?e=[]:"object"===o&&(e={}),e},i=j(new Array(n),function(){return r()});i.unshift(t,0),e.splice.apply(e,i)}var s;switch(n=n||1,e){case"insert_row":if(m.getSettings().maxRows===m.countSourceRows())return;s=d.createRow(t,n),i(c.cellSettings,t,n,"array"),s&&(p.isSelected()&&c.selRange.from.row>=t?(c.selRange.from.row=c.selRange.from.row+s,p.transformEnd(s,0)):p.refreshBorders());break;case"insert_col":s=d.createCol(t,n);for(var a=0,l=m.countSourceRows();l>a;a++)c.cellSettings[a]&&i(c.cellSettings[a],t,n);if(s){if(Array.isArray(m.getSettings().colHeaders)){var u=[t,0];u.length+=s,Array.prototype.splice.apply(m.getSettings().colHeaders,u)}p.isSelected()&&c.selRange.from.col>=t?(c.selRange.from.col=c.selRange.from.col+s,p.transformEnd(0,s)):p.refreshBorders()}break;case"remove_row":d.removeRow(t,n),c.cellSettings.splice(t,n);var h=m.countRows(),g=m.getSettings().fixedRowsTop;g>=t+1&&(m.getSettings().fixedRowsTop-=Math.min(n,g-t));var v=m.getSettings().fixedRowsBottom;v&&t>=h-v&&(m.getSettings().fixedRowsBottom-=Math.min(n,v)),f.adjustRowsAndCols(),p.refreshBorders();break;case"remove_col":d.removeCol(t,n);for(var w=0,y=m.countSourceRows();y>w;w++)c.cellSettings[w]&&c.cellSettings[w].splice(t,n);var b=m.getSettings().fixedColumnsLeft;b>=t+1&&(m.getSettings().fixedColumnsLeft-=Math.min(n,b-t)),Array.isArray(m.getSettings().colHeaders)&&("undefined"==typeof t&&(t=-1),m.getSettings().colHeaders.splice(t,n)),f.adjustRowsAndCols(),p.refreshBorders();break;default:throw new Error('There is no such action "'+e+'"')}r||f.adjustRowsAndCols()},adjustRowsAndCols:function(){if(c.settings.minRows){var e=m.countRows();if(et;t++)d.createRow(m.countRows(),1,!0)}if(c.settings.minSpareRows){var o=m.countEmptyRows(!0);if(oi-1?(l=i-1,a=!0,h>l&&(h=l)):h>i-1&&(h=i-1,a=!0,l>h&&(l=h)),u>s-1?(u=s-1,a=!0,f>u&&(f=u)):f>s-1&&(f=s-1,a=!0,u>f&&(u=f)),a&&m.selectCell(l,u,h,f)}m.view&&m.view.wt.wtOverlays.adjustElementsSize()},populateFromArray:function(e,t,n,o,r,i,s){var a,l,u,d,h=[],f={};if(l=t.length,0===l)return!1;var p,g,v,w;({row:null===n?null:n.row,col:null===n?null:n.col});switch(r){case"shift_down":for(p=n?n.col-e.col+1:0,g=n?n.row-e.row+1:0,t=$(t),u=0,d=t.length,v=Math.max(d,p);v>u;u++)if(d>u){for(a=0,l=t[u].length;g-l>a;a++)t[u].push(t[u][a%l]);t[u].unshift(e.col+u,e.row,0),m.spliceCol.apply(m,t[u])}else t[u%d][0]=e.col+u,m.spliceCol.apply(m,t[u%d]);break;case"shift_right":for(p=n?n.col-e.col+1:0,g=n?n.row-e.row+1:0,a=0,l=t.length,w=Math.max(l,g);w>a;a++)if(l>a){for(u=0,d=t[a].length;p-d>u;u++)t[a].push(t[a][u%d]);t[a].unshift(e.row+a,e.col,0),m.spliceRow.apply(m,t[a])}else t[a%l][0]=e.row+a,m.spliceRow.apply(m,t[a%l]);break;case"overwrite":default:f.row=e.row,f.col=e.col;var y,b={row:n&&e?n.row-e.row+1:1,col:n&&e?n.col-e.col+1:1},C=0,R=0,_=!0,S=function(e){var n=void 0!==arguments[1]?arguments[1]:null,o=t[e%t.length];return null!==n?o[n%o.length]:o},E=t.length,T=n?n.row-e.row+1:0;for(l=n?T:Math.max(E,T),a=0;l>a&&!(n&&f.row>n.row&&T>E||!c.settings.allowInsertRow&&f.row>m.countRows()-1||f.row>=c.settings.maxRows);a++){var M=a-C,O=S(M).length,k=n?n.col-e.col+1:0;if(d=n?k:Math.max(O,k),f.col=e.col,y=m.getCellMeta(f.row,f.col),"paste"!==o&&"autofill"!==o||!y.skipRowOnPaste){for(R=0,u=0;d>u&&!(n&&f.col>n.col&&k>O||!c.settings.allowInsertColumn&&f.col>m.countCols()-1||f.col>=c.settings.maxCols);u++)if(y=m.getCellMeta(f.row,f.col),"paste"!==o&&"autofill"!==o||!y.skipColumnOnPaste)if(y.readOnly)f.col++;else{var H=u-R,D=S(M,H),x=m.getDataAtCell(f.row,f.col),A={row:M,col:H};if("autofill"===o){var W=m.runHooks("beforeAutofillInsidePopulate",A,i,t,s,{},b);W&&(D="undefined"==typeof W.value?D:W.value)}if(null!==D&&"object"==typeof D)if(null===x||"object"!=typeof x)_=!1;else{var I=P(x[0]||x),j=P(D[0]||D);N(I,j)?D=L(D):_=!1}else null!==x&&"object"==typeof x&&(_=!1);_&&h.push([f.row,f.col,D]),_=!0,f.col++}else R++,f.col++,d++;f.row++}else C++,f.row++,l++}m.setDataAtCell(h,null,null,o||"populateFromArray")}}},this.selection=p={inProgress:!1,selectedHeader:{cols:!1,rows:!1},setSelectedHeaders:function(e,t){m.selection.selectedHeader.rows=e,m.selection.selectedHeader.cols=t},begin:function(){m.selection.inProgress=!0},finish:function(){var e=m.getSelected();Handsontable.hooks.run(m,"afterSelectionEnd",e[0],e[1],e[2],e[3]),Handsontable.hooks.run(m,"afterSelectionEndByProp",e[0],m.colToProp(e[1]),e[2],m.colToProp(e[3])),m.selection.inProgress=!1},isInProgress:function(){return m.selection.inProgress},setRangeStart:function(e,t){Handsontable.hooks.run(m,"beforeSetRangeStart",e),c.selRange=new Z(e,e,e),p.setRangeEnd(e,null,t)},setRangeEnd:function(e,t,n){if(null!==c.selRange){var o,r=!1,i=!0,s=m.view.wt.wtTable.getFirstVisibleRow(),a=m.view.wt.wtTable.getFirstVisibleColumn(),l={row:null,col:null};Handsontable.hooks.run(m,"beforeSetRangeEnd",e),m.selection.begin(),l.row=e.row<0?s:e.row,l.col=e.col<0?a:e.col,c.selRange.to=new q(l.row,l.col),c.settings.multiSelect||(c.selRange.from=e),m.view.wt.selections.current.clear(),o=m.getCellMeta(c.selRange.highlight.row,c.selRange.highlight.col).disableVisualSelection,"string"==typeof o&&(o=[o]),(o===!1||Array.isArray(o)&&-1===o.indexOf("current"))&&m.view.wt.selections.current.add(c.selRange.highlight),m.view.wt.selections.area.clear(),(o===!1||Array.isArray(o)&&-1===o.indexOf("area"))&&p.isMultiple()&&(m.view.wt.selections.area.add(c.selRange.from),m.view.wt.selections.area.add(c.selRange.to)),(c.settings.currentRowClassName||c.settings.currentColClassName)&&(m.view.wt.selections.highlight.clear(),m.view.wt.selections.highlight.add(c.selRange.from),m.view.wt.selections.highlight.add(c.selRange.to)),Handsontable.hooks.run(m,"afterSelection",c.selRange.from.row,c.selRange.from.col,c.selRange.to.row,c.selRange.to.col),Handsontable.hooks.run(m,"afterSelectionByProp",c.selRange.from.row,d.colToProp(c.selRange.from.col),c.selRange.to.row,d.colToProp(c.selRange.to.col)),(0===c.selRange.from.row&&c.selRange.to.row===m.countRows()-1&&m.countRows()>1||0===c.selRange.from.col&&c.selRange.to.col===m.countCols()-1&&m.countCols()>1)&&(r=!0),(e.row<0||e.col<0)&&(i=!1),t!==!1&&!r&&i&&(c.selRange.from&&!p.isMultiple()?m.view.scrollViewport(c.selRange.from):m.view.scrollViewport(e)),p.refreshBorders(null,n)}},refreshBorders:function(e,t){t||g.destroyEditor(e),m.view.render(),p.isSelected()&&!t&&g.prepareEditor()},isMultiple:function(){var e=!(c.selRange.to.col===c.selRange.from.col&&c.selRange.to.row===c.selRange.from.row),t=Handsontable.hooks.run(m,"afterIsMultipleSelection",e);return e?t:void 0},transformStart:function(e,t,n,o){var r,i,s,a,l=new q(e,t),u=0,d=0;m.runHooks("modifyTransformStart",l),r=m.countRows(),i=m.countCols(),a=m.getSettings().fixedRowsBottom,c.selRange.highlight.row+e>r-1?n&&c.settings.minSpareRows>0&&!(a&&c.selRange.highlight.row>=r-a-1)?(m.alter("insert_row",r),r=m.countRows()):c.settings.autoWrapCol&&(l.row=1-r,l.col=c.selRange.highlight.col+l.col==i-1?1-i:1):c.settings.autoWrapCol&&c.selRange.highlight.row+l.row<0&&c.selRange.highlight.col+l.col>=0&&(l.row=r-1,l.col=c.selRange.highlight.col+l.col==0?i-1:-1),c.selRange.highlight.col+l.col>i-1?n&&c.settings.minSpareCols>0?(m.alter("insert_col",i),i=m.countCols()):c.settings.autoWrapRow&&(l.row=c.selRange.highlight.row+l.row==r-1?1-r:1,l.col=1-i):c.settings.autoWrapRow&&c.selRange.highlight.col+l.col<0&&c.selRange.highlight.row+l.row>=0&&(l.row=c.selRange.highlight.row+l.row==0?r-1:-1,l.col=i-1),s=new q(c.selRange.highlight.row+l.row,c.selRange.highlight.col+l.col),s.row<0?(u=-1,s.row=0):s.row>0&&s.row>=r&&(u=1,s.row=r-1),s.col<0?(d=-1,s.col=0):s.col>0&&s.col>=i&&(d=1,s.col=i-1),m.runHooks("afterModifyTransformStart",s,u,d),p.setRangeStart(s,o)},transformEnd:function(e,t){var n,o,r,i=new q(e,t),s=0,a=0;m.runHooks("modifyTransformEnd",i),n=m.countRows(),o=m.countCols(),r=new q(c.selRange.to.row+i.row,c.selRange.to.col+i.col),r.row<0?(s=-1,r.row=0):r.row>0&&r.row>=n&&(s=1,r.row=n-1),r.col<0?(a=-1,r.col=0):r.col>0&&r.col>=o&&(a=1,r.col=o-1),m.runHooks("afterModifyTransformEnd",r,s,a),p.setRangeEnd(r,!0)},isSelected:function(){return null!==c.selRange},inInSelection:function(e){return p.isSelected()?c.selRange.includes(e):!1},deselect:function(){p.isSelected()&&(m.selection.inProgress=!1,c.selRange=null,m.view.wt.selections.current.clear(),m.view.wt.selections.area.clear(),(c.settings.currentRowClassName||c.settings.currentColClassName)&&m.view.wt.selections.highlight.clear(),g.destroyEditor(),p.refreshBorders(),Handsontable.hooks.run(m,"afterDeselect"))},selectAll:function(){c.settings.multiSelect&&(p.setRangeStart(new q(0,0)),p.setRangeEnd(new q(m.countRows()-1,m.countCols()-1),!1))},empty:function(){if(p.isSelected()){var e,t,n=c.selRange.getTopLeftCorner(),o=c.selRange.getBottomRightCorner(),r=[];for(e=n.row;e<=o.row;e++)for(t=n.col;t<=o.col;t++)m.getCellMeta(e,t).readOnly||r.push([e,t,""]);m.setDataAtCell(r)}}},this.init=function(){h.setData(c.settings.data),Handsontable.hooks.run(m,"beforeInit"),Handsontable.mobileBrowser&&S(m.rootElement,"mobile"),this.updateSettings(c.settings,!0),this.view=new Y(this),g=new H(m,c,p,d),this.forceFullRender=!0,Handsontable.hooks.run(m,"init"),this.view.render(),"object"==typeof c.firstRun&&(Handsontable.hooks.run(m,"afterChange",c.firstRun[0],c.firstRun[1]),c.firstRun=!1),Handsontable.hooks.run(m,"afterInit")},this.validateCell=function(e,t,n,o){function r(e){var o=t.visualCol,r=t.visualRow,i=m.getCell(r,o,!0);i&&m.view.wt.wtSettings.settings.cellRenderer(r,o,i),n(e)}var i=m.getCellValidator(t);"[object RegExp]"===Object.prototype.toString.call(i)&&(i=function(e){return function(t,n){n(e.test(t))}}(i)),"function"==typeof i?(e=Handsontable.hooks.run(m,"beforeValidate",e,t.visualRow,t.prop,o),m._registerTimeout(setTimeout(function(){i.call(t,e,function(n){n=Handsontable.hooks.run(m,"afterValidate",n,e,t.visualRow,t.prop,o),t.valid=n,r(n),Handsontable.hooks.run(m,"postAfterValidate",n,e,t.visualRow,t.prop,o)})},0))):(t.valid=!0,r(t.valid))},this.setDataAtCell=function(e,t,n,s){var a,l,u,c=i(e,t,n),h=[];for(a=0,l=c.length;l>a;a++){if("object"!=typeof c[a])throw new Error("Method `setDataAtCell` accepts row number or changes array of arrays as its first parameter");if("number"!=typeof c[a][1])throw new Error("Method `setDataAtCell` accepts row and column number as its parameters. If you want to use object property name, use method `setDataAtRowProp`");u=d.colToProp(c[a][1]),h.push([c[a][0],u,d.get(c[a][0],u),c[a][2]])}s||"object"!=typeof e||(s=t),o(h,s,function(){r(h,s)})},this.setDataAtRowProp=function(e,t,n,s){var a,l,u=i(e,t,n),c=[];for(a=0,l=u.length;l>a;a++)c.push([u[a][0],u[a][1],d.get(u[a][0],u[a][1]),u[a][2]]);s||"object"!=typeof e||(s=t),o(c,s,function(){r(c,s)})},this.listen=function(){Handsontable.activeGuid=m.guid},this.unlisten=function(){Handsontable.activeGuid=null},this.isListening=function(){return Handsontable.activeGuid===m.guid},this.destroyEditor=function(e){p.refreshBorders(e)},this.populateFromArray=function(e,t,n,o,r,i,s,a,l){var u;if("object"!=typeof n||"object"!=typeof n[0])throw new Error("populateFromArray parameter `input` must be an array of arrays");return u="number"==typeof o?new q(o,r):null,f.populateFromArray(new q(e,t),n,u,i,s,a,l)},this.spliceCol=function(e,t,n){return d.spliceCol.apply(d,arguments)},this.spliceRow=function(e,t,n){return d.spliceRow.apply(d,arguments)},this.getSelected=function(){return p.isSelected()?[c.selRange.from.row,c.selRange.from.col,c.selRange.to.row,c.selRange.to.col]:void 0},this.getSelectedRange=function(){return p.isSelected()?c.selRange:void 0},this.render=function(){m.view&&(m.renderCall=!0,m.forceFullRender=!0,p.refreshBorders(null,!0))},this.loadData=function(e){function t(){c.cellSettings.length=0}if("object"==typeof e&&null!==e)e.push&&e.splice||(e=[e]);else{if(null!==e)throw new Error("loadData only accepts array of objects or array of arrays ("+typeof e+" given)");e=[];for(var n,o=0,r=c.settings.startRows;r>o;o++){n=[];for(var i=0,s=c.settings.startCols;s>i;i++)n.push(null);e.push(n)}}c.isPopulated=!1,v.prototype.data=e,Array.isArray(c.settings.dataSchema)||Array.isArray(e[0])?m.dataType="array":"function"==typeof c.settings.dataSchema?m.dataType="function":m.dataType="object",d=new k(m,c,v),h.data=e,h.dataType=m.dataType,h.colToProp=d.colToProp.bind(d),h.propToCol=d.propToCol.bind(d),t(),f.adjustRowsAndCols(),Handsontable.hooks.run(m,"afterLoadData",c.firstRun),c.firstRun?c.firstRun=[null,"loadData"]:(Handsontable.hooks.run(m,"afterChange",null,"loadData"),m.render()),c.isPopulated=!0},this.getData=function(e,t,n,o){return"undefined"==typeof e?d.getAll():d.getRange(new q(e,t),new q(n,o),d.DESTINATION_RENDERER)},this.getCopyableText=function(e,t,n,o){return d.getCopyableText(new q(e,t),new q(n,o))},this.getCopyableData=function(e,t){return d.getCopyable(e,d.colToProp(t))},this.getSchema=function(){return d.getSchema()},this.updateSettings=function(e,t){var n,o;if("undefined"!=typeof e.rows)throw new Error('"rows" setting is no longer supported. do you mean startRows, minRows or maxRows?');if("undefined"!=typeof e.cols)throw new Error('"cols" setting is no longer supported. do you mean startCols, minCols or maxCols?');for(n in e)"data"!==n&&(Handsontable.hooks.getRegistered().indexOf(n)>-1?("function"==typeof e[n]||Array.isArray(e[n]))&&m.addHook(n,e[n]):!t&&e.hasOwnProperty(n)&&(v.prototype[n]=e[n]));if(void 0===e.data&&void 0===c.settings.data?m.loadData(null):void 0!==e.data?m.loadData(e.data):void 0!==e.columns&&d.createMap(),o=m.countCols(),(void 0!==e.cell||void 0!==e.cells||void 0!==e.columns)&&(c.cellSettings.length=0),o>0){var r,i;for(n=0;o>n;n++)c.columnSettings[n]=O(v,c.columnsSettingConflicts),r=c.columnSettings[n].prototype,v.prototype.columns&&(i=v.prototype.columns[n],A(r,i),A(r,s(i)))}if("undefined"!=typeof e.cell)for(n in e.cell)if(e.cell.hasOwnProperty(n)){var a=e.cell[n];m.setCellMetaObject(a.row,a.col,a)}if(Handsontable.hooks.run(m,"afterCellMetaReset"),"undefined"!=typeof e.className&&(v.prototype.className&&M(m.rootElement,v.prototype.className),e.className&&S(m.rootElement,e.className)),"undefined"!=typeof e.height){var l=e.height;"function"==typeof l&&(l=l()),m.rootElement.style.height=l+"px"}if("undefined"!=typeof e.width){var u=e.width;"function"==typeof u&&(u=u()),m.rootElement.style.width=u+"px"}l&&(m.rootElement.style.overflow="hidden"),t||Handsontable.hooks.run(m,"afterUpdateSettings"),f.adjustRowsAndCols(),m.view&&!c.firstRun&&(m.forceFullRender=!0,p.refreshBorders(null,!0))},this.getValue=function(){var e=m.getSelected();if(v.prototype.getValue){if("function"==typeof v.prototype.getValue)return v.prototype.getValue.call(m);if(e)return m.getData()[e[0]][v.prototype.getValue]}else if(e)return m.getDataAtCell(e[0],e[1])},this.getSettings=function(){return c.settings},this.clear=function(){p.selectAll(),p.empty()},this.alter=function(e,t,n,o,r){f.alter(e,t,n,o,r)},this.getCell=function(e,t,n){return m.view.getCellAtCoords(new q(e,t),n)},this.getCoords=function(e){return this.view.wt.wtTable.getCoords.call(this.view.wt.wtTable,e)},this.colToProp=function(e){return d.colToProp(e)},this.propToCol=function(e){return d.propToCol(e)},this.getDataAtCell=function(e,t){return d.get(e,d.colToProp(t))},this.getDataAtRowProp=function(e,t){return d.get(e,t)},this.getDataAtCol=function(e){var t=[];return t.concat.apply(t,d.getRange(new q(0,e),new q(c.settings.data.length-1,e),d.DESTINATION_RENDERER))},this.getDataAtProp=function(e){var t,n=[];return t=d.getRange(new q(0,d.propToCol(e)),new q(c.settings.data.length-1,d.propToCol(e)),d.DESTINATION_RENDERER),n.concat.apply(n,t)},this.getSourceData=function(e,t,n,o){var r;return r=void 0===e?h.getData():h.getByRange(new q(e,t),new q(n,o))},this.getSourceDataAtCol=function(e){return h.getAtColumn(e)},this.getSourceDataAtRow=function(e){return h.getAtRow(e)},this.getSourceDataAtCell=function(e,t){return h.getAtCell(e,t)},this.getDataAtRow=function(e){var t=d.getRange(new q(e,0),new q(e,this.countCols()-1),d.DESTINATION_RENDERER);return t[0]},this.getDataType=function(e,t,n,o){var r=this,i=null,s=null;void 0===e&&(e=0,n=this.countRows(),t=0,o=this.countCols()),void 0===n&&(n=e),void 0===o&&(o=t);var a="mixed";return z(Math.min(e,n),Math.max(e,n),function(e){var n=!0;return z(Math.min(t,o),Math.max(t,o),function(t){var o=r.getCellMeta(e,t);return s=o.type,i?n=i===s:i=s,n}),a=n?s:"mixed",n}),a},this.removeCellMeta=function(e,t,n){var o=m.getCellMeta(e,t);void 0!=o[n]&&delete c.cellSettings[e][t][n]},this.setCellMetaObject=function(e,t,n){if("object"==typeof n)for(var o in n)if(n.hasOwnProperty(o)){var r=n[o];this.setCellMeta(e,t,o,r)}},this.setCellMeta=function(e,t,n,o){c.cellSettings[e]||(c.cellSettings[e]=[]),c.cellSettings[e][t]||(c.cellSettings[e][t]=new c.columnSettings[t]),c.cellSettings[e][t][n]=o,Handsontable.hooks.run(m,"afterSetCellMeta",e,t,n,o)},this.getCellsMeta=function(){return I(c.cellSettings)},this.getCellMeta=function(e,t){var n,o=d.colToProp(t),r=e,i=t;if(e=a(e),t=l(t),c.columnSettings[t]||(c.columnSettings[t]=O(v,c.columnsSettingConflicts)),c.cellSettings[e]||(c.cellSettings[e]=[]),c.cellSettings[e][t]||(c.cellSettings[e][t]=new c.columnSettings[t]),n=c.cellSettings[e][t],n.row=e,n.col=t,n.visualRow=r,n.visualCol=i,n.prop=o,n.instance=m,Handsontable.hooks.run(m,"beforeGetCellMeta",e,t,n),A(n,s(n)),n.cells){var u=n.cells.call(n,e,t,o);u&&(A(n,u),A(n,s(u)))}return Handsontable.hooks.run(m,"afterGetCellMeta",e,t,n),n},this.isColumnModificationAllowed=function(){return!("object"===m.dataType||m.getSettings().columns)};var y=K("renderer");this.getCellRenderer=function(e,t){var n=y.call(this,e,t);return B(n)},this.getCellEditor=K("editor"),this.getCellValidator=K("validator"),this.validateCells=function(e){var t=new n;e&&(t.onQueueEmpty=e);for(var o=m.countRows()-1;o>=0;){for(var r=m.countCols()-1;r>=0;)t.addValidatorToQueue(),m.validateCell(m.getDataAtCell(o,r),m.getCellMeta(o,r),function(e){if("boolean"!=typeof e)throw new Error("Validation error: result is not boolean");e===!1&&(t.valid=!1),t.removeValidatorFormQueue()},"validateCells"),r--;o--}t.checkIfQueueIsEmpty()},this.getRowHeader=function(e){var t=c.settings.rowHeaders;return void 0!==e&&(e=Handsontable.hooks.run(m,"modifyRowHeader",e)),void 0===e?(t=[],z(m.countRows()-1,function(e){t.push(m.getRowHeader(e))})):Array.isArray(t)&&void 0!==t[e]?t=t[e]:"function"==typeof t?t=t(e):t&&"string"!=typeof t&&"number"!=typeof t&&(t=e+1),t},this.hasRowHeaders=function(){return!!c.settings.rowHeaders},this.hasColHeaders=function(){if(void 0!==c.settings.colHeaders&&null!==c.settings.colHeaders)return!!c.settings.colHeaders;for(var e=0,t=m.countCols();t>e;e++)if(m.getColHeader(e))return!0;return!1},this.getColHeader=function(e){if(e=Handsontable.hooks.run(m,"modifyColHeader",e),void 0===e){for(var t=[],n=0,o=m.countCols();o>n;n++)t.push(m.getColHeader(n));return t}var r=e;return e=Handsontable.hooks.run(m,"modifyCol",e),c.settings.columns&&c.settings.columns[e]&&c.settings.columns[e].title?c.settings.columns[e].title:Array.isArray(c.settings.colHeaders)&&void 0!==c.settings.colHeaders[e]?c.settings.colHeaders[e]:"function"==typeof c.settings.colHeaders?c.settings.colHeaders(e):c.settings.colHeaders&&"string"!=typeof c.settings.colHeaders&&"number"!=typeof c.settings.colHeaders?X(r):c.settings.colHeaders},this._getColWidthFromSettings=function(e){var t=m.getCellMeta(0,e),n=t.width;if((void 0===n||n===c.settings.width)&&(n=t.colWidths),void 0!==n&&null!==n){switch(typeof n){case"object":n=n[e];break;case"function":n=n(e)}"string"==typeof n&&(n=parseInt(n,10))}return n},this.getColWidth=function(e){var t=m._getColWidthFromSettings(e);return t=Handsontable.hooks.run(m,"modifyColWidth",t,e),void 0===t&&(t=J.DEFAULT_WIDTH),t},this._getRowHeightFromSettings=function(e){var t=c.settings.rowHeights;if(void 0!==t&&null!==t){switch(typeof t){case"object":t=t[e];break;case"function":t=t(e)}"string"==typeof t&&(t=parseInt(t,10))}return t},this.getRowHeight=function(e){var t=m._getRowHeightFromSettings(e);return t=Handsontable.hooks.run(m,"modifyRowHeight",t,e)},this.countSourceRows=function(){return m.getSourceData()?m.getSourceData().length:0},this.countRows=function(){return d.getLength()},this.countCols=function(){return"object"===m.dataType||"function"===m.dataType?c.settings.columns&&c.settings.columns.length?c.settings.columns.length:d.colToPropCache.length:"array"===m.dataType?c.settings.columns&&c.settings.columns.length?c.settings.columns.length:c.settings.data&&c.settings.data[0]&&c.settings.data[0].length?c.settings.data[0].length:0:void 0},this.getColspanOffset=function(e,t){var n=0;if(m.colspanArray){for(var o=0;e>o;o++)n+=m.colspanArray[t][o]-1||0;return n}for(var n=0,r=m.view.wt.wtTable.THEAD.childNodes.length-t-1,i=m.view.wt.wtTable.THEAD.querySelector("tr:nth-child("+parseInt(r+1,10)+")"),s=m.view.wt.wtSettings.settings.rowHeaders().length,o=s;s+e>o;o++)i.childNodes[o].hasAttribute("colspan")&&(n+=parseInt(i.childNodes[o].getAttribute("colspan"),10)-1);return n},this.getHeaderColspan=function(e,t){var n=m.view.wt.wtTable.THEAD.childNodes.length-t-1,o=m.view.wt.wtSettings.settings.rowHeaders().length,r=m.view.wt.wtTable.THEAD.querySelector("tr:nth-child("+parseInt(n+1,10)+")"),i=o+e-m.view.wt.wtViewport.columnsRenderCalculator.startColumn;return r.childNodes[i].hasAttribute("colspan")?parseInt(r.childNodes[i].getAttribute("colspan"),10):0},this.rowOffset=function(){return m.view.wt.wtTable.getFirstRenderedRow()},this.colOffset=function(){return m.view.wt.wtTable.getFirstRenderedColumn()},this.countRenderedRows=function(){return m.view.wt.drawn?m.view.wt.wtTable.getRenderedRowsCount():-1},this.countVisibleRows=function(){return m.view.wt.drawn?m.view.wt.wtTable.getVisibleRowsCount():-1},this.countRenderedCols=function(){return m.view.wt.drawn?m.view.wt.wtTable.getRenderedColumnsCount():-1},this.countVisibleCols=function(){return m.view.wt.drawn?m.view.wt.wtTable.getVisibleColumnsCount():-1},this.countEmptyRows=function(e){for(var t,n=m.countRows()-1,o=0;n>=0;){if(t=Handsontable.hooks.run(this,"modifyRow",n),m.isEmptyRow(t))o++;else if(e)break;n--}return o},this.countEmptyCols=function(e){if(m.countRows()<1)return 0;for(var t=m.countCols()-1,n=0;t>=0;){if(m.isEmptyCol(t))n++;else if(e)break;t--}return n},this.isEmptyRow=function(e){return c.settings.isEmptyRow.call(m,e)},this.isEmptyCol=function(e){return c.settings.isEmptyCol.call(m,e)},this.selectCell=function(e,t,n,o,r,i){var s;if(i="undefined"==typeof i||i===!0,"number"!=typeof e||0>e||e>=m.countRows())return!1;if("number"!=typeof t||0>t||t>=m.countCols())return!1;if("undefined"!=typeof n){if("number"!=typeof n||0>n||n>=m.countRows())return!1;if("number"!=typeof o||0>o||o>=m.countCols())return!1}return s=new q(e,t),c.selRange=new Z(s,s,s),i&&m.listen(),"undefined"==typeof n?p.setRangeEnd(c.selRange.from,r):p.setRangeEnd(new q(n,o),r),m.selection.finish(),!0},this.selectCellByProp=function(e,t,n,o,r){return arguments[1]=d.propToCol(arguments[1]),"undefined"!=typeof arguments[3]&&(arguments[3]=d.propToCol(arguments[3])),m.selectCell.apply(m,arguments)},this.deselectCell=function(){p.deselect()},this.destroy=function(){m._clearTimeouts(),m.view&&m.view.destroy(),h&&h.destroy(),h=null,E(m.rootElement),w.destroy(),Handsontable.hooks.run(m,"afterDestroy"),Handsontable.hooks.destroy(m);for(var e in m)m.hasOwnProperty(e)&&("function"==typeof m[e]?m[e]=u:"guid"!==e&&(m[e]=null));c=null,d=null,f=null,p=null,g=null,m=null,v=null},this.getActiveEditor=function(){return g.getActiveEditor()},this.getPlugin=function(e){return V(this,e)},this.getInstance=function(){return m},this.addHook=function(e,t){Handsontable.hooks.add(e,t,m)},this.hasHook=function(e){return Handsontable.hooks.has(e,m)},this.addHookOnce=function(e,t){ -Handsontable.hooks.once(e,t,m)},this.removeHook=function(e,t){Handsontable.hooks.remove(e,t,m)},this.runHooks=function(e,t,n,o,r,i,s){return Handsontable.hooks.run(m,e,t,n,o,r,i,s)},this.timeouts=[],this._registerTimeout=function(e){this.timeouts.push(e)},this._clearTimeouts=function(){for(var e=0,t=this.timeouts.length;t>e;e++)clearTimeout(this.timeouts[e])},this.version=Handsontable.version,Handsontable.hooks.run(m,"construct")};var Q=function(){};Q.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:!1,customBorders:!1,minRows:0,minCols:0,maxRows:1/0,maxCols:1/0,minSpareRows:0,minSpareCols:0,allowInsertRow:!0,allowInsertColumn:!0,allowRemoveRow:!0,allowRemoveColumn:!0,multiSelect:!0,fillHandle:!0,fixedRowsTop:0,fixedRowsBottom:0,fixedColumnsLeft:0,outsideClickDeselects:!0,enterBeginsEditing:!0,enterMoves:{row:1,col:0},tabMoves:{row:0,col:1},autoWrapRow:!1,autoWrapCol:!1,copyRowsLimit:1e3,copyColsLimit:1e3,pasteMode:"overwrite",persistentState:void 0,currentRowClassName:void 0,currentColClassName:void 0,className:void 0,tableClassName:void 0,stretchH:"none",isEmptyRow:function(e){var t,n,o,r;for(t=0,n=this.countCols();n>t;t++)if(o=this.getDataAtCell(e,t),""!==o&&null!==o&&"undefined"!=typeof o)return"object"==typeof o?(r=this.getCellMeta(e,t),N(this.getSchema()[r.prop],o)):!1;return!0},isEmptyCol:function(e){var t,n,o;for(t=0,n=this.countRows();n>t;t++)if(o=this.getDataAtCell(t,e),""!==o&&null!==o&&"undefined"!=typeof o)return!1;return!0},observeDOMVisibility:!0,allowInvalid:!0,allowEmpty:!0,invalidCellClassName:"htInvalid",placeholder:!1,placeholderCellClassName:"htPlaceholder",readOnlyCellClassName:"htDimmed",renderer:void 0,commentedCellClassName:"htCommentCell",fragmentSelection:!1,readOnly:!1,skipColumnOnPaste:!1,search:!1,type:"text",copyable:!0,editor:void 0,autoComplete:void 0,visibleRows:10,trimDropdown:!0,debug:!1,wordWrap:!0,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:!1,viewportRowRenderingOffset:"auto",viewportColumnRenderingOffset:"auto",validator:void 0,disableVisualSelection:!1,sortIndicator:void 0,manualColumnFreeze:void 0,trimWhitespace:!0,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:!1,defaultDate:void 0,strict:void 0,renderAllRows:void 0,preventOverflow:!1,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,observeChanges:void 0},Handsontable.DefaultSettings=Q},{"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:90,tableView:99}],26:[function(e,t,n){"use strict";function o(e,t,n){this.instance=e,this.priv=t,this.GridSettings=n,this.dataSource=this.instance.getSettings().data,this.dataSource[0]?this.duckSchema=this.recursiveDuckSchema(this.dataSource[0]):this.duckSchema={},this.createMap()}Object.defineProperties(n,{DataMap:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,a,l,u,c,d=(r=e("SheetClip"),r&&r.__esModule&&r||{"default":r})["default"],h=(i=e("helpers/data"),i&&i.__esModule&&i||{"default":i}).cellMethodLookupFactory,f=(s=e("helpers/setting"),s&&s.__esModule&&s||{"default":s}).columnFactory,p=(a=e("helpers/object"),a&&a.__esModule&&a||{"default":a}),g=p.duckSchema,m=p.deepExtend,v=(l=e("helpers/array"),l&&l.__esModule&&l||{"default":l}),w=v.extendArray,y=v.to2dArray,b=(u=e("helpers/number"),u&&u.__esModule&&u||{"default":u}).rangeEach,C=(c=e("multiMap"),c&&c.__esModule&&c||{"default":c}).MultiMap;o.prototype.DESTINATION_RENDERER=1,o.prototype.DESTINATION_CLIPBOARD_GENERATOR=2,o.prototype.recursiveDuckSchema=function(e){return g(e)},o.prototype.recursiveDuckColumns=function(e,t,n){var o,r;if("undefined"==typeof t&&(t=0,n=""),"object"==typeof e&&!Array.isArray(e))for(r in e)e.hasOwnProperty(r)&&(null===e[r]?(o=n+r,this.colToPropCache.push(o),this.propToColCache.set(o,t),t++):t=this.recursiveDuckColumns(e[r],t,r+"."));return t},o.prototype.createMap=function(){var e,t,n=this.getSchema();if("undefined"==typeof n)throw new Error("trying to create `columns` definition but you didnt' provide `schema` nor `data`");this.colToPropCache=[],this.propToColCache=new C;var o=this.instance.getSettings().columns;if(o)for(e=0,t=o.length;t>e;e++)"undefined"!=typeof o[e].data&&(this.colToPropCache[e]=o[e].data,this.propToColCache.set(o[e].data,e));else this.recursiveDuckColumns(n)},o.prototype.colToProp=function(e){return e=Handsontable.hooks.run(this.instance,"modifyCol",e),this.colToPropCache&&"undefined"!=typeof this.colToPropCache[e]?this.colToPropCache[e]:e},o.prototype.propToCol=function(e){var t;return t="undefined"==typeof this.propToColCache.get(e)?e:this.propToColCache.get(e),t=Handsontable.hooks.run(this.instance,"modifyCol",t)},o.prototype.getSchema=function(){var e=this.instance.getSettings().dataSchema;return e?"function"==typeof e?e():e:this.duckSchema},o.prototype.createRow=function(e,t,n){var o,r,i=this.instance.countCols(),s=0;t||(t=1),("number"!=typeof e||e>=this.instance.countSourceRows())&&(e=this.instance.countSourceRows()),r=e;for(var a=this.instance.getSettings().maxRows;t>s&&this.instance.countSourceRows()l;l++)o.push(null)}else"function"===this.instance.dataType?o=this.instance.getSettings().dataSchema(e):(o={},m(o,this.getSchema()));e===this.instance.countSourceRows()?this.dataSource.push(o):this.dataSource.splice(e,0,o),s++,r++}return Handsontable.hooks.run(this.instance,"afterCreateRow",e,s,n),this.instance.forceFullRender=!0,s},o.prototype.createCol=function(e,t,n){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 o,r,i=this.instance.countSourceRows(),s=this.dataSource,a=0;t||(t=1),r=e;for(var l=this.instance.getSettings().maxCols;t>a&&this.instance.countCols()=this.instance.countCols()){for(var u=0;i>u;u++)"undefined"==typeof s[u]&&(s[u]=[]),s[u].push(null);this.priv.columnSettings.push(o)}else{for(var u=0;i>u;u++)s[u].splice(r,0,null);this.priv.columnSettings.splice(r,0,o)}a++,r++}return Handsontable.hooks.run(this.instance,"afterCreateCol",e,a,n),this.instance.forceFullRender=!0,a},o.prototype.removeRow=function(e,t){t||(t=1),"number"!=typeof e&&(e=-t),e=(this.instance.countSourceRows()+e)%this.instance.countSourceRows();var n=this.physicalRowsToLogical(e,t),o=Handsontable.hooks.run(this.instance,"beforeRemoveRow",e,t,n);if(o!==!1){var r=this.dataSource,i=r.filter(function(e,t){return-1==n.indexOf(t)});r.length=0,Array.prototype.push.apply(r,i),Handsontable.hooks.run(this.instance,"afterRemoveRow",e,t,n),this.instance.forceFullRender=!0}},o.prototype.removeCol=function(e,t){if("object"===this.instance.dataType||this.instance.getSettings().columns)throw new Error("cannot remove column with object data source or columns option specified");t||(t=1),"number"!=typeof e&&(e=-t),e=(this.instance.countCols()+e)%this.instance.countCols();var n=Handsontable.hooks.run(this.instance,"beforeRemoveCol",e,t);if(n!==!1){for(var o=this.dataSource,r=0,i=this.instance.countSourceRows();i>r;r++)o[r].splice(e,t);this.priv.columnSettings.splice(e,t),Handsontable.hooks.run(this.instance,"afterRemoveCol",e,t),this.instance.forceFullRender=!0}},o.prototype.spliceCol=function(e,t,n){var o=4<=arguments.length?[].slice.call(arguments,3):[],r=this.instance.getDataAtCol(e),i=r.slice(t,t+n),s=r.slice(t+n);w(o,s);for(var a=0;n>a;)o.push(null),a++;return y(o),this.instance.populateFromArray(t,e,o,null,null,"spliceCol"),i},o.prototype.spliceRow=function(e,t,n){var o=4<=arguments.length?[].slice.call(arguments,3):[],r=this.instance.getSourceDataAtRow(e),i=r.slice(t,t+n),s=r.slice(t+n);w(o,s);for(var a=0;n>a;)o.push(null),a++;return this.instance.populateFromArray(e,t,[o],null,null,"spliceRow"),i},o.prototype.get=function(e,t){e=Handsontable.hooks.run(this.instance,"modifyRow",e);var n=this.dataSource[e];if(n&&n.hasOwnProperty&&n.hasOwnProperty(t))return n[t];if("string"==typeof t&&t.indexOf(".")>-1){var o=t.split("."),r=n;if(!r)return null;for(var i=0,s=o.length;s>i;i++)if(r=r[o[i]],"undefined"==typeof r)return null;return r}return"function"==typeof t?t(this.dataSource.slice(e,e+1)[0]):null};var R=h("copyable",!1);o.prototype.getCopyable=function(e,t){return R.call(this.instance,e,this.propToCol(t))?this.get(e,t):""},o.prototype.set=function(e,t,n,o){e=Handsontable.hooks.run(this.instance,"modifyRow",e,o||"datamapGet");var r=this.dataSource[e];if(r&&r.hasOwnProperty&&r.hasOwnProperty(t))r[t]=n;else if("string"==typeof t&&t.indexOf(".")>-1){for(var i=t.split("."),s=r,a=0,l=i.length-1;l>a;a++)"undefined"==typeof s[i[a]]&&(s[i[a]]={}),s=s[i[a]];s[i[a]]=n}else"function"==typeof t?t(this.dataSource.slice(e,e+1)[0],n):r[t]=n},o.prototype.physicalRowsToLogical=function(e,t){for(var n,o=this.instance.countSourceRows(),r=(o+e)%o,i=[],s=t;o>r&&s;)n=Handsontable.hooks.run(this.instance,"modifyRow",r),i.push(n),s--,r++;return i},o.prototype.clear=function(){for(var e=0;e=o;o++){a=[];var c=Handsontable.hooks.run(this.instance,"modifyRow",o);for(i=Math.min(e.col,t.col);s>=i;i++){if(null===c)break;a.push(u.call(this,o,this.colToProp(i)))}null!==c&&l.push(a)}return l},o.prototype.getText=function(e,t){return d.stringify(this.getRange(e,t,this.DESTINATION_RENDERER))},o.prototype.getCopyableText=function(e,t){return d.stringify(this.getRange(e,t,this.DESTINATION_CLIPBOARD_GENERATOR))},Handsontable.DataMap=o},{SheetClip:"SheetClip","helpers/array":42,"helpers/data":44,"helpers/number":49,"helpers/object":50,"helpers/setting":51,multiMap:55}],27:[function(e,t,n){"use strict";Object.defineProperties(n,{DataSource:{get:function(){return f}},__esModule:{value:!0}});var o,r,i,s,a,l=((o=e("helpers/data"),o&&o.__esModule&&o||{"default":o}).cellMethodLookupFactory,(r=e("helpers/setting"),r&&r.__esModule&&r||{"default":r}).columnFactory,i=e("helpers/object"),i&&i.__esModule&&i||{"default":i}),u=(l.duckSchema,l.deepExtend,l.getProperty),c=(s=e("helpers/array"),s&&s.__esModule&&s||{"default":s}),d=(c.extendArray,c.arrayEach),h=(a=e("helpers/number"),a&&a.__esModule&&a||{"default":a}).rangeEach,f=function(e){var t=void 0!==arguments[1]?arguments[1]:[];this.hot=e,this.data=t,this.dataType="array",this.colToProp=function(){},this.propToCol=function(){}};$traceurRuntime.createClass(f,{getData:function(){return this.data},setData:function(e){this.data=e},getAtColumn:function(e){var t=this,n=[];return d(this.data,function(o){var r=t.colToProp(e);o="string"==typeof r?u(o,r):o[r],n.push(o)}),n},getAtRow:function(e){return this.data[e]},getAtCell:function(e,t){return this.data[e][this.colToProp(t)]},getByRange:function(e,t){var n=this,o=Math.min(e.row,t.row),r=Math.min(e.col,t.col),i=Math.max(e.row,t.row),s=Math.max(e.col,t.col),a=[];return h(o,i,function(e){var t,o=n.getAtRow(e);"array"===n.dataType?t=o.slice(r,s):"object"===n.dataType&&(t={},h(r,s,function(e){var r=n.colToProp(e);t[r]=o[r]})),a.push(t)}),a},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(e,t,n){"use strict";function o(e,t,n){function o(e){var o="function"==typeof t.settings.enterMoves?t.settings.enterMoves(event):t.settings.enterMoves;e?n.transformStart(-o.row,-o.col):n.transformStart(o.row,o.col,!0)}function r(e){e?n.transformEnd(-1,0):n.transformStart(-1,0)}function i(e){e?n.transformEnd(1,0):n.transformStart(1,0)}function s(e){e?n.transformEnd(0,1):n.transformStart(0,1)}function a(e){e?n.transformEnd(0,-1):n.transformStart(0,-1)}function l(l){var c,p;if(e.isListening()&&(Handsontable.hooks.run(e,"beforeKeyDown",l),!C&&!v(l)&&(t.lastKeyCode=l.keyCode,n.isSelected()))){if(c=(l.ctrlKey||l.metaKey)&&!l.altKey,y&&!y.isWaiting()&&!(h(l.keyCode)||f(l.keyCode)||c||b.isEditorOpened()))return void b.openEditor("",l);switch(p=l.shiftKey?n.setRangeEnd:n.setRangeStart,l.keyCode){case d.A:!b.isEditorOpened()&&c&&(n.selectAll(),l.preventDefault(),g(l));break;case d.ARROW_UP:b.isEditorOpened()&&!y.isWaiting()&&b.closeEditorAndSaveChanges(c),r(l.shiftKey),l.preventDefault(),g(l);break;case d.ARROW_DOWN:b.isEditorOpened()&&!y.isWaiting()&&b.closeEditorAndSaveChanges(c),i(l.shiftKey),l.preventDefault(),g(l);break;case d.ARROW_RIGHT:b.isEditorOpened()&&!y.isWaiting()&&b.closeEditorAndSaveChanges(c),s(l.shiftKey),l.preventDefault(),g(l);break;case d.ARROW_LEFT:b.isEditorOpened()&&!y.isWaiting()&&b.closeEditorAndSaveChanges(c),a(l.shiftKey),l.preventDefault(),g(l);break;case d.TAB:var w="function"==typeof t.settings.tabMoves?t.settings.tabMoves(l):t.settings.tabMoves;l.shiftKey?n.transformStart(-w.row,-w.col):n.transformStart(w.row,w.col,!0),l.preventDefault(),g(l);break;case d.BACKSPACE:case d.DELETE:n.empty(l),b.prepareEditor(),l.preventDefault();break;case d.F2:b.openEditor(null,l),y&&y.enableFullEditMode(),l.preventDefault();break;case d.ENTER:b.isEditorOpened()?(y&&y.state!==Handsontable.EditorState.WAITING&&b.closeEditorAndSaveChanges(c),o(l.shiftKey)):e.getSettings().enterBeginsEditing?(b.openEditor(null,l),y&&y.enableFullEditMode()):o(l.shiftKey),l.preventDefault(),m(l);break;case d.ESCAPE:b.isEditorOpened()&&b.closeEditorAndRestoreOriginalValue(c),l.preventDefault();break;case d.HOME:p(l.ctrlKey||l.metaKey?new u(0,t.selRange.from.col):new u(t.selRange.from.row,0)),l.preventDefault(),g(l);break;case d.END:p(l.ctrlKey||l.metaKey?new u(e.countRows()-1,t.selRange.from.col):new u(t.selRange.from.row,e.countCols()-1)),l.preventDefault(),g(l);break;case d.PAGE_UP:n.transformStart(-e.countVisibleRows(),0),l.preventDefault(),g(l);break;case d.PAGE_DOWN:n.transformStart(e.countVisibleRows(),0),l.preventDefault(),g(l)}}}function c(){function t(e,t,n){"TD"==n.nodeName&&(b.openEditor(),y&&y.enableFullEditMode())}e.addHook("afterDocumentKeyDown",l),p.addEventListener(document.documentElement,"keydown",function(t){e.runHooks("afterDocumentKeyDown",t)}),e.view.wt.update("onCellDblClick",t),e.addHook("afterDestroy",function(){C=!0})}var p,y,b=this,C=!1;p=w(e),this.destroyEditor=function(e){this.closeEditor(e)},this.getActiveEditor=function(){return y},this.prepareEditor=function(){var n,o,r,i,s,a,l;return y&&y.isWaiting()?void this.closeEditor(!1,!1,function(e){e&&b.prepareEditor()}):(n=t.selRange.highlight.row,o=t.selRange.highlight.col,r=e.colToProp(o),i=e.getCell(n,o),s=e.getDataAtCell(n,o),a=e.getCellMeta(n,o),l=e.getCellEditor(a),void(l?(y=Handsontable.editors.getEditor(l,e),y.prepare(n,o,r,i,s,a)):y=void 0))},this.isEditorOpened=function(){return y&&y.isOpened()},this.openEditor=function(e,t){y&&!y.cellProperties.readOnly?y.beginEditing(e,t):y&&y.cellProperties.readOnly&&t&&t.keyCode===d.ENTER&&o()},this.closeEditor=function(e,t,n){y?y.finishEditing(e,t,n):n&&n(!1)},this.closeEditorAndSaveChanges=function(e){return this.closeEditor(!1,e)},this.closeEditorAndRestoreOriginalValue=function(e){return this.closeEditor(!0,e)},c()}Object.defineProperties(n,{EditorManager:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,a,l,u=(r=e("3rdparty/walkontable/src/cell/coords"),r&&r.__esModule&&r||{"default":r}).WalkontableCellCoords,c=(i=e("helpers/unicode"),i&&i.__esModule&&i||{"default":i}),d=c.KEY_CODES,h=c.isMetaKey,f=c.isCtrlKey,p=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),g=p.stopPropagation,m=p.stopImmediatePropagation,v=p.isImmediatePropagationStopped,w=((a=e("editors"),a&&a.__esModule&&a||{"default":a}).getEditor,(l=e("eventManager"),l&&l.__esModule&&l||{"default":l}).eventManager);Handsontable.EditorManager=o},{"3rdparty/walkontable/src/cell/coords":5,editors:29,eventManager:41,"helpers/dom/event":46,"helpers/unicode":53}],29:[function(e,t,n){"use strict";function o(e){var t,n;n={},t=e,this.getConstructor=function(){return e},this.getInstance=function(e){return e.guid in n||(n[e.guid]=new t(e)),n[e.guid]}}function r(e,t){var n=new o(t);"string"==typeof e&&(c[e]=n,Handsontable.editors[u(e)+"Editor"]=t),d.set(t,n)}function i(e,t){var n;if("function"==typeof e)d.get(e)||r(null,e),n=d.get(e);else{if("string"!=typeof e)throw Error('Only strings and functions can be passed as "editor" parameter ');n=c[e]}if(!n)throw Error('No editor registered under name "'+e+'"');return n.getInstance(t)}function s(e){var t;if("string"!=typeof e)throw Error('Only strings and functions can be passed as "editor" parameter ');if(t=c[e],!t)throw Error('No editor registered under name "'+e+'"');return t.getConstructor()}function a(e){return c[e]?!0:!1}Object.defineProperties(n,{registerEditor:{get:function(){return r}},getEditor:{get:function(){return i}},hasEditor:{get:function(){return a}},getEditorConstructor:{get:function(){return s}},__esModule:{value:!0}});var l,u=(l=e("helpers/string"),l&&l.__esModule&&l||{"default":l}).toUpperCaseFirst,c={},d=new WeakMap;Handsontable.editors=Handsontable.editors||{},Handsontable.editors.registerEditor=r,Handsontable.editors.getEditor=i},{"helpers/string":52}],30:[function(e,t,n){"use strict";function o(e){this.instance=e,this.state=Handsontable.EditorState.VIRGIN,this._opened=!1,this._fullEditMode=!1,this._closeCallback=null,this.init()}Object.defineProperties(n,{BaseEditor:{get:function(){return o}},__esModule:{value:!0}});var r,i,s=(r=e("helpers/mixed"),r&&r.__esModule&&r||{"default":r}).stringify,a=(i=e("3rdparty/walkontable/src/cell/coords"),i&&i.__esModule&&i||{"default":i}).WalkontableCellCoords;Handsontable.editors=Handsontable.editors||{},Handsontable.editors.BaseEditor=o,Handsontable.EditorState={VIRGIN:"STATE_VIRGIN",EDITING:"STATE_EDITING",WAITING:"STATE_WAITING",FINISHED:"STATE_FINISHED"},o.prototype._fireCallbacks=function(e){this._closeCallback&&(this._closeCallback(e),this._closeCallback=null)},o.prototype.init=function(){},o.prototype.getValue=function(){throw Error("Editor getValue() method unimplemented")},o.prototype.setValue=function(e){throw Error("Editor setValue() method unimplemented")},o.prototype.open=function(){throw Error("Editor open() method unimplemented")},o.prototype.close=function(){throw Error("Editor close() method unimplemented")},o.prototype.prepare=function(e,t,n,o,r,i){this.TD=o,this.row=e,this.col=t,this.prop=n,this.originalValue=r,this.cellProperties=i,this.instance.view.isMouseDown()&&document.activeElement&&document.activeElement!==document.body?document.activeElement.blur():document.activeElement||document.body.focus(),this.state=Handsontable.EditorState.VIRGIN},o.prototype.extend=function(){function e(){n.apply(this,arguments)}function t(e,t){function n(){}return n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e,e}var n=this.constructor;return t(e,n)},o.prototype.saveValue=function(e,t){var n,o;t?(n=this.instance.getSelected(),n[0]>n[2]&&(o=n[0],n[0]=n[2],n[2]=o),n[1]>n[3]&&(o=n[1],n[1]=n[3],n[3]=o),this.instance.populateFromArray(n[0],n[1],e,n[2],n[3],"edit")):this.instance.populateFromArray(this.row,this.col,e,null,null,"edit")},o.prototype.beginEditing=function(e,t){this.state==Handsontable.EditorState.VIRGIN&&(this.instance.view.scrollViewport(new a(this.row,this.col)),this.instance.view.render(),this.state=Handsontable.EditorState.EDITING,e="string"==typeof e?e:this.originalValue,this.setValue(s(e)),this.open(t),this._opened=!0,this.focus(),this.instance.view.render())},o.prototype.finishEditing=function(e,t,n){var o,r=this;if(n){var i=this._closeCallback;this._closeCallback=function(e){i&&i(e),n(e)}}if(!this.isWaiting()){if(this.state==Handsontable.EditorState.VIRGIN)return void this.instance._registerTimeout(setTimeout(function(){r._fireCallbacks(!0)},0));if(this.state==Handsontable.EditorState.EDITING){if(e)return this.cancelChanges(),void this.instance.view.render();var s=this.getValue();o=this.instance.getSettings().trimWhitespace?[["string"==typeof s?String.prototype.trim.call(s||""):s]]:[[s]],this.state=Handsontable.EditorState.WAITING,this.saveValue(o,t),this.instance.getCellValidator(this.cellProperties)?this.instance.addHookOnce("postAfterValidate",function(e){r.state=Handsontable.EditorState.FINISHED,r.discardEditor(e)}):(this.state=Handsontable.EditorState.FINISHED,this.discardEditor(!0))}}},o.prototype.cancelChanges=function(){this.state=Handsontable.EditorState.FINISHED,this.discardEditor()},o.prototype.discardEditor=function(e){this.state===Handsontable.EditorState.FINISHED&&(e===!1&&this.cellProperties.allowInvalid!==!0?(this.instance.selectCell(this.row,this.col),this.focus(),this.state=Handsontable.EditorState.EDITING,this._fireCallbacks(!1)):(this.close(),this._opened=!1,this._fullEditMode=!1,this.state=Handsontable.EditorState.VIRGIN,this._fireCallbacks(!0)))},o.prototype.enableFullEditMode=function(){this._fullEditMode=!0},o.prototype.isInFullEditMode=function(){return this._fullEditMode},o.prototype.isOpened=function(){return this._opened},o.prototype.isWaiting=function(){return this.state===Handsontable.EditorState.WAITING},o.prototype.checkEditorSection=function(){var e=this.instance.countRows(),t="";return this.row=e-this.instance.getSettings().fixedRowsBottom?t=this.col"+a+"")))},autoColumnSize:!0,modifyColWidth:function(e,t){var o=this.getPlugin("autoColumnSize").widths;return o[t]&&(e=o[t]),n?e:e+15}}),this.htEditor.view.wt.wtTable.holder.parentNode.style["padding-right"]=w()+2+"px",T&&(T=!1),t.instance._registerTimeout(setTimeout(function(){t.queryChoices(t.TEXTAREA.value)},0))},E.prototype.close=function(){S.prototype.close.apply(this,arguments)},E.prototype.queryChoices=function(e){if(this.query=e,"function"==typeof this.cellProperties.source){var t=this;this.cellProperties.source(e,function(e){t.updateChoicesList(e)})}else if(Array.isArray(this.cellProperties.source)){var n;if(e&&this.cellProperties.filter!==!1){var o=this.cellProperties.filteringCaseSensitive===!0,r=e.toLowerCase();n=this.cellProperties.source.filter(function(t){return o?-1!=t.indexOf(e):-1!=t.toLowerCase().indexOf(r)})}else n=this.cellProperties.source;this.updateChoicesList(n)}else this.updateChoicesList([])},E.prototype.updateChoicesList=function(e){var t,n=v(this.TEXTAREA),o=y(this.TEXTAREA),r=E.sortByRelevance(this.getValue(),e,this.cellProperties.filteringCaseSensitive);if(0==this.cellProperties.filter)t=r[0];else{for(var i=[],s=0,a=r.length;a>s;s++)i.push(e[r[s]]);t=0,e=i}this.choices=e,this.htEditor.loadData(p([e])),this.updateDropdownHeight(),this.cellProperties.strict===!0&&this.highlightBestMatchingChoice(t),this.instance.listen(),this.TEXTAREA.focus(),C(this.TEXTAREA,n,n==o?void 0:o)},E.prototype.updateDropdownHeight=function(){var e=this.htEditor.getColWidth(0)+w()+2,t=void 0===this.cellProperties.trimDropdown?!0:this.cellProperties.trimDropdown;this.htEditor.updateSettings({height:this.getDropdownHeight(),width:t?void 0:e}),this.htEditor.view.wt.wtTable.alignOverlaysWithTrimmingContainer()},E.prototype.finishEditing=function(e){e||this.instance.removeHook("beforeKeyDown",o),S.prototype.finishEditing.apply(this,arguments)},E.prototype.highlightBestMatchingChoice=function(e){"number"==typeof e?this.htEditor.selectCell(e,0):this.htEditor.deselectCell()},E.sortByRelevance=function(e,t,n){var o,r,i,s,a,l=[],u=e.length,c=[];if(0===u){for(s=0,a=t.length;a>s;s++)c.push(s);return c}for(s=0,a=t.length;a>s;s++)o=f(t[s]),r=n?o.indexOf(e):o.toLowerCase().indexOf(e.toLowerCase()),-1!=r&&(i=o.length-r-u,l.push({baseIndex:s,index:r,charsLeft:i,value:o}));for(l.sort(function(e,t){return-1===t.index?-1:-1===e.index?1:e.indext.charsLeft?1:0:void 0}),s=0,a=l.length;a>s;s++)c.push(l[s].baseIndex);return c},E.prototype.getDropdownHeight=function(){var e=this.htEditor.getInstance().getRowHeight(0)||23,t=this.cellProperties.visibleRows;return this.choices.length>=t?t*e:this.choices.length*e+8},E.prototype.allowKeyEventPropagation=function(e){var t={row:this.htEditor.getSelectedRange()?this.htEditor.getSelectedRange().from.row:-1},n=!1;return e===d.ARROW_DOWN&&t.row-1&&(n=!0),n},_("autocomplete",E)},{editors:29,handsontableEditor:35,"helpers/array":42,"helpers/dom/element":45,"helpers/mixed":48,"helpers/unicode":53}],32:[function(e,t,n){"use strict";Object.defineProperties(n,{CheckboxEditor:{get:function(){return u}},__esModule:{value:!0}});var o,r,i,s=(o=e("editors"),o&&o.__esModule&&o||{"default":o}).registerEditor,a=(r=e("_baseEditor"),r&&r.__esModule&&r||{"default":r}).BaseEditor,l=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}).hasClass,u=function(){$traceurRuntime.superConstructor(c).apply(this,arguments)},c=u;$traceurRuntime.createClass(u,{beginEditing:function(){var e=this.TD.querySelector('input[type="checkbox"]');l(e,"htBadValue")||e.click()},finishEditing:function(){},init:function(){},open:function(){},close:function(){},getValue:function(){},setValue:function(){},focus:function(){}},{},a),s("checkbox",u)},{_baseEditor:30,editors:29,"helpers/dom/element":45}],33:[function(e,t,n){"use strict";Object.defineProperties(n,{DateEditor:{get:function(){return S}},__esModule:{value:!0}});var o,r,i,s,a,l,u,c,d,h=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),f=h.addClass,p=h.outerHeight,g=(r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}).deepExtend,m=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).EventManager,v=(s=e("editors"),s&&s.__esModule&&s||{"default":s}),w=(v.getEditor,v.registerEditor),y=(a=e("helpers/unicode"),a&&a.__esModule&&a||{"default":a}).isMetaKey,b=(l=e("helpers/dom/event"),l&&l.__esModule&&l||{"default":l}).stopPropagation,C=(u=e("textEditor"),u&&u.__esModule&&u||{"default":u}).TextEditor,R=(c=e("moment"),c&&c.__esModule&&c||{"default":c})["default"],_=(d=e("pikaday"),d&&d.__esModule&&d||{"default":d})["default"];Handsontable.editors=Handsontable.editors||{},Handsontable.editors.DateEditor=S;var S=function(e){this.$datePicker=null,this.datePicker=null,this.datePickerStyle=null,this.defaultDateFormat="DD/MM/YYYY",this.isCellEdited=!1,this.parentDestroyed=!1,$traceurRuntime.superConstructor(E).call(this,e)},E=S;$traceurRuntime.createClass(S,{init:function(){var e=this;if("function"!=typeof R)throw new Error("You need to include moment.js to your project.");if("function"!=typeof _)throw new Error("You need to include Pikaday to your project.");$traceurRuntime.superGet(this,E.prototype,"init").call(this),this.instance.addHook("afterDestroy",function(){e.parentDestroyed=!0,e.destroyElements()})},createElements:function(){$traceurRuntime.superGet(this,E.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,f(this.datePicker,"htDatepickerHolder"),document.body.appendChild(this.datePicker),this.$datePicker=new _(this.getDatePickerConfig());var e=new m(this);e.addEventListener(this.datePicker,"mousedown",function(e){return b(e)}),this.hideDatepicker()},destroyElements:function(){this.$datePicker.destroy()},prepare:function(e,t,n,o,r,i){this._opened=!1,$traceurRuntime.superGet(this,E.prototype,"prepare").call(this,e,t,n,o,r,i)},open:function(){var e=void 0!==arguments[0]?arguments[0]:null;$traceurRuntime.superGet(this,E.prototype,"open").call(this),this.showDatepicker(e)},close:function(){var e=this;this._opened=!1,this.instance._registerTimeout(setTimeout(function(){e.instance.selection.refreshBorders(); -},0)),$traceurRuntime.superGet(this,E.prototype,"close").call(this)},finishEditing:function(){var e=void 0!==arguments[0]?arguments[0]:!1,t=void 0!==arguments[1]?arguments[1]:!1;if(e){var n=this.originalValue;void 0!==n&&this.setValue(n)}this.hideDatepicker(),$traceurRuntime.superGet(this,E.prototype,"finishEditing").call(this,e,t)},showDatepicker:function(e){this.$datePicker.config(this.getDatePickerConfig());var t,n=this.TD.getBoundingClientRect(),o=this.cellProperties.dateFormat||this.defaultDateFormat,r=this.$datePicker.config(),i=this.instance.view.isMouseDown(),s=e?y(e.keyCode):!1;this.datePickerStyle.top=window.pageYOffset+n.top+p(this.TD)+"px",this.datePickerStyle.left=window.pageXOffset+n.left+"px",this.$datePicker._onInputFocus=function(){},r.format=o,this.originalValue?(t=this.originalValue,R(t,o,!0).isValid()&&this.$datePicker.setMoment(R(t,o),!0),s||i||this.setValue("")):this.cellProperties.defaultDate?(t=this.cellProperties.defaultDate,r.defaultDate=t,R(t,o,!0).isValid()&&this.$datePicker.setMoment(R(t,o),!0),s||i||this.setValue("")):this.$datePicker.gotoToday(),this.datePickerStyle.display="block",this.$datePicker.show()},hideDatepicker:function(){this.datePickerStyle.display="none",this.$datePicker.hide()},getDatePickerConfig:function(){var e=this,t=this.TEXTAREA,n={};this.cellProperties&&this.cellProperties.datePickerConfig&&g(n,this.cellProperties.datePickerConfig);var o=n.onSelect,r=n.onClose;return n.field=t,n.trigger=t,n.container=this.datePicker,n.bound=!1,n.format=n.format||this.defaultDateFormat,n.reposition=n.reposition||!1,n.onSelect=function(t){isNaN(t.getTime())||(t=R(t).format(e.cellProperties.dateFormat||e.defaultDateFormat)),e.setValue(t),e.hideDatepicker(),o&&o()},n.onClose=function(){e.parentDestroyed||e.finishEditing(!1),r&&r()},n}},{},C),w("date",S)},{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(e,t,n){"use strict";Object.defineProperties(n,{DropdownEditor:{get:function(){return l}},__esModule:{value:!0}});var o,r,i=(o=e("editors"),o&&o.__esModule&&o||{"default":o}),s=(i.getEditor,i.registerEditor),a=(r=e("autocompleteEditor"),r&&r.__esModule&&r||{"default":r}).AutocompleteEditor,l=function(){$traceurRuntime.superConstructor(u).apply(this,arguments)},u=l;$traceurRuntime.createClass(l,{prepare:function(e,t,n,o,r,i){$traceurRuntime.superGet(this,u.prototype,"prepare").call(this,e,t,n,o,r,i),this.cellProperties.filter=!1,this.cellProperties.strict=!0}},{},a),Handsontable.hooks.add("beforeValidate",function(e,t,n,o){var r=this.getCellMeta(t,n);r.editor===Handsontable.editors.DropdownEditor&&void 0===r.strict&&(r.filter=!1,r.strict=!0)}),s("dropdown",l)},{autocompleteEditor:31,editors:29}],35:[function(e,t,n){"use strict";Object.defineProperties(n,{HandsontableEditor:{get:function(){return w}},__esModule:{value:!0}});var o,r,i,s,a,l,u=(o=e("helpers/unicode"),o&&o.__esModule&&o||{"default":o}).KEY_CODES,c=(r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}).extend,d=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}).setCaretPosition,h=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),f=h.stopImmediatePropagation,p=h.isImmediatePropagationStopped,g=(a=e("editors"),a&&a.__esModule&&a||{"default":a}),m=(g.getEditor,g.registerEditor),v=(l=e("textEditor"),l&&l.__esModule&&l||{"default":l}).TextEditor,w=v.prototype.extend();w.prototype.createElements=function(){v.prototype.createElements.apply(this,arguments);var e=document.createElement("DIV");e.className="handsontableEditor",this.TEXTAREA_PARENT.appendChild(e),this.htContainer=e,this.assignHooks()},w.prototype.prepare=function(e,t,n,o,r,i){v.prototype.prepare.apply(this,arguments);var s=this,a={startRows:0,startCols:0,minRows:0,minCols:0,className:"listbox",copyPaste:!1,autoColumnSize:!1,autoRowSize:!1,readOnly:!0,fillHandle:!1,afterOnCellMouseDown:function(){var e=this.getValue();void 0!==e&&s.setValue(e),s.instance.destroyEditor()}};this.cellProperties.handsontable&&c(a,i.handsontable),this.htOptions=a};var y=function(e){if(!p(e)){var t,n=this.getActiveEditor(),o=n.htEditor.getInstance();if(e.keyCode==u.ARROW_DOWN)if(o.getSelected()){var r=o.getSelected()[0],i=o.countRows()-1;t=Math.min(i,r+1)}else t=0;else if(e.keyCode==u.ARROW_UP&&o.getSelected()){var r=o.getSelected()[0];t=r-1}void 0!==t&&(0>t?o.deselectCell():o.selectCell(t,0),o.getData().length&&(e.preventDefault(),f(e),n.instance.listen(),n.TEXTAREA.focus()))}};w.prototype.open=function(){this.instance.addHook("beforeKeyDown",y),v.prototype.open.apply(this,arguments),this.htEditor&&this.htEditor.destroy(),this.htEditor=new Handsontable(this.htContainer,this.htOptions),this.cellProperties.strict?(this.htEditor.selectCell(0,0),this.TEXTAREA.style.visibility="hidden"):(this.htEditor.deselectCell(),this.TEXTAREA.style.visibility="visible"),d(this.TEXTAREA,0,this.TEXTAREA.value.length)},w.prototype.close=function(){this.instance.removeHook("beforeKeyDown",y),this.instance.listen(),v.prototype.close.apply(this,arguments)},w.prototype.focus=function(){this.instance.listen(),v.prototype.focus.apply(this,arguments)},w.prototype.beginEditing=function(e){var t=this.instance.getSettings().onBeginEditing;t&&t()===!1||v.prototype.beginEditing.apply(this,arguments)},w.prototype.finishEditing=function(e,t){if(this.htEditor&&this.htEditor.isListening()&&this.instance.listen(),this.htEditor&&this.htEditor.getSelected()){var n=this.htEditor.getInstance().getValue();void 0!==n&&this.setValue(n)}return v.prototype.finishEditing.apply(this,arguments)},w.prototype.assignHooks=function(){var e=this;this.instance.addHook("afterDestroy",function(){e.htEditor&&e.htEditor.destroy()})},m("handsontable",w)},{editors:29,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/object":50,"helpers/unicode":53,textEditor:40}],36:[function(e,t,n){"use strict";Object.defineProperties(n,{MobileTextEditor:{get:function(){return O}},__esModule:{value:!0}});var o,r,i,s,a,l,u=(o=e("helpers/unicode"),o&&o.__esModule&&o||{"default":o}).KEY_CODES,c=(r=e("helpers/dom/event"),r&&r.__esModule&&r||{"default":r}),d=c.stopImmediatePropagation,h=c.isImmediatePropagationStopped,f=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),p=f.addClass,g=f.getScrollLeft,m=f.getScrollTop,v=f.hasClass,w=f.isChildOf,y=f.offset,b=f.outerHeight,C=f.outerWidth,R=f.removeClass,_=f.setCaretPosition,S=(s=e("editors"),s&&s.__esModule&&s||{"default":s}),E=(S.getEditor,S.registerEditor),T=(a=e("_baseEditor"),a&&a.__esModule&&a||{"default":a}).BaseEditor,M=(l=e("eventManager"),l&&l.__esModule&&l||{"default":l}).eventManager,O=T.prototype.extend(),k={},H=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 e in this.controls)this.controls.hasOwnProperty(e)&&this.positionControls.appendChild(this.controls[e])};O.prototype.valueChanged=function(){return this.initValue!=this.getValue()},O.prototype.init=function(){var e=this;this.eventManager=M(this.instance),this.createElements(),this.bindEvents(),this.instance.addHook("afterDestroy",function(){e.destroy()})},O.prototype.getValue=function(){return this.TEXTAREA.value},O.prototype.setValue=function(e){this.initValue=e,this.TEXTAREA.value=e},O.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"),p(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),H.call(this),document.body.appendChild(this.editorContainer)},O.prototype.onBeforeKeyDown=function(e){var t=this,n=t.getActiveEditor();if(e.target===n.TEXTAREA&&!h(e))switch(e.keyCode){case u.ENTER:n.close(),e.preventDefault();break;case u.BACKSPACE:d(e)}},O.prototype.open=function(){this.instance.addHook("beforeKeyDown",this.onBeforeKeyDown),p(this.editorContainer,"active"),R(this.cellPointer,"hidden"),this.updateEditorPosition()},O.prototype.focus=function(){this.TEXTAREA.focus(),_(this.TEXTAREA,this.TEXTAREA.value.length)},O.prototype.close=function(){this.TEXTAREA.blur(),this.instance.removeHook("beforeKeyDown",this.onBeforeKeyDown),R(this.editorContainer,"active")},O.prototype.scrollToView=function(){var e=this.instance.getSelectedRange().highlight;this.instance.view.scrollViewport(e)},O.prototype.hideCellPointer=function(){v(this.cellPointer,"hidden")||p(this.cellPointer,"hidden")},O.prototype.updateEditorPosition=function(e,t){if(e&&t)e=parseInt(e,10),t=parseInt(t,10),this.editorContainer.style.top=t+"px",this.editorContainer.style.left=e+"px";else{var n=this.instance.getSelected(),o=this.instance.getCell(n[0],n[1]);if(k.cellPointer||(k.cellPointer={height:b(this.cellPointer),width:C(this.cellPointer)}),k.editorContainer||(k.editorContainer={width:C(this.editorContainer)}),void 0!==o){var r=this.instance.view.wt.wtOverlays.leftOverlay.trimmingContainer==window?0:g(this.instance.view.wt.wtOverlays.leftOverlay.holder),i=this.instance.view.wt.wtOverlays.topOverlay.trimmingContainer==window?0:m(this.instance.view.wt.wtOverlays.topOverlay.holder),s=y(o),a=C(o),l={x:r,y:i};this.editorContainer.style.top=parseInt(s.top+b(o)-l.y+k.cellPointer.height,10)+"px",this.editorContainer.style.left=parseInt(window.innerWidth/2-k.editorContainer.width/2,10)+"px",s.left+a/2>parseInt(this.editorContainer.style.left,10)+k.editorContainer.width?this.editorContainer.style.left=window.innerWidth-k.editorContainer.width+"px":s.left+a/2n;n++)t[e[n]]=e[n];else"object"==typeof e&&(t=e);return t},S.prototype.getValue=function(){return this.select.value},S.prototype.setValue=function(e){this.select.value=e};var E=function(e){var t=this,n=t.getActiveEditor();switch(e.keyCode){case b.ARROW_UP:var o=n.select.selectedIndex-1;o>=0&&(n.select[o].selected=!0),y(e),e.preventDefault();break;case b.ARROW_DOWN:var r=n.select.selectedIndex+1;r<=n.select.length-1&&(n.select[r].selected=!0),y(e),e.preventDefault()}};S.prototype.open=function(){this._opened=!0,this.refreshDimensions(),this.select.style.display="",this.instance.addHook("beforeKeyDown",E)},S.prototype.close=function(){this._opened=!1,this.select.style.display="none",this.instance.removeHook("beforeKeyDown",E)},S.prototype.focus=function(){this.select.focus()},S.prototype.refreshDimensions=function(){if(this.state===Handsontable.EditorState.EDITING){if(this.TD=this.getEditedCell(),!this.TD)return void this.close();var e,t=v(this.TD)+1,n=m(this.TD)+1,o=g(this.TD),r=g(this.instance.rootElement),i=p(this.TD),s=o.top-r.top-1-(i.scrollTop||0),a=o.left-r.left-1-(i.scrollLeft||0),l=this.checkEditorSection(),u=this.instance.getSettings();u.rowHeaders?1:0,u.colHeaders?1:0;switch(l){case"top":e=f(this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.holder.parentNode);break;case"left":e=f(this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.holder.parentNode);break;case"top-left-corner":e=f(this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.holder.parentNode);break;case"bottom-left-corner":e=f(this.instance.view.wt.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.holder.parentNode);break;case"bottom":e=f(this.instance.view.wt.wtOverlays.bottomOverlay.clone.wtTable.holder.parentNode)}0===this.instance.getSelected()[0]&&(s+=1),0===this.instance.getSelected()[1]&&(a+=1);var c=this.select.style;e&&-1!=e?c[e[0]]=e[1]:w(this.select);var d=h(this.TD);parseInt(d.borderTopWidth,10)>0&&(n-=1),parseInt(d.borderLeftWidth,10)>0&&(t-=1),c.height=n+"px",c.minWidth=t+"px",c.top=s+"px",c.left=a+"px",c.margin="0px"}},S.prototype.getEditedCell=function(){var e,t=this.checkEditorSection();switch(t){case"top":e=this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.select.style.zIndex=101;break;case"corner":e=this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.select.style.zIndex=103;break;case"left":e=this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.select.style.zIndex=102;break;default:e=this.instance.getCell(this.row,this.col),this.select.style.zIndex=""}return-1!=e&&-2!=e?e:void 0},R("select",S)},{_baseEditor:30,editors:29,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/unicode":53}],40:[function(e,t,n){"use strict";Object.defineProperties(n,{TextEditor:{get:function(){return A}},__esModule:{value:!0}});var o,r,i,s,a,l,u,c=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),d=c.addClass,h=c.getCaretPosition,f=c.getComputedStyle,p=c.getCssTransform,g=c.getScrollableElement,m=c.getScrollbarWidth,v=c.innerWidth,w=c.offset,y=c.resetCssTransform,b=c.setCaretPosition,C=c.hasVerticalScrollbar,R=c.hasHorizontalScrollbar,_=(r=e("autoResize"),r&&r.__esModule&&r||{"default":r})["default"],S=(i=e("_baseEditor"),i&&i.__esModule&&i||{"default":i}).BaseEditor,E=(s=e("eventManager"),s&&s.__esModule&&s||{"default":s}).eventManager,T=(a=e("editors"),a&&a.__esModule&&a||{"default":a}),M=(T.getEditor,T.registerEditor),O=(l=e("helpers/unicode"),l&&l.__esModule&&l||{"default":l}).KEY_CODES,k=(u=e("helpers/dom/event"),u&&u.__esModule&&u||{"default":u}),H=k.stopPropagation,D=k.stopImmediatePropagation,x=k.isImmediatePropagationStopped,A=S.prototype.extend();A.prototype.init=function(){var e=this;this.createElements(),this.eventManager=E(this),this.bindEvents(),this.autoResize=_(),this.instance.addHook("afterDestroy",function(){e.destroy()})},A.prototype.getValue=function(){return this.TEXTAREA.value},A.prototype.setValue=function(e){this.TEXTAREA.value=e};var P=function(e){var t,n=this,o=n.getActiveEditor();if(t=(e.ctrlKey||e.metaKey)&&!e.altKey,e.target===o.TEXTAREA&&!x(e)){if(17===e.keyCode||224===e.keyCode||91===e.keyCode||93===e.keyCode)return void D(e);switch(e.keyCode){case O.ARROW_RIGHT:o.isInFullEditMode()&&(!o.isWaiting()&&!o.allowKeyEventPropagation||!o.isWaiting()&&o.allowKeyEventPropagation&&!o.allowKeyEventPropagation(e.keyCode))&&D(e);break;case O.ARROW_LEFT:o.isInFullEditMode()&&(!o.isWaiting()&&!o.allowKeyEventPropagation||!o.isWaiting()&&o.allowKeyEventPropagation&&!o.allowKeyEventPropagation(e.keyCode))&&D(e);break;case O.ARROW_UP:case O.ARROW_DOWN:o.isInFullEditMode()&&(!o.isWaiting()&&!o.allowKeyEventPropagation||!o.isWaiting()&&o.allowKeyEventPropagation&&!o.allowKeyEventPropagation(e.keyCode))&&D(e);break;case O.ENTER:var r=o.instance.getSelected(),i=!(r[0]===r[2]&&r[1]===r[3]);if(t&&!i||e.altKey){if(o.isOpened()){var s=h(o.TEXTAREA),a=o.getValue(),l=a.slice(0,s)+"\n"+a.slice(s);o.setValue(l),b(o.TEXTAREA,s+1)}else o.beginEditing(o.originalValue+"\n");D(e)}e.preventDefault();break;case O.A:case O.X:case O.C:case O.V:t&&D(e);break;case O.BACKSPACE:case O.DELETE:case O.HOME:case O.END:D(e)}-1===[O.ARROW_UP,O.ARROW_RIGHT,O.ARROW_DOWN,O.ARROW_LEFT].indexOf(e.keyCode)&&o.autoResize.resize(String.fromCharCode(e.keyCode))}};A.prototype.open=function(){this.refreshDimensions(),this.instance.addHook("beforeKeyDown",P)},A.prototype.close=function(e){this.textareaParentStyle.display="none",this.autoResize.unObserve(),document.activeElement===this.TEXTAREA&&this.instance.listen(),this.instance.removeHook("beforeKeyDown",P)},A.prototype.focus=function(){this.TEXTAREA.focus(),b(this.TEXTAREA,this.TEXTAREA.value.length)},A.prototype.createElements=function(){this.TEXTAREA=document.createElement("TEXTAREA"),d(this.TEXTAREA,"handsontableInput"),this.textareaStyle=this.TEXTAREA.style,this.textareaStyle.width=0,this.textareaStyle.height=0,this.TEXTAREA_PARENT=document.createElement("DIV"),d(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 e=this;this.instance._registerTimeout(setTimeout(function(){e.refreshDimensions()},0))},A.prototype.getEditedCell=function(){var e,t=this.checkEditorSection();switch(t){case"top":e=this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.textareaParentStyle.zIndex=101;break;case"top-left-corner":e=this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.textareaParentStyle.zIndex=103;break;case"bottom-left-corner":e=this.instance.view.wt.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.textareaParentStyle.zIndex=103;break;case"left":e=this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.textareaParentStyle.zIndex=102;break;case"bottom":e=this.instance.view.wt.wtOverlays.bottomOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.textareaParentStyle.zIndex=102;break;default:e=this.instance.getCell(this.row,this.col),this.textareaParentStyle.zIndex=""}return-1!=e&&-2!=e?e:void 0},A.prototype.refreshDimensions=function(){if(this.state===Handsontable.EditorState.EDITING){if(this.TD=this.getEditedCell(),!this.TD)return void this.close(!0);var e,t=w(this.TD),n=w(this.instance.rootElement),o=g(this.TD),r=this.instance.countRows(),i=t.top-n.top-1-(o.scrollTop||0),s=t.left-n.left-1-(o.scrollLeft||0),a=this.instance.getSettings(),l=(this.instance.hasRowHeaders(),this.instance.hasColHeaders()),u=this.checkEditorSection(),c=this.TD.style.backgroundColor;switch(u){case"top":e=p(this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.holder.parentNode);break;case"left":e=p(this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.holder.parentNode);break;case"top-left-corner":e=p(this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.holder.parentNode);break;case"bottom-left-corner":e=p(this.instance.view.wt.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.holder.parentNode);break;case"bottom":e=p(this.instance.view.wt.wtOverlays.bottomOverlay.clone.wtTable.holder.parentNode)}(l&&0===this.instance.getSelected()[0]||a.fixedRowsBottom&&this.instance.getSelected()[0]===r-a.fixedRowsBottom)&&(i+=1),0===this.instance.getSelected()[1]&&(s+=1),e&&-1!=e?this.textareaParentStyle[e[0]]=e[1]:y(this.textareaParentStyle),this.textareaParentStyle.top=i+"px",this.textareaParentStyle.left=s+"px";var d=this.instance.view.wt.wtViewport.rowsRenderCalculator.startPosition,h=this.instance.view.wt.wtViewport.columnsRenderCalculator.startPosition,b=this.instance.view.wt.wtOverlays.leftOverlay.getScrollPosition(),_=this.instance.view.wt.wtOverlays.topOverlay.getScrollPosition(),S=m(),E=this.TD.offsetTop+d-_,T=this.TD.offsetLeft+h-b,M=v(this.TD)-8,O=C(o)?S:0,k=R(o)?S:0,H=this.instance.view.maximumVisibleElementWidth(T)-9-O,D=this.TD.scrollHeight+1,x=Math.max(this.instance.view.maximumVisibleElementHeight(E)-k,23),A=f(this.TD);this.TEXTAREA.style.fontSize=A.fontSize,this.TEXTAREA.style.fontFamily=A.fontFamily,this.TEXTAREA.style.backgroundColor="",this.TEXTAREA.style.backgroundColor=c?c:f(this.TEXTAREA).backgroundColor,this.autoResize.init(this.TEXTAREA,{minHeight:Math.min(D,x),maxHeight:x,minWidth:Math.min(M,H),maxWidth:H},!0),this.textareaParentStyle.display="block"}},A.prototype.bindEvents=function(){var e=this;this.eventManager.addEventListener(this.TEXTAREA,"cut",function(e){H(e)}),this.eventManager.addEventListener(this.TEXTAREA,"paste",function(e){H(e)}),this.instance.addHook("afterScrollHorizontally",function(){e.refreshDimensions()}),this.instance.addHook("afterScrollVertically",function(){e.refreshDimensions()}),this.instance.addHook("afterColumnResize",function(){e.refreshDimensions(),e.focus()}),this.instance.addHook("afterRowResize",function(){e.refreshDimensions(),e.focus()}),this.instance.addHook("afterDestroy",function(){e.eventManager.destroy()})},A.prototype.destroy=function(){this.eventManager.destroy()},M("text",A)},{_baseEditor:30,autoResize:"autoResize",editors:29,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/unicode":53}],41:[function(e,t,n){"use strict";function o(e,t){var n,o,r,i,s,a,l="HOT-TABLE";if(t.isTargetWebComponent=!1,t.realTarget=t.target,a=t.stopImmediatePropagation,t.stopImmediatePropagation=function(){a.apply(this),h(this)},!Handsontable.eventManager.isHotTableEnv)return t;for(t=u(t),s=t.path?t.path.length:0;s--;){if(t.path[s].nodeName===l)n=!0;else if(n&&t.path[s].shadowRoot){i=t.path[s];break}0!==s||i||(i=t.path[s])}return i||(i=t.target),t.isTargetWebComponent=!0,d()?t.realTarget=t.srcElement||t.toElement:(e instanceof Handsontable.Core||e instanceof Walkontable)&&(e instanceof Handsontable.Core?o=e.view?e.view.wt.wtTable.TABLE:null:e instanceof Walkontable&&(o=e.wtTable.TABLE.parentNode.parentNode),r=c(t.target,[l],o),r?t.realTarget=o.querySelector(l)||t.target:t.realTarget=t.target),Object.defineProperty(t,"target",{get:function(){return u(i)},enumerable:!0,configurable:!0}),t}function r(e){return new f(e)}Object.defineProperties(n,{EventManager:{get:function(){return f}},eventManager:{get:function(){return r}},__esModule:{value:!0}});var i,s,a,l=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),u=l.polymerWrap,c=l.closest,d=(s=e("helpers/browser"),s&&s.__esModule&&s||{"default":s}).isWebComponentSupportedNatively,h=(a=e("helpers/dom/event"),a&&a.__esModule&&a||{"default":a}).stopImmediatePropagation,f=function(){var e=void 0!==arguments[0]?arguments[0]:null;this.context=e||this,this.context.eventListeners||(this.context.eventListeners=[])};$traceurRuntime.createClass(f,{addEventListener:function(e,t,n){function r(e){void 0==e.target&&void 0!=e.srcElement&&(e.definePoperty?e.definePoperty("target",{value:e.srcElement}):e.target=e.srcElement),void 0==e.preventDefault&&(e.definePoperty?e.definePoperty("preventDefault",{value:function(){this.returnValue=!1}}):e.preventDefault=function(){this.returnValue=!1}),e=o(s,e),n.call(this,e)}var i=this,s=this.context;return this.context.eventListeners.push({element:e,event:t,callback:n,callbackProxy:r}),window.addEventListener?e.addEventListener(t,r,!1):e.attachEvent("on"+t,r),Handsontable.countEventManagerListeners++,function(){i.removeEventListener(e,t,n)}},removeEventListener:function(e,t,n){for(var o,r=this.context.eventListeners.length;r--;)if(o=this.context.eventListeners[r],o.event==t&&o.element==e){if(n&&n!=o.callback)continue;this.context.eventListeners.splice(r,1),o.element.removeEventListener?o.element.removeEventListener(o.event,o.callbackProxy,!1):o.element.detachEvent("on"+o.event,o.callbackProxy),Handsontable.countEventManagerListeners--}},clearEvents:function(){if(this.context)for(var e=this.context.eventListeners.length;e--;){var t=this.context.eventListeners[e];t&&this.removeEventListener(t.element,t.event,t.callback)}},clear:function(){this.clearEvents()},destroy:function(){this.clearEvents(),this.context=null},fireEvent:function(e,t){var n,o={bubbles:!0,cancelable:"mousemove"!==t,view:window,detail:0,screenX:0,screenY:0,clientX:1,clientY:1,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:void 0};document.createEvent?(n=document.createEvent("MouseEvents"),n.initMouseEvent(t,o.bubbles,o.cancelable,o.view,o.detail,o.screenX,o.screenY,o.clientX,o.clientY,o.ctrlKey,o.altKey,o.shiftKey,o.metaKey,o.button,o.relatedTarget||document.body.parentNode)):n=document.createEventObject(),e.dispatchEvent?e.dispatchEvent(n):e.fireEvent("on"+t,n)}},{}),window.Handsontable=window.Handsontable||{},Handsontable.countEventManagerListeners=0,Handsontable.eventManager=r},{"helpers/browser":43,"helpers/dom/element":45,"helpers/dom/event":46}],42:[function(e,t,n){"use strict";function o(e){for(var t=0,n=e.length;n>t;)e[t]=[e[t]],t++}function r(e,t){for(var n=0,o=t.length;o>n;)e.push(t[n]),n++}function i(e){var t=[];if(!e||0===e.length||!e[0]||0===e[0].length)return t;for(var n=e.length,o=e[0].length,r=0;n>r;r++)for(var i=0;o>i;i++)t[i]||(t[i]=[]),t[i][r]=e[r][i];return t}function s(e,t,n,o){var r=-1,i=e.length;for(o&&i&&(n=e[++r]);++rt?e:t},Array.isArray(e)?e[0]:void 0)}function h(e){return s(e,function(e,t){return t>e?e:t},Array.isArray(e)?e[0]:void 0)}function f(e){return e.length?c(e)/e.length:0}function p(e){return s(e,function(e,t){return e.concat(Array.isArray(t)?p(t):t)},[])}function g(e){var t=[];return u(e,function(e){-1===t.indexOf(e)&&t.push(e)}),t}Object.defineProperties(n,{to2dArray:{get:function(){return o}},extendArray:{get:function(){return r}},pivot:{get:function(){return i}},arrayReduce:{get:function(){return s}},arrayFilter:{get:function(){return a; -}},arrayMap:{get:function(){return l}},arrayEach:{get:function(){return u}},arraySum:{get:function(){return c}},arrayMax:{get:function(){return d}},arrayMin:{get:function(){return h}},arrayAvg:{get:function(){return f}},arrayFlatten:{get:function(){return p}},arrayUnique:{get:function(){return g}},__esModule:{value:!0}})},{}],43:[function(e,t,n){"use strict";function o(){return f}function r(){return p}function i(){return g}function s(){return m}function a(e){return e||(e=navigator.userAgent),/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(e)}function l(){return"ontouchstart"in window}function u(){var e=document.createElement("div");return e.createShadowRoot&&e.createShadowRoot.toString().match(/\[native code\]/)?!0:!1}function c(){var e=document.createElement("TABLE");e.style.borderSpacing=0,e.style.borderWidth=0,e.style.padding=0;var t=document.createElement("TBODY");e.appendChild(t),t.appendChild(document.createElement("TR")),t.firstChild.appendChild(document.createElement("TD")),t.firstChild.firstChild.innerHTML="t
t";var n=document.createElement("CAPTION");n.innerHTML="c
c
c
c",n.style.padding=0,n.style.margin=0,e.insertBefore(n,t),document.body.appendChild(e),h=e.offsetHeight<2*e.lastChild.offsetHeight,document.body.removeChild(e)}function d(){return void 0===h&&c(),h}Object.defineProperties(n,{isIE8:{get:function(){return o}},isIE9:{get:function(){return r}},isSafari:{get:function(){return i}},isChrome:{get:function(){return s}},isMobileBrowser:{get:function(){return a}},isTouchSupported:{get:function(){return l}},isWebComponentSupportedNatively:{get:function(){return u}},hasCaptionProblem:{get:function(){return d}},__esModule:{value:!0}});var h,f=!document.createTextNode("test").textContent,p=!!document.documentMode,g=/Safari/.test(navigator.userAgent)&&/Apple Computer/.test(navigator.vendor),m=/Chrome/.test(navigator.userAgent)&&/Google/.test(navigator.vendor)},{}],44:[function(e,t,n){"use strict";function o(e){for(var t,n=e+1,o="";n>0;)t=(n-1)%26,o=String.fromCharCode(65+t)+o,n=parseInt((n-t)/26,10);return o}function r(e,t){e="number"==typeof e?e:100,t="number"==typeof t?t:4;var n,r,i=[];for(n=0;e>n;n++){var s=[];for(r=0;t>r;r++)s.push(o(r)+(n+1));i.push(s)}return i}function i(e,t){e="number"==typeof e?e:100,t="number"==typeof t?t:4;var n,r,i=[];for(n=0;e>n;n++){var s={};for(r=0;t>r;r++)s["prop"+r]=o(r)+(n+1);i.push(s)}return i}function s(e,t){for(var n,o=[],r=0;e>r;r++){n=[];for(var i=0;t>i;i++)n.push("");o.push(n)}return o}function a(e){var t,n,o,r,i=[],s=0;for(t=0,n=e.length;n>t;t++)for(o=0,r=e[t].length;r>o;o++)o==s&&(i.push([]),s++),i[o].push(e[t][o]);return i}function l(e,t){function n(e){var t=Handsontable.cellTypes[e];if("undefined"==typeof t)throw new Error('You declared cell type "'+e+'" 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 t}return t="undefined"==typeof t?!0:t,function(o,r){return function i(o){if(o){if(o.hasOwnProperty(e)&&void 0!==o[e])return o[e];if(o.hasOwnProperty("type")&&o.type){var r;if("string"!=typeof o.type)throw new Error("Cell type must be a string ");if(r=n(o.type),r.hasOwnProperty(e))return r[e];if(t)return}return i(c(o))}}("number"==typeof o?this.getCellMeta(o,r):o)}}Object.defineProperties(n,{spreadsheetColumnLabel:{get:function(){return o}},createSpreadsheetData:{get:function(){return r}},createSpreadsheetObjectData:{get:function(){return i}},createEmptySpreadsheetData:{get:function(){return s}},translateRowsToColumns:{get:function(){return a}},cellMethodLookupFactory:{get:function(){return l}},__esModule:{value:!0}});var u,c=(u=e("object"),u&&u.__esModule&&u||{"default":u}).getPrototypeOf},{object:50}],45:[function(e,t,n){"use strict";function o(e,t,n){for(;null!=e&&e!==n;){if(e.nodeType===Node.ELEMENT_NODE&&(t.indexOf(e.nodeName)>-1||t.indexOf(e)>-1))return e;e=e.host&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE?e.host:e.parentNode}return null}function r(e,t){var n=e.parentNode,o=[];for("string"==typeof t?o=Array.prototype.slice.call(document.querySelectorAll(t),0):o.push(t);null!=n;){if(o.indexOf(n)>-1)return!0;n=n.parentNode}return!1}function i(e){function t(e){return e.nodeType===Node.ELEMENT_NODE&&e.nodeName===o.toUpperCase()}var n,o="hot-table",r=!1;for(n=s(e);null!=n;){if(t(n)){r=!0;break}if(n.host&&n.nodeType===Node.DOCUMENT_FRAGMENT_NODE){if(r=t(n.host))break;n=n.host}n=n.parentNode}return r}function s(e){return"undefined"!=typeof Polymer&&"function"==typeof wrap?wrap(e):e}function a(e){return"undefined"!=typeof Polymer&&"function"==typeof unwrap?unwrap(e):e}function l(e){var t=0;if(e.previousSibling)for(;e=e.previousSibling;)++t;return t}function u(e,t){var n=document.querySelector(".ht_clone_"+e);return n?n.contains(t):null}function c(e){var t=0,n=[];if(!e||!e.length)return n;for(;e[t];)n.push(e[t]),t++;return n}function d(e,t){return q(e,t)}function h(e,t){return Z(e,t)}function f(e,t){return J(e,t)}function p(e,t){if(3===e.nodeType)t.removeChild(e);else if(["TABLE","THEAD","TBODY","TFOOT","TR"].indexOf(e.nodeName)>-1)for(var n=e.childNodes,o=n.length-1;o>=0;o--)p(n[o],e)}function g(e){for(var t;t=e.lastChild;)e.removeChild(t)}function m(e,t){le.test(t)?e.innerHTML=t:v(e,t)}function v(e,t){var n=e.firstChild;n&&3===n.nodeType&&null===n.nextSibling?ue?n.textContent=t:n.data=t:(g(e),e.appendChild(document.createTextNode(t)))}function w(e){for(var t=e;a(t)!==document.documentElement;){if(null===t)return!1;if(t.nodeType===Node.DOCUMENT_FRAGMENT_NODE){if(t.host){if(t.host.impl)return w(t.host.impl);if(t.host)return w(t.host);throw new Error("Lost in Web Components world")}return!1}if("none"===t.style.display)return!1;t=t.parentNode}return!0}function y(e){var t,n,o,r,i;if(r=document.documentElement,oe()&&e.firstChild&&"CAPTION"===e.firstChild.nodeName)return i=e.getBoundingClientRect(),{top:i.top+(window.pageYOffset||r.scrollTop)-(r.clientTop||0),left:i.left+(window.pageXOffset||r.scrollLeft)-(r.clientLeft||0)};for(t=e.offsetLeft,n=e.offsetTop,o=e;(e=e.offsetParent)&&e!==document.body;)t+=e.offsetLeft,n+=e.offsetTop,o=e;return o&&"fixed"===o.style.position&&(t+=window.pageXOffset||r.scrollLeft,n+=window.pageYOffset||r.scrollTop),{left:t,top:n}}function b(){var e=window.scrollY;return void 0===e&&(e=document.documentElement.scrollTop),e}function C(){var e=window.scrollX;return void 0===e&&(e=document.documentElement.scrollLeft),e}function R(e){return e===window?b():e.scrollTop}function _(e){return e===window?C():e.scrollLeft}function S(e){for(var t,n,o,r=e.parentNode,i=["auto","scroll"],s="",a="",l="",u="";r&&r.style&&document.body!==r;){if(t=r.style.overflow,n=r.style.overflowX,o=r.style.overflowY,"scroll"==t||"scroll"==n||"scroll"==o)return r;if(window.getComputedStyle&&(s=window.getComputedStyle(r),a=s.getPropertyValue("overflow"),l=s.getPropertyValue("overflow-y"),u=s.getPropertyValue("overflow-x"),"scroll"===a||"scroll"===u||"scroll"===l))return r;if(r.clientHeight<=r.scrollHeight&&(-1!==i.indexOf(o)||-1!==i.indexOf(t)||-1!==i.indexOf(a)||-1!==i.indexOf(l)))return r;if(r.clientWidth<=r.scrollWidth&&(-1!==i.indexOf(n)||-1!==i.indexOf(t)||-1!==i.indexOf(a)||-1!==i.indexOf(u)))return r;r=r.parentNode}return window}function E(e){for(var t=e.parentNode;t&&t.style&&document.body!==t;){if("visible"!==t.style.overflow&&""!==t.style.overflow)return t;if(window.getComputedStyle){var n=window.getComputedStyle(t);if("visible"!==n.getPropertyValue("overflow")&&""!==n.getPropertyValue("overflow"))return t}t=t.parentNode}return window}function T(e,t){if(e){if(e!==window){var n,o=e.style[t];return""!==o&&void 0!==o?o:(n=M(e),""!==n[t]&&void 0!==n[t]?n[t]:void 0)}if("width"===t)return window.innerWidth+"px";if("height"===t)return window.innerHeight+"px"}}function M(e){return e.currentStyle||document.defaultView.getComputedStyle(e)}function O(e){return e.offsetWidth}function k(e){return oe()&&e.firstChild&&"CAPTION"===e.firstChild.nodeName?e.offsetHeight+e.firstChild.offsetHeight:e.offsetHeight}function H(e){return e.clientHeight||e.innerHeight}function D(e){return e.clientWidth||e.innerWidth}function x(e,t,n){window.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)}function A(e,t,n){window.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent("on"+t,n)}function P(e){if(e.selectionStart)return e.selectionStart;if(document.selection){e.focus();var t=document.selection.createRange();if(null==t)return 0;var n=e.createTextRange(),o=n.duplicate();return n.moveToBookmark(t.getBookmark()),o.setEndPoint("EndToStart",n),o.text.length}return 0}function N(e){if(e.selectionEnd)return e.selectionEnd;if(document.selection){var t=document.selection.createRange();if(null==t)return 0;var n=e.createTextRange();return n.text.indexOf(t.text)+t.text.length}}function L(){var e="";return window.getSelection?e=window.getSelection().toString():document.selection&&"Control"!==document.selection.type&&(e=document.selection.createRange().text),e}function W(e,t,n){if(void 0===n&&(n=t),e.setSelectionRange){e.focus();try{e.setSelectionRange(t,n)}catch(o){var r=e.parentNode,i=r.style.display;r.style.display="block",e.setSelectionRange(t,n),r.style.display=i}}else if(e.createTextRange){var s=e.createTextRange();s.collapse(!0),s.moveEnd("character",n),s.moveStart("character",t),s.select()}}function I(){var e=document.createElement("p");e.style.width="100%",e.style.height="200px";var t=document.createElement("div");t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.visibility="hidden",t.style.width="200px",t.style.height="150px",t.style.overflow="hidden",t.appendChild(e),(document.body||document.documentElement).appendChild(t);var n=e.offsetWidth;t.style.overflow="scroll";var o=e.offsetWidth;return n==o&&(o=t.clientWidth),(document.body||document.documentElement).removeChild(t),n-o}function j(){return void 0===ae&&(ae=I()),ae}function V(e){return e.offsetWidth!==e.clientWidth}function B(e){return e.offsetHeight!==e.clientHeight}function F(e,t,n){ee()||te()?(e.style.top=n,e.style.left=t):ne()?e.style["-webkit-transform"]="translate3d("+t+","+n+",0)":e.style.transform="translate3d("+t+","+n+",0)"}function z(e){var t;return e.style.transform&&""!==(t=e.style.transform)?["transform",t]:e.style["-webkit-transform"]&&""!==(t=e.style["-webkit-transform"])?["-webkit-transform",t]:-1}function Y(e){e.transform&&""!==e.transform?e.transform="":e["-webkit-transform"]&&""!==e["-webkit-transform"]&&(e["-webkit-transform"]="")}function U(e){var t=["INPUT","SELECT","TEXTAREA"];return e&&(t.indexOf(e.nodeName)>-1||"true"===e.contentEditable)}function G(e){return U(e)&&-1==e.className.indexOf("handsontableInput")&&-1==e.className.indexOf("copyPaste")}function $(e){return he.call(window,e)}function K(e){fe.call(window,e)}Object.defineProperties(n,{closest:{get:function(){return o}},isChildOf:{get:function(){return r}},isChildOfWebComponentTable:{get:function(){return i}},polymerWrap:{get:function(){return s}},polymerUnwrap:{get:function(){return a}},index:{get:function(){return l}},overlayContainsElement:{get:function(){return u}},hasClass:{get:function(){return d}},addClass:{get:function(){return h}},removeClass:{get:function(){return f}},removeTextNodes:{get:function(){return p}},empty:{get:function(){return g}},HTML_CHARACTERS:{get:function(){return le}},fastInnerHTML:{get:function(){return m}},fastInnerText:{get:function(){return v}},isVisible:{get:function(){return w}},offset:{get:function(){return y}},getWindowScrollTop:{get:function(){return b}},getWindowScrollLeft:{get:function(){return C}},getScrollTop:{get:function(){return R}},getScrollLeft:{get:function(){return _}},getScrollableElement:{get:function(){return S}},getTrimmingContainer:{get:function(){return E}},getStyle:{get:function(){return T}},getComputedStyle:{get:function(){return M}},outerWidth:{get:function(){return O}},outerHeight:{get:function(){return k}},innerHeight:{get:function(){return H}},innerWidth:{get:function(){return D}},addEvent:{get:function(){return x}},removeEvent:{get:function(){return A}},getCaretPosition:{get:function(){return P}},getSelectionEndPosition:{get:function(){return N}},getSelectionText:{get:function(){return L}},setCaretPosition:{get:function(){return W}},getScrollbarWidth:{get:function(){return j}},hasVerticalScrollbar:{get:function(){return V}},hasHorizontalScrollbar:{get:function(){return B}},setOverlayPosition:{get:function(){return F}},getCssTransform:{get:function(){return z}},resetCssTransform:{get:function(){return Y}},isInput:{get:function(){return U}},isOutsideInput:{get:function(){return G}},requestAnimationFrame:{get:function(){return $}},cancelAnimationFrame:{get:function(){return K}},__esModule:{value:!0}});var X,q,Z,J,Q=(X=e("../browser"),X&&X.__esModule&&X||{"default":X}),ee=Q.isIE8,te=Q.isIE9,ne=Q.isSafari,oe=Q.hasCaptionProblem,re=document.documentElement.classList?!0:!1;if(re){var ie=function(){var e=document.createElement("div");return e.classList.add("test","test2"),e.classList.contains("test2")}();q=function(e,t){return""===t?!1:e.classList.contains(t)},Z=function(e,t){var n=0;if("string"==typeof t&&(t=t.split(" ")),t=c(t),ie)e.classList.add.apply(e.classList,t);else for(;t&&t[n];)e.classList.add(t[n]),n++},J=function(e,t){var n=0;if("string"==typeof t&&(t=t.split(" ")),t=c(t),ie)e.classList.remove.apply(e.classList,t);else for(;t&&t[n];)e.classList.remove(t[n]),n++}}else{var se=function(e){return new RegExp("(\\s|^)"+e+"(\\s|$)")};q=function(e,t){return e.className.match(se(t))?!0:!1},Z=function(e,t){var n=0,o=e.className;if("string"==typeof t&&(t=t.split(" ")),""===o)o=t.join(" ");else for(;t&&t[n];)se(t[n]).test(o)||(o+=" "+t[n]),n++;e.className=o},J=function(e,t){var n=0,o=e.className;for("string"==typeof t&&(t=t.split(" "));t&&t[n];)o=o.replace(se(t[n])," ").trim(),n++;e.className!==o&&(e.className=o)}}for(var ae,le=/(<(.*)>|&(.*);)/,ue=document.createTextNode("test").textContent?!0:!1,ce=0,de=["ms","moz","webkit","o"],he=window.requestAnimationFrame,fe=window.cancelAnimationFrame,pe=0;pe=n?e.apply(this,a):t(a)}}var n=e.length;return t([])}function c(e){function t(o){return function(){for(var r=[],i=0;i=n?e.apply(this,a):t(a)}}var n=e.length;return t([])}Object.defineProperties(n,{proxy:{get:function(){return o}},throttle:{get:function(){return r}},throttleAfterHits:{get:function(){return i}},debounce:{get:function(){return s}},pipe:{get:function(){return a}},partial:{get:function(){return l}},curry:{get:function(){return u}},curryRight:{get:function(){return c}},__esModule:{value:!0}});var d,h=(d=e("array"),d&&d.__esModule&&d||{"default":d}).arrayReduce},{array:42}],48:[function(e,t,n){"use strict";function o(e){switch(typeof e){case"string":case"number":return e+"";case"object":return null===e?"":e.toString();case"undefined":return"";default:return e.toString()}}Object.defineProperties(n,{stringify:{get:function(){return o}},__esModule:{value:!0}})},{}],49:[function(e,t,n){"use strict";function o(e){var t=typeof e;return"number"==t?!isNaN(e)&&isFinite(e):"string"==t?e.length?1==e.length?/\d/.test(e):/^\s*[+-]?\s*(?:(?:\d+(?:\.\d+)?(?:e[+-]?\d+)?)|(?:0x[a-f\d]+))\s*$/i.test(e):!1:"object"==t?!(!e||"number"!=typeof e.valueOf()||e instanceof Date):!1}function r(e,t,n){var o=-1;for("function"==typeof t?(n=t,t=e):o=e-1;++o<=t&&n(o)!==!1;);}function i(e,t,n){var o=e+1;for("function"==typeof t&&(n=t,t=0);--o>=t&&n(o)!==!1;);}function s(e,t){return t=parseInt(t.toString().replace("%",""),10),t=parseInt(e*t/100)}Object.defineProperties(n,{isNumeric:{get:function(){return o}},rangeEach:{get:function(){return r}},rangeEachReverse:{get:function(){return i}},valueAccordingPercent:{get:function(){return s}},__esModule:{value:!0}})},{}],50:[function(e,t,n){"use strict";function o(e){var t;return Array.isArray(e)?t=[]:(t={},p(e,function(e,n){e&&"object"==typeof e&&!Array.isArray(e)?t[n]=o(e):Array.isArray(e)?e.length&&"object"==typeof e[0]&&!Array.isArray(e[0])?t[n]=[o(e[0])]:t[n]=[]:t[n]=null})),t}function r(e,t){return t.prototype.constructor=t,e.prototype=new t,e.prototype.constructor=e,e}function i(e,t){return p(t,function(t,n){e[n]=t}),e}function s(e,t){p(t,function(n,o){t[o]&&"object"==typeof t[o]?(e[o]||(Array.isArray(t[o])?e[o]=[]:"[object Date]"===Object.prototype.toString.call(t[o])?e[o]=t[o]:e[o]={}),s(e[o],t[o])):e[o]=t[o]})}function a(e){return"object"==typeof e?JSON.parse(JSON.stringify(e)):e}function l(e){var t={};return p(e,function(e,n){t[n]=e}),t}function u(e){for(var t=[],n=1;no;o++)n.prototype[t[o]]=void 0;return n}Object.defineProperties(n,{columnFactory:{get:function(){return o}},__esModule:{value:!0}});var r,i=(r=e("object"),r&&r.__esModule&&r||{"default":r}).inherit},{object:50}],52:[function(e,t,n){"use strict";function o(e){return e[0].toUpperCase()+e.substr(1)}function r(e,t){var n=!0;return p(t.length-1,function(o){return e.charAt(o)!==t.charAt(o)?(n=!1,!1):void 0}),n}function i(e,t){var n=!0,o=t.length-1,r=e.length-1;return p(o,function(i){var s=r-i,a=o-i;return e.charAt(s)!==t.charAt(a)?(n=!1,!1):void 0}),n}function s(){for(var e=[],t=0;t=t)return e;n=String(n);var o=n.length;o||(n=" ");var r=t-e.length,i=Math.ceil(r/n.length),s="";return p(i,function(e){s+=n}),s=s.slice(0,r),s+e}Object.defineProperties(n,{toUpperCaseFirst:{get:function(){return o}},startsWith:{get:function(){return r}},endsWith:{get:function(){return i}},equalsIgnoreCase:{get:function(){return s}},randomString:{get:function(){return a}},isPercentValue:{get:function(){return l}},substitute:{get:function(){return u}},padStart:{get:function(){return c}},__esModule:{value:!0}});var d,h,f=(d=e("mixed"),d&&d.__esModule&&d||{"default":d}).stringify,p=(h=e("number"),h&&h.__esModule&&h||{"default":h}).rangeEach},{mixed:48,number:49}],53:[function(e,t,n){"use strict";function o(e){return 32==e||e>=48&&57>=e||e>=96&&111>=e||e>=186&&192>=e||e>=219&&222>=e||e>=226||e>=65&&90>=e}function r(e){var t=[u.ARROW_DOWN,u.ARROW_UP,u.ARROW_LEFT,u.ARROW_RIGHT,u.HOME,u.END,u.DELETE,u.BACKSPACE,u.F1,u.F2,u.F3,u.F4,u.F5,u.F6,u.F7,u.F8,u.F9,u.F10,u.F11,u.F12,u.TAB,u.PAGE_DOWN,u.PAGE_UP,u.ENTER,u.ESCAPE,u.SHIFT,u.CAPS_LOCK,u.ALT];return-1!==t.indexOf(e)}function i(e){return-1!==[u.CONTROL_LEFT,224,u.COMMAND_LEFT,u.COMMAND_RIGHT].indexOf(e)}function s(e,t){var n=t.split("|"),o=!1;return l(n,function(t){return e===u[t]?(o=!0,!1):void 0}),o}Object.defineProperties(n,{KEY_CODES:{get:function(){return u}},isPrintableChar:{get:function(){return o}},isMetaKey:{get:function(){return r}},isCtrlKey:{get:function(){return i}},isKey:{get:function(){return s}},__esModule:{value:!0}});var a,l=(a=e("array"),a&&a.__esModule&&a||{"default":a}).arrayEach,u={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}},{array:42}],54:[function(e,t,n){"use strict";Object.defineProperties(n,{localHooks:{get:function(){return l}},__esModule:{value:!0}});var o,r,i=(o=e("helpers/array"),o&&o.__esModule&&o||{"default":o}).arrayEach,s=(r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}).defineGetter,a="localHooks",l={_localHooks:Object.create(null),addLocalHook:function(e,t){this._localHooks[e]||(this._localHooks[e]=[]),this._localHooks[e].push(t)},runLocalHooks:function(e){for(var t=[],n=1;n=0?(t.skip=!0,!0):!1},has:function(e){var t=void 0!==arguments[1]?arguments[1]:null,n=this.getBucket(t);return void 0!==n[e]&&n[e].length?!0:!1},run:function(e,t,n,o,r,i,s,a){var l=this.globalBucket[t],u=-1,c=l?l.length:0;if(c)for(;++u=0},getRegistered:function(){return i}},{}),Handsontable.utils=Handsontable.utils||{},Handsontable.utils.Hooks=l},{"helpers/array":42,"helpers/object":50}],57:[function(e,t,n){"use strict";function o(e,t){e=c(e),Handsontable.plugins[e]=t,Handsontable.hooks.add("construct",function(){var n;d.has(this)||d.set(this,{}),n=d.get(this),n[e]||(n[e]=new t(this))}),Handsontable.hooks.add("afterDestroy",function(){if(d.has(this)){var e=d.get(this);u(e,function(e){return e.destroy()}),d["delete"](this)}})}function r(e,t){if("string"!=typeof t)throw Error('Only strings can be passed as "plugin" parameter');var n=c(t);if(d.has(e)&&d.get(e)[n])return d.get(e)[n]}function i(e){return d.has(e)?Object.keys(d.get(e)):[]}function s(e,t){var n=null;return d.has(e)&&u(d.get(e),function(e,o){e===t&&(n=o)}),n}Object.defineProperties(n,{registerPlugin:{get:function(){return o}},getPlugin:{get:function(){return r}},getRegistredPluginNames:{get:function(){return i}},getPluginName:{get:function(){return s}},__esModule:{value:!0}});var a,l,u=(a=e("helpers/object"),a&&a.__esModule&&a||{"default":a}).objectEach,c=(l=e("helpers/string"),l&&l.__esModule&&l||{"default":l}).toUpperCaseFirst,d=new WeakMap},{"helpers/object":50,"helpers/string":52}],58:[function(e,t,n){"use strict";Object.defineProperties(n,{"default":{get:function(){return m}},__esModule:{value:!0}});var o,r,i,s=(o=e("helpers/object"),o&&o.__esModule&&o||{"default":o}),a=s.defineGetter,l=s.objectEach,u=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}).arrayEach,c=(i=e("plugins"),i&&i.__esModule&&i||{"default":i}),d=c.getRegistredPluginNames,h=c.getPluginName,f=new WeakMap,p=null,g=function(e){var t=this;a(this,"hot",e,{writable:!1}),f.set(this,{hooks:{}}),p=null,this.pluginName=null,this.pluginsInitializedCallbacks=[],this.isPluginsReady=!1,this.enabled=!1,this.initialized=!1,this.hot.addHook("afterPluginsInitialized",function(){return t.onAfterPluginsInitialized()}),this.hot.addHook("afterUpdateSettings",function(){return t.onUpdateSettings()}),this.hot.addHook("beforeInit",function(){return t.init()})};$traceurRuntime.createClass(g,{init:function(){this.pluginName=h(this.hot,this),this.isEnabled&&this.isEnabled()&&this.enablePlugin(),p||(p=d(this.hot)),p.indexOf(this.pluginName)>=0&&p.splice(p.indexOf(this.pluginName),1),p.length||this.hot.runHooks("afterPluginsInitialized"),this.initialized=!0},enablePlugin:function(){this.enabled=!0},disablePlugin:function(){this.eventManager&&this.eventManager.clear(),this.clearHooks(),this.enabled=!1},addHook:function(e,t){var n=f.get(this).hooks[e]=f.get(this).hooks[e]||[];this.hot.addHook(e,t),n.push(t),f.get(this).hooks[e]=n},removeHooks:function(e){var t=this;u(f.get(this).hooks[e]||[],function(n){t.hot.removeHook(e,n); -})},clearHooks:function(){var e=this,t=f.get(this).hooks;l(t,function(t,n){return e.removeHooks(n)}),t.length=0},callOnPluginsReady:function(e){this.isPluginsReady?e():this.pluginsInitializedCallbacks.push(e)},onAfterPluginsInitialized:function(){u(this.pluginsInitializedCallbacks,function(e){return e()}),this.pluginsInitializedCallbacks.length=0,this.isPluginsReady=!0},onUpdateSettings:function(){this.isEnabled&&(this.enabled&&!this.isEnabled()&&this.disablePlugin(),!this.enabled&&this.isEnabled()&&this.enablePlugin(),this.enabled&&this.isEnabled()&&this.updatePlugin())},updatePlugin:function(){},destroy:function(){var e=this;this.eventManager&&this.eventManager.destroy(),this.clearHooks(),l(this,function(t,n){"hot"!==n&&(e[n]=null)}),delete this.hot}},{});var m=g;Handsontable.plugins.BasePlugin=g},{"helpers/array":42,"helpers/object":50,plugins:57}],59:[function(e,t,n){"use strict";Object.defineProperties(n,{AutoColumnSize:{get:function(){return D}},__esModule:{value:!0}});var o,r,i,s,a,l,u,c,d,h,f=(o=e("_base"),o&&o.__esModule&&o||{"default":o})["default"],p=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}),g=p.arrayEach,m=p.arrayFilter,v=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),w=v.cancelAnimationFrame,y=v.requestAnimationFrame,b=v.isVisible,C=(s=e("utils/ghostTable"),s&&s.__esModule&&s||{"default":s}).GhostTable,R=(a=e("helpers/object"),a&&a.__esModule&&a||{"default":a}),_=R.isObject,S=(R.objectEach,l=e("helpers/number"),l&&l.__esModule&&l||{"default":l}),E=S.valueAccordingPercent,T=S.rangeEach,M=(u=e("plugins"),u&&u.__esModule&&u||{"default":u}).registerPlugin,O=(c=e("utils/samplesGenerator"),c&&c.__esModule&&c||{"default":c}).SamplesGenerator,k=(d=e("helpers/string"),d&&d.__esModule&&d||{"default":d}).isPercentValue,H=(h=e("3rdparty/walkontable/src/calculator/viewportColumns"),h&&h.__esModule&&h||{"default":h}).WalkontableViewportColumnsCalculator,D=function(e){var t=this;$traceurRuntime.superConstructor(x).call(this,e),this.widths=[],this.ghostTable=new C(this.hot),this.samplesGenerator=new O(function(e,n){return t.hot.getDataAtCell(e,n)}),this.firstCalculation=!0,this.inProgress=!1,this.addHook("beforeColumnResize",function(e,n,o){return t.onBeforeColumnResize(e,n,o)})},x=D;$traceurRuntime.createClass(D,{isEnabled:function(){return this.hot.getSettings().autoColumnSize!==!1&&!this.hot.getSettings().colWidths},enablePlugin:function(){var e=this;if(!this.enabled){var t=this.hot.getSettings().autoColumnSize,n=t&&t.hasOwnProperty("samplingRatio")?this.hot.getSettings().autoColumnSize.samplingRatio:void 0;n&&!isNaN(n)&&(this.samplesGenerator.customSampleCount=parseInt(n,10)),this.addHook("afterLoadData",function(){return e.onAfterLoadData()}),this.addHook("beforeChange",function(t){return e.onBeforeChange(t)}),this.addHook("beforeRender",function(t){return e.onBeforeRender(t)}),this.addHook("modifyColWidth",function(t,n){return e.getColumnWidth(n,t)}),$traceurRuntime.superGet(this,x.prototype,"enablePlugin").call(this)}},disablePlugin:function(){$traceurRuntime.superGet(this,x.prototype,"disablePlugin").call(this)},calculateColumnsWidth:function(){var e=void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countCols()-1},t=void 0!==arguments[1]?arguments[1]:{from:0,to:this.hot.countRows()-1},n=void 0!==arguments[2]?arguments[2]:!1,o=this;"number"==typeof e&&(e={from:e,to:e}),"number"==typeof t&&(t={from:t,to:t}),T(e.from,e.to,function(e){if(n||void 0===o.widths[e]&&!o.hot._getColWidthFromSettings(e)){var r=o.samplesGenerator.generateColumnSamples(e,t);r.forEach(function(e,t){return o.ghostTable.addColumn(t,e)})}}),this.ghostTable.columns.length&&(this.ghostTable.getWidths(function(e,t){return o.widths[e]=t}),this.ghostTable.clean())},calculateAllColumnsWidth:function(){var e=void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countRows()-1},t=this,n=0,o=this.hot.countCols()-1,r=null;this.inProgress=!0;var i=function(){return t.hot?(t.calculateColumnsWidth({from:n,to:Math.min(n+x.CALCULATION_STEP,o)},e),n=n+x.CALCULATION_STEP+1,void(o>n?r=y(i):(w(r),t.inProgress=!1,t.hot.view.wt.wtOverlays.adjustElementsSize(!0),t.hot.view.wt.wtOverlays.leftOverlay.needFullRender&&t.hot.view.wt.wtOverlays.leftOverlay.clone.draw()))):(w(r),void(t.inProgress=!1))};this.firstCalculation&&this.getSyncCalculationLimit()&&(this.calculateColumnsWidth({from:0,to:this.getSyncCalculationLimit()},e),this.firstCalculation=!1,n=this.getSyncCalculationLimit()+1),o>n?i():this.inProgress=!1},recalculateAllColumnsWidth:function(){this.hot.view&&b(this.hot.view.wt.wtTable.TABLE)&&(this.clearCache(),this.calculateAllColumnsWidth())},getSyncCalculationLimit:function(){var e=x.SYNC_CALCULATION_LIMIT,t=this.hot.countCols()-1;return _(this.hot.getSettings().autoColumnSize)&&(e=this.hot.getSettings().autoColumnSize.syncLimit,k(e)?e=E(t,e):e>>=0),Math.min(e,t)},getColumnWidth:function(e){var t=arguments[1],n=void 0!==arguments[2]?arguments[2]:!0,o=t;return void 0===o&&(o=this.widths[e],n&&"number"==typeof o&&(o=Math.max(o,H.DEFAULT_WIDTH))),o},getFirstVisibleColumn:function(){var e=this.hot.view.wt;return e.wtViewport.columnsVisibleCalculator?e.wtTable.getFirstVisibleColumn():e.wtViewport.columnsRenderCalculator?e.wtTable.getFirstRenderedColumn():-1},getLastVisibleColumn:function(){var e=this.hot.view.wt;return e.wtViewport.columnsVisibleCalculator?e.wtTable.getLastVisibleColumn():e.wtViewport.columnsRenderCalculator?e.wtTable.getLastRenderedColumn():-1},clearCache:function(){this.widths.length=0},isNeedRecalculate:function(){return m(this.widths,function(e){return void 0===e}).length?!0:!1},onBeforeRender:function(){var e=this.hot.renderCall,t=this.hot.countRows();t&&(this.calculateColumnsWidth({from:this.getFirstVisibleColumn(),to:this.getLastVisibleColumn()},void 0,e),this.isNeedRecalculate()&&!this.inProgress&&this.calculateAllColumnsWidth())},onAfterLoadData:function(){var e=this;this.hot.view?this.recalculateAllColumnsWidth():setTimeout(function(){e.hot&&e.recalculateAllColumnsWidth()},0)},onBeforeChange:function(e){var t=this;g(e,function(e){return t.widths[t.hot.propToCol(e[1])]=void 0})},onBeforeColumnResize:function(e,t,n){return n&&(this.calculateColumnsWidth(e,void 0,!0),t=this.getColumnWidth(e,void 0,!1)),t},destroy:function(){this.ghostTable.clean(),$traceurRuntime.superGet(this,x.prototype,"destroy").call(this)}},{get CALCULATION_STEP(){return 50},get SYNC_CALCULATION_LIMIT(){return 50}},f),M("autoColumnSize",D)},{"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":100,"utils/samplesGenerator":101}],60:[function(e,t,n){"use strict";Object.defineProperties(n,{AutoRowSize:{get:function(){return O}},__esModule:{value:!0}});var o,r,i,s,a,l,u,c,d,h=(o=e("_base"),o&&o.__esModule&&o||{"default":o})["default"],f=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}),p=(f.arrayEach,f.arrayFilter),g=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),m=g.cancelAnimationFrame,v=g.requestAnimationFrame,w=g.isVisible,y=(s=e("utils/ghostTable"),s&&s.__esModule&&s||{"default":s}).GhostTable,b=(a=e("helpers/object"),a&&a.__esModule&&a||{"default":a}),C=b.isObject,R=(b.objectEach,l=e("helpers/number"),l&&l.__esModule&&l||{"default":l}),_=R.valueAccordingPercent,S=R.rangeEach,E=(u=e("plugins"),u&&u.__esModule&&u||{"default":u}).registerPlugin,T=(c=e("utils/samplesGenerator"),c&&c.__esModule&&c||{"default":c}).SamplesGenerator,M=(d=e("helpers/string"),d&&d.__esModule&&d||{"default":d}).isPercentValue,O=function(e){var t=this;$traceurRuntime.superConstructor(k).call(this,e),this.heights=[],this.ghostTable=new y(this.hot),this.samplesGenerator=new T(function(e,n){return t.hot.getDataAtCell(e,n)}),this.firstCalculation=!0,this.inProgress=!1,this.addHook("beforeRowResize",function(e,n,o){return t.onBeforeRowResize(e,n,o)})},k=O;$traceurRuntime.createClass(O,{isEnabled:function(){return this.hot.getSettings().autoRowSize===!0||C(this.hot.getSettings().autoRowSize)},enablePlugin:function(){var e=this;if(!this.enabled){var t=this.hot.getSettings().autoRowSize,n=t&&t.hasOwnProperty("samplingRatio")?this.hot.getSettings().autoRowSize.samplingRatio:void 0;n&&!isNaN(n)&&(this.samplesGenerator.customSampleCount=parseInt(n,10)),this.addHook("afterLoadData",function(){return e.onAfterLoadData()}),this.addHook("beforeChange",function(t){return e.onBeforeChange(t)}),this.addHook("beforeColumnMove",function(){return e.recalculateAllRowsHeight()}),this.addHook("beforeColumnResize",function(){return e.recalculateAllRowsHeight()}),this.addHook("beforeColumnSort",function(){return e.clearCache()}),this.addHook("beforeRender",function(t){return e.onBeforeRender(t)}),this.addHook("beforeRowMove",function(t,n){return e.onBeforeRowMove(t,n)}),this.addHook("modifyRowHeight",function(t,n){return e.getRowHeight(n,t)}),$traceurRuntime.superGet(this,k.prototype,"enablePlugin").call(this)}},disablePlugin:function(){$traceurRuntime.superGet(this,k.prototype,"disablePlugin").call(this)},calculateRowsHeight:function(){var e=void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countRows()-1},t=void 0!==arguments[1]?arguments[1]:{from:0,to:this.hot.countCols()-1},n=void 0!==arguments[2]?arguments[2]:!1,o=this;"number"==typeof e&&(e={from:e,to:e}),"number"==typeof t&&(t={from:t,to:t}),S(e.from,e.to,function(e){if(n||void 0===o.heights[e]){var r=o.samplesGenerator.generateRowSamples(e,t);r.forEach(function(e,t){return o.ghostTable.addRow(t,e)})}}),this.ghostTable.rows.length&&(this.ghostTable.getHeights(function(e,t){return o.heights[e]=t}),this.ghostTable.clean())},calculateAllRowsHeight:function(){var e=void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countCols()-1},t=this,n=0,o=this.hot.countRows()-1,r=null;this.inProgress=!0;var i=function(){return t.hot?(t.calculateRowsHeight({from:n,to:Math.min(n+k.CALCULATION_STEP,o)},e),n=n+k.CALCULATION_STEP+1,void(o>n?r=v(i):(m(r),t.inProgress=!1,t.hot.view.wt.wtOverlays.adjustElementsSize(!0),t.hot.view.wt.wtOverlays.leftOverlay.needFullRender&&t.hot.view.wt.wtOverlays.leftOverlay.clone.draw()))):(m(r),void(t.inProgress=!1))};this.firstCalculation&&this.getSyncCalculationLimit()&&(this.calculateRowsHeight({from:0,to:this.getSyncCalculationLimit()},e),this.firstCalculation=!1,n=this.getSyncCalculationLimit()+1),o>n?i():this.inProgress=!1},recalculateAllRowsHeight:function(){w(this.hot.view.wt.wtTable.TABLE)&&(this.clearCache(),this.calculateAllRowsHeight())},getSyncCalculationLimit:function(){var e=k.SYNC_CALCULATION_LIMIT,t=this.hot.countRows()-1;return C(this.hot.getSettings().autoRowSize)&&(e=this.hot.getSettings().autoRowSize.syncLimit,M(e)?e=_(t,e):e>>=0),Math.min(e,t)},getRowHeight:function(e){var t=arguments[1],n=t;return void 0!==this.heights[e]&&this.heights[e]>(t||0)&&(n=this.heights[e]),n},getFirstVisibleRow:function(){var e=this.hot.view.wt;return e.wtViewport.rowsVisibleCalculator?e.wtTable.getFirstVisibleRow():e.wtViewport.rowsRenderCalculator?e.wtTable.getFirstRenderedRow():-1},getLastVisibleRow:function(){var e=this.hot.view.wt;return e.wtViewport.rowsVisibleCalculator?e.wtTable.getLastVisibleRow():e.wtViewport.rowsRenderCalculator?e.wtTable.getLastRenderedRow():-1},clearCache:function(){this.heights.length=0},clearCacheByRange:function(e){var t=this;"number"==typeof e&&(e={from:e,to:e}),S(Math.min(e.from,e.to),Math.max(e.from,e.to),function(e){return t.heights[e]=void 0})},isNeedRecalculate:function(){return p(this.heights,function(e){return void 0===e}).length?!0:!1},onBeforeRender:function(){var e=this.hot.renderCall;this.calculateRowsHeight({from:this.getFirstVisibleRow(),to:this.getLastVisibleRow()},void 0,e);var t=this.hot.getSettings().fixedRowsBottom;if(t){var n=this.hot.countRows()-1;this.calculateRowsHeight({from:n-t,to:n})}this.isNeedRecalculate()&&!this.inProgress&&this.calculateAllRowsHeight()},onBeforeRowMove:function(e,t){this.clearCacheByRange({from:e,to:t}),this.calculateAllRowsHeight()},onBeforeRowResize:function(e,t,n){return n&&(this.calculateRowsHeight(e,void 0,!0),t=this.getRowHeight(e)),t},onAfterLoadData:function(){var e=this;this.hot.view?this.recalculateAllRowsHeight():setTimeout(function(){e.hot&&e.recalculateAllRowsHeight()},0)},onBeforeChange:function(e){var t=null;1===e.length?t=e[0][0]:e.length>1&&(t={from:e[0][0],to:e[e.length-1][0]}),null!==t&&this.clearCacheByRange(t)},destroy:function(){this.ghostTable.clean(),$traceurRuntime.superGet(this,k.prototype,"destroy").call(this)}},{get CALCULATION_STEP(){return 50},get SYNC_CALCULATION_LIMIT(){return 500}},h),E("autoRowSize",O)},{_base:58,"helpers/array":42,"helpers/dom/element":45,"helpers/number":49,"helpers/object":50,"helpers/string":52,plugins:57,"utils/ghostTable":100,"utils/samplesGenerator":101}],61:[function(e,t,n){"use strict";function o(e,t,n,o){var r,i,s,a,l,u=n.length,c=n?n[0].length:0,d=[],h=[];if(r=t.row-e.row,i=t.col-e.col,-1!==["down","up"].indexOf(o)){for(var f=0;i>=f;f++)s=parseInt(n[0][f],10),a=parseInt(n[u-1][f],10),l=("down"===o?a-s:s-a)/(u-1)||0,h.push(l);d.push(h)}if(-1!==["right","left"].indexOf(o))for(var p=0;r>=p;p++)s=parseInt(n[p][0],10),a=parseInt(n[p][c-1],10),l=("right"===o?a-s:s-a)/(c-1)||0,h=[],h.push(l),d.push(h);return d}function r(e){function t(t){return e.autofill?void(e.autofill.handle&&e.autofill.handle.isDragged&&(e.autofill.handle.isDragged>1&&e.autofill.apply(),e.autofill.handle.isDragged=0,a=!1)):!0}function n(e){var t,n;return s.instance.autofill?(t=d(s.instance.table).top-(window.pageYOffset||document.documentElement.scrollTop)+h(s.instance.table),n=d(s.instance.table).left-(window.pageXOffset||document.documentElement.scrollLeft)+f(s.instance.table),s.addingStarted===!1&&s.instance.autofill.handle.isDragged>0&&e.clientY>t&&e.clientX<=n?(s.instance.mouseDragOutside=!0,s.addingStarted=!0):s.instance.mouseDragOutside=!1,void(s.instance.mouseDragOutside&&m("autoInsertRow")&&setTimeout(function(){s.addingStarted=!1,s.instance.alter("insert_row")},200))):!1}var o,r,i,s=this,a=!1;this.instance=e,this.addingStarted=!1,i=p(e),i.addEventListener(document,"mouseup",t),i.addEventListener(document,"mousemove",n),o=this.instance.view.wt.wtSettings.settings.onCellCornerMouseDown,this.instance.view.wt.wtSettings.settings.onCellCornerMouseDown=function(t){e.autofill.handle.isDragged=1,a=!0,o(t)},r=this.instance.view.wt.wtSettings.settings.onCellMouseOver,this.instance.view.wt.wtSettings.settings.onCellMouseOver=function(t,n,o,i){e.autofill&&a&&!e.view.isMouseDown()&&e.autofill.handle&&e.autofill.handle.isDragged&&(e.autofill.handle.isDragged++,e.autofill.showBorder(n),e.autofill.checkIfNewRowNeeded()),r(t,n,o,i)},this.instance.view.wt.wtSettings.settings.onCellCornerDblClick=function(){e.autofill.selectAdjacent()}}function i(e){return function(t){var n;return"direction"===t?n="string"==typeof e?e:"object"==typeof e&&void 0!==e[t]?e[t]:!0:"autoInsertRow"===t?n="object"==typeof e&&void 0!==e[t]?e[t]:!0:"fillHandle"===t&&(n=e?!0:!1),n}}Object.defineProperties(n,{Autofill:{get:function(){return r}},__esModule:{value:!0}});var s,a,l,u,c=(s=e("helpers/dom/element"),s&&s.__esModule&&s||{"default":s}),d=c.offset,h=c.outerHeight,f=c.outerWidth,p=(a=e("eventManager"),a&&a.__esModule&&a||{"default":a}).eventManager,g=((l=e("plugins"),l&&l.__esModule&&l||{"default":l}).registerPlugin,(u=e("3rdparty/walkontable/src/cell/coords"),u&&u.__esModule&&u||{"default":u}).WalkontableCellCoords);r.prototype.init=function(){this.handle={}},r.prototype.disable=function(){this.handle.disabled=!0},r.prototype.selectAdjacent=function(){var e,t,n,o,r;e=this.instance.selection.isMultiple()?this.instance.view.wt.selections.area.getCorners():this.instance.view.wt.selections.current.getCorners(),t=this.instance.getData();e:for(n=e[2]+1;nt[3]?(s="right",n=new g(e[0],t[3]+1),r=new g(e[2],e[3])):e[0]t[2]&&e[1]===t[1]&&(s="down",n=new g(t[2]+1,e[1]),r=new g(e[2],e[3])),n&&n.row>-1&&n.col>-1?(l={from:this.instance.getSelectedRange().from,to:this.instance.getSelectedRange().to},i=this.instance.getData(l.from.row,l.from.col,l.to.row,l.to.col),a=o(n,r,i,s),Handsontable.hooks.run(this.instance,"beforeAutofill",n,r,i),this.instance.populateFromArray(n.row,n.col,i,r.row,r.col,"autofill",null,s,a),this.instance.selection.setRangeStart(new g(e[0],e[1])),this.instance.selection.setRangeEnd(new g(e[2],e[3]))):this.instance.selection.refreshBorders())},r.prototype.showBorder=function(e){var t=this.instance.getSelectedRange().getTopLeftCorner(),n=this.instance.getSelectedRange().getBottomRightCorner();if("horizontal"!==m("direction")&&(n.rowe.row))e=new g(e.row,n.col);else{if("vertical"===m("direction"))return;e=new g(n.row,e.col)}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(e),this.instance.view.render()},r.prototype.checkIfNewRowNeeded=function(){var e,t,n=this.instance.countRows(),o=this;this.instance.view.wt.selections.fill.cellRange&&this.addingStarted===!1&&m("autoInsertRow")&&(t=this.instance.getSelected(),e=this.instance.view.wt.selections.fill.getCorners(),t[2]n[1]?e?1:-1:0}},dateSort:function(e){return function(t,n){if(t[1]===n[1])return 0;if(null===t[1]||""===t[1])return 1;if(null===n[1]||""===n[1])return-1;var o=new Date(t[1]),r=new Date(n[1]);return r>o?e?-1:1:o>r?e?1:-1:0}},sort:function(){if("undefined"==typeof this.hot.sortOrder)return void(this.hot.sortIndex.length=0);var e,t;this.hot.sortingEnabled=!1,this.hot.sortIndex.length=0;for(var n=0,o=this.hot.countRows()-this.hot.getSettings().minSpareRows;o>n;n++)this.hot.sortIndex.push([n,this.hot.getDataAtCell(n,this.hot.sortColumn)]);switch(e=this.hot.getCellMeta(0,this.hot.sortColumn),e.type){case"date":t=this.dateSort;break;default:t=this.defaultSort}this.hot.sortIndex.sort(t(this.hot.sortOrder));for(var r=this.hot.sortIndex.length;r=0&&-1===r&&u(n,"columnSorting"),f(n,"descending"),f(n,"ascending"),this.sortIndicators[e]&&e===this.hot.sortColumn&&("ascending"===this.sortOrderClass?u(n,"ascending"):"descending"===this.sortOrderClass&&u(n,"descending")))},isSorted:function(){return"undefined"!=typeof this.hot.sortColumn},afterCreateRow:function(e,t){if(this.isSorted()){for(var n=0;n=e&&(this.hot.sortIndex[n][0]+=t);for(var n=0;t>n;n++)this.hot.sortIndex.splice(e+n,0,[e+n,this.hot.getSourceData()[e+n][this.hot.sortColumn+this.hot.colOffset()]]);this.saveSortingState()}},afterRemoveRow:function(e,t){function n(e){return m(o,function(t,n){return e>n&&t++,t},0)}if(this.isSorted()){var o=this.hot.sortIndex.splice(e,t);o=g(o,function(e){return e[0]}),this.hot.sortIndex=g(this.hot.sortIndex,function(e,t){var o=n(e[0]);return o&&(e[0]-=o),e}),this.saveSortingState()}}},{},w),y("columnSorting",b)},{_base:58,eventManager:41,"helpers/array":42,"helpers/dom/element":45,plugins:57}],63:[function(e,t,n){"use strict";Object.defineProperties(n,{CommentEditor:{get:function(){return i}},__esModule:{value:!0}});var o,r=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}).addClass,i=function(){this.editor=this.createEditor(),this.editorStyle=this.editor.style,this.editorStyle.position="absolute",this.editorStyle.zIndex=100,this.hide()},s=i;$traceurRuntime.createClass(i,{setPosition:function(e,t){this.editorStyle.left=e+"px",this.editorStyle.top=t+"px"},show:function(){this.editorStyle.display="block"},hide:function(){this.editorStyle.display="none"},isVisible:function(){return"block"===this.editorStyle.display},setValue:function(){var e=void 0!==arguments[0]?arguments[0]:"";e=e||"",this.getInputElement().value=e},getValue:function(){return this.getInputElement().value},isFocused:function(){return document.activeElement===this.getInputElement()},focus:function(){this.getInputElement().focus()},createEditor:function(){var e,t,n=document.querySelector("."+s.CLASS_EDITOR_CONTAINER);return n||(n=document.createElement("div"),r(n,s.CLASS_EDITOR_CONTAINER),document.body.appendChild(n)),e=document.createElement("div"),r(e,s.CLASS_EDITOR),t=document.createElement("textarea"),r(t,s.CLASS_INPUT),e.appendChild(t),n.appendChild(e),e},getInputElement:function(){return this.editor.querySelector("."+s.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(e,t,n){"use strict";Object.defineProperties(n,{Comments:{get:function(){return R}},__esModule:{value:!0}});var o,r,i,s,a,l,u=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),c=u.addClass,d=u.closest,h=u.getWindowScrollLeft,f=u.getWindowScrollTop,p=u.hasClass,g=u.offset,m=(r=e("eventManager"),r&&r.__esModule&&r||{"default":r}).EventManager,v=(i=e("3rdparty/walkontable/src/cell/coords"),i&&i.__esModule&&i||{"default":i}).WalkontableCellCoords,w=(s=e("plugins"),s&&s.__esModule&&s||{"default":s}),y=w.registerPlugin,b=(w.getPlugin,(a=e("_base"),a&&a.__esModule&&a||{"default":a})["default"]),C=(l=e("commentEditor"),l&&l.__esModule&&l||{"default":l}).CommentEditor,R=function(e){$traceurRuntime.superConstructor(_).call(this,e),this.editor=null,this.eventManager=null,this.range={},this.mouseDown=!1,this.contextMenuEvent=!1,this.timer=null},_=R;$traceurRuntime.createClass(R,{isEnabled:function(){return this.hot.getSettings().comments},enablePlugin:function(){var e=this;this.enabled||(this.editor||(this.editor=new C),this.eventManager||(this.eventManager=new m(this)),this.addHook("afterContextMenuDefaultOptions",function(t){return e.addToContextMenu(t)}),this.addHook("afterRenderer",function(t,n,o,r,i,s){return e.onAfterRenderer(t,s)}),this.addHook("afterScrollHorizontally",function(){return e.refreshEditorPosition()}),this.addHook("afterScrollVertically",function(){return e.refreshEditorPosition()}),this.addHook("afterColumnResize",function(){return e.refreshEditorPosition()}),this.addHook("afterRowResize",function(){return e.refreshEditorPosition()}),this.registerListeners(),$traceurRuntime.superGet(this,_.prototype,"enablePlugin").call(this))},disablePlugin:function(){$traceurRuntime.superGet(this,_.prototype,"disablePlugin").call(this)},registerListeners:function(){var e=this;this.eventManager.addEventListener(document,"mouseover",function(t){return e.onMouseOver(t)}),this.eventManager.addEventListener(document,"mousedown",function(t){return e.onMouseDown(t)}),this.eventManager.addEventListener(document,"mousemove",function(t){return e.onMouseMove(t)}),this.eventManager.addEventListener(document,"mouseup",function(t){return e.onMouseUp(t)}),this.eventManager.addEventListener(this.editor.getInputElement(),"blur",function(t){return e.onEditorBlur(t)})},setRange:function(e){this.range=e},clearRange:function(){this.range={}},targetIsCellWithComment:function(e){return p(e.target,"htCommentCell")&&d(e.target,[this.hot.rootElement])?!0:!1},targetIsCommentTextArea:function(e){return this.editor.getInputElement()===e.target},saveComment:function(){if(!this.range.from)throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');var e=this.editor.getValue(),t=this.range.from.row,n=this.range.from.col;this.hot.setCellMeta(t,n,"comment",e),this.hot.render()},saveCommentAtCell:function(e,t){this.setRange({from:new v(e,t)}),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(e,t){this.setRange({from:new v(e,t)}),this.removeComment()},show:function(){if(!this.range.from)throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');var e=this.hot.getCellMeta(this.range.from.row,this.range.from.col);return this.refreshEditorPosition(!0),this.editor.setValue(e.comment||""),this.editor.show(),!0},showAtCell:function(e,t){return this.setRange({from:new v(e,t)}),this.show()},hide:function(){this.editor.hide()},refreshEditorPosition:function(){var e=void 0!==arguments[0]?arguments[0]:!1;if(e||this.range.from&&this.editor.isVisible()){var t=this.hot.view.wt.wtTable.getCell(this.range.from),n=g(t),o=this.hot.getColWidth(this.range.from.col),r=n.top,i=n.left,s=0,a=0;this.hot.view.wt.wtViewport.hasVerticalScroll()&&(r-=this.hot.view.wt.wtOverlays.topOverlay.getScrollPosition(),s=20),this.hot.view.wt.wtViewport.hasHorizontalScroll()&&(i-=this.hot.view.wt.wtOverlays.leftOverlay.getScrollPosition(),a=20);var l=i+o,u=r,c=this.hot.view.wt.wtTable.holder.getBoundingClientRect(),d={left:c.left+h()+a,right:c.right+h()-15, -top:c.top+f()+s,bottom:c.bottom+f()};l<=d.left||l>d.right||u<=d.top||u>d.bottom?this.hide():this.editor.setPosition(l,u)}},onMouseDown:function(e){this.mouseDown=!0,this.hot.view&&this.hot.view.wt&&(this.contextMenuEvent||this.targetIsCommentTextArea(e)||this.targetIsCellWithComment(e)||this.hide(),this.contextMenuEvent=!1)},onMouseOver:function(e){if(!this.mouseDown&&!this.editor.isFocused())if(this.targetIsCellWithComment(e)){var t=this.hot.view.wt.wtTable.getCoords(e.target),n={from:new v(t.row,t.col)};this.setRange(n),this.show()}else this.targetIsCommentTextArea(e)||this.editor.isFocused()||this.hide()},onMouseMove:function(e){var t=this;this.targetIsCommentTextArea(e)&&(this.mouseDown=!0,clearTimeout(this.timer),this.timer=setTimeout(function(){t.mouseDown=!1},200))},onMouseUp:function(e){this.mouseDown=!1},onAfterRenderer:function(e,t){t.comment&&c(e,t.commentedCellClassName)},onEditorBlur:function(e){this.saveComment()},checkSelectionCommentsConsistency:function(){var e=this.hot.getSelectedRange();if(!e)return!1;var t=!1,n=e.from;return this.hot.getCellMeta(n.row,n.col).comment&&(t=!0),t},onContextMenuAddComment:function(){var e=this,t=this.hot.getSelectedRange();this.contextMenuEvent=!0,this.setRange({from:t.from}),this.show(),setTimeout(function(){e.hot&&(e.hot.deselectCell(),e.editor.focus())},10)},onContextMenuRemoveComment:function(e,t){this.contextMenuEvent=!0,this.removeCommentAtCell(t.start.row,t.start.col)},addToContextMenu:function(e){var t=this;e.items.push(Handsontable.plugins.ContextMenu.SEPARATOR,{key:"commentsAddEdit",name:function(){return t.checkSelectionCommentsConsistency()?"Edit Comment":"Add Comment"},callback:function(){return t.onContextMenuAddComment()},disabled:function(){return this.getSelected()?!1:!0}},{key:"commentsRemove",name:function(){return"Delete Comment"},callback:function(e,n){return t.onContextMenuRemoveComment(e,n)},disabled:function(){return!t.checkSelectionCommentsConsistency()}})},destroy:function(){this.editor&&this.editor.destroy(),$traceurRuntime.superGet(this,_.prototype,"destroy").call(this)}},{},b),y("comments",R)},{"3rdparty/walkontable/src/cell/coords":5,_base:58,commentEditor:63,eventManager:41,"helpers/dom/element":45,plugins:57}],65:[function(e,t,n){"use strict";function o(e,t){var n;return i(t,function(t){var o=t.key?t.key.split(":"):null;return Array.isArray(o)&&o[1]===e?(n=t,!1):void 0}),n}Object.defineProperties(n,{CommandExecutor:{get:function(){return s}},__esModule:{value:!0}});var r,i=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}).arrayEach,s=function(e){this.hot=e,this.commands={},this.commonCallback=null};$traceurRuntime.createClass(s,{registerCommand:function(e,t){this.commands[e]=t},setCommonCallback:function(e){this.commonCallback=e},execute:function(e){for(var t=[],n=1;n0;if(s)return}}else if(!(t(i)||w(i,"current")&&w(i,"wtBorder")))return;this.open(e)},onMenuAfterOpen:function(){this.hot.runHooks("afterContextMenuShow",this)},onMenuAfterClose:function(){this.hot.listen(),this.hot.runHooks("afterContextMenuHide",this)},destroy:function(){this.close(),this.menu&&this.menu.destroy(),$traceurRuntime.superGet(this,z.prototype,"destroy").call(this)}},{get DEFAULT_ITEMS(){return[D,x,B,A,P,B,N,L,B,W,I,B,j,B,V]}},p),F.SEPARATOR={name:B},Handsontable.hooks.register("afterContextMenuDefaultOptions"),Handsontable.hooks.register("afterContextMenuShow"),Handsontable.hooks.register("afterContextMenuHide"),Handsontable.hooks.register("afterContextMenuExecute"),R("contextMenu",F)},{_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(e,t,n){"use strict";Object.defineProperties(n,{Cursor:{get:function(){return d}},__esModule:{value:!0}});var o,r,i=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),s=i.getWindowScrollLeft,a=i.getWindowScrollTop,l=(r=e("helpers/dom/event"),r&&r.__esModule&&r||{"default":r}),u=l.pageX,c=l.pageY,d=function(e){var t,n,o,r,i,l,d=a(),h=s();this.type=this.getSourceType(e),"literal"===this.type?(t=parseInt(e.top,10),o=parseInt(e.left,10),i=e.height||0,l=e.width||0,n=t,r=o,t+=d,o+=h):"event"===this.type&&(t=parseInt(c(e),10),o=parseInt(u(e),10),i=e.target.clientHeight,l=e.target.clientWidth,n=t-d,r=o-h),this.top=t,this.topRelative=n,this.left=o,this.leftRelative=r,this.scrollTop=d,this.scrollLeft=h,this.cellHeight=i,this.cellWidth=l};$traceurRuntime.createClass(d,{getSourceType:function(e){var t="literal";return e instanceof Event&&(t="event"),t},fitsAbove:function(e){return this.topRelative>=e.offsetHeight},fitsBelow:function(e){var t=void 0!==arguments[1]?arguments[1]:window.innerHeight;return this.topRelative+e.offsetHeight<=t},fitsOnRight:function(e){var t=void 0!==arguments[1]?arguments[1]:window.innerWidth;return this.leftRelative+this.cellWidth+e.offsetWidth<=t},fitsOnLeft:function(e){return this.leftRelative>=e.offsetWidth}},{}),Handsontable.plugins.utils=Handsontable.plugins.utils||{},Handsontable.plugins.utils.Cursor=d},{"helpers/dom/element":45,"helpers/dom/event":46}],68:[function(e,t,n){"use strict";function o(){var e=void 0!==arguments[0]?arguments[0]:null,t=void 0!==arguments[1]?arguments[1]:[],n=void 0!==arguments[2]?arguments[2]:{},o=[];return e&&e.items?e=e.items:Array.isArray(e)||(e=t),u(e)?l(e,function(e,t){var r=n["string"==typeof e?e:t];r||(r=e),u(e)?c(r,e):"string"==typeof r&&(r={name:r}),void 0===r.key&&(r.key=t),o.push(r)}):d(e,function(e,t){var r=n[e];!r&&p.indexOf(e)>=0||(r||(r={name:e,key:t+""}),u(e)&&c(r,e),void 0===r.key&&(r.key=t),o.push(r))}),o[0].name===f&&o.shift(),o}Object.defineProperties(n,{ItemsFactory:{get:function(){return m}},__esModule:{value:!0}});var r,i,s,a=(r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}),l=a.objectEach,u=a.isObject,c=a.extend,d=(i=e("helpers/array"),i&&i.__esModule&&i||{"default":i}).arrayEach,h=(s=e("predefinedItems"),s&&s.__esModule&&s||{"default":s}),f=h.SEPARATOR,p=h.ITEMS,g=h.predefinedItems,m=function(e){var t=void 0!==arguments[1]?arguments[1]:null;this.hot=e,this.predefinedItems=g(),this.defaultOrderPattern=t};$traceurRuntime.createClass(m,{setPredefinedItems:function(e){var t=this,n={};this.defaultOrderPattern.length=0,l(e,function(e,o){var r="";e.name===f?(n[f]=e,r=f):isNaN(parseInt(o,10))?(e.key=void 0===e.key?o:e.key,n[o]=e,r=e.key):(n[e.key]=e,r=e.key),t.defaultOrderPattern.push(r)}),this.predefinedItems=n},getVisibleItems:function(){var e=void 0!==arguments[0]?arguments[0]:null,t=this,n={};return l(this.predefinedItems,function(e,o){(!e.hidden||e.hidden&&!e.hidden.apply(t.hot))&&(n[o]=e)}),o(e,this.defaultOrderPattern,n)},getItems:function(){var e=void 0!==arguments[0]?arguments[0]:null;return o(e,this.defaultOrderPattern,this.predefinedItems)}},{})},{"helpers/array":42,"helpers/object":50,predefinedItems:70}],69:[function(e,t,n){"use strict";Object.defineProperties(n,{Menu:{get:function(){return B}},__esModule:{value:!0}});var o,r,i,s,a,l,u,c,d,h,f,p=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),g=p.addClass,m=p.empty,v=p.fastInnerHTML,w=(p.getComputedStyle,p.getScrollbarWidth),y=(p.getWindowScrollLeft,p.getWindowScrollTop,p.hasClass,p.isChildOf),b=p.removeClass,C=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}),R=C.arrayEach,_=C.arrayReduce,S=(i=e("cursor"),i&&i.__esModule&&i||{"default":i}).Cursor,E=(s=e("eventManager"),s&&s.__esModule&&s||{"default":s}).EventManager,T=(a=e("helpers/object"),a&&a.__esModule&&a||{"default":a}),M=(T.extend,T.isObject,T.objectEach,T.mixin),O=(l=e("helpers/function"),l&&l.__esModule&&l||{"default":l}).debounce,k=(u=e("utils"),u&&u.__esModule&&u||{"default":u}),H=k.isSeparator,D=k.isDisabled,x=k.isSelectionDisabled,A=k.hasSubMenu,P=k.normalizeSelection,N=(c=e("helpers/unicode"),c&&c.__esModule&&c||{"default":c}).KEY_CODES,L=(d=e("mixins/localHooks"),d&&d.__esModule&&d||{"default":d}).localHooks,W=(h=e("predefinedItems"),h&&h.__esModule&&h||{"default":h}),I=W.SEPARATOR,j=(W.predefinedItems,f=e("helpers/dom/event"),f&&f.__esModule&&f||{"default":f}),V=(j.stopPropagation,j.stopImmediatePropagation),B=(j.pageX,j.pageY,function(e,t){this.hot=e,this.options=t||{parent:null,name:null,className:"",keepInViewport:!0,standalone:!1},this.eventManager=new E(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()}),F=B;$traceurRuntime.createClass(B,{registerEvents:function(){var e=this;this.eventManager.addEventListener(document.documentElement,"mousedown",function(t){return e.onDocumentMouseDown(t)})},setMenuItems:function(e){this.menuItems=e},setOffset:function(e){var t=void 0!==arguments[1]?arguments[1]:0;this.offset[e]=t},isSubMenu:function(){return null!==this.parentMenu},open:function(){var e=this;this.container.removeAttribute("style"),this.container.style.display="block";var t=O(function(t){return e.openSubMenu(t)},300),n={data:this.menuItems,colHeaders:!1,colWidths:[200],autoRowSize:!1,readOnly:!0,copyPaste:!1,columns:[{data:"name",renderer:function(t,n,o,r,i,s){return e.menuItemRenderer(t,n,o,r,i,s)}}],renderAllRows:!0,fragmentSelection:"cell",beforeKeyDown:function(t){return e.onBeforeKeyDown(t)},afterOnCellMouseOver:function(n,o,r){e.isAllSubMenusClosed()?t(o.row):e.openSubMenu(o.row)}};this.origOutsideClickDeselects=this.hot.getSettings().outsideClickDeselects,this.hot.getSettings().outsideClickDeselects=!1,this.hotMenu=new Handsontable.Core(this.container,n),this.hotMenu.addHook("afterInit",function(){return e.onAfterInit()}),this.hotMenu.init(),this.hotMenu.listen(),this.blockMainTableCallbacks(),this.runLocalHooks("afterOpen")},close:function(){var e=void 0!==arguments[0]?arguments[0]:!1;this.isOpened()&&(e&&this.parentMenu?this.parentMenu.close():(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(e){if(this.hotMenu){var t=this.hotMenu.getCell(e,0);if(this.closeAllSubMenus(),!t||!A(t))return!1;var n=this.hotMenu.getSourceDataAtRow(e),o=new F(this.hot,{parent:this,name:n.name,className:this.options.className,keepInViewport:!0});return o.setMenuItems(n.submenu.items),o.open(),o.setPosition(t.getBoundingClientRect()),this.hotSubMenus[n.key]=o,o}},closeSubMenu:function(e){var t=this.hotMenu.getSourceDataAtRow(e),n=this.hotSubMenus[t.key];n&&(n.destroy(),delete this.hotSubMenus[t.key])},closeAllSubMenus:function(){var e=this;R(this.hotMenu.getData(),function(t,n){return e.closeSubMenu(n)})},isAllSubMenusClosed:function(){return 0===Object.keys(this.hotSubMenus).length},destroy:function(){this.clearLocalHooks(),this.close(),this.parentMenu=null,this.eventManager.destroy()},isOpened:function(){return null!==this.hotMenu},executeCommand:function(e){if(this.isOpened()&&this.hotMenu.getSelected()){var t=this.hotMenu.getSourceDataAtRow(this.hotMenu.getSelected()[0]);if(this.runLocalHooks("select",t,e),t.isCommand!==!1&&t.name!==I){var n=this.hot.getSelectedRange(),o=n?P(n):{};this.runLocalHooks("executeCommand",t.key,o,e),this.isSubMenu()&&this.parentMenu.runLocalHooks("executeCommand",t.key,o,e),t.disabled===!0||"function"==typeof t.disabled&&t.disabled.call(this.hot)===!0||t.submenu||this.close(!0)}}},setPosition:function(e){var t=new S(e);this.options.keepInViewport?(t.fitsBelow(this.container)?this.setPositionBelowCursor(t):t.fitsAbove(this.container)?this.setPositionAboveCursor(t):this.setPositionBelowCursor(t),t.fitsOnRight(this.container)?this.setPositionOnRightOfCursor(t):this.setPositionOnLeftOfCursor(t)):(this.setPositionBelowCursor(t),this.setPositionOnRightOfCursor(t))},setPositionAboveCursor:function(e){var t=this.offset.above+e.top-this.container.offsetHeight;this.isSubMenu()&&(t=e.top+e.cellHeight-this.container.offsetHeight+3),this.container.style.top=t+"px"},setPositionBelowCursor:function(e){var t=this.offset.below+e.top;this.isSubMenu()&&(t=e.top-1),this.container.style.top=t+"px"},setPositionOnRightOfCursor:function(e){var t;t=this.isSubMenu()?1+e.left+e.cellWidth:this.offset.right+1+e.left,this.container.style.left=t+"px"},setPositionOnLeftOfCursor:function(e){var t=this.offset.left+e.left-this.container.offsetWidth+w()+4;this.container.style.left=t+"px"},selectFirstCell:function(){var e=this.hotMenu.getCell(0,0);H(e)||D(e)||x(e)?this.selectNextCell(0,0):this.hotMenu.selectCell(0,0)},selectLastCell:function(){var e=this.hotMenu.countRows()-1,t=this.hotMenu.getCell(e,0);H(t)||D(t)||x(t)?this.selectPrevCell(e,0):this.hotMenu.selectCell(e,0)},selectNextCell:function(e,t){var n=e+1,o=n=0?this.hotMenu.getCell(n,t):null;o&&(H(o)||D(o)||x(o)?this.selectPrevCell(n,t):this.hotMenu.selectCell(n,t))},menuItemRenderer:function(e,t,n,o,r,i){var s=this,a=e.getSourceDataAtRow(n),l=document.createElement("div"),u=function(e){return e.hasOwnProperty("submenu")},c=function(e){return new RegExp(I,"i").test(e.name)},d=function(e){return e.disabled===!0||"function"==typeof e.disabled&&e.disabled.call(s.hot)===!0},h=function(e){return"function"==typeof e.hidden&&e.hidden.call(s.hot)===!0},f=function(e){return e.disableSelection},p=h(a);"function"==typeof i&&(i=i.call(this.hot)),m(t),g(l,"htItemWrapper"),t.appendChild(l),c(a)?g(t,"htSeparator"):p||"function"!=typeof a.renderer?v(l,i):(g(t,"htCustomMenuRenderer"),t.appendChild(a.renderer(e,l,n,o,r,i))),p?t.parentNode&&g(t.parentNode,"htHidden"):d(a)?(g(t,"htDisabled"),this.eventManager.addEventListener(t,"mouseenter",function(){return e.deselectCell()})):f(a)?(g(t,"htSelectionDisabled"),this.eventManager.addEventListener(t,"mouseenter",function(){return e.deselectCell()})):u(a)?(g(t,"htSubmenu"),f(a)?this.eventManager.addEventListener(t,"mouseenter",function(){return e.deselectCell()}):this.eventManager.addEventListener(t,"mouseenter",function(){return e.selectCell(n,o,void 0,void 0,void 0,!1)})):(b(t,"htSubmenu"),b(t,"htDisabled"),f(a)?this.eventManager.addEventListener(t,"mouseenter",function(){return e.deselectCell()}):this.eventManager.addEventListener(t,"mouseenter",function(){return e.selectCell(n,o,void 0,void 0,void 0,!1)}))},createContainer:function(){var e=void 0!==arguments[0]?arguments[0]:null;e&&(e=e.replace(/ /g,"_"),e=this.options.className+"Sub_"+e);var t;return t=e?document.querySelector("."+this.options.className+"."+e):document.querySelector("."+this.options.className),t||(t=document.createElement("div"),g(t,"htMenu "+this.options.className),e&&g(t,e),document.getElementsByTagName("body")[0].appendChild(t)),t},blockMainTableCallbacks:function(){this._afterScrollCallback=function(){},this.hot.addHook("afterScrollVertically",this._afterScrollCallback),this.hot.addHook("afterScrollHorizontally",this._afterScrollCallback)},releaseMainTableCallbacks:function(){this._afterScrollCallback&&(this.hot.removeHook("afterScrollVertically",this._afterScrollCallback),this.hot.removeHook("afterScrollHorizontally",this._afterScrollCallback),this._afterScrollCallback=null)},onBeforeKeyDown:function(e){var t=this.hotMenu.getSelected(),n=!1;switch(e.keyCode){case N.ESCAPE:this.close(),n=!0;break;case N.ENTER:t&&(this.hotMenu.getSourceDataAtRow(t[0]).submenu?n=!0:(this.executeCommand(e),this.close(!0)));break;case N.ARROW_DOWN:t?this.selectNextCell(t[0],t[1]):this.selectFirstCell(),n=!0;break;case N.ARROW_UP:t?this.selectPrevCell(t[0],t[1]):this.selectLastCell(),n=!0;break;case N.ARROW_RIGHT:if(t){var o=this.openSubMenu(t[0]);o&&o.selectFirstCell()}n=!0;break;case N.ARROW_LEFT:t&&this.isSubMenu()&&(this.close(),this.parentMenu&&this.parentMenu.hotMenu.listen(),n=!0)}n&&(e.preventDefault(),V(e))},onAfterInit:function(){var e=this.hotMenu.getSettings().data,t=this.hotMenu.view.wt.wtTable.hider.style,n=this.hotMenu.view.wt.wtTable.holder.style,o=parseInt(t.width,10),r=_(e,function(e,t){return e+(t.name===I?1:26)},0);n.width=o+22+"px",n.height=r+4+"px"},onDocumentMouseDown:function(e){this.isOpened()&&(this.container&&y(e.target,this.container)&&this.executeCommand(e),this.options.standalone&&this.hotMenu&&!y(e.target,this.hotMenu.rootElement)?this.close(!0):(this.isAllSubMenusClosed()||this.isSubMenu())&&!y(e.target,".htMenu")&&y(e.target,document)&&this.close(!0))}},{}),M(B,L)},{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(e,t,n){"use strict";function o(){var e={};return c(D,function(t,n){return e[n]=d(t)}),e}function r(e,t){-1===H.indexOf(e)&&(D[e]=t)}var i;Object.defineProperties(n,{ROW_ABOVE:{get:function(){return w}},ROW_BELOW:{get:function(){return y}},COLUMN_LEFT:{get:function(){return b}},COLUMN_RIGHT:{get:function(){return C}},CLEAR_COLUMN:{get:function(){return R}},REMOVE_ROW:{get:function(){return _}},REMOVE_COLUMN:{get:function(){return S}},UNDO:{get:function(){return E}},REDO:{get:function(){return T}},READ_ONLY:{get:function(){return M}},ALIGNMENT:{get:function(){return O}},SEPARATOR:{get:function(){return k}},ITEMS:{get:function(){return H}},predefinedItems:{get:function(){return o}},addItem:{get:function(){return r}},__esModule:{value:!0}});var s,a,l,u=(s=e("helpers/object"),s&&s.__esModule&&s||{"default":s}),c=u.objectEach,d=u.clone,h=((a=e("helpers/number"),a&&a.__esModule&&a||{"default":a}).rangeEach,l=e("utils"),l&&l.__esModule&&l||{"default":l}),f=h.align,p=h.getAlignmentClasses,g=h.getValidSelection,m=h.checkSelectionConsistency,v=h.markLabelAsSelected,w="row_above",y="row_below",b="col_left",C="col_right",R="clear_column",_="remove_row",S="remove_col",E="undo",T="redo",M="make_read_only",O="alignment",k="---------",H=[w,y,b,C,R,_,S,E,T,M,O,k],D=(i={},Object.defineProperty(i,k,{value:{name:k},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,w,{value:{key:w,name:"Insert row above",callback:function(e,t){this.alter("insert_row",t.start.row)},disabled:function(){var e=g(this);if(!e||this.countRows()>=this.getSettings().maxRows)return!0;var t=this.countRows(),n=[0,e[1],t-1,e[1]];return n.join(",")===e.join(",")&&t>1},hidden:function(){return!this.getSettings().allowInsertRow}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,y,{value:{key:y,name:"Insert row below",callback:function(e,t){this.alter("insert_row",t.end.row+1)},disabled:function(){var e=g(this);if(!e||this.countRows()>=this.getSettings().maxRows)return!0;var t=this.countRows(),n=[0,e[1],t-1,e[1]];return n.join(",")===e.join(",")&&t>1},hidden:function(){return!this.getSettings().allowInsertRow}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,b,{value:{key:b,name:"Insert column on the left",callback:function(e,t){this.alter("insert_col",t.start.col)},disabled:function(){var e=g(this);if(!e)return!0;if(!this.isColumnModificationAllowed())return!0;var t=[e[0],0,e[0],this.countCols()-1],n=t.join(",")==e.join(",");return e[1]<0||this.countCols()>=this.getSettings().maxCols||n},hidden:function(){return!this.getSettings().allowInsertColumn}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,C,{value:{key:C,name:"Insert column on the right",callback:function(e,t){this.alter("insert_col",t.end.col+1)},disabled:function(){var e=g(this);if(!e)return!0;if(!this.isColumnModificationAllowed())return!0;var t=[e[0],0,e[0],this.countCols()-1],n=t.join(",")==e.join(",");return e[1]<0||this.countCols()>=this.getSettings().maxCols||n},hidden:function(){return!this.getSettings().allowInsertColumn}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,R,{value:{key:R,name:"Clear column",callback:function(e,t){var n=t.start.col;this.countRows()&&this.populateFromArray(0,n,[[null]],Math.max(t.start.row,t.end.row),n)},disabled:function(){var e=g(this);if(!e)return!0;var t=[e[0],0,e[0],this.countCols()-1],n=t.join(",")==e.join(",");return e[1]<0||this.countCols()>=this.getSettings().maxCols||n}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,_,{value:{key:_,name:"Remove row",callback:function(e,t){var n=t.end.row-t.start.row+1;this.alter("remove_row",t.start.row,n)},disabled:function(){var e=g(this);if(!e)return!0;var t=[0,e[1],this.countRows()-1,e[1]];return t.join(",")===e.join(",")},hidden:function(){return!this.getSettings().allowRemoveRow}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,S,{value:{key:S,name:"Remove column",callback:function(e,t){var n=t.end.col-t.start.col+1;this.alter("remove_col",t.start.col,n)},disabled:function(){var e=g(this);if(!e)return!0;if(!this.isColumnModificationAllowed())return!0;var t=[e[0],0,e[0],this.countCols()-1],n=t.join(",")==e.join(",");return e[1]<0||n},hidden:function(){return!this.getSettings().allowRemoveColumn}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,E,{value:{key:E,name:"Undo",callback:function(){this.undo()},disabled:function(){return this.undoRedo&&!this.undoRedo.isUndoAvailable()}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,T,{value:{key:T,name:"Redo",callback:function(){this.redo()},disabled:function(){return this.undoRedo&&!this.undoRedo.isRedoAvailable()}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,M,{value:{key:M,name:function(){var e=this,t="Read only",n=m(this.getSelectedRange(),function(t,n){return e.getCellMeta(t,n).readOnly});return n&&(t=v(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=m(t,function(t,n){return e.getCellMeta(t,n).readOnly});t.forAll(function(t,o){e.getCellMeta(t,o).readOnly=n?!1:!0}),this.render()},disabled:function(){return this.getSelectedRange()?!1:!0}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,O,{value:{key:O,name:"Alignment",disabled:function(){return this.getSelectedRange()?!1:!0},submenu:{items:[{key:O+":left",name:function(){var e=this,t="Left",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htLeft")?!0:void 0});return n&&(t=v(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=p(t,function(t,n){return e.getCellMeta(t,n).className}),o="horizontal",r="htLeft";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1},{key:O+":center",name:function(){var e=this,t="Center",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htCenter")?!0:void 0});return n&&(t=v(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=p(t,function(t,n){return e.getCellMeta(t,n).className}),o="horizontal",r="htCenter";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1},{key:O+":right",name:function(){var e=this,t="Right",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htRight")?!0:void 0});return n&&(t=v(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=p(t,function(t,n){return e.getCellMeta(t,n).className}),o="horizontal",r="htRight";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1},{key:O+":justify",name:function(){var e=this,t="Justify",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htJustify")?!0:void 0});return n&&(t=v(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=p(t,function(t,n){return e.getCellMeta(t,n).className}),o="horizontal",r="htJustify";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1},{name:k},{key:O+":top",name:function(){var e=this,t="Top",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htTop")?!0:void 0});return n&&(t=v(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=p(t,function(t,n){return e.getCellMeta(t,n).className}),o="vertical",r="htTop";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1},{key:O+":middle",name:function(){var e=this,t="Middle",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htMiddle")?!0:void 0});return n&&(t=v(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=p(t,function(t,n){return e.getCellMeta(t,n).className}),o="vertical",r="htMiddle";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1},{key:O+":bottom",name:function(){var e=this,t="Bottom",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htBottom")?!0:void 0});return n&&(t=v(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=p(t,function(t,n){return e.getCellMeta(t,n).className}),o="vertical",r="htBottom";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1}]}},configurable:!0,enumerable:!0,writable:!0}),i)},{"helpers/number":49,"helpers/object":50,utils:71}],71:[function(e,t,n){"use strict";function o(e){return{start:e.getTopLeftCorner(),end:e.getBottomRightCorner()}}function r(e){return v(e,"htSeparator")}function i(e){return v(e,"htSubmenu")}function s(e){return v(e,"htDisabled")}function a(e){return v(e,"htSelectionDisabled")}function l(e){var t=e.getSelected();return t?t[0]<0?null:t:null}function u(e,t){return-1!=e.indexOf(t)?e:(e=e.replace("htTop","").replace("htMiddle","").replace("htBottom","").replace(" ",""),e+=" "+t)}function c(e,t){return-1!=e.indexOf(t)?e:(e=e.replace("htLeft","").replace("htCenter","").replace("htRight","").replace("htJustify","").replace(" ",""),e+=" "+t)}function d(e,t){for(var n={},o=e.from.row;o<=e.to.row;o++)for(var r=e.from.col;r<=e.to.col;r++)n[o]||(n[o]=[]),n[o][r]=t(o,r);return n}function h(e,t,n,o){if(e.from.row==e.to.row&&e.from.col==e.to.col)f(e.from.row,e.from.col,t,n,o);else for(var r=e.from.row;r<=e.to.row;r++)for(var i=e.from.col;i<=e.to.col;i++)f(r,i,t,n,o)}function f(e,t,n,o,r){var i=r(e,t),s=o;i.className&&(s="vertical"===n?u(i.className,o):c(i.className,o)),i.className=s}function p(e,t){var n=!1;return e&&e.forAll(function(e,o){return t(e,o)?(n=!0,!1):void 0}),n}function g(e){return''+String.fromCharCode(10003)+""+e}Object.defineProperties(n,{normalizeSelection:{get:function(){return o}},isSeparator:{get:function(){return r}},hasSubMenu:{get:function(){return i}},isDisabled:{get:function(){return s}},isSelectionDisabled:{get:function(){return a}},getValidSelection:{get:function(){return l}},prepareVerticalAlignClass:{get:function(){return u}},prepareHorizontalAlignClass:{get:function(){return c}},getAlignmentClasses:{get:function(){return d}},align:{get:function(){return h}},checkSelectionConsistency:{get:function(){return p}},markLabelAsSelected:{get:function(){return g}},__esModule:{value:!0}});var m,v=(m=e("helpers/dom/element"),m&&m.__esModule&&m||{"default":m}).hasClass},{"helpers/dom/element":45}],72:[function(e,t,n){"use strict";Object.defineProperties(n,{ContextMenuCopyPaste:{get:function(){return g}},__esModule:{value:!0}});var o,r,i,s,a,l,u=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}).removeClass,c=(r=e("helpers/array"), -r&&r.__esModule&&r||{"default":r}).arrayEach,d=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).EventManager,h=(s=e("plugins"),s&&s.__esModule&&s||{"default":s}).registerPlugin,f=(a=e("_base"),a&&a.__esModule&&a||{"default":a})["default"],p=(l=e("zeroclipboard"),l&&l.__esModule&&l||{"default":l})["default"],g=function(e){$traceurRuntime.superConstructor(m).call(this,e),this.eventManager=new d(this),this.swfPath=null,this.outsideClickDeselectsCache=null},m=g;$traceurRuntime.createClass(g,{isEnabled:function(){return this.hot.getSettings().contextMenuCopyPaste},enablePlugin:function(){var e=this;if(!this.enabled){"object"==typeof this.hot.getSettings().contextMenuCopyPaste&&(this.swfPath=this.hot.getSettings().contextMenuCopyPaste.swfPath),"undefined"==typeof p&&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(t){"undefined"==typeof navigator.mimeTypes["application/x-shockwave-flash"]&&console.error("To be able to use the Copy/Paste feature from the context menu, your browser needs to have Flash Plugin installed.")}this.swfPath&&p.config({swfPath:this.swfPath}),this.hot.addHook("afterContextMenuShow",function(){return e.onAfterContextMenuShow()}),this.hot.addHook("afterContextMenuDefaultOptions",function(t){return e.onAfterContextMenuDefaultOptions(t)}),this.registerEvents(),$traceurRuntime.superGet(this,m.prototype,"enablePlugin").call(this)}},disablePlugin:function(){$traceurRuntime.superGet(this,m.prototype,"disablePlugin").call(this)},registerEvents:function(){var e=this;this.eventManager.addEventListener(document,"mouseenter",function(){return e.removeCurrentClass()}),this.eventManager.addEventListener(document,"mouseleave",function(){return e.removeZeroClipboardClass()})},getCopyValue:function(){return this.hot.copyPaste.setCopyableText(),this.hot.copyPaste.copyPasteInstance.elTextarea.value},onAfterContextMenuDefaultOptions:function(e){e.items.unshift({key:"copy",name:"Copy"},{key:"paste",name:"Paste",callback:function(){this.copyPaste.triggerPaste()}},Handsontable.plugins.ContextMenu.SEPARATOR)},onAfterContextMenuShow:function(){var e=this,t=this.hot.getPlugin("contextMenu"),n=t.menu.hotMenu.getSourceData();c(n,function(n,o){if("copy"===n.key){var r=new p(t.menu.hotMenu.getCell(o,0));return r.off(),r.on("copy",function(t){var n=t.clipboardData;n.setData("text/plain",e.getCopyValue()),e.hot.getSettings().outsideClickDeselects=e.outsideClickDeselectsCache}),!1}})},removeCurrentClass:function(){var e=this.hot.getPlugin("contextMenu");if(e.menu.isOpened()){var t=e.menu.hotMenu.rootElement.querySelector("td.current");t&&u(t,"current")}this.outsideClickDeselectsCache=this.hot.getSettings().outsideClickDeselects,this.hot.getSettings().outsideClickDeselects=!1},removeZeroClipboardClass:function(){var e=this.hot.getPlugin("contextMenu");if(e.menu.isOpened()){var t=e.menu.hotMenu.rootElement.querySelector("td.zeroclipboard-is-hover");t&&u(t,"zeroclipboard-is-hover")}this.hot.getSettings().outsideClickDeselects=this.outsideClickDeselectsCache}},{},f),h("contextMenuCopyPaste",g)},{_base:58,eventManager:41,"helpers/array":42,"helpers/dom/element":45,plugins:57,zeroclipboard:"zeroclipboard"}],73:[function(e,t,n){"use strict";function o(e){function t(){e.isListening()&&e.selection.empty()}function n(t){var n,o,r,i,s,a,l,u,c,d;if(e.isListening()&&e.selection.isSelected()){n=t,o=v.parse(n),r=e.getSelected(),i=new O(r[0],r[1]),s=new O(r[2],r[3]),a=new k(i,i,s),l=a.getTopLeftCorner(),u=a.getBottomRightCorner(),c=l,d=new O(Math.max(u.row,o.length-1+l.row),Math.max(u.col,o[0].length-1+l.col));var h=s.row-i.row>=o.length-1,f=s.col-i.col>=o[0].length-1;e.addHookOnce("afterChange",function(t,n){var o=t?t.length:0;if(o){var r={row:0,col:0},i=-1;C(t,function(e,n){var s=o>n+1?t[n+1]:null;s&&(h||(r.row=r.row+Math.max(s[0]-e[0]-1,0)),!f&&e[1]>i&&(i=e[1],r.col=r.col+Math.max(s[1]-e[1]-1,0)))}),e.selectCell(c.row,c.col,d.row+r.row,d.col+r.col)}}),e.populateFromArray(c.row,c.col,o,d.row,d.col,"paste",e.getSettings().pasteMode)}}function o(t){if(e.getSelected()&&!(e.getActiveEditor()&&e.getActiveEditor().isOpened()||E(t))){if(b(t.keyCode)){if(e.getSettings().fragmentSelection&&T())return;return r.setCopyableText(),void S(t)}var n=(t.ctrlKey||t.metaKey)&&!t.altKey;t.keyCode==y.A&&n&&e._registerTimeout(setTimeout(M(r.setCopyableText,r),0))}}var r=this;this.copyPasteInstance=m(),this.copyPasteInstance.onCut(t),this.copyPasteInstance.onPaste(n),this.onPaste=n,e.addHook("beforeKeyDown",o),this.destroy=function(){this.copyPasteInstance&&(this.copyPasteInstance.removeCallback(t),this.copyPasteInstance.removeCallback(n),this.copyPasteInstance.destroy(),this.copyPasteInstance=null),e.removeHook("beforeKeyDown",o)},e.addHook("afterDestroy",M(this.destroy,this)),this.triggerPaste=M(this.copyPasteInstance.triggerPaste,this.copyPasteInstance),this.triggerCut=M(this.copyPasteInstance.triggerCut,this.copyPasteInstance),this.setCopyableText=function(){var t=e.getSettings(),n=t.copyRowsLimit,o=t.copyColsLimit,r=e.getSelectedRange(),i=r.getTopLeftCorner(),s=r.getBottomRightCorner(),a=i.row,l=i.col,u=s.row,c=s.col,d=Math.min(u,a+n-1),h=Math.min(c,l+o-1),f=[];f.push({startRow:a,startCol:l,endRow:d,endCol:h}),f=Handsontable.hooks.run(e,"modifyCopyableRange",f);var p=this.getRangedCopyableData(f);e.copyPaste.copyPasteInstance.copyable(p),(u!==d||c!==h)&&Handsontable.hooks.run(e,"afterCopyLimit",u-a+1,c-l+1,n,o)},this.getRangedCopyableData=function(t){var n=[],o=[],r=[];return C(t,function(e){R(e.startRow,e.endRow,function(e){-1===o.indexOf(e)&&o.push(e)}),R(e.startCol,e.endCol,function(e){-1===r.indexOf(e)&&r.push(e)})}),C(o,function(t){var o=[];C(r,function(n){o.push(e.getCopyableData(t,n))}),n.push(o)}),v.stringify(n)}}function r(){var e=this,t=e.getSettings().copyPaste!==!1;t&&!e.copyPaste?e.copyPaste=new o(e):!t&&e.copyPaste&&(e.copyPaste.destroy(),e.copyPaste=null)}Object.defineProperties(n,{CopyPastePlugin:{get:function(){return o}},__esModule:{value:!0}});var i,s,a,l,u,c,d,h,f,p,g,m=(i=e("copyPaste"),i&&i.__esModule&&i||{"default":i})["default"],v=(s=e("SheetClip"),s&&s.__esModule&&s||{"default":s})["default"],w=(a=e("helpers/unicode"),a&&a.__esModule&&a||{"default":a}),y=w.KEY_CODES,b=w.isCtrlKey,C=(l=e("helpers/array"),l&&l.__esModule&&l||{"default":l}).arrayEach,R=(u=e("helpers/number"),u&&u.__esModule&&u||{"default":u}).rangeEach,_=(c=e("helpers/dom/event"),c&&c.__esModule&&c||{"default":c}),S=_.stopImmediatePropagation,E=_.isImmediatePropagationStopped,T=(d=e("helpers/dom/element"),d&&d.__esModule&&d||{"default":d}).getSelectionText,M=(h=e("helpers/function"),h&&h.__esModule&&h||{"default":h}).proxy,O=((f=e("plugins"),f&&f.__esModule&&f||{"default":f}).registerPlugin,(p=e("3rdparty/walkontable/src/cell/coords"),p&&p.__esModule&&p||{"default":p}).WalkontableCellCoords),k=(g=e("3rdparty/walkontable/src/cell/range"),g&&g.__esModule&&g||{"default":g}).WalkontableCellRange;Handsontable.hooks.add("afterInit",r),Handsontable.hooks.add("afterUpdateSettings",r),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(e,t,n){"use strict";function o(){}var r,i,s,a,l=((r=e("plugins"),r&&r.__esModule&&r||{"default":r}).registerPlugin,(i=e("3rdparty/walkontable/src/cell/range"),i&&i.__esModule&&i||{"default":i}).WalkontableCellRange),u=(s=e("3rdparty/walkontable/src/selection"),s&&s.__esModule&&s||{"default":s}).WalkontableSelection,c=function(e){return"boolean"==typeof e&&e===!0?!0:"object"==typeof e&&e.length>0?!0:!1},d=function(){c(this.getSettings().customBorders)&&(this.customBorders||(a=this,this.customBorders=new o))},h=function(e){for(var t=0;t=0?a.view.wt.selections[o]=n:a.view.wt.selections.push(n)},p=function(e,t,n){var o=b(e,t);o=C(o,n),this.setCellMeta(e,t,"borders",o),f(o)},g=function(e){for(var t=e.range,n=t.from.row;n<=t.to.row;n++)for(var o=t.from.col;o<=t.to.col;o++){var r=b(n,o),i=0;n==t.from.row&&(i++,e.hasOwnProperty("top")&&(r.top=e.top)),n==t.to.row&&(i++,e.hasOwnProperty("bottom")&&(r.bottom=e.bottom)),o==t.from.col&&(i++,e.hasOwnProperty("left")&&(r.left=e.left)),o==t.to.col&&(i++,e.hasOwnProperty("right")&&(r.right=e.right)),i>0&&(this.setCellMeta(n,o,"borders",r),f(r))}},m=function(e,t){return"border_row"+e+"col"+t},v=function(){return{width:1,color:"#000"}},w=function(){return{hide:!0}},y=function(){return{width:1,color:"#000",cornerVisible:!1}},b=function(e,t){return{className:m(e,t),border:y(),row:e,col:t,top:w(),right:w(),bottom:w(),left:w()}},C=function(e,t){return t.hasOwnProperty("border")&&(e.border=t.border),t.hasOwnProperty("top")&&(e.top=t.top),t.hasOwnProperty("right")&&(e.right=t.right),t.hasOwnProperty("bottom")&&(e.bottom=t.bottom),t.hasOwnProperty("left")&&(e.left=t.left),e},R=function(e){for(var t=document.querySelectorAll("."+e),n=0;n'+String.fromCharCode(10003)+""+e},O=function(e){this.getSettings().customBorders&&(e.items.push(Handsontable.plugins.ContextMenu.SEPARATOR),e.items.push({key:"borders",name:"Borders",submenu:{items:[{key:"borders:top",name:function(){var e="Top",t=T(this,"top");return t&&(e=M(e)),e},callback:function(){var e=T(this,"top");E.call(this,this.getSelectedRange(),"top",e)},disabled:!1},{key:"borders:right",name:function(){var e="Right",t=T(this,"right");return t&&(e=M(e)),e},callback:function(){var e=T(this,"right");E.call(this,this.getSelectedRange(),"right",e)},disabled:!1},{key:"borders:bottom",name:function(){var e="Bottom",t=T(this,"bottom");return t&&(e=M(e)),e},callback:function(){var e=T(this,"bottom");E.call(this,this.getSelectedRange(),"bottom",e)},disabled:!1},{key:"borders:left",name:function(){var e="Left",t=T(this,"left");return t&&(e=M(e)),e},callback:function(){var e=T(this,"left");E.call(this,this.getSelectedRange(),"left",e)},disabled:!1},{key:"borders:no_borders",name:"Remove border(s)",callback:function(){E.call(this,this.getSelectedRange(),"noBorders")},disabled:function(){return!T(this)}}]}}))};Handsontable.hooks.add("beforeInit",d),Handsontable.hooks.add("afterContextMenuDefaultOptions",O),Handsontable.hooks.add("afterInit",function(){var e=this.getSettings().customBorders;if(e){for(var t=0;tthis.boundaries.bottom&&(o=t-this.boundaries.bottom),ethis.boundaries.right&&(n=e-this.boundaries.right),this.callback(n,o)};var a,l=function(e){e.dragToScrollListening=!1;var t=e.view.wt.wtTable.holder;a=new o,t!==window&&(a.setBoundaries(t.getBoundingClientRect()),a.setCallback(function(e,n){0>e?t.scrollLeft-=50:e>0&&(t.scrollLeft+=50),0>n?t.scrollTop-=20:n>0&&(t.scrollTop+=20)}),e.dragToScrollListening=!0)};Handsontable.hooks.add("afterInit",function(){var e=this,t=s(this);t.addEventListener(document,"mouseup",function(){e.dragToScrollListening=!1}),t.addEventListener(document,"mousemove",function(t){e.dragToScrollListening&&a.check(t.clientX,t.clientY)})}),Handsontable.hooks.add("afterDestroy",function(){s(this).clear()}),Handsontable.hooks.add("afterOnCellMouseDown",function(){l(this)}),Handsontable.hooks.add("afterOnCellCornerMouseDown",function(){l(this)}),Handsontable.plugins.DragToScroll=o},{eventManager:41,plugins:57}],76:[function(e,t,n){"use strict";Object.defineProperties(n,{ManualColumnFreeze:{get:function(){return a}},__esModule:{value:!0}});var o,r,i=(o=e("_base"),o&&o.__esModule&&o||{"default":o})["default"],s=(r=e("plugins"),r&&r.__esModule&&r||{"default":r}).registerPlugin,a=function(e){$traceurRuntime.superConstructor(l).call(this,e)},l=a;$traceurRuntime.createClass(a,{isEnabled:function(){return!!this.hot.getSettings().manualColumnFreeze},enablePlugin:function(){var e=this;this.enabled||(this.addHook("modifyCol",function(t){return e.onModifyCol(t)}),this.addHook("afterContextMenuDefaultOptions",function(t){return e.addContextMenuEntry(t)}),$traceurRuntime.superGet(this,l.prototype,"enablePlugin").call(this))},disablePlugin:function(){$traceurRuntime.superGet(this,l.prototype,"disablePlugin").call(this)},init:function(){$traceurRuntime.superGet(this,l.prototype,"init").call(this),"undefined"==typeof this.hot.manualColumnPositionsPluginUsages?this.hot.manualColumnPositionsPluginUsages=["manualColumnFreeze"]:this.hot.manualColumnPositionsPluginUsages.push("manualColumnFreeze"),this.fixedColumnsCount=this.hot.getSettings().fixedColumnsLeft},onModifyCol:function(e){return this.hot.manualColumnPositionsPluginUsages.length>1?e:this.getModifiedColumnIndex(e)},getModifiedColumnIndex:function(e){return this.hot.manualColumnPositions[e]},addContextMenuEntry:function(e){var t=this;e.items.push(Handsontable.plugins.ContextMenu.SEPARATOR,{key:"freeze_column",name:function(){var e=t.hot.getSelected()[1];return e>t.fixedColumnsCount-1?"Freeze this column":"Unfreeze this column"},disabled:function(){var e=t.hot.getSelected();return e[1]!==e[3]},callback:function(){var e=t.hot.getSelected()[1];e>t.fixedColumnsCount-1?t.freezeColumn(e):t.unfreezeColumn(e)}})},freezeColumn:function(e){if(!(e<=this.fixedColumnsCount-1)){var t=this.getModifiedColumnIndex(e)||e;this.checkPositionData(t),this.modifyColumnOrder(t,e,null,"freeze"),this.addFixedColumn(),this.hot.view.wt.wtOverlays.leftOverlay.refresh(),this.hot.view.wt.wtOverlays.adjustElementsSize()}},unfreezeColumn:function(e){if(!(e>this.fixedColumnsCount-1)){var t=this.getBestColumnReturnPosition(e),n=this.getModifiedColumnIndex(e)||e;this.checkPositionData(n),this.modifyColumnOrder(n,e,t,"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(e){this.hot.manualColumnPositions&&0!==this.hot.manualColumnPositions.length||this.hot.manualColumnPositions||(this.hot.manualColumnPositions=[]),e?this.hot.manualColumnPositions[e]||this.createPositionData(e+1):this.createPositionData(this.hot.countCols())},createPositionData:function(e){if(this.hot.manualColumnPositions.lengtht;t++)this.hot.manualColumnPositions[t]=t},modifyColumnOrder:function(e,t,n,o){null==n&&(n=e),"freeze"===o?this.hot.manualColumnPositions.splice(this.fixedColumnsCount,0,this.hot.manualColumnPositions.splice(t,1)[0]):"unfreeze"===o&&this.hot.manualColumnPositions.splice(n,0,this.hot.manualColumnPositions.splice(t,1)[0])},getBestColumnReturnPosition:function(e){for(var t=this.fixedColumnsCount,n=this.getModifiedColumnIndex(t),o=this.getModifiedColumnIndex(e);o>n;)t++,n=this.getModifiedColumnIndex(t);return t-1}},{},i),s("manualColumnFreeze",a)},{_base:58,plugins:57}],77:[function(e,t,n){"use strict";function o(){function e(e){g=this,m=e;var t=this.view.wt.wtTable.getCoords(e).col;if(t>=0){f=t;var n=m.getBoundingClientRect();l=n.left,v.style.top=n.top+"px",v.style.left=l+"px",g.rootElement.appendChild(v)}}function t(e,t){var n=e.getBoundingClientRect(),o=6;t>0?v.style.left=n.left+n.width-o+"px":v.style.left=n.left+"px"}function n(){var e=this;u(v,"active"),u(w,"active");var t=m.getBoundingClientRect();w.style.width=t.width+"px",w.style.height=e.view.maximumVisibleElementHeight(0)+"px",w.style.top=v.style.top,w.style.left=l+"px",e.rootElement.appendChild(w)}function o(e){w.style.left=l+e+"px"}function r(){d(v,"active"),d(w,"active")}var i,s,a,l,f,g,m,v=document.createElement("DIV"),w=document.createElement("DIV"),y=h(this);v.className="manualColumnMover",w.className="manualColumnMoverGuide";var b=function(){var e=this;Handsontable.hooks.run(e,"persistentStateSave","manualColumnPositions",e.manualColumnPositions)},C=function(){var e=this,t={};return Handsontable.hooks.run(e,"persistentStateLoad","manualColumnPositions",t),t.value},R=function(e){if(e!=this.rootElement){var t=e.parentNode;return"THEAD"===t.tagName?!0:R.call(this,t)}return!1},_=function(e){return"TABLE"!=e.tagName?"TH"==e.tagName?e:_(e.parentNode):null},S=function(){var l,u=this;y.addEventListener(u.rootElement,"mouseover",function(n){if(R.call(u,n.target)){var o=_(n.target);if(o)if(l){var r=u.view.wt.wtTable.getCoords(o).col;r>=0&&(s=r,t(n.target,s-i))}else e.call(u,o)}}),y.addEventListener(u.rootElement,"mousedown",function(e){c(e.target,"manualColumnMover")&&(a=p(e),n.call(u),l=u,i=f,s=f)}),y.addEventListener(window,"mousemove",function(e){l&&o(p(e)-a)}),y.addEventListener(window,"mouseup",function(t){l&&(r(),l=!1,T(u.manualColumnPositions,u.countCols()),u.manualColumnPositions.splice(s,0,u.manualColumnPositions.splice(i,1)[0]),Handsontable.hooks.run(u,"beforeColumnMove",i,s),u.forceFullRender=!0,u.view.render(),b.call(u),Handsontable.hooks.run(u,"afterColumnMove",i,s),e.call(u,m))}),u.addHook("afterDestroy",E)},E=function(){y.clear()},T=function(e,t){if(e.lengthn;n++)e[n]=n};this.beforeInit=function(){this.manualColumnPositions=[]},this.init=function(e){var t=this,n=!!this.getSettings().manualColumnMove;if(n){var o=this.getSettings().manualColumnMove,r=C.call(t);"undefined"!=typeof r?this.manualColumnPositions=r:Array.isArray(o)?this.manualColumnPositions=o:o&&void 0!==this.manualColumnPositions||(this.manualColumnPositions=[]),("afterInit"===e||"afterUpdateSettings"===e&&0===y.context.eventListeners.length)&&("undefined"==typeof t.manualColumnPositionsPluginUsages?t.manualColumnPositionsPluginUsages=["manualColumnMove"]:t.manualColumnPositionsPluginUsages.push("manualColumnMove"),E.call(this),S.call(this),this.manualColumnPositions&&this.manualColumnPositions.length>0&&(this.forceFullRender=!0,this.render()))}else{var i=t.manualColumnPositionsPluginUsages?t.manualColumnPositionsPluginUsages.indexOf("manualColumnMove"):-1;i>-1&&(E.call(this),this.manualColumnPositions=[],t.manualColumnPositionsPluginUsages[i]=void 0)}},this.modifyCol=function(e){return this.getSettings().manualColumnMove?("undefined"==typeof this.manualColumnPositions[e]&&T(this.manualColumnPositions,e+1),this.manualColumnPositions[e]):e},this.afterRemoveCol=function(e,t){if(this.getSettings().manualColumnMove){var n,o=this.manualColumnPositions;n=o.splice(e,t),o=o.map(function(e){var t,o=e;for(t=0;tn[t]&&o--;return o}),this.manualColumnPositions=o}},this.afterCreateCol=function(e,t){if(this.getSettings().manualColumnMove){var n=this.manualColumnPositions;if(n.length){for(var o=[],r=0;t>r;r++)o.push(e+r);e>=n.length?n.concat(o):(n=n.map(function(n){return n>=e?n+t:n}),n.splice.apply(n,[e,0].concat(o))),this.manualColumnPositions=n}}}}Object.defineProperties(n,{ManualColumnMove:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,a,l=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),u=l.addClass,c=l.hasClass,d=l.removeClass,h=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager,f=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),p=f.pageX,g=(f.pageY,(a=e("plugins"),a&&a.__esModule&&a||{"default":a}).registerPlugin,new o);Handsontable.hooks.add("beforeInit",g.beforeInit),Handsontable.hooks.add("afterInit",function(){g.init.call(this,"afterInit")}),Handsontable.hooks.add("afterUpdateSettings",function(){g.init.call(this,"afterUpdateSettings")}),Handsontable.hooks.add("modifyCol",g.modifyCol),Handsontable.hooks.add("afterRemoveCol",g.afterRemoveCol),Handsontable.hooks.add("afterCreateCol",g.afterCreateCol),Handsontable.hooks.register("beforeColumnMove"),Handsontable.hooks.register("afterColumnMove")},{eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,plugins:57}],78:[function(e,t,n){"use strict";Object.defineProperties(n,{ManualColumnResize:{get:function(){return v}},__esModule:{value:!0}});var o,r,i,s,a,l=(o=e("_base.js"),o&&o.__esModule&&o||{"default":o})["default"],u=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),c=u.addClass,d=u.hasClass,h=u.removeClass,f=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager,p=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),g=p.pageX,m=(p.pageY,(a=e("plugins"),a&&a.__esModule&&a||{"default":a}).registerPlugin),v=function(e){$traceurRuntime.superConstructor(w).call(this,e),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=f(this),this.pressed=null,this.dblclick=0,this.autoresizeTimeout=null,this.manualColumnWidths=[],c(this.handle,"manualColumnResizer"),c(this.guide,"manualColumnResizerGuide")},w=v;$traceurRuntime.createClass(v,{isEnabled:function(){return this.hot.getSettings().manualColumnResize},enablePlugin:function(){var e=this;if(!this.enabled){this.manualColumnWidths=[];var t=this.hot.getSettings().manualColumnResize,n=this.loadManualColumnWidths();this.addHook("modifyColWidth",function(t,n){return e.onModifyColWidth(t,n)}),this.addHook("beforeStretchingColumnWidth",function(t,n){return e.onBeforeStretchingColumnWidth(t,n)}),"undefined"!=typeof n?this.manualColumnWidths=n:Array.isArray(t)?this.manualColumnWidths=t:this.manualColumnWidths=[],Handsontable.hooks.register("beforeColumnResize"),Handsontable.hooks.register("afterColumnResize"),this.bindEvents(),$traceurRuntime.superGet(this,w.prototype,"enablePlugin").call(this)}},updatePlugin:function(){var e=this.hot.getSettings().manualColumnResize;Array.isArray(e)?this.manualColumnWidths=e:e||(this.manualColumnWidths=[])},disablePlugin:function(){$traceurRuntime.superGet(this,w.prototype,"disablePlugin").call(this)},saveManualColumnWidths:function(){this.hot.runHooks("persistentStateSave","manualColumnWidths",this.manualColumnWidths)},loadManualColumnWidths:function(){var e={};return this.hot.runHooks("persistentStateLoad","manualColumnWidths",e),e.value},setupHandlePosition:function(e){this.currentTH=e;var t=this.hot.view.wt.wtTable.getCoords(e).col;if(t>=0){var n=this.currentTH.getBoundingClientRect();this.currentCol=t,this.startOffset=n.left-6,this.startWidth=parseInt(n.width,10),this.handle.style.top=n.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(){c(this.handle,"active"),c(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(){h(this.handle,"active"),h(this.guide,"active")},checkIfColumnHeader:function(e){if(e!=this.hot.rootElement){var t=e.parentNode;return"THEAD"===t.tagName?!0:this.checkIfColumnHeader(t)}return!1},getTHFromTargetElement:function(e){return"TABLE"!=e.tagName?"TH"==e.tagName?e:this.getTHFromTargetElement(e.parentNode):null},onMouseOver:function(e){if(this.checkIfColumnHeader(e.target)){var t=this.getTHFromTargetElement(e.target);if(!t)return;var n=t.getAttribute("colspan");!t||null!==n&&1!==n||this.pressed||this.setupHandlePosition(t)}},afterMouseDownTimeout:function(){if(this.dblclick>=2){var e=this.hot.runHooks("beforeColumnResize",this.currentCol,this.newSize,!0);void 0!==e&&(this.newSize=e),"all"===this.hot.getSettings().stretchH?this.clearManualSize(this.currentCol):this.setManualSize(this.currentCol,this.newSize),this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.wt.wtOverlays.adjustElementsSize(!0),this.hot.runHooks("afterColumnResize",this.currentCol,this.newSize,!0)}this.dblclick=0,this.autoresizeTimeout=null},onMouseDown:function(e){var t=this;d(e.target,"manualColumnResizer")&&(this.setupGuidePosition(),this.pressed=this.hot,null===this.autoresizeTimeout&&(this.autoresizeTimeout=setTimeout(function(){return t.afterMouseDownTimeout()},500),this.hot._registerTimeout(this.autoresizeTimeout)),this.dblclick++,this.startX=g(e),this.newSize=this.startWidth)},onMouseMove:function(e){this.pressed&&(this.currentWidth=this.startWidth+(g(e)-this.startX),this.newSize=this.setManualSize(this.currentCol,this.currentWidth),this.refreshHandlePosition(),this.refreshGuidePosition())},onMouseUp:function(e){this.pressed&&(this.hideHandleAndGuide(),this.pressed=!1,this.newSize!=this.startWidth&&(this.hot.runHooks("beforeColumnResize",this.currentCol,this.newSize),this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.wt.wtOverlays.adjustElementsSize(!0),this.saveManualColumnWidths(),this.hot.runHooks("afterColumnResize",this.currentCol,this.newSize)),this.setupHandlePosition(this.currentTH))},bindEvents:function(){var e=this;this.eventManager.addEventListener(this.hot.rootElement,"mouseover",function(t){return e.onMouseOver(t)}),this.eventManager.addEventListener(this.hot.rootElement,"mousedown",function(t){return e.onMouseDown(t)}),this.eventManager.addEventListener(window,"mousemove",function(t){return e.onMouseMove(t)}),this.eventManager.addEventListener(window,"mouseup",function(t){return e.onMouseUp(t)})},setManualSize:function(e,t){return t=Math.max(t,20),e=this.hot.runHooks("modifyCol",e),this.manualColumnWidths[e]=t,t},clearManualSize:function(e){e=this.hot.runHooks("modifyCol",e),this.manualColumnWidths[e]=void 0},onModifyColWidth:function(e,t){return this.enabled&&(t=this.hot.runHooks("modifyCol",t),this.hot.getSettings().manualColumnResize&&this.manualColumnWidths[t])?this.manualColumnWidths[t]:e},onBeforeStretchingColumnWidth:function(e,t){var n=this.manualColumnWidths[t];return void 0===n&&(n=e),n}},{},l),m("manualColumnResize",v)},{"_base.js":58,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,plugins:57}],79:[function(e,t,n){"use strict";function o(){function e(e){var t=this;g=e;var n=this.view.wt.wtTable.getCoords(e).row;if(n>=0){f=n;var o=g.getBoundingClientRect();l=o.top,m.style.top=l+"px",m.style.left=o.left+"px",t.rootElement.appendChild(m)}}function t(e,t){var n=e.getBoundingClientRect(),o=6;t>0?m.style.top=n.top+n.height-o+"px":m.style.top=n.top+"px"}function n(){var e=this;u(m,"active"),u(v,"active");var t=g.getBoundingClientRect();v.style.width=e.view.maximumVisibleElementWidth(0)+"px",v.style.height=t.height+"px",v.style.top=l+"px",v.style.left=m.style.left,e.rootElement.appendChild(v)}function o(e){v.style.top=l+e+"px"}function r(){d(m,"active"),d(v,"active")}var i,s,a,l,f,g,m=document.createElement("DIV"),v=document.createElement("DIV"),w=h(this);m.className="manualRowMover",v.className="manualRowMoverGuide";var y=function(){var e=this;Handsontable.hooks.run(e,"persistentStateSave","manualRowPositions",e.manualRowPositions)},b=function(){var e=this,t={};return Handsontable.hooks.run(e,"persistentStateLoad","manualRowPositions",t),t.value},C=function(e){if(e!=this.rootElement){var t=e.parentNode;return"TBODY"==t.tagName?!0:C.call(this,t)}return!1},R=function(e){return"TABLE"!=e.tagName?"TH"==e.tagName?e:R(e.parentNode):null},_=function(){var l,u=this;w.addEventListener(u.rootElement,"mouseover",function(n){if(C.call(u,n.target)){var o=R(n.target);o&&(l?(s=u.view.wt.wtTable.getCoords(o).row,t(o,s-i)):e.call(u,o))}}),w.addEventListener(u.rootElement,"mousedown",function(e){c(e.target,"manualRowMover")&&(a=p(e),n.call(u),l=u,i=f,s=f)}),w.addEventListener(window,"mousemove",function(e){l&&o(p(e)-a)}),w.addEventListener(window,"mouseup",function(t){l&&(r(),l=!1,E(u.manualRowPositions,u.countRows()),u.manualRowPositions.splice(s,0,u.manualRowPositions.splice(i,1)[0]),Handsontable.hooks.run(u,"beforeRowMove",i,s),u.forceFullRender=!0,u.view.render(),y.call(u),Handsontable.hooks.run(u,"afterRowMove",i,s),e.call(u,g))}),u.addHook("afterDestroy",S)},S=function(){w.clear()},E=function(e,t){if(e.lengthn;n++)e[n]=n};this.beforeInit=function(){this.manualRowPositions=[]},this.init=function(e){var t=this,n=!!t.getSettings().manualRowMove;if(n){var o=t.getSettings().manualRowMove,r=b.call(t);"undefined"==typeof t.manualRowPositionsPluginUsages?t.manualRowPositionsPluginUsages=["manualColumnMove"]:t.manualRowPositionsPluginUsages.push("manualColumnMove"),"undefined"!=typeof r?this.manualRowPositions=r:Array.isArray(o)?this.manualRowPositions=o:o&&void 0!==this.manualRowPositions||(this.manualRowPositions=[]),("afterInit"===e||"afterUpdateSettings"===e&&0===w.context.eventListeners.length)&&(S.call(this),_.call(this),this.manualRowPositions&&this.manualRowPositions.length>0&&(t.forceFullRender=!0,t.render()))}else{var i=t.manualRowPositionsPluginUsages?t.manualRowPositionsPluginUsages.indexOf("manualColumnMove"):-1;i>-1&&(S.call(this),t.manualRowPositions=[],t.manualRowPositionsPluginUsages[i]=void 0)}},this.modifyRow=function(e){var t=this;return t.getSettings().manualRowMove?("undefined"==typeof t.manualRowPositions[e]&&E(this.manualRowPositions,e+1),t.manualRowPositions[e]):e}}Object.defineProperties(n,{ManualRowMove:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,a,l=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),u=l.addClass,c=l.hasClass,d=l.removeClass,h=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager,f=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),p=(f.pageX,f.pageY),g=((a=e("plugins"),a&&a.__esModule&&a||{"default":a}).registerPlugin,new o);Handsontable.hooks.add("beforeInit",g.beforeInit), -Handsontable.hooks.add("afterInit",function(){g.init.call(this,"afterInit")}),Handsontable.hooks.add("afterUpdateSettings",function(){g.init.call(this,"afterUpdateSettings")}),Handsontable.hooks.add("modifyRow",g.modifyRow),Handsontable.hooks.register("beforeRowMove"),Handsontable.hooks.register("afterRowMove")},{eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,plugins:57}],80:[function(e,t,n){"use strict";Object.defineProperties(n,{ManualRowResize:{get:function(){return v}},__esModule:{value:!0}});var o,r,i,s,a,l=(o=e("_base.js"),o&&o.__esModule&&o||{"default":o})["default"],u=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),c=u.addClass,d=u.hasClass,h=u.removeClass,f=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager,p=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),g=(p.pageX,p.pageY),m=(a=e("plugins"),a&&a.__esModule&&a||{"default":a}).registerPlugin,v=function(e){$traceurRuntime.superConstructor(w).call(this,e),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=f(this),this.pressed=null,this.dblclick=0,this.autoresizeTimeout=null,this.manualRowHeights=[],c(this.handle,"manualRowResizer"),c(this.guide,"manualRowResizerGuide")},w=v;$traceurRuntime.createClass(v,{isEnabled:function(){return this.hot.getSettings().manualRowResize},enablePlugin:function(){var e=this;if(!this.enabled){this.manualRowHeights=[];var t=this.hot.getSettings().manualRowResize,n=this.loadManualRowHeights();"undefined"!=typeof n?this.manualRowHeights=n:Array.isArray(t)?this.manualRowHeights=t:this.manualRowHeights=[],this.addHook("modifyRowHeight",function(t,n){return e.onModifyRowHeight(t,n)}),Handsontable.hooks.register("beforeRowResize"),Handsontable.hooks.register("afterRowResize"),this.bindEvents(),$traceurRuntime.superGet(this,w.prototype,"enablePlugin").call(this)}},updatePlugin:function(){var e=this.hot.getSettings().manualRowResize;Array.isArray(e)?this.manualRowHeights=e:e||(this.manualRowHeights=[])},disablePlugin:function(){$traceurRuntime.superGet(this,w.prototype,"disablePlugin").call(this)},saveManualRowHeights:function(){this.hot.runHooks("persistentStateSave","manualRowHeights",this.manualRowHeights)},loadManualRowHeights:function(){var e={};return this.hot.runHooks("persistentStateLoad","manualRowHeights",e),e.value},setupHandlePosition:function(e){this.currentTH=e;var t=this.hot.view.wt.wtTable.getCoords(e).row;if(t>=0){var n=this.currentTH.getBoundingClientRect();this.currentRow=t,this.startOffset=n.top-6,this.startHeight=parseInt(n.height,10),this.handle.style.left=n.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(){c(this.handle,"active"),c(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(){h(this.handle,"active"),h(this.guide,"active")},checkIfRowHeader:function(e){if(e!=this.hot.rootElement){var t=e.parentNode;return"TBODY"===t.tagName?!0:this.checkIfRowHeader(t)}return!1},getTHFromTargetElement:function(e){return"TABLE"!=e.tagName?"TH"==e.tagName?e:this.getTHFromTargetElement(e.parentNode):null},onMouseOver:function(e){if(this.checkIfRowHeader(e.target)){var t=this.getTHFromTargetElement(e.target);t&&(this.pressed||this.setupHandlePosition(t))}},afterMouseDownTimeout:function(){if(this.dblclick>=2){var e=this.hot.runHooks("beforeRowResize",this.currentRow,this.newSize,!0);void 0!==e&&(this.newSize=e),this.setManualSize(this.currentRow,this.newSize),this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.wt.wtOverlays.adjustElementsSize(!0),this.hot.runHooks("afterRowResize",this.currentRow,this.newSize,!0)}this.dblclick=0,this.autoresizeTimeout=null},onMouseDown:function(e){var t=this;d(e.target,"manualRowResizer")&&(this.setupGuidePosition(),this.pressed=this.hot,null==this.autoresizeTimeout&&(this.autoresizeTimeout=setTimeout(function(){return t.afterMouseDownTimeout()},500),this.hot._registerTimeout(this.autoresizeTimeout)),this.dblclick++,this.startY=g(e),this.newSize=this.startHeight)},onMouseMove:function(e){this.pressed&&(this.currentHeight=this.startHeight+(g(e)-this.startY),this.newSize=this.setManualSize(this.currentRow,this.currentHeight),this.refreshHandlePosition(),this.refreshGuidePosition())},onMouseUp:function(e){this.pressed&&(this.hideHandleAndGuide(),this.pressed=!1,this.newSize!=this.startHeight&&(this.hot.runHooks("beforeRowResize",this.currentRow,this.newSize),this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.wt.wtOverlays.adjustElementsSize(!0),this.saveManualRowHeights(),this.hot.runHooks("afterRowResize",this.currentRow,this.newSize)),this.setupHandlePosition(this.currentTH))},bindEvents:function(){var e=this;this.eventManager.addEventListener(this.hot.rootElement,"mouseover",function(t){return e.onMouseOver(t)}),this.eventManager.addEventListener(this.hot.rootElement,"mousedown",function(t){return e.onMouseDown(t)}),this.eventManager.addEventListener(window,"mousemove",function(t){return e.onMouseMove(t)}),this.eventManager.addEventListener(window,"mouseup",function(t){return e.onMouseUp(t)})},setManualSize:function(e,t){return e=this.hot.runHooks("modifyRow",e),this.manualRowHeights[e]=t,t},onModifyRowHeight:function(e,t){if(this.enabled){var n=this.hot.getPlugin("autoRowSize"),o=n?n.heights[t]:null;t=this.hot.runHooks("modifyRow",t);var r=this.manualRowHeights[t];if(void 0!==r&&(r===o||r>(e||0)))return r}return e}},{},l),m("manualRowResize",v)},{"_base.js":58,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,plugins:57}],81:[function(e,t,n){"use strict";function o(){var e=[];return e.getInfo=function(e,t){for(var n=0,o=this.length;o>n;n++)if(this[n].row<=e&&this[n].row+this[n].rowspan-1>=e&&this[n].col<=t&&this[n].col+this[n].colspan-1>=t)return this[n]},e.setInfo=function(e){for(var t=0,n=this.length;n>t;t++)if(this[t].row===e.row&&this[t].col===e.col)return void(this[t]=e);this.push(e)},e.removeInfo=function(e,t){for(var n=0,o=this.length;o>n;n++)if(this[n].row===e&&this[n].col===t){this.splice(n,1);break}},e}function r(e){if(this.mergedCellInfoCollection=new o,Array.isArray(e))for(var t=0,n=e.length;n>t;t++)this.mergedCellInfoCollection.setInfo(e[t])}function i(e,t){var n=this.getSettings().mergeCells;if(n&&!this.selection.isMultiple()){var o=this.mergeCells.mergedCellInfoCollection.getInfo(e[0],e[1]);o&&(e[0]=o.row,e[1]=o.col,e[2]=o.row+o.rowspan-1,e[3]=o.col+o.colspan-1)}}function s(e,t){this.mergeCells&&this.mergeCells.shiftCollection("right",e,t)}function a(e,t){this.mergeCells&&this.mergeCells.shiftCollection("left",e,t)}function l(e,t){this.mergeCells&&this.mergeCells.shiftCollection("down",e,t)}function u(e,t){this.mergeCells&&this.mergeCells.shiftCollection("up",e,t)}Object.defineProperties(n,{MergeCells:{get:function(){return r}},__esModule:{value:!0}});var c,d,h,f,p,g=((c=e("plugins"),c&&c.__esModule&&c||{"default":c}).registerPlugin,(d=e("helpers/dom/event"),d&&d.__esModule&&d||{"default":d}).stopImmediatePropagation),m=(h=e("3rdparty/walkontable/src/cell/coords"),h&&h.__esModule&&h||{"default":h}).WalkontableCellCoords,v=(f=e("3rdparty/walkontable/src/cell/range"),f&&f.__esModule&&f||{"default":f}).WalkontableCellRange,w=(p=e("3rdparty/walkontable/src/table"),p&&p.__esModule&&p||{"default":p}).WalkontableTable;r.prototype.canMergeRange=function(e){return!e.isSingle()},r.prototype.mergeRange=function(e){if(this.canMergeRange(e)){var t=e.getTopLeftCorner(),n=e.getBottomRightCorner(),o={};o.row=t.row,o.col=t.col,o.rowspan=n.row-t.row+1,o.colspan=n.col-t.col+1,this.mergedCellInfoCollection.setInfo(o)}},r.prototype.mergeOrUnmergeSelection=function(e){var t=this.mergedCellInfoCollection.getInfo(e.from.row,e.from.col);t?this.unmergeSelection(e.from):this.mergeSelection(e)},r.prototype.mergeSelection=function(e){this.mergeRange(e)},r.prototype.unmergeSelection=function(e){var t=this.mergedCellInfoCollection.getInfo(e.row,e.col);this.mergedCellInfoCollection.removeInfo(t.row,t.col)},r.prototype.applySpanProperties=function(e,t,n){var o=this.mergedCellInfoCollection.getInfo(t,n);o?o.row===t&&o.col===n?(e.setAttribute("rowspan",o.rowspan),e.setAttribute("colspan",o.colspan)):(e.removeAttribute("rowspan"),e.removeAttribute("colspan"),e.style.display="none"):(e.removeAttribute("rowspan"),e.removeAttribute("colspan"))},r.prototype.modifyTransform=function(e,t,n){var o=function(e,t){return t.row>=e.row&&t.row<=e.row+e.rowspan-1?!0:!1},r=function(e,t){return t.col>=e.col&&t.col<=e.col+e.colspan-1?!0:!1},i=function(e){return new m(t.to.row+e.row,t.to.col+e.col)},s={row:n.row,col:n.col};if("modifyTransformStart"==e){this.lastDesiredCoords||(this.lastDesiredCoords=new m(null,null));for(var a,l=new m(t.highlight.row,t.highlight.col),u=this.mergedCellInfoCollection.getInfo(l.row,l.col),c=0,d=this.mergedCellInfoCollection.length;d>c;c++){var h=this.mergedCellInfoCollection[c];if(h=new m(h.row+h.rowspan-1,h.col+h.colspan-1),t.includes(h)){a=!0;break}}if(u){var f=new m(u.row,u.col),p=new m(u.row+u.rowspan-1,u.col+u.colspan-1),g=new v(f,f,p);g.includes(this.lastDesiredCoords)||(this.lastDesiredCoords=new m(null,null)),s.row=this.lastDesiredCoords.row?this.lastDesiredCoords.row-l.row:s.row,s.col=this.lastDesiredCoords.col?this.lastDesiredCoords.col-l.col:s.col,n.row>0?s.row=u.row+u.rowspan-1-l.row+n.row:n.row<0&&(s.row=l.row-u.row+n.row),n.col>0?s.col=u.col+u.colspan-1-l.col+n.col:n.col<0&&(s.col=l.col-u.col+n.col)}var w=new m(t.highlight.row+s.row,t.highlight.col+s.col),y=this.mergedCellInfoCollection.getInfo(w.row,w.col);y&&(this.lastDesiredCoords=w,s={row:y.row-l.row,col:y.col-l.col})}else if("modifyTransformEnd"==e)for(var c=0,d=this.mergedCellInfoCollection.length;d>c;c++){var b=this.mergedCellInfoCollection[c],f=new m(b.row,b.col),p=new m(b.row+b.rowspan-1,b.col+b.colspan-1),C=new v(f,f,p),R=t.getBordersSharedWith(C);if(C.isEqual(t))t.setDirection("NW-SE");else if(R.length>0){var _=t.highlight.isEqual(C.from);R.indexOf("top")>-1?t.to.isSouthEastOf(C.from)&&_?t.setDirection("NW-SE"):t.to.isSouthWestOf(C.from)&&_&&t.setDirection("NE-SW"):R.indexOf("bottom")>-1&&(t.to.isNorthEastOf(C.from)&&_?t.setDirection("SW-NE"):t.to.isNorthWestOf(C.from)&&_&&t.setDirection("SE-NW"))}var w=i(s),S=o(b,w),E=r(b,w);t.includesRange(C)&&(C.includes(w)||S||E)&&(S&&(s.row<0?s.row-=b.rowspan-1:s.row>0&&(s.row+=b.rowspan-1)),E&&(s.col<0?s.col-=b.colspan-1:s.col>0&&(s.col+=b.colspan-1)))}0!==s.row&&(n.row=s.row),0!==s.col&&(n.col=s.col)},r.prototype.shiftCollection=function(e,t,n){var o=[0,0];switch(e){case"right":o[0]+=1;break;case"left":o[0]-=1;break;case"down":o[1]+=1;break;case"up":o[1]-=1}for(var r=0;rn;n++)e.mergeCells.mergedCellInfoCollection.setInfo(t[n])}else e.mergeCells=new r(t);else e.mergeCells&&(e.mergeCells.mergedCellInfoCollection=new o)},R=function(e){if(this.mergeCells){var t=(e.ctrlKey||e.metaKey)&&!e.altKey;t&&77===e.keyCode&&(this.mergeCells.mergeOrUnmergeSelection(this.getSelectedRange()),this.render(),g(e))}},_=function(e){this.getSettings().mergeCells&&(e.items.push(Handsontable.plugins.ContextMenu.SEPARATOR),e.items.push({key:"mergeCells",name:function(){var e=this.getSelected(),t=this.mergeCells.mergedCellInfoCollection.getInfo(e[0],e[1]);return t?"Unmerge cells":"Merge cells"},callback:function(){this.mergeCells.mergeOrUnmergeSelection(this.getSelectedRange()),this.render()},disabled:function(){return!1}}))},S=function(e,t,n,o,r,i){this.mergeCells&&this.mergeCells.applySpanProperties(e,t,n)},E=function(e){return function(t){var n=this.getSettings().mergeCells;if(n){var o=this.getSelectedRange();if(this.mergeCells.modifyTransform(e,o,t),"modifyTransformEnd"===e){var r=this.countRows(),i=this.countCols();o.from.row<0?o.from.row=0:o.from.row>0&&o.from.row>=r&&(o.from.row=o.from-1),o.from.col<0?o.from.col=0:o.from.col>0&&o.from.col>=i&&(o.from.col=i-1)}}}},T=function(e){this.lastDesiredCoords=null;var t=this.getSettings().mergeCells;if(t){var n=this.getSelectedRange();n.highlight=new m(n.highlight.row,n.highlight.col),n.to=e;var o=!1;do{o=!1;for(var r=0,i=this.mergeCells.mergedCellInfoCollection.length;i>r;r++){var s=this.mergeCells.mergedCellInfoCollection[r],a=new m(s.row,s.col),l=new m(s.row+s.rowspan-1,s.col+s.colspan-1),u=new v(a,a,l);n.expandByRange(u)&&(e.row=n.to.row,e.col=n.to.col,o=!0)}}while(o)}},M=function(e,t){if(t&&"area"==t){var n=this.getSettings().mergeCells;if(n)for(var o=this.getSelectedRange(),r=new v(o.from,o.from,o.from),i=new v(o.to,o.to,o.to),s=0,a=this.mergeCells.mergedCellInfoCollection.length;a>s;s++){var l=this.mergeCells.mergedCellInfoCollection[s],u=new m(l.row,l.col),c=new m(l.row+l.rowspan-1,l.col+l.colspan-1),d=new v(u,u,c);r.expandByRange(d)&&(e[0]=r.from.row,e[1]=r.from.col),i.expandByRange(d)&&(e[2]=i.from.row,e[3]=i.from.col)}}},O=function(e,t,n){var o=this.getSettings().mergeCells;if(o){var r=this.mergeCells.mergedCellInfoCollection.getInfo(e,t);!r||r.row==e&&r.col==t||(n.copyable=!1)}},k=function(e){var t=this.getSettings().mergeCells;if(t)for(var n,o=this.countCols(),r=0;o>r;r++){if(n=this.mergeCells.mergedCellInfoCollection.getInfo(e.startRow,r),n&&n.rowe.endRow)return e.endRow=i,k.call(this,e)}}},H=function(e){var t=this.getSettings().mergeCells;if(t)for(var n,o=this.countRows(),r=0;o>r;r++){if(n=this.mergeCells.mergedCellInfoCollection.getInfo(r,e.startColumn),n&&n.cole.endColumn)return e.endColumn=i,H.call(this,e)}}},D=function(e){if(e&&this.mergeCells){var t=this.mergeCells.mergedCellInfoCollection,n=this.getSelectedRange();for(var o in t)if(n.highlight.row==t[o].row&&n.highlight.col==t[o].col&&n.to.row==t[o].row+t[o].rowspan-1&&n.to.col==t[o].col+t[o].colspan-1)return!1}return e};Handsontable.hooks.add("beforeInit",y),Handsontable.hooks.add("afterInit",b),Handsontable.hooks.add("afterUpdateSettings",C),Handsontable.hooks.add("beforeKeyDown",R),Handsontable.hooks.add("modifyTransformStart",E("modifyTransformStart")),Handsontable.hooks.add("modifyTransformEnd",E("modifyTransformEnd")),Handsontable.hooks.add("beforeSetRangeEnd",T),Handsontable.hooks.add("beforeDrawBorders",M),Handsontable.hooks.add("afterIsMultipleSelection",D),Handsontable.hooks.add("afterRenderer",S),Handsontable.hooks.add("afterContextMenuDefaultOptions",_),Handsontable.hooks.add("afterGetCellMeta",O),Handsontable.hooks.add("afterViewportRowCalculatorOverride",k),Handsontable.hooks.add("afterViewportColumnCalculatorOverride",H),Handsontable.hooks.add("afterAutofillApplyValues",i),Handsontable.hooks.add("afterCreateCol",s),Handsontable.hooks.add("afterRemoveCol",a),Handsontable.hooks.add("afterCreateRow",l),Handsontable.hooks.add("afterRemoveRow",u),Handsontable.MergeCells=r},{"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(e,t,n){"use strict";Object.defineProperties(n,{MultipleSelectionHandles:{get:function(){return p}},__esModule:{value:!0}});var o,r,i,s,a=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),l=a.getWindowScrollTop,u=a.hasClass,c=a.getWindowScrollLeft,d=(r=e("_base"),r&&r.__esModule&&r||{"default":r})["default"],h=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).EventManager,f=(s=e("plugins"),s&&s.__esModule&&s||{"default":s}).registerPlugin,p=function(e){$traceurRuntime.superConstructor(g).call(this,e),this.dragged=[],this.eventManager=null,this.lastSetCell=null},g=p;$traceurRuntime.createClass(p,{isEnabled:function(){return Handsontable.mobileBrowser},enablePlugin:function(){this.enabled||(this.eventManager||(this.eventManager=new h(this)),this.registerListeners(),$traceurRuntime.superGet(this,g.prototype,"enablePlugin").call(this))},registerListeners:function(){function e(e){if(1===t.dragged.length)return t.dragged.splice(0,t.dragged.length),!0;var n=t.dragged.indexOf(e);return-1==n?!1:void(0===n?t.dragged=t.dragged.slice(0,1):1==n&&(t.dragged=t.dragged.slice(-1)))}var t=this;this.eventManager.addEventListener(this.hot.rootElement,"touchstart",function(e){var n;return u(e.target,"topLeftSelectionHandle-HitArea")?(n=t.hot.getSelectedRange(),t.dragged.push("topLeft"),t.touchStartRange={width:n.getWidth(),height:n.getHeight(),direction:n.getDirection()},e.preventDefault(),!1):u(e.target,"bottomRightSelectionHandle-HitArea")?(n=t.hot.getSelectedRange(),t.dragged.push("bottomRight"),t.touchStartRange={width:n.getWidth(),height:n.getHeight(),direction:n.getDirection()},e.preventDefault(),!1):void 0}),this.eventManager.addEventListener(this.hot.rootElement,"touchend",function(n){return u(n.target,"topLeftSelectionHandle-HitArea")?(e.call(t,"topLeft"),t.touchStartRange=void 0,n.preventDefault(),!1):u(n.target,"bottomRightSelectionHandle-HitArea")?(e.call(t,"bottomRight"),t.touchStartRange=void 0,n.preventDefault(),!1):void 0}),this.eventManager.addEventListener(this.hot.rootElement,"touchmove",function(e){var n,o,r,i,s,a,u,d=l(),h=c();0!==t.dragged.length&&(n=document.elementFromPoint(e.touches[0].screenX-h,e.touches[0].screenY-d),n&&n!==t.lastSetCell&&(("TD"==n.nodeName||"TH"==n.nodeName)&&(o=t.hot.getCoords(n),-1==o.col&&(o.col=0),r=t.hot.getSelectedRange(),i=r.getWidth(),s=r.getHeight(),a=r.getDirection(),1==i&&1==s&&t.hot.selection.setRangeEnd(o),u=t.getCurrentRangeCoords(r,o,t.touchStartRange.direction,a,t.dragged[0]),null!==u.start&&t.hot.selection.setRangeStart(u.start),t.hot.selection.setRangeEnd(u.end),t.lastSetCell=n),e.preventDefault()))})},getCurrentRangeCoords:function(e,t,n,o,r){var i=e.getTopLeftCorner(),s=e.getBottomRightCorner(),a=e.getBottomLeftCorner(),l=e.getTopRightCorner(),u={start:null,end:null};switch(n){case"NE-SW":switch(o){case"NE-SW":case"NW-SE":u="topLeft"==r?{start:new WalkontableCellCoords(t.row,e.highlight.col),end:new WalkontableCellCoords(a.row,t.col)}:{start:new WalkontableCellCoords(e.highlight.row,t.col),end:new WalkontableCellCoords(t.row,i.col)};break;case"SE-NW":"bottomRight"==r&&(u={start:new WalkontableCellCoords(s.row,t.col),end:new WalkontableCellCoords(t.row,i.col)})}break;case"NW-SE":switch(o){case"NE-SW":"topLeft"==r?u={start:t,end:a}:u.end=t;break;case"NW-SE":"topLeft"==r?u={start:t,end:s}:u.end=t;break;case"SE-NW":"topLeft"==r?u={start:t,end:i}:u.end=t;break;case"SW-NE":"topLeft"==r?u={start:t,end:l}:u.end=t}break;case"SW-NE":switch(o){case"NW-SE":u="bottomRight"==r?{start:new WalkontableCellCoords(t.row,i.col),end:new WalkontableCellCoords(a.row,t.col)}:{start:new WalkontableCellCoords(i.row,t.col),end:new WalkontableCellCoords(t.row,s.col)};break;case"SW-NE":u="topLeft"==r?{start:new WalkontableCellCoords(e.highlight.row,t.col),end:new WalkontableCellCoords(t.row,s.col)}:{start:new WalkontableCellCoords(t.row,i.col),end:new WalkontableCellCoords(i.row,t.col)};break;case"SE-NW":"bottomRight"==r?u={start:new WalkontableCellCoords(t.row,l.col),end:new WalkontableCellCoords(i.row,t.col)}:"topLeft"==r&&(u={start:a,end:t})}break;case"SE-NW":switch(o){case"NW-SE":case"NE-SW":case"SW-NE":"topLeft"==r&&(u.end=t);break;case"SE-NW":"topLeft"==r?u.end=t:u={start:t,end:i}}}return u},isDragged:function(){return this.dragged.length>0}},{},d),f("multipleSelectionHandles",p)},{_base:58,eventManager:41,"helpers/dom/element":45,plugins:57}],83:[function(e,t,n){"use strict";Object.defineProperties(n,{DataObserver:{get:function(){return d}},__esModule:{value:!0}});var o,r,i,s,a=(o=e("jsonpatch"),o&&o.__esModule&&o||{"default":o})["default"],l=(r=e("../../mixins/localHooks"),r&&r.__esModule&&r||{"default":r}).localHooks,u=(i=e("../../helpers/object"),i&&i.__esModule&&i||{"default":i}).mixin,c=(s=e("utils"),s&&s.__esModule&&s||{"default":s}).cleanPatches,d=function(e){this.observedData=null,this.observer=null,this.paused=!1,this.setObservedData(e)};$traceurRuntime.createClass(d,{setObservedData:function(e){var t=this;this.observer&&a.unobserve(this.observedData,this.observer),this.observedData=e,this.observer=a.observe(this.observedData,function(e){return t.onChange(e)})},isPaused:function(){return this.paused},pause:function(){this.paused=!0},resume:function(){this.paused=!1},onChange:function(e){this.runLocalHooks("change",c(e))},destroy:function(){a.unobserve(this.observedData,this.observer),this.observedData=null,this.observer=null}},{}),u(d,l)},{"../../helpers/object":50,"../../mixins/localHooks":54,jsonpatch:"jsonpatch",utils:85}],84:[function(e,t,n){"use strict";Object.defineProperties(n,{ObserveChanges:{get:function(){return h}},__esModule:{value:!0}});var o,r,i,s,a,l=(o=e("_base"),o&&o.__esModule&&o||{"default":o})["default"],u=((r=e("jsonpatch"),r&&r.__esModule&&r||{"default":r})["default"],(i=e("dataObserver"),i&&i.__esModule&&i||{"default":i}).DataObserver),c=(s=e("helpers/array"),s&&s.__esModule&&s||{"default":s}).arrayEach,d=(a=e("plugins"),a&&a.__esModule&&a||{"default":a}).registerPlugin;Handsontable.hooks.register("afterChangesObserved");var h=function(e){$traceurRuntime.superConstructor(f).call(this,e),this.observer=null},f=h;$traceurRuntime.createClass(h,{isEnabled:function(){return this.hot.getSettings().observeChanges},enablePlugin:function(){var e=this;this.enabled||(this.observer||(this.observer=new u(this.hot.getSourceData()),this._exposePublicApi()),this.observer.addLocalHook("change",function(t){return e.onDataChange(t)}),this.addHook("afterCreateRow",function(){return e.onAfterTableAlter()}),this.addHook("afterRemoveRow",function(){return e.onAfterTableAlter()}),this.addHook("afterCreateCol",function(){return e.onAfterTableAlter()}),this.addHook("afterRemoveCol",function(){return e.onAfterTableAlter()}),this.addHook("afterChange",function(t,n){return e.onAfterTableAlter(n)}),this.addHook("afterLoadData",function(t){return e.onAfterLoadData(t)}),$traceurRuntime.superGet(this,f.prototype,"enablePlugin").call(this))},disablePlugin:function(){this.observer&&(this.observer.destroy(),this.observer=null,this._deletePublicApi()),$traceurRuntime.superGet(this,f.prototype,"disablePlugin").call(this)},onDataChange:function(e){var t=this;if(!this.observer.isPaused()){var n={add:function(e){isNaN(e.col)?t.hot.runHooks("afterCreateRow",e.row):t.hot.runHooks("afterCreateCol",e.col)},remove:function(e){isNaN(e.col)?t.hot.runHooks("afterRemoveRow",e.row,1):t.hot.runHooks("afterRemoveCol",e.col,1)},replace:function(e){t.hot.runHooks("afterChange",[e.row,e.col,null,e.value],"external")}};c(e,function(e){n[e.op]&&n[e.op](e)}),this.hot.render()}this.hot.runHooks("afterChangesObserved")},onAfterTableAlter:function(e){var t=this;"loadData"!==e&&(this.observer.pause(),this.hot.addHookOnce("afterChangesObserved",function(){return t.observer.resume()}))},onAfterLoadData:function(e){e||this.observer.setObservedData(this.hot.getSourceData())},destroy:function(){this.observer&&(this.observer.destroy(),this._deletePublicApi()),$traceurRuntime.superGet(this,f.prototype,"destroy").call(this)},_exposePublicApi:function(){var e=this,t=this.hot;t.pauseObservingChanges=function(){return e.observer.pause()},t.resumeObservingChanges=function(){return e.observer.resume()},t.isPausedObservingChanges=function(){return e.observer.isPaused()}},_deletePublicApi:function(){var e=this.hot;delete e.pauseObservingChanges,delete e.resumeObservingChanges,delete e.isPausedObservingChanges}},{},l),d("observeChanges",h)},{_base:58,dataObserver:83,"helpers/array":42,jsonpatch:"jsonpatch",plugins:57}],85:[function(e,t,n){"use strict";function o(e){var t=[];return e=a(e,function(e){return/[\/]length/gi.test(e.path)?!1:r(e.path)?!0:!1}),e=l(e,function(e){var t=r(e.path);return e.row=t.row,e.col=t.col,e}),e=a(e,function(e){if(-1!==["add","remove"].indexOf(e.op)&&!isNaN(e.col)){if(-1!==t.indexOf(e.col))return!1;t.push(e.col)}return!0}),t.length=0,e}function r(e){var t=e.match(/^\/(\d+)\/?(.*)?$/);if(!t)return null;var n=t,o=n[1],r=n[2];return{row:parseInt(o,10),col:/^\d*$/.test(r)?parseInt(r,10):r}}Object.defineProperties(n,{cleanPatches:{get:function(){return o}},parsePath:{get:function(){return r}},__esModule:{value:!0}});var i,s=(i=e("../../helpers/array"),i&&i.__esModule&&i||{"default":i}),a=s.arrayFilter,l=s.arrayMap},{"../../helpers/array":42}],86:[function(e,t,n){"use strict";function o(e){var t,n=function(){window.localStorage[e+"__persistentStateKeys"]=JSON.stringify(t)},o=function(){var n=window.localStorage[e+"__persistentStateKeys"],o="string"==typeof n?JSON.parse(n):void 0;t=o?o:[]},r=function(){t=[],n()};o(),this.saveValue=function(o,r){window.localStorage[e+"_"+o]=JSON.stringify(r),-1==t.indexOf(o)&&(t.push(o),n())},this.loadValue=function(t,n){t="undefined"==typeof t?n:t;var o=window.localStorage[e+"_"+t];return"undefined"==typeof o?void 0:JSON.parse(o)},this.reset=function(t){window.localStorage.removeItem(e+"_"+t)},this.resetAll=function(){for(var n=0;na;a++)for(var l=0;i>l;l++){var u=e.getDataAtCell(a,l),c=e.getCellMeta(a,l),d=c.search.callback||n,h=c.search.queryMethod||o,f=h(t,u);if(f){var p={row:a,col:l,data:u};s.push(p)}d&&d(e,a,l,u,f)}return s}},Handsontable.Search.DEFAULT_CALLBACK=function(e,t,n,o,r){e.getCellMeta(t,n).isSearchResult=r},Handsontable.Search.DEFAULT_QUERY_METHOD=function(e,t){return"undefined"!=typeof e&&null!=e&&e.toLowerCase&&0!==e.length?"undefined"==typeof t||null==t?!1:-1!=t.toString().toLowerCase().indexOf(e.toLowerCase()):!1},Handsontable.Search.DEFAULT_SEARCH_RESULT_CLASS="htSearchResult",Handsontable.Search.global=function(){var e=Handsontable.Search.DEFAULT_CALLBACK,t=Handsontable.Search.DEFAULT_QUERY_METHOD,n=Handsontable.Search.DEFAULT_SEARCH_RESULT_CLASS;return{getDefaultCallback:function(){return e},setDefaultCallback:function(t){e=t},getDefaultQueryMethod:function(){return t},setDefaultQueryMethod:function(e){t=e},getDefaultSearchResultClass:function(){return n},setDefaultSearchResultClass:function(e){n=e}}}(),Handsontable.SearchCellDecorator=function(e,t,n,o,r,i,s){var u=null!==s.search&&"object"==typeof s.search&&s.search.searchResultClass||Handsontable.Search.global.getDefaultSearchResultClass();s.isSearchResult?a(t,u):l(t,u)};var h=d("base");c("base",function(e,t,n,o,r,i,s){h.apply(this,arguments),Handsontable.SearchCellDecorator.apply(this,arguments)}),Handsontable.hooks.add("afterInit",o),Handsontable.hooks.add("afterUpdateSettings",o)},{"helpers/dom/element":45,renderers:90}],88:[function(e,t,n){"use strict";Object.defineProperties(n,{TouchScroll:{get:function(){return d}},__esModule:{value:!0}});var o,r,i,s=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),a=s.addClass,l=s.removeClass,u=(r=e("_base"),r&&r.__esModule&&r||{"default":r})["default"],c=(i=e("plugins"),i&&i.__esModule&&i||{"default":i}).registerPlugin,d=function(e){var t=this;$traceurRuntime.superConstructor(h).call(this,e),this.hot.addHook("afterInit",function(){return t.afterInit()}),this.hot.addHook("afterUpdateSettings",function(){return t.onAfterUpdateSettings()}),this.scrollbars=[],this.clones=[]},h=d;$traceurRuntime.createClass(d,{afterInit:function(){this.registerEvents(),this.onAfterUpdateSettings()},onAfterUpdateSettings:function(){var e=this;this.hot.addHookOnce("afterRender",function(){var t=e.hot.view.wt.wtOverlays;e.scrollbars=[],e.scrollbars.push(t.topOverlay),t.bottomOverlay.clone&&e.scrollbars.push(t.bottomOverlay),e.scrollbars.push(t.leftOverlay),t.topLeftCornerOverlay&&e.scrollbars.push(t.topLeftCornerOverlay),t.bottomLeftCornerOverlay&&t.bottomLeftCornerOverlay.clone&&e.scrollbars.push(t.bottomLeftCornerOverlay),e.clones=[],t.topOverlay.needFullRender&&e.clones.push(t.topOverlay.clone.wtTable.holder.parentNode),t.bottomOverlay.needFullRender&&e.clones.push(t.bottomOverlay.clone.wtTable.holder.parentNode),t.leftOverlay.needFullRender&&e.clones.push(t.leftOverlay.clone.wtTable.holder.parentNode),t.topLeftCornerOverlay&&e.clones.push(t.topLeftCornerOverlay.clone.wtTable.holder.parentNode),t.bottomLeftCornerOverlay&&t.bottomLeftCornerOverlay.clone&&e.clones.push(t.bottomLeftCornerOverlay.clone.wtTable.holder.parentNode)})},registerEvents:function(){var e=this;this.hot.addHook("beforeTouchScroll",function(){return e.onBeforeTouchScroll()}),this.hot.addHook("afterMomentumScroll",function(){return e.onAfterMomentumScroll()})},onBeforeTouchScroll:function(){Handsontable.freezeOverlays=!0;for(var e=0,t=this.clones.length;t>e;e++)a(this.clones[e],"hide-tween")},onAfterMomentumScroll:function(){Handsontable.freezeOverlays=!1;for(var e=this,t=0,n=this.clones.length;n>t;t++)l(this.clones[t],"hide-tween");for(var o=0,r=this.clones.length;r>o;o++)a(this.clones[o],"show-tween");setTimeout(function(){for(var t=0,n=e.clones.length;n>t;t++)l(e.clones[t],"show-tween")},400);for(var i=0,s=this.scrollbars.length;s>i;i++)this.scrollbars[i].refresh(),this.scrollbars[i].resetFixedPosition();this.hot.view.wt.wtOverlays.syncScrollWithMaster()}},{},u),c("touchScroll",d)},{_base:58,"helpers/dom/element":45,plugins:57}],89:[function(e,t,n){"use strict";function o(){var e=this,t="undefined"==typeof e.getSettings().undo||e.getSettings().undo; -t?e.undoRedo||(e.undoRedo=new Handsontable.UndoRedo(e),s(e),e.addHook("beforeKeyDown",r),e.addHook("afterChange",i)):e.undoRedo&&(delete e.undoRedo,a(e),e.removeHook("beforeKeyDown",r),e.removeHook("afterChange",i))}function r(e){var t=this,n=(e.ctrlKey||e.metaKey)&&!e.altKey;n&&(89===e.keyCode||e.shiftKey&&90===e.keyCode?(t.undoRedo.redo(),f(e)):90===e.keyCode&&(t.undoRedo.undo(),f(e)))}function i(e,t){var n=this;return"loadData"==t?n.undoRedo.clear():void 0}function s(e){e.undo=function(){return e.undoRedo.undo()},e.redo=function(){return e.undoRedo.redo()},e.isUndoAvailable=function(){return e.undoRedo.isUndoAvailable()},e.isRedoAvailable=function(){return e.undoRedo.isRedoAvailable()},e.clearUndo=function(){return e.undoRedo.clear()}}function a(e){delete e.undo,delete e.redo,delete e.isUndoAvailable,delete e.isRedoAvailable,delete e.clearUndo}var l,u,c=(l=e("helpers/object"),l&&l.__esModule&&l||{"default":l}),d=c.inherit,h=c.deepClone,f=(u=e("helpers/dom/event"),u&&u.__esModule&&u||{"default":u}).stopImmediatePropagation;Handsontable.UndoRedo=function(e){var t=this;this.instance=e,this.doneActions=[],this.undoneActions=[],this.ignoreNewActions=!1,e.addHook("afterChange",function(e,n){if(e){var o=new Handsontable.UndoRedo.ChangeAction(e);t.done(o)}}),e.addHook("afterCreateRow",function(e,n,o){if(!o){var r=new Handsontable.UndoRedo.CreateRowAction(e,n);t.done(r)}}),e.addHook("beforeRemoveRow",function(e,n){var o=t.instance.getSourceData();e=(o.length+e)%o.length;var r=o.slice(e,e+n),i=new Handsontable.UndoRedo.RemoveRowAction(e,r);t.done(i)}),e.addHook("afterCreateCol",function(e,n,o){if(!o){var r=new Handsontable.UndoRedo.CreateColumnAction(e,n);t.done(r)}}),e.addHook("beforeRemoveCol",function(n,o){var r=t.instance.getSourceData();n=(t.instance.countCols()+n)%t.instance.countCols();for(var i=[],s=0,a=r.length;a>s;s++)i[s]=r[s].slice(n,n+o);var l;Array.isArray(e.getSettings().colHeaders)&&(l=e.getSettings().colHeaders.slice(n,n+i.length));var u=new Handsontable.UndoRedo.RemoveColumnAction(n,i,l);t.done(u)}),e.addHook("beforeCellAlignment",function(e,n,o,r){var i=new Handsontable.UndoRedo.CellAlignmentAction(e,n,o,r);t.done(i)})},Handsontable.UndoRedo.prototype.done=function(e){this.ignoreNewActions||(this.doneActions.push(e),this.undoneActions.length=0)},Handsontable.UndoRedo.prototype.undo=function(){if(this.isUndoAvailable()){var e=this.doneActions.pop();this.ignoreNewActions=!0;var t=this;e.undo(this.instance,function(){t.ignoreNewActions=!1,t.undoneActions.push(e)})}},Handsontable.UndoRedo.prototype.redo=function(){if(this.isRedoAvailable()){var e=this.undoneActions.pop();this.ignoreNewActions=!0;var t=this;e.redo(this.instance,function(){t.ignoreNewActions=!1,t.doneActions.push(e)})}},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(e){this.changes=e},d(Handsontable.UndoRedo.ChangeAction,Handsontable.UndoRedo.Action),Handsontable.UndoRedo.ChangeAction.prototype.undo=function(e,t){for(var n=h(this.changes),o=e.countEmptyRows(!0),r=e.countEmptyCols(!0),i=0,s=n.length;s>i;i++)n[i].splice(3,1);e.addHookOnce("afterChange",t),e.setDataAtRowProp(n,null,null,"undo");for(var i=0,s=n.length;s>i;i++)e.getSettings().minSpareRows&&n[i][0]+1+e.getSettings().minSpareRows===e.countRows()&&o==e.getSettings().minSpareRows&&(e.alter("remove_row",parseInt(n[i][0]+1,10),e.getSettings().minSpareRows),e.undoRedo.doneActions.pop()),e.getSettings().minSpareCols&&n[i][1]+1+e.getSettings().minSpareCols===e.countCols()&&r==e.getSettings().minSpareCols&&(e.alter("remove_col",parseInt(n[i][1]+1,10),e.getSettings().minSpareCols),e.undoRedo.doneActions.pop())},Handsontable.UndoRedo.ChangeAction.prototype.redo=function(e,t){for(var n=h(this.changes),o=0,r=n.length;r>o;o++)n[o].splice(2,1);e.addHookOnce("afterChange",t),e.setDataAtRowProp(n,null,null,"redo")},Handsontable.UndoRedo.CreateRowAction=function(e,t){this.index=e,this.amount=t},d(Handsontable.UndoRedo.CreateRowAction,Handsontable.UndoRedo.Action),Handsontable.UndoRedo.CreateRowAction.prototype.undo=function(e,t){var n=e.countRows(),o=e.getSettings().minSpareRows;this.index>=n&&this.index-or;r++)n=e.getSourceDataAtRow(r),o=[this.index,0],Array.prototype.push.apply(o,this.data[r]),Array.prototype.splice.apply(n,o);"undefined"!=typeof this.headers&&(o=[this.index,0],Array.prototype.push.apply(o,this.headers),Array.prototype.splice.apply(e.getSettings().colHeaders,o)),e.addHookOnce("afterRender",t),e.render()},Handsontable.UndoRedo.RemoveColumnAction.prototype.redo=function(e,t){e.addHookOnce("afterRemoveCol",t),e.alter("remove_col",this.index,this.amount)},Handsontable.hooks.add("afterInit",o),Handsontable.hooks.add("afterUpdateSettings",o)},{"helpers/dom/event":46,"helpers/object":50}],90:[function(e,t,n){"use strict";function o(e,t){var n;l[e]=t,n=a(e)+"Renderer",Handsontable.renderers[n]=t,Handsontable[n]=t}function r(e){if("function"==typeof e)return e;if("string"!=typeof e)throw Error('Only strings and functions can be passed as "renderer" parameter');if(!(e in l))throw Error('No editor registered under name "'+e+'"');return l[e]}function i(e){return e in l}Object.defineProperties(n,{registerRenderer:{get:function(){return o}},getRenderer:{get:function(){return r}},hasRenderer:{get:function(){return i}},__esModule:{value:!0}});var s,a=(s=e("helpers/string"),s&&s.__esModule&&s||{"default":s}).toUpperCaseFirst,l={};Handsontable.renderers=Handsontable.renderers||{},Handsontable.renderers.registerRenderer=o,Handsontable.renderers.getRenderer=r},{"helpers/string":52}],91:[function(e,t,n){"use strict";function o(e,t,n,o,r,i,s){s.className&&(t.className?t.className=t.className+" "+s.className:t.className=s.className),s.readOnly&&a(t,s.readOnlyCellClassName),s.valid===!1&&s.invalidCellClassName?a(t,s.invalidCellClassName):l(t,s.invalidCellClassName),s.wordWrap===!1&&s.noWordWrapClassName&&a(t,s.noWordWrapClassName),!i&&s.placeholder&&a(t,s.placeholderCellClassName)}Object.defineProperties(n,{cellDecorator:{get:function(){return o}},__esModule:{value:!0}});var r,i,s=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),a=s.addClass,l=s.removeClass,u=(i=e("renderers"),i&&i.__esModule&&i||{"default":i}).registerRenderer;u("base",o),Handsontable.renderers.cellDecorator=o},{"helpers/dom/element":45,renderers:90}],92:[function(e,t,n){"use strict";function o(e,t,n,o,r,i,s){var a=(m.cloneNode(!0),v.cloneNode(!0));if(f("text")(e,t,n,o,r,i,s),t.appendChild(a),u(t,"htAutocomplete"),t.firstChild||t.appendChild(document.createTextNode(String.fromCharCode(160))),!e.acArrowListener){var l=d(e);e.acArrowListener=function(r){c(r.target,"htAutocompleteArrow")&&e.view.wt.getSetting("onCellDblClick",null,new g(n,o),t)},l.addEventListener(e.rootElement,"mousedown",e.acArrowListener),e.addHookOnce("afterDestroy",function(){l.destroy()})}}Object.defineProperties(n,{autocompleteRenderer:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,a,l=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),u=l.addClass,c=l.hasClass,d=(l.empty,(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager),h=(s=e("renderers"),s&&s.__esModule&&s||{"default":s}),f=h.getRenderer,p=h.registerRenderer,g=(a=e("3rdparty/walkontable/src/cell/coords"),a&&a.__esModule&&a||{"default":a}).WalkontableCellCoords,m=document.createElement("DIV");m.className="htAutocompleteWrapper";var v=document.createElement("DIV");v.className="htAutocompleteArrow",v.appendChild(document.createTextNode(String.fromCharCode(9660)));p("autocomplete",o)},{"3rdparty/walkontable/src/cell/coords":5,eventManager:41,"helpers/dom/element":45,renderers:90}],93:[function(e,t,n){"use strict";function o(e,t,n,o,a,l,u){function c(e){var t=[C.SPACE,C.ENTER,C.DELETE,C.BACKSPACE];-1===t.indexOf(e.keyCode)||E(e)||f(function(){S(e),e.preventDefault()}),(e.keyCode==C.SPACE||e.keyCode==C.ENTER)&&d(),(e.keyCode==C.DELETE||e.keyCode==C.BACKSPACE)&&d(!1)}function d(){var e=void 0!==arguments[0]?arguments[0]:null;f(function(t){for(var n=0,o=t.length;o>n;n++){if(m(t[n],M)&&null===e)return;h(t[n],e)}})}function h(e){var t=void 0!==arguments[1]?arguments[1]:null;null===t?e.checked=!e.checked:e.checked=t,y.fireEvent(e,"change")}function f(t){for(var n=e.getSelectedRange(),o=n.getTopLeftCorner(),r=n.getBottomRightCorner(),i=o.row;i<=r.row;i++)for(var s=o.col;s<=r.col;s++){var a=e.getCell(i,s),l=e.getCellMeta(i,s),u=a.querySelectorAll("input[type=checkbox]");u.length>0&&!l.readOnly&&t(u)}}var y=new w(e),b=r(),R=u.label,O=!1;if("undefined"==typeof u.checkedTemplate&&(u.checkedTemplate=!0),"undefined"==typeof u.uncheckedTemplate&&(u.uncheckedTemplate=!1),p(t),l===u.checkedTemplate||v(l,u.checkedTemplate)?b.checked=!0:l===u.uncheckedTemplate||v(l,u.uncheckedTemplate)?b.checked=!1:null===l?g(b,"noValue"):(b.style.display="none",g(b,M),O=!0),!O&&R){var k="";R.value?k="function"==typeof R.value?R.value.call(this,n,o,a,l):R.value:R.property&&(k=e.getDataAtRowProp(n,R.property));var H=i(k);"before"===R.position?H.appendChild(b):H.insertBefore(b,H.firstChild),b=H}t.appendChild(b),O&&t.appendChild(document.createTextNode("#bad-value#")),u.readOnly?y.addEventListener(b,"click",s):(y.addEventListener(b,"mousedown",_),y.addEventListener(b,"mouseup",_),y.addEventListener(b,"change",function(t){e.setDataAtRowProp(n,a,t.target.checked?u.checkedTemplate:u.uncheckedTemplate)})),T.has(e)||(T.set(e,!0),e.addHook("beforeKeyDown",c))}function r(){var e=document.createElement("input");return e.className="htCheckboxRendererInput",e.type="checkbox",e.setAttribute("autocomplete","off"),e.cloneNode(!1)}function i(e){var t=document.createElement("label");return t.className="htCheckboxRendererLabel",t.appendChild(document.createTextNode(e)),t.cloneNode(!0)}function s(e){e.preventDefault()}Object.defineProperties(n,{checkboxRenderer:{get:function(){return o}},__esModule:{value:!0}});var a,l,u,c,d,h,f=(a=e("helpers/dom/element"),a&&a.__esModule&&a||{"default":a}),p=f.empty,g=f.addClass,m=f.hasClass,v=(l=e("helpers/string"),l&&l.__esModule&&l||{"default":l}).equalsIgnoreCase,w=(u=e("eventManager"),u&&u.__esModule&&u||{"default":u}).EventManager,y=(c=e("renderers"),c&&c.__esModule&&c||{"default":c}),b=(y.getRenderer,y.registerRenderer),C=(d=e("helpers/unicode"),d&&d.__esModule&&d||{"default":d}).KEY_CODES,R=(h=e("helpers/dom/event"),h&&h.__esModule&&h||{"default":h}),_=R.stopPropagation,S=R.stopImmediatePropagation,E=R.isImmediatePropagationStopped,T=new WeakMap,M="htBadValue";b("checkbox",o)},{eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/string":52,"helpers/unicode":53,renderers:90}],94:[function(e,t,n){"use strict";function o(e,t,n,o,r,i,a){l("base").apply(this,arguments),(null===i||void 0===i)&&(i=""),s(t,i)}Object.defineProperties(n,{htmlRenderer:{get:function(){return o}},__esModule:{value:!0}});var r,i,s=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}).fastInnerHTML,a=(i=e("renderers"),i&&i.__esModule&&i||{"default":i}),l=a.getRenderer,u=a.registerRenderer;u("html",o)},{"helpers/dom/element":45,renderers:90}],95:[function(e,t,n){"use strict";function o(e,t,n,o,r,i,s){f(i)&&("undefined"!=typeof s.language&&l.language(s.language),i=l(i).format(s.format||"0"),u(t,"htNumeric")),d("text")(e,t,n,o,r,i,s)}Object.defineProperties(n,{numericRenderer:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,a,l=(r=e("numeral"),r&&r.__esModule&&r||{"default":r})["default"],u=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}).addClass,c=(s=e("renderers"),s&&s.__esModule&&s||{"default":s}),d=c.getRenderer,h=c.registerRenderer,f=(a=e("helpers/number"),a&&a.__esModule&&a||{"default":a}).isNumeric;h("numeric",o)},{"helpers/dom/element":45,"helpers/number":49,numeral:"numeral",renderers:90}],96:[function(e,t,n){"use strict";function o(e,t,n,o,r,i,a){l("text").apply(this,arguments),i=t.innerHTML;var u,c=a.hashLength||i.length,d=a.hashSymbol||"*";for(u="";u.split(d).length-13?("function"==typeof o&&(e.__proto__=o),e.prototype=d(a(o),i(t))):e.prototype=t,f(e,"prototype",{configurable:!1,writable:!1}),h(e,i(n))}function a(e){if("function"==typeof e){var t=e.prototype;if(u(t)===t||null===t)return e.prototype;throw new c("super prototype must be an Object or null")}if(null===e)return null;throw new c("Super expression must either be null or a function, not "+typeof e+".")}function l(e,t,o){null!==g(t)&&n(e,t,"constructor",o)}var u=Object,c=TypeError,d=u.create,h=$traceurRuntime.defineProperties,f=$traceurRuntime.defineProperty,p=$traceurRuntime.getOwnPropertyDescriptor,g=Object.getPrototypeOf,m=$traceurRuntime.toProperty,v=Object,w=v.getOwnPropertyNames,y=v.getOwnPropertySymbols;$traceurRuntime.createClass=s,$traceurRuntime.defaultSuperCall=l,$traceurRuntime.superCall=n,$traceurRuntime.superConstructor=t,$traceurRuntime.superGet=o,$traceurRuntime.superSet=r}()},{}],99:[function(e,t,n){"use strict";function o(e){var t=this,n=this;this.eventManager=b(e),this.instance=e,this.settings=e.getSettings(),this.selectionMouseDown=!1;var o=e.rootElement.getAttribute("style");o&&e.rootElement.setAttribute("data-originalstyle",o),d(e.rootElement,"handsontable");var r=document.createElement("TABLE");d(r,"htCore"),e.getSettings().tableClassName&&d(r,e.getSettings().tableClassName),this.THEAD=document.createElement("THEAD"),r.appendChild(this.THEAD),this.TBODY=document.createElement("TBODY"),r.appendChild(this.TBODY),e.table=r,e.container.insertBefore(r,e.container.firstChild),this.eventManager.addEventListener(e.rootElement,"mousedown",function(e){this.selectionMouseDown=!0,n.isTextSelectionAllowed(e.target)||(s(),e.preventDefault(),window.focus())}),this.eventManager.addEventListener(e.rootElement,"mouseup",function(e){this.selectionMouseDown=!1}),this.eventManager.addEventListener(e.rootElement,"mousemove",function(e){this.selectionMouseDown&&!n.isTextSelectionAllowed(e.target)&&(s(),e.preventDefault())}),this.eventManager.addEventListener(document.documentElement,"keyup",function(t){e.selection.isInProgress()&&!t.shiftKey&&e.selection.finish()});var i;this.isMouseDown=function(){return i},this.eventManager.addEventListener(document.documentElement,"mouseup",function(t){e.selection.isInProgress()&&1===t.which&&e.selection.finish(),i=!1,y(document.activeElement)&&e.unlisten()}),this.eventManager.addEventListener(document.documentElement,"mousedown",function(t){var o=t.target,r=t.x||t.clientX,s=t.y||t.clientY;if(!i&&e.rootElement){if(o===e.view.wt.wtTable.holder){var a=g();if(document.elementFromPoint(r+a,s)!==e.view.wt.wtTable.holder||document.elementFromPoint(r,s+a)!==e.view.wt.wtTable.holder)return}else for(;o!==document.documentElement;){if(null===o){if(t.isTargetWebComponent)break;return}if(o===e.rootElement)return;o=o.parentNode}n.settings.outsideClickDeselects?e.deselectCell():e.destroyEditor()}}),this.eventManager.addEventListener(r,"selectstart",function(e){n.settings.fragmentSelection||w(e.target)||e.preventDefault()});var s=function(){window.getSelection?window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges():document.selection&&document.selection.empty()},a=[new E({className:"current",border:{width:2,color:"#5292F7",cornerVisible:function(){return n.settings.fillHandle&&!n.isCellEdited()&&!e.selection.isMultiple()},multipleSelectionHandlesVisible:function(){return!n.isCellEdited()&&!e.selection.isMultiple()}}}),new E({className:"area",border:{width:1,color:"#89AFF9",cornerVisible:function(){return n.settings.fillHandle&&!n.isCellEdited()&&e.selection.isMultiple()},multipleSelectionHandlesVisible:function(){return!n.isCellEdited()&&e.selection.isMultiple()}}}),new E({className:"highlight",highlightRowClassName:n.settings.currentRowClassName,highlightColumnClassName:n.settings.currentColClassName}),new E({className:"fill",border:{width:1,color:"red"}})];a.current=a[0],a.area=a[1],a.highlight=a[2],a.fill=a[3];var l={debug:function(){return n.settings.debug},externalRowCalculator:this.instance.getPlugin("autoRowSize")&&this.instance.getPlugin("autoRowSize").isEnabled(),table:r,preventOverflow:function(){return t.settings.preventOverflow},stretchH:this.settings.stretchH,data:e.getDataAtCell,totalRows:function(){return e.countRows()},totalColumns:function(){return e.countCols()},fixedColumnsLeft:function(){return n.settings.fixedColumnsLeft},fixedRowsTop:function(){return n.settings.fixedRowsTop},fixedRowsBottom:function(){return n.settings.fixedRowsBottom},minSpareRows:function(){return n.settings.minSpareRows},renderAllRows:n.settings.renderAllRows,rowHeaders:function(){var t=[];return e.hasRowHeaders()&&t.push(function(e,t){n.appendRowHeader(e,t)}),Handsontable.hooks.run(e,"afterGetRowHeaderRenderers",t),t},columnHeaders:function(){var t=[];return e.hasColHeaders()&&t.push(function(e,t){n.appendColHeader(e,t)}),Handsontable.hooks.run(e,"afterGetColumnHeaderRenderers",t),t},columnWidth:e.getColWidth,rowHeight:e.getRowHeight,cellRenderer:function(e,t,o){var r=n.instance.colToProp(t),i=n.instance.getCellMeta(e,t),s=n.instance.getCellRenderer(i),a=n.instance.getDataAtRowProp(e,r);s(n.instance,o,e,t,r,a,i),Handsontable.hooks.run(n.instance,"afterRenderer",o,e,t,r,a,i)},selections:a,hideBorderOnMouseDownOver:function(){return n.settings.fragmentSelection},onCellMouseDown:function(t,o,r,s){var a,l,u=r.parentNode,c=u.parentNode;if(e.listen(),n.activeWt=s,i=!0,Handsontable.hooks.run(e,"beforeOnCellMouseDown",t,o,r),e.selection.setSelectedHeaders(!1,!1),!_(t)){if(2===t.button&&e.selection.inInSelection(o));else t.shiftKey?o.row>=0&&o.col>=0&&e.selection.setRangeEnd(o):(o.row<0||o.col<0)&&(o.row>=0||o.col>=0)?(o.row<0&&(a=c.childNodes.length-Array.prototype.indexOf.call(c.childNodes,u)-1,l=e.getHeaderColspan(o.col,a),e.selection.setSelectedHeaders(!1,!0),e.selectCell(0,o.col,e.countRows()-1,o.col+Math.max(0,l-1))),o.col<0&&(e.selection.setSelectedHeaders(!0,!1),e.selectCell(o.row,0,o.row,e.countCols()-1))):(o.row=o.row<0?0:o.row,o.col=o.col<0?0:o.col,e.selection.setRangeStart(o));Handsontable.hooks.run(e,"afterOnCellMouseDown",t,o,r),n.activeWt=n.wt}},onCellMouseOver:function(t,o,r,s){n.activeWt=s,o.row>=0&&o.col>=0?i&&e.selection.setRangeEnd(o):i&&(o.row<0&&(e.selection.selectedHeader.cols?(e.selection.setRangeEnd(new S(e.countRows()-1,o.col)),e.selection.setSelectedHeaders(!1,!0)):e.selection.setRangeEnd(new S(o.row,o.col))),o.col<0&&(e.selection.selectedHeader.rows?(e.selection.setRangeEnd(new S(o.row,e.countCols()-1)),e.selection.setSelectedHeaders(!0,!1)):e.selection.setRangeEnd(new S(o.row,o.col)))),Handsontable.hooks.run(e,"afterOnCellMouseOver",t,o,r),n.activeWt=n.wt},onCellCornerMouseDown:function(t){t.preventDefault(),Handsontable.hooks.run(e,"afterOnCellCornerMouseDown",t)},beforeDraw:function(e){n.beforeRender(e)},onDraw:function(e){n.onDraw(e)},onScrollVertically:function(){e.runHooks("afterScrollVertically")},onScrollHorizontally:function(){e.runHooks("afterScrollHorizontally")},onBeforeDrawBorders:function(t,n){e.runHooks("beforeDrawBorders",t,n)},onBeforeTouchScroll:function(){e.runHooks("beforeTouchScroll")},onAfterMomentumScroll:function(){e.runHooks("afterMomentumScroll")},onBeforeStretchingColumnWidth:function(t,n){return e.runHooks("beforeStretchingColumnWidth",t,n)},viewportRowCalculatorOverride:function(t){var o=e.countRows(),r=n.settings.viewportRowRenderingOffset;if("auto"===r&&n.settings.fixedRowsTop&&(r=10),"number"==typeof r&&(t.startRow=Math.max(t.startRow-r,0),t.endRow=Math.min(t.endRow+r,o-1)),"auto"===r){var i=t.startRow+t.endRow-t.startRow,s=Math.ceil(i/o*12);t.startRow=Math.max(t.startRow-s,0),t.endRow=Math.min(t.endRow+s,o-1)}e.runHooks("afterViewportRowCalculatorOverride",t)},viewportColumnCalculatorOverride:function(t){var o=e.countCols(),r=n.settings.viewportColumnRenderingOffset;if("auto"===r&&n.settings.fixedColumnsLeft&&(r=10),"number"==typeof r&&(t.startColumn=Math.max(t.startColumn-r,0),t.endColumn=Math.min(t.endColumn+r,o-1)),"auto"===r){var i=t.startColumn+t.endColumn-t.startColumn,s=Math.ceil(i/o*12);t.startRow=Math.max(t.startColumn-s,0),t.endColumn=Math.min(t.endColumn+s,o-1)}e.runHooks("afterViewportColumnCalculatorOverride",t)},rowHeaderWidth:function(){return n.settings.rowHeaderWidth},columnHeaderHeight:function(){return n.settings.columnHeaderHeight}};Handsontable.hooks.run(e,"beforeInitWalkontable",l),this.wt=new T(l),this.activeWt=this.wt,this.eventManager.addEventListener(n.wt.wtTable.spreader,"mousedown",function(e){e.target===n.wt.wtTable.spreader&&3===e.which&&R(e)}),this.eventManager.addEventListener(n.wt.wtTable.spreader,"contextmenu",function(e){e.target===n.wt.wtTable.spreader&&3===e.which&&R(e)}),this.eventManager.addEventListener(document.documentElement,"click",function(){n.settings.observeDOMVisibility&&n.wt.drawInterrupted&&(n.instance.forceFullRender=!0,n.render())})}Object.defineProperties(n,{TableView:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,a,l,u,c=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),d=c.addClass,h=c.empty,f=c.fastInnerHTML,p=c.fastInnerText,g=c.getScrollbarWidth,m=c.hasClass,v=c.isChildOf,w=c.isInput,y=c.isOutsideInput,b=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager,C=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),R=C.stopPropagation,_=C.isImmediatePropagationStopped,S=(a=e("3rdparty/walkontable/src/cell/coords"),a&&a.__esModule&&a||{"default":a}).WalkontableCellCoords,E=(l=e("3rdparty/walkontable/src/selection"),l&&l.__esModule&&l||{"default":l}).WalkontableSelection,T=(u=e("3rdparty/walkontable/src/core"),u&&u.__esModule&&u||{"default":u}).Walkontable;Handsontable.TableView=o,o.prototype.isTextSelectionAllowed=function(e){if(w(e))return!0;var t=v(e,this.instance.view.wt.wtTable.spreader);return this.settings.fragmentSelection===!0&&t?!0:"cell"===this.settings.fragmentSelection&&this.isSelectedOnlyCell()&&t?!0:!1},o.prototype.isSelectedOnlyCell=function(){var e=this.instance.getSelected()||[],t=e[0],n=e[1],o=e[2],r=e[3];return void 0!==t&&t===o&&n===r},o.prototype.isCellEdited=function(){var e=this.instance.getActiveEditor();return e&&e.isOpened()},o.prototype.beforeRender=function(e){e&&Handsontable.hooks.run(this.instance,"beforeRender",this.instance.forceFullRender)},o.prototype.onDraw=function(e){e&&Handsontable.hooks.run(this.instance,"afterRender",this.instance.forceFullRender)},o.prototype.render=function(){this.wt.draw(!this.instance.forceFullRender),this.instance.forceFullRender=!1,this.instance.renderCall=!1},o.prototype.getCellAtCoords=function(e,t){var n=this.wt.getCell(e,t);return 0>n?null:n},o.prototype.scrollViewport=function(e){this.wt.scrollViewport(e)},o.prototype.appendRowHeader=function(e,t){if(t.firstChild){var n=t.firstChild;if(!m(n,"relative"))return h(t),void this.appendRowHeader(e,t);this.updateCellHeader(n.querySelector(".rowHeader"),e,this.instance.getRowHeader)}else{var o=document.createElement("div"),r=document.createElement("span");o.className="relative",r.className="rowHeader",this.updateCellHeader(r,e,this.instance.getRowHeader),o.appendChild(r),t.appendChild(o)}Handsontable.hooks.run(this.instance,"afterGetRowHeader",e,t)},o.prototype.appendColHeader=function(e,t){if(t.firstChild){var n=t.firstChild;m(n,"relative")?this.updateCellHeader(n.querySelector(".colHeader"),e,this.instance.getColHeader):(h(t),this.appendColHeader(e,t))}else{var o=document.createElement("div"),r=document.createElement("span");o.className="relative",r.className="colHeader",this.updateCellHeader(r,e,this.instance.getColHeader),o.appendChild(r),t.appendChild(o)}Handsontable.hooks.run(this.instance,"afterGetColHeader",e,t); -},o.prototype.updateCellHeader=function(e,t,n){t>-1?f(e,n(t)):(p(e,String.fromCharCode(160)),d(e,"cornerHeader"))},o.prototype.maximumVisibleElementWidth=function(e){var t=this.wt.wtViewport.getWorkspaceWidth(),n=t-e;return n>0?n:0},o.prototype.maximumVisibleElementHeight=function(e){var t=this.wt.wtViewport.getWorkspaceHeight(),n=t-e;return n>0?n:0},o.prototype.mainViewIsActive=function(){return this.wt===this.activeWt},o.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}],100:[function(e,t,n){"use strict";Object.defineProperties(n,{GhostTable:{get:function(){return f}},__esModule:{value:!0}});var o,r,i,s,a,l=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),u=l.addClass,c=l.outerHeight,d=l.outerWidth,h=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}).arrayEach,f=((i=e("helpers/object"),i&&i.__esModule&&i||{"default":i}).objectEach,(s=e("helpers/number"),s&&s.__esModule&&s||{"default":s}).rangeEach,(a=e("helpers/mixed"),a&&a.__esModule&&a||{"default":a}).stringify,function(e){this.hot=e,this.container=null,this.injected=!1,this.rows=[],this.columns=[],this.samples=null});$traceurRuntime.createClass(f,{addRow:function(e,t){if(this.columns.length)throw new Error("Doesn't support multi-dimensional table");this.rows.length||(this.container=this.createContainer(this.hot.rootElement.className));var n={row:e};this.rows.push(n),this.samples=t,this.table=this.createTable(this.hot.table.className),this.table.colGroup.appendChild(this.createColGroupsCol()),this.table.tr.appendChild(this.createRow(e)),this.container.container.appendChild(this.table.fragment),n.table=this.table.table},addColumn:function(e,t){if(this.rows.length)throw new Error("Doesn't support multi-dimensional table");this.columns.length||(this.container=this.createContainer(this.hot.rootElement.className));var n={col:e};this.columns.push(n),this.samples=t,this.table=this.createTable(this.hot.table.className),null!==this.hot.getColHeader(e)&&this.hot.view.appendColHeader(e,this.table.th),this.table.tBody.appendChild(this.createCol(e)),this.container.container.appendChild(this.table.fragment),n.table=this.table.table},getHeights:function(e){this.injected||this.injectTable(),h(this.rows,function(t){e(t.row,c(t.table)-1)})},getWidths:function(e){this.injected||this.injectTable(),h(this.columns,function(t){e(t.col,d(t.table))})},createColGroupsCol:function(){var e=this,t=document,n=t.createDocumentFragment();return n.appendChild(this.createColElement(-1)),this.samples.forEach(function(t){h(t.strings,function(t){n.appendChild(e.createColElement(t.col))})}),n},createRow:function(e){var t=this,n=document,o=n.createDocumentFragment(),r=n.createElement("th");return null!==this.hot.getRowHeader(e)&&this.hot.view.appendRowHeader(e,r),o.appendChild(r),this.samples.forEach(function(r){h(r.strings,function(r){var i=r.col,s=t.hot.getCellMeta(e,i);s.col=i,s.row=e;var a=t.hot.getCellRenderer(s),l=n.createElement("td");a(t.hot,l,e,i,t.hot.colToProp(i),r.value,s),o.appendChild(l)})}),o},createCol:function(e){var t=this,n=document,o=n.createDocumentFragment();return this.samples.forEach(function(r){h(r.strings,function(r){var i=r.row,s=t.hot.getCellMeta(i,e);s.col=e,s.row=i;var a=t.hot.getCellRenderer(s),l=n.createElement("td"),u=n.createElement("tr");a(t.hot,l,i,e,t.hot.colToProp(e),r.value,s),u.appendChild(l),o.appendChild(u)})}),o},clean:function(){this.rows.length=0,this.columns.length=0,this.samples&&this.samples.clear(),this.samples=null,this.removeTable()},injectTable:function(){var e=void 0!==arguments[0]?arguments[0]:null;this.injected||((e||this.hot.rootElement).appendChild(this.container.fragment),this.injected=!0)},removeTable:function(){this.injected&&this.container.container.parentNode&&(this.container.container.parentNode.removeChild(this.container.container),this.container=null,this.injected=!1)},createColElement:function(e){var t=document,n=t.createElement("col");return n.style.width=this.hot.view.wt.wtTable.getStretchedColumnWidth(e)+"px",n},createTable:function(){var e=void 0!==arguments[0]?arguments[0]:"",t=document,n=t.createDocumentFragment(),o=t.createElement("table"),r=t.createElement("thead"),i=t.createElement("tbody"),s=t.createElement("colgroup"),a=t.createElement("tr"),l=t.createElement("th");return this.isVertical()&&o.appendChild(s),this.isHorizontal()&&(a.appendChild(l),r.appendChild(a),o.style.tableLayout="auto",o.style.width="auto"),o.appendChild(r),this.isVertical()&&i.appendChild(a),o.appendChild(i),u(o,e),n.appendChild(o),{fragment:n,table:o,tHead:r,tBody:i,colGroup:s,tr:a,th:l}},createContainer:function(){var e=void 0!==arguments[0]?arguments[0]:"",t=document,n=t.createDocumentFragment(),o=t.createElement("div");return e="htGhostTable htAutoSize "+e.trim(),u(o,e),n.appendChild(o),{fragment:n,container:o}},isVertical:function(){return this.rows.length&&!this.columns.length?!0:!1},isHorizontal:function(){return this.columns.length&&!this.rows.length?!0:!1}},{}),Handsontable.utils=Handsontable.utils||{},Handsontable.utils.GhostTable=f},{"helpers/array":42,"helpers/dom/element":45,"helpers/mixed":48,"helpers/number":49,"helpers/object":50}],101:[function(e,t,n){"use strict";var o;Object.defineProperties(n,{SamplesGenerator:{get:function(){return p}},__esModule:{value:!0}});var r,i,s,a,l,u=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),c=(u.addClass,u.outerHeight,u.outerWidth,(i=e("helpers/array"),i&&i.__esModule&&i||{"default":i}).arrayEach,s=e("helpers/object"),s&&s.__esModule&&s||{"default":s}),d=(c.objectEach,c.isObject),h=(a=e("helpers/number"),a&&a.__esModule&&a||{"default":a}).rangeEach,f=(l=e("helpers/mixed"),l&&l.__esModule&&l||{"default":l}).stringify,p=function(e){this.samples=null,this.dataFactory=e,this.customSampleCount=null},g=p;$traceurRuntime.createClass(p,(o={},Object.defineProperty(o,"getSampleCount",{value:function(){return this.customSampleCount?this.customSampleCount:g.SAMPLE_COUNT},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(o,"generateRowSamples",{value:function(e,t){return this.generateSamples("row",t,e)},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(o,"generateColumnSamples",{value:function(e,t){return this.generateSamples("col",t,e)},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(o,"generateSamples",{value:function(e,t,n){var o=this,r=new Map;return"number"==typeof n&&(n={from:n,to:n}),h(n.from,n.to,function(n){var i=o.generateSample(e,t,n);r.set(n,i)}),r},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(o,"generateSample",{value:function(e,t,n){var o,r=this,i=new Map,s=[];return h(t.from,t.to,function(t){var a,l;if("row"===e)l=r.dataFactory(n,t);else{if("col"!==e)throw new Error("Unsupported sample type");l=r.dataFactory(t,n)}o=d(l)?Object.keys(l).length:Array.isArray(l)?l.length:f(l).length,i.has(o)||i.set(o,{needed:r.getSampleCount(),strings:[]});var u=i.get(o);if(u.needed){var c=s.indexOf(l)>-1;if(!c){var h="row"===e?"col":"row";u.strings.push((a={},Object.defineProperty(a,"value",{value:l,configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(a,h,{value:t,configurable:!0,enumerable:!0,writable:!0}),a)),s.push(l),u.needed--}}}),i},configurable:!0,enumerable:!0,writable:!0}),o),{get SAMPLE_COUNT(){return 3}}),Handsontable.utils=Handsontable.utils||{},Handsontable.utils.SamplesGenerator=p},{"helpers/array":42,"helpers/dom/element":45,"helpers/mixed":48,"helpers/number":49,"helpers/object":50}],102:[function(e,t,n){"use strict";function o(e,t){var n=e,o="string"==typeof n?n.toLowerCase():null;return function(e){for(var r=!1,s=0,a=e.length;a>s;s++){if(n===e[s]){r=!0;break}if(o===i(e[s]).toLowerCase()){r=!0;break}}t(r)}}var r,i=(r=e("helpers/mixed"),r&&r.__esModule&&r||{"default":r}).stringify;Handsontable.AutocompleteValidator=function(e,t){this.strict&&this.source?"function"==typeof this.source?this.source(e,o(e,t)):o(e,t)(this.source):t(!0)}},{"helpers/mixed":48}],103:[function(e,t,n){"use strict";var o,r,i=(o=e("moment"),o&&o.__esModule&&o||{"default":o})["default"],s=(r=e("editors"),r&&r.__esModule&&r||{"default":r}).getEditor;Handsontable.DateValidator=function(e,t){var n=!0,o=s("date",this.instance);null==e&&(e="");var r=i(new Date(e)).isValid(),l=i(e,this.dateFormat||o.defaultDateFormat,!0).isValid();if(this.allowEmpty&&""===e&&(r=!0,l=!0),r||(n=!1),!r&&l&&(n=!0),r&&!l)if(this.correctFormat===!0){var u=a(e,this.dateFormat);this.instance.setDataAtCell(this.row,this.col,u,"dateValidator"),n=!0}else n=!1;t(n)};var a=function(e,t){var n=i(new Date(e)),o=n.format("YYYY"),r=i().format("YYYY");return o.substr(0,2)!==r.substr(0,2)?e.match(new RegExp(o))||n.year(o.replace(o.substr(0,2),r.substr(0,2))):o.length>4&&n.year((n.year()+"").substr(0,4)),n.format(t)}},{editors:29,moment:"moment"}],104:[function(e,t,n){"use strict";Handsontable.NumericValidator=function(e,t){null==e&&(e=""),t(this.allowEmpty&&""===e?!0:""===e?!1:/^-?\d*(\.|\,)?\d*$/.test(e))}},{}],SheetClip:[function(e,t,n){"use strict";!function(e){function t(e){return e.split('"').length-1}var o={parse:function(e){var n,o,r,i,s,a,l,u=[],c=0;for(r=e.split("\n"),r.length>1&&""===r[r.length-1]&&r.pop(),n=0,o=r.length;o>n;n+=1){for(r[n]=r[n].split(" "),i=0,s=r[n].length;s>i;i+=1)u[c]||(u[c]=[]),a&&0===i?(l=u[c].length-1,u[c][l]=u[c][l]+"\n"+r[n][0],a&&1&t(r[n][0])&&(a=!1,u[c][l]=u[c][l].substring(0,u[c][l].length-1).replace(/""/g,'"'))):i===s-1&&0===r[n][i].indexOf('"')&&1&t(r[n][i])?(u[c].push(r[n][i].substring(1).replace(/""/g,'"')),a=!0):(u[c].push(r[n][i].replace(/""/g,'"')),a=!1);a||(c+=1)}return u},stringify:function(e){var t,n,o,r,i,s="";for(t=0,n=e.length;n>t;t+=1){for(r=e[t].length,o=0;r>o;o+=1)o>0&&(s+=" "),i=e[t][o],s+="string"==typeof i?i.indexOf("\n")>-1?'"'+i.replace(/"/g,'""')+'"':i:null===i||void 0===i?"":i;s+="\n"}return s}};"undefined"!=typeof n?(n.parse=o.parse,n.stringify=o.stringify):e.SheetClip=o}(window)},{}],autoResize:[function(e,t,n){"use strict";function o(){var e,t={minHeight:200,maxHeight:300,minWidth:100,maxWidth:300},n=document.body,o=document.createTextNode(""),r=document.createElement("SPAN"),i=function(e,t,n){window.attachEvent?e.attachEvent("on"+t,n):e.addEventListener(t,n,!1)},s=function(e,t,n){window.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent("on"+t,n)},a=function(i){var s,a;i?/^[a-zA-Z \.,\\\/\|0-9]$/.test(i)||(i="."):i="",void 0!==o.textContent?o.textContent=e.value+i:o.data=e.value+i,r.style.fontSize=Handsontable.Dom.getComputedStyle(e).fontSize,r.style.fontFamily=Handsontable.Dom.getComputedStyle(e).fontFamily,r.style.whiteSpace="pre",n.appendChild(r),s=r.clientWidth+2,n.removeChild(r),e.style.height=t.minHeight+"px",t.minWidth>s?e.style.width=t.minWidth+"px":s>t.maxWidth?e.style.width=t.maxWidth+"px":e.style.width=s+"px",a=e.scrollHeight?e.scrollHeight-1:0,t.minHeight>a?e.style.height=t.minHeight+"px":t.maxHeight-1||"true"===e.contentEditable}var n=this,o=!1;if(e.metaKey?o=!0:e.ctrlKey&&-1===navigator.userAgent.indexOf("Mac")&&(o=!0),o){if(document.activeElement!==this.elTextarea&&(""!==this.getSelectionText()||t()))return;this.selectNodeText(this.elTextarea),setTimeout(function(){document.activeElement!==n.elTextarea&&n.selectNodeText(n.elTextarea)},0)}!o||67!==e.keyCode&&86!==e.keyCode&&88!==e.keyCode||(88===e.keyCode?setTimeout(function(){n.triggerCut(e)},0):86===e.keyCode&&setTimeout(function(){n.triggerPaste(e)},0))},r.prototype.selectNodeText=function(e){e&&e.select()},r.prototype.getSelectionText=function(){var e="";return window.getSelection?e=window.getSelection().toString():document.selection&&"Control"!==document.selection.type&&(e=document.selection.createRange().text),e},r.prototype.copyable=function(e){if("string"!=typeof e&&void 0===e.toString)throw new Error("copyable requires string parameter");this.elTextarea.value=e,this.selectNodeText(this.elTextarea)},r.prototype.onCut=function(e){this.cutCallbacks.push(e)},r.prototype.onPaste=function(e){this.pasteCallbacks.push(e)},r.prototype.removeCallback=function(e){var t,n;for(t=0,n=this.copyCallbacks.length;n>t;t++)if(this.copyCallbacks[t]===e)return this.copyCallbacks.splice(t,1),!0;for(t=0,n=this.cutCallbacks.length;n>t;t++)if(this.cutCallbacks[t]===e)return this.cutCallbacks.splice(t,1),!0;for(t=0,n=this.pasteCallbacks.length;n>t;t++)if(this.pasteCallbacks[t]===e)return this.pasteCallbacks.splice(t,1),!0;return!1},r.prototype.triggerCut=function(e){var t=this;t.cutCallbacks&&setTimeout(function(){for(var n=0,o=t.cutCallbacks.length;o>n;n++)t.cutCallbacks[n](e)},50)},r.prototype.triggerPaste=function(e,t){var n=this;n.pasteCallbacks&&setTimeout(function(){for(var o=t||n.elTextarea.value,r=0,i=n.pasteCallbacks.length;i>r;r++)n.pasteCallbacks[r](o,e)},50)},r.prototype.destroy=function(){this.hasBeenDestroyed()||0!==--this.refCounter||(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)},r.prototype.hasBeenDestroyed=function(){return!this.refCounter}},{}],es6collections:[function(e,t,n){"use strict";!function(e){function t(e,t){function o(e){return this&&this.constructor===o?(this._keys=[],this._values=[],this._itp=[],this.objectOnly=t,void(e&&n.call(this,e))):new o(e)}return t||y(e,"size",{get:m}),e.constructor=o,o.prototype=e,o}function n(e){this.add?e.forEach(this.add,this):e.forEach(function(e){this.set(e[0],e[1])},this)}function o(e){return this.has(e)&&(this._keys.splice(w,1),this._values.splice(w,1),this._itp.forEach(function(e){w-1}function r(e){return this.has(e)?this._values[w]:void 0}function i(e,t){if(this.objectOnly&&t!==Object(t))throw new TypeError("Invalid value used as weak collection key");if(t!=t||0===t)for(w=e.length;w--&&!b(e[w],t););else w=e.indexOf(t);return w>-1}function s(e){return i.call(this,this._values,e)}function a(e){return i.call(this,this._keys,e)}function l(e,t){return this.has(e)?this._values[w]=t:this._values[this._keys.push(e)-1]=t,this}function u(e){return this.has(e)||this._values.push(e),this}function c(){this._values.length=0}function d(){return g(this._itp,this._keys)}function h(){return g(this._itp,this._values)}function f(){return g(this._itp,this._keys,this._values)}function p(){return g(this._itp,this._values,this._values)}function g(e,t,n){var o=[0],r=!1;return e.push(o),{next:function(){var i,s=o[0];return!r&&st;t++)if(w[t].obj===e)return w[t]}function i(e){for(var t=0,n=w.length;n>t;t++)w[t]===e&&w.splice(t,1)}function s(e,t){for(var n=0,o=e.observers.length;o>n;n++)if(e.observers[n].callback===t)return e.observers[n].observer}function a(e,t){for(var n=0,o=e.observers.length;o>n;n++)if(e.observers[n].observer===t)return e.observers.splice(n,1),void(e.observers.length||i(e))}function l(e,t){h(t),Object.observe?d(t,e):clearTimeout(t.next);var n=r(e);a(n,t)}function u(e,t){var n,i=[],a=e,l=r(e);if(l?n=s(l,t):(l=new y(e),w.push(l)),n)return n;if(Object.observe)n=function(r){d(n,e),c(n,e);for(var s=0,l=r.length;l>s;){if(("length"!==r[s].name||!R(r[s].object))&&"__Jasmine_been_here_before__"!==r[s].name){var u=r[s].type;switch(u){case"new":u="add";break;case"deleted":u="delete";break;case"updated":u="update"}v[u].call(r[s],i,o(a,r[s].object))}s++}i&&t&&t(i),n.patches=i,i=[]};else if(n={},l.value=JSON.parse(JSON.stringify(e)),t){n.callback=t,n.next=null;var u=this.intervals||[100,1e3,1e4,6e4],f=0,p=function(){h(n)},g=function(){clearTimeout(n.next),n.next=setTimeout(function(){p(),f=0,n.next=setTimeout(m,u[f++])},0)},m=function(){p(),f==u.length&&(f=u.length-1),n.next=setTimeout(m,u[f++])};"undefined"!=typeof window&&(window.addEventListener?(window.addEventListener("mousedown",g),window.addEventListener("mouseup",g),window.addEventListener("keydown",g)):(window.attachEvent("onmousedown",g),window.attachEvent("onmouseup",g),window.attachEvent("onkeydown",g))),n.next=setTimeout(m,u[f++])}return n.patches=i,n.object=e,l.observers.push(new b(t,n)),c(n,e)}function c(e,t){if(Object.observe){Object.observe(t,e);for(var n in t)if(t.hasOwnProperty(n)){var o=t[n];o&&"object"==typeof o&&c(e,o)}}return e}function d(e,t){if(Object.observe){Object.unobserve(t,e);for(var n in t)if(t.hasOwnProperty(n)){var o=t[n];o&&"object"==typeof o&&d(e,o)}}return e}function h(e){if(Object.observe)Object.deliverChangeRecords(e);else{for(var t,n=0,o=w.length;o>n;n++)if(w[n].obj===e.object){t=w[n];break}t&&f(t.value,e.object,e.patches,"")}var r=e.patches;return r.length>0&&(e.patches=[],e.callback&&e.callback(r)),r}function f(e,n,o,r){for(var i=C(n),s=C(e),a=!1,l=!1,u=s.length-1;u>=0;u--){var c=s[u],d=e[c];if(n.hasOwnProperty(c)){var h=n[c];d instanceof Object?f(d,h,o,r+"/"+t(c)):d!=h&&(a=!0,o.push({op:"replace",path:r+"/"+t(c),value:h}),e[c]=h)}else o.push({op:"remove",path:r+"/"+t(c)}),delete e[c],l=!0}if(l||i.length!=s.length)for(var u=0;ur;){n=t[r];for(var s=n.path.split("/"),a=e,l=1,u=s.length;;)if(R(a)){var c=parseInt(s[l],10);if(l++,l>=u){o=m[n.op].call(n,a,c,e);break}a=a[c]}else{var d=s[l];if(-1!=d.indexOf("~")&&(d=d.replace(/~1/g,"/").replace(/~0/g,"~")),l++,l>=u){o=g[n.op].call(n,a,d,e);break}a=a[d]}r++}return o}var g={add:function(e,t){return e[t]=this.value,!0},remove:function(e,t){return delete e[t],!0},replace:function(e,t){return e[t]=this.value,!0},move:function(e,t,n){var o={op:"_get",path:this.from};return p(n,[o]),p(n,[{op:"remove",path:this.from}]),p(n,[{op:"add",path:this.path,value:o.value}]),!0},copy:function(e,t,n){var o={op:"_get",path:this.from};return p(n,[o]),p(n,[{op:"add",path:this.path,value:o.value}]),!0},test:function(e,t){return JSON.stringify(e[t])===JSON.stringify(this.value)},_get:function(e,t){this.value=e[t]}},m={add:function(e,t){return e.splice(t,0,this.value),!0},remove:function(e,t){return e.splice(t,1),!0},replace:function(e,t){return e[t]=this.value,!0},move:g.move,copy:g.copy,test:g.test,_get:g._get},v={add:function(e,n){var o={op:"add",path:n+t(this.name),value:this.object[this.name]};e.push(o)},"delete":function(e,n){var o={op:"remove",path:n+t(this.name)};e.push(o)},update:function(e,n){var o={op:"replace",path:n+t(this.name),value:this.object[this.name]};e.push(o)}},w=[];e.intervals;var y=function(){function e(e){this.observers=[],this.obj=e}return e}(),b=function(){function e(e,t){this.callback=e,this.observer=t}return e}();e.unobserve=l,e.observe=u,e.generate=h;var C;C=Object.keys?Object.keys:function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t};var R;R=Array.isArray?Array.isArray:function(e){return e.push&&"number"==typeof e.length},e.apply=p}(o||(o={})),"undefined"!=typeof n&&(n.apply=o.apply,n.observe=o.observe,n.unobserve=o.unobserve,n.generate=o.generate)},{}],moment:[function(t,n,o){!function(t,r){"object"==typeof o&&"undefined"!=typeof n?n.exports=r():"function"==typeof e&&e.amd?e(r):t.moment=r()}(this,function(){"use strict";function e(){return Xn.apply(null,arguments)}function o(e){Xn=e}function r(e){return"[object Array]"===Object.prototype.toString.call(e)}function i(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function s(e,t){var n,o=[];for(n=0;n0)for(n in Zn)o=Zn[n],r=t[o],p(r)||(e[o]=r);return e}function m(t){g(this,t),this._d=new Date(null!=t._d?t._d.getTime():NaN),Jn===!1&&(Jn=!0,e.updateOffset(this),Jn=!1)}function v(e){return e instanceof m||null!=e&&null!=e._isAMomentObject}function w(e){return 0>e?Math.ceil(e):Math.floor(e)}function y(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=w(t)),n}function b(e,t,n){var o,r=Math.min(e.length,t.length),i=Math.abs(e.length-t.length),s=0;for(o=0;r>o;o++)(n&&e[o]!==t[o]||!n&&y(e[o])!==y(t[o]))&&s++;return s+i}function C(){}function R(e){return e?e.toLowerCase().replace("_","-"):e}function _(e){for(var t,n,o,r,i=0;i0;){if(o=S(r.slice(0,t).join("-")))return o;if(n&&n.length>=t&&b(r,n,!0)>=t-1)break;t--}i++}return null}function S(e){var o=null;if(!Qn[e]&&"undefined"!=typeof n&&n&&n.exports)try{o=qn._abbr,t("./locale/"+e),E(o)}catch(r){}return Qn[e]}function E(e,t){var n;return e&&(n=p(t)?M(e):T(e,t),n&&(qn=n)),qn._abbr}function T(e,t){return null!==t?(t.abbr=e,Qn[e]=Qn[e]||new C,Qn[e].set(t),E(e),Qn[e]):(delete Qn[e],null)}function M(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return qn;if(!r(e)){if(t=S(e))return t;e=[e]}return _(e)}function O(e,t){var n=e.toLowerCase();eo[n]=eo[n+"s"]=eo[t]=e}function k(e){return"string"==typeof e?eo[e]||eo[e.toLowerCase()]:void 0}function H(e){var t,n,o={};for(n in e)a(e,n)&&(t=k(n),t&&(o[t]=e[n]));return o}function D(e){return e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function x(t,n){return function(o){return null!=o?(P(this,t,o),e.updateOffset(this,n),this):A(this,t)}}function A(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function P(e,t,n){e.isValid()&&e._d["set"+(e._isUTC?"UTC":"")+t](n)}function N(e,t){var n;if("object"==typeof e)for(n in e)this.set(n,e[n]);else if(e=k(e),D(this[e]))return this[e](t);return this}function L(e,t,n){var o=""+Math.abs(e),r=t-o.length,i=e>=0;return(i?n?"+":"":"-")+Math.pow(10,Math.max(0,r)).toString().substr(1)+o}function W(e,t,n,o){var r=o;"string"==typeof o&&(r=function(){return this[o]()}),e&&(ro[e]=r),t&&(ro[t[0]]=function(){return L(r.apply(this,arguments),t[1],t[2])}),n&&(ro[n]=function(){return this.localeData().ordinal(r.apply(this,arguments),e)})}function I(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function j(e){var t,n,o=e.match(to);for(t=0,n=o.length;n>t;t++)ro[o[t]]?o[t]=ro[o[t]]:o[t]=I(o[t]);return function(r){var i="";for(t=0;n>t;t++)i+=o[t]instanceof Function?o[t].call(r,e):o[t];return i}}function V(e,t){return e.isValid()?(t=B(t,e.localeData()),oo[t]=oo[t]||j(t),oo[t](e)):e.localeData().invalidDate()}function B(e,t){function n(e){return t.longDateFormat(e)||e}var o=5;for(no.lastIndex=0;o>=0&&no.test(e);)e=e.replace(no,n),no.lastIndex=0,o-=1;return e}function F(e,t,n){_o[e]=D(t)?t:function(e,o){return e&&n?n:t}}function z(e,t){return a(_o,e)?_o[e](t._strict,t._locale):new RegExp(Y(e))}function Y(e){return U(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,o,r){return t||n||o||r}))}function U(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function G(e,t){var n,o=t;for("string"==typeof e&&(e=[e]),"number"==typeof t&&(o=function(e,n){n[t]=y(e)}),n=0;no;o++){if(r=u([2e3,o]),n&&!this._longMonthsParse[o]&&(this._longMonthsParse[o]=new RegExp("^"+this.months(r,"").replace(".","")+"$","i"),this._shortMonthsParse[o]=new RegExp("^"+this.monthsShort(r,"").replace(".","")+"$","i")),n||this._monthsParse[o]||(i="^"+this.months(r,"")+"|^"+this.monthsShort(r,""),this._monthsParse[o]=new RegExp(i.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[o].test(e))return o;if(n&&"MMM"===t&&this._shortMonthsParse[o].test(e))return o;if(!n&&this._monthsParse[o].test(e))return o}}function Q(e,t){var n;return e.isValid()?"string"==typeof t&&(t=e.localeData().monthsParse(t),"number"!=typeof t)?e:(n=Math.min(e.date(),X(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,n),e):e}function ee(t){return null!=t?(Q(this,t),e.updateOffset(this,!0),this):A(this,"Month")}function te(){return X(this.year(),this.month())}function ne(e){return this._monthsParseExact?(a(this,"_monthsRegex")||re.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex}function oe(e){return this._monthsParseExact?(a(this,"_monthsRegex")||re.call(this),e?this._monthsStrictRegex:this._monthsRegex):this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex}function re(){function e(e,t){return t.length-e.length}var t,n,o=[],r=[],i=[];for(t=0;12>t;t++)n=u([2e3,t]),o.push(this.monthsShort(n,"")),r.push(this.months(n,"")),i.push(this.months(n,"")),i.push(this.monthsShort(n,""));for(o.sort(e),r.sort(e),i.sort(e),t=0;12>t;t++)o[t]=U(o[t]),r[t]=U(r[t]),i[t]=U(i[t]);this._monthsRegex=new RegExp("^("+i.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+r.join("|")+")$","i"),this._monthsShortStrictRegex=new RegExp("^("+o.join("|")+")$","i")}function ie(e){var t,n=e._a;return n&&-2===d(e).overflow&&(t=n[To]<0||n[To]>11?To:n[Mo]<1||n[Mo]>X(n[Eo],n[To])?Mo:n[Oo]<0||n[Oo]>24||24===n[Oo]&&(0!==n[ko]||0!==n[Ho]||0!==n[Do])?Oo:n[ko]<0||n[ko]>59?ko:n[Ho]<0||n[Ho]>59?Ho:n[Do]<0||n[Do]>999?Do:-1,d(e)._overflowDayOfYear&&(Eo>t||t>Mo)&&(t=Mo),d(e)._overflowWeeks&&-1===t&&(t=xo),d(e)._overflowWeekday&&-1===t&&(t=Ao),d(e).overflow=t),e}function se(t){e.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+t)}function ae(e,t){var n=!0;return l(function(){return n&&(se(e+"\nArguments: "+Array.prototype.slice.call(arguments).join(", ")+"\n"+(new Error).stack),n=!1),t.apply(this,arguments)},t)}function le(e,t){jo[e]||(se(t),jo[e]=!0)}function ue(e){var t,n,o,r,i,s,a=e._i,l=Vo.exec(a)||Bo.exec(a);if(l){for(d(e).iso=!0,t=0,n=zo.length;n>t;t++)if(zo[t][1].exec(l[1])){r=zo[t][0],o=zo[t][2]!==!1;break}if(null==r)return void(e._isValid=!1);if(l[3]){for(t=0,n=Yo.length;n>t;t++)if(Yo[t][1].exec(l[3])){i=(l[2]||" ")+Yo[t][0];break}if(null==i)return void(e._isValid=!1)}if(!o&&null!=i)return void(e._isValid=!1);if(l[4]){if(!Fo.exec(l[4]))return void(e._isValid=!1);s="Z"}e._f=r+(i||"")+(s||""),Se(e)}else e._isValid=!1}function ce(t){var n=Uo.exec(t._i);return null!==n?void(t._d=new Date(+n[1])):(ue(t),void(t._isValid===!1&&(delete t._isValid,e.createFromInputFallback(t))))}function de(e,t,n,o,r,i,s){var a=new Date(e,t,n,o,r,i,s);return 100>e&&e>=0&&isFinite(a.getFullYear())&&a.setFullYear(e), -a}function he(e){var t=new Date(Date.UTC.apply(null,arguments));return 100>e&&e>=0&&isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e),t}function fe(e){return pe(e)?366:365}function pe(e){return e%4===0&&e%100!==0||e%400===0}function ge(){return pe(this.year())}function me(e,t,n){var o=7+t-n,r=(7+he(e,0,o).getUTCDay()-t)%7;return-r+o-1}function ve(e,t,n,o,r){var i,s,a=(7+n-o)%7,l=me(e,o,r),u=1+7*(t-1)+a+l;return 0>=u?(i=e-1,s=fe(i)+u):u>fe(e)?(i=e+1,s=u-fe(e)):(i=e,s=u),{year:i,dayOfYear:s}}function we(e,t,n){var o,r,i=me(e.year(),t,n),s=Math.floor((e.dayOfYear()-i-1)/7)+1;return 1>s?(r=e.year()-1,o=s+ye(r,t,n)):s>ye(e.year(),t,n)?(o=s-ye(e.year(),t,n),r=e.year()+1):(r=e.year(),o=s),{week:o,year:r}}function ye(e,t,n){var o=me(e,t,n),r=me(e+1,t,n);return(fe(e)-o+r)/7}function be(e,t,n){return null!=e?e:null!=t?t:n}function Ce(t){var n=new Date(e.now());return t._useUTC?[n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate()]:[n.getFullYear(),n.getMonth(),n.getDate()]}function Re(e){var t,n,o,r,i=[];if(!e._d){for(o=Ce(e),e._w&&null==e._a[Mo]&&null==e._a[To]&&_e(e),e._dayOfYear&&(r=be(e._a[Eo],o[Eo]),e._dayOfYear>fe(r)&&(d(e)._overflowDayOfYear=!0),n=he(r,0,e._dayOfYear),e._a[To]=n.getUTCMonth(),e._a[Mo]=n.getUTCDate()),t=0;3>t&&null==e._a[t];++t)e._a[t]=i[t]=o[t];for(;7>t;t++)e._a[t]=i[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[Oo]&&0===e._a[ko]&&0===e._a[Ho]&&0===e._a[Do]&&(e._nextDay=!0,e._a[Oo]=0),e._d=(e._useUTC?he:de).apply(null,i),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[Oo]=24)}}function _e(e){var t,n,o,r,i,s,a,l;t=e._w,null!=t.GG||null!=t.W||null!=t.E?(i=1,s=4,n=be(t.GG,e._a[Eo],we(xe(),1,4).year),o=be(t.W,1),r=be(t.E,1),(1>r||r>7)&&(l=!0)):(i=e._locale._week.dow,s=e._locale._week.doy,n=be(t.gg,e._a[Eo],we(xe(),i,s).year),o=be(t.w,1),null!=t.d?(r=t.d,(0>r||r>6)&&(l=!0)):null!=t.e?(r=t.e+i,(t.e<0||t.e>6)&&(l=!0)):r=i),1>o||o>ye(n,i,s)?d(e)._overflowWeeks=!0:null!=l?d(e)._overflowWeekday=!0:(a=ve(n,o,r,i,s),e._a[Eo]=a.year,e._dayOfYear=a.dayOfYear)}function Se(t){if(t._f===e.ISO_8601)return void ue(t);t._a=[],d(t).empty=!0;var n,o,r,i,s,a=""+t._i,l=a.length,u=0;for(r=B(t._f,t._locale).match(to)||[],n=0;n0&&d(t).unusedInput.push(s),a=a.slice(a.indexOf(o)+o.length),u+=o.length),ro[i]?(o?d(t).empty=!1:d(t).unusedTokens.push(i),K(i,o,t)):t._strict&&!o&&d(t).unusedTokens.push(i);d(t).charsLeftOver=l-u,a.length>0&&d(t).unusedInput.push(a),d(t).bigHour===!0&&t._a[Oo]<=12&&t._a[Oo]>0&&(d(t).bigHour=void 0),t._a[Oo]=Ee(t._locale,t._a[Oo],t._meridiem),Re(t),ie(t)}function Ee(e,t,n){var o;return null==n?t:null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?(o=e.isPM(n),o&&12>t&&(t+=12),o||12!==t||(t=0),t):t}function Te(e){var t,n,o,r,i;if(0===e._f.length)return d(e).invalidFormat=!0,void(e._d=new Date(NaN));for(r=0;ri)&&(o=i,n=t));l(e,n||t)}function Me(e){if(!e._d){var t=H(e._i);e._a=s([t.year,t.month,t.day||t.date,t.hour,t.minute,t.second,t.millisecond],function(e){return e&&parseInt(e,10)}),Re(e)}}function Oe(e){var t=new m(ie(ke(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function ke(e){var t=e._i,n=e._f;return e._locale=e._locale||M(e._l),null===t||void 0===n&&""===t?f({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),v(t)?new m(ie(t)):(r(n)?Te(e):n?Se(e):i(t)?e._d=t:He(e),h(e)||(e._d=null),e))}function He(t){var n=t._i;void 0===n?t._d=new Date(e.now()):i(n)?t._d=new Date(+n):"string"==typeof n?ce(t):r(n)?(t._a=s(n.slice(0),function(e){return parseInt(e,10)}),Re(t)):"object"==typeof n?Me(t):"number"==typeof n?t._d=new Date(n):e.createFromInputFallback(t)}function De(e,t,n,o,r){var i={};return"boolean"==typeof n&&(o=n,n=void 0),i._isAMomentObject=!0,i._useUTC=i._isUTC=r,i._l=n,i._i=e,i._f=t,i._strict=o,Oe(i)}function xe(e,t,n,o){return De(e,t,n,o,!1)}function Ae(e,t){var n,o;if(1===t.length&&r(t[0])&&(t=t[0]),!t.length)return xe();for(n=t[0],o=1;oe&&(e=-e,n="-"),n+L(~~(e/60),2)+t+L(~~e%60,2)})}function je(e,t){var n=(t||"").match(e)||[],o=n[n.length-1]||[],r=(o+"").match(qo)||["-",0,0],i=+(60*r[1])+y(r[2]);return"+"===r[0]?i:-i}function Ve(t,n){var o,r;return n._isUTC?(o=n.clone(),r=(v(t)||i(t)?+t:+xe(t))-+o,o._d.setTime(+o._d+r),e.updateOffset(o,!1),o):xe(t).local()}function Be(e){return 15*-Math.round(e._d.getTimezoneOffset()/15)}function Fe(t,n){var o,r=this._offset||0;return this.isValid()?null!=t?("string"==typeof t?t=je(bo,t):Math.abs(t)<16&&(t=60*t),!this._isUTC&&n&&(o=Be(this)),this._offset=t,this._isUTC=!0,null!=o&&this.add(o,"m"),r!==t&&(!n||this._changeInProgress?rt(this,Qe(t-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?r:Be(this):null!=t?this:NaN}function ze(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function Ye(e){return this.utcOffset(0,e)}function Ue(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Be(this),"m")),this}function Ge(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(je(yo,this._i)),this}function $e(e){return this.isValid()?(e=e?xe(e).utcOffset():0,(this.utcOffset()-e)%60===0):!1}function Ke(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Xe(){if(!p(this._isDSTShifted))return this._isDSTShifted;var e={};if(g(e,this),e=ke(e),e._a){var t=e._isUTC?u(e._a):xe(e._a);this._isDSTShifted=this.isValid()&&b(e._a,t.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function qe(){return this.isValid()?!this._isUTC:!1}function Ze(){return this.isValid()?this._isUTC:!1}function Je(){return this.isValid()?this._isUTC&&0===this._offset:!1}function Qe(e,t){var n,o,r,i=e,s=null;return We(e)?i={ms:e._milliseconds,d:e._days,M:e._months}:"number"==typeof e?(i={},t?i[t]=e:i.milliseconds=e):(s=Zo.exec(e))?(n="-"===s[1]?-1:1,i={y:0,d:y(s[Mo])*n,h:y(s[Oo])*n,m:y(s[ko])*n,s:y(s[Ho])*n,ms:y(s[Do])*n}):(s=Jo.exec(e))?(n="-"===s[1]?-1:1,i={y:et(s[2],n),M:et(s[3],n),d:et(s[4],n),h:et(s[5],n),m:et(s[6],n),s:et(s[7],n),w:et(s[8],n)}):null==i?i={}:"object"==typeof i&&("from"in i||"to"in i)&&(r=nt(xe(i.from),xe(i.to)),i={},i.ms=r.milliseconds,i.M=r.months),o=new Le(i),We(e)&&a(e,"_locale")&&(o._locale=e._locale),o}function et(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function tt(e,t){var n={milliseconds:0,months:0};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function nt(e,t){var n;return e.isValid()&&t.isValid()?(t=Ve(t,e),e.isBefore(t)?n=tt(e,t):(n=tt(t,e),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function ot(e,t){return function(n,o){var r,i;return null===o||isNaN(+o)||(le(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period)."),i=n,n=o,o=i),n="string"==typeof n?+n:n,r=Qe(n,o),rt(this,r,e),this}}function rt(t,n,o,r){var i=n._milliseconds,s=n._days,a=n._months;t.isValid()&&(r=null==r?!0:r,i&&t._d.setTime(+t._d+i*o),s&&P(t,"Date",A(t,"Date")+s*o),a&&Q(t,A(t,"Month")+a*o),r&&e.updateOffset(t,s||a))}function it(e,t){var n=e||xe(),o=Ve(n,this).startOf("day"),r=this.diff(o,"days",!0),i=-6>r?"sameElse":-1>r?"lastWeek":0>r?"lastDay":1>r?"sameDay":2>r?"nextDay":7>r?"nextWeek":"sameElse",s=t&&(D(t[i])?t[i]():t[i]);return this.format(s||this.localeData().calendar(i,this,xe(n)))}function st(){return new m(this)}function at(e,t){var n=v(e)?e:xe(e);return this.isValid()&&n.isValid()?(t=k(p(t)?"millisecond":t),"millisecond"===t?+this>+n:+n<+this.clone().startOf(t)):!1}function lt(e,t){var n=v(e)?e:xe(e);return this.isValid()&&n.isValid()?(t=k(p(t)?"millisecond":t),"millisecond"===t?+n>+this:+this.clone().endOf(t)<+n):!1}function ut(e,t,n){return this.isAfter(e,n)&&this.isBefore(t,n)}function ct(e,t){var n,o=v(e)?e:xe(e);return this.isValid()&&o.isValid()?(t=k(t||"millisecond"),"millisecond"===t?+this===+o:(n=+o,+this.clone().startOf(t)<=n&&n<=+this.clone().endOf(t))):!1}function dt(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function ht(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function ft(e,t,n){var o,r,i,s;return this.isValid()?(o=Ve(e,this),o.isValid()?(r=6e4*(o.utcOffset()-this.utcOffset()),t=k(t),"year"===t||"month"===t||"quarter"===t?(s=pt(this,o),"quarter"===t?s/=3:"year"===t&&(s/=12)):(i=this-o,s="second"===t?i/1e3:"minute"===t?i/6e4:"hour"===t?i/36e5:"day"===t?(i-r)/864e5:"week"===t?(i-r)/6048e5:i),n?s:w(s)):NaN):NaN}function pt(e,t){var n,o,r=12*(t.year()-e.year())+(t.month()-e.month()),i=e.clone().add(r,"months");return 0>t-i?(n=e.clone().add(r-1,"months"),o=(t-i)/(i-n)):(n=e.clone().add(r+1,"months"),o=(t-i)/(n-i)),-(r+o)}function gt(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function mt(){var e=this.clone().utc();return 0i&&(t=i),Ft.call(this,e,t,n,o,r))}function Ft(e,t,n,o,r){var i=ve(e,t,n,o,r),s=he(i.year,0,i.dayOfYear);return this.year(s.getUTCFullYear()),this.month(s.getUTCMonth()),this.date(s.getUTCDate()),this}function zt(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)}function Yt(e){return we(e,this._week.dow,this._week.doy).week}function Ut(){return this._week.dow}function Gt(){return this._week.doy}function $t(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")}function Kt(e){var t=we(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")}function Xt(e,t){return"string"!=typeof e?e:isNaN(e)?(e=t.weekdaysParse(e),"number"==typeof e?e:null):parseInt(e,10)}function qt(e,t){return r(this._weekdays)?this._weekdays[e.day()]:this._weekdays[this._weekdays.isFormat.test(t)?"format":"standalone"][e.day()]}function Zt(e){return this._weekdaysShort[e.day()]}function Jt(e){return this._weekdaysMin[e.day()]}function Qt(e,t,n){var o,r,i;for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),o=0;7>o;o++){if(r=xe([2e3,1]).day(o),n&&!this._fullWeekdaysParse[o]&&(this._fullWeekdaysParse[o]=new RegExp("^"+this.weekdays(r,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[o]=new RegExp("^"+this.weekdaysShort(r,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[o]=new RegExp("^"+this.weekdaysMin(r,"").replace(".",".?")+"$","i")),this._weekdaysParse[o]||(i="^"+this.weekdays(r,"")+"|^"+this.weekdaysShort(r,"")+"|^"+this.weekdaysMin(r,""),this._weekdaysParse[o]=new RegExp(i.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[o].test(e))return o;if(n&&"ddd"===t&&this._shortWeekdaysParse[o].test(e))return o;if(n&&"dd"===t&&this._minWeekdaysParse[o].test(e))return o;if(!n&&this._weekdaysParse[o].test(e))return o}}function en(e){if(!this.isValid())return null!=e?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=Xt(e,this.localeData()),this.add(e-t,"d")):t}function tn(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")}function nn(e){return this.isValid()?null==e?this.day()||7:this.day(this.day()%7?e:e-7):null!=e?this:NaN}function on(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")}function rn(){return this.hours()%12||12}function sn(e,t){W(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function an(e,t){return t._meridiemParse}function ln(e){return"p"===(e+"").toLowerCase().charAt(0)}function un(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}function cn(e,t){t[Do]=y(1e3*("0."+e))}function dn(){return this._isUTC?"UTC":""}function hn(){return this._isUTC?"Coordinated Universal Time":""}function fn(e){return xe(1e3*e)}function pn(){return xe.apply(null,arguments).parseZone()}function gn(e,t,n){var o=this._calendar[e];return D(o)?o.call(t,n):o}function mn(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.replace(/MMMM|MM|DD|dddd/g,function(e){return e.slice(1)}),this._longDateFormat[e])}function vn(){return this._invalidDate}function wn(e){return this._ordinal.replace("%d",e)}function yn(e){return e}function bn(e,t,n,o){var r=this._relativeTime[n];return D(r)?r(e,t,n,o):r.replace(/%d/i,e)}function Cn(e,t){var n=this._relativeTime[e>0?"future":"past"];return D(n)?n(t):n.replace(/%s/i,t)}function Rn(e){var t,n;for(n in e)t=e[n],D(t)?this[n]=t:this["_"+n]=t;this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function _n(e,t,n,o){var r=M(),i=u().set(o,t);return r[n](i,e)}function Sn(e,t,n,o,r){if("number"==typeof e&&(t=e,e=void 0),e=e||"",null!=t)return _n(e,t,n,r);var i,s=[];for(i=0;o>i;i++)s[i]=_n(e,i,n,r);return s}function En(e,t){return Sn(e,t,"months",12,"month")}function Tn(e,t){return Sn(e,t,"monthsShort",12,"month")}function Mn(e,t){return Sn(e,t,"weekdays",7,"day")}function On(e,t){return Sn(e,t,"weekdaysShort",7,"day")}function kn(e,t){return Sn(e,t,"weekdaysMin",7,"day")}function Hn(){var e=this._data;return this._milliseconds=Rr(this._milliseconds),this._days=Rr(this._days),this._months=Rr(this._months),e.milliseconds=Rr(e.milliseconds),e.seconds=Rr(e.seconds),e.minutes=Rr(e.minutes),e.hours=Rr(e.hours),e.months=Rr(e.months),e.years=Rr(e.years),this}function Dn(e,t,n,o){var r=Qe(t,n);return e._milliseconds+=o*r._milliseconds,e._days+=o*r._days,e._months+=o*r._months,e._bubble()}function xn(e,t){return Dn(this,e,t,1)}function An(e,t){return Dn(this,e,t,-1)}function Pn(e){return 0>e?Math.floor(e):Math.ceil(e)}function Nn(){var e,t,n,o,r,i=this._milliseconds,s=this._days,a=this._months,l=this._data;return i>=0&&s>=0&&a>=0||0>=i&&0>=s&&0>=a||(i+=864e5*Pn(Wn(a)+s),s=0,a=0),l.milliseconds=i%1e3,e=w(i/1e3),l.seconds=e%60,t=w(e/60),l.minutes=t%60,n=w(t/60),l.hours=n%24,s+=w(n/24),r=w(Ln(s)),a+=r,s-=Pn(Wn(r)),o=w(a/12),a%=12,l.days=s,l.months=a,l.years=o,this}function Ln(e){return 4800*e/146097}function Wn(e){return 146097*e/4800}function In(e){var t,n,o=this._milliseconds;if(e=k(e),"month"===e||"year"===e)return t=this._days+o/864e5,n=this._months+Ln(t),"month"===e?n:n/12;switch(t=this._days+Math.round(Wn(this._months)),e){case"week":return t/7+o/6048e5;case"day":return t+o/864e5;case"hour":return 24*t+o/36e5;case"minute":return 1440*t+o/6e4;case"second":return 86400*t+o/1e3;case"millisecond":return Math.floor(864e5*t)+o;default:throw new Error("Unknown unit "+e)}}function jn(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*y(this._months/12)}function Vn(e){return function(){return this.as(e)}}function Bn(e){return e=k(e),this[e+"s"]()}function Fn(e){return function(){return this._data[e]}}function zn(){return w(this.days()/7)}function Yn(e,t,n,o,r){return r.relativeTime(t||1,!!n,e,o)}function Un(e,t,n){var o=Qe(e).abs(),r=Ir(o.as("s")),i=Ir(o.as("m")),s=Ir(o.as("h")),a=Ir(o.as("d")),l=Ir(o.as("M")),u=Ir(o.as("y")),c=r=i&&["m"]||i=s&&["h"]||s=a&&["d"]||a=l&&["M"]||l=u&&["y"]||["yy",u];return c[2]=t,c[3]=+e>0,c[4]=n,Yn.apply(null,c)}function Gn(e,t){return void 0===jr[e]?!1:void 0===t?jr[e]:(jr[e]=t,!0)}function $n(e){var t=this.localeData(),n=Un(this,!e,t);return e&&(n=t.pastFuture(+this,n)),t.postformat(n)}function Kn(){var e,t,n,o=Vr(this._milliseconds)/1e3,r=Vr(this._days),i=Vr(this._months);e=w(o/60),t=w(e/60),o%=60,e%=60,n=w(i/12),i%=12;var s=n,a=i,l=r,u=t,c=e,d=o,h=this.asSeconds();return h?(0>h?"-":"")+"P"+(s?s+"Y":"")+(a?a+"M":"")+(l?l+"D":"")+(u||c||d?"T":"")+(u?u+"H":"")+(c?c+"M":"")+(d?d+"S":""):"P0D"}var Xn,qn,Zn=e.momentProperties=[],Jn=!1,Qn={},eo={},to=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,no=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,oo={},ro={},io=/\d/,so=/\d\d/,ao=/\d{3}/,lo=/\d{4}/,uo=/[+-]?\d{6}/,co=/\d\d?/,ho=/\d\d\d\d?/,fo=/\d\d\d\d\d\d?/,po=/\d{1,3}/,go=/\d{1,4}/,mo=/[+-]?\d{1,6}/,vo=/\d+/,wo=/[+-]?\d+/,yo=/Z|[+-]\d\d:?\d\d/gi,bo=/Z|[+-]\d\d(?::?\d\d)?/gi,Co=/[+-]?\d+(\.\d{1,3})?/,Ro=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,_o={},So={},Eo=0,To=1,Mo=2,Oo=3,ko=4,Ho=5,Do=6,xo=7,Ao=8;W("M",["MM",2],"Mo",function(){return this.month()+1}),W("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),W("MMMM",0,0,function(e){return this.localeData().months(this,e)}),O("month","M"),F("M",co),F("MM",co,so),F("MMM",function(e,t){return t.monthsShortRegex(e)}),F("MMMM",function(e,t){return t.monthsRegex(e)}),G(["M","MM"],function(e,t){t[To]=y(e)-1}),G(["MMM","MMMM"],function(e,t,n,o){var r=n._locale.monthsParse(e,o,n._strict);null!=r?t[To]=r:d(n).invalidMonth=e});var Po=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/,No="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Lo="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Wo=Ro,Io=Ro,jo={};e.suppressDeprecationWarnings=!1;var Vo=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,Bo=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,Fo=/Z|[+-]\d\d(?::?\d\d)?/,zo=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],Yo=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Uo=/^\/?Date\((\-?\d+)/i;e.createFromInputFallback=ae("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(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),W("Y",0,0,function(){var e=this.year();return 9999>=e?""+e:"+"+e}),W(0,["YY",2],0,function(){return this.year()%100}),W(0,["YYYY",4],0,"year"),W(0,["YYYYY",5],0,"year"),W(0,["YYYYYY",6,!0],0,"year"),O("year","y"),F("Y",wo),F("YY",co,so),F("YYYY",go,lo),F("YYYYY",mo,uo),F("YYYYYY",mo,uo),G(["YYYYY","YYYYYY"],Eo),G("YYYY",function(t,n){n[Eo]=2===t.length?e.parseTwoDigitYear(t):y(t)}),G("YY",function(t,n){n[Eo]=e.parseTwoDigitYear(t)}),G("Y",function(e,t){t[Eo]=parseInt(e,10)}),e.parseTwoDigitYear=function(e){return y(e)+(y(e)>68?1900:2e3)};var Go=x("FullYear",!1);e.ISO_8601=function(){};var $o=ae("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var e=xe.apply(null,arguments);return this.isValid()&&e.isValid()?this>e?this:e:f()}),Ko=ae("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var e=xe.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:f()}),Xo=function(){return Date.now?Date.now():+new Date};Ie("Z",":"),Ie("ZZ",""),F("Z",bo),F("ZZ",bo),G(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=je(bo,e)});var qo=/([\+\-]|\d\d)/gi;e.updateOffset=function(){};var Zo=/(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,Jo=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/;Qe.fn=Le.prototype;var Qo=ot(1,"add"),er=ot(-1,"subtract");e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";var tr=ae("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});W(0,["gg",2],0,function(){return this.weekYear()%100}),W(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Lt("gggg","weekYear"),Lt("ggggg","weekYear"),Lt("GGGG","isoWeekYear"),Lt("GGGGG","isoWeekYear"),O("weekYear","gg"),O("isoWeekYear","GG"),F("G",wo),F("g",wo),F("GG",co,so),F("gg",co,so),F("GGGG",go,lo),F("gggg",go,lo),F("GGGGG",mo,uo),F("ggggg",mo,uo),$(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,o){t[o.substr(0,2)]=y(e)}),$(["gg","GG"],function(t,n,o,r){n[r]=e.parseTwoDigitYear(t)}),W("Q",0,"Qo","quarter"),O("quarter","Q"),F("Q",io),G("Q",function(e,t){t[To]=3*(y(e)-1)}),W("w",["ww",2],"wo","week"),W("W",["WW",2],"Wo","isoWeek"),O("week","w"),O("isoWeek","W"),F("w",co),F("ww",co,so),F("W",co),F("WW",co,so),$(["w","ww","W","WW"],function(e,t,n,o){t[o.substr(0,1)]=y(e)});var nr={dow:0,doy:6};W("D",["DD",2],"Do","date"),O("date","D"),F("D",co),F("DD",co,so),F("Do",function(e,t){return e?t._ordinalParse:t._ordinalParseLenient}),G(["D","DD"],Mo),G("Do",function(e,t){t[Mo]=y(e.match(co)[0],10)});var or=x("Date",!0);W("d",0,"do","day"),W("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),W("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),W("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),W("e",0,0,"weekday"),W("E",0,0,"isoWeekday"),O("day","d"),O("weekday","e"),O("isoWeekday","E"),F("d",co),F("e",co),F("E",co),F("dd",Ro),F("ddd",Ro),F("dddd",Ro),$(["dd","ddd","dddd"],function(e,t,n,o){var r=n._locale.weekdaysParse(e,o,n._strict);null!=r?t.d=r:d(n).invalidWeekday=e}),$(["d","e","E"],function(e,t,n,o){t[o]=y(e)});var rr="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),ir="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),sr="Su_Mo_Tu_We_Th_Fr_Sa".split("_");W("DDD",["DDDD",3],"DDDo","dayOfYear"),O("dayOfYear","DDD"),F("DDD",po),F("DDDD",ao),G(["DDD","DDDD"],function(e,t,n){n._dayOfYear=y(e)}),W("H",["HH",2],0,"hour"),W("h",["hh",2],0,rn),W("hmm",0,0,function(){return""+rn.apply(this)+L(this.minutes(),2)}),W("hmmss",0,0,function(){return""+rn.apply(this)+L(this.minutes(),2)+L(this.seconds(),2)}),W("Hmm",0,0,function(){return""+this.hours()+L(this.minutes(),2)}),W("Hmmss",0,0,function(){return""+this.hours()+L(this.minutes(),2)+L(this.seconds(),2)}),sn("a",!0),sn("A",!1),O("hour","h"),F("a",an),F("A",an),F("H",co),F("h",co),F("HH",co,so),F("hh",co,so),F("hmm",ho),F("hmmss",fo),F("Hmm",ho),F("Hmmss",fo),G(["H","HH"],Oo),G(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),G(["h","hh"],function(e,t,n){t[Oo]=y(e),d(n).bigHour=!0}),G("hmm",function(e,t,n){var o=e.length-2;t[Oo]=y(e.substr(0,o)),t[ko]=y(e.substr(o)),d(n).bigHour=!0}),G("hmmss",function(e,t,n){var o=e.length-4,r=e.length-2;t[Oo]=y(e.substr(0,o)),t[ko]=y(e.substr(o,2)),t[Ho]=y(e.substr(r)),d(n).bigHour=!0}),G("Hmm",function(e,t,n){var o=e.length-2;t[Oo]=y(e.substr(0,o)),t[ko]=y(e.substr(o))}),G("Hmmss",function(e,t,n){var o=e.length-4,r=e.length-2;t[Oo]=y(e.substr(0,o)),t[ko]=y(e.substr(o,2)),t[Ho]=y(e.substr(r))});var ar=/[ap]\.?m?\.?/i,lr=x("Hours",!0);W("m",["mm",2],0,"minute"),O("minute","m"),F("m",co),F("mm",co,so),G(["m","mm"],ko);var ur=x("Minutes",!1);W("s",["ss",2],0,"second"),O("second","s"),F("s",co),F("ss",co,so),G(["s","ss"],Ho);var cr=x("Seconds",!1);W("S",0,0,function(){return~~(this.millisecond()/100)}),W(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),W(0,["SSS",3],0,"millisecond"),W(0,["SSSS",4],0,function(){return 10*this.millisecond()}),W(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),W(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),W(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),W(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),W(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),O("millisecond","ms"),F("S",po,io),F("SS",po,so),F("SSS",po,ao);var dr;for(dr="SSSS";dr.length<=9;dr+="S")F(dr,vo);for(dr="S";dr.length<=9;dr+="S")G(dr,cn);var hr=x("Milliseconds",!1);W("z",0,0,"zoneAbbr"),W("zz",0,0,"zoneName");var fr=m.prototype;fr.add=Qo,fr.calendar=it,fr.clone=st,fr.diff=ft,fr.endOf=Et,fr.format=vt,fr.from=wt,fr.fromNow=yt,fr.to=bt,fr.toNow=Ct,fr.get=N,fr.invalidAt=Pt,fr.isAfter=at,fr.isBefore=lt,fr.isBetween=ut,fr.isSame=ct,fr.isSameOrAfter=dt,fr.isSameOrBefore=ht,fr.isValid=xt,fr.lang=tr,fr.locale=Rt,fr.localeData=_t,fr.max=Ko,fr.min=$o,fr.parsingFlags=At,fr.set=N,fr.startOf=St,fr.subtract=er,fr.toArray=kt,fr.toObject=Ht,fr.toDate=Ot,fr.toISOString=mt,fr.toJSON=Dt,fr.toString=gt,fr.unix=Mt,fr.valueOf=Tt,fr.creationData=Nt,fr.year=Go,fr.isLeapYear=ge,fr.weekYear=Wt,fr.isoWeekYear=It,fr.quarter=fr.quarters=zt,fr.month=ee,fr.daysInMonth=te,fr.week=fr.weeks=$t,fr.isoWeek=fr.isoWeeks=Kt,fr.weeksInYear=Vt,fr.isoWeeksInYear=jt,fr.date=or,fr.day=fr.days=en,fr.weekday=tn,fr.isoWeekday=nn,fr.dayOfYear=on,fr.hour=fr.hours=lr,fr.minute=fr.minutes=ur,fr.second=fr.seconds=cr,fr.millisecond=fr.milliseconds=hr,fr.utcOffset=Fe,fr.utc=Ye,fr.local=Ue,fr.parseZone=Ge,fr.hasAlignedHourOffset=$e,fr.isDST=Ke,fr.isDSTShifted=Xe,fr.isLocal=qe,fr.isUtcOffset=Ze,fr.isUtc=Je,fr.isUTC=Je,fr.zoneAbbr=dn,fr.zoneName=hn,fr.dates=ae("dates accessor is deprecated. Use date instead.",or),fr.months=ae("months accessor is deprecated. Use month instead",ee),fr.years=ae("years accessor is deprecated. Use year instead",Go),fr.zone=ae("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",ze);var pr=fr,gr={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},mr={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"},vr="Invalid date",wr="%d",yr=/\d{1,2}/,br={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"},Cr=C.prototype;Cr._calendar=gr,Cr.calendar=gn,Cr._longDateFormat=mr,Cr.longDateFormat=mn,Cr._invalidDate=vr,Cr.invalidDate=vn,Cr._ordinal=wr,Cr.ordinal=wn,Cr._ordinalParse=yr,Cr.preparse=yn,Cr.postformat=yn,Cr._relativeTime=br,Cr.relativeTime=bn,Cr.pastFuture=Cn,Cr.set=Rn,Cr.months=q,Cr._months=No,Cr.monthsShort=Z,Cr._monthsShort=Lo,Cr.monthsParse=J,Cr._monthsRegex=Io,Cr.monthsRegex=oe,Cr._monthsShortRegex=Wo,Cr.monthsShortRegex=ne,Cr.week=Yt,Cr._week=nr,Cr.firstDayOfYear=Gt,Cr.firstDayOfWeek=Ut,Cr.weekdays=qt,Cr._weekdays=rr,Cr.weekdaysMin=Jt,Cr._weekdaysMin=sr,Cr.weekdaysShort=Zt,Cr._weekdaysShort=ir,Cr.weekdaysParse=Qt,Cr.isPM=ln,Cr._meridiemParse=ar,Cr.meridiem=un,E("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,n=1===y(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+n}}),e.lang=ae("moment.lang is deprecated. Use moment.locale instead.",E),e.langData=ae("moment.langData is deprecated. Use moment.localeData instead.",M);var Rr=Math.abs,_r=Vn("ms"),Sr=Vn("s"),Er=Vn("m"),Tr=Vn("h"),Mr=Vn("d"),Or=Vn("w"),kr=Vn("M"),Hr=Vn("y"),Dr=Fn("milliseconds"),xr=Fn("seconds"),Ar=Fn("minutes"),Pr=Fn("hours"),Nr=Fn("days"),Lr=Fn("months"),Wr=Fn("years"),Ir=Math.round,jr={s:45,m:45,h:22,d:26,M:11},Vr=Math.abs,Br=Le.prototype;Br.abs=Hn,Br.add=xn,Br.subtract=An,Br.as=In,Br.asMilliseconds=_r,Br.asSeconds=Sr,Br.asMinutes=Er,Br.asHours=Tr,Br.asDays=Mr,Br.asWeeks=Or,Br.asMonths=kr,Br.asYears=Hr,Br.valueOf=jn,Br._bubble=Nn,Br.get=Bn,Br.milliseconds=Dr,Br.seconds=xr,Br.minutes=Ar,Br.hours=Pr,Br.days=Nr,Br.weeks=zn,Br.months=Lr,Br.years=Wr,Br.humanize=$n,Br.toISOString=Kn,Br.toString=Kn,Br.toJSON=Kn,Br.locale=Rt,Br.localeData=_t,Br.toIsoString=ae("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Kn),Br.lang=tr,W("X",0,0,"unix"),W("x",0,0,"valueOf"),F("x",wo),F("X",Co),G("X",function(e,t,n){n._d=new Date(1e3*parseFloat(e,10))}),G("x",function(e,t,n){n._d=new Date(y(e))}),e.version="2.11.1",o(xe),e.fn=pr,e.min=Pe,e.max=Ne,e.now=Xo,e.utc=u,e.unix=fn,e.months=En,e.isDate=i,e.locale=E,e.invalid=f,e.duration=Qe,e.isMoment=v,e.weekdays=Mn,e.parseZone=pn,e.localeData=M,e.isDuration=We,e.monthsShort=Tn,e.weekdaysMin=kn,e.defineLocale=T,e.weekdaysShort=On,e.normalizeUnits=k,e.relativeTimeThreshold=Gn,e.prototype=pr;var Fr=e;return Fr})},{}],numeral:[function(t,n,o){"use strict";(function(){function t(e){this._value=e}function o(e,t,n,o){var r,i,s=Math.pow(10,t);return i=(n(e*s)/s).toFixed(t),o&&(r=new RegExp("0{1,"+o+"}$"),i=i.replace(r,"")),i}function r(e,t,n){var o;return o=t.indexOf("$")>-1?s(e,t,n):t.indexOf("%")>-1?a(e,t,n):t.indexOf(":")>-1?l(e,t):c(e._value,t,n)}function i(e,t){var n,o,r,i,s,a=t,l=["KB","MB","GB","TB","PB","EB","ZB","YB"],c=!1; -if(t.indexOf(":")>-1)e._value=u(t);else if(t===w)e._value=0;else{for("."!==m[v].delimiters.decimal&&(t=t.replace(/\./g,"").replace(m[v].delimiters.decimal,".")),n=new RegExp("[^a-zA-Z]"+m[v].abbreviations.thousand+"(?:\\)|(\\"+m[v].currency.symbol+")?(?:\\))?)?$"),o=new RegExp("[^a-zA-Z]"+m[v].abbreviations.million+"(?:\\)|(\\"+m[v].currency.symbol+")?(?:\\))?)?$"),r=new RegExp("[^a-zA-Z]"+m[v].abbreviations.billion+"(?:\\)|(\\"+m[v].currency.symbol+")?(?:\\))?)?$"),i=new RegExp("[^a-zA-Z]"+m[v].abbreviations.trillion+"(?:\\)|(\\"+m[v].currency.symbol+")?(?:\\))?)?$"),s=0;s<=l.length&&!(c=t.indexOf(l[s])>-1?Math.pow(1024,s+1):!1);s++);e._value=(c?c:1)*(a.match(n)?Math.pow(10,3):1)*(a.match(o)?Math.pow(10,6):1)*(a.match(r)?Math.pow(10,9):1)*(a.match(i)?Math.pow(10,12):1)*(t.indexOf("%")>-1?.01:1)*((t.split("-").length+Math.min(t.split("(").length-1,t.split(")").length-1))%2?1:-1)*Number(t.replace(/[^0-9\.]+/g,"")),e._value=c?Math.ceil(e._value):e._value}return e._value}function s(e,t,n){var o,r,i=t.indexOf("$"),s=t.indexOf("("),a=t.indexOf("-"),l="";return t.indexOf(" $")>-1?(l=" ",t=t.replace(" $","")):t.indexOf("$ ")>-1?(l=" ",t=t.replace("$ ","")):t=t.replace("$",""),r=c(e._value,t,n),1>=i?r.indexOf("(")>-1||r.indexOf("-")>-1?(r=r.split(""),o=1,(s>i||a>i)&&(o=0),r.splice(o,0,m[v].currency.symbol+l),r=r.join("")):r=m[v].currency.symbol+l+r:r.indexOf(")")>-1?(r=r.split(""),r.splice(-1,0,l+m[v].currency.symbol),r=r.join("")):r=r+l+m[v].currency.symbol,r}function a(e,t,n){var o,r="",i=100*e._value;return t.indexOf(" %")>-1?(r=" ",t=t.replace(" %","")):t=t.replace("%",""),o=c(i,t,n),o.indexOf(")")>-1?(o=o.split(""),o.splice(-1,0,r+"%"),o=o.join("")):o=o+r+"%",o}function l(e){var t=Math.floor(e._value/60/60),n=Math.floor((e._value-60*t*60)/60),o=Math.round(e._value-60*t*60-60*n);return t+":"+(10>n?"0"+n:n)+":"+(10>o?"0"+o:o)}function u(e){var t=e.split(":"),n=0;return 3===t.length?(n+=60*Number(t[0])*60,n+=60*Number(t[1]),n+=Number(t[2])):2===t.length&&(n+=60*Number(t[0]),n+=Number(t[1])),Number(n)}function c(e,t,n){var r,i,s,a,l,u,c=!1,d=!1,h=!1,f="",p=!1,g=!1,y=!1,b=!1,C=!1,R="",_="",S=Math.abs(e),E=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],T="",M=!1;if(0===e&&null!==w)return w;if(t.indexOf("(")>-1?(c=!0,t=t.slice(1,-1)):t.indexOf("+")>-1&&(d=!0,t=t.replace(/\+/g,"")),t.indexOf("a")>-1&&(p=t.indexOf("aK")>=0,g=t.indexOf("aM")>=0,y=t.indexOf("aB")>=0,b=t.indexOf("aT")>=0,C=p||g||y||b,t.indexOf(" a")>-1?(f=" ",t=t.replace(" a","")):t=t.replace("a",""),S>=Math.pow(10,12)&&!C||b?(f+=m[v].abbreviations.trillion,e/=Math.pow(10,12)):S=Math.pow(10,9)&&!C||y?(f+=m[v].abbreviations.billion,e/=Math.pow(10,9)):S=Math.pow(10,6)&&!C||g?(f+=m[v].abbreviations.million,e/=Math.pow(10,6)):(S=Math.pow(10,3)&&!C||p)&&(f+=m[v].abbreviations.thousand,e/=Math.pow(10,3))),t.indexOf("b")>-1)for(t.indexOf(" b")>-1?(R=" ",t=t.replace(" b","")):t=t.replace("b",""),s=0;s<=E.length;s++)if(r=Math.pow(1024,s),i=Math.pow(1024,s+1),e>=r&&i>e){R+=E[s],r>0&&(e/=r);break}return t.indexOf("o")>-1&&(t.indexOf(" o")>-1?(_=" ",t=t.replace(" o","")):t=t.replace("o",""),_+=m[v].ordinal(e)),t.indexOf("[.]")>-1&&(h=!0,t=t.replace("[.]",".")),a=e.toString().split(".")[0],l=t.split(".")[1],u=t.indexOf(","),l?(l.indexOf("[")>-1?(l=l.replace("]",""),l=l.split("["),T=o(e,l[0].length+l[1].length,n,l[1].length)):T=o(e,l.length,n),a=T.split(".")[0],T=T.split(".")[1].length?m[v].delimiters.decimal+T.split(".")[1]:"",h&&0===Number(T.slice(1))&&(T="")):a=o(e,null,n),a.indexOf("-")>-1&&(a=a.slice(1),M=!0),u>-1&&(a=a.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+m[v].delimiters.thousands)),0===t.indexOf(".")&&(a=""),(c&&M?"(":"")+(!c&&M?"-":"")+(!M&&d?"+":"")+a+T+(_?_:"")+(f?f:"")+(R?R:"")+(c&&M?")":"")}function d(e,t){m[e]=t}function h(e){var t=e.toString().split(".");return t.length<2?1:Math.pow(10,t[1].length)}function f(){var e=Array.prototype.slice.call(arguments);return e.reduce(function(e,t){var n=h(e),o=h(t);return n>o?n:o},-(1/0))}var p,g="1.5.3",m={},v="en",w=null,y="0,0",b="undefined"!=typeof n&&n.exports;p=function(e){return p.isNumeral(e)?e=e.value():0===e||"undefined"==typeof e?e=0:Number(e)||(e=p.fn.unformat(e)),new t(Number(e))},p.version=g,p.isNumeral=function(e){return e instanceof t},p.language=function(e,t){if(!e)return v;if(e&&!t){if(!m[e])throw new Error("Unknown language : "+e);v=e}return(t||!m[e])&&d(e,t),p},p.languageData=function(e){if(!e)return m[v];if(!m[e])throw new Error("Unknown language : "+e);return m[e]},p.language("en",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(e){var t=e%10;return 1===~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th"},currency:{symbol:"$"}}),p.zeroFormat=function(e){w="string"==typeof e?e:null},p.defaultFormat=function(e){y="string"==typeof e?e:"0.0"},p.validate=function(e,t){var n,o,r,i,s,a,l,u;if("string"!=typeof e&&(e+="",console.warn&&console.warn("Numeral.js: Value is not string. It has been co-erced to: ",e)),e=e.trim(),""===e)return!1;e=e.replace(/^[+-]?/,"");try{l=p.languageData(t)}catch(c){l=p.languageData(p.language())}return r=l.currency.symbol,s=l.abbreviations,n=l.delimiters.decimal,o="."===l.delimiters.thousands?"\\.":l.delimiters.thousands,u=e.match(/^[^\d\.\,]+/),null!==u&&(e=e.substr(1),u[0]!==r)?!1:(u=e.match(/[^\d]+$/),null!==u&&(e=e.slice(0,-1),u[0]!==s.thousand&&u[0]!==s.million&&u[0]!==s.billion&&u[0]!==s.trillion)?!1:e.match(/^\d+$/)?!0:(a=new RegExp(o+"{2}"),e.match(/[^\d.,]/g)?!1:(i=e.split(n),i.length>2?!1:i.length<2?!!i[0].match(/^\d+.*\d$/)&&!i[0].match(a):""===i[0]?!i[0].match(a)&&!!i[1].match(/^\d+$/):1===i[0].length?!!i[0].match(/^\d+$/)&&!i[0].match(a)&&!!i[1].match(/^\d+$/):!!i[0].match(/^\d+.*\d$/)&&!i[0].match(a)&&!!i[1].match(/^\d+$/))))},"function"!=typeof Array.prototype.reduce&&(Array.prototype.reduce=function(e,t){if(null===this||"undefined"==typeof this)throw new TypeError("Array.prototype.reduce called on null or undefined");if("function"!=typeof e)throw new TypeError(e+" is not a function");var n,o,r=this.length>>>0,i=!1;for(1n;++n)this.hasOwnProperty(n)&&(i?o=e(o,this[n],n,this):(o=this[n],i=!0));if(!i)throw new TypeError("Reduce of empty array with no initial value");return o}),p.fn=t.prototype={clone:function(){return p(this)},format:function(e,t){return r(this,e?e:y,void 0!==t?t:Math.round)},unformat:function(e){return"[object Number]"===Object.prototype.toString.call(e)?e:i(this,e?e:y)},value:function(){return this._value},valueOf:function(){return this._value},set:function(e){return this._value=Number(e),this},add:function(e){function t(e,t,o,r){return e+n*t}var n=f.call(null,this._value,e);return this._value=[this._value,e].reduce(t,0)/n,this},subtract:function(e){function t(e,t,o,r){return e-n*t}var n=f.call(null,this._value,e);return this._value=[e].reduce(t,this._value*n)/n,this},multiply:function(e){function t(e,t,n,o){var r=f(e,t);return e*r*(t*r)/(r*r)}return this._value=[this._value,e].reduce(t,1),this},divide:function(e){function t(e,t,n,o){var r=f(e,t);return e*r/(t*r)}return this._value=[this._value,e].reduce(t),this},difference:function(e){return Math.abs(p(this._value).subtract(e).value())}},b&&(n.exports=p),"undefined"==typeof ender&&(this.numeral=p),"function"==typeof e&&e.amd&&e([],function(){return p})}).call(window)},{}],pikaday:[function(t,n,o){/*! +!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.Handsontable=e()}}(function(){var e;return function(e,t,n){return function o(e,t,n){function i(a,l){if(!t[a]){if(!e[a]){var u="function"==typeof require&&require;if(!l&&u)return u(a,!0);if(r)return r(a,!0);if(s[a]&&"undefined"!=typeof window[s[a]])return window[s[a]];var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var d=t[a]={exports:{}};e[a][0].call(d.exports,function(t){var n=e[a][1][t];return i(n?n:t)},d,d.exports,o,e,t,n)}return t[a].exports}for(var r="function"==typeof require&&require,s=JSON.parse('{"zeroclipboard":"ZeroClipboard","moment":"moment","pikaday":"Pikaday"}')||{},a=0;a1)for(t=1,o=arguments.length;o>t;t++)i.push(arguments[t]);if(l){if("undefined"==typeof l[e])throw new Error("Handsontable do not provide action: "+e);r=l[e].apply(l,i),"destroy"===e&&a.removeData()}return r}}(window,jQuery,Handsontable)},{}],2:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableBorder:{get:function(){return y}},__esModule:{value:!0}});var o,i,r,s,a,l=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),u=l.getComputedStyle,c=l.getTrimmingContainer,d=l.innerWidth,h=l.innerHeight,f=l.offset,p=l.outerHeight,g=l.outerWidth,m=(i=e("helpers/dom/event"),i&&i.__esModule&&i||{"default":i}).stopImmediatePropagation,v=(r=e("eventManager"),r&&r.__esModule&&r||{"default":r}).EventManager,w=(s=e("cell/coords"),s&&s.__esModule&&s||{"default":s}).WalkontableCellCoords,y=((a=e("overlay/_base.js"),a&&a.__esModule&&a||{"default":a}).WalkontableOverlay,function(e,t){t&&(this.eventManager=new v(e),this.instance=e,this.wot=e,this.settings=t,this.mouseDown=!1,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(t),this.registerListeners())});$traceurRuntime.createClass(y,{registerListeners:function(){var e=this;this.eventManager.addEventListener(document.body,"mousedown",function(){return e.onMouseDown()}),this.eventManager.addEventListener(document.body,"mouseup",function(){return e.onMouseUp()});for(var t=this,n=function(n,o){t.eventManager.addEventListener(t.main.childNodes[n],"mouseenter",function(t){return e.onMouseEnter(t,e.main.childNodes[n])})},o=0,i=this.main.childNodes.length;i>o;o++)n(o,i)},onMouseDown:function(){this.mouseDown=!0},onMouseUp:function(){this.mouseDown=!1},onMouseEnter:function(e,t){function n(e){return e.clientYMath.ceil(r.top+r.height)?!0:e.clientXMath.ceil(r.left+r.width)?!0:void 0}function o(e){n(e)&&(i.eventManager.removeEventListener(document.body,"mousemove",o),t.style.display="block")}if(this.mouseDown&&this.wot.getSetting("hideBorderOnMouseDownOver")){e.preventDefault(),m(e);var i=this,r=t.getBoundingClientRect();t.style.display="none",this.eventManager.addEventListener(document.body,"mousemove",o)}},createBorders:function(e){this.main=document.createElement("div");var t=["top","left","bottom","right","corner"],n=this.main.style;n.position="absolute",n.top=0,n.left=0;for(var o=0;5>o;o++){var i=t[o],r=document.createElement("div");r.className="wtBorder "+(this.settings.className||""),this.settings[i]&&this.settings[i].hide&&(r.className+=" hidden"),n=r.style,n.backgroundColor=this.settings[i]&&this.settings[i].color?this.settings[i].color:e.border.color,n.height=this.settings[i]&&this.settings[i].width?this.settings[i].width+"px":e.border.width+"px",n.width=this.settings[i]&&this.settings[i].width?this.settings[i].width+"px":e.border.width+"px",this.main.appendChild(r)}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(" "),Handsontable.mobileBrowser&&this.createMultipleSelectorHandles(),this.disappear(),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 e=10,t=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 n={position:"absolute",height:t+"px",width:t+"px","border-radius":parseInt(t/1.5,10)+"px"};for(var o in n)n.hasOwnProperty(o)&&(this.selectionHandles.styles.bottomRightHitArea[o]=n[o],this.selectionHandles.styles.topLeftHitArea[o]=n[o]);var i={position:"absolute",height:e+"px",width:e+"px","border-radius":parseInt(e/1.5,10)+"px",background:"#F5F5FF",border:"1px solid #4285c8"};for(var r in i)i.hasOwnProperty(r)&&(this.selectionHandles.styles.bottomRight[r]=i[r],this.selectionHandles.styles.topLeft[r]=i[r]);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(e,t){return this.wot.selections.area.cellRange&&(e!=this.wot.selections.area.cellRange.to.row||t!=this.wot.selections.area.cellRange.to.col)},updateMultipleSelectionHandlesPosition:function(e,t,n,o,i,r){var s=parseInt(this.selectionHandles.styles.topLeft.width,10),a=parseInt(this.selectionHandles.styles.topLeftHitArea.width,10);this.selectionHandles.styles.topLeft.top=parseInt(n-s,10)+"px",this.selectionHandles.styles.topLeft.left=parseInt(o-s,10)+"px",this.selectionHandles.styles.topLeftHitArea.top=parseInt(n-a/4*3,10)+"px",this.selectionHandles.styles.topLeftHitArea.left=parseInt(o-a/4*3,10)+"px",this.selectionHandles.styles.bottomRight.top=parseInt(n+r,10)+"px",this.selectionHandles.styles.bottomRight.left=parseInt(o+i,10)+"px",this.selectionHandles.styles.bottomRightHitArea.top=parseInt(n+r-a/4,10)+"px",this.selectionHandles.styles.bottomRightHitArea.left=parseInt(o+i-a/4,10)+"px",this.settings.border.multipleSelectionHandlesVisible&&this.settings.border.multipleSelectionHandlesVisible()?(this.selectionHandles.styles.topLeft.display="block",this.selectionHandles.styles.topLeftHitArea.display="block",this.isPartRange(e,t)?(this.selectionHandles.styles.bottomRight.display="none",this.selectionHandles.styles.bottomRightHitArea.display="none"):(this.selectionHandles.styles.bottomRight.display="block",this.selectionHandles.styles.bottomRightHitArea.display="block")):(this.selectionHandles.styles.topLeft.display="none",this.selectionHandles.styles.bottomRight.display="none",this.selectionHandles.styles.topLeftHitArea.display="none",this.selectionHandles.styles.bottomRightHitArea.display="none"),e==this.wot.wtSettings.getSetting("fixedRowsTop")||t==this.wot.wtSettings.getSetting("fixedColumnsLeft")?(this.selectionHandles.styles.topLeft.zIndex="9999",this.selectionHandles.styles.topLeftHitArea.zIndex="9999"):(this.selectionHandles.styles.topLeft.zIndex="",this.selectionHandles.styles.topLeftHitArea.zIndex="")},appear:function(e){if(!this.disabled){var t,n,o,i,r,s,a,l,m,v,y,b,C,R,_,S,E,T,M;M=this.wot.wtTable.getRenderedRowsCount();for(var O=0;M>O;O++){var k=this.wot.wtTable.rowFilter.renderedToSource(O);if(k>=e[0]&&k<=e[2]){C=k;break}}for(var H=M-1;H>=0;H--){var D=this.wot.wtTable.rowFilter.renderedToSource(H);if(D>=e[0]&&D<=e[2]){_=D;break}}M=this.wot.wtTable.getRenderedColumnsCount();for(var x=0;M>x;x++){var A=this.wot.wtTable.columnFilter.renderedToSource(x);if(A>=e[1]&&A<=e[3]){R=A;break}}for(var P=M-1;P>=0;P--){var N=this.wot.wtTable.columnFilter.renderedToSource(P);if(N>=e[1]&&N<=e[3]){S=N;break}}if(void 0===C||void 0===R)return void this.disappear();t=C!==_||R!==S,n=this.wot.wtTable.getCell(new w(C,R)),o=t?this.wot.wtTable.getCell(new w(_,S)):n,i=f(n),r=t?f(o):i,s=f(this.wot.wtTable.TABLE),l=i.top,y=r.top+p(o)-l,v=i.left,b=r.left+g(o)-v,a=l-s.top-1,m=v-s.left-1;var L=u(n);parseInt(L.borderTopWidth,10)>0&&(a+=1,y=y>0?y-1:0),parseInt(L.borderLeftWidth,10)>0&&(m+=1,b=b>0?b-1:0),this.topStyle.top=a+"px",this.topStyle.left=m+"px",this.topStyle.width=b+"px",this.topStyle.display="block",this.leftStyle.top=a+"px",this.leftStyle.left=m+"px",this.leftStyle.height=y+"px",this.leftStyle.display="block";var W=Math.floor(this.settings.border.width/2);this.bottomStyle.top=a+y-W+"px",this.bottomStyle.left=m+"px",this.bottomStyle.width=b+"px",this.bottomStyle.display="block",this.rightStyle.top=a+"px",this.rightStyle.left=m+b-W+"px",this.rightStyle.height=y+1+"px",this.rightStyle.display="block",Handsontable.mobileBrowser||!this.hasSetting(this.settings.border.cornerVisible)||this.isPartRange(_,S)?this.cornerStyle.display="none":(this.cornerStyle.top=a+y-4+"px",this.cornerStyle.left=m+b-4+"px",this.cornerStyle.borderRightWidth=this.cornerDefaultStyle.borderWidth,this.cornerStyle.width=this.cornerDefaultStyle.width,this.cornerStyle.display="block",E=c(this.wot.wtTable.TABLE),S===this.wot.getSetting("totalColumns")-1&&(T=o.offsetLeft+g(o)>=d(E),T&&(this.cornerStyle.left=Math.floor(m+b-3-parseInt(this.cornerDefaultStyle.width)/2)+"px",this.cornerStyle.borderRightWidth=0)),_===this.wot.getSetting("totalRows")-1&&(T=o.offsetTop+p(o)>=h(E),T&&(this.cornerStyle.top=Math.floor(a+y-3-parseInt(this.cornerDefaultStyle.height)/2)+"px",this.cornerStyle.borderBottomWidth=0))),Handsontable.mobileBrowser&&this.updateMultipleSelectionHandlesPosition(C,R,a,m,b,y)}},disappear:function(){this.topStyle.display="none",this.leftStyle.display="none",this.bottomStyle.display="none",this.rightStyle.display="none",this.cornerStyle.display="none",Handsontable.mobileBrowser&&(this.selectionHandles.styles.topLeft.display="none",this.selectionHandles.styles.bottomRight.display="none")},hasSetting:function(e){return"function"==typeof e?e():!!e}},{}),window.WalkontableBorder=y},{"cell/coords":5,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,"overlay/_base.js":11}],3:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableViewportColumnsCalculator:{get:function(){return i}},__esModule:{value:!0}});var o=new WeakMap,i=function(e,t,n,i,r,s,a){var l=void 0!==arguments[7]?arguments[7]:function(e){return e};o.set(this,{viewportWidth:e,scrollOffset:t,totalColumns:n,columnWidthFn:i,overrideFn:r,onlyFullyVisible:s,stretchingColumnWidthFn:l}),this.count=0,this.startColumn=null,this.endColumn=null,this.startPosition=null,this.stretchAllRatio=0,this.stretchLastWidth=0,this.stretch=a,this.totalTargetWidth=0,this.needVerifyLastColumnWidth=!0,this.stretchAllColumnsWidth=[],this.calculate()},r=i;$traceurRuntime.createClass(i,{calculate:function(){for(var e,t=0,n=!0,i=[],r=o.get(this),s=r.onlyFullyVisible,a=r.overrideFn,l=r.scrollOffset,u=r.totalColumns,c=r.viewportWidth,d=0;u>d;d++)if(e=this._getColumnWidth(d),l>=t&&!s&&(this.startColumn=d),t>=l&&l+c>=t+e&&(null==this.startColumn&&(this.startColumn=d),this.endColumn=d),i.push(t),t+=e,s||(this.endColumn=d),t>=l+c){n=!1;break}if(this.endColumn===u-1&&n)for(this.startColumn=this.endColumn;this.startColumn>0;){var h=i[this.endColumn]+e-i[this.startColumn-1];if((c>=h||!s)&&this.startColumn--,h>c)break}null!==this.startColumn&&a&&a(this),this.startPosition=i[this.startColumn],void 0==this.startPosition&&(this.startPosition=null),null!==this.startColumn&&(this.count=this.endColumn-this.startColumn+1)},refreshStretching:function(e){if("none"!==this.stretch){this.totalTargetWidth=e;for(var t=o.get(this),n=t.totalColumns,i=0,r=0;n>r;r++){var s=this._getColumnWidth(r),a=t.stretchingColumnWidthFn(void 0,r);"number"==typeof a?e-=a:i+=s}var l=e-i;if("all"===this.stretch&&l>0)this.stretchAllRatio=e/i,this.stretchAllColumnsWidth=[],this.needVerifyLastColumnWidth=!0;else if("last"===this.stretch&&e!==1/0){var u=this._getColumnWidth(n-1),c=l+u;this.stretchLastWidth=c>=0?c:u}}},getStretchedColumnWidth:function(e,t){var n=null;return"all"===this.stretch&&0!==this.stretchAllRatio?n=this._getStretchedAllColumnWidth(e,t):"last"===this.stretch&&0!==this.stretchLastWidth&&(n=this._getStretchedLastColumnWidth(e)),n},_getStretchedAllColumnWidth:function(e,t){var n=0,i=o.get(this),r=i.totalColumns;if(!this.stretchAllColumnsWidth[e]){var s=Math.round(t*this.stretchAllRatio),a=i.stretchingColumnWidthFn(s,e);void 0===a?this.stretchAllColumnsWidth[e]=s:this.stretchAllColumnsWidth[e]=isNaN(a)?this._getColumnWidth(e):a}if(this.stretchAllColumnsWidth.length===r&&this.needVerifyLastColumnWidth){this.needVerifyLastColumnWidth=!1;for(var l=0;lf;f++){var p=l(f);if(void 0===p&&(p=r.DEFAULT_HEIGHT),u>=e&&!s&&(this.startRow=f),e>=u&&u+d-h>=e+p&&(null===this.startRow&&(this.startRow=f),this.endRow=f),n.push(e),e+=p,s||(this.endRow=f),e>=u+d-h){t=!1;break}}if(this.endRow===c-1&&t)for(this.startRow=this.endRow;this.startRow>0;){var g=n[this.endRow]+p-n[this.startRow-1];if((d-h>=g||!s)&&this.startRow--,g>=d-h)break}null!==this.startRow&&a&&a(this),this.startPosition=n[this.startRow],void 0==this.startPosition&&(this.startPosition=null),null!==this.startRow&&(this.count=this.endRow-this.startRow+1)}},{get DEFAULT_HEIGHT(){return 23}}),window.WalkontableViewportRowsCalculator=i},{}],5:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableCellCoords:{get:function(){return o}},__esModule:{value:!0}});var o=function(e,t){"undefined"!=typeof e&&"undefined"!=typeof t?(this.row=e,this.col=t):(this.row=null,this.col=null)};$traceurRuntime.createClass(o,{isValid:function(e){return this.row<0||this.col<0?!1:!(this.row>=e.getSetting("totalRows")||this.col>=e.getSetting("totalColumns"))},isEqual:function(e){return e===this?!0:this.row===e.row&&this.col===e.col},isSouthEastOf:function(e){return this.row>=e.row&&this.col>=e.col},isNorthWestOf:function(e){return this.row<=e.row&&this.col<=e.col},isSouthWestOf:function(e){return this.row>=e.row&&this.col<=e.col},isNorthEastOf:function(e){return this.row<=e.row&&this.col>=e.col}},{}),window.WalkontableCellCoords=o},{}],6:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableCellRange:{get:function(){return r}},__esModule:{value:!0}});var o,i=(o=e("cell/coords"),o&&o.__esModule&&o||{"default":o}).WalkontableCellCoords,r=function(e,t,n){this.highlight=e,this.from=t,this.to=n},s=r;$traceurRuntime.createClass(r,{isValid:function(e){return this.from.isValid(e)&&this.to.isValid(e)},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(e){var t=this.getTopLeftCorner(),n=this.getBottomRightCorner();return e.row<0&&(e.row=0),e.col<0&&(e.col=0),t.row<=e.row&&n.row>=e.row&&t.col<=e.col&&n.col>=e.col},includesRange:function(e){return this.includes(e.getTopLeftCorner())&&this.includes(e.getBottomRightCorner())},isEqual:function(e){return Math.min(this.from.row,this.to.row)==Math.min(e.from.row,e.to.row)&&Math.max(this.from.row,this.to.row)==Math.max(e.from.row,e.to.row)&&Math.min(this.from.col,this.to.col)==Math.min(e.from.col,e.to.col)&&Math.max(this.from.col,this.to.col)==Math.max(e.from.col,e.to.col)},overlaps:function(e){return e.isSouthEastOf(this.getTopLeftCorner())&&e.isNorthWestOf(this.getBottomRightCorner())},isSouthEastOf:function(e){return this.getTopLeftCorner().isSouthEastOf(e)||this.getBottomRightCorner().isSouthEastOf(e)},isNorthWestOf:function(e){return this.getTopLeftCorner().isNorthWestOf(e)||this.getBottomRightCorner().isNorthWestOf(e)},expand:function(e){var t=this.getTopLeftCorner(),n=this.getBottomRightCorner();return e.rown.row||e.col>n.col?(this.from=new i(Math.min(t.row,e.row),Math.min(t.col,e.col)),this.to=new i(Math.max(n.row,e.row),Math.max(n.col,e.col)),!0):!1},expandByRange:function(e){if(this.includesRange(e)||!this.overlaps(e))return!1;var t=this.getTopLeftCorner(),n=this.getBottomRightCorner(),o=(this.getTopRightCorner(),this.getBottomLeftCorner(),e.getTopLeftCorner()),r=e.getBottomRightCorner(),a=Math.min(t.row,o.row),l=Math.min(t.col,o.col),u=Math.max(n.row,r.row),c=Math.max(n.col,r.col),d=new i(a,l),h=new i(u,c),f=new s(d,d,h).isCorner(this.from,e),p=e.isEqual(new s(d,d,h));return f&&!p&&(this.from.col>d.col&&(d.col=c,h.col=l),this.from.row>d.row&&(d.row=u,h.row=a)),this.from=d,this.to=h,!0},getDirection:function(){return this.from.isNorthWestOf(this.to)?"NW-SE":this.from.isNorthEastOf(this.to)?"NE-SW":this.from.isSouthEastOf(this.to)?"SE-NW":this.from.isSouthWestOf(this.to)?"SW-NE":void 0},setDirection:function(e){switch(e){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()}},getTopLeftCorner:function(){return new i(Math.min(this.from.row,this.to.row),Math.min(this.from.col,this.to.col))},getBottomRightCorner:function(){return new i(Math.max(this.from.row,this.to.row),Math.max(this.from.col,this.to.col))},getTopRightCorner:function(){return new i(Math.min(this.from.row,this.to.row),Math.max(this.from.col,this.to.col))},getBottomLeftCorner:function(){return new i(Math.max(this.from.row,this.to.row),Math.min(this.from.col,this.to.col))},isCorner:function(e,t){return t&&t.includes(e)&&(this.getTopLeftCorner().isEqual(new i(t.from.row,t.from.col))||this.getTopRightCorner().isEqual(new i(t.from.row,t.to.col))||this.getBottomLeftCorner().isEqual(new i(t.to.row,t.from.col))||this.getBottomRightCorner().isEqual(new i(t.to.row,t.to.col)))?!0:e.isEqual(this.getTopLeftCorner())||e.isEqual(this.getTopRightCorner())||e.isEqual(this.getBottomLeftCorner())||e.isEqual(this.getBottomRightCorner())},getOppositeCorner:function(e,t){if(!(e instanceof i))return!1;if(t&&t.includes(e)){if(this.getTopLeftCorner().isEqual(new i(t.from.row,t.from.col)))return this.getBottomRightCorner();if(this.getTopRightCorner().isEqual(new i(t.from.row,t.to.col)))return this.getBottomLeftCorner();if(this.getBottomLeftCorner().isEqual(new i(t.to.row,t.from.col)))return this.getTopRightCorner();if(this.getBottomRightCorner().isEqual(new i(t.to.row,t.to.col)))return this.getTopLeftCorner()}return e.isEqual(this.getBottomRightCorner())?this.getTopLeftCorner():e.isEqual(this.getTopLeftCorner())?this.getBottomRightCorner():e.isEqual(this.getTopRightCorner())?this.getBottomLeftCorner():e.isEqual(this.getBottomLeftCorner())?this.getTopRightCorner():void 0},getBordersSharedWith:function(e){if(!this.includesRange(e))return[];var t={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)},n={top:Math.min(e.from.row,e.to.row),bottom:Math.max(e.from.row,e.to.row),left:Math.min(e.from.col,e.to.col),right:Math.max(e.from.col,e.to.col)},o=[];return t.top==n.top&&o.push("top"),t.right==n.right&&o.push("right"),t.bottom==n.bottom&&o.push("bottom"),t.left==n.left&&o.push("left"),o},getInner:function(){for(var e=this.getTopLeftCorner(),t=this.getBottomRightCorner(),n=[],o=e.row;o<=t.row;o++)for(var r=e.col;r<=t.col;r++)this.from.row===o&&this.from.col===r||this.to.row===o&&this.to.col===r||n.push(new i(o,r));return n},getAll:function(){for(var e=this.getTopLeftCorner(),t=this.getBottomRightCorner(),n=[],o=e.row;o<=t.row;o++)for(var r=e.col;r<=t.col;r++)e.row===o&&e.col===r?n.push(e):t.row===o&&t.col===r?n.push(t):n.push(new i(o,r));return n},forAll:function(e){for(var t=this.getTopLeftCorner(),n=this.getBottomRightCorner(),o=t.row;o<=n.row;o++)for(var i=t.col;i<=n.col;i++){var r=e(o,i);if(r===!1)return}}},{}),window.WalkontableCellRange=r},{"cell/coords":5}],7:[function(e,t,n){"use strict";Object.defineProperties(n,{Walkontable:{get:function(){return x}},__esModule:{value:!0}});var o,i,r,s,a,l,u,c,d,h,f,p,g,m,v=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),w=v.addClass,y=v.fastInnerText,b=v.isVisible,C=v.removeClass,R=(i=e("helpers/object"),i&&i.__esModule&&i||{"default":i}).objectEach,_=(r=e("helpers/string"),r&&r.__esModule&&r||{"default":r}),S=_.toUpperCaseFirst,E=_.randomString,T=(s=e("event"),s&&s.__esModule&&s||{"default":s}).WalkontableEvent,M=(a=e("overlays"),a&&a.__esModule&&a||{"default":a}).WalkontableOverlays,O=(l=e("scroll"),l&&l.__esModule&&l||{"default":l}).WalkontableScroll,k=(u=e("settings"),u&&u.__esModule&&u||{"default":u}).WalkontableSettings,H=(c=e("table"),c&&c.__esModule&&c||{"default":c}).WalkontableTable,D=(d=e("viewport"),d&&d.__esModule&&d||{"default":d}).WalkontableViewport,x=((h=e("overlay/_base.js"),h&&h.__esModule&&h||{"default":h}).WalkontableOverlay,(f=e("overlay/top.js"),f&&f.__esModule&&f||{"default":f}).WalkontableTopOverlay,(p=e("overlay/left.js"),p&&p.__esModule&&p||{"default":p}).WalkontableLeftOverlay,(g=e("overlay/debug.js"),g&&g.__esModule&&g||{"default":g}).WalkontableDebugOverlay,(m=e("overlay/topLeftCorner.js"),m&&m.__esModule&&m||{"default":m}).WalkontableTopLeftCornerOverlay,function(e){var t=[];if(this.guid="wt_"+E(),e.cloneSource?(this.cloneSource=e.cloneSource,this.cloneOverlay=e.cloneOverlay,this.wtSettings=e.cloneSource.wtSettings,this.wtTable=new H(this,e.table,e.wtRootElement),this.wtScroll=new O(this),this.wtViewport=e.cloneSource.wtViewport,this.wtEvent=new T(this),this.selections=this.cloneSource.selections):(this.wtSettings=new k(this,e),this.wtTable=new H(this,e.table),this.wtScroll=new O(this),this.wtViewport=new D(this),this.wtEvent=new T(this),this.selections=this.getSetting("selections"),this.wtOverlays=new M(this),this.exportSettingsAsClassNames()),this.wtTable.THEAD.childNodes.length&&this.wtTable.THEAD.childNodes[0].childNodes.length){for(var n=0,o=this.wtTable.THEAD.childNodes[0].childNodes.length;o>n;n++)t.push(this.wtTable.THEAD.childNodes[0].childNodes[n].innerHTML);this.getSetting("columnHeaders").length||this.update("columnHeaders",[function(e,n){y(n,t[e])}])}this.drawn=!1,this.drawInterrupted=!1});$traceurRuntime.createClass(x,{draw:function(){var e=void 0!==arguments[0]?arguments[0]:!1;return this.drawInterrupted=!1,e||b(this.wtTable.TABLE)?this.wtTable.draw(e):this.drawInterrupted=!0,this},getCell:function(e){var t=void 0!==arguments[1]?arguments[1]:!1;if(!t)return this.wtTable.getCell(e);var n=this.wtSettings.getSetting("totalRows"),o=this.wtSettings.getSetting("fixedRowsTop"),i=this.wtSettings.getSetting("fixedRowsBottom"),r=this.wtSettings.getSetting("fixedColumnsLeft");if(e.row=n-i){if(this.wtOverlays.bottomLeftCornerOverlay.clone)return this.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.getCell(e)}else{if(e.coln-i&&this.wtOverlays.bottomOverlay.clone)return this.wtOverlays.bottomOverlay.clone.wtTable.getCell(e)}return this.wtTable.getCell(e)},update:function(e,t){return this.wtSettings.update(e,t)},scrollVertical:function(e){return this.wtOverlays.topOverlay.scrollTo(e),this.getSetting("onScrollVertically"),this},scrollHorizontal:function(e){return this.wtOverlays.leftOverlay.scrollTo(e),this.getSetting("onScrollHorizontally"),this},scrollViewport:function(e){return this.wtScroll.scrollViewport(e),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(e){return this.cloneOverlay?this.cloneOverlay.type===e:!1},exportSettingsAsClassNames:function(){var e=this,t={rowHeaders:["array"],columnHeaders:["array"]},n=[],o=[];R(t,function(t,i){t.indexOf("array")>-1&&e.getSetting(i).length&&o.push("ht"+S(i)),n.push("ht"+S(i))}),C(this.wtTable.wtRootElement.parentNode,n),w(this.wtTable.wtRootElement.parentNode,o)},getSetting:function(e,t,n,o,i){return this.wtSettings.getSetting(e,t,n,o,i)},hasSetting:function(e){return this.wtSettings.has(e)},destroy:function(){this.wtOverlays.destroy(),this.wtEvent.destroy()}},{}),window.Walkontable=x},{event:8,"helpers/dom/element":45,"helpers/object":51,"helpers/string":53,"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(e,t,n){"use strict";function o(e){var t=this,n=c(e);this.instance=e;var o=[null,null];this.dblClickTimeout=[null,null];var i,r=function(e){var n=t.parentCell(e.realTarget);l(e.realTarget,"corner")?t.instance.getSetting("onCellCornerMouseDown",e,e.realTarget):n.TD&&t.instance.hasSetting("onCellMouseDown")&&t.instance.getSetting("onCellMouseDown",e,n.coords,n.TD,t.instance),2!==e.button&&n.TD&&(o[0]=n.TD,clearTimeout(t.dblClickTimeout[0]),t.dblClickTimeout[0]=setTimeout(function(){o[0]=null},1e3))},s=function(e){t.instance.touchMoving=!0},d=function(e){n.addEventListener(this,"touchmove",s),t.checkIfTouchMove=setTimeout(function(){return t.instance.touchMoving===!0?(t.instance.touchMoving=void 0,void n.removeEventListener("touchmove",s,!1)):void r(e)},30)},h=function(e){var n,o,i;t.instance.hasSetting("onCellMouseOver")&&(n=t.instance.wtTable.TABLE,o=a(e.realTarget,["TD","TH"],n),i=t.instance.cloneSource||t.instance,o&&o!==i.lastMouseOver&&u(o,n)&&(i.lastMouseOver=o,t.instance.getSetting("onCellMouseOver",e,t.instance.wtTable.getCoords(o),o,t.instance)))},f=function(e){if(2!==e.button){var n=t.parentCell(e.realTarget);n.TD===o[0]&&n.TD===o[1]?(l(e.realTarget,"corner")?t.instance.getSetting("onCellCornerDblClick",e,n.coords,n.TD,t.instance):t.instance.getSetting("onCellDblClick",e,n.coords,n.TD,t.instance),o[0]=null,o[1]=null):n.TD===o[0]&&(o[1]=n.TD,clearTimeout(t.dblClickTimeout[1]),t.dblClickTimeout[1]=setTimeout(function(){o[1]=null},500))}},p=function(e){clearTimeout(i),e.preventDefault(),f(e)};if(n.addEventListener(this.instance.wtTable.holder,"mousedown",r),n.addEventListener(this.instance.wtTable.TABLE,"mouseover",h),n.addEventListener(this.instance.wtTable.holder,"mouseup",f),this.instance.wtTable.holder.parentNode.parentNode&&Handsontable.mobileBrowser&&!t.instance.wtTable.isWorkingOnClone()){var g="."+this.instance.wtTable.holder.parentNode.className.split(" ").join(".");n.addEventListener(this.instance.wtTable.holder,"touchstart",function(e){t.instance.touchApplied=!0,u(e.target,g)&&d.call(e.target,e)}),n.addEventListener(this.instance.wtTable.holder,"touchend",function(e){t.instance.touchApplied=!1,u(e.target,g)&&p.call(e.target,e)}),t.instance.momentumScrolling||(t.instance.momentumScrolling={}),n.addEventListener(this.instance.wtTable.holder,"scroll",function(e){clearTimeout(t.instance.momentumScrolling._timeout),t.instance.momentumScrolling.ongoing||t.instance.getSetting("onBeforeTouchScroll"),t.instance.momentumScrolling.ongoing=!0,t.instance.momentumScrolling._timeout=setTimeout(function(){t.instance.touchApplied||(t.instance.momentumScrolling.ongoing=!1,t.instance.getSetting("onAfterMomentumScroll"))},200)})}n.addEventListener(window,"resize",function(){"none"!==t.instance.getSetting("stretchH")&&t.instance.draw()}),this.destroy=function(){clearTimeout(this.dblClickTimeout[0]),clearTimeout(this.dblClickTimeout[1]),n.destroy()}}Object.defineProperties(n,{WalkontableEvent:{get:function(){return o}},__esModule:{value:!0}});var i,r,s=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),a=s.closest,l=s.hasClass,u=s.isChildOf,c=(r=e("eventManager"),r&&r.__esModule&&r||{"default":r}).eventManager;o.prototype.parentCell=function(e){var t={},n=this.instance.wtTable.TABLE,o=a(e,["TD","TH"],n),i=a(o,["TABLE"]);return o&&u(o,n)&&i==n?(t.coords=this.instance.wtTable.getCoords(o),t.TD=o):l(e,"wtBorder")&&l(e,"current")?(t.coords=this.instance.selections.current.cellRange.highlight,t.TD=this.instance.wtTable.getCell(t.coords)):l(e,"wtBorder")&&l(e,"area")&&this.instance.selections.area.cellRange&&(t.coords=this.instance.selections.area.cellRange.to,t.TD=this.instance.wtTable.getCell(t.coords)),t},window.WalkontableEvent=o},{eventManager:41,"helpers/dom/element":45}],9:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableColumnFilter:{get:function(){return o}},__esModule:{value:!0}});var o=function(e,t,n){this.offset=e,this.total=t,this.countTH=n};$traceurRuntime.createClass(o,{offsetted:function(e){return e+this.offset},unOffsetted:function(e){return e-this.offset},renderedToSource:function(e){return this.offsetted(e)},sourceToRendered:function(e){return this.unOffsetted(e)},offsettedTH:function(e){return e-this.countTH},unOffsettedTH:function(e){return e+this.countTH},visibleRowHeadedColumnToSourceColumn:function(e){return this.renderedToSource(this.offsettedTH(e)); +},sourceColumnToVisibleRowHeadedColumn:function(e){return this.unOffsettedTH(this.sourceToRendered(e))}},{}),window.WalkontableColumnFilter=o},{}],10:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableRowFilter:{get:function(){return o}},__esModule:{value:!0}});var o=function(e,t,n){this.offset=e,this.total=t,this.countTH=n};$traceurRuntime.createClass(o,{offsetted:function(e){return e+this.offset},unOffsetted:function(e){return e-this.offset},renderedToSource:function(e){return this.offsetted(e)},sourceToRendered:function(e){return this.unOffsetted(e)},offsettedTH:function(e){return e-this.countTH},unOffsettedTH:function(e){return e+this.countTH},visibleColHeadedRowToSourceRow:function(e){return this.renderedToSource(this.offsettedTH(e))},sourceRowToVisibleColHeadedRow:function(e){return this.unOffsettedTH(this.sourceToRendered(e))}},{}),window.WalkontableRowFilter=o},{}],11:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableOverlay:{get:function(){return h}},__esModule:{value:!0}});var o,i,r,s=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),a=s.getScrollableElement,l=s.getTrimmingContainer,u=(i=e("helpers/object"),i&&i.__esModule&&i||{"default":i}).defineGetter,c=(r=e("eventManager"),r&&r.__esModule&&r||{"default":r}).eventManager,d={},h=function(e){u(this,"wot",e,{writable:!1}),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=l(this.hider.parentNode.parentNode),this.needFullRender=this.shouldBeRendered(),this.areElementSizesAdjusted=!1},f=h;$traceurRuntime.createClass(h,{shouldBeRendered:function(){return!0},updateTrimmingContainer:function(){this.trimmingContainer=l(this.hider.parentNode.parentNode)},updateMainScrollableElement:function(){this.mainTableScrollableElement=a(this.wot.wtTable.TABLE)},makeClone:function(e){if(-1===f.CLONE_TYPES.indexOf(e))throw new Error('Clone type "'+e+'" is not supported.');var t=document.createElement("DIV"),n=document.createElement("TABLE");t.className="ht_clone_"+e+" handsontable",t.style.position="absolute",t.style.top=0,t.style.left=0,t.style.overflow="hidden",n.className=this.wot.wtTable.TABLE.className,t.appendChild(n),this.type=e,this.wot.wtTable.wtRootElement.parentNode.appendChild(t);var o=this.wot.getSetting("preventOverflow");return o===!0||"horizontal"===o&&this.type===f.CLONE_TOP||"vertical"===o&&this.type===f.CLONE_LEFT?this.mainTableScrollableElement=window:this.mainTableScrollableElement=a(this.wot.wtTable.TABLE),new Walkontable({cloneSource:this.wot,cloneOverlay:this,table:n})},refresh:function(){var e=void 0!==arguments[0]?arguments[0]:!1,t=this.shouldBeRendered();this.clone&&(this.needFullRender||t)&&this.clone.draw(e),this.needFullRender=t},destroy:function(){c(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[f.CLONE_TOP,f.CLONE_BOTTOM,f.CLONE_LEFT,f.CLONE_TOP_LEFT_CORNER,f.CLONE_BOTTOM_LEFT_CORNER,f.CLONE_DEBUG]},registerOverlay:function(e,t){if(-1===f.CLONE_TYPES.indexOf(e))throw new Error("Unsupported overlay ("+e+").");d[e]=t},createOverlay:function(e,t){return new d[e](t)},isOverlayTypeOf:function(e,t){return e&&d[t]?e instanceof d[t]:!1}}),window.WalkontableOverlay=h},{eventManager:41,"helpers/dom/element":45,"helpers/object":51}],12:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableDebugOverlay:{get:function(){return a}},__esModule:{value:!0}});var o,i,r=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}).addClass,s=(i=e("_base"),i&&i.__esModule&&i||{"default":i}).WalkontableOverlay,a=function(e){$traceurRuntime.superConstructor(l).call(this,e),this.clone=this.makeClone(s.CLONE_DEBUG),this.clone.wtTable.holder.style.opacity=.4,this.clone.wtTable.holder.style.textShadow="0 0 2px #ff0000",r(this.clone.wtTable.holder.parentNode,"wtDebugVisible")},l=a;$traceurRuntime.createClass(a,{},{},s),window.WalkontableDebugOverlay=a,s.registerOverlay(s.CLONE_DEBUG,a)},{_base:11,"helpers/dom/element":45}],13:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableLeftOverlay:{get:function(){return v}},__esModule:{value:!0}});var o,i,r=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),s=r.addClass,a=r.getScrollbarWidth,l=r.getScrollLeft,u=r.getWindowScrollTop,c=r.hasClass,d=r.outerWidth,h=r.innerHeight,f=r.removeClass,p=r.setOverlayPosition,g=r.resetCssTransform,m=(i=e("_base"),i&&i.__esModule&&i||{"default":i}).WalkontableOverlay,v=function(e){$traceurRuntime.superConstructor(w).call(this,e),this.clone=this.makeClone(m.CLONE_LEFT)},w=v;$traceurRuntime.createClass(v,{shouldBeRendered:function(){return!(!this.wot.getSetting("fixedColumnsLeft")&&!this.wot.getSetting("rowHeaders").length)},resetFixedPosition:function(){if(this.needFullRender&&this.wot.wtTable.holder.parentNode){var e=this.clone.wtTable.holder.parentNode,t=0,n=this.wot.getSetting("preventOverflow");if(this.trimmingContainer!==window||n&&"horizontal"===n)t=this.getScrollPosition(),g(e);else{var o,i,r=this.wot.wtTable.hider.getBoundingClientRect(),s=Math.ceil(r.left),a=Math.ceil(r.right);i=this.wot.wtTable.hider.style.top,i=""===i?0:i,o=0>s&&a-e.offsetWidth>0?-s:0,t=o,o+="px",p(e,o,i)}this.adjustHeaderBordersPosition(t),this.adjustElementsSize()}},setScrollPosition:function(e){this.mainTableScrollableElement===window?window.scrollTo(e,u()):this.mainTableScrollableElement.scrollLeft=e},onScroll:function(){this.wot.getSetting("onScrollVertically")},sumCellSizes:function(e,t){for(var n=0,o=this.wot.wtSettings.defaultColumnWidth;t>e;)n+=this.wot.wtTable.getStretchedColumnWidth(e)||o,e++;return n},adjustElementsSize:function(){var e=void 0!==arguments[0]?arguments[0]:!1;this.updateTrimmingContainer(),(this.needFullRender||e)&&(this.adjustRootElementSize(),this.adjustRootChildrenSize(),e||(this.areElementSizesAdjusted=!0))},adjustRootElementSize:function(){var e,t=this.wot.wtTable.holder,n=t.clientHeight===t.offsetHeight?0:a(),o=this.clone.wtTable.holder.parentNode,i=o.style,r=this.wot.getSetting("preventOverflow");if(this.trimmingContainer!==window||"vertical"===r){var s=this.wot.wtViewport.getWorkspaceHeight()-n;s=Math.min(s,h(this.wot.wtTable.wtRootElement)),i.height=s+"px"}else i.height="";this.clone.wtTable.holder.style.height=i.height,e=d(this.clone.wtTable.TABLE),i.width=(0===e?e:e+4)+"px"},adjustRootChildrenSize:function(){var e=a();this.clone.wtTable.hider.style.height=this.hider.style.height,this.clone.wtTable.holder.style.height=this.clone.wtTable.holder.parentNode.style.height,0===e&&(e=30),this.clone.wtTable.holder.style.width=parseInt(this.clone.wtTable.holder.parentNode.style.width,10)+e+"px"},applyToDOM:function(){var e=this.wot.getSetting("totalColumns");if(this.areElementSizesAdjusted||this.adjustElementsSize(),"number"==typeof this.wot.wtViewport.columnsRenderCalculator.startPosition)this.spreader.style.left=this.wot.wtViewport.columnsRenderCalculator.startPosition+"px";else{if(0!==e)throw new Error("Incorrect value of the columnsRenderCalculator");this.spreader.style.left="0"}this.spreader.style.right="",this.needFullRender&&this.syncOverlayOffset()},syncOverlayOffset:function(){"number"==typeof this.wot.wtViewport.rowsRenderCalculator.startPosition?this.clone.wtTable.spreader.style.top=this.wot.wtViewport.rowsRenderCalculator.startPosition+"px":this.clone.wtTable.spreader.style.top=""},scrollTo:function(e,t){var n=this.getTableParentOffset(),o=this.wot.cloneSource?this.wot.cloneSource:this.wot,i=o.wtTable.holder,r=0;t&&i.offsetWidth!==i.clientWidth&&(r=a()),t?(n+=this.sumCellSizes(0,e+1),n-=this.wot.wtViewport.getViewportWidth()):n+=this.sumCellSizes(this.wot.getSetting("fixedColumnsLeft"),e),n+=r,this.setScrollPosition(n)},getTableParentOffset:function(){var e=this.wot.getSetting("preventOverflow"),t=0;return e||this.trimmingContainer!==window||(t=this.wot.wtTable.holderOffset.left),t},getScrollPosition:function(){return l(this.mainTableScrollableElement)},adjustHeaderBordersPosition:function(e){var t=this.wot.wtTable.holder.parentNode,n=this.wot.getSetting("rowHeaders"),o=this.wot.getSetting("fixedColumnsLeft");if(o&&!n.length)s(t,"innerBorderLeft");else if(!o&&n.length){var i=c(t,"innerBorderLeft");e?s(t,"innerBorderLeft"):f(t,"innerBorderLeft"),(!i&&e||i&&!e)&&this.wot.wtOverlays.adjustElementsSize()}}},{},m),window.WalkontableLeftOverlay=v,m.registerOverlay(m.CLONE_LEFT,v)},{_base:11,"helpers/dom/element":45}],14:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableTopOverlay:{get:function(){return v}},__esModule:{value:!0}});var o,i,r=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),s=r.addClass,a=r.getScrollbarWidth,l=r.getScrollTop,u=r.getWindowScrollLeft,c=r.hasClass,d=r.outerHeight,h=r.innerWidth,f=r.removeClass,p=r.setOverlayPosition,g=r.resetCssTransform,m=(i=e("_base"),i&&i.__esModule&&i||{"default":i}).WalkontableOverlay,v=function(e){$traceurRuntime.superConstructor(w).call(this,e),this.clone=this.makeClone(m.CLONE_TOP)},w=v;$traceurRuntime.createClass(v,{shouldBeRendered:function(){return!(!this.wot.getSetting("fixedRowsTop")&&!this.wot.getSetting("columnHeaders").length)},resetFixedPosition:function(){if(this.needFullRender&&this.wot.wtTable.holder.parentNode){var e=this.clone.wtTable.holder.parentNode,t=0,n=this.wot.getSetting("preventOverflow");if(this.trimmingContainer!==window||n&&"vertical"===n)t=this.getScrollPosition(),g(e);else{var o,i,r=this.wot.wtTable.hider.getBoundingClientRect(),s=Math.ceil(r.top),a=Math.ceil(r.bottom);o=this.wot.wtTable.hider.style.left,o=""===o?0:o,i=0>s&&a-e.offsetHeight>0?-s:0,t=i,i+="px",p(e,o,i)}this.adjustHeaderBordersPosition(t),this.adjustElementsSize()}},setScrollPosition:function(e){this.mainTableScrollableElement===window?window.scrollTo(u(),e):this.mainTableScrollableElement.scrollTop=e},onScroll:function(){this.wot.getSetting("onScrollHorizontally")},sumCellSizes:function(e,t){for(var n=0,o=this.wot.wtSettings.settings.defaultRowHeight;t>e;){var i=this.wot.wtTable.getRowHeight(e);n+=void 0===i?o:i,e++}return n},adjustElementsSize:function(){var e=void 0!==arguments[0]?arguments[0]:!1;this.updateTrimmingContainer(),(this.needFullRender||e)&&(this.adjustRootElementSize(),this.adjustRootChildrenSize(),e||(this.areElementSizesAdjusted=!0))},adjustRootElementSize:function(){var e,t=this.wot.wtTable.holder,n=t.clientWidth===t.offsetWidth?0:a(),o=this.clone.wtTable.holder.parentNode,i=o.style,r=this.wot.getSetting("preventOverflow");if(this.trimmingContainer!==window||"horizontal"===r){var s=this.wot.wtViewport.getWorkspaceWidth()-n;s=Math.min(s,h(this.wot.wtTable.wtRootElement)),i.width=s+"px"}else i.width="";this.clone.wtTable.holder.style.width=i.width,e=d(this.clone.wtTable.TABLE),i.height=(0===e?e:e+4)+"px"},adjustRootChildrenSize:function(){var e=a();this.clone.wtTable.hider.style.width=this.hider.style.width,this.clone.wtTable.holder.style.width=this.clone.wtTable.holder.parentNode.style.width,0===e&&(e=30),this.clone.wtTable.holder.style.height=parseInt(this.clone.wtTable.holder.parentNode.style.height,10)+e+"px"},applyToDOM:function(){var e=this.wot.getSetting("totalRows");if(this.areElementSizesAdjusted||this.adjustElementsSize(),"number"==typeof this.wot.wtViewport.rowsRenderCalculator.startPosition)this.spreader.style.top=this.wot.wtViewport.rowsRenderCalculator.startPosition+"px";else{if(0!==e)throw new Error("Incorrect value of the rowsRenderCalculator");this.spreader.style.top="0"}this.spreader.style.bottom="",this.needFullRender&&this.syncOverlayOffset()},syncOverlayOffset:function(){"number"==typeof this.wot.wtViewport.columnsRenderCalculator.startPosition?this.clone.wtTable.spreader.style.left=this.wot.wtViewport.columnsRenderCalculator.startPosition+"px":this.clone.wtTable.spreader.style.left=""},scrollTo:function(e,t){var n=this.getTableParentOffset(),o=this.wot.cloneSource?this.wot.cloneSource:this.wot,i=o.wtTable.holder,r=0;if(t&&i.offsetHeight!==i.clientHeight&&(r=a()),t){var s=this.wot.getSetting("fixedRowsBottom"),l=(this.wot.getSetting("fixedRowsTop"),this.wot.getSetting("totalRows"));n+=this.sumCellSizes(0,e+1),n-=this.wot.wtViewport.getViewportHeight()-this.sumCellSizes(l-s,l),n+=1}else n+=this.sumCellSizes(this.wot.getSetting("fixedRowsTop"),e);n+=r,this.setScrollPosition(n)},getTableParentOffset:function(){return this.mainTableScrollableElement===window?this.wot.wtTable.holderOffset.top:0},getScrollPosition:function(){return l(this.mainTableScrollableElement)},adjustHeaderBordersPosition:function(e){if(0===this.wot.getSetting("fixedRowsTop")&&this.wot.getSetting("columnHeaders").length>0){var t=this.wot.wtTable.holder.parentNode,n=c(t,"innerBorderTop");e||0===this.wot.getSetting("totalRows")?s(t,"innerBorderTop"):f(t,"innerBorderTop"),(!n&&e||n&&!e)&&this.wot.wtOverlays.adjustElementsSize()}if(0===this.wot.getSetting("rowHeaders").length){var o=this.clone.wtTable.THEAD.querySelectorAll("th:nth-of-type(2)");if(o)for(var i=0;ic&&h-e.offsetWidth>0&&(f=-c+"px"),o&&"horizontal"!==o||0>r&&d-e.offsetHeight>0&&(p=-r+"px"),l(e,f,p)}else u(e);e.style.height=(0===t?t:t+4)+"px",e.style.width=(0===n?n:n+4)+"px"}}},{},c),window.WalkontableTopLeftCornerOverlay=d,c.registerOverlay(c.CLONE_TOP_LEFT_CORNER,d)},{_base:11,"helpers/dom/element":45}],16:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableOverlays:{get:function(){return f}},__esModule:{value:!0}});var o,i,r,s=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),a=s.getScrollableElement,l=s.getScrollbarWidth,u=s.getScrollLeft,c=s.getScrollTop,d=(i=e("helpers/unicode"),i&&i.__esModule&&i||{"default":i}).isKey,h=(r=e("eventManager"),r&&r.__esModule&&r||{"default":r}).EventManager,f=function(e){this.wot=e,this.instance=this.wot,this.eventManager=new h(this.wot),this.wot.update("scrollbarWidth",l()),this.wot.update("scrollbarHeight",l()),this.scrollableElement=a(this.wot.wtTable.TABLE),this.topOverlay=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_TOP,this.wot),"undefined"==typeof WalkontableBottomOverlay?this.bottomOverlay={needFullRender:!1}:this.bottomOverlay=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_BOTTOM,this.wot),this.leftOverlay=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_LEFT,this.wot),this.topOverlay.needFullRender&&this.leftOverlay.needFullRender&&(this.topLeftCornerOverlay=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_TOP_LEFT_CORNER,this.wot)),this.bottomOverlay.needFullRender&&this.leftOverlay.needFullRender&&"undefined"!=typeof WalkontableBottomLeftCornerOverlay?this.bottomLeftCornerOverlay=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER,this.wot):this.bottomLeftCornerOverlay={needFullRender:!1},this.wot.getSetting("debug")&&(this.debug=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_DEBUG,this.wot)),this.destroyed=!1,this.keyPressed=!1,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.pendingScrollCallbacks={master:{top:0,left:0},top:{left:0},bottom:{left:0},left:{top:0}},this.verticalScrolling=!1,this.horizontalScrolling=!1,this.delegatedScrollCallback=!1,this.registeredListeners=[],this.registerListeners()};$traceurRuntime.createClass(f,{refreshAll:function(){if(this.wot.drawn){if(!this.wot.wtTable.holder.parentNode)return void this.destroy();this.wot.draw(!0),this.verticalScrolling&&this.leftOverlay.onScroll(),this.horizontalScrolling&&this.topOverlay.onScroll(),this.verticalScrolling=!1,this.horizontalScrolling=!1}},registerListeners:function(){var e=this,t=this.topOverlay.mainTableScrollableElement,n=this.leftOverlay.mainTableScrollableElement,o=[];for(o.push([document.documentElement,"keydown",function(t){return e.onKeyDown(t)}]),o.push([document.documentElement,"keyup",function(){return e.onKeyUp()}]),o.push([document,"visibilitychange",function(){return e.onKeyUp()}]),o.push([t,"scroll",function(t){return e.onTableScroll(t)}]),t!==n&&o.push([n,"scroll",function(t){return e.onTableScroll(t)}]),this.topOverlay.needFullRender&&(o.push([this.topOverlay.clone.wtTable.holder,"scroll",function(t){return e.onTableScroll(t)}]),o.push([this.topOverlay.clone.wtTable.holder,"wheel",function(t){return e.onTableScroll(t)}])),this.bottomOverlay.needFullRender&&(o.push([this.bottomOverlay.clone.wtTable.holder,"scroll",function(t){return e.onTableScroll(t)}]),o.push([this.bottomOverlay.clone.wtTable.holder,"wheel",function(t){return e.onTableScroll(t)}])),this.leftOverlay.needFullRender&&(o.push([this.leftOverlay.clone.wtTable.holder,"scroll",function(t){return e.onTableScroll(t)}]),o.push([this.leftOverlay.clone.wtTable.holder,"wheel",function(t){return e.onTableScroll(t)}])),this.topOverlay.trimmingContainer!==window&&this.leftOverlay.trimmingContainer!==window&&o.push([window,"wheel",function(t){var n,o=t.wheelDeltaY||t.deltaY,i=t.wheelDeltaX||t.deltaX;e.topOverlay.clone.wtTable.holder.contains(t.realTarget)?n="top":e.bottomOverlay.clone&&e.bottomOverlay.clone.wtTable.holder.contains(t.realTarget)?n="bottom":e.leftOverlay.clone.wtTable.holder.contains(t.realTarget)&&(n="left"),"top"==n&&0!==o?t.preventDefault():"left"==n&&0!==i?t.preventDefault():"bottom"==n&&0!==o&&t.preventDefault()}]);o.length;){var i=o.pop();this.eventManager.addEventListener(i[0],i[1],i[2]),this.registeredListeners.push(i)}},deregisterListeners:function(){for(;this.registeredListeners.length;){var e=this.registeredListeners.pop();this.eventManager.removeEventListener(e[0],e[1],e[2])}},onTableScroll:function(e){if(!Handsontable.mobileBrowser){var t=this.leftOverlay.mainTableScrollableElement,n=this.topOverlay.mainTableScrollableElement,o=e.target;this.keyPressed&&(n!==window&&o!==window&&!e.target.contains(n)||t!==window&&o!==window&&!e.target.contains(t))||("scroll"===e.type?this.syncScrollPositions(e):this.translateMouseWheelToScroll(e))}},onKeyDown:function(e){this.keyPressed=d(e.keyCode,"ARROW_UP|ARROW_RIGHT|ARROW_DOWN|ARROW_LEFT")},onKeyUp:function(){this.keyPressed=!1},translateMouseWheelToScroll:function(e){var t,n=this.topOverlay.clone.wtTable.holder,o=this.bottomOverlay.clone?this.bottomOverlay.clone.wtTable.holder:null,i=this.leftOverlay.clone.wtTable.holder,r={type:"wheel"},s=e.target,a=e.wheelDeltaY||-1*e.deltaY,l=e.wheelDeltaX||-1*e.deltaX;for(1===e.deltaMode&&(a=120*a,l=120*l);s!=document&&null!=s;){if(s.className.indexOf("wtHolder")>-1){t=s;break}s=s.parentNode}return r.target=t,t==n?this.syncScrollPositions(r,-.2*a):t==o?this.syncScrollPositions(r,-.2*a):t==i&&this.syncScrollPositions(r,-.2*l),!1},syncScrollPositions:function(e){var t=void 0!==arguments[1]?arguments[1]:null;if(!this.destroyed){if(0===arguments.length)return void this.syncScrollWithMaster();var n,o,i,r=this.leftOverlay.mainTableScrollableElement,s=this.topOverlay.mainTableScrollableElement,a=e.target,l=0,d=!1,h=!1,f=this.wot.getSetting("preventOverflow");this.topOverlay.needFullRender&&(n=this.topOverlay.clone.wtTable.holder),this.bottomOverlay.needFullRender&&(i=this.bottomOverlay.clone.wtTable.holder),this.leftOverlay.needFullRender&&(o=this.leftOverlay.clone.wtTable.holder),a===document&&(a=window),a===r||a===s?(l=u(f?this.scrollableElement:a),this.horizontalScrolling=!0,this.overlayScrollPositions.master.left=l,d=!0,this.pendingScrollCallbacks.master.left>0?this.pendingScrollCallbacks.master.left--:(n&&n.scrollLeft!==l&&(null==t&&this.pendingScrollCallbacks.top.left++,n.scrollLeft=l,h=r!==window),i&&i.scrollLeft!==l&&(null==t&&this.pendingScrollCallbacks.bottom.left++,i.scrollLeft=l,h=r!==window)),l=c(a),this.verticalScrolling=!0,this.overlayScrollPositions.master.top=l,d=!0,this.pendingScrollCallbacks.master.top>0?this.pendingScrollCallbacks.master.top--:o&&o.scrollTop!==l&&(null==t&&this.pendingScrollCallbacks.left.top++,o.scrollTop=l,h=s!==window)):a===i?(l=u(a),this.horizontalScrolling=!0,this.overlayScrollPositions.bottom.left=l,d=!0,this.pendingScrollCallbacks.bottom.left>0?this.pendingScrollCallbacks.bottom.left--:(null==t&&this.pendingScrollCallbacks.master.left++,r.scrollLeft=l,n&&n.scrollLeft!==l&&(null==t&&this.pendingScrollCallbacks.top.left++,n.scrollLeft=l,h=s!==window)),null!==t&&(d=!0,s.scrollTop+=t)):a===n?(l=u(a),this.horizontalScrolling=!0,this.overlayScrollPositions.top.left=l,d=!0,this.pendingScrollCallbacks.top.left>0?this.pendingScrollCallbacks.top.left--:(null==t&&this.pendingScrollCallbacks.master.left++,r.scrollLeft=l),null!==t&&(d=!0,s.scrollTop+=t),i&&i.scrollLeft!==l&&(null==t&&this.pendingScrollCallbacks.bottom.left++,i.scrollLeft=l,h=s!==window)):a===o&&(l=c(a),this.overlayScrollPositions.left.top!==l&&(this.verticalScrolling=!0,this.overlayScrollPositions.left.top=l,d=!0,this.pendingScrollCallbacks.left.top>0?this.pendingScrollCallbacks.left.top--:(null==t&&this.pendingScrollCallbacks.master.top++,s.scrollTop=l)),null!==t&&(d=!0,s.scrollLeft+=t)),!this.keyPressed&&d&&"scroll"===e.type&&(this.delegatedScrollCallback?this.delegatedScrollCallback=!1:this.refreshAll(),h&&(this.delegatedScrollCallback=!0))}},syncScrollWithMaster:function(){var e=this.topOverlay.mainTableScrollableElement;this.topOverlay.needFullRender&&(this.topOverlay.clone.wtTable.holder.scrollLeft=e.scrollLeft),this.leftOverlay.needFullRender&&(this.leftOverlay.clone.wtTable.holder.scrollTop=e.scrollTop)},updateMainScrollableElements:function(){this.deregisterListeners(),this.leftOverlay.updateMainScrollableElement(),this.topOverlay.updateMainScrollableElement(),this.bottomOverlay.needFullRender&&this.bottomOverlay.updateMainScrollableElement(),this.scrollableElement=a(this.wot.wtTable.TABLE),this.registerListeners()},destroy:function(){this.eventManager.destroy(),this.topOverlay.destroy(),this.bottomOverlay.clone&&this.bottomOverlay.destroy(),this.leftOverlay.destroy(),this.topLeftCornerOverlay&&this.topLeftCornerOverlay.destroy(),this.bottomLeftCornerOverlay&&this.bottomLeftCornerOverlay.clone&&this.bottomLeftCornerOverlay.destroy(),this.debug&&this.debug.destroy(),this.destroyed=!0},refresh:function(){var e=void 0!==arguments[0]?arguments[0]:!1;if(this.topOverlay.areElementSizesAdjusted&&this.leftOverlay.areElementSizesAdjusted){var t=this.wot.wtTable.wtRootElement.parentNode||this.wot.wtTable.wtRootElement,n=t.clientWidth,o=t.clientHeight;n===this.spreaderLastSize.width&&o===this.spreaderLastSize.height||(this.spreaderLastSize.width=n,this.spreaderLastSize.height=o,this.adjustElementsSize())}this.bottomOverlay.clone&&this.bottomOverlay.refresh(e),this.leftOverlay.refresh(e),this.topOverlay.refresh(e),this.topLeftCornerOverlay&&this.topLeftCornerOverlay.refresh(e),this.bottomLeftCornerOverlay&&this.bottomLeftCornerOverlay.clone&&this.bottomLeftCornerOverlay.refresh(e),this.debug&&this.debug.refresh(e)},adjustElementsSize:function(){var e=void 0!==arguments[0]?arguments[0]:!1,t=this.wot.getSetting("totalColumns"),n=this.wot.getSetting("totalRows"),o=this.wot.wtViewport.getRowHeaderWidth(),i=this.wot.wtViewport.getColumnHeaderHeight(),r=this.wot.wtTable.hider.style;r.width=o+this.leftOverlay.sumCellSizes(0,t)+"px",r.height=i+this.topOverlay.sumCellSizes(0,n)+1+"px",this.topOverlay.adjustElementsSize(e),this.leftOverlay.adjustElementsSize(e),this.bottomOverlay.clone&&this.bottomOverlay.adjustElementsSize(e)},applyToDOM:function(){this.topOverlay.areElementSizesAdjusted&&this.leftOverlay.areElementSizesAdjusted||this.adjustElementsSize(),this.topOverlay.applyToDOM(),this.bottomOverlay.clone&&this.bottomOverlay.applyToDOM(),this.leftOverlay.applyToDOM()}},{}),window.WalkontableOverlays=f},{eventManager:41,"helpers/dom/element":45,"helpers/unicode":54}],17:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableScroll:{get:function(){return p}},__esModule:{value:!0}});var o,i,r=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),s=r.innerHeight,a=r.innerWidth,l=r.getScrollLeft,u=r.getScrollTop,c=r.offset,d=(i=e("helpers/number"),i&&i.__esModule&&i||{"default":i}),h=d.rangeEach,f=d.rangeEachReverse,p=function(e){this.wot=e,this.instance=e};$traceurRuntime.createClass(p,{scrollViewport:function(e){if(this.wot.drawn){var t=this._getVariables(),n=t.topOverlay,o=t.leftOverlay,i=t.totalRows,r=t.totalColumns,s=t.fixedRowsTop,a=t.fixedRowsBottom,l=t.fixedColumnsLeft;if(e.row<0||e.row>i-1)throw new Error("row "+e.row+" does not exist");if(e.col<0||e.col>r-1)throw new Error("column "+e.col+" does not exist");e.row>=s&&e.rowthis.getLastVisibleRow()&&e.row=l&&e.colthis.getLastVisibleColumn()&&o.scrollTo(e.col,!0)}},getFirstVisibleRow:function(){var e=this._getVariables(),t=e.topOverlay,n=e.wtTable,o=e.wtViewport,i=e.totalRows,r=e.fixedRowsTop,a=n.getFirstVisibleRow();if(t.mainTableScrollableElement===window){var l=c(n.wtRootElement),d=s(n.hider),h=s(window),p=u(window);if(l.top+d-h<=p){var g=o.getColumnHeaderHeight();g+=t.sumCellSizes(0,r),f(i,1,function(e){return g+=t.sumCellSizes(e-1,e),l.top+d-g<=p?(a=e,!1):void 0})}}return a},getLastVisibleRow:function(){var e=this._getVariables(),t=e.topOverlay,n=e.wtTable,o=e.wtViewport,i=e.totalRows,r=n.getLastVisibleRow();if(t.mainTableScrollableElement===window){var a=c(n.wtRootElement),l=s(window),d=u(window);if(a.top>d){var f=o.getColumnHeaderHeight();h(1,i,function(e){return f+=t.sumCellSizes(e-1,e),a.top+f-d>=l?(r=e-2,!1):void 0})}}return r},getFirstVisibleColumn:function(){var e=this._getVariables(),t=e.leftOverlay,n=e.wtTable,o=e.wtViewport,i=e.totalColumns,r=(e.fixedColumnsLeft,n.getFirstVisibleColumn());if(t.mainTableScrollableElement===window){var s=c(n.wtRootElement),u=a(n.hider),d=a(window),h=l(window);if(s.left+u-d<=h){var p=o.getRowHeaderWidth();f(i,1,function(e){return p+=t.sumCellSizes(e-1,e),s.left+u-p<=h?(r=e,!1):void 0})}}return r},getLastVisibleColumn:function(){var e=this._getVariables(),t=e.leftOverlay,n=e.wtTable,o=e.wtViewport,i=e.totalColumns,r=n.getLastVisibleColumn();if(t.mainTableScrollableElement===window){var s=c(n.wtRootElement),u=a(window),d=l(window);if(s.left>d){var f=o.getRowHeaderWidth();h(1,i,function(e){return f+=t.sumCellSizes(e-1,e),s.left+f-d>=u?(r=e-2,!1):void 0})}}return r},_getVariables:function(){var e=this.wot,t=e.wtOverlays.topOverlay,n=e.wtOverlays.leftOverlay,o=e.wtTable,i=e.wtViewport,r=e.getSetting("totalRows"),s=e.getSetting("totalColumns"),a=e.getSetting("fixedRowsTop"),l=e.getSetting("fixedRowsBottom"),u=e.getSetting("fixedColumnsLeft");return{topOverlay:t,leftOverlay:n,wtTable:o,wtViewport:i,totalRows:r,totalColumns:s,fixedRowsTop:a,fixedRowsBottom:l,fixedColumnsLeft:u}}},{}),window.WalkontableScroll=p},{"helpers/dom/element":45,"helpers/number":50}],18:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableSelection:{get:function(){return d}},__esModule:{value:!0}});var o,i,r,s,a=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}).addClass,l=(i=e("border"),i&&i.__esModule&&i||{"default":i}).WalkontableBorder,u=(r=e("cell/coords"),r&&r.__esModule&&r||{"default":r}).WalkontableCellCoords,c=(s=e("cell/range"),s&&s.__esModule&&s||{"default":s}).WalkontableCellRange,d=function(e,t){this.settings=e,this.cellRange=t||null,this.instanceBorders={}};$traceurRuntime.createClass(d,{getBorder:function(e){return this.instanceBorders[e.guid]?this.instanceBorders[e.guid]:void(this.instanceBorders[e.guid]=new l(e,this.settings))},isEmpty:function(){return null===this.cellRange},add:function(e){this.isEmpty()?this.cellRange=new c(e,e,e):this.cellRange.expand(e)},replace:function(e,t){if(!this.isEmpty()){if(this.cellRange.from.isEqual(e))return this.cellRange.from=t,!0;if(this.cellRange.to.isEqual(e))return this.cellRange.to=t,!0}return!1},clear:function(){this.cellRange=null},getCorners:function(){var e=this.cellRange.getTopLeftCorner(),t=this.cellRange.getBottomRightCorner();return[e.row,e.col,t.row,t.col]},addClassAtCoords:function(e,t,n,o){var i=e.wtTable.getCell(new u(t,n));"object"==typeof i&&a(i,o)},draw:function(e){if(this.isEmpty()){if(this.settings.border){var t=this.getBorder(e);t&&t.disappear()}}else{for(var n,o,i,r=e.wtTable.getRenderedRowsCount(),s=e.wtTable.getRenderedColumnsCount(),l=this.getCorners(),u=0;s>u;u++)o=e.wtTable.columnFilter.renderedToSource(u),o>=l[1]&&o<=l[3]&&(i=e.wtTable.getColumnHeader(o),i&&this.settings.highlightColumnClassName&&a(i,this.settings.highlightColumnClassName));for(var c=0;r>c;c++){n=e.wtTable.rowFilter.renderedToSource(c),n>=l[0]&&n<=l[2]&&(i=e.wtTable.getRowHeader(n),i&&this.settings.highlightRowClassName&&a(i,this.settings.highlightRowClassName));for(var d=0;s>d;d++)o=e.wtTable.columnFilter.renderedToSource(d),n>=l[0]&&n<=l[2]&&o>=l[1]&&o<=l[3]?this.settings.className&&this.addClassAtCoords(e,n,o,this.settings.className):n>=l[0]&&n<=l[2]?this.settings.highlightRowClassName&&this.addClassAtCoords(e,n,o,this.settings.highlightRowClassName):o>=l[1]&&o<=l[3]&&this.settings.highlightColumnClassName&&this.addClassAtCoords(e,n,o,this.settings.highlightColumnClassName)}if(e.getSetting("onBeforeDrawBorders",l,this.settings.className),this.settings.border){var h=this.getBorder(e);h&&h.appear(l)}}}},{}),window.WalkontableSelection=d},{border:2,"cell/coords":5,"cell/range":6,"helpers/dom/element":45}],19:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableSettings:{get:function(){return r}},__esModule:{value:!0}});var o,i=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}).fastInnerText,r=function(e,t){var n=this;this.wot=e,this.instance=e,this.defaults={table:void 0,debug:!1,externalRowCalculator:!1,stretchH:"none",currentRowClassName:null,currentColumnClassName:null,preventOverflow:function(){return!1},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(e,t,o){var r=n.getSetting("data",e,t);i(o,void 0===r||null===r?"":r)},columnWidth:function(e){},rowHeight:function(e){},defaultRowHeight:23,defaultColumnWidth:50,selections:null,hideBorderOnMouseDownOver:!1,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(e){return e},scrollbarWidth:10,scrollbarHeight:10,renderAllRows:!1,groups:!1,rowHeaderWidth:null,columnHeaderHeight:null},this.settings={};for(var o in this.defaults)if(this.defaults.hasOwnProperty(o))if(void 0!==t[o])this.settings[o]=t[o];else{if(void 0===this.defaults[o])throw new Error('A required setting "'+o+'" was not provided');this.settings[o]=this.defaults[o]}};$traceurRuntime.createClass(r,{update:function(e,t){if(void 0===t)for(var n in e)e.hasOwnProperty(n)&&(this.settings[n]=e[n]);else this.settings[e]=t;return this.wot},getSetting:function(e,t,n,o,i){return"function"==typeof this.settings[e]?this.settings[e](t,n,o,i):void 0!==t&&Array.isArray(this.settings[e])?this.settings[e][t]:this.settings[e]},has:function(e){return!!this.settings[e]}},{}),window.WalkontableSettings=r},{"helpers/dom/element":45}],20:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableTable:{get:function(){return _}},__esModule:{value:!0}});var o,i,r,s,a,l,u=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),c=u.getStyle,d=u.getTrimmingContainer,h=u.hasClass,f=u.index,p=u.offset,g=u.removeClass,m=u.removeTextNodes,v=u.overlayContainsElement,w=u.closest,y=(i=e("cell/coords"),i&&i.__esModule&&i||{"default":i}).WalkontableCellCoords,b=((r=e("cell/range"),r&&r.__esModule&&r||{"default":r}).WalkontableCellRange,(s=e("filter/column"),s&&s.__esModule&&s||{"default":s}).WalkontableColumnFilter),C=(a=e("filter/row"),a&&a.__esModule&&a||{"default":a}).WalkontableRowFilter,R=(l=e("tableRenderer"),l&&l.__esModule&&l||{"default":l}).WalkontableTableRenderer,_=function(e,t){this.wot=e,this.instance=this.wot,this.TABLE=t,this.TBODY=null,this.THEAD=null,this.COLGROUP=null,this.tableOffset=0,this.holderOffset=0,m(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(_,{fixTableDomTree:function(){this.TBODY=this.TABLE.querySelector("tbody"),this.TBODY||(this.TBODY=document.createElement("tbody"),this.TABLE.appendChild(this.TBODY)),this.THEAD=this.TABLE.querySelector("thead"),this.THEAD||(this.THEAD=document.createElement("thead"),this.TABLE.insertBefore(this.THEAD,this.TBODY)),this.COLGROUP=this.TABLE.querySelector("colgroup"),this.COLGROUP||(this.COLGROUP=document.createElement("colgroup"),this.TABLE.insertBefore(this.COLGROUP,this.THEAD)),this.wot.getSetting("columnHeaders").length&&!this.THEAD.childNodes.length&&this.THEAD.appendChild(document.createElement("TR"))},createSpreader:function(e){var t,n=e.parentNode;return n&&1===n.nodeType&&h(n,"wtHolder")||(t=document.createElement("div"),t.className="wtSpreader",n&&n.insertBefore(t,e),t.appendChild(e)),t.style.position="relative",t},createHider:function(e){var t,n=e.parentNode;return n&&1===n.nodeType&&h(n,"wtHolder")||(t=document.createElement("div"),t.className="wtHider",n&&n.insertBefore(t,e),t.appendChild(e)),t},createHolder:function(e){var t,n=e.parentNode;return n&&1===n.nodeType&&h(n,"wtHolder")||(t=document.createElement("div"),t.style.position="relative",t.className="wtHolder",n&&n.insertBefore(t,e),this.isWorkingOnClone()||(t.parentNode.className+="ht_master handsontable"),t.appendChild(e)),t},alignOverlaysWithTrimmingContainer:function(){var e=d(this.wtRootElement);if(!this.isWorkingOnClone())if(this.holder.parentNode.style.position="relative",e===window){var t=this.wot.getSetting("preventOverflow");t||(this.holder.style.overflow="visible",this.wtRootElement.style.overflow="visible")}else this.holder.style.width=c(e,"width"),this.holder.style.height=c(e,"height"),this.holder.style.overflow=""},isWorkingOnClone:function(){return!!this.wot.cloneSource},draw:function(e){var t=this.instance.getSetting("totalRows");if(this.isWorkingOnClone()||(this.holderOffset=p(this.holder),e=this.wot.wtViewport.createRenderCalculators(e)),e)this.isWorkingOnClone()||this.wot.wtViewport.createVisibleCalculators(),this.wot.wtOverlays&&this.wot.wtOverlays.refresh(!0);else{this.isWorkingOnClone()?this.tableOffset=this.wot.cloneSource.wtTable.tableOffset:this.tableOffset=p(this.TABLE);var n;n=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)?0:WalkontableOverlay.isOverlayTypeOf(this.instance.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM)||WalkontableOverlay.isOverlayTypeOf(this.instance.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER)?Math.max(t-this.wot.getSetting("fixedRowsBottom"),0):this.wot.wtViewport.rowsRenderCalculator.startRow;var o;o=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)?0:this.wot.wtViewport.columnsRenderCalculator.startColumn,this.rowFilter=new C(n,t,this.wot.getSetting("columnHeaders").length),this.columnFilter=new b(o,this.wot.getSetting("totalColumns"),this.wot.getSetting("rowHeaders").length),this._doDraw(),this.alignOverlaysWithTrimmingContainer()}return this.refreshSelections(e),this.isWorkingOnClone()||(this.wot.wtOverlays.topOverlay.resetFixedPosition(),this.wot.wtOverlays.bottomOverlay.clone&&this.wot.wtOverlays.bottomOverlay.resetFixedPosition(),this.wot.wtOverlays.leftOverlay.resetFixedPosition(),this.wot.wtOverlays.topLeftCornerOverlay&&this.wot.wtOverlays.topLeftCornerOverlay.resetFixedPosition(),this.instance.wtOverlays.bottomLeftCornerOverlay&&this.instance.wtOverlays.bottomLeftCornerOverlay.clone&&this.wot.wtOverlays.bottomLeftCornerOverlay.resetFixedPosition()),this.wot.drawn=!0,this},_doDraw:function(){var e=new R(this);e.render()},removeClassFromCells:function(e){for(var t=this.TABLE.querySelectorAll("."+e),n=0,o=t.length;o>n;n++)g(t[n],e)},refreshSelections:function(e){if(this.wot.selections){var t=this.wot.selections.length;if(e)for(var n=0;t>n;n++)this.wot.selections[n].settings.className&&this.removeClassFromCells(this.wot.selections[n].settings.className),this.wot.selections[n].settings.highlightRowClassName&&this.removeClassFromCells(this.wot.selections[n].settings.highlightRowClassName),this.wot.selections[n].settings.highlightColumnClassName&&this.removeClassFromCells(this.wot.selections[n].settings.highlightColumnClassName);for(var o=0;t>o;o++)this.wot.selections[o].draw(this.wot,e)}},getCell:function(e){if(this.isRowBeforeRenderedRows(e.row))return-1;if(this.isRowAfterRenderedRows(e.row))return-2;var t=this.TBODY.childNodes[this.rowFilter.sourceToRendered(e.row)];return t?t.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(e.col)]:void 0},getColumnHeader:function(e){var t=void 0!==arguments[1]?arguments[1]:0,n=this.THEAD.childNodes[t];return n?n.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(e)]:void 0},getRowHeader:function(e){if(0===this.columnFilter.sourceColumnToVisibleRowHeadedColumn(0))return null;var t=this.TBODY.childNodes[this.rowFilter.sourceToRendered(e)];return t?t.childNodes[0]:void 0},getCoords:function(e){"TD"!==e.nodeName&&"TH"!==e.nodeName&&(e=w(e,["TD","TH"]));var t=e.parentNode,n=t.parentNode,o=f(t),i=e.cellIndex;return v(WalkontableOverlay.CLONE_TOP_LEFT_CORNER,e)||v(WalkontableOverlay.CLONE_TOP,e)?"THEAD"===n.nodeName&&(o-=n.childNodes.length):o=n===this.THEAD?this.rowFilter.visibleColHeadedRowToSourceRow(o):this.rowFilter.renderedToSource(o),i=v(WalkontableOverlay.CLONE_TOP_LEFT_CORNER,e)||v(WalkontableOverlay.CLONE_LEFT,e)?this.columnFilter.offsettedTH(i):this.columnFilter.visibleRowHeadedColumnToSourceColumn(i),new y(o,i)},getTrForRow:function(e){return this.TBODY.childNodes[this.rowFilter.sourceToRendered(e)]},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(e){return this.rowFilter.sourceToRendered(e)<0&&e>=0},isRowAfterViewport:function(e){return this.rowFilter.sourceToRendered(e)>this.getLastVisibleRow()},isRowAfterRenderedRows:function(e){return this.rowFilter.sourceToRendered(e)>this.getLastRenderedRow()},isColumnBeforeViewport:function(e){return this.columnFilter.sourceToRendered(e)<0&&e>=0},isColumnAfterViewport:function(e){return this.columnFilter.sourceToRendered(e)>this.getLastVisibleColumn()},isLastRowFullyVisible:function(){return this.getLastVisibleRow()===this.getLastRenderedRow()},isLastColumnFullyVisible:function(){return this.getLastVisibleColumn()===this.getLastRenderedColumn()},getRenderedColumnsCount:function(){var e=this.wot.wtViewport.columnsRenderCalculator.count,t=this.wot.getSetting("totalColumns");if(this.wot.isOverlayName(WalkontableOverlay.CLONE_DEBUG))e=t;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"),t);return e},getRenderedRowsCount:function(){var e=this.wot.wtViewport.rowsRenderCalculator.count,t=this.wot.getSetting("totalRows");return this.wot.isOverlayName(WalkontableOverlay.CLONE_DEBUG)?e=t:this.wot.isOverlayName(WalkontableOverlay.CLONE_TOP)||this.wot.isOverlayName(WalkontableOverlay.CLONE_TOP_LEFT_CORNER)?e=Math.min(this.wot.getSetting("fixedRowsTop"),t):(this.wot.isOverlayName(WalkontableOverlay.CLONE_BOTTOM)||this.wot.isOverlayName(WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER))&&(e=Math.min(this.wot.getSetting("fixedRowsBottom"),t)),e},getVisibleRowsCount:function(){return this.wot.wtViewport.rowsVisibleCalculator.count},allRowsInViewport:function(){return this.wot.getSetting("totalRows")==this.getVisibleRowsCount()},getRowHeight:function(e){var t=this.wot.wtSettings.settings.rowHeight(e),n=this.wot.wtViewport.oversizedRows[e];return void 0!==n&&(t=void 0===t?n:Math.max(t,n)),t},getColumnHeaderHeight:function(e){var t=this.wot.wtSettings.settings.defaultRowHeight,n=this.wot.wtViewport.oversizedColumnHeaders[e];return void 0!==n&&(t=t?Math.max(t,n):n),t},getVisibleColumnsCount:function(){return this.wot.wtViewport.columnsVisibleCalculator.count},allColumnsInViewport:function(){return this.wot.getSetting("totalColumns")==this.getVisibleColumnsCount()},getColumnWidth:function(e){var t=this.wot.wtSettings.settings.columnWidth;return"function"==typeof t?t=t(e):"object"==typeof t&&(t=t[e]),t||this.wot.wtSettings.settings.defaultColumnWidth},getStretchedColumnWidth:function(e){var t=this.getColumnWidth(e),n=null==t?this.instance.wtSettings.settings.defaultColumnWidth:t,o=this.wot.wtViewport.columnsRenderCalculator;if(o){var i=o.getStretchedColumnWidth(e,n);i&&(n=i)}return n}},{}),window.WalkontableTable=_},{"cell/coords":5,"cell/range":6,"filter/column":9,"filter/row":10,"helpers/dom/element":45,tableRenderer:21}],21:[function(e,t,n){"use strict";function o(e,t){var n=document.createElement("TH");return t.insertBefore(n,e),t.removeChild(e),n}function i(e,t){var n=document.createElement("TD");return t.insertBefore(n,e),t.removeChild(e),n}Object.defineProperties(n,{WalkontableTableRenderer:{get:function(){return f}},__esModule:{value:!0}});var r,s=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),a=s.addClass,l=s.empty,u=s.getScrollbarWidth,c=s.hasClass,d=s.innerHeight,h=s.outerWidth,f=function(e){this.wtTable=e,this.wot=e.instance,this.instance=e.instance,this.rowFilter=e.rowFilter,this.columnFilter=e.columnFilter,this.TABLE=e.TABLE,this.THEAD=e.THEAD,this.TBODY=e.TBODY,this.COLGROUP=e.COLGROUP,this.rowHeaders=[],this.rowHeaderCount=0,this.columnHeaders=[],this.columnHeaderCount=0,this.fixedRowsTop=0,this.fixedRowsBottom=0};$traceurRuntime.createClass(f,{render:function(){this.wtTable.isWorkingOnClone()||this.wot.getSetting("beforeDraw",!0),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 e,t=this.wtTable.getRenderedColumnsCount(),n=this.wtTable.getRenderedRowsCount(),o=this.wot.getSetting("totalColumns"),i=this.wot.getSetting("totalRows"),r=!1;if((WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER))&&(this.columnHeaders=[],this.columnHeaderCount=0),o>0&&(this.adjustAvailableNodes(),r=!0,this.renderColumnHeaders(),this.renderRows(i,n,t),this.wtTable.isWorkingOnClone()||(e=this.wot.wtViewport.getWorkspaceWidth(),this.wot.wtViewport.containerWidth=null),this.adjustColumnHeaderHeights(),this.adjustColumnWidths(t),this.markOversizedColumns()),r||this.adjustAvailableNodes(),this.removeRedundantRows(n),this.wtTable.isWorkingOnClone()&&!this.wot.isOverlayName(WalkontableOverlay.CLONE_BOTTOM)||this.markOversizedRows(),this.wtTable.isWorkingOnClone())this.wot.isOverlayName(WalkontableOverlay.CLONE_BOTTOM)&&this.wot.cloneSource.wtOverlays.adjustElementsSize();else{this.wot.wtViewport.createVisibleCalculators(),this.wot.wtOverlays.refresh(!1);var s=h(this.wtTable.hider),a=h(this.wtTable.TABLE);if(0!==s&&a!==s&&this.adjustColumnWidths(t),this.wot.wtOverlays.applyToDOM(),e!==this.wot.wtViewport.getWorkspaceWidth()){this.wot.wtViewport.containerWidth=null;var l=this.wtTable.getFirstRenderedColumn(),u=this.wtTable.getLastRenderedColumn(),c=this.wot.getSetting("rowHeaderWidth");if(null!=c)for(var d=0;df;f++){var p=this.wtTable.getStretchedColumnWidth(f),g=this.columnFilter.sourceToRendered(f);this.COLGROUP.childNodes[g+this.rowHeaderCount].style.width=p+"px"}}this.wot.getSetting("onDraw",!0)}},removeRedundantRows:function(e){for(;this.wtTable.tbodyChildrenLength>e;)this.TBODY.removeChild(this.TBODY.lastChild),this.wtTable.tbodyChildrenLength--},renderRows:function(e,t,n){for(var o,i,r=0,s=this.rowFilter.renderedToSource(r),a=this.wtTable.isWorkingOnClone();e>s&&s>=0&&(r>1e3&&console.error("Security brake: Too much TRs. Please define height for your table, which will enforce scrollbars."),void 0===t||r!==t);){if(i=this.getOrCreateTrForRow(r,i),this.renderRowHeaders(s,i),this.adjustColumns(i,n+this.rowHeaderCount),o=this.renderCells(s,i,n),a&&!this.wot.isOverlayName(WalkontableOverlay.CLONE_BOTTOM)||this.resetOversizedRow(s),i.firstChild){var l=this.wot.wtTable.getRowHeight(s);l?(l--,i.firstChild.style.height=l+"px"):i.firstChild.style.height=""}r++,s=this.rowFilter.renderedToSource(r)}},resetOversizedRow:function(e){this.wot.getSetting("externalRowCalculator")||this.wot.wtViewport.oversizedRows&&this.wot.wtViewport.oversizedRows[e]&&(this.wot.wtViewport.oversizedRows[e]=void 0)},markOversizedRows:function(){if(!this.wot.getSetting("externalRowCalculator")){var e,t,n,o,i,r=this.instance.wtTable.TBODY.childNodes.length,s=r*this.instance.wtSettings.settings.defaultRowHeight,a=d(this.instance.wtTable.TBODY)-1;this.instance.getSetting("totalRows");if(s!==a||this.instance.getSetting("fixedRowsBottom"))for(;r;)r--,n=this.instance.wtTable.rowFilter.renderedToSource(r),e=this.instance.wtTable.getRowHeight(n),o=this.instance.wtTable.getTrForRow(n),i=o.querySelector("th"),t=i?d(i):d(o)-1,(!e&&this.instance.wtSettings.settings.defaultRowHeighte)&&(this.instance.wtViewport.oversizedRows[n]=++t)}},markOversizedColumns:function(){var e=this.wot.getOverlayName();if(this.columnHeaderCount&&!this.wot.wtViewport.isMarkedOversizedColumn[e]&&!this.wtTable.isWorkingOnClone()){for(var t=this.wtTable.getRenderedColumnsCount(),n=0;no;o++)this.markIfOversizedColumnHeader(o);this.wot.wtViewport.isMarkedOversizedColumn[e]=!0}},adjustColumnHeaderHeights:function(){for(var e=this.wot.getSetting("columnHeaders"),t=this.wot.wtTable.THEAD.childNodes,n=this.wot.wtViewport.oversizedColumnHeaders,o=0,i=e.length;i>o;o++)if(n[o]){if(0===t[o].childNodes.length)return;t[o].childNodes[0].style.height=n[o]+"px"}},markIfOversizedColumnHeader:function(e){for(var t,n,o,i=this.wot.wtTable.columnFilter.renderedToSource(e),r=this.columnHeaderCount,s=this.wot.wtSettings.settings.defaultRowHeight,a=this.wot.getSetting("columnHeaderHeight")||[];r;)r--,t=this.wot.wtTable.getColumnHeaderHeight(r),n=this.wot.wtTable.getColumnHeader(i,r),n&&(o=d(n),(!t&&o>s||o>t)&&(this.wot.wtViewport.oversizedColumnHeaders[r]=o),this.wot.wtViewport.oversizedColumnHeaders[r]<(a[r]||a)&&(this.wot.wtViewport.oversizedColumnHeaders[r]=a[r]||a))},renderCells:function(e,t,n){for(var o,r,s=0;n>s;s++)r=this.columnFilter.renderedToSource(s),o=0===s?t.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(r)]:o.nextSibling,"TH"==o.nodeName&&(o=i(o,t)),c(o,"hide")||(o.className=""),o.removeAttribute("style"),this.wot.wtSettings.settings.cellRenderer(e,r,o);return o},adjustColumnWidths:function(e){var t=0,n=this.wot.cloneSource?this.wot.cloneSource:this.wot,o=n.wtTable.holder;o.offsetHeights;s++){var a=this.wtTable.getStretchedColumnWidth(this.columnFilter.renderedToSource(s));this.COLGROUP.childNodes[s+this.rowHeaderCount].style.width=a+"px"}},appendToTbody:function(e){this.TBODY.appendChild(e),this.wtTable.tbodyChildrenLength++},getOrCreateTrForRow:function(e,t){var n;return e>=this.wtTable.tbodyChildrenLength?(n=this.createRow(),this.appendToTbody(n)):n=0===e?this.TBODY.firstChild:t.nextSibling,n.className&&n.removeAttribute("class"),n},createRow:function(){for(var e=document.createElement("TR"),t=0;to;o++){var i=this.columnFilter.renderedToSource(o);this.renderColumnHeader(t,i,n.childNodes[o+this.rowHeaderCount])}},adjustColGroups:function(){for(var e=this.wtTable.getRenderedColumnsCount();this.wtTable.colgroupChildrenLengthe+this.rowHeaderCount;)this.COLGROUP.removeChild(this.COLGROUP.lastChild),this.wtTable.colgroupChildrenLength--;this.rowHeaderCount&&a(this.COLGROUP.childNodes[0],"rowHeader")},adjustThead:function(){var e=this.wtTable.getRenderedColumnsCount(),t=this.THEAD.firstChild;if(this.columnHeaders.length){for(var n=0,o=this.columnHeaders.length;o>n;n++){for(t=this.THEAD.childNodes[n],t||(t=document.createElement("TR"),this.THEAD.appendChild(t)),this.theadChildrenLength=t.childNodes.length;this.theadChildrenLengthe+this.rowHeaderCount;)t.removeChild(t.lastChild),this.theadChildrenLength--}var i=this.THEAD.childNodes.length;if(i>this.columnHeaders.length)for(var r=this.columnHeaders.length;i>r;r++)this.THEAD.removeChild(this.THEAD.lastChild)}else t&&l(t)},getTrForColumnHeaders:function(e){return this.THEAD.childNodes[e]},renderColumnHeader:function(e,t,n){return n.className="",n.removeAttribute("style"),this.columnHeaders[e](t,n,e)},adjustColumns:function(e,t){for(var n=e.childNodes.length;t>n;){var o=document.createElement("TD");e.appendChild(o),n++}for(;n>t;)e.removeChild(e.lastChild),n--},removeRedundantColumns:function(e){for(;this.wtTable.tbodyChildrenLength>e;)this.TBODY.removeChild(this.TBODY.lastChild),this.wtTable.tbodyChildrenLength--}},{}),window.WalkontableTableRenderer=f},{"helpers/dom/element":45}],22:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableViewport:{get:function(){return m}},__esModule:{value:!0}});var o,i,r,s,a=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),l=a.getScrollbarWidth,u=(a.getScrollTop,a.getStyle),c=a.offset,d=a.outerHeight,h=a.outerWidth,f=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).EventManager,p=(r=e("calculator/viewportColumns"),r&&r.__esModule&&r||{"default":r}).WalkontableViewportColumnsCalculator,g=(s=e("calculator/viewportRows"),s&&s.__esModule&&s||{"default":s}).WalkontableViewportRowsCalculator,m=function(e){var t=this;this.wot=e,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 f(this.wot),this.eventManager.addEventListener(window,"resize",function(){t.clientHeight=t.getWorkspaceHeight()})};$traceurRuntime.createClass(m,{getWorkspaceHeight:function(){var e,t=this.instance.wtOverlays.topOverlay.trimmingContainer,n=0;return t===window?n=document.documentElement.clientHeight:(e=d(t),n=e>0&&t.clientHeight>0?t.clientHeight:1/0),n},getWorkspaceWidth:function(){var e,t,n=this.wot.getSetting("totalColumns"),o=this.instance.wtOverlays.leftOverlay.trimmingContainer,i=this.wot.getSetting("stretchH"),r=document.documentElement.offsetWidth,s=this.wot.getSetting("preventOverflow");return s?h(this.instance.wtTable.wtRootElement):(e=Handsontable.freezeOverlays?Math.min(r-this.getWorkspaceOffset().left,r):Math.min(this.getContainerFillWidth(),r-this.getWorkspaceOffset().left,r),o===window&&n>0&&this.sumColumnWidths(0,n-1)>e?document.documentElement.clientWidth:o!==window&&(t=u(this.instance.wtOverlays.leftOverlay.trimmingContainer,"overflow"),"scroll"==t||"hidden"==t||"auto"==t)?Math.max(e,o.clientWidth):"none"!==i&&i?e:Math.max(e,h(this.instance.wtTable.TABLE)))},hasVerticalScroll:function(){return this.getWorkspaceActualHeight()>this.getWorkspaceHeight()},hasHorizontalScroll:function(){return this.getWorkspaceActualWidth()>this.getWorkspaceWidth()},sumColumnWidths:function(e,t){for(var n=0;t>e;)n+=this.wot.wtTable.getColumnWidth(e),e++;return n},getContainerFillWidth:function(){if(this.containerWidth)return this.containerWidth;var e,t,n=this.instance.wtTable.holder;return t=document.createElement("div"),t.style.width="100%",t.style.height="1px",n.appendChild(t),e=t.offsetWidth,this.containerWidth=e,n.removeChild(t),e},getWorkspaceOffset:function(){return c(this.wot.wtTable.TABLE)},getWorkspaceActualHeight:function(){return d(this.wot.wtTable.TABLE)},getWorkspaceActualWidth:function(){return h(this.wot.wtTable.TABLE)||h(this.wot.wtTable.TBODY)||h(this.wot.wtTable.THEAD)},getColumnHeaderHeight:function(){return isNaN(this.columnHeaderHeight)&&(this.columnHeaderHeight=d(this.wot.wtTable.THEAD)),this.columnHeaderHeight},getViewportHeight:function(){var e,t=this.getWorkspaceHeight();return t===1/0?t:(e=this.getColumnHeaderHeight(),e>0&&(t-=e),t)},getRowHeaderWidth:function(){var e=this.instance.getSetting("rowHeaderWidth"),t=this.instance.getSetting("rowHeaders");if(e){this.rowHeaderWidth=0;for(var n=0,o=t.length;o>n;n++)this.rowHeaderWidth+=e[n]||e}if(this.wot.cloneSource)return this.wot.cloneSource.wtViewport.getRowHeaderWidth();if(isNaN(this.rowHeaderWidth))if(t.length){var i=this.instance.wtTable.TABLE.querySelector("TH");this.rowHeaderWidth=0;for(var r=0,s=t.length;s>r;r++)i?(this.rowHeaderWidth+=h(i),i=i.nextSibling):this.rowHeaderWidth+=50}else this.rowHeaderWidth=0;return this.rowHeaderWidth},getViewportWidth:function(){var e,t=this.getWorkspaceWidth();return t===1/0?t:(e=this.getRowHeaderWidth(),e>0?t-e:t)},createRowsCalculator:function(){var e,t,n,o,i,r,s,a=void 0!==arguments[0]?arguments[0]:!1,u=this;return this.rowHeaderWidth=NaN,e=this.wot.wtSettings.settings.renderAllRows?1/0:this.getViewportHeight(),t=this.wot.wtOverlays.topOverlay.getScrollPosition()-this.wot.wtOverlays.topOverlay.getTableParentOffset(),0>t&&(t=0),n=this.wot.getSetting("fixedRowsTop"),i=this.wot.getSetting("fixedRowsBottom"),s=this.wot.getSetting("totalRows"),n&&(r=this.wot.wtOverlays.topOverlay.sumCellSizes(0,n),t+=r,e-=r),i&&this.wot.wtOverlays.bottomOverlay.clone&&(r=this.wot.wtOverlays.bottomOverlay.sumCellSizes(s-i,s),e-=r),o=this.wot.wtTable.holder.clientHeight===this.wot.wtTable.holder.offsetHeight?0:l(),new g(e,t,this.wot.getSetting("totalRows"),function(e){return u.wot.wtTable.getRowHeight(e)},a?null:this.wot.wtSettings.settings.viewportRowCalculatorOverride,a,o)},createColumnsCalculator:function(){var e,t,n=void 0!==arguments[0]?arguments[0]:!1,o=this,i=this.getViewportWidth();if(this.columnHeaderHeight=NaN,e=this.wot.wtOverlays.leftOverlay.getScrollPosition()-this.wot.wtOverlays.leftOverlay.getTableParentOffset(),0>e&&(e=0),t=this.wot.getSetting("fixedColumnsLeft")){var r=this.wot.wtOverlays.leftOverlay.sumCellSizes(0,t);e+=r,i-=r}return this.wot.wtTable.holder.clientWidth!==this.wot.wtTable.holder.offsetWidth&&(i-=l()),new p(i,e,this.wot.getSetting("totalColumns"),function(e){return o.wot.wtTable.getColumnWidth(e)},n?null:this.wot.wtSettings.settings.viewportColumnCalculatorOverride,n,this.wot.getSetting("stretchH"),function(e,t){return o.wot.getSetting("onBeforeStretchingColumnWidth",e,t)})},createRenderCalculators:function(){var e=void 0!==arguments[0]?arguments[0]:!1;if(e){var t=this.createRowsCalculator(!0),n=this.createColumnsCalculator(!0);this.areAllProposedVisibleRowsAlreadyRendered(t)&&this.areAllProposedVisibleColumnsAlreadyRendered(n)||(e=!1)}return e||(this.rowsRenderCalculator=this.createRowsCalculator(),this.columnsRenderCalculator=this.createColumnsCalculator()),this.rowsVisibleCalculator=null,this.columnsVisibleCalculator=null,e},createVisibleCalculators:function(){this.rowsVisibleCalculator=this.createRowsCalculator(!0),this.columnsVisibleCalculator=this.createColumnsCalculator(!0)},areAllProposedVisibleRowsAlreadyRendered:function(e){return this.rowsVisibleCalculator?e.startRow0?!1:!(e.endRow>this.rowsRenderCalculator.endRow||e.endRow===this.rowsRenderCalculator.endRow&&e.endRow0?!1:!(e.endColumn>this.columnsRenderCalculator.endColumn||e.endColumn===this.columnsRenderCalculator.endColumn&&e.endColumn=0;s--)if(null===e[s])e.splice(s,1);else{var a=e[s][0],l=d.propToCol(e[s][1]),u=m.getCellMeta(a,l);if("numeric"===u.type&&"string"==typeof e[s][3]&&e[s][3].length>0&&(/^-?[\d\s]*(\.|\,)?\d*$/.test(e[s][3])||u.format)){var c=e[s][3].length;"undefined"==typeof u.language?R.language("en"):e[s][3].indexOf(".")===c-3&&-1===e[s][3].indexOf(",")?R.language("en"):R.language(u.language),R.validate(e[s][3])&&(e[s][3]=R().unformat(e[s][3]))}m.getCellValidator(u)&&(r.addValidatorToQueue(),m.validateCell(e[s][3],u,function(t,n){return function(o){if("boolean"!=typeof o)throw new Error("Validation error: result is not boolean");o===!1&&n.allowInvalid===!1&&(e.splice(t,1),n.valid=!0,--t),r.removeValidatorFormQueue()}}(s,u),t))}r.checkIfQueueIsEmpty()}function i(e,t){var n=e.length-1;if(!(0>n)){for(;n>=0;n--)if(null!==e[n]){if(null!=e[n][2]||null!=e[n][3]){if(c.settings.allowInsertRow)for(;e[n][0]>m.countRows()-1;)d.createRow();if("array"===m.dataType&&c.settings.allowInsertColumn)for(;d.propToCol(e[n][1])>m.countCols()-1;)d.createCol();d.set(e[n][0],e[n][1],e[n][3])}}else e.splice(n,1);m.forceFullRender=!0,f.adjustRowsAndCols(),Handsontable.hooks.run(m,"beforeChangeRender",e,t),p.refreshBorders(null,!0),m.view.wt.wtOverlays.adjustElementsSize(),Handsontable.hooks.run(m,"afterChange",e,t||"edit")}}function r(e,t,n){return"object"==typeof e?e:[[e,t,n]]}function s(e){if(e.hasOwnProperty("type")){var t,n={};if("object"==typeof e.type)t=e.type;else if("string"==typeof e.type&&(t=Handsontable.cellTypes[e.type],void 0===t))throw new Error('You declared cell type "'+e.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 o in t)t.hasOwnProperty(o)&&!e.hasOwnProperty(o)&&(n[o]=t[o]);return n}}function a(e){return Handsontable.hooks.run(m,"modifyRow",e)}function l(e){return Handsontable.hooks.run(m,"modifyCol",e)}function u(){throw new Error("This method cannot be called because this Handsontable instance has been destroyed")}var c,d,h,f,p,g,m=this,v=function(){},w=D(m);A(v.prototype,Q.prototype),A(v.prototype,t),A(v.prototype,s(t)),this.rootElement=e,this.isHotTableEnv=T(this.rootElement),Handsontable.eventManager.isHotTableEnv=this.isHotTableEnv,this.container=document.createElement("DIV"),this.renderCall=!1,e.insertBefore(this.container,e.firstChild),this.guid="ht_"+B(),h=new U(m),this.rootElement.id&&"ht_"!==this.rootElement.id.substring(0,3)||(this.rootElement.id=this.guid),c={cellSettings:[],columnSettings:[],columnsSettingConflicts:["data","width"],settings:new v,selRange:null,isPopulated:null,scrollable:null,firstRun:!0},f={alter:function(e,t,n,o,i){function r(e,t,n,o){var i=function(){var e;return"array"===o?e=[]:"object"===o&&(e={}),e},r=j(new Array(n),function(){return i()});r.unshift(t,0),e.splice.apply(e,r)}var s;switch(n=n||1,e){case"insert_row":if(m.getSettings().maxRows===m.countSourceRows())return;s=d.createRow(t,n),r(c.cellSettings,t,n,"array"),s&&(p.isSelected()&&c.selRange.from.row>=t?(c.selRange.from.row=c.selRange.from.row+s,p.transformEnd(s,0)):p.refreshBorders());break;case"insert_col":s=d.createCol(t,n);for(var a=0,u=m.countSourceRows();u>a;a++)c.cellSettings[a]&&r(c.cellSettings[a],t,n);if(s){if(Array.isArray(m.getSettings().colHeaders)){var h=[t,0];h.length+=s,Array.prototype.splice.apply(m.getSettings().colHeaders,h)}p.isSelected()&&c.selRange.from.col>=t?(c.selRange.from.col=c.selRange.from.col+s,p.transformEnd(0,s)):p.refreshBorders()}break;case"remove_row":d.removeRow(t,n),c.cellSettings.splice(t,n);var g=m.countRows(),v=m.getSettings().fixedRowsTop;v>=t+1&&(m.getSettings().fixedRowsTop-=Math.min(n,v-t));var w=m.getSettings().fixedRowsBottom;w&&t>=g-w&&(m.getSettings().fixedRowsBottom-=Math.min(n,w)),f.adjustRowsAndCols(),p.refreshBorders();break;case"remove_col":var y=l(t);d.removeCol(t,n);for(var b=0,C=m.countSourceRows();C>b;b++)c.cellSettings[b]&&c.cellSettings[b].splice(y,n);var R=m.getSettings().fixedColumnsLeft;R>=t+1&&(m.getSettings().fixedColumnsLeft-=Math.min(n,R-t)),Array.isArray(m.getSettings().colHeaders)&&("undefined"==typeof y&&(y=-1),m.getSettings().colHeaders.splice(y,n)),f.adjustRowsAndCols(),p.refreshBorders();break;default:throw new Error('There is no such action "'+e+'"')}i||f.adjustRowsAndCols()},adjustRowsAndCols:function(){if(c.settings.minRows){var e=m.countRows();if(et;t++)d.createRow(m.countRows(),1,!0)}if(c.settings.minSpareRows){var o=m.countEmptyRows(!0);if(or-1?(l=r-1,a=!0,h>l&&(h=l)):h>r-1&&(h=r-1,a=!0,l>h&&(l=h)),u>s-1?(u=s-1,a=!0,f>u&&(f=u)):f>s-1&&(f=s-1,a=!0,u>f&&(u=f)),a&&m.selectCell(l,u,h,f)}m.view&&m.view.wt.wtOverlays.adjustElementsSize()},populateFromArray:function(e,t,n,o,i,r,s){var a,l,u,d,h=[],f={};if(l=t.length,0===l)return!1;var p,g,v,w;({row:null===n?null:n.row,col:null===n?null:n.col});switch(i){case"shift_down":for(p=n?n.col-e.col+1:0,g=n?n.row-e.row+1:0,t=$(t),u=0,d=t.length,v=Math.max(d,p);v>u;u++)if(d>u){for(a=0,l=t[u].length;g-l>a;a++)t[u].push(t[u][a%l]);t[u].unshift(e.col+u,e.row,0),m.spliceCol.apply(m,t[u])}else t[u%d][0]=e.col+u,m.spliceCol.apply(m,t[u%d]);break;case"shift_right":for(p=n?n.col-e.col+1:0,g=n?n.row-e.row+1:0,a=0,l=t.length,w=Math.max(l,g);w>a;a++)if(l>a){for(u=0,d=t[a].length;p-d>u;u++)t[a].push(t[a][u%d]);t[a].unshift(e.row+a,e.col,0),m.spliceRow.apply(m,t[a])}else t[a%l][0]=e.row+a,m.spliceRow.apply(m,t[a%l]);break;case"overwrite":default:f.row=e.row,f.col=e.col;var y,b={row:n&&e?n.row-e.row+1:1,col:n&&e?n.col-e.col+1:1},C=0,R=0,_=!0,S=function(e){var n=void 0!==arguments[1]?arguments[1]:null,o=t[e%t.length];return null!==n?o[n%o.length]:o},E=t.length,T=n?n.row-e.row+1:0;for(l=n?T:Math.max(E,T),a=0;l>a&&!(n&&f.row>n.row&&T>E||!c.settings.allowInsertRow&&f.row>m.countRows()-1||f.row>=c.settings.maxRows);a++){var M=a-C,O=S(M).length,k=n?n.col-e.col+1:0;if(d=n?k:Math.max(O,k),f.col=e.col,y=m.getCellMeta(f.row,f.col),"paste"!==o&&"autofill"!==o||!y.skipRowOnPaste){for(R=0,u=0;d>u&&!(n&&f.col>n.col&&k>O||!c.settings.allowInsertColumn&&f.col>m.countCols()-1||f.col>=c.settings.maxCols);u++)if(y=m.getCellMeta(f.row,f.col),"paste"!==o&&"autofill"!==o||!y.skipColumnOnPaste)if(y.readOnly)f.col++;else{var H=u-R,D=S(M,H),x=m.getDataAtCell(f.row,f.col),A={row:M,col:H};if("autofill"===o){var W=m.runHooks("beforeAutofillInsidePopulate",A,r,t,s,{},b);W&&(D="undefined"==typeof W.value?D:W.value)}if(null!==D&&"object"==typeof D)if(null===x||"object"!=typeof x)_=!1;else{var I=P(x[0]||x),j=P(D[0]||D);N(I,j)?D=L(D):_=!1}else null!==x&&"object"==typeof x&&(_=!1);_&&h.push([f.row,f.col,D]),_=!0,f.col++}else R++,f.col++,d++;f.row++}else C++,f.row++,l++}m.setDataAtCell(h,null,null,o||"populateFromArray")}}},this.selection=p={inProgress:!1,selectedHeader:{cols:!1,rows:!1},setSelectedHeaders:function(e,t){m.selection.selectedHeader.rows=e,m.selection.selectedHeader.cols=t},begin:function(){m.selection.inProgress=!0},finish:function(){var e=m.getSelected();Handsontable.hooks.run(m,"afterSelectionEnd",e[0],e[1],e[2],e[3]),Handsontable.hooks.run(m,"afterSelectionEndByProp",e[0],m.colToProp(e[1]),e[2],m.colToProp(e[3])),m.selection.inProgress=!1},isInProgress:function(){return m.selection.inProgress},setRangeStart:function(e,t){Handsontable.hooks.run(m,"beforeSetRangeStart",e),c.selRange=new Z(e,e,e),p.setRangeEnd(e,null,t)},setRangeEnd:function(e,t,n){if(null!==c.selRange){var o,i=!1,r=!0,s=m.view.wt.wtTable.getFirstVisibleRow(),a=m.view.wt.wtTable.getFirstVisibleColumn(),l={row:null,col:null};Handsontable.hooks.run(m,"beforeSetRangeEnd",e),m.selection.begin(),l.row=e.row<0?s:e.row,l.col=e.col<0?a:e.col,c.selRange.to=new q(l.row,l.col),c.settings.multiSelect||(c.selRange.from=e),m.view.wt.selections.current.clear(),o=m.getCellMeta(c.selRange.highlight.row,c.selRange.highlight.col).disableVisualSelection,"string"==typeof o&&(o=[o]),(o===!1||Array.isArray(o)&&-1===o.indexOf("current"))&&m.view.wt.selections.current.add(c.selRange.highlight),m.view.wt.selections.area.clear(),(o===!1||Array.isArray(o)&&-1===o.indexOf("area"))&&p.isMultiple()&&(m.view.wt.selections.area.add(c.selRange.from),m.view.wt.selections.area.add(c.selRange.to)),(c.settings.currentRowClassName||c.settings.currentColClassName)&&(m.view.wt.selections.highlight.clear(),m.view.wt.selections.highlight.add(c.selRange.from),m.view.wt.selections.highlight.add(c.selRange.to)),Handsontable.hooks.run(m,"afterSelection",c.selRange.from.row,c.selRange.from.col,c.selRange.to.row,c.selRange.to.col),Handsontable.hooks.run(m,"afterSelectionByProp",c.selRange.from.row,d.colToProp(c.selRange.from.col),c.selRange.to.row,d.colToProp(c.selRange.to.col)),(0===c.selRange.from.row&&c.selRange.to.row===m.countRows()-1&&m.countRows()>1||0===c.selRange.from.col&&c.selRange.to.col===m.countCols()-1&&m.countCols()>1)&&(i=!0),(e.row<0||e.col<0)&&(r=!1),t!==!1&&!i&&r&&(c.selRange.from&&!p.isMultiple()?m.view.scrollViewport(c.selRange.from):m.view.scrollViewport(e)),p.refreshBorders(null,n)}},refreshBorders:function(e,t){t||g.destroyEditor(e),m.view.render(),p.isSelected()&&!t&&g.prepareEditor()},isMultiple:function(){var e=!(c.selRange.to.col===c.selRange.from.col&&c.selRange.to.row===c.selRange.from.row),t=Handsontable.hooks.run(m,"afterIsMultipleSelection",e);return e?t:void 0},transformStart:function(e,t,n,o){var i,r,s,a,l=new q(e,t),u=0,d=0;m.runHooks("modifyTransformStart",l),i=m.countRows(),r=m.countCols(),a=m.getSettings().fixedRowsBottom,c.selRange.highlight.row+e>i-1?n&&c.settings.minSpareRows>0&&!(a&&c.selRange.highlight.row>=i-a-1)?(m.alter("insert_row",i),i=m.countRows()):c.settings.autoWrapCol&&(l.row=1-i,l.col=c.selRange.highlight.col+l.col==r-1?1-r:1):c.settings.autoWrapCol&&c.selRange.highlight.row+l.row<0&&c.selRange.highlight.col+l.col>=0&&(l.row=i-1,l.col=c.selRange.highlight.col+l.col==0?r-1:-1),c.selRange.highlight.col+l.col>r-1?n&&c.settings.minSpareCols>0?(m.alter("insert_col",r),r=m.countCols()):c.settings.autoWrapRow&&(l.row=c.selRange.highlight.row+l.row==i-1?1-i:1,l.col=1-r):c.settings.autoWrapRow&&c.selRange.highlight.col+l.col<0&&c.selRange.highlight.row+l.row>=0&&(l.row=c.selRange.highlight.row+l.row==0?i-1:-1,l.col=r-1),s=new q(c.selRange.highlight.row+l.row,c.selRange.highlight.col+l.col),s.row<0?(u=-1,s.row=0):s.row>0&&s.row>=i&&(u=1,s.row=i-1),s.col<0?(d=-1,s.col=0):s.col>0&&s.col>=r&&(d=1,s.col=r-1),m.runHooks("afterModifyTransformStart",s,u,d),p.setRangeStart(s,o)},transformEnd:function(e,t){var n,o,i,r=new q(e,t),s=0,a=0;m.runHooks("modifyTransformEnd",r),n=m.countRows(),o=m.countCols(),i=new q(c.selRange.to.row+r.row,c.selRange.to.col+r.col),i.row<0?(s=-1,i.row=0):i.row>0&&i.row>=n&&(s=1,i.row=n-1),i.col<0?(a=-1,i.col=0):i.col>0&&i.col>=o&&(a=1,i.col=o-1),m.runHooks("afterModifyTransformEnd",i,s,a),p.setRangeEnd(i,!0)},isSelected:function(){return null!==c.selRange},inInSelection:function(e){return p.isSelected()?c.selRange.includes(e):!1},deselect:function(){p.isSelected()&&(m.selection.inProgress=!1,c.selRange=null,m.view.wt.selections.current.clear(),m.view.wt.selections.area.clear(),(c.settings.currentRowClassName||c.settings.currentColClassName)&&m.view.wt.selections.highlight.clear(),g.destroyEditor(),p.refreshBorders(),Handsontable.hooks.run(m,"afterDeselect"))},selectAll:function(){c.settings.multiSelect&&(p.setRangeStart(new q(0,0)),p.setRangeEnd(new q(m.countRows()-1,m.countCols()-1),!1))},empty:function(){if(p.isSelected()){var e,t,n=c.selRange.getTopLeftCorner(),o=c.selRange.getBottomRightCorner(),i=[];for(e=n.row;e<=o.row;e++)for(t=n.col;t<=o.col;t++)m.getCellMeta(e,t).readOnly||i.push([e,t,""]);m.setDataAtCell(i)}}},this.init=function(){h.setData(c.settings.data),Handsontable.hooks.run(m,"beforeInit"),Handsontable.mobileBrowser&&S(m.rootElement,"mobile"),this.updateSettings(c.settings,!0),this.view=new Y(this),g=new H(m,c,p,d),this.forceFullRender=!0,Handsontable.hooks.run(m,"init"),this.view.render(),"object"==typeof c.firstRun&&(Handsontable.hooks.run(m,"afterChange",c.firstRun[0],c.firstRun[1]),c.firstRun=!1),Handsontable.hooks.run(m,"afterInit")},this.validateCell=function(e,t,n,o){function i(e){var o=t.visualCol,i=t.visualRow,r=m.getCell(i,o,!0);r&&m.view.wt.wtSettings.settings.cellRenderer(i,o,r),n(e)}var r=m.getCellValidator(t);"[object RegExp]"===Object.prototype.toString.call(r)&&(r=function(e){return function(t,n){n(e.test(t))}}(r)),"function"==typeof r?(e=Handsontable.hooks.run(m,"beforeValidate",e,t.visualRow,t.prop,o),m._registerTimeout(setTimeout(function(){r.call(t,e,function(n){n=Handsontable.hooks.run(m,"afterValidate",n,e,t.visualRow,t.prop,o),t.valid=n,i(n),Handsontable.hooks.run(m,"postAfterValidate",n,e,t.visualRow,t.prop,o)})},0))):m._registerTimeout(setTimeout(function(){t.valid=!0,i(t.valid)},0))},this.setDataAtCell=function(e,t,n,s){var a,l,u,c=r(e,t,n),h=[];for(a=0,l=c.length;l>a;a++){if("object"!=typeof c[a])throw new Error("Method `setDataAtCell` accepts row number or changes array of arrays as its first parameter");if("number"!=typeof c[a][1])throw new Error("Method `setDataAtCell` accepts row and column number as its parameters. If you want to use object property name, use method `setDataAtRowProp`");u=d.colToProp(c[a][1]),h.push([c[a][0],u,d.get(c[a][0],u),c[a][2]])}s||"object"!=typeof e||(s=t),o(h,s,function(){i(h,s)})},this.setDataAtRowProp=function(e,t,n,s){var a,l,u=r(e,t,n),c=[];for(a=0,l=u.length;l>a;a++)c.push([u[a][0],u[a][1],d.get(u[a][0],u[a][1]),u[a][2]]);s||"object"!=typeof e||(s=t),o(c,s,function(){i(c,s)})},this.listen=function(){Handsontable.activeGuid=m.guid},this.unlisten=function(){Handsontable.activeGuid=null},this.isListening=function(){return Handsontable.activeGuid===m.guid},this.destroyEditor=function(e){p.refreshBorders(e)},this.populateFromArray=function(e,t,n,o,i,r,s,a,l){var u;if("object"!=typeof n||"object"!=typeof n[0])throw new Error("populateFromArray parameter `input` must be an array of arrays");return u="number"==typeof o?new q(o,i):null,f.populateFromArray(new q(e,t),n,u,r,s,a,l)},this.spliceCol=function(e,t,n){return d.spliceCol.apply(d,arguments)},this.spliceRow=function(e,t,n){return d.spliceRow.apply(d,arguments)},this.getSelected=function(){return p.isSelected()?[c.selRange.from.row,c.selRange.from.col,c.selRange.to.row,c.selRange.to.col]:void 0},this.getSelectedRange=function(){return p.isSelected()?c.selRange:void 0},this.render=function(){m.view&&(m.renderCall=!0,m.forceFullRender=!0,p.refreshBorders(null,!0))},this.loadData=function(e){function t(){c.cellSettings.length=0}if("object"==typeof e&&null!==e)e.push&&e.splice||(e=[e]);else{if(null!==e)throw new Error("loadData only accepts array of objects or array of arrays ("+typeof e+" given)");e=[];for(var n,o=0,i=c.settings.startRows;i>o;o++){n=[];for(var r=0,s=c.settings.startCols;s>r;r++)n.push(null);e.push(n)}}c.isPopulated=!1,v.prototype.data=e,Array.isArray(c.settings.dataSchema)||Array.isArray(e[0])?m.dataType="array":"function"==typeof c.settings.dataSchema?m.dataType="function":m.dataType="object",d&&d.destroy(),d=new k(m,c,v),h.data=e,h.dataType=m.dataType,h.colToProp=d.colToProp.bind(d),h.propToCol=d.propToCol.bind(d),t(),f.adjustRowsAndCols(),Handsontable.hooks.run(m,"afterLoadData",c.firstRun),c.firstRun?c.firstRun=[null,"loadData"]:(Handsontable.hooks.run(m,"afterChange",null,"loadData"),m.render()),c.isPopulated=!0},this.getData=function(e,t,n,o){return"undefined"==typeof e?d.getAll():d.getRange(new q(e,t),new q(n,o),d.DESTINATION_RENDERER)},this.getCopyableText=function(e,t,n,o){return d.getCopyableText(new q(e,t),new q(n,o))},this.getCopyableData=function(e,t){return d.getCopyable(e,d.colToProp(t))},this.getSchema=function(){return d.getSchema()},this.updateSettings=function(e,t){var n,o;if("undefined"!=typeof e.rows)throw new Error('"rows" setting is no longer supported. do you mean startRows, minRows or maxRows?');if("undefined"!=typeof e.cols)throw new Error('"cols" setting is no longer supported. do you mean startCols, minCols or maxCols?');for(n in e)"data"!==n&&(Handsontable.hooks.getRegistered().indexOf(n)>-1?("function"==typeof e[n]||Array.isArray(e[n]))&&m.addHook(n,e[n]):!t&&e.hasOwnProperty(n)&&(v.prototype[n]=e[n]));if(void 0===e.data&&void 0===c.settings.data?m.loadData(null):void 0!==e.data?m.loadData(e.data):void 0!==e.columns&&d.createMap(),o=m.countCols(),void 0===e.cell&&void 0===e.cells&&void 0===e.columns||(c.cellSettings.length=0),o>0){var i,r;for(n=0;o>n;n++)c.columnSettings[n]=O(v,c.columnsSettingConflicts),i=c.columnSettings[n].prototype,v.prototype.columns&&(r=v.prototype.columns[n],r&&(A(i,r),A(i,s(r))))}if("undefined"!=typeof e.cell)for(n in e.cell)if(e.cell.hasOwnProperty(n)){var a=e.cell[n];m.setCellMetaObject(a.row,a.col,a)}Handsontable.hooks.run(m,"afterCellMetaReset"),"undefined"!=typeof e.className&&(v.prototype.className&&M(m.rootElement,v.prototype.className),e.className&&S(m.rootElement,e.className));var l=m.rootElement.style.height;""!==l&&(l=parseInt(m.rootElement.style.height,10));var u=e.height;if("function"==typeof u&&(u=u()),t){var h=m.rootElement.getAttribute("style");h&&m.rootElement.setAttribute("data-initialstyle",m.rootElement.getAttribute("style"))}if(null===u){var g=m.rootElement.getAttribute("data-initialstyle");g&&(g.indexOf("height")>-1||g.indexOf("overflow")>-1)?m.rootElement.setAttribute("style",g):(m.rootElement.style.height="",m.rootElement.style.overflow="")}else void 0!==u&&(m.rootElement.style.height=u+"px",m.rootElement.style.overflow="hidden");if("undefined"!=typeof e.width){var w=e.width;"function"==typeof w&&(w=w()),m.rootElement.style.width=w+"px"}t||Handsontable.hooks.run(m,"afterUpdateSettings"),f.adjustRowsAndCols(),m.view&&!c.firstRun&&(m.forceFullRender=!0,p.refreshBorders(null,!0)),t||!m.view||""!==l&&""!==u&&void 0!==u||l===u||m.view.wt.wtOverlays.updateMainScrollableElements()},this.getValue=function(){var e=m.getSelected();if(v.prototype.getValue){if("function"==typeof v.prototype.getValue)return v.prototype.getValue.call(m);if(e)return m.getData()[e[0]][v.prototype.getValue]}else if(e)return m.getDataAtCell(e[0],e[1])},this.getSettings=function(){return c.settings},this.clear=function(){p.selectAll(),p.empty()},this.alter=function(e,t,n,o,i){f.alter(e,t,n,o,i)},this.getCell=function(e,t,n){return m.view.getCellAtCoords(new q(e,t),n)},this.getCoords=function(e){return this.view.wt.wtTable.getCoords.call(this.view.wt.wtTable,e)},this.colToProp=function(e){return d.colToProp(e)},this.propToCol=function(e){return d.propToCol(e)},this.getDataAtCell=function(e,t){return d.get(e,d.colToProp(t))},this.getDataAtRowProp=function(e,t){return d.get(e,t)},this.getDataAtCol=function(e){var t=[];return t.concat.apply(t,d.getRange(new q(0,e),new q(c.settings.data.length-1,e),d.DESTINATION_RENDERER))},this.getDataAtProp=function(e){var t,n=[];return t=d.getRange(new q(0,d.propToCol(e)),new q(c.settings.data.length-1,d.propToCol(e)),d.DESTINATION_RENDERER),n.concat.apply(n,t)},this.getSourceData=function(e,t,n,o){var i;return i=void 0===e?h.getData():h.getByRange(new q(e,t),new q(n,o))},this.getSourceDataAtCol=function(e){return h.getAtColumn(e)},this.getSourceDataAtRow=function(e){return h.getAtRow(e)},this.getSourceDataAtCell=function(e,t){return h.getAtCell(e,t)},this.getDataAtRow=function(e){var t=d.getRange(new q(e,0),new q(e,this.countCols()-1),d.DESTINATION_RENDERER);return t[0]},this.getDataType=function(e,t,n,o){var i=this,r=null,s=null;void 0===e&&(e=0,n=this.countRows(),t=0,o=this.countCols()),void 0===n&&(n=e),void 0===o&&(o=t);var a="mixed";return z(Math.min(e,n),Math.max(e,n),function(e){var n=!0;return z(Math.min(t,o),Math.max(t,o),function(t){var o=i.getCellMeta(e,t);return s=o.type,r?n=r===s:r=s,n}),a=n?s:"mixed",n}),a},this.removeCellMeta=function(e,t,n){var o=m.getCellMeta(e,t);void 0!=o[n]&&delete c.cellSettings[e][t][n]},this.setCellMetaObject=function(e,t,n){if("object"==typeof n)for(var o in n)if(n.hasOwnProperty(o)){var i=n[o];this.setCellMeta(e,t,o,i)}},this.setCellMeta=function(e,t,n,o){c.cellSettings[e]||(c.cellSettings[e]=[]),c.cellSettings[e][t]||(c.cellSettings[e][t]=new c.columnSettings[t]),c.cellSettings[e][t][n]=o,Handsontable.hooks.run(m,"afterSetCellMeta",e,t,n,o)},this.getCellsMeta=function(){return I(c.cellSettings)},this.getCellMeta=function(e,t){var n,o=d.colToProp(t),i=e,r=t;if(e=a(e),t=l(t),c.columnSettings[t]||(c.columnSettings[t]=O(v,c.columnsSettingConflicts)),c.cellSettings[e]||(c.cellSettings[e]=[]),c.cellSettings[e][t]||(c.cellSettings[e][t]=new c.columnSettings[t]),n=c.cellSettings[e][t],n.row=e,n.col=t,n.visualRow=i,n.visualCol=r,n.prop=o,n.instance=m,Handsontable.hooks.run(m,"beforeGetCellMeta",e,t,n),A(n,s(n)),n.cells){var u=n.cells.call(n,e,t,o);u&&(A(n,u),A(n,s(u)))}return Handsontable.hooks.run(m,"afterGetCellMeta",e,t,n),n},this.isColumnModificationAllowed=function(){return!("object"===m.dataType||m.getSettings().columns)};var y=X("renderer");this.getCellRenderer=function(e,t){var n=y.call(this,e,t);return F(n)},this.getCellEditor=X("editor"),this.getCellValidator=X("validator"),this.validateCells=function(e){var t=new n;e&&(t.onQueueEmpty=e);for(var o=m.countRows()-1;o>=0;){for(var i=m.countCols()-1;i>=0;)t.addValidatorToQueue(),m.validateCell(m.getDataAtCell(o,i),m.getCellMeta(o,i),function(e){if("boolean"!=typeof e)throw new Error("Validation error: result is not boolean");e===!1&&(t.valid=!1),t.removeValidatorFormQueue()},"validateCells"),i--;o--}t.checkIfQueueIsEmpty()},this.getRowHeader=function(e){var t=c.settings.rowHeaders;return void 0!==e&&(e=Handsontable.hooks.run(m,"modifyRowHeader",e)),void 0===e?(t=[],z(m.countRows()-1,function(e){t.push(m.getRowHeader(e))})):Array.isArray(t)&&void 0!==t[e]?t=t[e]:"function"==typeof t?t=t(e):t&&"string"!=typeof t&&"number"!=typeof t&&(t=e+1),t},this.hasRowHeaders=function(){return!!c.settings.rowHeaders},this.hasColHeaders=function(){if(void 0!==c.settings.colHeaders&&null!==c.settings.colHeaders)return!!c.settings.colHeaders;for(var e=0,t=m.countCols();t>e;e++)if(m.getColHeader(e))return!0;return!1},this.getColHeader=function(e){if(e=Handsontable.hooks.run(m,"modifyColHeader",e),void 0===e){for(var t=[],n=0,o=m.countCols();o>n;n++)t.push(m.getColHeader(n));return t}var i=e;return e=Handsontable.hooks.run(m,"modifyCol",e),c.settings.columns&&c.settings.columns[e]&&c.settings.columns[e].title?c.settings.columns[e].title:Array.isArray(c.settings.colHeaders)&&void 0!==c.settings.colHeaders[e]?c.settings.colHeaders[e]:"function"==typeof c.settings.colHeaders?c.settings.colHeaders(e):c.settings.colHeaders&&"string"!=typeof c.settings.colHeaders&&"number"!=typeof c.settings.colHeaders?K(i):c.settings.colHeaders},this._getColWidthFromSettings=function(e){var t=m.getCellMeta(0,e),n=t.width;if(void 0!==n&&n!==c.settings.width||(n=t.colWidths),void 0!==n&&null!==n){switch(typeof n){case"object":n=n[e];break;case"function":n=n(e)}"string"==typeof n&&(n=parseInt(n,10))}return n},this.getColWidth=function(e){var t=m._getColWidthFromSettings(e);return t=Handsontable.hooks.run(m,"modifyColWidth",t,e),void 0===t&&(t=J.DEFAULT_WIDTH),t},this._getRowHeightFromSettings=function(e){var t=c.settings.rowHeights;if(void 0!==t&&null!==t){switch(typeof t){case"object":t=t[e];break;case"function":t=t(e)}"string"==typeof t&&(t=parseInt(t,10))}return t},this.getRowHeight=function(e){var t=m._getRowHeightFromSettings(e);return t=Handsontable.hooks.run(m,"modifyRowHeight",t,e)},this.countSourceRows=function(){return m.getSourceData()?m.getSourceData().length:0},this.countRows=function(){return d.getLength()},this.countCols=function(){return"object"===m.dataType||"function"===m.dataType?c.settings.columns&&c.settings.columns.length?c.settings.columns.length:d.colToPropCache.length:"array"===m.dataType?c.settings.columns&&c.settings.columns.length?c.settings.columns.length:c.settings.data&&c.settings.data[0]&&c.settings.data[0].length?c.settings.data[0].length:0:void 0},this.getColspanOffset=function(e,t){var n=0;if(m.colspanArray){for(var o=0;e>o;o++)n+=m.colspanArray[t][o]-1||0;return n}for(var n=0,i=m.view.wt.wtTable.THEAD.childNodes.length-t-1,r=m.view.wt.wtTable.THEAD.querySelector("tr:nth-child("+parseInt(i+1,10)+")"),s=m.view.wt.wtSettings.settings.rowHeaders().length,o=s;s+e>o;o++)r.childNodes[o].hasAttribute("colspan")&&(n+=parseInt(r.childNodes[o].getAttribute("colspan"),10)-1);return n},this.getHeaderColspan=function(e,t){var n=m.view.wt.wtTable.THEAD.childNodes.length-t-1,o=m.view.wt.wtSettings.settings.rowHeaders().length,i=m.view.wt.wtTable.THEAD.querySelector("tr:nth-child("+parseInt(n+1,10)+")"),r=o+e-m.view.wt.wtViewport.columnsRenderCalculator.startColumn;return i.childNodes[r].hasAttribute("colspan")?parseInt(i.childNodes[r].getAttribute("colspan"),10):0},this.rowOffset=function(){return m.view.wt.wtTable.getFirstRenderedRow()},this.colOffset=function(){return m.view.wt.wtTable.getFirstRenderedColumn()},this.countRenderedRows=function(){return m.view.wt.drawn?m.view.wt.wtTable.getRenderedRowsCount():-1},this.countVisibleRows=function(){return m.view.wt.drawn?m.view.wt.wtTable.getVisibleRowsCount():-1},this.countRenderedCols=function(){return m.view.wt.drawn?m.view.wt.wtTable.getRenderedColumnsCount():-1},this.countVisibleCols=function(){return m.view.wt.drawn?m.view.wt.wtTable.getVisibleColumnsCount():-1},this.countEmptyRows=function(e){for(var t,n=m.countRows()-1,o=0;n>=0;){if(t=Handsontable.hooks.run(this,"modifyRow",n),m.isEmptyRow(t))o++;else if(e)break;n--}return o},this.countEmptyCols=function(e){ +if(m.countRows()<1)return 0;for(var t=m.countCols()-1,n=0;t>=0;){if(m.isEmptyCol(t))n++;else if(e)break;t--}return n},this.isEmptyRow=function(e){return c.settings.isEmptyRow.call(m,e)},this.isEmptyCol=function(e){return c.settings.isEmptyCol.call(m,e)},this.selectCell=function(e,t,n,o,i,r){var s;if(r="undefined"==typeof r||r===!0,"number"!=typeof e||0>e||e>=m.countRows())return!1;if("number"!=typeof t||0>t||t>=m.countCols())return!1;if("undefined"!=typeof n){if("number"!=typeof n||0>n||n>=m.countRows())return!1;if("number"!=typeof o||0>o||o>=m.countCols())return!1}return s=new q(e,t),c.selRange=new Z(s,s,s),r&&m.listen(),"undefined"==typeof n?p.setRangeEnd(c.selRange.from,i):p.setRangeEnd(new q(n,o),i),m.selection.finish(),!0},this.selectCellByProp=function(e,t,n,o,i){return arguments[1]=d.propToCol(arguments[1]),"undefined"!=typeof arguments[3]&&(arguments[3]=d.propToCol(arguments[3])),m.selectCell.apply(m,arguments)},this.deselectCell=function(){p.deselect()},this.destroy=function(){m._clearTimeouts(),m.view&&m.view.destroy(),h&&h.destroy(),h=null,E(m.rootElement),w.destroy(),Handsontable.hooks.run(m,"afterDestroy"),Handsontable.hooks.destroy(m);for(var e in m)m.hasOwnProperty(e)&&("function"==typeof m[e]?m[e]=u:"guid"!==e&&(m[e]=null));d&&d.destroy(),d=null,c=null,f=null,p=null,g=null,m=null,v=null},this.getActiveEditor=function(){return g.getActiveEditor()},this.getPlugin=function(e){return V(this,e)},this.getInstance=function(){return m},this.addHook=function(e,t){Handsontable.hooks.add(e,t,m)},this.hasHook=function(e){return Handsontable.hooks.has(e,m)},this.addHookOnce=function(e,t){Handsontable.hooks.once(e,t,m)},this.removeHook=function(e,t){Handsontable.hooks.remove(e,t,m)},this.runHooks=function(e,t,n,o,i,r,s){return Handsontable.hooks.run(m,e,t,n,o,i,r,s)},this.timeouts=[],this._registerTimeout=function(e){this.timeouts.push(e)},this._clearTimeouts=function(){for(var e=0,t=this.timeouts.length;t>e;e++)clearTimeout(this.timeouts[e])},this.version=Handsontable.version,Handsontable.hooks.run(m,"construct")};var Q=function(){};Q.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:!1,customBorders:!1,minRows:0,minCols:0,maxRows:1/0,maxCols:1/0,minSpareRows:0,minSpareCols:0,allowInsertRow:!0,allowInsertColumn:!0,allowRemoveRow:!0,allowRemoveColumn:!0,multiSelect:!0,fillHandle:!0,fixedRowsTop:0,fixedRowsBottom:0,fixedColumnsLeft:0,outsideClickDeselects:!0,enterBeginsEditing:!0,enterMoves:{row:1,col:0},tabMoves:{row:0,col:1},autoWrapRow:!1,autoWrapCol:!1,copyRowsLimit:1e3,copyColsLimit:1e3,pasteMode:"overwrite",persistentState:void 0,currentRowClassName:void 0,currentColClassName:void 0,className:void 0,tableClassName:void 0,stretchH:"none",isEmptyRow:function(e){var t,n,o,i;for(t=0,n=this.countCols();n>t;t++)if(o=this.getDataAtCell(e,t),""!==o&&null!==o&&"undefined"!=typeof o)return"object"==typeof o?(i=this.getCellMeta(e,t),N(this.getSchema()[i.prop],o)):!1;return!0},isEmptyCol:function(e){var t,n,o;for(t=0,n=this.countRows();n>t;t++)if(o=this.getDataAtCell(t,e),""!==o&&null!==o&&"undefined"!=typeof o)return!1;return!0},observeDOMVisibility:!0,allowInvalid:!0,allowEmpty:!0,invalidCellClassName:"htInvalid",placeholder:!1,placeholderCellClassName:"htPlaceholder",readOnlyCellClassName:"htDimmed",renderer:void 0,commentedCellClassName:"htCommentCell",fragmentSelection:!1,readOnly:!1,skipColumnOnPaste:!1,search:!1,type:"text",copyable:!0,editor:void 0,autoComplete:void 0,visibleRows:10,trimDropdown:!0,debug:!1,wordWrap:!0,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:!1,viewportRowRenderingOffset:"auto",viewportColumnRenderingOffset:"auto",validator:void 0,disableVisualSelection:!1,sortIndicator:void 0,manualColumnFreeze:void 0,trimWhitespace:!0,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:!1,defaultDate:void 0,strict:void 0,renderAllRows:void 0,preventOverflow:!1,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,observeChanges:void 0,sortFunction:void 0},Handsontable.DefaultSettings=Q},{"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":50,"helpers/object":51,"helpers/setting":52,"helpers/string":53,numeral:"numeral",plugins:58,renderers:91,tableView:100}],26:[function(e,t,n){"use strict";function o(e,t,n){var o=this;this.instance=e,this.priv=t,this.GridSettings=n,this.dataSource=this.instance.getSettings().data,this.cachedLength=null,this.latestSourceRowsCount=0,this.dataSource[0]?this.duckSchema=this.recursiveDuckSchema(this.dataSource[0]):this.duckSchema={},this.createMap(),this.interval=C.create(function(){return o.clearLengthCache()},"15fps")}Object.defineProperties(n,{DataMap:{get:function(){return o}},__esModule:{value:!0}});var i,r,s,a,l,u,c,d,h=(i=e("SheetClip"),i&&i.__esModule&&i||{"default":i})["default"],f=(r=e("helpers/data"),r&&r.__esModule&&r||{"default":r}).cellMethodLookupFactory,p=(s=e("helpers/setting"),s&&s.__esModule&&s||{"default":s}).columnFactory,g=(a=e("helpers/object"),a&&a.__esModule&&a||{"default":a}),m=g.duckSchema,v=g.deepExtend,w=(l=e("helpers/array"),l&&l.__esModule&&l||{"default":l}),y=w.extendArray,b=w.to2dArray,C=(u=e("utils/interval"),u&&u.__esModule&&u||{"default":u}).Interval,R=(c=e("helpers/number"),c&&c.__esModule&&c||{"default":c}).rangeEach,_=(d=e("multiMap"),d&&d.__esModule&&d||{"default":d}).MultiMap;o.prototype.DESTINATION_RENDERER=1,o.prototype.DESTINATION_CLIPBOARD_GENERATOR=2,o.prototype.recursiveDuckSchema=function(e){return m(e)},o.prototype.recursiveDuckColumns=function(e,t,n){var o,i;if("undefined"==typeof t&&(t=0,n=""),"object"==typeof e&&!Array.isArray(e))for(i in e)e.hasOwnProperty(i)&&(null===e[i]?(o=n+i,this.colToPropCache.push(o),this.propToColCache.set(o,t),t++):t=this.recursiveDuckColumns(e[i],t,i+"."));return t},o.prototype.createMap=function(){var e,t,n=this.getSchema();if("undefined"==typeof n)throw new Error("trying to create `columns` definition but you didnt' provide `schema` nor `data`");this.colToPropCache=[],this.propToColCache=new _;var o=this.instance.getSettings().columns;if(o)for(e=0,t=o.length;t>e;e++)"undefined"!=typeof o[e].data&&(this.colToPropCache[e]=o[e].data,this.propToColCache.set(o[e].data,e));else this.recursiveDuckColumns(n)},o.prototype.colToProp=function(e){return e=Handsontable.hooks.run(this.instance,"modifyCol",e),this.colToPropCache&&"undefined"!=typeof this.colToPropCache[e]?this.colToPropCache[e]:e},o.prototype.propToCol=function(e){var t;return t="undefined"==typeof this.propToColCache.get(e)?e:this.propToColCache.get(e),t=Handsontable.hooks.run(this.instance,"unmodifyCol",t)},o.prototype.getSchema=function(){var e=this.instance.getSettings().dataSchema;return e?"function"==typeof e?e():e:this.duckSchema},o.prototype.createRow=function(e,t,n){var o,i,r=this.instance.countCols(),s=0;t||(t=1),("number"!=typeof e||e>=this.instance.countSourceRows())&&(e=this.instance.countSourceRows()),i=e;for(var a=this.instance.getSettings().maxRows;t>s&&this.instance.countSourceRows()l;l++)o.push(null)}else"function"===this.instance.dataType?o=this.instance.getSettings().dataSchema(e):(o={},v(o,this.getSchema()));e===this.instance.countSourceRows()?this.dataSource.push(o):this.dataSource.splice(e,0,o),s++,i++}return Handsontable.hooks.run(this.instance,"afterCreateRow",e,s,n),this.instance.forceFullRender=!0,s},o.prototype.createCol=function(e,t,n){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 o,i,r=this.instance.countSourceRows(),s=this.dataSource,a=0;t||(t=1),i=e;for(var l=this.instance.getSettings().maxCols;t>a&&this.instance.countCols()=this.instance.countCols()){for(var u=0;r>u;u++)"undefined"==typeof s[u]&&(s[u]=[]),s[u].push(null);this.priv.columnSettings.push(o)}else{for(var u=0;r>u;u++)s[u].splice(i,0,null);this.priv.columnSettings.splice(i,0,o)}a++,i++}return Handsontable.hooks.run(this.instance,"afterCreateCol",e,a,n),this.instance.forceFullRender=!0,a},o.prototype.removeRow=function(e,t){t||(t=1),"number"!=typeof e&&(e=-t),e=(this.instance.countSourceRows()+e)%this.instance.countSourceRows();var n=this.physicalRowsToLogical(e,t),o=(n.slice(0).sort(function(e,t){return t-e}),Handsontable.hooks.run(this.instance,"beforeRemoveRow",e,t,n));if(o!==!1){var i,r=this.dataSource;i=r.filter(function(e,t){return-1==n.indexOf(t)}),r.length=0,Array.prototype.push.apply(r,i),Handsontable.hooks.run(this.instance,"afterRemoveRow",e,t,n),this.instance.forceFullRender=!0}},o.prototype.removeCol=function(e,t){if("object"===this.instance.dataType||this.instance.getSettings().columns)throw new Error("cannot remove column with object data source or columns option specified");t||(t=1),"number"!=typeof e&&(e=-t),e=(this.instance.countCols()+e)%this.instance.countCols();var n=this.physicalColumnsToLogical(e,t),o=n.slice(0).sort(function(e,t){return t-e}),i=Handsontable.hooks.run(this.instance,"beforeRemoveCol",e,t,n);if(i!==!1){for(var r=!0,s=o.length,a=this.dataSource,l=0;s>l;l++)r&&n[0]!==n[l]-l&&(r=!1);if(r)for(var u=0,c=this.instance.countSourceRows();c>u;u++)a[u].splice(n[0],t);else{for(var d=0,h=this.instance.countSourceRows();h>d;d++)for(var f=0;s>f;f++)a[d].splice(o[f],1);for(var p=0;s>p;p++)this.priv.columnSettings.splice(n[p],1)}Handsontable.hooks.run(this.instance,"afterRemoveCol",e,t),this.instance.forceFullRender=!0}},o.prototype.spliceCol=function(e,t,n){var o=4<=arguments.length?[].slice.call(arguments,3):[],i=this.instance.getDataAtCol(e),r=i.slice(t,t+n),s=i.slice(t+n);y(o,s);for(var a=0;n>a;)o.push(null),a++;return b(o),this.instance.populateFromArray(t,e,o,null,null,"spliceCol"),r},o.prototype.spliceRow=function(e,t,n){var o=4<=arguments.length?[].slice.call(arguments,3):[],i=this.instance.getSourceDataAtRow(e),r=i.slice(t,t+n),s=i.slice(t+n);y(o,s);for(var a=0;n>a;)o.push(null),a++;return this.instance.populateFromArray(e,t,[o],null,null,"spliceRow"),r},o.prototype.get=function(e,t){e=Handsontable.hooks.run(this.instance,"modifyRow",e);var n=this.dataSource[e];if(n&&n.hasOwnProperty&&n.hasOwnProperty(t))return n[t];if("string"==typeof t&&t.indexOf(".")>-1){var o=t.split("."),i=n;if(!i)return null;for(var r=0,s=o.length;s>r;r++)if(i=i[o[r]],"undefined"==typeof i)return null;return i}return"function"==typeof t?t(this.dataSource.slice(e,e+1)[0]):null};var S=f("copyable",!1);o.prototype.getCopyable=function(e,t){return S.call(this.instance,e,this.propToCol(t))?this.get(e,t):""},o.prototype.set=function(e,t,n,o){e=Handsontable.hooks.run(this.instance,"modifyRow",e,o||"datamapGet");var i=this.dataSource[e];if(i&&i.hasOwnProperty&&i.hasOwnProperty(t))i[t]=n;else if("string"==typeof t&&t.indexOf(".")>-1){for(var r=t.split("."),s=i,a=0,l=r.length-1;l>a;a++)"undefined"==typeof s[r[a]]&&(s[r[a]]={}),s=s[r[a]];s[r[a]]=n}else"function"==typeof t?t(this.dataSource.slice(e,e+1)[0],n):i[t]=n},o.prototype.physicalRowsToLogical=function(e,t){for(var n,o=this.instance.countSourceRows(),i=(o+e)%o,r=[],s=t;o>i&&s;)n=Handsontable.hooks.run(this.instance,"modifyRow",i),r.push(n),s--,i++;return r},o.prototype.physicalColumnsToLogical=function(e,t){for(var n=this.instance.countCols(),o=(n+e)%n,i=[],r=t;n>o&&r;){var s=Handsontable.hooks.run(this.instance,"modifyCol",o);i.push(s),r--,o++}return i},o.prototype.clear=function(){for(var e=0;e=o;o++){a=[];var c=Handsontable.hooks.run(this.instance,"modifyRow",o);for(r=Math.min(e.col,t.col);s>=r;r++){if(null===c)break;a.push(u.call(this,o,this.colToProp(r)))}null!==c&&l.push(a)}return l},o.prototype.getText=function(e,t){return h.stringify(this.getRange(e,t,this.DESTINATION_RENDERER))},o.prototype.getCopyableText=function(e,t){return h.stringify(this.getRange(e,t,this.DESTINATION_CLIPBOARD_GENERATOR))},o.prototype.destroy=function(){this.interval.stop(),this.interval=null,this.instance=null,this.priv=null,this.GridSettings=null,this.dataSource=null,this.cachedLength=null,this.duckSchema=null},Handsontable.DataMap=o},{SheetClip:"SheetClip","helpers/array":42,"helpers/data":44,"helpers/number":50,"helpers/object":51,"helpers/setting":52,multiMap:56,"utils/interval":102}],27:[function(e,t,n){"use strict";Object.defineProperties(n,{DataSource:{get:function(){return f}},__esModule:{value:!0}});var o,i,r,s,a,l=((o=e("helpers/data"),o&&o.__esModule&&o||{"default":o}).cellMethodLookupFactory,(i=e("helpers/setting"),i&&i.__esModule&&i||{"default":i}).columnFactory,r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}),u=(l.duckSchema,l.deepExtend,l.getProperty),c=(s=e("helpers/array"),s&&s.__esModule&&s||{"default":s}),d=(c.extendArray,c.arrayEach),h=(a=e("helpers/number"),a&&a.__esModule&&a||{"default":a}).rangeEach,f=function(e){var t=void 0!==arguments[1]?arguments[1]:[];this.hot=e,this.data=t,this.dataType="array",this.colToProp=function(){},this.propToCol=function(){}};$traceurRuntime.createClass(f,{getData:function(){return this.data},setData:function(e){this.data=e},getAtColumn:function(e){var t=this,n=[];return d(this.data,function(o){var i=t.colToProp(e);o="string"==typeof i?u(o,i):o[i],n.push(o)}),n},getAtRow:function(e){return this.data[e]},getAtCell:function(e,t){return this.data[e][this.colToProp(t)]},getByRange:function(e,t){var n=this,o=Math.min(e.row,t.row),i=Math.min(e.col,t.col),r=Math.max(e.row,t.row),s=Math.max(e.col,t.col),a=[];return h(o,r,function(e){var t,o=n.getAtRow(e);"array"===n.dataType?t=o.slice(i,s):"object"===n.dataType&&(t={},h(i,s,function(e){var i=n.colToProp(e);t[i]=o[i]})),a.push(t)}),a},destroy:function(){this.data=null,this.hot=null}},{})},{"helpers/array":42,"helpers/data":44,"helpers/number":50,"helpers/object":51,"helpers/setting":52}],28:[function(e,t,n){"use strict";function o(e,t,n){function o(e){var o="function"==typeof t.settings.enterMoves?t.settings.enterMoves(event):t.settings.enterMoves;e?n.transformStart(-o.row,-o.col):n.transformStart(o.row,o.col,!0)}function i(e){e?n.transformEnd(-1,0):n.transformStart(-1,0)}function r(e){e?n.transformEnd(1,0):n.transformStart(1,0)}function s(e){e?n.transformEnd(0,1):n.transformStart(0,1)}function a(e){e?n.transformEnd(0,-1):n.transformStart(0,-1)}function l(l){var c,p;if(e.isListening()&&(Handsontable.hooks.run(e,"beforeKeyDown",l),!C&&!v(l)&&(t.lastKeyCode=l.keyCode,n.isSelected()))){if(c=(l.ctrlKey||l.metaKey)&&!l.altKey,y&&!y.isWaiting()&&!(h(l.keyCode)||f(l.keyCode)||c||b.isEditorOpened()))return void b.openEditor("",l);switch(p=l.shiftKey?n.setRangeEnd:n.setRangeStart,l.keyCode){case d.A:!b.isEditorOpened()&&c&&(n.selectAll(),l.preventDefault(),g(l));break;case d.ARROW_UP:b.isEditorOpened()&&!y.isWaiting()&&b.closeEditorAndSaveChanges(c),i(l.shiftKey),l.preventDefault(),g(l);break;case d.ARROW_DOWN:b.isEditorOpened()&&!y.isWaiting()&&b.closeEditorAndSaveChanges(c),r(l.shiftKey),l.preventDefault(),g(l);break;case d.ARROW_RIGHT:b.isEditorOpened()&&!y.isWaiting()&&b.closeEditorAndSaveChanges(c),s(l.shiftKey),l.preventDefault(),g(l);break;case d.ARROW_LEFT:b.isEditorOpened()&&!y.isWaiting()&&b.closeEditorAndSaveChanges(c),a(l.shiftKey),l.preventDefault(),g(l);break;case d.TAB:var w="function"==typeof t.settings.tabMoves?t.settings.tabMoves(l):t.settings.tabMoves;l.shiftKey?n.transformStart(-w.row,-w.col):n.transformStart(w.row,w.col,!0),l.preventDefault(),g(l);break;case d.BACKSPACE:case d.DELETE:n.empty(l),b.prepareEditor(),l.preventDefault();break;case d.F2:b.openEditor(null,l),y&&y.enableFullEditMode(),l.preventDefault();break;case d.ENTER:b.isEditorOpened()?(y&&y.state!==Handsontable.EditorState.WAITING&&b.closeEditorAndSaveChanges(c),o(l.shiftKey)):e.getSettings().enterBeginsEditing?(b.openEditor(null,l),y&&y.enableFullEditMode()):o(l.shiftKey),l.preventDefault(),m(l);break;case d.ESCAPE:b.isEditorOpened()&&b.closeEditorAndRestoreOriginalValue(c),l.preventDefault();break;case d.HOME:p(l.ctrlKey||l.metaKey?new u(0,t.selRange.from.col):new u(t.selRange.from.row,0)),l.preventDefault(),g(l);break;case d.END:p(l.ctrlKey||l.metaKey?new u(e.countRows()-1,t.selRange.from.col):new u(t.selRange.from.row,e.countCols()-1)),l.preventDefault(),g(l);break;case d.PAGE_UP:n.transformStart(-e.countVisibleRows(),0),l.preventDefault(),g(l);break;case d.PAGE_DOWN:n.transformStart(e.countVisibleRows(),0),l.preventDefault(),g(l)}}}function c(){function t(e,t,n){"TD"==n.nodeName&&(b.openEditor(),y&&y.enableFullEditMode())}e.addHook("afterDocumentKeyDown",l),p.addEventListener(document.documentElement,"keydown",function(t){e.runHooks("afterDocumentKeyDown",t)}),e.view.wt.update("onCellDblClick",t),e.addHook("afterDestroy",function(){C=!0})}var p,y,b=this,C=!1;p=w(e),this.destroyEditor=function(e){this.closeEditor(e)},this.getActiveEditor=function(){return y},this.prepareEditor=function(){var n,o,i,r,s,a,l;return y&&y.isWaiting()?void this.closeEditor(!1,!1,function(e){e&&b.prepareEditor()}):(n=t.selRange.highlight.row,o=t.selRange.highlight.col,i=e.colToProp(o),r=e.getCell(n,o),s=e.getDataAtCell(n,o),a=e.getCellMeta(n,o),l=e.getCellEditor(a),void(l?(y=Handsontable.editors.getEditor(l,e),y.prepare(n,o,i,r,s,a)):y=void 0))},this.isEditorOpened=function(){return y&&y.isOpened()},this.openEditor=function(e,t){y&&!y.cellProperties.readOnly?y.beginEditing(e,t):y&&y.cellProperties.readOnly&&t&&t.keyCode===d.ENTER&&o()},this.closeEditor=function(e,t,n){y?y.finishEditing(e,t,n):n&&n(!1)},this.closeEditorAndSaveChanges=function(e){return this.closeEditor(!1,e)},this.closeEditorAndRestoreOriginalValue=function(e){return this.closeEditor(!0,e)},c()}Object.defineProperties(n,{EditorManager:{get:function(){return o}},__esModule:{value:!0}});var i,r,s,a,l,u=(i=e("3rdparty/walkontable/src/cell/coords"),i&&i.__esModule&&i||{"default":i}).WalkontableCellCoords,c=(r=e("helpers/unicode"),r&&r.__esModule&&r||{"default":r}),d=c.KEY_CODES,h=c.isMetaKey,f=c.isCtrlKey,p=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),g=p.stopPropagation,m=p.stopImmediatePropagation,v=p.isImmediatePropagationStopped,w=((a=e("editors"),a&&a.__esModule&&a||{"default":a}).getEditor,(l=e("eventManager"),l&&l.__esModule&&l||{"default":l}).eventManager);Handsontable.EditorManager=o},{"3rdparty/walkontable/src/cell/coords":5,editors:29,eventManager:41,"helpers/dom/event":46,"helpers/unicode":54}],29:[function(e,t,n){"use strict";function o(e){var t,n;n={},t=e,this.getConstructor=function(){return e},this.getInstance=function(e){return e.guid in n||(n[e.guid]=new t(e)),n[e.guid]}}function i(e,t){var n=new o(t);"string"==typeof e&&(c[e]=n,Handsontable.editors[u(e)+"Editor"]=t),d.set(t,n)}function r(e,t){var n;if("function"==typeof e)d.get(e)||i(null,e),n=d.get(e);else{if("string"!=typeof e)throw Error('Only strings and functions can be passed as "editor" parameter ');n=c[e]}if(!n)throw Error('No editor registered under name "'+e+'"');return n.getInstance(t)}function s(e){var t;if("string"!=typeof e)throw Error('Only strings and functions can be passed as "editor" parameter ');if(t=c[e],!t)throw Error('No editor registered under name "'+e+'"');return t.getConstructor()}function a(e){return!!c[e]}Object.defineProperties(n,{registerEditor:{get:function(){return i}},getEditor:{get:function(){return r}},hasEditor:{get:function(){return a}},getEditorConstructor:{get:function(){return s}},__esModule:{value:!0}});var l,u=(l=e("helpers/string"),l&&l.__esModule&&l||{"default":l}).toUpperCaseFirst,c={},d=new WeakMap;Handsontable.editors=Handsontable.editors||{},Handsontable.editors.registerEditor=i,Handsontable.editors.getEditor=r},{"helpers/string":53}],30:[function(e,t,n){"use strict";function o(e){this.instance=e,this.state=Handsontable.EditorState.VIRGIN,this._opened=!1,this._fullEditMode=!1,this._closeCallback=null,this.init()}Object.defineProperties(n,{BaseEditor:{get:function(){return o}},__esModule:{value:!0}});var i,r,s=(i=e("helpers/mixed"),i&&i.__esModule&&i||{"default":i}).stringify,a=(r=e("3rdparty/walkontable/src/cell/coords"),r&&r.__esModule&&r||{"default":r}).WalkontableCellCoords;Handsontable.editors=Handsontable.editors||{},Handsontable.editors.BaseEditor=o,Handsontable.EditorState={VIRGIN:"STATE_VIRGIN",EDITING:"STATE_EDITING",WAITING:"STATE_WAITING",FINISHED:"STATE_FINISHED"},o.prototype._fireCallbacks=function(e){this._closeCallback&&(this._closeCallback(e),this._closeCallback=null)},o.prototype.init=function(){},o.prototype.getValue=function(){throw Error("Editor getValue() method unimplemented")},o.prototype.setValue=function(e){throw Error("Editor setValue() method unimplemented")},o.prototype.open=function(){throw Error("Editor open() method unimplemented")},o.prototype.close=function(){throw Error("Editor close() method unimplemented")},o.prototype.prepare=function(e,t,n,o,i,r){this.TD=o,this.row=e,this.col=t,this.prop=n,this.originalValue=i,this.cellProperties=r,this.instance.view.isMouseDown()&&document.activeElement&&document.activeElement!==document.body?document.activeElement.blur():document.activeElement||document.body.focus(),this.state=Handsontable.EditorState.VIRGIN},o.prototype.extend=function(){function e(){n.apply(this,arguments)}function t(e,t){function n(){}return n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e,e}var n=this.constructor;return t(e,n)},o.prototype.saveValue=function(e,t){var n,o;t?(n=this.instance.getSelected(),n[0]>n[2]&&(o=n[0],n[0]=n[2],n[2]=o),n[1]>n[3]&&(o=n[1],n[1]=n[3],n[3]=o),this.instance.populateFromArray(n[0],n[1],e,n[2],n[3],"edit")):this.instance.populateFromArray(this.row,this.col,e,null,null,"edit")},o.prototype.beginEditing=function(e,t){this.state==Handsontable.EditorState.VIRGIN&&(this.instance.view.scrollViewport(new a(this.row,this.col)),this.instance.view.render(),this.state=Handsontable.EditorState.EDITING,e="string"==typeof e?e:this.originalValue,this.setValue(s(e)),this.open(t),this._opened=!0,this.focus(),this.instance.view.render())},o.prototype.finishEditing=function(e,t,n){var o,i=this;if(n){var r=this._closeCallback;this._closeCallback=function(e){r&&r(e),n(e)}}if(!this.isWaiting()){if(this.state==Handsontable.EditorState.VIRGIN)return void this.instance._registerTimeout(setTimeout(function(){i._fireCallbacks(!0)},0));if(this.state==Handsontable.EditorState.EDITING){if(e)return this.cancelChanges(),void this.instance.view.render();var s=this.getValue();o=this.instance.getSettings().trimWhitespace?[["string"==typeof s?String.prototype.trim.call(s||""):s]]:[[s]],this.state=Handsontable.EditorState.WAITING,this.saveValue(o,t),this.instance.getCellValidator(this.cellProperties)?this.instance.addHookOnce("postAfterValidate",function(e){i.state=Handsontable.EditorState.FINISHED,i.discardEditor(e)}):(this.state=Handsontable.EditorState.FINISHED,this.discardEditor(!0))}}},o.prototype.cancelChanges=function(){this.state=Handsontable.EditorState.FINISHED,this.discardEditor()},o.prototype.discardEditor=function(e){this.state===Handsontable.EditorState.FINISHED&&(e===!1&&this.cellProperties.allowInvalid!==!0?(this.instance.selectCell(this.row,this.col),this.focus(),this.state=Handsontable.EditorState.EDITING,this._fireCallbacks(!1)):(this.close(),this._opened=!1,this._fullEditMode=!1,this.state=Handsontable.EditorState.VIRGIN,this._fireCallbacks(!0)))},o.prototype.enableFullEditMode=function(){this._fullEditMode=!0},o.prototype.isInFullEditMode=function(){return this._fullEditMode},o.prototype.isOpened=function(){return this._opened},o.prototype.isWaiting=function(){return this.state===Handsontable.EditorState.WAITING},o.prototype.checkEditorSection=function(){var e=this.instance.countRows(),t="";return this.row=e-this.instance.getSettings().fixedRowsBottom?t=this.col"+a+"")))},autoColumnSize:!0,modifyColWidth:function(e,t){var o=this.getPlugin("autoColumnSize").widths;return o[t]&&(e=o[t]),n?e:e+15}}),this.htEditor.view.wt.wtTable.holder.parentNode.style["padding-right"]=w()+2+"px",T&&(T=!1),t.instance._registerTimeout(setTimeout(function(){t.queryChoices(t.TEXTAREA.value)},0))},E.prototype.close=function(){S.prototype.close.apply(this,arguments)},E.prototype.queryChoices=function(e){if(this.query=e,"function"==typeof this.cellProperties.source){var t=this;this.cellProperties.source(e,function(e){t.updateChoicesList(e)})}else if(Array.isArray(this.cellProperties.source)){var n;if(e&&this.cellProperties.filter!==!1){var o=this.cellProperties.filteringCaseSensitive===!0,i=e.toLowerCase();n=this.cellProperties.source.filter(function(t){return o?-1!=t.indexOf(e):-1!=t.toLowerCase().indexOf(i)})}else n=this.cellProperties.source;this.updateChoicesList(n)}else this.updateChoicesList([])},E.prototype.updateChoicesList=function(e){var t,n=v(this.TEXTAREA),o=y(this.TEXTAREA),i=E.sortByRelevance(this.getValue(),e,this.cellProperties.filteringCaseSensitive);if(0==this.cellProperties.filter)t=i[0];else{for(var r=[],s=0,a=i.length;a>s;s++)r.push(e[i[s]]);t=0,e=r}this.choices=e,this.htEditor.loadData(p([e])),this.updateDropdownHeight(),this.cellProperties.strict===!0&&this.highlightBestMatchingChoice(t),this.instance.listen(),this.TEXTAREA.focus(),C(this.TEXTAREA,n,n==o?void 0:o)},E.prototype.updateDropdownHeight=function(){var e=this.htEditor.getColWidth(0)+w()+2,t=void 0===this.cellProperties.trimDropdown?!0:this.cellProperties.trimDropdown;this.htEditor.updateSettings({height:this.getDropdownHeight(),width:t?void 0:e}),this.htEditor.view.wt.wtTable.alignOverlaysWithTrimmingContainer()},E.prototype.finishEditing=function(e){e||this.instance.removeHook("beforeKeyDown",o),S.prototype.finishEditing.apply(this,arguments)},E.prototype.highlightBestMatchingChoice=function(e){"number"==typeof e?this.htEditor.selectCell(e,0):this.htEditor.deselectCell()},E.sortByRelevance=function(e,t,n){var o,i,r,s,a,l=[],u=e.length,c=[];if(0===u){for(s=0,a=t.length;a>s;s++)c.push(s);return c}for(s=0,a=t.length;a>s;s++)o=f(t[s]),i=n?o.indexOf(e):o.toLowerCase().indexOf(e.toLowerCase()),-1!=i&&(r=o.length-i-u,l.push({baseIndex:s,index:i,charsLeft:r,value:o}));for(l.sort(function(e,t){return-1===t.index?-1:-1===e.index?1:e.indext.charsLeft?1:0:void 0}),s=0,a=l.length;a>s;s++)c.push(l[s].baseIndex);return c},E.prototype.getDropdownHeight=function(){var e=this.htEditor.getInstance().getRowHeight(0)||23,t=this.cellProperties.visibleRows;return this.choices.length>=t?t*e:this.choices.length*e+8},E.prototype.allowKeyEventPropagation=function(e){var t={row:this.htEditor.getSelectedRange()?this.htEditor.getSelectedRange().from.row:-1},n=!1;return e===d.ARROW_DOWN&&t.row-1&&(n=!0),n},_("autocomplete",E)},{editors:29,handsontableEditor:35,"helpers/array":42,"helpers/dom/element":45,"helpers/mixed":49,"helpers/unicode":54}],32:[function(e,t,n){"use strict";Object.defineProperties(n,{CheckboxEditor:{get:function(){return u}},__esModule:{value:!0}});var o,i,r,s=(o=e("editors"),o&&o.__esModule&&o||{"default":o}).registerEditor,a=(i=e("_baseEditor"),i&&i.__esModule&&i||{"default":i}).BaseEditor,l=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}).hasClass,u=function(){$traceurRuntime.superConstructor(c).apply(this,arguments)},c=u;$traceurRuntime.createClass(u,{beginEditing:function(){var e=this.TD.querySelector('input[type="checkbox"]'); +l(e,"htBadValue")||e.click()},finishEditing:function(){},init:function(){},open:function(){},close:function(){},getValue:function(){},setValue:function(){},focus:function(){}},{},a),s("checkbox",u)},{_baseEditor:30,editors:29,"helpers/dom/element":45}],33:[function(e,t,n){"use strict";Object.defineProperties(n,{DateEditor:{get:function(){return S}},__esModule:{value:!0}});var o,i,r,s,a,l,u,c,d,h=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),f=h.addClass,p=h.outerHeight,g=(i=e("helpers/object"),i&&i.__esModule&&i||{"default":i}).deepExtend,m=(r=e("eventManager"),r&&r.__esModule&&r||{"default":r}).EventManager,v=(s=e("editors"),s&&s.__esModule&&s||{"default":s}),w=(v.getEditor,v.registerEditor),y=(a=e("helpers/unicode"),a&&a.__esModule&&a||{"default":a}).isMetaKey,b=(l=e("helpers/dom/event"),l&&l.__esModule&&l||{"default":l}).stopPropagation,C=(u=e("textEditor"),u&&u.__esModule&&u||{"default":u}).TextEditor,R=(c=e("moment"),c&&c.__esModule&&c||{"default":c})["default"],_=(d=e("pikaday"),d&&d.__esModule&&d||{"default":d})["default"];Handsontable.editors=Handsontable.editors||{},Handsontable.editors.DateEditor=S;var S=function(e){this.$datePicker=null,this.datePicker=null,this.datePickerStyle=null,this.defaultDateFormat="DD/MM/YYYY",this.isCellEdited=!1,this.parentDestroyed=!1,$traceurRuntime.superConstructor(E).call(this,e)},E=S;$traceurRuntime.createClass(S,{init:function(){var e=this;if("function"!=typeof R)throw new Error("You need to include moment.js to your project.");if("function"!=typeof _)throw new Error("You need to include Pikaday to your project.");$traceurRuntime.superGet(this,E.prototype,"init").call(this),this.instance.addHook("afterDestroy",function(){e.parentDestroyed=!0,e.destroyElements()})},createElements:function(){$traceurRuntime.superGet(this,E.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,f(this.datePicker,"htDatepickerHolder"),document.body.appendChild(this.datePicker),this.$datePicker=new _(this.getDatePickerConfig());var e=new m(this);e.addEventListener(this.datePicker,"mousedown",function(e){return b(e)}),this.hideDatepicker()},destroyElements:function(){this.$datePicker.destroy()},prepare:function(e,t,n,o,i,r){this._opened=!1,$traceurRuntime.superGet(this,E.prototype,"prepare").call(this,e,t,n,o,i,r)},open:function(){var e=void 0!==arguments[0]?arguments[0]:null;$traceurRuntime.superGet(this,E.prototype,"open").call(this),this.showDatepicker(e)},close:function(){var e=this;this._opened=!1,this.instance._registerTimeout(setTimeout(function(){e.instance.selection.refreshBorders()},0)),$traceurRuntime.superGet(this,E.prototype,"close").call(this)},finishEditing:function(){var e=void 0!==arguments[0]?arguments[0]:!1,t=void 0!==arguments[1]?arguments[1]:!1;if(e){var n=this.originalValue;void 0!==n&&this.setValue(n)}this.hideDatepicker(),$traceurRuntime.superGet(this,E.prototype,"finishEditing").call(this,e,t)},showDatepicker:function(e){this.$datePicker.config(this.getDatePickerConfig());var t,n=this.TD.getBoundingClientRect(),o=this.cellProperties.dateFormat||this.defaultDateFormat,i=this.$datePicker.config(),r=this.instance.view.isMouseDown(),s=e?y(e.keyCode):!1;this.datePickerStyle.top=window.pageYOffset+n.top+p(this.TD)+"px",this.datePickerStyle.left=window.pageXOffset+n.left+"px",this.$datePicker._onInputFocus=function(){},i.format=o,this.originalValue?(t=this.originalValue,R(t,o,!0).isValid()&&this.$datePicker.setMoment(R(t,o),!0),s||r||this.setValue("")):this.cellProperties.defaultDate?(t=this.cellProperties.defaultDate,i.defaultDate=t,R(t,o,!0).isValid()&&this.$datePicker.setMoment(R(t,o),!0),s||r||this.setValue("")):this.$datePicker.gotoToday(),this.datePickerStyle.display="block",this.$datePicker.show()},hideDatepicker:function(){this.datePickerStyle.display="none",this.$datePicker.hide()},getDatePickerConfig:function(){var e=this,t=this.TEXTAREA,n={};this.cellProperties&&this.cellProperties.datePickerConfig&&g(n,this.cellProperties.datePickerConfig);var o=n.onSelect,i=n.onClose;return n.field=t,n.trigger=t,n.container=this.datePicker,n.bound=!1,n.format=n.format||this.defaultDateFormat,n.reposition=n.reposition||!1,n.onSelect=function(t){isNaN(t.getTime())||(t=R(t).format(e.cellProperties.dateFormat||e.defaultDateFormat)),e.setValue(t),e.hideDatepicker(),o&&o()},n.onClose=function(){e.parentDestroyed||e.finishEditing(!1),i&&i()},n}},{},C),w("date",S)},{editors:29,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/object":51,"helpers/unicode":54,moment:"moment",pikaday:"pikaday",textEditor:40}],34:[function(e,t,n){"use strict";Object.defineProperties(n,{DropdownEditor:{get:function(){return l}},__esModule:{value:!0}});var o,i,r=(o=e("editors"),o&&o.__esModule&&o||{"default":o}),s=(r.getEditor,r.registerEditor),a=(i=e("autocompleteEditor"),i&&i.__esModule&&i||{"default":i}).AutocompleteEditor,l=function(){$traceurRuntime.superConstructor(u).apply(this,arguments)},u=l;$traceurRuntime.createClass(l,{prepare:function(e,t,n,o,i,r){$traceurRuntime.superGet(this,u.prototype,"prepare").call(this,e,t,n,o,i,r),this.cellProperties.filter=!1,this.cellProperties.strict=!0}},{},a),Handsontable.hooks.add("beforeValidate",function(e,t,n,o){var i=this.getCellMeta(t,n);i.editor===Handsontable.editors.DropdownEditor&&void 0===i.strict&&(i.filter=!1,i.strict=!0)}),s("dropdown",l)},{autocompleteEditor:31,editors:29}],35:[function(e,t,n){"use strict";Object.defineProperties(n,{HandsontableEditor:{get:function(){return w}},__esModule:{value:!0}});var o,i,r,s,a,l,u=(o=e("helpers/unicode"),o&&o.__esModule&&o||{"default":o}).KEY_CODES,c=(i=e("helpers/object"),i&&i.__esModule&&i||{"default":i}).extend,d=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}).setCaretPosition,h=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),f=h.stopImmediatePropagation,p=h.isImmediatePropagationStopped,g=(a=e("editors"),a&&a.__esModule&&a||{"default":a}),m=(g.getEditor,g.registerEditor),v=(l=e("textEditor"),l&&l.__esModule&&l||{"default":l}).TextEditor,w=v.prototype.extend();w.prototype.createElements=function(){v.prototype.createElements.apply(this,arguments);var e=document.createElement("DIV");e.className="handsontableEditor",this.TEXTAREA_PARENT.appendChild(e),this.htContainer=e,this.assignHooks()},w.prototype.prepare=function(e,t,n,o,i,r){v.prototype.prepare.apply(this,arguments);var s=this,a={startRows:0,startCols:0,minRows:0,minCols:0,className:"listbox",copyPaste:!1,autoColumnSize:!1,autoRowSize:!1,readOnly:!0,fillHandle:!1,afterOnCellMouseDown:function(){var e=this.getValue();void 0!==e&&s.setValue(e),s.instance.destroyEditor()}};this.cellProperties.handsontable&&c(a,r.handsontable),this.htOptions=a};var y=function(e){if(!p(e)){var t,n=this.getActiveEditor(),o=n.htEditor.getInstance();if(e.keyCode==u.ARROW_DOWN)if(o.getSelected()){var i=o.getSelected()[0],r=o.countRows()-1;t=Math.min(r,i+1)}else t=0;else if(e.keyCode==u.ARROW_UP&&o.getSelected()){var i=o.getSelected()[0];t=i-1}void 0!==t&&(0>t?o.deselectCell():o.selectCell(t,0),o.getData().length&&(e.preventDefault(),f(e),n.instance.listen(),n.TEXTAREA.focus()))}};w.prototype.open=function(){this.instance.addHook("beforeKeyDown",y),v.prototype.open.apply(this,arguments),this.htEditor&&this.htEditor.destroy(),this.htEditor=new Handsontable(this.htContainer,this.htOptions),this.cellProperties.strict?(this.htEditor.selectCell(0,0),this.TEXTAREA.style.visibility="hidden"):(this.htEditor.deselectCell(),this.TEXTAREA.style.visibility="visible"),d(this.TEXTAREA,0,this.TEXTAREA.value.length)},w.prototype.close=function(){this.instance.removeHook("beforeKeyDown",y),this.instance.listen(),v.prototype.close.apply(this,arguments)},w.prototype.focus=function(){this.instance.listen(),v.prototype.focus.apply(this,arguments)},w.prototype.beginEditing=function(e){var t=this.instance.getSettings().onBeginEditing;t&&t()===!1||v.prototype.beginEditing.apply(this,arguments)},w.prototype.finishEditing=function(e,t){if(this.htEditor&&this.htEditor.isListening()&&this.instance.listen(),this.htEditor&&this.htEditor.getSelected()){var n=this.htEditor.getInstance().getValue();void 0!==n&&this.setValue(n)}return v.prototype.finishEditing.apply(this,arguments)},w.prototype.assignHooks=function(){var e=this;this.instance.addHook("afterDestroy",function(){e.htEditor&&e.htEditor.destroy()})},m("handsontable",w)},{editors:29,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/object":51,"helpers/unicode":54,textEditor:40}],36:[function(e,t,n){"use strict";Object.defineProperties(n,{MobileTextEditor:{get:function(){return O}},__esModule:{value:!0}});var o,i,r,s,a,l,u=(o=e("helpers/unicode"),o&&o.__esModule&&o||{"default":o}).KEY_CODES,c=(i=e("helpers/dom/event"),i&&i.__esModule&&i||{"default":i}),d=c.stopImmediatePropagation,h=c.isImmediatePropagationStopped,f=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),p=f.addClass,g=f.getScrollLeft,m=f.getScrollTop,v=f.hasClass,w=f.isChildOf,y=f.offset,b=f.outerHeight,C=f.outerWidth,R=f.removeClass,_=f.setCaretPosition,S=(s=e("editors"),s&&s.__esModule&&s||{"default":s}),E=(S.getEditor,S.registerEditor),T=(a=e("_baseEditor"),a&&a.__esModule&&a||{"default":a}).BaseEditor,M=(l=e("eventManager"),l&&l.__esModule&&l||{"default":l}).eventManager,O=T.prototype.extend(),k={},H=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 e in this.controls)this.controls.hasOwnProperty(e)&&this.positionControls.appendChild(this.controls[e])};O.prototype.valueChanged=function(){return this.initValue!=this.getValue()},O.prototype.init=function(){var e=this;this.eventManager=M(this.instance),this.createElements(),this.bindEvents(),this.instance.addHook("afterDestroy",function(){e.destroy()})},O.prototype.getValue=function(){return this.TEXTAREA.value},O.prototype.setValue=function(e){this.initValue=e,this.TEXTAREA.value=e},O.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"),p(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),H.call(this),document.body.appendChild(this.editorContainer)},O.prototype.onBeforeKeyDown=function(e){var t=this,n=t.getActiveEditor();if(e.target===n.TEXTAREA&&!h(e))switch(e.keyCode){case u.ENTER:n.close(),e.preventDefault();break;case u.BACKSPACE:d(e)}},O.prototype.open=function(){this.instance.addHook("beforeKeyDown",this.onBeforeKeyDown),p(this.editorContainer,"active"),R(this.cellPointer,"hidden"),this.updateEditorPosition()},O.prototype.focus=function(){this.TEXTAREA.focus(),_(this.TEXTAREA,this.TEXTAREA.value.length)},O.prototype.close=function(){this.TEXTAREA.blur(),this.instance.removeHook("beforeKeyDown",this.onBeforeKeyDown),R(this.editorContainer,"active")},O.prototype.scrollToView=function(){var e=this.instance.getSelectedRange().highlight;this.instance.view.scrollViewport(e)},O.prototype.hideCellPointer=function(){v(this.cellPointer,"hidden")||p(this.cellPointer,"hidden")},O.prototype.updateEditorPosition=function(e,t){if(e&&t)e=parseInt(e,10),t=parseInt(t,10),this.editorContainer.style.top=t+"px",this.editorContainer.style.left=e+"px";else{var n=this.instance.getSelected(),o=this.instance.getCell(n[0],n[1]);if(k.cellPointer||(k.cellPointer={height:b(this.cellPointer),width:C(this.cellPointer)}),k.editorContainer||(k.editorContainer={width:C(this.editorContainer)}),void 0!==o){var i=this.instance.view.wt.wtOverlays.leftOverlay.trimmingContainer==window?0:g(this.instance.view.wt.wtOverlays.leftOverlay.holder),r=this.instance.view.wt.wtOverlays.topOverlay.trimmingContainer==window?0:m(this.instance.view.wt.wtOverlays.topOverlay.holder),s=y(o),a=C(o),l={x:i,y:r};this.editorContainer.style.top=parseInt(s.top+b(o)-l.y+k.cellPointer.height,10)+"px",this.editorContainer.style.left=parseInt(window.innerWidth/2-k.editorContainer.width/2,10)+"px",s.left+a/2>parseInt(this.editorContainer.style.left,10)+k.editorContainer.width?this.editorContainer.style.left=window.innerWidth-k.editorContainer.width+"px":s.left+a/2n;n++)t[e[n]]=e[n];else"object"==typeof e&&(t=e);return t},S.prototype.getValue=function(){return this.select.value},S.prototype.setValue=function(e){this.select.value=e};var E=function(e){var t=this,n=t.getActiveEditor();switch(e.keyCode){case b.ARROW_UP:var o=n.select.selectedIndex-1;o>=0&&(n.select[o].selected=!0),y(e),e.preventDefault();break;case b.ARROW_DOWN:var i=n.select.selectedIndex+1;i<=n.select.length-1&&(n.select[i].selected=!0),y(e),e.preventDefault()}};S.prototype.open=function(){this._opened=!0,this.refreshDimensions(),this.select.style.display="",this.instance.addHook("beforeKeyDown",E)},S.prototype.close=function(){this._opened=!1,this.select.style.display="none",this.instance.removeHook("beforeKeyDown",E)},S.prototype.focus=function(){this.select.focus()},S.prototype.refreshDimensions=function(){if(this.state===Handsontable.EditorState.EDITING){if(this.TD=this.getEditedCell(),!this.TD)return void this.close();var e,t=v(this.TD)+1,n=m(this.TD)+1,o=g(this.TD),i=g(this.instance.rootElement),r=p(this.TD),s=o.top-i.top-1-(r.scrollTop||0),a=o.left-i.left-1-(r.scrollLeft||0),l=this.checkEditorSection(),u=this.instance.getSettings();u.rowHeaders?1:0,u.colHeaders?1:0;switch(l){case"top":e=f(this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.holder.parentNode);break;case"left":e=f(this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.holder.parentNode);break;case"top-left-corner":e=f(this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.holder.parentNode);break;case"bottom-left-corner":e=f(this.instance.view.wt.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.holder.parentNode);break;case"bottom":e=f(this.instance.view.wt.wtOverlays.bottomOverlay.clone.wtTable.holder.parentNode)}0===this.instance.getSelected()[0]&&(s+=1),0===this.instance.getSelected()[1]&&(a+=1);var c=this.select.style;e&&-1!=e?c[e[0]]=e[1]:w(this.select);var d=h(this.TD);parseInt(d.borderTopWidth,10)>0&&(n-=1),parseInt(d.borderLeftWidth,10)>0&&(t-=1),c.height=n+"px",c.minWidth=t+"px",c.top=s+"px",c.left=a+"px",c.margin="0px"}},S.prototype.getEditedCell=function(){var e,t=this.checkEditorSection();switch(t){case"top":e=this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.select.style.zIndex=101;break;case"corner":e=this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.select.style.zIndex=103;break;case"left":e=this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.select.style.zIndex=102;break;default:e=this.instance.getCell(this.row,this.col),this.select.style.zIndex=""}return-1!=e&&-2!=e?e:void 0},R("select",S)},{_baseEditor:30,editors:29,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/unicode":54}],40:[function(e,t,n){"use strict";Object.defineProperties(n,{TextEditor:{get:function(){return A}},__esModule:{value:!0}});var o,i,r,s,a,l,u,c=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),d=c.addClass,h=c.getCaretPosition,f=c.getComputedStyle,p=c.getCssTransform,g=c.getScrollableElement,m=c.getScrollbarWidth,v=c.innerWidth,w=c.offset,y=c.resetCssTransform,b=c.setCaretPosition,C=c.hasVerticalScrollbar,R=c.hasHorizontalScrollbar,_=(i=e("autoResize"),i&&i.__esModule&&i||{"default":i})["default"],S=(r=e("_baseEditor"),r&&r.__esModule&&r||{"default":r}).BaseEditor,E=(s=e("eventManager"),s&&s.__esModule&&s||{"default":s}).eventManager,T=(a=e("editors"),a&&a.__esModule&&a||{"default":a}),M=(T.getEditor,T.registerEditor),O=(l=e("helpers/unicode"),l&&l.__esModule&&l||{"default":l}).KEY_CODES,k=(u=e("helpers/dom/event"),u&&u.__esModule&&u||{"default":u}),H=k.stopPropagation,D=k.stopImmediatePropagation,x=k.isImmediatePropagationStopped,A=S.prototype.extend();A.prototype.init=function(){var e=this;this.createElements(),this.eventManager=E(this),this.bindEvents(),this.autoResize=_(),this.instance.addHook("afterDestroy",function(){e.destroy()})},A.prototype.getValue=function(){return this.TEXTAREA.value},A.prototype.setValue=function(e){this.TEXTAREA.value=e};var P=function(e){var t,n=this,o=n.getActiveEditor();if(t=(e.ctrlKey||e.metaKey)&&!e.altKey,e.target===o.TEXTAREA&&!x(e)){if(17===e.keyCode||224===e.keyCode||91===e.keyCode||93===e.keyCode)return void D(e);switch(e.keyCode){case O.ARROW_RIGHT:o.isInFullEditMode()&&(!o.isWaiting()&&!o.allowKeyEventPropagation||!o.isWaiting()&&o.allowKeyEventPropagation&&!o.allowKeyEventPropagation(e.keyCode))&&D(e);break;case O.ARROW_LEFT:o.isInFullEditMode()&&(!o.isWaiting()&&!o.allowKeyEventPropagation||!o.isWaiting()&&o.allowKeyEventPropagation&&!o.allowKeyEventPropagation(e.keyCode))&&D(e);break;case O.ARROW_UP:case O.ARROW_DOWN:o.isInFullEditMode()&&(!o.isWaiting()&&!o.allowKeyEventPropagation||!o.isWaiting()&&o.allowKeyEventPropagation&&!o.allowKeyEventPropagation(e.keyCode))&&D(e);break;case O.ENTER:var i=o.instance.getSelected(),r=!(i[0]===i[2]&&i[1]===i[3]);if(t&&!r||e.altKey){if(o.isOpened()){var s=h(o.TEXTAREA),a=o.getValue(),l=a.slice(0,s)+"\n"+a.slice(s);o.setValue(l),b(o.TEXTAREA,s+1)}else o.beginEditing(o.originalValue+"\n");D(e)}e.preventDefault();break;case O.A:case O.X:case O.C:case O.V:t&&D(e);break;case O.BACKSPACE:case O.DELETE:case O.HOME:case O.END:D(e)}-1===[O.ARROW_UP,O.ARROW_RIGHT,O.ARROW_DOWN,O.ARROW_LEFT].indexOf(e.keyCode)&&o.autoResize.resize(String.fromCharCode(e.keyCode))}};A.prototype.open=function(){this.refreshDimensions(),this.instance.addHook("beforeKeyDown",P)},A.prototype.close=function(e){this.textareaParentStyle.display="none",this.autoResize.unObserve(),document.activeElement===this.TEXTAREA&&this.instance.listen(),this.instance.removeHook("beforeKeyDown",P)},A.prototype.focus=function(){this.TEXTAREA.focus(),b(this.TEXTAREA,this.TEXTAREA.value.length)},A.prototype.createElements=function(){this.TEXTAREA=document.createElement("TEXTAREA"),d(this.TEXTAREA,"handsontableInput"),this.textareaStyle=this.TEXTAREA.style,this.textareaStyle.width=0,this.textareaStyle.height=0,this.TEXTAREA_PARENT=document.createElement("DIV"),d(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 e=this;this.instance._registerTimeout(setTimeout(function(){e.refreshDimensions()},0))},A.prototype.getEditedCell=function(){var e,t=this.checkEditorSection();switch(t){case"top":e=this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.textareaParentStyle.zIndex=101;break;case"top-left-corner":e=this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.textareaParentStyle.zIndex=103;break;case"bottom-left-corner":e=this.instance.view.wt.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.textareaParentStyle.zIndex=103;break;case"left":e=this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.textareaParentStyle.zIndex=102;break;case"bottom":e=this.instance.view.wt.wtOverlays.bottomOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.textareaParentStyle.zIndex=102;break;default:e=this.instance.getCell(this.row,this.col),this.textareaParentStyle.zIndex=""}return-1!=e&&-2!=e?e:void 0},A.prototype.refreshDimensions=function(){if(this.state===Handsontable.EditorState.EDITING){if(this.TD=this.getEditedCell(),!this.TD)return void this.close(!0);var e,t=w(this.TD),n=w(this.instance.rootElement),o=g(this.TD),i=this.instance.countRows(),r=t.top-n.top-1-(o.scrollTop||0),s=t.left-n.left-1-(o.scrollLeft||0),a=this.instance.getSettings(),l=(this.instance.hasRowHeaders(),this.instance.hasColHeaders()),u=this.checkEditorSection(),c=this.TD.style.backgroundColor;switch(u){case"top":e=p(this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.holder.parentNode);break;case"left":e=p(this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.holder.parentNode);break;case"top-left-corner":e=p(this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.holder.parentNode);break;case"bottom-left-corner":e=p(this.instance.view.wt.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.holder.parentNode);break;case"bottom":e=p(this.instance.view.wt.wtOverlays.bottomOverlay.clone.wtTable.holder.parentNode)}(l&&0===this.instance.getSelected()[0]||a.fixedRowsBottom&&this.instance.getSelected()[0]===i-a.fixedRowsBottom)&&(r+=1),0===this.instance.getSelected()[1]&&(s+=1),e&&-1!=e?this.textareaParentStyle[e[0]]=e[1]:y(this.TEXTAREA_PARENT),this.textareaParentStyle.top=r+"px",this.textareaParentStyle.left=s+"px";var d=this.instance.view.wt.wtViewport.rowsRenderCalculator.startPosition,h=this.instance.view.wt.wtViewport.columnsRenderCalculator.startPosition,b=this.instance.view.wt.wtOverlays.leftOverlay.getScrollPosition(),_=this.instance.view.wt.wtOverlays.topOverlay.getScrollPosition(),S=m(),E=this.TD.offsetTop+d-_,T=this.TD.offsetLeft+h-b,M=v(this.TD)-8,O=C(o)?S:0,k=R(o)?S:0,H=this.instance.view.maximumVisibleElementWidth(T)-9-O,D=this.TD.scrollHeight+1,x=Math.max(this.instance.view.maximumVisibleElementHeight(E)-k,23),A=f(this.TD);this.TEXTAREA.style.fontSize=A.fontSize,this.TEXTAREA.style.fontFamily=A.fontFamily,this.TEXTAREA.style.backgroundColor="",this.TEXTAREA.style.backgroundColor=c?c:f(this.TEXTAREA).backgroundColor,this.autoResize.init(this.TEXTAREA,{minHeight:Math.min(D,x),maxHeight:x,minWidth:Math.min(M,H),maxWidth:H},!0),this.textareaParentStyle.display="block"}},A.prototype.bindEvents=function(){var e=this;this.eventManager.addEventListener(this.TEXTAREA,"cut",function(e){H(e)}),this.eventManager.addEventListener(this.TEXTAREA,"paste",function(e){H(e)}),this.instance.addHook("afterScrollHorizontally",function(){e.refreshDimensions()}),this.instance.addHook("afterScrollVertically",function(){e.refreshDimensions()}),this.instance.addHook("afterColumnResize",function(){e.refreshDimensions(),e.focus()}),this.instance.addHook("afterRowResize",function(){e.refreshDimensions(),e.focus()}),this.instance.addHook("afterDestroy",function(){e.eventManager.destroy()})},A.prototype.destroy=function(){this.eventManager.destroy()},M("text",A)},{_baseEditor:30,autoResize:"autoResize",editors:29,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/unicode":54}],41:[function(e,t,n){"use strict";function o(e,t){var n,o,i,r,s,a,l="HOT-TABLE";if(t.isTargetWebComponent=!1,t.realTarget=t.target,a=t.stopImmediatePropagation,t.stopImmediatePropagation=function(){a.apply(this),h(this)},!Handsontable.eventManager.isHotTableEnv)return t;for(t=u(t),s=t.path?t.path.length:0;s--;){if(t.path[s].nodeName===l)n=!0;else if(n&&t.path[s].shadowRoot){r=t.path[s];break}0!==s||r||(r=t.path[s])}return r||(r=t.target),t.isTargetWebComponent=!0,d()?t.realTarget=t.srcElement||t.toElement:(e instanceof Handsontable.Core||e instanceof Walkontable)&&(e instanceof Handsontable.Core?o=e.view?e.view.wt.wtTable.TABLE:null:e instanceof Walkontable&&(o=e.wtTable.TABLE.parentNode.parentNode),i=c(t.target,[l],o),i?t.realTarget=o.querySelector(l)||t.target:t.realTarget=t.target),Object.defineProperty(t,"target",{get:function(){return u(r)},enumerable:!0,configurable:!0}),t}function i(e){return new f(e)}Object.defineProperties(n,{EventManager:{get:function(){return f}},eventManager:{get:function(){return i}},__esModule:{value:!0}});var r,s,a,l=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),u=l.polymerWrap,c=l.closest,d=(s=e("helpers/feature"),s&&s.__esModule&&s||{"default":s}).isWebComponentSupportedNatively,h=(a=e("helpers/dom/event"),a&&a.__esModule&&a||{"default":a}).stopImmediatePropagation,f=function(){var e=void 0!==arguments[0]?arguments[0]:null;this.context=e||this,this.context.eventListeners||(this.context.eventListeners=[])};$traceurRuntime.createClass(f,{addEventListener:function(e,t,n){function i(e){void 0==e.target&&void 0!=e.srcElement&&(e.definePoperty?e.definePoperty("target",{value:e.srcElement}):e.target=e.srcElement),void 0==e.preventDefault&&(e.definePoperty?e.definePoperty("preventDefault",{value:function(){this.returnValue=!1}}):e.preventDefault=function(){this.returnValue=!1}),e=o(s,e),n.call(this,e)}var r=this,s=this.context;return this.context.eventListeners.push({element:e,event:t,callback:n,callbackProxy:i}),window.addEventListener?e.addEventListener(t,i,!1):e.attachEvent("on"+t,i),Handsontable.countEventManagerListeners++,function(){r.removeEventListener(e,t,n); +}},removeEventListener:function(e,t,n){for(var o,i=this.context.eventListeners.length;i--;)if(o=this.context.eventListeners[i],o.event==t&&o.element==e){if(n&&n!=o.callback)continue;this.context.eventListeners.splice(i,1),o.element.removeEventListener?o.element.removeEventListener(o.event,o.callbackProxy,!1):o.element.detachEvent("on"+o.event,o.callbackProxy),Handsontable.countEventManagerListeners--}},clearEvents:function(){if(this.context)for(var e=this.context.eventListeners.length;e--;){var t=this.context.eventListeners[e];t&&this.removeEventListener(t.element,t.event,t.callback)}},clear:function(){this.clearEvents()},destroy:function(){this.clearEvents(),this.context=null},fireEvent:function(e,t){var n,o={bubbles:!0,cancelable:"mousemove"!==t,view:window,detail:0,screenX:0,screenY:0,clientX:1,clientY:1,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:void 0};document.createEvent?(n=document.createEvent("MouseEvents"),n.initMouseEvent(t,o.bubbles,o.cancelable,o.view,o.detail,o.screenX,o.screenY,o.clientX,o.clientY,o.ctrlKey,o.altKey,o.shiftKey,o.metaKey,o.button,o.relatedTarget||document.body.parentNode)):n=document.createEventObject(),e.dispatchEvent?e.dispatchEvent(n):e.fireEvent("on"+t,n)}},{}),window.Handsontable=window.Handsontable||{},Handsontable.countEventManagerListeners=0,Handsontable.eventManager=i},{"helpers/dom/element":45,"helpers/dom/event":46,"helpers/feature":47}],42:[function(e,t,n){"use strict";function o(e){for(var t=0,n=e.length;n>t;)e[t]=[e[t]],t++}function i(e,t){for(var n=0,o=t.length;o>n;)e.push(t[n]),n++}function r(e){var t=[];if(!e||0===e.length||!e[0]||0===e[0].length)return t;for(var n=e.length,o=e[0].length,i=0;n>i;i++)for(var r=0;o>r;r++)t[r]||(t[r]=[]),t[r][i]=e[i][r];return t}function s(e,t,n,o){var i=-1,r=e.length;for(o&&r&&(n=e[++i]);++it?e:t},Array.isArray(e)?e[0]:void 0)}function h(e){return s(e,function(e,t){return t>e?e:t},Array.isArray(e)?e[0]:void 0)}function f(e){return e.length?c(e)/e.length:0}function p(e){return s(e,function(e,t){return e.concat(Array.isArray(t)?p(t):t)},[])}function g(e){var t=[];return u(e,function(e){-1===t.indexOf(e)&&t.push(e)}),t}Object.defineProperties(n,{to2dArray:{get:function(){return o}},extendArray:{get:function(){return i}},pivot:{get:function(){return r}},arrayReduce:{get:function(){return s}},arrayFilter:{get:function(){return a}},arrayMap:{get:function(){return l}},arrayEach:{get:function(){return u}},arraySum:{get:function(){return c}},arrayMax:{get:function(){return d}},arrayMin:{get:function(){return h}},arrayAvg:{get:function(){return f}},arrayFlatten:{get:function(){return p}},arrayUnique:{get:function(){return g}},__esModule:{value:!0}})},{}],43:[function(e,t,n){"use strict";function o(){return l}function i(){return u}function r(){return c}function s(){return d}function a(e){return e||(e=navigator.userAgent),/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(e)}Object.defineProperties(n,{isIE8:{get:function(){return o}},isIE9:{get:function(){return i}},isSafari:{get:function(){return r}},isChrome:{get:function(){return s}},isMobileBrowser:{get:function(){return a}},__esModule:{value:!0}});var l=!document.createTextNode("test").textContent,u=!!document.documentMode,c=/Safari/.test(navigator.userAgent)&&/Apple Computer/.test(navigator.vendor),d=/Chrome/.test(navigator.userAgent)&&/Google/.test(navigator.vendor)},{}],44:[function(e,t,n){"use strict";function o(e){for(var t,n=e+1,o="";n>0;)t=(n-1)%26,o=String.fromCharCode(65+t)+o,n=parseInt((n-t)/26,10);return o}function i(e,t){e="number"==typeof e?e:100,t="number"==typeof t?t:4;var n,i,r=[];for(n=0;e>n;n++){var s=[];for(i=0;t>i;i++)s.push(o(i)+(n+1));r.push(s)}return r}function r(e,t){e="number"==typeof e?e:100,t="number"==typeof t?t:4;var n,i,r=[];for(n=0;e>n;n++){var s={};for(i=0;t>i;i++)s["prop"+i]=o(i)+(n+1);r.push(s)}return r}function s(e,t){for(var n,o=[],i=0;e>i;i++){n=[];for(var r=0;t>r;r++)n.push("");o.push(n)}return o}function a(e){var t,n,o,i,r=[],s=0;for(t=0,n=e.length;n>t;t++)for(o=0,i=e[t].length;i>o;o++)o==s&&(r.push([]),s++),r[o].push(e[t][o]);return r}function l(e,t){function n(e){var t=Handsontable.cellTypes[e];if("undefined"==typeof t)throw new Error('You declared cell type "'+e+'" 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 t}return t="undefined"==typeof t?!0:t,function(o,i){return function r(o){if(o){if(o.hasOwnProperty(e)&&void 0!==o[e])return o[e];if(o.hasOwnProperty("type")&&o.type){var i;if("string"!=typeof o.type)throw new Error("Cell type must be a string ");if(i=n(o.type),i.hasOwnProperty(e))return i[e];if(t)return}return r(c(o))}}("number"==typeof o?this.getCellMeta(o,i):o)}}Object.defineProperties(n,{spreadsheetColumnLabel:{get:function(){return o}},createSpreadsheetData:{get:function(){return i}},createSpreadsheetObjectData:{get:function(){return r}},createEmptySpreadsheetData:{get:function(){return s}},translateRowsToColumns:{get:function(){return a}},cellMethodLookupFactory:{get:function(){return l}},__esModule:{value:!0}});var u,c=(u=e("object"),u&&u.__esModule&&u||{"default":u}).getPrototypeOf},{object:51}],45:[function(e,t,n){"use strict";function o(e,t,n){for(;null!=e&&e!==n;){if(e.nodeType===Node.ELEMENT_NODE&&(t.indexOf(e.nodeName)>-1||t.indexOf(e)>-1))return e;e=e.host&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE?e.host:e.parentNode}return null}function i(e,t){var n=e.parentNode,o=[];for("string"==typeof t?o=Array.prototype.slice.call(document.querySelectorAll(t),0):o.push(t);null!=n;){if(o.indexOf(n)>-1)return!0;n=n.parentNode}return!1}function r(e){function t(e){return e.nodeType===Node.ELEMENT_NODE&&e.nodeName===o.toUpperCase()}var n,o="hot-table",i=!1;for(n=s(e);null!=n;){if(t(n)){i=!0;break}if(n.host&&n.nodeType===Node.DOCUMENT_FRAGMENT_NODE){if(i=t(n.host))break;n=n.host}n=n.parentNode}return i}function s(e){return"undefined"!=typeof Polymer&&"function"==typeof wrap?wrap(e):e}function a(e){return"undefined"!=typeof Polymer&&"function"==typeof unwrap?unwrap(e):e}function l(e){var t=0;if(e.previousSibling)for(;e=e.previousSibling;)++t;return t}function u(e,t){var n=document.querySelector(".ht_clone_"+e);return n?n.contains(t):null}function c(e){var t=0,n=[];if(!e||!e.length)return n;for(;e[t];)n.push(e[t]),t++;return n}function d(e,t){return K(e,t)}function h(e,t){return q(e,t)}function f(e,t){return Z(e,t)}function p(e,t){if(3===e.nodeType)t.removeChild(e);else if(["TABLE","THEAD","TBODY","TFOOT","TR"].indexOf(e.nodeName)>-1)for(var n=e.childNodes,o=n.length-1;o>=0;o--)p(n[o],e)}function g(e){for(var t;t=e.lastChild;)e.removeChild(t)}function m(e,t){ae.test(t)?e.innerHTML=t:v(e,t)}function v(e,t){var n=e.firstChild;n&&3===n.nodeType&&null===n.nextSibling?le?n.textContent=t:n.data=t:(g(e),e.appendChild(document.createTextNode(t)))}function w(e){for(var t=e;a(t)!==document.documentElement;){if(null===t)return!1;if(t.nodeType===Node.DOCUMENT_FRAGMENT_NODE){if(t.host){if(t.host.impl)return w(t.host.impl);if(t.host)return w(t.host);throw new Error("Lost in Web Components world")}return!1}if("none"===t.style.display)return!1;t=t.parentNode}return!0}function y(e){var t,n,o,i,r;if(i=document.documentElement,ne()&&e.firstChild&&"CAPTION"===e.firstChild.nodeName)return r=e.getBoundingClientRect(),{top:r.top+(window.pageYOffset||i.scrollTop)-(i.clientTop||0),left:r.left+(window.pageXOffset||i.scrollLeft)-(i.clientLeft||0)};for(t=e.offsetLeft,n=e.offsetTop,o=e;(e=e.offsetParent)&&e!==document.body;)t+=e.offsetLeft,n+=e.offsetTop,o=e;return o&&"fixed"===o.style.position&&(t+=window.pageXOffset||i.scrollLeft,n+=window.pageYOffset||i.scrollTop),{left:t,top:n}}function b(){var e=window.scrollY;return void 0===e&&(e=document.documentElement.scrollTop),e}function C(){var e=window.scrollX;return void 0===e&&(e=document.documentElement.scrollLeft),e}function R(e){return e===window?b():e.scrollTop}function _(e){return e===window?C():e.scrollLeft}function S(e){for(var t,n,o,i=e.parentNode,r=["auto","scroll"],s="",a="",l="",u="";i&&i.style&&document.body!==i;){if(t=i.style.overflow,n=i.style.overflowX,o=i.style.overflowY,"scroll"==t||"scroll"==n||"scroll"==o)return i;if(window.getComputedStyle&&(s=window.getComputedStyle(i),a=s.getPropertyValue("overflow"),l=s.getPropertyValue("overflow-y"),u=s.getPropertyValue("overflow-x"),"scroll"===a||"scroll"===u||"scroll"===l))return i;if(i.clientHeight<=i.scrollHeight&&(-1!==r.indexOf(o)||-1!==r.indexOf(t)||-1!==r.indexOf(a)||-1!==r.indexOf(l)))return i;if(i.clientWidth<=i.scrollWidth&&(-1!==r.indexOf(n)||-1!==r.indexOf(t)||-1!==r.indexOf(a)||-1!==r.indexOf(u)))return i;i=i.parentNode}return window}function E(e){for(var t=e.parentNode;t&&t.style&&document.body!==t;){if("visible"!==t.style.overflow&&""!==t.style.overflow)return t;if(window.getComputedStyle){var n=window.getComputedStyle(t);if("visible"!==n.getPropertyValue("overflow")&&""!==n.getPropertyValue("overflow"))return t}t=t.parentNode}return window}function T(e,t){if(e){if(e!==window){var n,o=e.style[t];return""!==o&&void 0!==o?o:(n=M(e),""!==n[t]&&void 0!==n[t]?n[t]:void 0)}if("width"===t)return window.innerWidth+"px";if("height"===t)return window.innerHeight+"px"}}function M(e){return e.currentStyle||document.defaultView.getComputedStyle(e)}function O(e){return e.offsetWidth}function k(e){return ne()&&e.firstChild&&"CAPTION"===e.firstChild.nodeName?e.offsetHeight+e.firstChild.offsetHeight:e.offsetHeight}function H(e){return e.clientHeight||e.innerHeight}function D(e){return e.clientWidth||e.innerWidth}function x(e,t,n){window.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)}function A(e,t,n){window.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent("on"+t,n)}function P(e){if(e.selectionStart)return e.selectionStart;if(document.selection){e.focus();var t=document.selection.createRange();if(null==t)return 0;var n=e.createTextRange(),o=n.duplicate();return n.moveToBookmark(t.getBookmark()),o.setEndPoint("EndToStart",n),o.text.length}return 0}function N(e){if(e.selectionEnd)return e.selectionEnd;if(document.selection){var t=document.selection.createRange();if(null==t)return 0;var n=e.createTextRange();return n.text.indexOf(t.text)+t.text.length}}function L(){var e="";return window.getSelection?e=window.getSelection().toString():document.selection&&"Control"!==document.selection.type&&(e=document.selection.createRange().text),e}function W(e,t,n){if(void 0===n&&(n=t),e.setSelectionRange){e.focus();try{e.setSelectionRange(t,n)}catch(o){var i=e.parentNode,r=i.style.display;i.style.display="block",e.setSelectionRange(t,n),i.style.display=r}}else if(e.createTextRange){var s=e.createTextRange();s.collapse(!0),s.moveEnd("character",n),s.moveStart("character",t),s.select()}}function I(){var e=document.createElement("p");e.style.width="100%",e.style.height="200px";var t=document.createElement("div");t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.visibility="hidden",t.style.width="200px",t.style.height="150px",t.style.overflow="hidden",t.appendChild(e),(document.body||document.documentElement).appendChild(t);var n=e.offsetWidth;t.style.overflow="scroll";var o=e.offsetWidth;return n==o&&(o=t.clientWidth),(document.body||document.documentElement).removeChild(t),n-o}function j(){return void 0===se&&(se=I()),se}function V(e){return e.offsetWidth!==e.clientWidth}function F(e){return e.offsetHeight!==e.clientHeight}function B(e,t,n){Q()||ee()?(e.style.top=n,e.style.left=t):te()?e.style["-webkit-transform"]="translate3d("+t+","+n+",0)":e.style.transform="translate3d("+t+","+n+",0)"}function z(e){var t;return e.style.transform&&""!==(t=e.style.transform)?["transform",t]:e.style["-webkit-transform"]&&""!==(t=e.style["-webkit-transform"])?["-webkit-transform",t]:-1}function Y(e){e.style.transform&&""!==e.style.transform?e.style.transform="":e.style["-webkit-transform"]&&""!==e.style["-webkit-transform"]&&(e.style["-webkit-transform"]="")}function U(e){var t=["INPUT","SELECT","TEXTAREA"];return e&&(t.indexOf(e.nodeName)>-1||"true"===e.contentEditable)}function G(e){return U(e)&&-1==e.className.indexOf("handsontableInput")&&-1==e.className.indexOf("copyPaste")}Object.defineProperties(n,{closest:{get:function(){return o}},isChildOf:{get:function(){return i}},isChildOfWebComponentTable:{get:function(){return r}},polymerWrap:{get:function(){return s}},polymerUnwrap:{get:function(){return a}},index:{get:function(){return l}},overlayContainsElement:{get:function(){return u}},hasClass:{get:function(){return d}},addClass:{get:function(){return h}},removeClass:{get:function(){return f}},removeTextNodes:{get:function(){return p}},empty:{get:function(){return g}},HTML_CHARACTERS:{get:function(){return ae}},fastInnerHTML:{get:function(){return m}},fastInnerText:{get:function(){return v}},isVisible:{get:function(){return w}},offset:{get:function(){return y}},getWindowScrollTop:{get:function(){return b}},getWindowScrollLeft:{get:function(){return C}},getScrollTop:{get:function(){return R}},getScrollLeft:{get:function(){return _}},getScrollableElement:{get:function(){return S}},getTrimmingContainer:{get:function(){return E}},getStyle:{get:function(){return T}},getComputedStyle:{get:function(){return M}},outerWidth:{get:function(){return O}},outerHeight:{get:function(){return k}},innerHeight:{get:function(){return H}},innerWidth:{get:function(){return D}},addEvent:{get:function(){return x}},removeEvent:{get:function(){return A}},getCaretPosition:{get:function(){return P}},getSelectionEndPosition:{get:function(){return N}},getSelectionText:{get:function(){return L}},setCaretPosition:{get:function(){return W}},getScrollbarWidth:{get:function(){return j}},hasVerticalScrollbar:{get:function(){return V}},hasHorizontalScrollbar:{get:function(){return F}},setOverlayPosition:{get:function(){return B}},getCssTransform:{get:function(){return z}},resetCssTransform:{get:function(){return Y}},isInput:{get:function(){return U}},isOutsideInput:{get:function(){return G}},__esModule:{value:!0}});var $,X,K,q,Z,J=($=e("../browser"),$&&$.__esModule&&$||{"default":$}),Q=J.isIE8,ee=J.isIE9,te=J.isSafari,ne=(X=e("../feature"),X&&X.__esModule&&X||{"default":X}).hasCaptionProblem,oe=!!document.documentElement.classList;if(oe){var ie=function(){var e=document.createElement("div");return e.classList.add("test","test2"),e.classList.contains("test2")}();K=function(e,t){return""===t?!1:e.classList.contains(t)},q=function(e,t){var n=0;if("string"==typeof t&&(t=t.split(" ")),t=c(t),ie)e.classList.add.apply(e.classList,t);else for(;t&&t[n];)e.classList.add(t[n]),n++},Z=function(e,t){var n=0;if("string"==typeof t&&(t=t.split(" ")),t=c(t),ie)e.classList.remove.apply(e.classList,t);else for(;t&&t[n];)e.classList.remove(t[n]),n++}}else{var re=function(e){return new RegExp("(\\s|^)"+e+"(\\s|$)")};K=function(e,t){return!!e.className.match(re(t))},q=function(e,t){var n=0,o=e.className;if("string"==typeof t&&(t=t.split(" ")),""===o)o=t.join(" ");else for(;t&&t[n];)re(t[n]).test(o)||(o+=" "+t[n]),n++;e.className=o},Z=function(e,t){var n=0,o=e.className;for("string"==typeof t&&(t=t.split(" "));t&&t[n];)o=o.replace(re(t[n])," ").trim(),n++;e.className!==o&&(e.className=o)}}var se,ae=/(<(.*)>|&(.*);)/,le=!!document.createTextNode("test").textContent},{"../browser":43,"../feature":47}],46:[function(e,t,n){"use strict";function o(e){e.isImmediatePropagationEnabled=!1,e.cancelBubble=!0}function i(e){return e.isImmediatePropagationEnabled===!1}function r(e){"function"==typeof e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function s(e){return e.pageX?e.pageX:e.clientX+d()}function a(e){return e.pageY?e.pageY:e.clientY+c()}Object.defineProperties(n,{stopImmediatePropagation:{get:function(){return o}},isImmediatePropagationStopped:{get:function(){return i}},stopPropagation:{get:function(){return r}},pageX:{get:function(){return s}},pageY:{get:function(){return a}},__esModule:{value:!0}});var l,u=(l=e("element"),l&&l.__esModule&&l||{"default":l}),c=u.getWindowScrollTop,d=u.getWindowScrollLeft},{element:45}],47:[function(e,t,n){"use strict";function o(e){return h.call(window,e)}function i(e){f.call(window,e)}function r(){return"ontouchstart"in window}function s(){var e=document.createElement("div");return!(!e.createShadowRoot||!e.createShadowRoot.toString().match(/\[native code\]/))}function a(){var e=document.createElement("TABLE");e.style.borderSpacing=0,e.style.borderWidth=0,e.style.padding=0;var t=document.createElement("TBODY");e.appendChild(t),t.appendChild(document.createElement("TR")),t.firstChild.appendChild(document.createElement("TD")),t.firstChild.firstChild.innerHTML="t
t";var n=document.createElement("CAPTION");n.innerHTML="c
c
c
c",n.style.padding=0,n.style.margin=0,e.insertBefore(n,t),document.body.appendChild(e),g=e.offsetHeight<2*e.lastChild.offsetHeight,document.body.removeChild(e)}function l(){return void 0===g&&a(),g}function u(e){var t=void 0!==arguments[1]?arguments[1]:{};return m?m:m="object"==typeof Intl?new Intl.Collator(e,t).compare:"function"==typeof String.prototype.localeCompare?function(e,t){return(e+"").localeCompare(t)}:function(e,t){return e===t?0:e>t?-1:1}}Object.defineProperties(n,{requestAnimationFrame:{get:function(){return o}},cancelAnimationFrame:{get:function(){return i}},isTouchSupported:{get:function(){return r}},isWebComponentSupportedNatively:{get:function(){return s}},hasCaptionProblem:{get:function(){return l}},getComparisonFunction:{get:function(){return u}},__esModule:{value:!0}});for(var c=0,d=["ms","moz","webkit","o"],h=window.requestAnimationFrame,f=window.cancelAnimationFrame,p=0;p=n?e.apply(this,a):t(a)}}var n=e.length;return t([])}function c(e){function t(o){return function(){for(var i=[],r=0;r=n?e.apply(this,a):t(a)}}var n=e.length;return t([])}Object.defineProperties(n,{proxy:{get:function(){return o}},throttle:{get:function(){return i}},throttleAfterHits:{get:function(){return r}},debounce:{get:function(){return s}},pipe:{get:function(){return a}},partial:{get:function(){return l}},curry:{get:function(){return u}},curryRight:{get:function(){return c}},__esModule:{value:!0}});var d,h=(d=e("array"),d&&d.__esModule&&d||{"default":d}).arrayReduce},{array:42}],49:[function(e,t,n){"use strict";function o(e){switch(typeof e){case"string":case"number":return e+"";case"object":return null===e?"":e.toString();case"undefined":return"";default:return e.toString()}}Object.defineProperties(n,{stringify:{get:function(){return o}},__esModule:{value:!0}})},{}],50:[function(e,t,n){"use strict";function o(e){var t=typeof e;return"number"==t?!isNaN(e)&&isFinite(e):"string"==t?e.length?1==e.length?/\d/.test(e):/^\s*[+-]?\s*(?:(?:\d+(?:\.\d+)?(?:e[+-]?\d+)?)|(?:0x[a-f\d]+))\s*$/i.test(e):!1:"object"==t?!(!e||"number"!=typeof e.valueOf()||e instanceof Date):!1}function i(e,t,n){var o=-1;for("function"==typeof t?(n=t,t=e):o=e-1;++o<=t&&n(o)!==!1;);}function r(e,t,n){var o=e+1;for("function"==typeof t&&(n=t,t=0);--o>=t&&n(o)!==!1;);}function s(e,t){return t=parseInt(t.toString().replace("%",""),10),t=parseInt(e*t/100)}Object.defineProperties(n,{isNumeric:{get:function(){return o}},rangeEach:{get:function(){return i}},rangeEachReverse:{get:function(){return r}},valueAccordingPercent:{get:function(){return s}},__esModule:{value:!0}})},{}],51:[function(e,t,n){"use strict";function o(e){var t;return Array.isArray(e)?t=[]:(t={},p(e,function(e,n){e&&"object"==typeof e&&!Array.isArray(e)?t[n]=o(e):Array.isArray(e)?e.length&&"object"==typeof e[0]&&!Array.isArray(e[0])?t[n]=[o(e[0])]:t[n]=[]:t[n]=null})),t}function i(e,t){return t.prototype.constructor=t,e.prototype=new t,e.prototype.constructor=e,e}function r(e,t){return p(t,function(t,n){e[n]=t}),e}function s(e,t){p(t,function(n,o){t[o]&&"object"==typeof t[o]?(e[o]||(Array.isArray(t[o])?e[o]=[]:"[object Date]"===Object.prototype.toString.call(t[o])?e[o]=t[o]:e[o]={}),s(e[o],t[o])):e[o]=t[o]})}function a(e){return"object"==typeof e?JSON.parse(JSON.stringify(e)):e}function l(e){var t={};return p(e,function(e,n){t[n]=e}),t}function u(e){for(var t=[],n=1;no;o++)n.prototype[t[o]]=void 0;return n}Object.defineProperties(n,{columnFactory:{get:function(){return o}},__esModule:{value:!0}});var i,r=(i=e("object"),i&&i.__esModule&&i||{"default":i}).inherit},{object:51}],53:[function(e,t,n){"use strict";function o(e){return e[0].toUpperCase()+e.substr(1)}function i(e,t){var n=!0;return p(t.length-1,function(o){return e.charAt(o)!==t.charAt(o)?(n=!1,!1):void 0}),n}function r(e,t){var n=!0,o=t.length-1,i=e.length-1;return p(o,function(r){var s=i-r,a=o-r;return e.charAt(s)!==t.charAt(a)?(n=!1,!1):void 0}),n}function s(){for(var e=[],t=0;t=t)return e;n=String(n);var o=n.length;o||(n=" ");var i=t-e.length,r=Math.ceil(i/n.length),s="";return p(r,function(e){s+=n}),s=s.slice(0,i),s+e}Object.defineProperties(n,{toUpperCaseFirst:{get:function(){return o}},startsWith:{get:function(){return i}},endsWith:{get:function(){return r}},equalsIgnoreCase:{get:function(){return s}},randomString:{get:function(){return a}},isPercentValue:{get:function(){return l}},substitute:{get:function(){return u}},padStart:{get:function(){return c}},__esModule:{value:!0}});var d,h,f=(d=e("mixed"),d&&d.__esModule&&d||{"default":d}).stringify,p=(h=e("number"),h&&h.__esModule&&h||{"default":h}).rangeEach},{mixed:49,number:50}],54:[function(e,t,n){"use strict";function o(e){return 32==e||e>=48&&57>=e||e>=96&&111>=e||e>=186&&192>=e||e>=219&&222>=e||e>=226||e>=65&&90>=e}function i(e){var t=[u.ARROW_DOWN,u.ARROW_UP,u.ARROW_LEFT,u.ARROW_RIGHT,u.HOME,u.END,u.DELETE,u.BACKSPACE,u.F1,u.F2,u.F3,u.F4,u.F5,u.F6,u.F7,u.F8,u.F9,u.F10,u.F11,u.F12,u.TAB,u.PAGE_DOWN,u.PAGE_UP,u.ENTER,u.ESCAPE,u.SHIFT,u.CAPS_LOCK,u.ALT];return-1!==t.indexOf(e)}function r(e){return-1!==[u.CONTROL_LEFT,224,u.COMMAND_LEFT,u.COMMAND_RIGHT].indexOf(e)}function s(e,t){var n=t.split("|"),o=!1;return l(n,function(t){return e===u[t]?(o=!0,!1):void 0}),o}Object.defineProperties(n,{KEY_CODES:{get:function(){return u}},isPrintableChar:{get:function(){return o}},isMetaKey:{get:function(){return i}},isCtrlKey:{get:function(){return r}},isKey:{get:function(){return s}},__esModule:{value:!0}});var a,l=(a=e("array"),a&&a.__esModule&&a||{"default":a}).arrayEach,u={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}},{array:42}],55:[function(e,t,n){"use strict";Object.defineProperties(n,{localHooks:{get:function(){return l}},__esModule:{value:!0}});var o,i,r=(o=e("helpers/array"),o&&o.__esModule&&o||{"default":o}).arrayEach,s=(i=e("helpers/object"),i&&i.__esModule&&i||{"default":i}).defineGetter,a="localHooks",l={_localHooks:Object.create(null),addLocalHook:function(e,t){this._localHooks[e]||(this._localHooks[e]=[]),this._localHooks[e].push(t)},runLocalHooks:function(e){for(var t=[],n=1;n=0?(t.skip=!0,!0):!1},has:function(e){var t=void 0!==arguments[1]?arguments[1]:null,n=this.getBucket(t);return!(void 0===n[e]||!n[e].length)},run:function(e,t,n,o,i,r,s,a){var l=this.globalBucket[t],u=-1,c=l?l.length:0;if(c)for(;++u=0},getRegistered:function(){return r}},{}),Handsontable.utils=Handsontable.utils||{},Handsontable.utils.Hooks=l},{"helpers/array":42,"helpers/object":51}],58:[function(e,t,n){"use strict";function o(e,t){e=c(e),Handsontable.plugins[e]=t,Handsontable.hooks.add("construct",function(){var n;d.has(this)||d.set(this,{}),n=d.get(this),n[e]||(n[e]=new t(this))}),Handsontable.hooks.add("afterDestroy",function(){if(d.has(this)){var e=d.get(this);u(e,function(e){return e.destroy()}),d["delete"](this)}})}function i(e,t){if("string"!=typeof t)throw Error('Only strings can be passed as "plugin" parameter');var n=c(t);if(d.has(e)&&d.get(e)[n])return d.get(e)[n]}function r(e){return d.has(e)?Object.keys(d.get(e)):[]}function s(e,t){var n=null;return d.has(e)&&u(d.get(e),function(e,o){e===t&&(n=o)}),n}Object.defineProperties(n,{registerPlugin:{get:function(){return o}},getPlugin:{get:function(){return i}},getRegistredPluginNames:{get:function(){return r}},getPluginName:{get:function(){return s}},__esModule:{value:!0}});var a,l,u=(a=e("helpers/object"),a&&a.__esModule&&a||{"default":a}).objectEach,c=(l=e("helpers/string"),l&&l.__esModule&&l||{"default":l}).toUpperCaseFirst,d=new WeakMap},{"helpers/object":51,"helpers/string":53}],59:[function(e,t,n){"use strict";Object.defineProperties(n,{"default":{get:function(){return m}},__esModule:{value:!0}});var o,i,r,s=(o=e("helpers/object"),o&&o.__esModule&&o||{"default":o}),a=s.defineGetter,l=s.objectEach,u=(i=e("helpers/array"),i&&i.__esModule&&i||{"default":i}).arrayEach,c=(r=e("plugins"),r&&r.__esModule&&r||{"default":r}),d=c.getRegistredPluginNames,h=c.getPluginName,f=new WeakMap,p=null,g=function(e){var t=this;a(this,"hot",e,{writable:!1}),f.set(this,{hooks:{}}),p=null,this.pluginName=null,this.pluginsInitializedCallbacks=[],this.isPluginsReady=!1,this.enabled=!1,this.initialized=!1,this.hot.addHook("afterPluginsInitialized",function(){return t.onAfterPluginsInitialized()}),this.hot.addHook("afterUpdateSettings",function(){return t.onUpdateSettings()}),this.hot.addHook("beforeInit",function(){return t.init()})};$traceurRuntime.createClass(g,{init:function(){this.pluginName=h(this.hot,this),this.isEnabled&&this.isEnabled()&&this.enablePlugin(),p||(p=d(this.hot)),p.indexOf(this.pluginName)>=0&&p.splice(p.indexOf(this.pluginName),1),p.length||this.hot.runHooks("afterPluginsInitialized"),this.initialized=!0},enablePlugin:function(){this.enabled=!0},disablePlugin:function(){this.eventManager&&this.eventManager.clear(),this.clearHooks(),this.enabled=!1},addHook:function(e,t){var n=f.get(this).hooks[e]=f.get(this).hooks[e]||[];this.hot.addHook(e,t),n.push(t),f.get(this).hooks[e]=n},removeHooks:function(e){var t=this;u(f.get(this).hooks[e]||[],function(n){t.hot.removeHook(e,n)})},clearHooks:function(){var e=this,t=f.get(this).hooks;l(t,function(t,n){return e.removeHooks(n)}),t.length=0},callOnPluginsReady:function(e){this.isPluginsReady?e():this.pluginsInitializedCallbacks.push(e)},onAfterPluginsInitialized:function(){u(this.pluginsInitializedCallbacks,function(e){return e()}),this.pluginsInitializedCallbacks.length=0,this.isPluginsReady=!0},onUpdateSettings:function(){this.isEnabled&&(this.enabled&&!this.isEnabled()&&this.disablePlugin(),!this.enabled&&this.isEnabled()&&this.enablePlugin(),this.enabled&&this.isEnabled()&&this.updatePlugin())},updatePlugin:function(){},destroy:function(){var e=this;this.eventManager&&this.eventManager.destroy(),this.clearHooks(),l(this,function(t,n){"hot"!==n&&(e[n]=null)}),delete this.hot}},{});var m=g;Handsontable.plugins.BasePlugin=g},{"helpers/array":42,"helpers/object":51,plugins:58}],60:[function(e,t,n){"use strict";Object.defineProperties(n,{AutoColumnSize:{get:function(){return x}},__esModule:{value:!0}});var o,i,r,s,a,l,u,c,d,h,f,p=(o=e("_base"),o&&o.__esModule&&o||{"default":o})["default"],g=(i=e("helpers/array"),i&&i.__esModule&&i||{"default":i}),m=g.arrayEach,v=g.arrayFilter,w=(r=e("helpers/feature"),r&&r.__esModule&&r||{"default":r}),y=w.cancelAnimationFrame,b=w.requestAnimationFrame,C=(s=e("helpers/dom/element"),s&&s.__esModule&&s||{"default":s}).isVisible,R=(a=e("utils/ghostTable"),a&&a.__esModule&&a||{"default":a}).GhostTable,_=(l=e("helpers/object"),l&&l.__esModule&&l||{"default":l}),S=_.isObject,E=(_.objectEach,u=e("helpers/number"),u&&u.__esModule&&u||{"default":u}),T=E.valueAccordingPercent,M=E.rangeEach,O=(c=e("plugins"),c&&c.__esModule&&c||{"default":c}).registerPlugin,k=(d=e("utils/samplesGenerator"),d&&d.__esModule&&d||{"default":d}).SamplesGenerator,H=(h=e("helpers/string"),h&&h.__esModule&&h||{"default":h}).isPercentValue,D=(f=e("3rdparty/walkontable/src/calculator/viewportColumns"),f&&f.__esModule&&f||{"default":f}).WalkontableViewportColumnsCalculator,x=function(e){var t=this;$traceurRuntime.superConstructor(A).call(this,e),this.widths=[],this.ghostTable=new R(this.hot),this.samplesGenerator=new k(function(e,n){return t.hot.getDataAtCell(e,n)}),this.firstCalculation=!0,this.inProgress=!1,this.addHook("beforeColumnResize",function(e,n,o){return t.onBeforeColumnResize(e,n,o)})},A=x;$traceurRuntime.createClass(x,{isEnabled:function(){return this.hot.getSettings().autoColumnSize!==!1&&!this.hot.getSettings().colWidths},enablePlugin:function(){var e=this;if(!this.enabled){var t=this.hot.getSettings().autoColumnSize,n=t&&t.hasOwnProperty("samplingRatio")?this.hot.getSettings().autoColumnSize.samplingRatio:void 0;n&&!isNaN(n)&&(this.samplesGenerator.customSampleCount=parseInt(n,10)),this.addHook("afterLoadData",function(){return e.onAfterLoadData()}),this.addHook("beforeChange",function(t){return e.onBeforeChange(t)}),this.addHook("beforeRender",function(t){return e.onBeforeRender(t)}),this.addHook("modifyColWidth",function(t,n){return e.getColumnWidth(n,t)}),$traceurRuntime.superGet(this,A.prototype,"enablePlugin").call(this)}},disablePlugin:function(){$traceurRuntime.superGet(this,A.prototype,"disablePlugin").call(this)},calculateColumnsWidth:function(){var e=void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countCols()-1},t=void 0!==arguments[1]?arguments[1]:{from:0,to:this.hot.countRows()-1},n=void 0!==arguments[2]?arguments[2]:!1,o=this;"number"==typeof e&&(e={from:e,to:e}),"number"==typeof t&&(t={from:t,to:t}),M(e.from,e.to,function(e){if(n||void 0===o.widths[e]&&!o.hot._getColWidthFromSettings(e)){var i=o.samplesGenerator.generateColumnSamples(e,t);i.forEach(function(e,t){return o.ghostTable.addColumn(t,e)})}}),this.ghostTable.columns.length&&(this.ghostTable.getWidths(function(e,t){return o.widths[e]=t}),this.ghostTable.clean())},calculateAllColumnsWidth:function(){var e=void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countRows()-1},t=this,n=0,o=this.hot.countCols()-1,i=null;this.inProgress=!0;var r=function(){return t.hot?(t.calculateColumnsWidth({from:n,to:Math.min(n+A.CALCULATION_STEP,o)},e),n=n+A.CALCULATION_STEP+1,void(o>n?i=b(r):(y(i),t.inProgress=!1,t.hot.view.wt.wtOverlays.adjustElementsSize(!0),t.hot.view.wt.wtOverlays.leftOverlay.needFullRender&&t.hot.view.wt.wtOverlays.leftOverlay.clone.draw()))):(y(i),void(t.inProgress=!1))};this.firstCalculation&&this.getSyncCalculationLimit()&&(this.calculateColumnsWidth({from:0,to:this.getSyncCalculationLimit()},e),this.firstCalculation=!1,n=this.getSyncCalculationLimit()+1),o>n?r():this.inProgress=!1},recalculateAllColumnsWidth:function(){this.hot.view&&C(this.hot.view.wt.wtTable.TABLE)&&(this.clearCache(),this.calculateAllColumnsWidth())},getSyncCalculationLimit:function(){var e=A.SYNC_CALCULATION_LIMIT,t=this.hot.countCols()-1;return S(this.hot.getSettings().autoColumnSize)&&(e=this.hot.getSettings().autoColumnSize.syncLimit,H(e)?e=T(t,e):e>>=0),Math.min(e,t)},getColumnWidth:function(e){var t=arguments[1],n=void 0!==arguments[2]?arguments[2]:!0,o=t;return void 0===o&&(o=this.widths[e],n&&"number"==typeof o&&(o=Math.max(o,D.DEFAULT_WIDTH))),o},getFirstVisibleColumn:function(){var e=this.hot.view.wt;return e.wtViewport.columnsVisibleCalculator?e.wtTable.getFirstVisibleColumn():e.wtViewport.columnsRenderCalculator?e.wtTable.getFirstRenderedColumn():-1},getLastVisibleColumn:function(){var e=this.hot.view.wt;return e.wtViewport.columnsVisibleCalculator?e.wtTable.getLastVisibleColumn():e.wtViewport.columnsRenderCalculator?e.wtTable.getLastRenderedColumn():-1},clearCache:function(){this.widths.length=0},isNeedRecalculate:function(){return!!v(this.widths,function(e){return void 0===e}).length},onBeforeRender:function(){var e=this.hot.renderCall,t=this.hot.countRows();t&&(this.calculateColumnsWidth({from:this.getFirstVisibleColumn(),to:this.getLastVisibleColumn()},void 0,e),this.isNeedRecalculate()&&!this.inProgress&&this.calculateAllColumnsWidth())},onAfterLoadData:function(){var e=this;this.hot.view?this.recalculateAllColumnsWidth():setTimeout(function(){e.hot&&e.recalculateAllColumnsWidth()},0)},onBeforeChange:function(e){var t=this;m(e,function(e){return t.widths[t.hot.propToCol(e[1])]=void 0})},onBeforeColumnResize:function(e,t,n){return n&&(this.calculateColumnsWidth(e,void 0,!0),t=this.getColumnWidth(e,void 0,!1)),t},destroy:function(){this.ghostTable.clean(),$traceurRuntime.superGet(this,A.prototype,"destroy").call(this)}},{get CALCULATION_STEP(){return 50},get SYNC_CALCULATION_LIMIT(){return 50}},p),O("autoColumnSize",x)},{"3rdparty/walkontable/src/calculator/viewportColumns":3,_base:59,"helpers/array":42,"helpers/dom/element":45,"helpers/feature":47,"helpers/number":50,"helpers/object":51,"helpers/string":53,plugins:58,"utils/ghostTable":101,"utils/samplesGenerator":103}],61:[function(e,t,n){"use strict";Object.defineProperties(n,{AutoRowSize:{get:function(){return k}},__esModule:{value:!0}});var o,i,r,s,a,l,u,c,d,h,f=(o=e("_base"),o&&o.__esModule&&o||{"default":o})["default"],p=(i=e("helpers/array"),i&&i.__esModule&&i||{"default":i}),g=(p.arrayEach,p.arrayFilter),m=(r=e("helpers/feature"),r&&r.__esModule&&r||{"default":r}),v=m.cancelAnimationFrame,w=m.requestAnimationFrame,y=(s=e("helpers/dom/element"),s&&s.__esModule&&s||{"default":s}).isVisible,b=(a=e("utils/ghostTable"),a&&a.__esModule&&a||{"default":a}).GhostTable,C=(l=e("helpers/object"),l&&l.__esModule&&l||{"default":l}),R=C.isObject,_=(C.objectEach,u=e("helpers/number"),u&&u.__esModule&&u||{"default":u}),S=_.valueAccordingPercent,E=_.rangeEach,T=(c=e("plugins"),c&&c.__esModule&&c||{"default":c}).registerPlugin,M=(d=e("utils/samplesGenerator"),d&&d.__esModule&&d||{"default":d}).SamplesGenerator,O=(h=e("helpers/string"),h&&h.__esModule&&h||{"default":h}).isPercentValue,k=function(e){var t=this;$traceurRuntime.superConstructor(H).call(this,e),this.heights=[],this.ghostTable=new b(this.hot),this.samplesGenerator=new M(function(e,n){return t.hot.getDataAtCell(e,n)}),this.firstCalculation=!0,this.inProgress=!1,this.addHook("beforeRowResize",function(e,n,o){return t.onBeforeRowResize(e,n,o)})},H=k;$traceurRuntime.createClass(k,{isEnabled:function(){return this.hot.getSettings().autoRowSize===!0||R(this.hot.getSettings().autoRowSize)},enablePlugin:function(){var e=this;if(!this.enabled){var t=this.hot.getSettings().autoRowSize,n=t&&t.hasOwnProperty("samplingRatio")?this.hot.getSettings().autoRowSize.samplingRatio:void 0;n&&!isNaN(n)&&(this.samplesGenerator.customSampleCount=parseInt(n,10)),this.addHook("afterLoadData",function(){return e.onAfterLoadData()}),this.addHook("beforeChange",function(t){return e.onBeforeChange(t)}),this.addHook("beforeColumnMove",function(){return e.recalculateAllRowsHeight()}),this.addHook("beforeColumnResize",function(){return e.recalculateAllRowsHeight()}),this.addHook("beforeColumnSort",function(){return e.clearCache()}),this.addHook("beforeRender",function(t){return e.onBeforeRender(t)}),this.addHook("beforeRowMove",function(t,n){return e.onBeforeRowMove(t,n)}),this.addHook("modifyRowHeight",function(t,n){return e.getRowHeight(n,t)}),$traceurRuntime.superGet(this,H.prototype,"enablePlugin").call(this)}},disablePlugin:function(){$traceurRuntime.superGet(this,H.prototype,"disablePlugin").call(this)},calculateRowsHeight:function(){var e=void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countRows()-1},t=void 0!==arguments[1]?arguments[1]:{from:0,to:this.hot.countCols()-1},n=void 0!==arguments[2]?arguments[2]:!1,o=this;"number"==typeof e&&(e={from:e,to:e}),"number"==typeof t&&(t={from:t,to:t}),E(e.from,e.to,function(e){if(n||void 0===o.heights[e]){var i=o.samplesGenerator.generateRowSamples(e,t);i.forEach(function(e,t){return o.ghostTable.addRow(t,e)})}}),this.ghostTable.rows.length&&(this.ghostTable.getHeights(function(e,t){return o.heights[e]=t}),this.ghostTable.clean())},calculateAllRowsHeight:function(){var e=void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countCols()-1},t=this,n=0,o=this.hot.countRows()-1,i=null;this.inProgress=!0;var r=function(){return t.hot?(t.calculateRowsHeight({from:n,to:Math.min(n+H.CALCULATION_STEP,o)},e),n=n+H.CALCULATION_STEP+1,void(o>n?i=w(r):(v(i),t.inProgress=!1,t.hot.view.wt.wtOverlays.adjustElementsSize(!0),t.hot.view.wt.wtOverlays.leftOverlay.needFullRender&&t.hot.view.wt.wtOverlays.leftOverlay.clone.draw()))):(v(i),void(t.inProgress=!1))};this.firstCalculation&&this.getSyncCalculationLimit()&&(this.calculateRowsHeight({from:0,to:this.getSyncCalculationLimit()},e),this.firstCalculation=!1,n=this.getSyncCalculationLimit()+1),o>n?r():this.inProgress=!1},recalculateAllRowsHeight:function(){y(this.hot.view.wt.wtTable.TABLE)&&(this.clearCache(),this.calculateAllRowsHeight())},getSyncCalculationLimit:function(){var e=H.SYNC_CALCULATION_LIMIT,t=this.hot.countRows()-1;return R(this.hot.getSettings().autoRowSize)&&(e=this.hot.getSettings().autoRowSize.syncLimit,O(e)?e=S(t,e):e>>=0),Math.min(e,t)},getRowHeight:function(e){var t=arguments[1],n=t;return void 0!==this.heights[e]&&this.heights[e]>(t||0)&&(n=this.heights[e]),n},getFirstVisibleRow:function(){var e=this.hot.view.wt;return e.wtViewport.rowsVisibleCalculator?e.wtTable.getFirstVisibleRow():e.wtViewport.rowsRenderCalculator?e.wtTable.getFirstRenderedRow():-1},getLastVisibleRow:function(){var e=this.hot.view.wt;return e.wtViewport.rowsVisibleCalculator?e.wtTable.getLastVisibleRow():e.wtViewport.rowsRenderCalculator?e.wtTable.getLastRenderedRow():-1},clearCache:function(){this.heights.length=0},clearCacheByRange:function(e){var t=this;"number"==typeof e&&(e={from:e,to:e}),E(Math.min(e.from,e.to),Math.max(e.from,e.to),function(e){return t.heights[e]=void 0})},isNeedRecalculate:function(){return!!g(this.heights,function(e){return void 0===e}).length},onBeforeRender:function(){var e=this.hot.renderCall;this.calculateRowsHeight({from:this.getFirstVisibleRow(),to:this.getLastVisibleRow()},void 0,e);var t=this.hot.getSettings().fixedRowsBottom;if(t){var n=this.hot.countRows()-1;this.calculateRowsHeight({from:n-t,to:n})}this.isNeedRecalculate()&&!this.inProgress&&this.calculateAllRowsHeight()},onBeforeRowMove:function(e,t){this.clearCacheByRange({from:e,to:t}),this.calculateAllRowsHeight()},onBeforeRowResize:function(e,t,n){return n&&(this.calculateRowsHeight(e,void 0,!0),t=this.getRowHeight(e)),t},onAfterLoadData:function(){var e=this;this.hot.view?this.recalculateAllRowsHeight():setTimeout(function(){e.hot&&e.recalculateAllRowsHeight()},0)},onBeforeChange:function(e){var t=null;1===e.length?t=e[0][0]:e.length>1&&(t={from:e[0][0],to:e[e.length-1][0]}),null!==t&&this.clearCacheByRange(t)},destroy:function(){this.ghostTable.clean(),$traceurRuntime.superGet(this,H.prototype,"destroy").call(this)}},{get CALCULATION_STEP(){return 50},get SYNC_CALCULATION_LIMIT(){return 500}},f),T("autoRowSize",k)},{_base:59,"helpers/array":42,"helpers/dom/element":45,"helpers/feature":47,"helpers/number":50,"helpers/object":51,"helpers/string":53,plugins:58,"utils/ghostTable":101,"utils/samplesGenerator":103}],62:[function(e,t,n){"use strict";function o(e,t,n,o){var i,r,s,a,l,u=n.length,c=n?n[0].length:0,d=[],h=[];if(i=t.row-e.row,r=t.col-e.col,-1!==["down","up"].indexOf(o)){for(var f=0;r>=f;f++)s=parseInt(n[0][f],10),a=parseInt(n[u-1][f],10),l=("down"===o?a-s:s-a)/(u-1)||0,h.push(l);d.push(h)}if(-1!==["right","left"].indexOf(o))for(var p=0;i>=p;p++)s=parseInt(n[p][0],10),a=parseInt(n[p][c-1],10),l=("right"===o?a-s:s-a)/(c-1)||0,h=[],h.push(l),d.push(h);return d}function i(e){function t(t){return e.autofill?void(e.autofill.handle&&e.autofill.handle.isDragged&&(e.autofill.handle.isDragged>1&&e.autofill.apply(),e.autofill.handle.isDragged=0,a=!1)):!0}function n(e){var t,n;return s.instance.autofill?(t=d(s.instance.table).top-(window.pageYOffset||document.documentElement.scrollTop)+h(s.instance.table),n=d(s.instance.table).left-(window.pageXOffset||document.documentElement.scrollLeft)+f(s.instance.table),s.addingStarted===!1&&s.instance.autofill.handle.isDragged>0&&e.clientY>t&&e.clientX<=n?(s.instance.mouseDragOutside=!0,s.addingStarted=!0):s.instance.mouseDragOutside=!1,void(s.instance.mouseDragOutside&&m("autoInsertRow")&&setTimeout(function(){s.addingStarted=!1,s.instance.alter("insert_row")},200))):!1}var o,i,r,s=this,a=!1;this.instance=e,this.addingStarted=!1,r=p(e),r.addEventListener(document,"mouseup",t),r.addEventListener(document,"mousemove",n),o=this.instance.view.wt.wtSettings.settings.onCellCornerMouseDown,this.instance.view.wt.wtSettings.settings.onCellCornerMouseDown=function(t){e.autofill.handle.isDragged=1,a=!0,o(t)},i=this.instance.view.wt.wtSettings.settings.onCellMouseOver,this.instance.view.wt.wtSettings.settings.onCellMouseOver=function(t,n,o,r){e.autofill&&a&&!e.view.isMouseDown()&&e.autofill.handle&&e.autofill.handle.isDragged&&(e.autofill.handle.isDragged++,e.autofill.showBorder(n),e.autofill.checkIfNewRowNeeded()),i(t,n,o,r)},this.instance.view.wt.wtSettings.settings.onCellCornerDblClick=function(){e.autofill.selectAdjacent()}}function r(e){return function(t){var n;return"direction"===t?n="string"==typeof e?e:"object"==typeof e&&void 0!==e[t]?e[t]:!0:"autoInsertRow"===t?n="object"==typeof e&&void 0!==e[t]?e[t]:!0:"fillHandle"===t&&(n=!!e),n}}Object.defineProperties(n,{Autofill:{get:function(){return i}},__esModule:{value:!0}});var s,a,l,u,c=(s=e("helpers/dom/element"),s&&s.__esModule&&s||{"default":s}),d=c.offset,h=c.outerHeight,f=c.outerWidth,p=(a=e("eventManager"),a&&a.__esModule&&a||{"default":a}).eventManager,g=((l=e("plugins"),l&&l.__esModule&&l||{"default":l}).registerPlugin,(u=e("3rdparty/walkontable/src/cell/coords"),u&&u.__esModule&&u||{"default":u}).WalkontableCellCoords);i.prototype.init=function(){this.handle={}},i.prototype.disable=function(){this.handle.disabled=!0},i.prototype.selectAdjacent=function(){var e,t,n,o,i;e=this.instance.selection.isMultiple()?this.instance.view.wt.selections.area.getCorners():this.instance.view.wt.selections.current.getCorners(),t=this.instance.getData();e:for(n=e[2]+1;nt[3]?(s="right",n=new g(e[0],t[3]+1),i=new g(e[2],e[3])):e[0]t[2]&&e[1]===t[1]&&(s="down",n=new g(t[2]+1,e[1]),i=new g(e[2],e[3])),n&&n.row>-1&&n.col>-1?(l={from:this.instance.getSelectedRange().from,to:this.instance.getSelectedRange().to},r=this.instance.getData(l.from.row,l.from.col,l.to.row,l.to.col),a=o(n,i,r,s),Handsontable.hooks.run(this.instance,"beforeAutofill",n,i,r),this.instance.populateFromArray(n.row,n.col,r,i.row,i.col,"autofill",null,s,a),this.instance.selection.setRangeStart(new g(e[0],e[1])),this.instance.selection.setRangeEnd(new g(e[2],e[3]))):this.instance.selection.refreshBorders())},i.prototype.showBorder=function(e){var t=this.instance.getSelectedRange().getTopLeftCorner(),n=this.instance.getSelectedRange().getBottomRightCorner();if("horizontal"!==m("direction")&&(n.rowe.row))e=new g(e.row,n.col);else{if("vertical"===m("direction"))return;e=new g(n.row,e.col)}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(e),this.instance.view.render()},i.prototype.checkIfNewRowNeeded=function(){var e,t,n=this.instance.countRows(),o=this;this.instance.view.wt.selections.fill.cellRange&&this.addingStarted===!1&&m("autoInsertRow")&&(t=this.instance.getSelected(),e=this.instance.view.wt.selections.fill.getCorners(),t[2]n[1]?e?1:-1:0}},dateSort:function(e){return function(t,n){if(t[1]===n[1])return 0;if(null===t[1]||""===t[1])return 1;if(null===n[1]||""===n[1])return-1;var o=new Date(t[1]),i=new Date(n[1]);return i>o?e?-1:1:o>i?e?1:-1:0}},numericSort:function(e){return function(t,n){var o=parseFloat(t[1]),i=parseFloat(n[1]);return o===i||isNaN(o)&&isNaN(i)?0:isNaN(o)?1:isNaN(i)?-1:i>o?e?-1:1:o>i?e?1:-1:0}},sort:function(){if("undefined"==typeof this.hot.sortOrder)return void(this.hot.sortIndex.length=0);var e,t;this.hot.sortingEnabled=!1,this.hot.sortIndex.length=0;for(var n=0,o=this.hot.countRows()-this.hot.getSettings().minSpareRows;o>n;n++)this.hot.sortIndex.push([n,this.hot.getDataAtCell(n,this.hot.sortColumn)]);if(e=this.hot.getCellMeta(0,this.hot.sortColumn),e.sortFunction)t=e.sortFunction;else switch(e.type){case"date":t=this.dateSort;break;case"numeric":t=this.numericSort;break;default:t=this.defaultSort}this.hot.sortIndex.sort(t(this.hot.sortOrder));for(var i=this.hot.sortIndex.length;i=0&&-1===i&&u(n,"columnSorting"),f(n,"descending"),f(n,"ascending"),this.sortIndicators[e]&&e===this.hot.sortColumn&&("ascending"===this.sortOrderClass?u(n,"ascending"):"descending"===this.sortOrderClass&&u(n,"descending")))},isSorted:function(){return"undefined"!=typeof this.hot.sortColumn},afterCreateRow:function(e,t){if(this.isSorted()){for(var n=0;n=e&&(this.hot.sortIndex[n][0]+=t);for(var n=0;t>n;n++)this.hot.sortIndex.splice(e+n,0,[e+n,this.hot.getSourceData()[e+n][this.hot.sortColumn+this.hot.colOffset()]]);this.saveSortingState()}},afterRemoveRow:function(e,t){function n(e){return m(o,function(t,n){return e>n&&t++,t},0)}if(this.isSorted()){var o=this.hot.sortIndex.splice(e,t);o=g(o,function(e){return e[0]}),this.hot.sortIndex=g(this.hot.sortIndex,function(e,t){var o=n(e[0]);return o&&(e[0]-=o),e}),this.saveSortingState()}}},{},w),y("columnSorting",b)},{_base:59,eventManager:41,"helpers/array":42,"helpers/dom/element":45,plugins:58}],64:[function(e,t,n){"use strict";Object.defineProperties(n,{CommentEditor:{get:function(){return r}},__esModule:{value:!0}});var o,i=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}).addClass,r=function(){this.editor=this.createEditor(),this.editorStyle=this.editor.style,this.editorStyle.position="absolute",this.editorStyle.zIndex=100,this.hide()},s=r;$traceurRuntime.createClass(r,{setPosition:function(e,t){this.editorStyle.left=e+"px",this.editorStyle.top=t+"px"},show:function(){this.editorStyle.display="block"},hide:function(){this.editorStyle.display="none"},isVisible:function(){return"block"===this.editorStyle.display},setValue:function(){var e=void 0!==arguments[0]?arguments[0]:"";e=e||"",this.getInputElement().value=e},getValue:function(){return this.getInputElement().value},isFocused:function(){return document.activeElement===this.getInputElement()},focus:function(){this.getInputElement().focus()},createEditor:function(){var e,t,n=document.querySelector("."+s.CLASS_EDITOR_CONTAINER);return n||(n=document.createElement("div"),i(n,s.CLASS_EDITOR_CONTAINER),document.body.appendChild(n)),e=document.createElement("div"),i(e,s.CLASS_EDITOR),t=document.createElement("textarea"),i(t,s.CLASS_INPUT),e.appendChild(t),n.appendChild(e),e},getInputElement:function(){return this.editor.querySelector("."+s.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}],65:[function(e,t,n){"use strict";Object.defineProperties(n,{Comments:{get:function(){return R}},__esModule:{value:!0}});var o,i,r,s,a,l,u=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),c=u.addClass,d=u.closest,h=u.getWindowScrollLeft,f=u.getWindowScrollTop,p=u.hasClass,g=u.offset,m=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).EventManager,v=(r=e("3rdparty/walkontable/src/cell/coords"),r&&r.__esModule&&r||{"default":r}).WalkontableCellCoords,w=(s=e("plugins"),s&&s.__esModule&&s||{"default":s}),y=w.registerPlugin,b=(w.getPlugin,(a=e("_base"),a&&a.__esModule&&a||{"default":a})["default"]),C=(l=e("commentEditor"),l&&l.__esModule&&l||{"default":l}).CommentEditor,R=function(e){ +$traceurRuntime.superConstructor(_).call(this,e),this.editor=null,this.eventManager=null,this.range={},this.mouseDown=!1,this.contextMenuEvent=!1,this.timer=null},_=R;$traceurRuntime.createClass(R,{isEnabled:function(){return this.hot.getSettings().comments},enablePlugin:function(){var e=this;this.enabled||(this.editor||(this.editor=new C),this.eventManager||(this.eventManager=new m(this)),this.addHook("afterContextMenuDefaultOptions",function(t){return e.addToContextMenu(t)}),this.addHook("afterRenderer",function(t,n,o,i,r,s){return e.onAfterRenderer(t,s)}),this.addHook("afterScrollHorizontally",function(){return e.refreshEditorPosition()}),this.addHook("afterScrollVertically",function(){return e.refreshEditorPosition()}),this.addHook("afterColumnResize",function(){return e.refreshEditorPosition()}),this.addHook("afterRowResize",function(){return e.refreshEditorPosition()}),this.registerListeners(),$traceurRuntime.superGet(this,_.prototype,"enablePlugin").call(this))},disablePlugin:function(){$traceurRuntime.superGet(this,_.prototype,"disablePlugin").call(this)},registerListeners:function(){var e=this;this.eventManager.addEventListener(document,"mouseover",function(t){return e.onMouseOver(t)}),this.eventManager.addEventListener(document,"mousedown",function(t){return e.onMouseDown(t)}),this.eventManager.addEventListener(document,"mousemove",function(t){return e.onMouseMove(t)}),this.eventManager.addEventListener(document,"mouseup",function(t){return e.onMouseUp(t)}),this.eventManager.addEventListener(this.editor.getInputElement(),"blur",function(t){return e.onEditorBlur(t)})},setRange:function(e){this.range=e},clearRange:function(){this.range={}},targetIsCellWithComment:function(e){return!(!p(e.target,"htCommentCell")||!d(e.target,[this.hot.rootElement]))},targetIsCommentTextArea:function(e){return this.editor.getInputElement()===e.target},saveComment:function(){if(!this.range.from)throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');var e=this.editor.getValue(),t=this.range.from.row,n=this.range.from.col;this.hot.setCellMeta(t,n,"comment",e),this.hot.render()},saveCommentAtCell:function(e,t){this.setRange({from:new v(e,t)}),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(e,t){this.setRange({from:new v(e,t)}),this.removeComment()},show:function(){if(!this.range.from)throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');var e=this.hot.getCellMeta(this.range.from.row,this.range.from.col);return this.refreshEditorPosition(!0),this.editor.setValue(e.comment||""),this.editor.show(),!0},showAtCell:function(e,t){return this.setRange({from:new v(e,t)}),this.show()},hide:function(){this.editor.hide()},refreshEditorPosition:function(){var e=void 0!==arguments[0]?arguments[0]:!1;if(e||this.range.from&&this.editor.isVisible()){var t=this.hot.view.wt.wtTable.getCell(this.range.from),n=g(t),o=this.hot.getColWidth(this.range.from.col),i=n.top,r=n.left,s=0,a=0;this.hot.view.wt.wtViewport.hasVerticalScroll()&&(i-=this.hot.view.wt.wtOverlays.topOverlay.getScrollPosition(),s=20),this.hot.view.wt.wtViewport.hasHorizontalScroll()&&(r-=this.hot.view.wt.wtOverlays.leftOverlay.getScrollPosition(),a=20);var l=r+o,u=i,c=this.hot.view.wt.wtTable.holder.getBoundingClientRect(),d={left:c.left+h()+a,right:c.right+h()-15,top:c.top+f()+s,bottom:c.bottom+f()};l<=d.left||l>d.right||u<=d.top||u>d.bottom?this.hide():this.editor.setPosition(l,u)}},onMouseDown:function(e){this.mouseDown=!0,this.hot.view&&this.hot.view.wt&&(this.contextMenuEvent||this.targetIsCommentTextArea(e)||this.targetIsCellWithComment(e)||this.hide(),this.contextMenuEvent=!1)},onMouseOver:function(e){if(!this.mouseDown&&!this.editor.isFocused())if(this.targetIsCellWithComment(e)){var t=this.hot.view.wt.wtTable.getCoords(e.target),n={from:new v(t.row,t.col)};this.setRange(n),this.show()}else this.targetIsCommentTextArea(e)||this.editor.isFocused()||this.hide()},onMouseMove:function(e){var t=this;this.targetIsCommentTextArea(e)&&(this.mouseDown=!0,clearTimeout(this.timer),this.timer=setTimeout(function(){t.mouseDown=!1},200))},onMouseUp:function(e){this.mouseDown=!1},onAfterRenderer:function(e,t){t.comment&&c(e,t.commentedCellClassName)},onEditorBlur:function(e){this.saveComment()},checkSelectionCommentsConsistency:function(){var e=this.hot.getSelectedRange();if(!e)return!1;var t=!1,n=e.from;return this.hot.getCellMeta(n.row,n.col).comment&&(t=!0),t},onContextMenuAddComment:function(){var e=this,t=this.hot.getSelectedRange();this.contextMenuEvent=!0,this.setRange({from:t.from}),this.show(),setTimeout(function(){e.hot&&(e.hot.deselectCell(),e.editor.focus())},10)},onContextMenuRemoveComment:function(e,t){this.contextMenuEvent=!0,this.removeCommentAtCell(t.start.row,t.start.col)},addToContextMenu:function(e){var t=this;e.items.push(Handsontable.plugins.ContextMenu.SEPARATOR,{key:"commentsAddEdit",name:function(){return t.checkSelectionCommentsConsistency()?"Edit Comment":"Add Comment"},callback:function(){return t.onContextMenuAddComment()},disabled:function(){return!this.getSelected()}},{key:"commentsRemove",name:function(){return"Delete Comment"},callback:function(e,n){return t.onContextMenuRemoveComment(e,n)},disabled:function(){return!t.checkSelectionCommentsConsistency()}})},destroy:function(){this.editor&&this.editor.destroy(),$traceurRuntime.superGet(this,_.prototype,"destroy").call(this)}},{},b),y("comments",R)},{"3rdparty/walkontable/src/cell/coords":5,_base:59,commentEditor:64,eventManager:41,"helpers/dom/element":45,plugins:58}],66:[function(e,t,n){"use strict";function o(e,t){var n;return r(t,function(t){var o=t.key?t.key.split(":"):null;return Array.isArray(o)&&o[1]===e?(n=t,!1):void 0}),n}Object.defineProperties(n,{CommandExecutor:{get:function(){return s}},__esModule:{value:!0}});var i,r=(i=e("helpers/array"),i&&i.__esModule&&i||{"default":i}).arrayEach,s=function(e){this.hot=e,this.commands={},this.commonCallback=null};$traceurRuntime.createClass(s,{registerCommand:function(e,t){this.commands[e]=t},setCommonCallback:function(e){this.commonCallback=e},execute:function(e){for(var t=[],n=1;n0;if(s)return}}else if(!(t(r)||w(r,"current")&&w(r,"wtBorder")))return;this.open(e)},onMenuAfterOpen:function(){this.hot.runHooks("afterContextMenuShow",this)},onMenuAfterClose:function(){this.hot.listen(),this.hot.runHooks("afterContextMenuHide",this)},destroy:function(){this.close(),this.menu&&this.menu.destroy(),$traceurRuntime.superGet(this,z.prototype,"destroy").call(this)}},{get DEFAULT_ITEMS(){return[D,x,F,A,P,F,N,L,F,W,I,F,j,F,V]}},p),B.SEPARATOR={name:F},Handsontable.hooks.register("afterContextMenuDefaultOptions"),Handsontable.hooks.register("afterContextMenuShow"),Handsontable.hooks.register("afterContextMenuHide"),Handsontable.hooks.register("afterContextMenuExecute"),R("contextMenu",B)},{_base:59,commandExecutor:66,eventManager:41,"helpers/array":42,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/object":51,itemsFactory:69,menu:70,plugins:58,predefinedItems:71}],68:[function(e,t,n){"use strict";Object.defineProperties(n,{Cursor:{get:function(){return d}},__esModule:{value:!0}});var o,i,r=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),s=r.getWindowScrollLeft,a=r.getWindowScrollTop,l=(i=e("helpers/dom/event"),i&&i.__esModule&&i||{"default":i}),u=l.pageX,c=l.pageY,d=function(e){var t,n,o,i,r,l,d=a(),h=s();this.type=this.getSourceType(e),"literal"===this.type?(t=parseInt(e.top,10),o=parseInt(e.left,10),r=e.height||0,l=e.width||0,n=t,i=o,t+=d,o+=h):"event"===this.type&&(t=parseInt(c(e),10),o=parseInt(u(e),10),r=e.target.clientHeight,l=e.target.clientWidth,n=t-d,i=o-h),this.top=t,this.topRelative=n,this.left=o,this.leftRelative=i,this.scrollTop=d,this.scrollLeft=h,this.cellHeight=r,this.cellWidth=l};$traceurRuntime.createClass(d,{getSourceType:function(e){var t="literal";return e instanceof Event&&(t="event"),t},fitsAbove:function(e){return this.topRelative>=e.offsetHeight},fitsBelow:function(e){var t=void 0!==arguments[1]?arguments[1]:window.innerHeight;return this.topRelative+e.offsetHeight<=t},fitsOnRight:function(e){var t=void 0!==arguments[1]?arguments[1]:window.innerWidth;return this.leftRelative+this.cellWidth+e.offsetWidth<=t},fitsOnLeft:function(e){return this.leftRelative>=e.offsetWidth}},{}),Handsontable.plugins.utils=Handsontable.plugins.utils||{},Handsontable.plugins.utils.Cursor=d},{"helpers/dom/element":45,"helpers/dom/event":46}],69:[function(e,t,n){"use strict";function o(){var e=void 0!==arguments[0]?arguments[0]:null,t=void 0!==arguments[1]?arguments[1]:[],n=void 0!==arguments[2]?arguments[2]:{},o=[];return e&&e.items?e=e.items:Array.isArray(e)||(e=t),u(e)?l(e,function(e,t){var i=n["string"==typeof e?e:t];i||(i=e),u(e)?c(i,e):"string"==typeof i&&(i={name:i}),void 0===i.key&&(i.key=t),o.push(i)}):d(e,function(e,t){var i=n[e];!i&&p.indexOf(e)>=0||(i||(i={name:e,key:t+""}),u(e)&&c(i,e),void 0===i.key&&(i.key=t),o.push(i))}),o[0].name===f&&o.shift(),o}Object.defineProperties(n,{ItemsFactory:{get:function(){return m}},__esModule:{value:!0}});var i,r,s,a=(i=e("helpers/object"),i&&i.__esModule&&i||{"default":i}),l=a.objectEach,u=a.isObject,c=a.extend,d=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}).arrayEach,h=(s=e("predefinedItems"),s&&s.__esModule&&s||{"default":s}),f=h.SEPARATOR,p=h.ITEMS,g=h.predefinedItems,m=function(e){var t=void 0!==arguments[1]?arguments[1]:null;this.hot=e,this.predefinedItems=g(),this.defaultOrderPattern=t};$traceurRuntime.createClass(m,{setPredefinedItems:function(e){var t=this,n={};this.defaultOrderPattern.length=0,l(e,function(e,o){var i="";e.name===f?(n[f]=e,i=f):isNaN(parseInt(o,10))?(e.key=void 0===e.key?o:e.key,n[o]=e,i=e.key):(n[e.key]=e,i=e.key),t.defaultOrderPattern.push(i)}),this.predefinedItems=n},getVisibleItems:function(){var e=void 0!==arguments[0]?arguments[0]:null,t=this,n={};return l(this.predefinedItems,function(e,o){(!e.hidden||e.hidden&&!e.hidden.apply(t.hot))&&(n[o]=e)}),o(e,this.defaultOrderPattern,n)},getItems:function(){var e=void 0!==arguments[0]?arguments[0]:null;return o(e,this.defaultOrderPattern,this.predefinedItems)}},{})},{"helpers/array":42,"helpers/object":51,predefinedItems:71}],70:[function(e,t,n){"use strict";Object.defineProperties(n,{Menu:{get:function(){return F}},__esModule:{value:!0}});var o,i,r,s,a,l,u,c,d,h,f,p=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),g=p.addClass,m=p.empty,v=p.fastInnerHTML,w=(p.getComputedStyle,p.getScrollbarWidth),y=(p.getWindowScrollLeft,p.getWindowScrollTop,p.hasClass,p.isChildOf),b=p.removeClass,C=(i=e("helpers/array"),i&&i.__esModule&&i||{"default":i}),R=C.arrayEach,_=C.arrayReduce,S=(r=e("cursor"),r&&r.__esModule&&r||{"default":r}).Cursor,E=(s=e("eventManager"),s&&s.__esModule&&s||{"default":s}).EventManager,T=(a=e("helpers/object"),a&&a.__esModule&&a||{"default":a}),M=(T.extend,T.isObject,T.objectEach,T.mixin),O=(l=e("helpers/function"),l&&l.__esModule&&l||{"default":l}).debounce,k=(u=e("utils"),u&&u.__esModule&&u||{"default":u}),H=k.isSeparator,D=k.isDisabled,x=k.isSelectionDisabled,A=k.hasSubMenu,P=k.normalizeSelection,N=(c=e("helpers/unicode"),c&&c.__esModule&&c||{"default":c}).KEY_CODES,L=(d=e("mixins/localHooks"),d&&d.__esModule&&d||{"default":d}).localHooks,W=(h=e("predefinedItems"),h&&h.__esModule&&h||{"default":h}),I=W.SEPARATOR,j=(W.predefinedItems,f=e("helpers/dom/event"),f&&f.__esModule&&f||{"default":f}),V=(j.stopPropagation,j.stopImmediatePropagation),F=(j.pageX,j.pageY,function(e,t){this.hot=e,this.options=t||{parent:null,name:null,className:"",keepInViewport:!0,standalone:!1},this.eventManager=new E(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()}),B=F;$traceurRuntime.createClass(F,{registerEvents:function(){var e=this;this.eventManager.addEventListener(document.documentElement,"mousedown",function(t){return e.onDocumentMouseDown(t)})},setMenuItems:function(e){this.menuItems=e},setOffset:function(e){var t=void 0!==arguments[1]?arguments[1]:0;this.offset[e]=t},isSubMenu:function(){return null!==this.parentMenu},open:function(){var e=this;this.container.removeAttribute("style"),this.container.style.display="block";var t=O(function(t){return e.openSubMenu(t)},300),n={data:this.menuItems,colHeaders:!1,colWidths:[200],autoRowSize:!1,readOnly:!0,copyPaste:!1,columns:[{data:"name",renderer:function(t,n,o,i,r,s){return e.menuItemRenderer(t,n,o,i,r,s)}}],renderAllRows:!0,fragmentSelection:"cell",disableVisualSelection:"area",beforeKeyDown:function(t){return e.onBeforeKeyDown(t)},afterOnCellMouseOver:function(n,o,i){e.isAllSubMenusClosed()?t(o.row):e.openSubMenu(o.row)}};this.origOutsideClickDeselects=this.hot.getSettings().outsideClickDeselects,this.hot.getSettings().outsideClickDeselects=!1,this.hotMenu=new Handsontable.Core(this.container,n),this.hotMenu.addHook("afterInit",function(){return e.onAfterInit()}),this.hotMenu.init(),this.hotMenu.listen(),this.blockMainTableCallbacks(),this.runLocalHooks("afterOpen")},close:function(){var e=void 0!==arguments[0]?arguments[0]:!1;this.isOpened()&&(e&&this.parentMenu?this.parentMenu.close():(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(e){if(!this.hotMenu)return!1;var t=this.hotMenu.getCell(e,0);if(this.closeAllSubMenus(),!t||!A(t))return!1;var n=this.hotMenu.getSourceDataAtRow(e),o=new B(this.hot,{parent:this,name:n.name,className:this.options.className,keepInViewport:!0});return o.setMenuItems(n.submenu.items),o.open(),o.setPosition(t.getBoundingClientRect()),this.hotSubMenus[n.key]=o,o},closeSubMenu:function(e){var t=this.hotMenu.getSourceDataAtRow(e),n=this.hotSubMenus[t.key];n&&(n.destroy(),delete this.hotSubMenus[t.key])},closeAllSubMenus:function(){var e=this;R(this.hotMenu.getData(),function(t,n){return e.closeSubMenu(n)})},isAllSubMenusClosed:function(){return 0===Object.keys(this.hotSubMenus).length},destroy:function(){this.clearLocalHooks(),this.close(),this.parentMenu=null,this.eventManager.destroy()},isOpened:function(){return null!==this.hotMenu},executeCommand:function(e){if(this.isOpened()&&this.hotMenu.getSelected()){var t=this.hotMenu.getSourceDataAtRow(this.hotMenu.getSelected()[0]);if(this.runLocalHooks("select",t,e),t.isCommand!==!1&&t.name!==I){var n=this.hot.getSelectedRange(),o=n?P(n):{};this.runLocalHooks("executeCommand",t.key,o,e),this.isSubMenu()&&this.parentMenu.runLocalHooks("executeCommand",t.key,o,e),t.disabled===!0||"function"==typeof t.disabled&&t.disabled.call(this.hot)===!0||t.submenu||this.close(!0)}}},setPosition:function(e){var t=new S(e);this.options.keepInViewport?(t.fitsBelow(this.container)?this.setPositionBelowCursor(t):t.fitsAbove(this.container)?this.setPositionAboveCursor(t):this.setPositionBelowCursor(t),t.fitsOnRight(this.container)?this.setPositionOnRightOfCursor(t):this.setPositionOnLeftOfCursor(t)):(this.setPositionBelowCursor(t),this.setPositionOnRightOfCursor(t))},setPositionAboveCursor:function(e){var t=this.offset.above+e.top-this.container.offsetHeight;this.isSubMenu()&&(t=e.top+e.cellHeight-this.container.offsetHeight+3),this.container.style.top=t+"px"},setPositionBelowCursor:function(e){var t=this.offset.below+e.top;this.isSubMenu()&&(t=e.top-1),this.container.style.top=t+"px"},setPositionOnRightOfCursor:function(e){var t;t=this.isSubMenu()?1+e.left+e.cellWidth:this.offset.right+1+e.left,this.container.style.left=t+"px"},setPositionOnLeftOfCursor:function(e){var t=this.offset.left+e.left-this.container.offsetWidth+w()+4;this.container.style.left=t+"px"},selectFirstCell:function(){var e=this.hotMenu.getCell(0,0);H(e)||D(e)||x(e)?this.selectNextCell(0,0):this.hotMenu.selectCell(0,0)},selectLastCell:function(){var e=this.hotMenu.countRows()-1,t=this.hotMenu.getCell(e,0);H(t)||D(t)||x(t)?this.selectPrevCell(e,0):this.hotMenu.selectCell(e,0)},selectNextCell:function(e,t){var n=e+1,o=n=0?this.hotMenu.getCell(n,t):null;o&&(H(o)||D(o)||x(o)?this.selectPrevCell(n,t):this.hotMenu.selectCell(n,t))},menuItemRenderer:function(e,t,n,o,i,r){var s=this,a=e.getSourceDataAtRow(n),l=document.createElement("div"),u=function(e){return e.hasOwnProperty("submenu")},c=function(e){return new RegExp(I,"i").test(e.name)},d=function(e){return e.disabled===!0||"function"==typeof e.disabled&&e.disabled.call(s.hot)===!0},h=function(e){return"function"==typeof e.hidden&&e.hidden.call(s.hot)===!0},f=function(e){return e.disableSelection},p=h(a);"function"==typeof r&&(r=r.call(this.hot)),m(t),g(l,"htItemWrapper"),t.appendChild(l),c(a)?g(t,"htSeparator"):p||"function"!=typeof a.renderer?v(l,r):(g(t,"htCustomMenuRenderer"),t.appendChild(a.renderer(e,l,n,o,i,r))),p?t.parentNode&&g(t.parentNode,"htHidden"):d(a)?(g(t,"htDisabled"),this.eventManager.addEventListener(t,"mouseenter",function(){return e.deselectCell()})):f(a)?(g(t,"htSelectionDisabled"),this.eventManager.addEventListener(t,"mouseenter",function(){return e.deselectCell()})):u(a)?(g(t,"htSubmenu"),f(a)?this.eventManager.addEventListener(t,"mouseenter",function(){return e.deselectCell()}):this.eventManager.addEventListener(t,"mouseenter",function(){return e.selectCell(n,o,void 0,void 0,void 0,!1)})):(b(t,"htSubmenu"),b(t,"htDisabled"),f(a)?this.eventManager.addEventListener(t,"mouseenter",function(){return e.deselectCell()}):this.eventManager.addEventListener(t,"mouseenter",function(){return e.selectCell(n,o,void 0,void 0,void 0,!1)}))},createContainer:function(){var e=void 0!==arguments[0]?arguments[0]:null;e&&(e=e.replace(/ /g,"_"),e=this.options.className+"Sub_"+e);var t;return t=e?document.querySelector("."+this.options.className+"."+e):document.querySelector("."+this.options.className),t||(t=document.createElement("div"),g(t,"htMenu "+this.options.className),e&&g(t,e),document.getElementsByTagName("body")[0].appendChild(t)),t},blockMainTableCallbacks:function(){this._afterScrollCallback=function(){},this.hot.addHook("afterScrollVertically",this._afterScrollCallback),this.hot.addHook("afterScrollHorizontally",this._afterScrollCallback)},releaseMainTableCallbacks:function(){this._afterScrollCallback&&(this.hot.removeHook("afterScrollVertically",this._afterScrollCallback),this.hot.removeHook("afterScrollHorizontally",this._afterScrollCallback),this._afterScrollCallback=null)},onBeforeKeyDown:function(e){var t=this.hotMenu.getSelected(),n=!1;switch(e.keyCode){case N.ESCAPE:this.close(),n=!0;break;case N.ENTER:t&&(this.hotMenu.getSourceDataAtRow(t[0]).submenu?n=!0:(this.executeCommand(e),this.close(!0)));break;case N.ARROW_DOWN:t?this.selectNextCell(t[0],t[1]):this.selectFirstCell(),n=!0;break;case N.ARROW_UP:t?this.selectPrevCell(t[0],t[1]):this.selectLastCell(),n=!0;break;case N.ARROW_RIGHT:if(t){var o=this.openSubMenu(t[0]);o&&o.selectFirstCell()}n=!0;break;case N.ARROW_LEFT:t&&this.isSubMenu()&&(this.close(),this.parentMenu&&this.parentMenu.hotMenu.listen(),n=!0)}n&&(e.preventDefault(),V(e))},onAfterInit:function(){var e=this.hotMenu.getSettings().data,t=this.hotMenu.view.wt.wtTable.hider.style,n=this.hotMenu.view.wt.wtTable.holder.style,o=parseInt(t.width,10),i=_(e,function(e,t){return e+(t.name===I?1:26)},0);n.width=o+22+"px",n.height=i+4+"px"},onDocumentMouseDown:function(e){this.isOpened()&&(this.container&&y(e.target,this.container)&&this.executeCommand(e),this.options.standalone&&this.hotMenu&&!y(e.target,this.hotMenu.rootElement)?this.close(!0):(this.isAllSubMenusClosed()||this.isSubMenu())&&!y(e.target,".htMenu")&&y(e.target,document)&&this.close(!0))}},{}),M(F,L)},{cursor:68,eventManager:41,"helpers/array":42,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/function":48,"helpers/object":51,"helpers/unicode":54,"mixins/localHooks":55,predefinedItems:71,utils:72}],71:[function(e,t,n){"use strict";function o(){var e={};return c(D,function(t,n){return e[n]=d(t)}),e}function i(e,t){-1===H.indexOf(e)&&(D[e]=t)}var r;Object.defineProperties(n,{ROW_ABOVE:{get:function(){return w}},ROW_BELOW:{get:function(){return y}},COLUMN_LEFT:{get:function(){return b}},COLUMN_RIGHT:{get:function(){return C}},CLEAR_COLUMN:{get:function(){return R}},REMOVE_ROW:{get:function(){return _}},REMOVE_COLUMN:{get:function(){return S}},UNDO:{get:function(){return E}},REDO:{get:function(){return T}},READ_ONLY:{get:function(){return M}},ALIGNMENT:{get:function(){return O}},SEPARATOR:{get:function(){return k}},ITEMS:{get:function(){return H}},predefinedItems:{get:function(){return o}},addItem:{get:function(){return i}},__esModule:{value:!0}});var s,a,l,u=(s=e("helpers/object"),s&&s.__esModule&&s||{"default":s}),c=u.objectEach,d=u.clone,h=((a=e("helpers/number"),a&&a.__esModule&&a||{"default":a}).rangeEach,l=e("utils"),l&&l.__esModule&&l||{"default":l}),f=h.align,p=h.getAlignmentClasses,g=h.getValidSelection,m=h.checkSelectionConsistency,v=h.markLabelAsSelected,w="row_above",y="row_below",b="col_left",C="col_right",R="clear_column",_="remove_row",S="remove_col",E="undo",T="redo",M="make_read_only",O="alignment",k="---------",H=[w,y,b,C,R,_,S,E,T,M,O,k],D=(r={},Object.defineProperty(r,k,{value:{name:k},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(r,w,{value:{key:w,name:"Insert row above",callback:function(e,t){this.alter("insert_row",t.start.row)},disabled:function(){var e=g(this);if(!e||this.countRows()>=this.getSettings().maxRows)return!0;var t=this.countRows(),n=[0,e[1],t-1,e[1]];return n.join(",")===e.join(",")&&t>1},hidden:function(){return!this.getSettings().allowInsertRow}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(r,y,{value:{key:y,name:"Insert row below",callback:function(e,t){this.alter("insert_row",t.end.row+1)},disabled:function(){var e=g(this);if(!e||this.countRows()>=this.getSettings().maxRows)return!0;var t=this.countRows(),n=[0,e[1],t-1,e[1]];return n.join(",")===e.join(",")&&t>1},hidden:function(){return!this.getSettings().allowInsertRow}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(r,b,{value:{key:b,name:"Insert column on the left",callback:function(e,t){this.alter("insert_col",t.start.col)},disabled:function(){var e=g(this);if(!e)return!0;if(!this.isColumnModificationAllowed())return!0;var t=[e[0],0,e[0],this.countCols()-1],n=t.join(",")==e.join(","),o=1==this.countCols();return e[1]<0||this.countCols()>=this.getSettings().maxCols||!o&&n},hidden:function(){return!this.getSettings().allowInsertColumn}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(r,C,{value:{key:C,name:"Insert column on the right",callback:function(e,t){this.alter("insert_col",t.end.col+1)},disabled:function(){var e=g(this);if(!e)return!0;if(!this.isColumnModificationAllowed())return!0;var t=[e[0],0,e[0],this.countCols()-1],n=t.join(",")==e.join(","),o=1==this.countCols();return e[1]<0||this.countCols()>=this.getSettings().maxCols||!o&&n},hidden:function(){return!this.getSettings().allowInsertColumn}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(r,R,{value:{key:R,name:"Clear column",callback:function(e,t){var n=t.start.col;this.countRows()&&this.populateFromArray(0,n,[[null]],Math.max(t.start.row,t.end.row),n)},disabled:function(){var e=g(this);if(!e)return!0;var t=[e[0],0,e[0],this.countCols()-1],n=t.join(",")==e.join(",");return e[1]<0||this.countCols()>=this.getSettings().maxCols||n}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(r,_,{value:{key:_,name:"Remove row",callback:function(e,t){var n=t.end.row-t.start.row+1;this.alter("remove_row",t.start.row,n)},disabled:function(){var e=g(this);if(!e)return!0;var t=[0,e[1],this.countRows()-1,e[1]];return t.join(",")===e.join(",")},hidden:function(){return!this.getSettings().allowRemoveRow}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(r,S,{value:{key:S,name:"Remove column",callback:function(e,t){var n=t.end.col-t.start.col+1;this.alter("remove_col",t.start.col,n)},disabled:function(){var e=g(this);if(!e)return!0;if(!this.isColumnModificationAllowed())return!0;var t=[e[0],0,e[0],this.countCols()-1],n=t.join(",")==e.join(",");return e[1]<0||n},hidden:function(){return!this.getSettings().allowRemoveColumn}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(r,E,{value:{key:E,name:"Undo",callback:function(){this.undo()},disabled:function(){return this.undoRedo&&!this.undoRedo.isUndoAvailable()}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(r,T,{value:{key:T,name:"Redo",callback:function(){this.redo()},disabled:function(){return this.undoRedo&&!this.undoRedo.isRedoAvailable()}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(r,M,{value:{key:M,name:function(){var e=this,t="Read only",n=m(this.getSelectedRange(),function(t,n){return e.getCellMeta(t,n).readOnly});return n&&(t=v(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=m(t,function(t,n){return e.getCellMeta(t,n).readOnly});t.forAll(function(t,o){e.getCellMeta(t,o).readOnly=!n}),this.render()},disabled:function(){return!this.getSelectedRange()}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(r,O,{value:{key:O,name:"Alignment",disabled:function(){return!this.getSelectedRange()},submenu:{items:[{key:O+":left",name:function(){var e=this,t="Left",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htLeft")?!0:void 0});return n&&(t=v(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=p(t,function(t,n){return e.getCellMeta(t,n).className}),o="horizontal",i="htLeft";this.runHooks("beforeCellAlignment",n,t,o,i),f(t,o,i,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1},{key:O+":center",name:function(){var e=this,t="Center",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htCenter")?!0:void 0});return n&&(t=v(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=p(t,function(t,n){return e.getCellMeta(t,n).className}),o="horizontal",i="htCenter";this.runHooks("beforeCellAlignment",n,t,o,i),f(t,o,i,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1},{key:O+":right",name:function(){var e=this,t="Right",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htRight")?!0:void 0});return n&&(t=v(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=p(t,function(t,n){return e.getCellMeta(t,n).className}),o="horizontal",i="htRight";this.runHooks("beforeCellAlignment",n,t,o,i),f(t,o,i,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1},{key:O+":justify",name:function(){var e=this,t="Justify",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htJustify")?!0:void 0});return n&&(t=v(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=p(t,function(t,n){return e.getCellMeta(t,n).className}),o="horizontal",i="htJustify";this.runHooks("beforeCellAlignment",n,t,o,i),f(t,o,i,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1},{name:k},{key:O+":top",name:function(){ +var e=this,t="Top",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htTop")?!0:void 0});return n&&(t=v(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=p(t,function(t,n){return e.getCellMeta(t,n).className}),o="vertical",i="htTop";this.runHooks("beforeCellAlignment",n,t,o,i),f(t,o,i,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1},{key:O+":middle",name:function(){var e=this,t="Middle",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htMiddle")?!0:void 0});return n&&(t=v(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=p(t,function(t,n){return e.getCellMeta(t,n).className}),o="vertical",i="htMiddle";this.runHooks("beforeCellAlignment",n,t,o,i),f(t,o,i,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1},{key:O+":bottom",name:function(){var e=this,t="Bottom",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htBottom")?!0:void 0});return n&&(t=v(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=p(t,function(t,n){return e.getCellMeta(t,n).className}),o="vertical",i="htBottom";this.runHooks("beforeCellAlignment",n,t,o,i),f(t,o,i,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1}]}},configurable:!0,enumerable:!0,writable:!0}),r)},{"helpers/number":50,"helpers/object":51,utils:72}],72:[function(e,t,n){"use strict";function o(e){return{start:e.getTopLeftCorner(),end:e.getBottomRightCorner()}}function i(e){return v(e,"htSeparator")}function r(e){return v(e,"htSubmenu")}function s(e){return v(e,"htDisabled")}function a(e){return v(e,"htSelectionDisabled")}function l(e){var t=e.getSelected();return t?t[0]<0?null:t:null}function u(e,t){return-1!=e.indexOf(t)?e:(e=e.replace("htTop","").replace("htMiddle","").replace("htBottom","").replace(" ",""),e+=" "+t)}function c(e,t){return-1!=e.indexOf(t)?e:(e=e.replace("htLeft","").replace("htCenter","").replace("htRight","").replace("htJustify","").replace(" ",""),e+=" "+t)}function d(e,t){for(var n={},o=e.from.row;o<=e.to.row;o++)for(var i=e.from.col;i<=e.to.col;i++)n[o]||(n[o]=[]),n[o][i]=t(o,i);return n}function h(e,t,n,o){if(e.from.row==e.to.row&&e.from.col==e.to.col)f(e.from.row,e.from.col,t,n,o);else for(var i=e.from.row;i<=e.to.row;i++)for(var r=e.from.col;r<=e.to.col;r++)f(i,r,t,n,o)}function f(e,t,n,o,i){var r=i(e,t),s=o;r.className&&(s="vertical"===n?u(r.className,o):c(r.className,o)),r.className=s}function p(e,t){var n=!1;return e&&e.forAll(function(e,o){return t(e,o)?(n=!0,!1):void 0}),n}function g(e){return''+String.fromCharCode(10003)+""+e}Object.defineProperties(n,{normalizeSelection:{get:function(){return o}},isSeparator:{get:function(){return i}},hasSubMenu:{get:function(){return r}},isDisabled:{get:function(){return s}},isSelectionDisabled:{get:function(){return a}},getValidSelection:{get:function(){return l}},prepareVerticalAlignClass:{get:function(){return u}},prepareHorizontalAlignClass:{get:function(){return c}},getAlignmentClasses:{get:function(){return d}},align:{get:function(){return h}},checkSelectionConsistency:{get:function(){return p}},markLabelAsSelected:{get:function(){return g}},__esModule:{value:!0}});var m,v=(m=e("helpers/dom/element"),m&&m.__esModule&&m||{"default":m}).hasClass},{"helpers/dom/element":45}],73:[function(e,t,n){"use strict";Object.defineProperties(n,{ContextMenuCopyPaste:{get:function(){return g}},__esModule:{value:!0}});var o,i,r,s,a,l,u=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}).removeClass,c=(i=e("helpers/array"),i&&i.__esModule&&i||{"default":i}).arrayEach,d=(r=e("eventManager"),r&&r.__esModule&&r||{"default":r}).EventManager,h=(s=e("plugins"),s&&s.__esModule&&s||{"default":s}).registerPlugin,f=(a=e("_base"),a&&a.__esModule&&a||{"default":a})["default"],p=(l=e("zeroclipboard"),l&&l.__esModule&&l||{"default":l})["default"],g=function(e){$traceurRuntime.superConstructor(m).call(this,e),this.eventManager=new d(this),this.swfPath=null,this.outsideClickDeselectsCache=null},m=g;$traceurRuntime.createClass(g,{isEnabled:function(){return this.hot.getSettings().contextMenuCopyPaste},enablePlugin:function(){var e=this;if(!this.enabled){"object"==typeof this.hot.getSettings().contextMenuCopyPaste&&(this.swfPath=this.hot.getSettings().contextMenuCopyPaste.swfPath),"undefined"==typeof p&&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(t){"undefined"==typeof navigator.mimeTypes["application/x-shockwave-flash"]&&console.error("To be able to use the Copy/Paste feature from the context menu, your browser needs to have Flash Plugin installed.")}this.swfPath&&p.config({swfPath:this.swfPath}),this.hot.addHook("afterContextMenuShow",function(){return e.onAfterContextMenuShow()}),this.hot.addHook("afterContextMenuDefaultOptions",function(t){return e.onAfterContextMenuDefaultOptions(t)}),this.registerEvents(),$traceurRuntime.superGet(this,m.prototype,"enablePlugin").call(this)}},disablePlugin:function(){$traceurRuntime.superGet(this,m.prototype,"disablePlugin").call(this)},registerEvents:function(){var e=this;this.eventManager.addEventListener(document,"mouseenter",function(){return e.removeCurrentClass()}),this.eventManager.addEventListener(document,"mouseleave",function(){return e.removeZeroClipboardClass()})},getCopyValue:function(){return this.hot.copyPaste.setCopyableText(),this.hot.copyPaste.copyPasteInstance.elTextarea.value},onAfterContextMenuDefaultOptions:function(e){e.items.unshift({key:"copy",name:"Copy"},{key:"paste",name:"Paste",callback:function(){this.copyPaste.triggerPaste()}},Handsontable.plugins.ContextMenu.SEPARATOR)},onAfterContextMenuShow:function(){var e=this,t=this.hot.getPlugin("contextMenu"),n=t.menu.hotMenu.getSourceData();c(n,function(n,o){if("copy"===n.key){var i=new p(t.menu.hotMenu.getCell(o,0));return i.off(),i.on("copy",function(t){var n=t.clipboardData;n.setData("text/plain",e.getCopyValue()),e.hot.getSettings().outsideClickDeselects=e.outsideClickDeselectsCache}),!1}})},removeCurrentClass:function(){var e=this.hot.getPlugin("contextMenu");if(e.menu.isOpened()){var t=e.menu.hotMenu.rootElement.querySelector("td.current");t&&u(t,"current")}this.outsideClickDeselectsCache=this.hot.getSettings().outsideClickDeselects,this.hot.getSettings().outsideClickDeselects=!1},removeZeroClipboardClass:function(){var e=this.hot.getPlugin("contextMenu");if(e.menu.isOpened()){var t=e.menu.hotMenu.rootElement.querySelector("td.zeroclipboard-is-hover");t&&u(t,"zeroclipboard-is-hover")}this.hot.getSettings().outsideClickDeselects=this.outsideClickDeselectsCache}},{},f),h("contextMenuCopyPaste",g)},{_base:59,eventManager:41,"helpers/array":42,"helpers/dom/element":45,plugins:58,zeroclipboard:"zeroclipboard"}],74:[function(e,t,n){"use strict";function o(e){function t(){e.isListening()&&e.selection.empty()}function n(t){var n,o,i,r,s,a,l,u,c,d;if(e.isListening()&&e.selection.isSelected()){n=t,o=v.parse(n),i=e.getSelected(),r=new O(i[0],i[1]),s=new O(i[2],i[3]),a=new k(r,r,s),l=a.getTopLeftCorner(),u=a.getBottomRightCorner(),c=l,d=new O(Math.max(u.row,o.length-1+l.row),Math.max(u.col,o[0].length-1+l.col));var h=s.row-r.row>=o.length-1,f=s.col-r.col>=o[0].length-1;e.addHookOnce("afterChange",function(t,n){var o=t?t.length:0;if(o){var i={row:0,col:0},r=-1;C(t,function(e,n){var s=o>n+1?t[n+1]:null;s&&(h||(i.row=i.row+Math.max(s[0]-e[0]-1,0)),!f&&e[1]>r&&(r=e[1],i.col=i.col+Math.max(s[1]-e[1]-1,0)))}),e.selectCell(c.row,c.col,d.row+i.row,d.col+i.col)}}),e.populateFromArray(c.row,c.col,o,d.row,d.col,"paste",e.getSettings().pasteMode)}}function o(t){if(e.getSelected()&&!(e.getActiveEditor()&&e.getActiveEditor().isOpened()||E(t))){if(b(t.keyCode)){if(e.getSettings().fragmentSelection&&T())return;return i.setCopyableText(),void S(t)}var n=(t.ctrlKey||t.metaKey)&&!t.altKey;t.keyCode==y.A&&n&&e._registerTimeout(setTimeout(M(i.setCopyableText,i),0))}}var i=this;this.copyPasteInstance=m(),this.copyPasteInstance.onCut(t),this.copyPasteInstance.onPaste(n),this.onPaste=n,e.addHook("beforeKeyDown",o),this.destroy=function(){this.copyPasteInstance&&(this.copyPasteInstance.removeCallback(t),this.copyPasteInstance.removeCallback(n),this.copyPasteInstance.destroy(),this.copyPasteInstance=null),e.removeHook("beforeKeyDown",o)},e.addHook("afterDestroy",M(this.destroy,this)),this.triggerPaste=M(this.copyPasteInstance.triggerPaste,this.copyPasteInstance),this.triggerCut=M(this.copyPasteInstance.triggerCut,this.copyPasteInstance),this.setCopyableText=function(){var t=e.getSettings(),n=t.copyRowsLimit,o=t.copyColsLimit,i=e.getSelectedRange(),r=i.getTopLeftCorner(),s=i.getBottomRightCorner(),a=r.row,l=r.col,u=s.row,c=s.col,d=Math.min(u,a+n-1),h=Math.min(c,l+o-1),f=[];f.push({startRow:a,startCol:l,endRow:d,endCol:h}),f=Handsontable.hooks.run(e,"modifyCopyableRange",f);var p=this.getRangedCopyableData(f);e.copyPaste.copyPasteInstance.copyable(p),u===d&&c===h||Handsontable.hooks.run(e,"afterCopyLimit",u-a+1,c-l+1,n,o)},this.getRangedCopyableData=function(t){var n=[],o=[],i=[];return C(t,function(e){R(e.startRow,e.endRow,function(e){-1===o.indexOf(e)&&o.push(e)}),R(e.startCol,e.endCol,function(e){-1===i.indexOf(e)&&i.push(e)})}),C(o,function(t){var o=[];C(i,function(n){o.push(e.getCopyableData(t,n))}),n.push(o)}),v.stringify(n)}}function i(){var e=this,t=e.getSettings().copyPaste!==!1;t&&!e.copyPaste?e.copyPaste=new o(e):!t&&e.copyPaste&&(e.copyPaste.destroy(),e.copyPaste=null)}Object.defineProperties(n,{CopyPastePlugin:{get:function(){return o}},__esModule:{value:!0}});var r,s,a,l,u,c,d,h,f,p,g,m=(r=e("copyPaste"),r&&r.__esModule&&r||{"default":r})["default"],v=(s=e("SheetClip"),s&&s.__esModule&&s||{"default":s})["default"],w=(a=e("helpers/unicode"),a&&a.__esModule&&a||{"default":a}),y=w.KEY_CODES,b=w.isCtrlKey,C=(l=e("helpers/array"),l&&l.__esModule&&l||{"default":l}).arrayEach,R=(u=e("helpers/number"),u&&u.__esModule&&u||{"default":u}).rangeEach,_=(c=e("helpers/dom/event"),c&&c.__esModule&&c||{"default":c}),S=_.stopImmediatePropagation,E=_.isImmediatePropagationStopped,T=(d=e("helpers/dom/element"),d&&d.__esModule&&d||{"default":d}).getSelectionText,M=(h=e("helpers/function"),h&&h.__esModule&&h||{"default":h}).proxy,O=((f=e("plugins"),f&&f.__esModule&&f||{"default":f}).registerPlugin,(p=e("3rdparty/walkontable/src/cell/coords"),p&&p.__esModule&&p||{"default":p}).WalkontableCellCoords),k=(g=e("3rdparty/walkontable/src/cell/range"),g&&g.__esModule&&g||{"default":g}).WalkontableCellRange;Handsontable.hooks.add("afterInit",i),Handsontable.hooks.add("afterUpdateSettings",i),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":48,"helpers/number":50,"helpers/unicode":54,plugins:58}],75:[function(e,t,n){"use strict";function o(){}var i,r,s,a,l=((i=e("plugins"),i&&i.__esModule&&i||{"default":i}).registerPlugin,(r=e("3rdparty/walkontable/src/cell/range"),r&&r.__esModule&&r||{"default":r}).WalkontableCellRange),u=(s=e("3rdparty/walkontable/src/selection"),s&&s.__esModule&&s||{"default":s}).WalkontableSelection,c=function(e){return"boolean"==typeof e&&e===!0?!0:"object"==typeof e&&e.length>0},d=function(){c(this.getSettings().customBorders)&&(this.customBorders||(a=this,this.customBorders=new o))},h=function(e){for(var t=0;t=0?a.view.wt.selections[o]=n:a.view.wt.selections.push(n)},p=function(e,t,n){var o=b(e,t);o=C(o,n),this.setCellMeta(e,t,"borders",o),f(o)},g=function(e){for(var t=e.range,n=t.from.row;n<=t.to.row;n++)for(var o=t.from.col;o<=t.to.col;o++){var i=b(n,o),r=0;n==t.from.row&&(r++,e.hasOwnProperty("top")&&(i.top=e.top)),n==t.to.row&&(r++,e.hasOwnProperty("bottom")&&(i.bottom=e.bottom)),o==t.from.col&&(r++,e.hasOwnProperty("left")&&(i.left=e.left)),o==t.to.col&&(r++,e.hasOwnProperty("right")&&(i.right=e.right)),r>0&&(this.setCellMeta(n,o,"borders",i),f(i))}},m=function(e,t){return"border_row"+e+"col"+t},v=function(){return{width:1,color:"#000"}},w=function(){return{hide:!0}},y=function(){return{width:1,color:"#000",cornerVisible:!1}},b=function(e,t){return{className:m(e,t),border:y(),row:e,col:t,top:w(),right:w(),bottom:w(),left:w()}},C=function(e,t){return t.hasOwnProperty("border")&&(e.border=t.border),t.hasOwnProperty("top")&&(e.top=t.top),t.hasOwnProperty("right")&&(e.right=t.right),t.hasOwnProperty("bottom")&&(e.bottom=t.bottom),t.hasOwnProperty("left")&&(e.left=t.left),e},R=function(e){for(var t=document.querySelectorAll("."+e),n=0;n'+String.fromCharCode(10003)+""+e},O=function(e){this.getSettings().customBorders&&(e.items.push(Handsontable.plugins.ContextMenu.SEPARATOR),e.items.push({key:"borders",name:"Borders",submenu:{items:[{key:"borders:top",name:function(){var e="Top",t=T(this,"top");return t&&(e=M(e)),e},callback:function(){var e=T(this,"top");E.call(this,this.getSelectedRange(),"top",e)},disabled:!1},{key:"borders:right",name:function(){var e="Right",t=T(this,"right");return t&&(e=M(e)),e},callback:function(){var e=T(this,"right");E.call(this,this.getSelectedRange(),"right",e)},disabled:!1},{key:"borders:bottom",name:function(){var e="Bottom",t=T(this,"bottom");return t&&(e=M(e)),e},callback:function(){var e=T(this,"bottom");E.call(this,this.getSelectedRange(),"bottom",e)},disabled:!1},{key:"borders:left",name:function(){var e="Left",t=T(this,"left");return t&&(e=M(e)),e},callback:function(){var e=T(this,"left");E.call(this,this.getSelectedRange(),"left",e)},disabled:!1},{key:"borders:no_borders",name:"Remove border(s)",callback:function(){E.call(this,this.getSelectedRange(),"noBorders")},disabled:function(){return!T(this)}}]}}))};Handsontable.hooks.add("beforeInit",d),Handsontable.hooks.add("afterContextMenuDefaultOptions",O),Handsontable.hooks.add("afterInit",function(){var e=this.getSettings().customBorders;if(e){for(var t=0;tthis.boundaries.bottom&&(o=t-this.boundaries.bottom),ethis.boundaries.right&&(n=e-this.boundaries.right),this.callback(n,o)};var a,l=function(e){e.dragToScrollListening=!1;var t=e.view.wt.wtTable.holder;a=new o,t!==window&&(a.setBoundaries(t.getBoundingClientRect()),a.setCallback(function(e,n){0>e?t.scrollLeft-=50:e>0&&(t.scrollLeft+=50),0>n?t.scrollTop-=20:n>0&&(t.scrollTop+=20)}),e.dragToScrollListening=!0)};Handsontable.hooks.add("afterInit",function(){var e=this,t=s(this);t.addEventListener(document,"mouseup",function(){e.dragToScrollListening=!1}),t.addEventListener(document,"mousemove",function(t){e.dragToScrollListening&&a.check(t.clientX,t.clientY)})}),Handsontable.hooks.add("afterDestroy",function(){s(this).clear()}),Handsontable.hooks.add("afterOnCellMouseDown",function(){l(this)}),Handsontable.hooks.add("afterOnCellCornerMouseDown",function(){l(this)}),Handsontable.plugins.DragToScroll=o},{eventManager:41,plugins:58}],77:[function(e,t,n){"use strict";Object.defineProperties(n,{ManualColumnFreeze:{get:function(){return a}},__esModule:{value:!0}});var o,i,r=(o=e("_base"),o&&o.__esModule&&o||{"default":o})["default"],s=(i=e("plugins"),i&&i.__esModule&&i||{"default":i}).registerPlugin,a=function(e){$traceurRuntime.superConstructor(l).call(this,e),this.manualColumnMovePlugin=null,this.frozenColumnsBasePositions=[]},l=a;$traceurRuntime.createClass(a,{isEnabled:function(){return!!this.hot.getSettings().manualColumnFreeze},enablePlugin:function(){var e=this;this.enabled||(this.addHook("modifyCol",function(t){return e.onModifyCol(t)}),this.addHook("afterContextMenuDefaultOptions",function(t){return e.addContextMenuEntry(t)}),$traceurRuntime.superGet(this,l.prototype,"enablePlugin").call(this))},init:function(){$traceurRuntime.superGet(this,l.prototype,"init").call(this),this.fixedColumnsCount=this.hot.getSettings().fixedColumnsLeft},getManualColumnMovePlugin:function(){return this.manualColumnMovePlugin||(this.manualColumnMovePlugin=this.hot.getPlugin("manualColumnMove")),this.manualColumnMovePlugin},onModifyCol:function(e){return this.getManualColumnMovePlugin().isEnabled()?e:this.getLogicalColumnIndex(e)},addContextMenuEntry:function(e){var t=this;e.items.push(Handsontable.plugins.ContextMenu.SEPARATOR,{key:"freeze_column",name:function(){var e=t.hot.getSelected()[1];return e>t.fixedColumnsCount-1?"Freeze this column":"Unfreeze this column"},disabled:function(){var e=t.hot.getSelected();return e[1]!==e[3]},callback:function(){var e=t.hot.getSelected()[1];e>t.fixedColumnsCount-1?t.freezeColumn(e):t.unfreezeColumn(e)}})},freezeColumn:function(e){e<=this.fixedColumnsCount-1||(e!==this.getLogicalColumnIndex(e)&&(this.frozenColumnsBasePositions[this.fixedColumnsCount]=e),this.changeColumnPositions(e,this.fixedColumnsCount),this.addFixedColumn(),this.hot.view.wt.wtOverlays.leftOverlay.refresh(),this.hot.view.wt.wtOverlays.adjustElementsSize())},unfreezeColumn:function(e){if(!(e>this.fixedColumnsCount-1)){var t=this.getBestColumnReturnPosition(e);this.changeColumnPositions(e,t),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--},getBestColumnReturnPosition:function(e){var t,n=this.fixedColumnsCount,o=this.getLogicalColumnIndex(n);if(null==this.frozenColumnsBasePositions[e])for(t=this.getLogicalColumnIndex(e);t>o;)n++,o=this.getLogicalColumnIndex(n);else{for(t=this.frozenColumnsBasePositions[e],this.frozenColumnsBasePositions[e]=void 0;t>=o;)n++,o=this.getLogicalColumnIndex(n);n=o}return n-1},getVisibleColumnIndex:function(e){return this.getManualColumnMovePlugin().getVisibleColumnIndex(e)},getLogicalColumnIndex:function(e){return this.getManualColumnMovePlugin().getLogicalColumnIndex(e)},changeColumnPositions:function(e,t){this.getManualColumnMovePlugin().changeColumnPositions(e,t)}},{},r),s("manualColumnFreeze",a)},{_base:59,plugins:58}],78:[function(e,t,n){"use strict";Object.defineProperties(n,{ManualColumnMove:{get:function(){return S}},__esModule:{value:!0}});var o,i,r,s,a,l,u,c=(o=e("_base.js"),o&&o.__esModule&&o||{"default":o})["default"],d=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),h=d.addClass,f=d.hasClass,p=d.removeClass,g=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}),m=g.arrayEach,v=g.arrayMap,w=(s=e("helpers/number"),s&&s.__esModule&&s||{"default":s}).rangeEach,y=(a=e("eventManager"),a&&a.__esModule&&a||{"default":a}).eventManager,b=(l=e("helpers/dom/event"),l&&l.__esModule&&l||{"default":l}),C=b.pageX,R=(b.pageY,(u=e("plugins"),u&&u.__esModule&&u||{"default":u}).registerPlugin),_=new WeakMap,S=function(e){var t=this;$traceurRuntime.superConstructor(E).call(this,e),_.set(this,{guideClassName:"manualColumnMoverGuide",handleClassName:"manualColumnMover",startOffset:null,pressed:null,startCol:null,endCol:null,currentCol:null,startX:null,startY:null}),this.guideElement=null,this.handleElement=null,this.currentTH=null,this.columnPositions=[],this.eventManager=y(this),this.addHook("init",function(){return t.onInit()})},E=S;$traceurRuntime.createClass(S,{isEnabled:function(){return!!this.hot.getSettings().manualColumnMove},enablePlugin:function(){var e=this,t=_.get(this),n=this.hot.getSettings().manualColumnMove,o=this.loadManualColumnPositions();this.handleElement=document.createElement("DIV"),this.handleElement.className=t.handleClassName,this.guideElement=document.createElement("DIV"),this.guideElement.className=t.guideClassName,this.addHook("modifyCol",function(t){return e.onModifyCol(t)}),this.addHook("unmodifyCol",function(t){return e.onUnmodifyCol(t)}),this.addHook("afterRemoveCol",function(t,n){return e.onAfterRemoveCol(t,n)}),this.addHook("afterCreateCol",function(t,n){return e.onAfterCreateCol(t,n)}),this.registerEvents(),"undefined"!=typeof o?this.columnPositions=o:Array.isArray(n)?this.columnPositions=n:n&&void 0!==this.columnPositions||(this.columnPositions=[]),$traceurRuntime.superGet(this,E.prototype,"enablePlugin").call(this)},updatePlugin:function(){this.disablePlugin(),this.enablePlugin(),$traceurRuntime.superGet(this,E.prototype,"updatePlugin").call(this)},disablePlugin:function(){var e=this.hot.getSettings().manualColumnMove;Array.isArray(e)&&(this.unregisterEvents(),this.columnPositions=[]),$traceurRuntime.superGet(this,E.prototype,"disablePlugin").call(this)},registerEvents:function(){var e=this;this.eventManager.addEventListener(this.hot.rootElement,"mouseover",function(t){return e.onMouseOver(t)}),this.eventManager.addEventListener(this.hot.rootElement,"mousedown",function(t){return e.onMouseDown(t)}),this.eventManager.addEventListener(window,"mousemove",function(t){return e.onMouseMove(t)}),this.eventManager.addEventListener(window,"mouseup",function(t){return e.onMouseUp(t)})},unregisterEvents:function(){this.eventManager.clear()},saveManualColumnPositions:function(){Handsontable.hooks.run(this.hot,"persistentStateSave","manualColumnPositions",this.columnPositions)},loadManualColumnPositions:function(){var e={};return Handsontable.hooks.run(this.hot,"persistentStateLoad","manualColumnPositions",e),e.value},completeSettingsArray:function(){var e=this,t=this.hot.countCols();this.columnPositions.length!==t&&w(0,t-1,function(t){-1===e.columnPositions.indexOf(t)&&e.columnPositions.push(t)})},setupHandlePosition:function(e){var t=_.get(this),n=this.hot.view.wt.wtTable.getCoords(e).col;if(this.currentTH=e,n>=0){var o=this.currentTH.getBoundingClientRect();t.currentCol=n,t.startOffset=o.left,this.handleElement.style.top=o.top+"px",this.handleElement.style.left=t.startOffset+"px",this.hot.rootElement.appendChild(this.handleElement)}},refreshHandlePosition:function(e,t){var n=e.getBoundingClientRect(),o=6;t>0?this.handleElement.style.left=n.left+n.width-o+"px":this.handleElement.style.left=n.left+"px"},setupGuidePosition:function(){var e=this.currentTH.getBoundingClientRect(),t=_.get(this);h(this.handleElement,"active"),h(this.guideElement,"active"),this.guideElement.style.width=e.width+"px",this.guideElement.style.height=this.hot.view.maximumVisibleElementHeight(0)+"px",this.guideElement.style.top=this.handleElement.style.top,this.guideElement.style.left=t.startOffset+"px",this.hot.rootElement.appendChild(this.guideElement)},refreshGuidePosition:function(e){var t=_.get(this);this.guideElement.style.left=t.startOffset+e+"px"},hideHandleAndGuide:function(){p(this.handleElement,"active"),p(this.guideElement,"active")},checkColumnHeader:function(e){if(e!=this.hot.rootElement){var t=e.parentNode;return"THEAD"===t.tagName?!0:this.checkColumnHeader(t)}return!1},createPositionData:function(e){var t=this.columnPositions;t.lengththis.columnPositions.length-1&&this.createPositionData(n+1),this.columnPositions.splice(t,0,this.columnPositions.splice(e,1)[0])},getVisibleColumnIndex:function(e){return e>this.columnPositions.length-1&&this.createPositionData(e),this.columnPositions.indexOf(e)},getLogicalColumnIndex:function(e){return this.columnPositions[e]},onMouseOver:function(e){var t=_.get(this);if(this.checkColumnHeader(e.target)){var n=this.getTHFromTargetElement(e.target);if(n)if(t.pressed){var o=this.hot.view.wt.wtTable.getCoords(n).col;o>=0&&(t.endCol=o,this.refreshHandlePosition(n,t.endCol-t.startCol))}else this.setupHandlePosition(n)}},onMouseDown:function(e){var t=_.get(this);f(e.target,t.handleClassName)&&(t.startX=C(e),this.setupGuidePosition(),t.pressed=this.hot,t.startCol=t.currentCol,t.endCol=t.currentCol)},onMouseMove:function(e){var t=_.get(this);t.pressed&&this.refreshGuidePosition(C(e)-t.startX)},onMouseUp:function(e){var t=_.get(this);t.pressed&&(this.hideHandleAndGuide(),t.pressed=!1,this.createPositionData(this.hot.countCols()),this.changeColumnPositions(t.startCol,t.endCol),Handsontable.hooks.run(this.hot,"beforeColumnMove",t.startCol,t.endCol),this.hot.forceFullRender=!0,this.hot.view.render(),this.saveManualColumnPositions(),Handsontable.hooks.run(this.hot,"afterColumnMove",t.startCol,t.endCol),this.setupHandlePosition(this.currentTH))},onModifyCol:function(e){return-1==typeof this.getVisibleColumnIndex(e)&&this.createPositionData(e+1),this.getLogicalColumnIndex(e)},onUnmodifyCol:function(e){return-1==typeof this.getVisibleColumnIndex(e)&&this.createPositionData(e+1),this.getVisibleColumnIndex(e)},onAfterRemoveCol:function(e,t){if(this.isEnabled()){var n,o=this.columnPositions;n=o.splice(e,t),o=v(o,function(e,t){var o=e;return m(n,function(t,n){e>t&&o--}),o}),this.columnPositions=o}},onAfterCreateCol:function(e,t){if(this.isEnabled()){var n=this.columnPositions;if(n.length){var o=[];w(0,t-1,function(t){o.push(e+t)}),e>=n.length?n.concat(o):(n=v(n,function(n,o){return n>=e?n+t:n}),n.splice.apply(n,[e,0].concat(o))),this.columnPositions=n}}},onInit:function(){this.completeSettingsArray()}},{},c),R("manualColumnMove",S),Handsontable.hooks.register("beforeColumnMove"),Handsontable.hooks.register("afterColumnMove"),Handsontable.hooks.register("unmodifyCol")},{"_base.js":59,eventManager:41,"helpers/array":42,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/number":50,plugins:58}],79:[function(e,t,n){"use strict";Object.defineProperties(n,{ManualColumnResize:{get:function(){return v}},__esModule:{value:!0}});var o,i,r,s,a,l=(o=e("_base.js"),o&&o.__esModule&&o||{"default":o})["default"],u=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),c=u.addClass,d=u.hasClass,h=u.removeClass,f=(r=e("eventManager"),r&&r.__esModule&&r||{"default":r}).eventManager,p=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),g=p.pageX,m=(p.pageY,(a=e("plugins"),a&&a.__esModule&&a||{"default":a}).registerPlugin),v=function(e){$traceurRuntime.superConstructor(w).call(this,e),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=f(this),this.pressed=null,this.dblclick=0,this.autoresizeTimeout=null,this.manualColumnWidths=[],c(this.handle,"manualColumnResizer"),c(this.guide,"manualColumnResizerGuide")},w=v;$traceurRuntime.createClass(v,{isEnabled:function(){return this.hot.getSettings().manualColumnResize},enablePlugin:function(){var e=this;if(!this.enabled){this.manualColumnWidths=[];var t=this.hot.getSettings().manualColumnResize,n=this.loadManualColumnWidths();this.addHook("modifyColWidth",function(t,n){return e.onModifyColWidth(t,n)}),this.addHook("beforeStretchingColumnWidth",function(t,n){return e.onBeforeStretchingColumnWidth(t,n)}),"undefined"!=typeof n?this.manualColumnWidths=n:Array.isArray(t)?this.manualColumnWidths=t:this.manualColumnWidths=[],Handsontable.hooks.register("beforeColumnResize"),Handsontable.hooks.register("afterColumnResize"),this.bindEvents(),$traceurRuntime.superGet(this,w.prototype,"enablePlugin").call(this)}},updatePlugin:function(){var e=this.hot.getSettings().manualColumnResize;Array.isArray(e)?this.manualColumnWidths=e:e||(this.manualColumnWidths=[])},disablePlugin:function(){$traceurRuntime.superGet(this,w.prototype,"disablePlugin").call(this)},saveManualColumnWidths:function(){this.hot.runHooks("persistentStateSave","manualColumnWidths",this.manualColumnWidths)},loadManualColumnWidths:function(){var e={};return this.hot.runHooks("persistentStateLoad","manualColumnWidths",e),e.value},setupHandlePosition:function(e){this.currentTH=e;var t=this.hot.view.wt.wtTable.getCoords(e).col;if(t>=0){var n=this.currentTH.getBoundingClientRect();this.currentCol=t,this.startOffset=n.left-6,this.startWidth=parseInt(n.width,10),this.handle.style.top=n.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(){c(this.handle,"active"),c(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(){h(this.handle,"active"),h(this.guide,"active")},checkIfColumnHeader:function(e){if(e!=this.hot.rootElement){var t=e.parentNode;return"THEAD"===t.tagName?!0:this.checkIfColumnHeader(t)}return!1},getTHFromTargetElement:function(e){return"TABLE"!=e.tagName?"TH"==e.tagName?e:this.getTHFromTargetElement(e.parentNode):null},onMouseOver:function(e){if(this.checkIfColumnHeader(e.target)){var t=this.getTHFromTargetElement(e.target);if(!t)return;var n=t.getAttribute("colspan");!t||null!==n&&1!==n||this.pressed||this.setupHandlePosition(t)}},afterMouseDownTimeout:function(){if(this.dblclick>=2){var e=this.hot.runHooks("beforeColumnResize",this.currentCol,this.newSize,!0);void 0!==e&&(this.newSize=e),"all"===this.hot.getSettings().stretchH?this.clearManualSize(this.currentCol):this.setManualSize(this.currentCol,this.newSize),this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.wt.wtOverlays.adjustElementsSize(!0),this.hot.runHooks("afterColumnResize",this.currentCol,this.newSize,!0); +}this.dblclick=0,this.autoresizeTimeout=null},onMouseDown:function(e){var t=this;d(e.target,"manualColumnResizer")&&(this.setupGuidePosition(),this.pressed=this.hot,null===this.autoresizeTimeout&&(this.autoresizeTimeout=setTimeout(function(){return t.afterMouseDownTimeout()},500),this.hot._registerTimeout(this.autoresizeTimeout)),this.dblclick++,this.startX=g(e),this.newSize=this.startWidth)},onMouseMove:function(e){this.pressed&&(this.currentWidth=this.startWidth+(g(e)-this.startX),this.newSize=this.setManualSize(this.currentCol,this.currentWidth),this.refreshHandlePosition(),this.refreshGuidePosition())},onMouseUp:function(e){this.pressed&&(this.hideHandleAndGuide(),this.pressed=!1,this.newSize!=this.startWidth&&(this.hot.runHooks("beforeColumnResize",this.currentCol,this.newSize),this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.wt.wtOverlays.adjustElementsSize(!0),this.saveManualColumnWidths(),this.hot.runHooks("afterColumnResize",this.currentCol,this.newSize)),this.setupHandlePosition(this.currentTH))},bindEvents:function(){var e=this;this.eventManager.addEventListener(this.hot.rootElement,"mouseover",function(t){return e.onMouseOver(t)}),this.eventManager.addEventListener(this.hot.rootElement,"mousedown",function(t){return e.onMouseDown(t)}),this.eventManager.addEventListener(window,"mousemove",function(t){return e.onMouseMove(t)}),this.eventManager.addEventListener(window,"mouseup",function(t){return e.onMouseUp(t)})},setManualSize:function(e,t){return t=Math.max(t,20),e=this.hot.runHooks("modifyCol",e),this.manualColumnWidths[e]=t,t},clearManualSize:function(e){e=this.hot.runHooks("modifyCol",e),this.manualColumnWidths[e]=void 0},onModifyColWidth:function(e,t){return this.enabled&&(t=this.hot.runHooks("modifyCol",t),this.hot.getSettings().manualColumnResize&&this.manualColumnWidths[t])?this.manualColumnWidths[t]:e},onBeforeStretchingColumnWidth:function(e,t){var n=this.manualColumnWidths[t];return void 0===n&&(n=e),n}},{},l),m("manualColumnResize",v)},{"_base.js":59,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,plugins:58}],80:[function(e,t,n){"use strict";Object.defineProperties(n,{ManualRowMove:{get:function(){return S}},__esModule:{value:!0}});var o,i,r,s,a,l,u,c=(o=e("_base.js"),o&&o.__esModule&&o||{"default":o})["default"],d=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),h=d.addClass,f=d.hasClass,p=d.removeClass,g=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}),m=g.arrayEach,v=g.arrayMap,w=(s=e("helpers/number"),s&&s.__esModule&&s||{"default":s}).rangeEach,y=(a=e("eventManager"),a&&a.__esModule&&a||{"default":a}).eventManager,b=(l=e("helpers/dom/event"),l&&l.__esModule&&l||{"default":l}),C=(b.pageX,b.pageY),R=(u=e("plugins"),u&&u.__esModule&&u||{"default":u}).registerPlugin,_=new WeakMap,S=function(e){$traceurRuntime.superConstructor(E).call(this,e),_.set(this,{guideClassName:"manualRowMoverGuide",handleClassName:"manualRowMover",startOffset:null,pressed:null,startRow:null,endRow:null,currentRow:null,startX:null,startY:null}),this.guideElement=null,this.handleElement=null,this.currentTH=null,this.rowPositions=[],this.eventManager=y(this)},E=S;$traceurRuntime.createClass(S,{isEnabled:function(){return!!this.hot.getSettings().manualRowMove},enablePlugin:function(){var e=this,t=_.get(this),n=this.hot.getSettings().manualRowMove,o=this.loadManualRowPositions();this.handleElement=document.createElement("DIV"),this.handleElement.className=t.handleClassName,this.guideElement=document.createElement("DIV"),this.guideElement.className=t.guideClassName,this.addHook("modifyRow",function(t){return e.onModifyRow(t)}),this.addHook("afterRemoveRow",function(t,n){return e.onAfterRemoveRow(t,n)}),this.addHook("afterCreateRow",function(t,n){return e.onAfterCreateRow(t,n)}),this.addHook("init",function(){return e.onInit()}),this.registerEvents(),"undefined"!=typeof o?this.rowPositions=o:Array.isArray(n)?this.rowPositions=n:n&&void 0!==this.rowPositions||(this.rowPositions=[]),$traceurRuntime.superGet(this,E.prototype,"enablePlugin").call(this)},updatePlugin:function(){this.disablePlugin(),this.enablePlugin(),$traceurRuntime.superGet(this,E.prototype,"updatePlugin").call(this)},disablePlugin:function(){var e=this.hot.getSettings().manualRowMove;Array.isArray(e)&&(this.unregisterEvents(),this.rowPositions=[]),$traceurRuntime.superGet(this,E.prototype,"disablePlugin").call(this)},registerEvents:function(){var e=this;this.eventManager.addEventListener(this.hot.rootElement,"mouseover",function(t){return e.onMouseOver(t)}),this.eventManager.addEventListener(this.hot.rootElement,"mousedown",function(t){return e.onMouseDown(t)}),this.eventManager.addEventListener(window,"mousemove",function(t){return e.onMouseMove(t)}),this.eventManager.addEventListener(window,"mouseup",function(t){return e.onMouseUp(t)})},unregisterEvents:function(){this.eventManager.clear()},saveManualRowPositions:function(){Handsontable.hooks.run(this.hot,"persistentStateSave","manualRowPositions",this.rowPositions)},loadManualRowPositions:function(){var e={};return Handsontable.hooks.run(this.hot,"persistentStateLoad","manualRowPositions",e),e.value},completeSettingsArray:function(){var e=this,t=this.hot.countRows();this.rowPositions.length!==t&&w(0,t-1,function(t){-1===e.rowPositions.indexOf(t)&&e.rowPositions.push(t)})},setupHandlePosition:function(e){var t=_.get(this),n=this.hot.view.wt.wtTable.getCoords(e).row;if(this.currentTH=e,n>=0){var o=this.currentTH.getBoundingClientRect();t.currentRow=n,t.startOffset=o.top,this.handleElement.style.top=t.startOffset+"px",this.handleElement.style.left=o.left+"px",this.hot.rootElement.appendChild(this.handleElement)}},refreshHandlePosition:function(e,t){var n=e.getBoundingClientRect(),o=6;t>0?this.handleElement.style.top=n.top+n.height-o+"px":this.handleElement.style.top=n.top+"px"},setupGuidePosition:function(){var e=this.currentTH.getBoundingClientRect(),t=_.get(this);h(this.handleElement,"active"),h(this.guideElement,"active"),this.guideElement.style.height=e.height+"px",this.guideElement.style.width=this.hot.view.maximumVisibleElementWidth(0)+"px",this.guideElement.style.top=t.startOffset+"px",this.guideElement.style.left=this.handleElement.style.left,this.hot.rootElement.appendChild(this.guideElement)},refreshGuidePosition:function(e){var t=_.get(this);this.guideElement.style.top=t.startOffset+e+"px"},hideHandleAndGuide:function(){p(this.handleElement,"active"),p(this.guideElement,"active")},checkRowHeader:function(e){if(e!=this.hot.rootElement){var t=e.parentNode;return"TBODY"===t.tagName?!0:this.checkRowHeader(t)}return!1},createPositionData:function(e){var t=this.rowPositions;t.lengththis.rowPositions.length-1&&this.createPositionData(n+1),this.rowPositions.splice(t,0,this.rowPositions.splice(e,1)[0])},getVisibleRowIndex:function(e){return e>this.rowPositions.length-1&&this.createPositionData(e),this.rowPositions.indexOf(e)},getLogicalRowIndex:function(e){return this.rowPositions[e]},onMouseOver:function(e){var t=_.get(this);if(this.checkRowHeader(e.target)){var n=this.getTHFromTargetElement(e.target);n&&(t.pressed?(t.endRow=this.hot.view.wt.wtTable.getCoords(n).row,this.refreshHandlePosition(n,t.endRow-t.startRow)):this.setupHandlePosition(n))}},onMouseDown:function(e){var t=_.get(this);f(e.target,t.handleClassName)&&(t.startY=C(e),this.setupGuidePosition(),t.pressed=this.hot,t.startRow=t.currentRow,t.endRow=t.currentRow)},onMouseMove:function(e){var t=_.get(this);t.pressed&&this.refreshGuidePosition(C(e)-t.startY)},onMouseUp:function(e){var t=_.get(this);t.pressed&&(this.hideHandleAndGuide(),t.pressed=!1,this.createPositionData(this.hot.countRows()),this.changeRowPositions(t.startRow,t.endRow),Handsontable.hooks.run(this.hot,"beforeRowMove",t.startRow,t.endRow),this.hot.forceFullRender=!0,this.hot.view.render(),this.saveManualRowPositions(),Handsontable.hooks.run(this.hot,"afterRowMove",t.startRow,t.endRow),this.setupHandlePosition(this.currentTH))},onModifyRow:function(e){return"undefined"==typeof this.getVisibleRowIndex(e)&&this.createPositionData(e+1),this.getLogicalRowIndex(e)},onAfterRemoveRow:function(e,t){if(this.isEnabled()){var n,o=this.rowPositions;n=o.splice(e,t),o=v(o,function(e,t){var o=e;return m(n,function(t,n){e>t&&o--}),o}),this.rowPositions=o}},onAfterCreateRow:function(e,t){if(this.isEnabled()){var n=this.rowPositions;if(n.length){for(var o=[],i=0;t>i;i++)o.push(e+i);e>=n.length?n.concat(o):(n=v(n,function(n,o){return n>=e?n+t:n}),n.splice.apply(n,[e,0].concat(o))),this.rowPositions=n}}},onInit:function(){this.completeSettingsArray()}},{},c),R("ManualRowMove",S),Handsontable.hooks.register("beforeRowMove"),Handsontable.hooks.register("afterRowMove")},{"_base.js":59,eventManager:41,"helpers/array":42,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/number":50,plugins:58}],81:[function(e,t,n){"use strict";Object.defineProperties(n,{ManualRowResize:{get:function(){return v}},__esModule:{value:!0}});var o,i,r,s,a,l=(o=e("_base.js"),o&&o.__esModule&&o||{"default":o})["default"],u=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),c=u.addClass,d=u.hasClass,h=u.removeClass,f=(r=e("eventManager"),r&&r.__esModule&&r||{"default":r}).eventManager,p=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),g=(p.pageX,p.pageY),m=(a=e("plugins"),a&&a.__esModule&&a||{"default":a}).registerPlugin,v=function(e){$traceurRuntime.superConstructor(w).call(this,e),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=f(this),this.pressed=null,this.dblclick=0,this.autoresizeTimeout=null,this.manualRowHeights=[],c(this.handle,"manualRowResizer"),c(this.guide,"manualRowResizerGuide")},w=v;$traceurRuntime.createClass(v,{isEnabled:function(){return this.hot.getSettings().manualRowResize},enablePlugin:function(){var e=this;if(!this.enabled){this.manualRowHeights=[];var t=this.hot.getSettings().manualRowResize,n=this.loadManualRowHeights();"undefined"!=typeof n?this.manualRowHeights=n:Array.isArray(t)?this.manualRowHeights=t:this.manualRowHeights=[],this.addHook("modifyRowHeight",function(t,n){return e.onModifyRowHeight(t,n)}),Handsontable.hooks.register("beforeRowResize"),Handsontable.hooks.register("afterRowResize"),this.bindEvents(),$traceurRuntime.superGet(this,w.prototype,"enablePlugin").call(this)}},updatePlugin:function(){var e=this.hot.getSettings().manualRowResize;Array.isArray(e)?this.manualRowHeights=e:e||(this.manualRowHeights=[])},disablePlugin:function(){$traceurRuntime.superGet(this,w.prototype,"disablePlugin").call(this)},saveManualRowHeights:function(){this.hot.runHooks("persistentStateSave","manualRowHeights",this.manualRowHeights)},loadManualRowHeights:function(){var e={};return this.hot.runHooks("persistentStateLoad","manualRowHeights",e),e.value},setupHandlePosition:function(e){this.currentTH=e;var t=this.hot.view.wt.wtTable.getCoords(e).row;if(t>=0){var n=this.currentTH.getBoundingClientRect();this.currentRow=t,this.startOffset=n.top-6,this.startHeight=parseInt(n.height,10),this.handle.style.left=n.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(){c(this.handle,"active"),c(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(){h(this.handle,"active"),h(this.guide,"active")},checkIfRowHeader:function(e){if(e!=this.hot.rootElement){var t=e.parentNode;return"TBODY"===t.tagName?!0:this.checkIfRowHeader(t)}return!1},getTHFromTargetElement:function(e){return"TABLE"!=e.tagName?"TH"==e.tagName?e:this.getTHFromTargetElement(e.parentNode):null},onMouseOver:function(e){if(this.checkIfRowHeader(e.target)){var t=this.getTHFromTargetElement(e.target);t&&(this.pressed||this.setupHandlePosition(t))}},afterMouseDownTimeout:function(){if(this.dblclick>=2){var e=this.hot.runHooks("beforeRowResize",this.currentRow,this.newSize,!0);void 0!==e&&(this.newSize=e),this.setManualSize(this.currentRow,this.newSize),this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.wt.wtOverlays.adjustElementsSize(!0),this.hot.runHooks("afterRowResize",this.currentRow,this.newSize,!0)}this.dblclick=0,this.autoresizeTimeout=null},onMouseDown:function(e){var t=this;d(e.target,"manualRowResizer")&&(this.setupGuidePosition(),this.pressed=this.hot,null==this.autoresizeTimeout&&(this.autoresizeTimeout=setTimeout(function(){return t.afterMouseDownTimeout()},500),this.hot._registerTimeout(this.autoresizeTimeout)),this.dblclick++,this.startY=g(e),this.newSize=this.startHeight)},onMouseMove:function(e){this.pressed&&(this.currentHeight=this.startHeight+(g(e)-this.startY),this.newSize=this.setManualSize(this.currentRow,this.currentHeight),this.refreshHandlePosition(),this.refreshGuidePosition())},onMouseUp:function(e){this.pressed&&(this.hideHandleAndGuide(),this.pressed=!1,this.newSize!=this.startHeight&&(this.hot.runHooks("beforeRowResize",this.currentRow,this.newSize),this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.wt.wtOverlays.adjustElementsSize(!0),this.saveManualRowHeights(),this.hot.runHooks("afterRowResize",this.currentRow,this.newSize)),this.setupHandlePosition(this.currentTH))},bindEvents:function(){var e=this;this.eventManager.addEventListener(this.hot.rootElement,"mouseover",function(t){return e.onMouseOver(t)}),this.eventManager.addEventListener(this.hot.rootElement,"mousedown",function(t){return e.onMouseDown(t)}),this.eventManager.addEventListener(window,"mousemove",function(t){return e.onMouseMove(t)}),this.eventManager.addEventListener(window,"mouseup",function(t){return e.onMouseUp(t)})},setManualSize:function(e,t){return e=this.hot.runHooks("modifyRow",e),this.manualRowHeights[e]=t,t},onModifyRowHeight:function(e,t){if(this.enabled){var n=this.hot.getPlugin("autoRowSize"),o=n?n.heights[t]:null;t=this.hot.runHooks("modifyRow",t);var i=this.manualRowHeights[t];if(void 0!==i&&(i===o||i>(e||0)))return i}return e}},{},l),m("manualRowResize",v)},{"_base.js":59,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,plugins:58}],82:[function(e,t,n){"use strict";function o(){var e=[];return e.getInfo=function(e,t){for(var n=0,o=this.length;o>n;n++)if(this[n].row<=e&&this[n].row+this[n].rowspan-1>=e&&this[n].col<=t&&this[n].col+this[n].colspan-1>=t)return this[n]},e.setInfo=function(e){for(var t=0,n=this.length;n>t;t++)if(this[t].row===e.row&&this[t].col===e.col)return void(this[t]=e);this.push(e)},e.removeInfo=function(e,t){for(var n=0,o=this.length;o>n;n++)if(this[n].row===e&&this[n].col===t){this.splice(n,1);break}},e}function i(e){if(this.mergedCellInfoCollection=new o,Array.isArray(e))for(var t=0,n=e.length;n>t;t++)this.mergedCellInfoCollection.setInfo(e[t])}function r(e,t){var n=this.getSettings().mergeCells;if(n&&!this.selection.isMultiple()){var o=this.mergeCells.mergedCellInfoCollection.getInfo(e[0],e[1]);o&&(e[0]=o.row,e[1]=o.col,e[2]=o.row+o.rowspan-1,e[3]=o.col+o.colspan-1)}}function s(e,t){this.mergeCells&&this.mergeCells.shiftCollection("right",e,t)}function a(e,t){this.mergeCells&&this.mergeCells.shiftCollection("left",e,t)}function l(e,t){this.mergeCells&&this.mergeCells.shiftCollection("down",e,t)}function u(e,t){this.mergeCells&&this.mergeCells.shiftCollection("up",e,t)}Object.defineProperties(n,{MergeCells:{get:function(){return i}},__esModule:{value:!0}});var c,d,h,f,p,g=((c=e("plugins"),c&&c.__esModule&&c||{"default":c}).registerPlugin,(d=e("helpers/dom/event"),d&&d.__esModule&&d||{"default":d}).stopImmediatePropagation),m=(h=e("3rdparty/walkontable/src/cell/coords"),h&&h.__esModule&&h||{"default":h}).WalkontableCellCoords,v=(f=e("3rdparty/walkontable/src/cell/range"),f&&f.__esModule&&f||{"default":f}).WalkontableCellRange,w=(p=e("3rdparty/walkontable/src/table"),p&&p.__esModule&&p||{"default":p}).WalkontableTable;i.prototype.canMergeRange=function(e){return!e.isSingle()},i.prototype.mergeRange=function(e){if(this.canMergeRange(e)){var t=e.getTopLeftCorner(),n=e.getBottomRightCorner(),o={};o.row=t.row,o.col=t.col,o.rowspan=n.row-t.row+1,o.colspan=n.col-t.col+1,this.mergedCellInfoCollection.setInfo(o)}},i.prototype.mergeOrUnmergeSelection=function(e){var t=this.mergedCellInfoCollection.getInfo(e.from.row,e.from.col);t?this.unmergeSelection(e.from):this.mergeSelection(e)},i.prototype.mergeSelection=function(e){this.mergeRange(e)},i.prototype.unmergeSelection=function(e){var t=this.mergedCellInfoCollection.getInfo(e.row,e.col);this.mergedCellInfoCollection.removeInfo(t.row,t.col)},i.prototype.applySpanProperties=function(e,t,n){var o=this.mergedCellInfoCollection.getInfo(t,n);o?o.row===t&&o.col===n?(e.setAttribute("rowspan",o.rowspan),e.setAttribute("colspan",o.colspan)):(e.removeAttribute("rowspan"),e.removeAttribute("colspan"),e.style.display="none"):(e.removeAttribute("rowspan"),e.removeAttribute("colspan"))},i.prototype.modifyTransform=function(e,t,n){var o=function(e,t){return t.row>=e.row&&t.row<=e.row+e.rowspan-1},i=function(e,t){return t.col>=e.col&&t.col<=e.col+e.colspan-1},r=function(e){return new m(t.to.row+e.row,t.to.col+e.col)},s={row:n.row,col:n.col};if("modifyTransformStart"==e){this.lastDesiredCoords||(this.lastDesiredCoords=new m(null,null));for(var a,l=new m(t.highlight.row,t.highlight.col),u=this.mergedCellInfoCollection.getInfo(l.row,l.col),c=0,d=this.mergedCellInfoCollection.length;d>c;c++){var h=this.mergedCellInfoCollection[c];if(h=new m(h.row+h.rowspan-1,h.col+h.colspan-1),t.includes(h)){a=!0;break}}if(u){var f=new m(u.row,u.col),p=new m(u.row+u.rowspan-1,u.col+u.colspan-1),g=new v(f,f,p);g.includes(this.lastDesiredCoords)||(this.lastDesiredCoords=new m(null,null)),s.row=this.lastDesiredCoords.row?this.lastDesiredCoords.row-l.row:s.row,s.col=this.lastDesiredCoords.col?this.lastDesiredCoords.col-l.col:s.col,n.row>0?s.row=u.row+u.rowspan-1-l.row+n.row:n.row<0&&(s.row=l.row-u.row+n.row),n.col>0?s.col=u.col+u.colspan-1-l.col+n.col:n.col<0&&(s.col=l.col-u.col+n.col)}var w=new m(t.highlight.row+s.row,t.highlight.col+s.col),y=this.mergedCellInfoCollection.getInfo(w.row,w.col);y&&(this.lastDesiredCoords=w,s={row:y.row-l.row,col:y.col-l.col})}else if("modifyTransformEnd"==e)for(var c=0,d=this.mergedCellInfoCollection.length;d>c;c++){var b=this.mergedCellInfoCollection[c],f=new m(b.row,b.col),p=new m(b.row+b.rowspan-1,b.col+b.colspan-1),C=new v(f,f,p),R=t.getBordersSharedWith(C);if(C.isEqual(t))t.setDirection("NW-SE");else if(R.length>0){var _=t.highlight.isEqual(C.from);R.indexOf("top")>-1?t.to.isSouthEastOf(C.from)&&_?t.setDirection("NW-SE"):t.to.isSouthWestOf(C.from)&&_&&t.setDirection("NE-SW"):R.indexOf("bottom")>-1&&(t.to.isNorthEastOf(C.from)&&_?t.setDirection("SW-NE"):t.to.isNorthWestOf(C.from)&&_&&t.setDirection("SE-NW"))}var w=r(s),S=o(b,w),E=i(b,w);t.includesRange(C)&&(C.includes(w)||S||E)&&(S&&(s.row<0?s.row-=b.rowspan-1:s.row>0&&(s.row+=b.rowspan-1)),E&&(s.col<0?s.col-=b.colspan-1:s.col>0&&(s.col+=b.colspan-1)))}0!==s.row&&(n.row=s.row),0!==s.col&&(n.col=s.col)},i.prototype.shiftCollection=function(e,t,n){var o=[0,0];switch(e){case"right":o[0]+=1;break;case"left":o[0]-=1;break;case"down":o[1]+=1;break;case"up":o[1]-=1}for(var i=0;in;n++)e.mergeCells.mergedCellInfoCollection.setInfo(t[n])}else e.mergeCells=new i(t);else e.mergeCells&&(e.mergeCells.mergedCellInfoCollection=new o)},R=function(e){if(this.mergeCells){var t=(e.ctrlKey||e.metaKey)&&!e.altKey;t&&77===e.keyCode&&(this.mergeCells.mergeOrUnmergeSelection(this.getSelectedRange()),this.render(),g(e))}},_=function(e){this.getSettings().mergeCells&&(e.items.push(Handsontable.plugins.ContextMenu.SEPARATOR),e.items.push({key:"mergeCells",name:function(){var e=this.getSelected(),t=this.mergeCells.mergedCellInfoCollection.getInfo(e[0],e[1]);return t?"Unmerge cells":"Merge cells"},callback:function(){this.mergeCells.mergeOrUnmergeSelection(this.getSelectedRange()),this.render()},disabled:function(){return!1}}))},S=function(e,t,n,o,i,r){this.mergeCells&&this.mergeCells.applySpanProperties(e,t,n)},E=function(e){return function(t){var n=this.getSettings().mergeCells;if(n){var o=this.getSelectedRange();if(this.mergeCells.modifyTransform(e,o,t),"modifyTransformEnd"===e){var i=this.countRows(),r=this.countCols();o.from.row<0?o.from.row=0:o.from.row>0&&o.from.row>=i&&(o.from.row=o.from-1),o.from.col<0?o.from.col=0:o.from.col>0&&o.from.col>=r&&(o.from.col=r-1)}}}},T=function(e){this.lastDesiredCoords=null;var t=this.getSettings().mergeCells;if(t){var n=this.getSelectedRange();n.highlight=new m(n.highlight.row,n.highlight.col),n.to=e;var o=!1;do{o=!1;for(var i=0,r=this.mergeCells.mergedCellInfoCollection.length;r>i;i++){var s=this.mergeCells.mergedCellInfoCollection[i],a=new m(s.row,s.col),l=new m(s.row+s.rowspan-1,s.col+s.colspan-1),u=new v(a,a,l);n.expandByRange(u)&&(e.row=n.to.row,e.col=n.to.col,o=!0)}}while(o)}},M=function(e,t){if(t&&"area"==t){var n=this.getSettings().mergeCells;if(n)for(var o=this.getSelectedRange(),i=new v(o.from,o.from,o.from),r=new v(o.to,o.to,o.to),s=0,a=this.mergeCells.mergedCellInfoCollection.length;a>s;s++){var l=this.mergeCells.mergedCellInfoCollection[s],u=new m(l.row,l.col),c=new m(l.row+l.rowspan-1,l.col+l.colspan-1),d=new v(u,u,c);i.expandByRange(d)&&(e[0]=i.from.row,e[1]=i.from.col),r.expandByRange(d)&&(e[2]=r.from.row,e[3]=r.from.col)}}},O=function(e,t,n){var o=this.getSettings().mergeCells;if(o){var i=this.mergeCells.mergedCellInfoCollection.getInfo(e,t);!i||i.row==e&&i.col==t||(n.copyable=!1)}},k=function(e){var t=this.getSettings().mergeCells;if(t)for(var n,o=this.countCols(),i=0;o>i;i++){if(n=this.mergeCells.mergedCellInfoCollection.getInfo(e.startRow,i),n&&n.rowe.endRow)return e.endRow=r,k.call(this,e)}}},H=function(e){var t=this.getSettings().mergeCells;if(t)for(var n,o=this.countRows(),i=0;o>i;i++){if(n=this.mergeCells.mergedCellInfoCollection.getInfo(i,e.startColumn),n&&n.cole.endColumn)return e.endColumn=r,H.call(this,e)}}},D=function(e){if(e&&this.mergeCells){var t=this.mergeCells.mergedCellInfoCollection,n=this.getSelectedRange();for(var o in t)if(n.highlight.row==t[o].row&&n.highlight.col==t[o].col&&n.to.row==t[o].row+t[o].rowspan-1&&n.to.col==t[o].col+t[o].colspan-1)return!1}return e};Handsontable.hooks.add("beforeInit",y),Handsontable.hooks.add("afterInit",b),Handsontable.hooks.add("afterUpdateSettings",C),Handsontable.hooks.add("beforeKeyDown",R),Handsontable.hooks.add("modifyTransformStart",E("modifyTransformStart")),Handsontable.hooks.add("modifyTransformEnd",E("modifyTransformEnd")),Handsontable.hooks.add("beforeSetRangeEnd",T),Handsontable.hooks.add("beforeDrawBorders",M),Handsontable.hooks.add("afterIsMultipleSelection",D),Handsontable.hooks.add("afterRenderer",S),Handsontable.hooks.add("afterContextMenuDefaultOptions",_),Handsontable.hooks.add("afterGetCellMeta",O),Handsontable.hooks.add("afterViewportRowCalculatorOverride",k),Handsontable.hooks.add("afterViewportColumnCalculatorOverride",H),Handsontable.hooks.add("afterAutofillApplyValues",r),Handsontable.hooks.add("afterCreateCol",s),Handsontable.hooks.add("afterRemoveCol",a),Handsontable.hooks.add("afterCreateRow",l),Handsontable.hooks.add("afterRemoveRow",u),Handsontable.MergeCells=i},{"3rdparty/walkontable/src/cell/coords":5,"3rdparty/walkontable/src/cell/range":6,"3rdparty/walkontable/src/table":20,"helpers/dom/event":46,plugins:58}],83:[function(e,t,n){"use strict";Object.defineProperties(n,{MultipleSelectionHandles:{get:function(){return p}},__esModule:{value:!0}});var o,i,r,s,a=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),l=a.getWindowScrollTop,u=a.hasClass,c=a.getWindowScrollLeft,d=(i=e("_base"),i&&i.__esModule&&i||{"default":i})["default"],h=(r=e("eventManager"),r&&r.__esModule&&r||{"default":r}).EventManager,f=(s=e("plugins"),s&&s.__esModule&&s||{"default":s}).registerPlugin,p=function(e){$traceurRuntime.superConstructor(g).call(this,e),this.dragged=[],this.eventManager=null,this.lastSetCell=null},g=p;$traceurRuntime.createClass(p,{isEnabled:function(){return Handsontable.mobileBrowser},enablePlugin:function(){this.enabled||(this.eventManager||(this.eventManager=new h(this)),this.registerListeners(),$traceurRuntime.superGet(this,g.prototype,"enablePlugin").call(this))},registerListeners:function(){function e(e){if(1===t.dragged.length)return t.dragged.splice(0,t.dragged.length),!0;var n=t.dragged.indexOf(e);return-1==n?!1:void(0===n?t.dragged=t.dragged.slice(0,1):1==n&&(t.dragged=t.dragged.slice(-1)))}var t=this;this.eventManager.addEventListener(this.hot.rootElement,"touchstart",function(e){var n;return u(e.target,"topLeftSelectionHandle-HitArea")?(n=t.hot.getSelectedRange(),t.dragged.push("topLeft"),t.touchStartRange={width:n.getWidth(),height:n.getHeight(),direction:n.getDirection()},e.preventDefault(),!1):u(e.target,"bottomRightSelectionHandle-HitArea")?(n=t.hot.getSelectedRange(),t.dragged.push("bottomRight"),t.touchStartRange={width:n.getWidth(),height:n.getHeight(),direction:n.getDirection()},e.preventDefault(),!1):void 0}),this.eventManager.addEventListener(this.hot.rootElement,"touchend",function(n){return u(n.target,"topLeftSelectionHandle-HitArea")?(e.call(t,"topLeft"),t.touchStartRange=void 0,n.preventDefault(),!1):u(n.target,"bottomRightSelectionHandle-HitArea")?(e.call(t,"bottomRight"),t.touchStartRange=void 0,n.preventDefault(),!1):void 0}),this.eventManager.addEventListener(this.hot.rootElement,"touchmove",function(e){var n,o,i,r,s,a,u,d=l(),h=c();0!==t.dragged.length&&(n=document.elementFromPoint(e.touches[0].screenX-h,e.touches[0].screenY-d),n&&n!==t.lastSetCell&&("TD"!=n.nodeName&&"TH"!=n.nodeName||(o=t.hot.getCoords(n),-1==o.col&&(o.col=0),i=t.hot.getSelectedRange(),r=i.getWidth(),s=i.getHeight(),a=i.getDirection(),1==r&&1==s&&t.hot.selection.setRangeEnd(o),u=t.getCurrentRangeCoords(i,o,t.touchStartRange.direction,a,t.dragged[0]),null!==u.start&&t.hot.selection.setRangeStart(u.start),t.hot.selection.setRangeEnd(u.end),t.lastSetCell=n),e.preventDefault()))})},getCurrentRangeCoords:function(e,t,n,o,i){var r=e.getTopLeftCorner(),s=e.getBottomRightCorner(),a=e.getBottomLeftCorner(),l=e.getTopRightCorner(),u={start:null,end:null};switch(n){case"NE-SW":switch(o){case"NE-SW":case"NW-SE":u="topLeft"==i?{start:new WalkontableCellCoords(t.row,e.highlight.col),end:new WalkontableCellCoords(a.row,t.col)}:{start:new WalkontableCellCoords(e.highlight.row,t.col),end:new WalkontableCellCoords(t.row,r.col)};break;case"SE-NW":"bottomRight"==i&&(u={start:new WalkontableCellCoords(s.row,t.col),end:new WalkontableCellCoords(t.row,r.col)})}break;case"NW-SE":switch(o){case"NE-SW":"topLeft"==i?u={start:t,end:a}:u.end=t;break;case"NW-SE":"topLeft"==i?u={start:t,end:s}:u.end=t;break;case"SE-NW":"topLeft"==i?u={start:t,end:r}:u.end=t;break;case"SW-NE":"topLeft"==i?u={start:t,end:l}:u.end=t}break;case"SW-NE":switch(o){case"NW-SE":u="bottomRight"==i?{start:new WalkontableCellCoords(t.row,r.col),end:new WalkontableCellCoords(a.row,t.col)}:{start:new WalkontableCellCoords(r.row,t.col),end:new WalkontableCellCoords(t.row,s.col)};break;case"SW-NE":u="topLeft"==i?{start:new WalkontableCellCoords(e.highlight.row,t.col),end:new WalkontableCellCoords(t.row,s.col)}:{start:new WalkontableCellCoords(t.row,r.col),end:new WalkontableCellCoords(r.row,t.col)};break;case"SE-NW":"bottomRight"==i?u={start:new WalkontableCellCoords(t.row,l.col),end:new WalkontableCellCoords(r.row,t.col)}:"topLeft"==i&&(u={start:a,end:t})}break;case"SE-NW":switch(o){case"NW-SE":case"NE-SW":case"SW-NE":"topLeft"==i&&(u.end=t);break;case"SE-NW":"topLeft"==i?u.end=t:u={start:t,end:r}}}return u},isDragged:function(){return this.dragged.length>0}},{},d),f("multipleSelectionHandles",p)},{_base:59,eventManager:41,"helpers/dom/element":45,plugins:58}],84:[function(e,t,n){"use strict";Object.defineProperties(n,{DataObserver:{get:function(){return d}},__esModule:{value:!0}});var o,i,r,s,a=(o=e("jsonpatch"),o&&o.__esModule&&o||{"default":o})["default"],l=(i=e("../../mixins/localHooks"),i&&i.__esModule&&i||{"default":i}).localHooks,u=(r=e("../../helpers/object"),r&&r.__esModule&&r||{"default":r}).mixin,c=(s=e("utils"),s&&s.__esModule&&s||{"default":s}).cleanPatches,d=function(e){this.observedData=null,this.observer=null,this.paused=!1,this.setObservedData(e)};$traceurRuntime.createClass(d,{setObservedData:function(e){var t=this;this.observer&&a.unobserve(this.observedData,this.observer),this.observedData=e,this.observer=a.observe(this.observedData,function(e){return t.onChange(e)})},isPaused:function(){return this.paused},pause:function(){this.paused=!0},resume:function(){this.paused=!1},onChange:function(e){this.runLocalHooks("change",c(e))},destroy:function(){a.unobserve(this.observedData,this.observer),this.observedData=null,this.observer=null}},{}),u(d,l)},{"../../helpers/object":51,"../../mixins/localHooks":55,jsonpatch:"jsonpatch",utils:86}],85:[function(e,t,n){"use strict";Object.defineProperties(n,{ObserveChanges:{get:function(){return h}},__esModule:{value:!0}});var o,i,r,s,a,l=(o=e("_base"),o&&o.__esModule&&o||{"default":o})["default"],u=((i=e("jsonpatch"),i&&i.__esModule&&i||{"default":i})["default"],(r=e("dataObserver"),r&&r.__esModule&&r||{"default":r}).DataObserver),c=(s=e("helpers/array"),s&&s.__esModule&&s||{"default":s}).arrayEach,d=(a=e("plugins"),a&&a.__esModule&&a||{"default":a}).registerPlugin;Handsontable.hooks.register("afterChangesObserved");var h=function(e){$traceurRuntime.superConstructor(f).call(this,e),this.observer=null},f=h;$traceurRuntime.createClass(h,{isEnabled:function(){return this.hot.getSettings().observeChanges},enablePlugin:function(){var e=this;this.enabled||(this.observer||(this.observer=new u(this.hot.getSourceData()),this._exposePublicApi()),this.observer.addLocalHook("change",function(t){return e.onDataChange(t)}),this.addHook("afterCreateRow",function(){return e.onAfterTableAlter()}),this.addHook("afterRemoveRow",function(){return e.onAfterTableAlter()}),this.addHook("afterCreateCol",function(){return e.onAfterTableAlter()}),this.addHook("afterRemoveCol",function(){return e.onAfterTableAlter()}),this.addHook("afterChange",function(t,n){return e.onAfterTableAlter(n)}),this.addHook("afterLoadData",function(t){return e.onAfterLoadData(t)}),$traceurRuntime.superGet(this,f.prototype,"enablePlugin").call(this))},disablePlugin:function(){this.observer&&(this.observer.destroy(),this.observer=null,this._deletePublicApi()),$traceurRuntime.superGet(this,f.prototype,"disablePlugin").call(this); +},onDataChange:function(e){var t=this;if(!this.observer.isPaused()){var n={add:function(e){isNaN(e.col)?t.hot.runHooks("afterCreateRow",e.row):t.hot.runHooks("afterCreateCol",e.col)},remove:function(e){isNaN(e.col)?t.hot.runHooks("afterRemoveRow",e.row,1):t.hot.runHooks("afterRemoveCol",e.col,1)},replace:function(e){t.hot.runHooks("afterChange",[e.row,e.col,null,e.value],"external")}};c(e,function(e){n[e.op]&&n[e.op](e)}),this.hot.render()}this.hot.runHooks("afterChangesObserved")},onAfterTableAlter:function(e){var t=this;"loadData"!==e&&(this.observer.pause(),this.hot.addHookOnce("afterChangesObserved",function(){return t.observer.resume()}))},onAfterLoadData:function(e){e||this.observer.setObservedData(this.hot.getSourceData())},destroy:function(){this.observer&&(this.observer.destroy(),this._deletePublicApi()),$traceurRuntime.superGet(this,f.prototype,"destroy").call(this)},_exposePublicApi:function(){var e=this,t=this.hot;t.pauseObservingChanges=function(){return e.observer.pause()},t.resumeObservingChanges=function(){return e.observer.resume()},t.isPausedObservingChanges=function(){return e.observer.isPaused()}},_deletePublicApi:function(){var e=this.hot;delete e.pauseObservingChanges,delete e.resumeObservingChanges,delete e.isPausedObservingChanges}},{},l),d("observeChanges",h)},{_base:59,dataObserver:84,"helpers/array":42,jsonpatch:"jsonpatch",plugins:58}],86:[function(e,t,n){"use strict";function o(e){var t=[];return e=a(e,function(e){return/[\/]length/gi.test(e.path)?!1:!!i(e.path)}),e=l(e,function(e){var t=i(e.path);return e.row=t.row,e.col=t.col,e}),e=a(e,function(e){if(-1!==["add","remove"].indexOf(e.op)&&!isNaN(e.col)){if(-1!==t.indexOf(e.col))return!1;t.push(e.col)}return!0}),t.length=0,e}function i(e){var t=e.match(/^\/(\d+)\/?(.*)?$/);if(!t)return null;var n=t,o=n[1],i=n[2];return{row:parseInt(o,10),col:/^\d*$/.test(i)?parseInt(i,10):i}}Object.defineProperties(n,{cleanPatches:{get:function(){return o}},parsePath:{get:function(){return i}},__esModule:{value:!0}});var r,s=(r=e("../../helpers/array"),r&&r.__esModule&&r||{"default":r}),a=s.arrayFilter,l=s.arrayMap},{"../../helpers/array":42}],87:[function(e,t,n){"use strict";function o(e){var t,n=function(){window.localStorage[e+"__persistentStateKeys"]=JSON.stringify(t)},o=function(){var n=window.localStorage[e+"__persistentStateKeys"],o="string"==typeof n?JSON.parse(n):void 0;t=o?o:[]},i=function(){t=[],n()};o(),this.saveValue=function(o,i){window.localStorage[e+"_"+o]=JSON.stringify(i),-1==t.indexOf(o)&&(t.push(o),n())},this.loadValue=function(t,n){t="undefined"==typeof t?n:t;var o=window.localStorage[e+"_"+t];return"undefined"==typeof o?void 0:JSON.parse(o)},this.reset=function(t){window.localStorage.removeItem(e+"_"+t)},this.resetAll=function(){for(var n=0;na;a++)for(var l=0;r>l;l++){var u=e.getDataAtCell(a,l),c=e.getCellMeta(a,l),d=c.search.callback||n,h=c.search.queryMethod||o,f=h(t,u);if(f){var p={row:a,col:l,data:u};s.push(p)}d&&d(e,a,l,u,f)}return s}},Handsontable.Search.DEFAULT_CALLBACK=function(e,t,n,o,i){e.getCellMeta(t,n).isSearchResult=i},Handsontable.Search.DEFAULT_QUERY_METHOD=function(e,t){return"undefined"!=typeof e&&null!=e&&e.toLowerCase&&0!==e.length?"undefined"==typeof t||null==t?!1:-1!=t.toString().toLowerCase().indexOf(e.toLowerCase()):!1},Handsontable.Search.DEFAULT_SEARCH_RESULT_CLASS="htSearchResult",Handsontable.Search.global=function(){var e=Handsontable.Search.DEFAULT_CALLBACK,t=Handsontable.Search.DEFAULT_QUERY_METHOD,n=Handsontable.Search.DEFAULT_SEARCH_RESULT_CLASS;return{getDefaultCallback:function(){return e},setDefaultCallback:function(t){e=t},getDefaultQueryMethod:function(){return t},setDefaultQueryMethod:function(e){t=e},getDefaultSearchResultClass:function(){return n},setDefaultSearchResultClass:function(e){n=e}}}(),Handsontable.SearchCellDecorator=function(e,t,n,o,i,r,s){var u=null!==s.search&&"object"==typeof s.search&&s.search.searchResultClass||Handsontable.Search.global.getDefaultSearchResultClass();s.isSearchResult?a(t,u):l(t,u)};var h=d("base");c("base",function(e,t,n,o,i,r,s){h.apply(this,arguments),Handsontable.SearchCellDecorator.apply(this,arguments)}),Handsontable.hooks.add("afterInit",o),Handsontable.hooks.add("afterUpdateSettings",o)},{"helpers/dom/element":45,renderers:91}],89:[function(e,t,n){"use strict";Object.defineProperties(n,{TouchScroll:{get:function(){return d}},__esModule:{value:!0}});var o,i,r,s=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),a=s.addClass,l=s.removeClass,u=(i=e("_base"),i&&i.__esModule&&i||{"default":i})["default"],c=(r=e("plugins"),r&&r.__esModule&&r||{"default":r}).registerPlugin,d=function(e){var t=this;$traceurRuntime.superConstructor(h).call(this,e),this.hot.addHook("afterInit",function(){return t.afterInit()}),this.hot.addHook("afterUpdateSettings",function(){return t.onAfterUpdateSettings()}),this.scrollbars=[],this.clones=[]},h=d;$traceurRuntime.createClass(d,{afterInit:function(){this.registerEvents(),this.onAfterUpdateSettings()},onAfterUpdateSettings:function(){var e=this;this.hot.addHookOnce("afterRender",function(){var t=e.hot.view.wt.wtOverlays;e.scrollbars=[],e.scrollbars.push(t.topOverlay),t.bottomOverlay.clone&&e.scrollbars.push(t.bottomOverlay),e.scrollbars.push(t.leftOverlay),t.topLeftCornerOverlay&&e.scrollbars.push(t.topLeftCornerOverlay),t.bottomLeftCornerOverlay&&t.bottomLeftCornerOverlay.clone&&e.scrollbars.push(t.bottomLeftCornerOverlay),e.clones=[],t.topOverlay.needFullRender&&e.clones.push(t.topOverlay.clone.wtTable.holder.parentNode),t.bottomOverlay.needFullRender&&e.clones.push(t.bottomOverlay.clone.wtTable.holder.parentNode),t.leftOverlay.needFullRender&&e.clones.push(t.leftOverlay.clone.wtTable.holder.parentNode),t.topLeftCornerOverlay&&e.clones.push(t.topLeftCornerOverlay.clone.wtTable.holder.parentNode),t.bottomLeftCornerOverlay&&t.bottomLeftCornerOverlay.clone&&e.clones.push(t.bottomLeftCornerOverlay.clone.wtTable.holder.parentNode)})},registerEvents:function(){var e=this;this.hot.addHook("beforeTouchScroll",function(){return e.onBeforeTouchScroll()}),this.hot.addHook("afterMomentumScroll",function(){return e.onAfterMomentumScroll()})},onBeforeTouchScroll:function(){Handsontable.freezeOverlays=!0;for(var e=0,t=this.clones.length;t>e;e++)a(this.clones[e],"hide-tween")},onAfterMomentumScroll:function(){Handsontable.freezeOverlays=!1;for(var e=this,t=0,n=this.clones.length;n>t;t++)l(this.clones[t],"hide-tween");for(var o=0,i=this.clones.length;i>o;o++)a(this.clones[o],"show-tween");setTimeout(function(){for(var t=0,n=e.clones.length;n>t;t++)l(e.clones[t],"show-tween")},400);for(var r=0,s=this.scrollbars.length;s>r;r++)this.scrollbars[r].refresh(),this.scrollbars[r].resetFixedPosition();this.hot.view.wt.wtOverlays.syncScrollWithMaster()}},{},u),c("touchScroll",d)},{_base:59,"helpers/dom/element":45,plugins:58}],90:[function(e,t,n){"use strict";function o(){var e=this,t="undefined"==typeof e.getSettings().undo||e.getSettings().undo;t?e.undoRedo||(e.undoRedo=new Handsontable.UndoRedo(e),s(e),e.addHook("beforeKeyDown",i),e.addHook("afterChange",r)):e.undoRedo&&(delete e.undoRedo,a(e),e.removeHook("beforeKeyDown",i),e.removeHook("afterChange",r))}function i(e){var t=this,n=(e.ctrlKey||e.metaKey)&&!e.altKey;n&&(89===e.keyCode||e.shiftKey&&90===e.keyCode?(t.undoRedo.redo(),w(e)):90===e.keyCode&&(t.undoRedo.undo(),w(e)))}function r(e,t){var n=this;return"loadData"==t?n.undoRedo.clear():void 0}function s(e){e.undo=function(){return e.undoRedo.undo()},e.redo=function(){return e.undoRedo.redo()},e.isUndoAvailable=function(){return e.undoRedo.isUndoAvailable()},e.isRedoAvailable=function(){return e.undoRedo.isRedoAvailable()},e.clearUndo=function(){return e.undoRedo.clear()}}function a(e){delete e.undo,delete e.redo,delete e.isUndoAvailable,delete e.isRedoAvailable,delete e.clearUndo}var l,u,c,d,h=(l=e("helpers/array"),l&&l.__esModule&&l||{"default":l}).arrayMap,f=(u=e("helpers/number"),u&&u.__esModule&&u||{"default":u}),p=f.rangeEach,g=(f.rangeEachReverse,c=e("helpers/object"),c&&c.__esModule&&c||{"default":c}),m=g.inherit,v=g.deepClone,w=(d=e("helpers/dom/event"),d&&d.__esModule&&d||{"default":d}).stopImmediatePropagation;Handsontable.UndoRedo=function(e){var t=this;this.instance=e,this.doneActions=[],this.undoneActions=[],this.ignoreNewActions=!1,e.addHook("afterChange",function(e,n){if(e){var o=new Handsontable.UndoRedo.ChangeAction(e);t.done(o)}}),e.addHook("afterCreateRow",function(e,n,o){if(!o){var i=new Handsontable.UndoRedo.CreateRowAction(e,n);t.done(i)}}),e.addHook("beforeRemoveRow",function(e,n){var o=t.instance.getSourceData();e=(o.length+e)%o.length;var i=o.slice(e,e+n),r=new Handsontable.UndoRedo.RemoveRowAction(e,i);t.done(r)}),e.addHook("afterCreateCol",function(e,n,o){if(!o){var i=new Handsontable.UndoRedo.CreateColumnAction(e,n);t.done(i)}}),e.addHook("beforeRemoveCol",function(n,o){var i=t.instance.getData();n=(t.instance.countCols()+n)%t.instance.countCols();var r=[],s=[],a=[];p(0,i.length-1,function(e){r[e]=i[e].slice(n,n+o)}),p(0,o-1,function(t){a.push(e.runHooks("modifyCol",n+t))}),Array.isArray(e.getSettings().colHeaders)&&p(0,o-1,function(t){s.push(e.getSettings().colHeaders[e.runHooks("modifyCol",n+t)]||null)});var l=t.instance.getPlugin("manualColumnMove"),u=new Handsontable.UndoRedo.RemoveColumnAction(a,r,s,l?l.columnPositions:[]);t.done(u)}),e.addHook("beforeCellAlignment",function(e,n,o,i){var r=new Handsontable.UndoRedo.CellAlignmentAction(e,n,o,i);t.done(r)}),e.addHook("beforeFilter",function(e){t.done(new Handsontable.UndoRedo.FiltersAction(e))})},Handsontable.UndoRedo.prototype.done=function(e){this.ignoreNewActions||(this.doneActions.push(e),this.undoneActions.length=0)},Handsontable.UndoRedo.prototype.undo=function(){if(this.isUndoAvailable()){var e=this.doneActions.pop();this.ignoreNewActions=!0;var t=this;e.undo(this.instance,function(){t.ignoreNewActions=!1,t.undoneActions.push(e)})}},Handsontable.UndoRedo.prototype.redo=function(){if(this.isRedoAvailable()){var e=this.undoneActions.pop();this.ignoreNewActions=!0;var t=this;e.redo(this.instance,function(){t.ignoreNewActions=!1,t.doneActions.push(e)})}},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(e){this.changes=e},m(Handsontable.UndoRedo.ChangeAction,Handsontable.UndoRedo.Action),Handsontable.UndoRedo.ChangeAction.prototype.undo=function(e,t){for(var n=v(this.changes),o=e.countEmptyRows(!0),i=e.countEmptyCols(!0),r=0,s=n.length;s>r;r++)n[r].splice(3,1);e.addHookOnce("afterChange",t),e.setDataAtRowProp(n,null,null,"undo");for(var r=0,s=n.length;s>r;r++)e.getSettings().minSpareRows&&n[r][0]+1+e.getSettings().minSpareRows===e.countRows()&&o==e.getSettings().minSpareRows&&(e.alter("remove_row",parseInt(n[r][0]+1,10),e.getSettings().minSpareRows),e.undoRedo.doneActions.pop()),e.getSettings().minSpareCols&&n[r][1]+1+e.getSettings().minSpareCols===e.countCols()&&i==e.getSettings().minSpareCols&&(e.alter("remove_col",parseInt(n[r][1]+1,10),e.getSettings().minSpareCols),e.undoRedo.doneActions.pop())},Handsontable.UndoRedo.ChangeAction.prototype.redo=function(e,t){for(var n=v(this.changes),o=0,i=n.length;i>o;o++)n[o].splice(2,1);e.addHookOnce("afterChange",t),e.setDataAtRowProp(n,null,null,"redo")},Handsontable.UndoRedo.CreateRowAction=function(e,t){this.index=e,this.amount=t},m(Handsontable.UndoRedo.CreateRowAction,Handsontable.UndoRedo.Action),Handsontable.UndoRedo.CreateRowAction.prototype.undo=function(e,t){var n=e.countRows(),o=e.getSettings().minSpareRows;this.index>=n&&this.index-on;n++){if(m(t[n],T)&&null===e)return;h(t[n],e)}})}function h(e){var t=void 0!==arguments[1]?arguments[1]:null;null===t?e.checked=!e.checked:e.checked=t,y.fireEvent(e,"change")}function f(t){for(var n=e.getSelectedRange(),o=n.getTopLeftCorner(),i=n.getBottomRightCorner(),r=o.row;r<=i.row;r++)for(var s=o.col;s<=i.col;s++){var a=e.getCell(r,s),l=e.getCellMeta(r,s),u=a.querySelectorAll("input[type=checkbox]");u.length>0&&!l.readOnly&&t(u)}}var y=new w(e),b=i(),R=u.label,M=!1;if("undefined"==typeof u.checkedTemplate&&(u.checkedTemplate=!0),"undefined"==typeof u.uncheckedTemplate&&(u.uncheckedTemplate=!1),p(t),l===u.checkedTemplate||v(l,u.checkedTemplate)?b.checked=!0:l===u.uncheckedTemplate||v(l,u.uncheckedTemplate)?b.checked=!1:null===l?g(b,"noValue"):(b.style.display="none",g(b,T),M=!0),!M&&R){var O="";R.value?O="function"==typeof R.value?R.value.call(this,n,o,a,l):R.value:R.property&&(O=e.getDataAtRowProp(n,R.property));var k=r(O);"before"===R.position?k.appendChild(b):k.insertBefore(b,k.firstChild),b=k}t.appendChild(b),M&&t.appendChild(document.createTextNode("#bad-value#")),u.readOnly?y.addEventListener(b,"click",s):(y.addEventListener(b,"mouseup",function(){return setTimeout(e.listen,10)}),y.addEventListener(b,"change",function(t){e.setDataAtRowProp(n,a,t.target.checked?u.checkedTemplate:u.uncheckedTemplate)})),E.has(e)||(E.set(e,!0),e.addHook("beforeKeyDown",c))}function i(){var e=document.createElement("input");return e.className="htCheckboxRendererInput",e.type="checkbox",e.setAttribute("autocomplete","off"),e.setAttribute("tabindex","-1"),e.cloneNode(!1)}function r(e){var t=document.createElement("label");return t.className="htCheckboxRendererLabel",t.appendChild(document.createTextNode(e)),t.cloneNode(!0)}function s(e){e.preventDefault()}Object.defineProperties(n,{checkboxRenderer:{get:function(){return o}},__esModule:{value:!0}});var a,l,u,c,d,h,f=(a=e("helpers/dom/element"),a&&a.__esModule&&a||{"default":a}),p=f.empty,g=f.addClass,m=f.hasClass,v=(l=e("helpers/string"),l&&l.__esModule&&l||{"default":l}).equalsIgnoreCase,w=(u=e("eventManager"),u&&u.__esModule&&u||{"default":u}).EventManager,y=(c=e("renderers"),c&&c.__esModule&&c||{"default":c}),b=(y.getRenderer,y.registerRenderer),C=(d=e("helpers/unicode"),d&&d.__esModule&&d||{"default":d}).KEY_CODES,R=(h=e("helpers/dom/event"),h&&h.__esModule&&h||{"default":h}),_=(R.stopPropagation,R.stopImmediatePropagation),S=R.isImmediatePropagationStopped,E=new WeakMap,T="htBadValue";b("checkbox",o)},{eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/string":53,"helpers/unicode":54,renderers:91}],95:[function(e,t,n){"use strict";function o(e,t,n,o,i,r,a){l("base").apply(this,arguments),null!==r&&void 0!==r||(r=""),s(t,r)}Object.defineProperties(n,{htmlRenderer:{get:function(){return o}},__esModule:{value:!0}});var i,r,s=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}).fastInnerHTML,a=(r=e("renderers"),r&&r.__esModule&&r||{"default":r}),l=a.getRenderer,u=a.registerRenderer;u("html",o)},{"helpers/dom/element":45,renderers:91}],96:[function(e,t,n){"use strict";function o(e,t,n,o,i,r,s){f(r)&&("undefined"!=typeof s.language&&l.language(s.language),r=l(r).format(s.format||"0"),u(t,"htNumeric")),d("text")(e,t,n,o,i,r,s)}Object.defineProperties(n,{numericRenderer:{get:function(){return o}},__esModule:{value:!0}});var i,r,s,a,l=(i=e("numeral"),i&&i.__esModule&&i||{"default":i})["default"],u=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}).addClass,c=(s=e("renderers"),s&&s.__esModule&&s||{"default":s}),d=c.getRenderer,h=c.registerRenderer,f=(a=e("helpers/number"),a&&a.__esModule&&a||{"default":a}).isNumeric;h("numeric",o)},{"helpers/dom/element":45,"helpers/number":50,numeral:"numeral",renderers:91}],97:[function(e,t,n){"use strict";function o(e,t,n,o,i,r,a){l("text").apply(this,arguments),r=t.innerHTML;var u,c=a.hashLength||r.length,d=a.hashSymbol||"*";for(u="";u.split(d).length-1n&&(o.done=!1,o.value=e[n],++n),o}}});for(var s=r[t(Symbol.iterator)]();!(e=s.next()).done;)n[o++]=e.value}return n}var t=$traceurRuntime.toProperty;$traceurRuntime.spread=e}(),function(){function e(e,t){var n=g(e);do{var o=p(n,t);if(o)return o;n=g(n)}while(n)}function t(e){return e.__proto__}function n(e,t,n,i){return o(e,t,n).apply(e,i)}function o(t,n,o){var i=e(n,o);return i?i.get?i.get.call(t):i.value:void 0}function i(t,n,o,i){var r=e(n,o);if(r&&r.set)return r.set.call(t,i),i;throw c("super has no setter '"+o+"'.")}function r(e){for(var t={},n=w(e),o=0;o3?("function"==typeof o&&(e.__proto__=o),e.prototype=d(a(o),r(t))):e.prototype=t,f(e,"prototype",{configurable:!1,writable:!1}),h(e,r(n))}function a(e){if("function"==typeof e){var t=e.prototype;if(u(t)===t||null===t)return e.prototype;throw new c("super prototype must be an Object or null")}if(null===e)return null;throw new c("Super expression must either be null or a function, not "+typeof e+".")}function l(e,t,o){null!==g(t)&&n(e,t,"constructor",o)}var u=Object,c=TypeError,d=u.create,h=$traceurRuntime.defineProperties,f=$traceurRuntime.defineProperty,p=$traceurRuntime.getOwnPropertyDescriptor,g=Object.getPrototypeOf,m=$traceurRuntime.toProperty,v=Object,w=v.getOwnPropertyNames,y=v.getOwnPropertySymbols;$traceurRuntime.createClass=s,$traceurRuntime.defaultSuperCall=l,$traceurRuntime.superCall=n,$traceurRuntime.superConstructor=t,$traceurRuntime.superGet=o,$traceurRuntime.superSet=i}()},{}],100:[function(e,t,n){"use strict";function o(e){var t=this,n=this;this.eventManager=b(e),this.instance=e,this.settings=e.getSettings(),this.selectionMouseDown=!1;var o=e.rootElement.getAttribute("style");o&&e.rootElement.setAttribute("data-originalstyle",o),d(e.rootElement,"handsontable");var i=document.createElement("TABLE");d(i,"htCore"),e.getSettings().tableClassName&&d(i,e.getSettings().tableClassName),this.THEAD=document.createElement("THEAD"),i.appendChild(this.THEAD),this.TBODY=document.createElement("TBODY"),i.appendChild(this.TBODY),e.table=i,e.container.insertBefore(i,e.container.firstChild),this.eventManager.addEventListener(e.rootElement,"mousedown",function(e){this.selectionMouseDown=!0, +n.isTextSelectionAllowed(e.target)||(s(),e.preventDefault(),window.focus())}),this.eventManager.addEventListener(e.rootElement,"mouseup",function(e){this.selectionMouseDown=!1}),this.eventManager.addEventListener(e.rootElement,"mousemove",function(e){this.selectionMouseDown&&!n.isTextSelectionAllowed(e.target)&&(s(),e.preventDefault())}),this.eventManager.addEventListener(document.documentElement,"keyup",function(t){e.selection.isInProgress()&&!t.shiftKey&&e.selection.finish()});var r;this.isMouseDown=function(){return r},this.eventManager.addEventListener(document.documentElement,"mouseup",function(t){e.selection.isInProgress()&&1===t.which&&e.selection.finish(),r=!1,y(document.activeElement)&&e.unlisten()}),this.eventManager.addEventListener(document.documentElement,"mousedown",function(t){var o=t.target,i=t.x||t.clientX,s=t.y||t.clientY;if(!r&&e.rootElement){if(o===e.view.wt.wtTable.holder){var a=g();if(document.elementFromPoint(i+a,s)!==e.view.wt.wtTable.holder||document.elementFromPoint(i,s+a)!==e.view.wt.wtTable.holder)return}else for(;o!==document.documentElement;){if(null===o){if(t.isTargetWebComponent)break;return}if(o===e.rootElement)return;o=o.parentNode}n.settings.outsideClickDeselects?e.deselectCell():e.destroyEditor()}}),this.eventManager.addEventListener(i,"selectstart",function(e){n.settings.fragmentSelection||w(e.target)||e.preventDefault()});var s=function(){window.getSelection?window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges():document.selection&&document.selection.empty()},a=[new E({className:"current",border:{width:2,color:"#5292F7",cornerVisible:function(){return n.settings.fillHandle&&!n.isCellEdited()&&!e.selection.isMultiple()},multipleSelectionHandlesVisible:function(){return!n.isCellEdited()&&!e.selection.isMultiple()}}}),new E({className:"area",border:{width:1,color:"#89AFF9",cornerVisible:function(){return n.settings.fillHandle&&!n.isCellEdited()&&e.selection.isMultiple()},multipleSelectionHandlesVisible:function(){return!n.isCellEdited()&&e.selection.isMultiple()}}}),new E({className:"highlight",highlightRowClassName:n.settings.currentRowClassName,highlightColumnClassName:n.settings.currentColClassName}),new E({className:"fill",border:{width:1,color:"red"}})];a.current=a[0],a.area=a[1],a.highlight=a[2],a.fill=a[3];var l={debug:function(){return n.settings.debug},externalRowCalculator:this.instance.getPlugin("autoRowSize")&&this.instance.getPlugin("autoRowSize").isEnabled(),table:i,preventOverflow:function(){return t.settings.preventOverflow},stretchH:function(){return n.settings.stretchH},data:e.getDataAtCell,totalRows:function(){return e.countRows()},totalColumns:function(){return e.countCols()},fixedColumnsLeft:function(){return n.settings.fixedColumnsLeft},fixedRowsTop:function(){return n.settings.fixedRowsTop},fixedRowsBottom:function(){return n.settings.fixedRowsBottom},minSpareRows:function(){return n.settings.minSpareRows},renderAllRows:n.settings.renderAllRows,rowHeaders:function(){var t=[];return e.hasRowHeaders()&&t.push(function(e,t){n.appendRowHeader(e,t)}),Handsontable.hooks.run(e,"afterGetRowHeaderRenderers",t),t},columnHeaders:function(){var t=[];return e.hasColHeaders()&&t.push(function(e,t){n.appendColHeader(e,t)}),Handsontable.hooks.run(e,"afterGetColumnHeaderRenderers",t),t},columnWidth:e.getColWidth,rowHeight:e.getRowHeight,cellRenderer:function(e,t,o){var i=n.instance.colToProp(t),r=n.instance.getCellMeta(e,t),s=n.instance.getCellRenderer(r),a=n.instance.getDataAtRowProp(e,i);s(n.instance,o,e,t,i,a,r),Handsontable.hooks.run(n.instance,"afterRenderer",o,e,t,i,a,r)},selections:a,hideBorderOnMouseDownOver:function(){return n.settings.fragmentSelection},onCellMouseDown:function(t,o,i,s){var a,l,u=i.parentNode,c=u.parentNode;if(e.listen(),n.activeWt=s,r=!0,Handsontable.hooks.run(e,"beforeOnCellMouseDown",t,o,i),e.selection.setSelectedHeaders(!1,!1),!_(t)){if(2===t.button&&e.selection.inInSelection(o));else t.shiftKey?o.row>=0&&o.col>=0&&e.selection.setRangeEnd(o):(o.row<0||o.col<0)&&(o.row>=0||o.col>=0)?(o.row<0&&(a=c.childNodes.length-Array.prototype.indexOf.call(c.childNodes,u)-1,l=e.getHeaderColspan(o.col,a),e.selection.setSelectedHeaders(!1,!0),e.selectCell(0,o.col,e.countRows()-1,o.col+Math.max(0,l-1))),o.col<0&&(e.selection.setSelectedHeaders(!0,!1),e.selectCell(o.row,0,o.row,e.countCols()-1))):(o.row=o.row<0?0:o.row,o.col=o.col<0?0:o.col,e.selection.setRangeStart(o));Handsontable.hooks.run(e,"afterOnCellMouseDown",t,o,i),n.activeWt=n.wt}},onCellMouseOver:function(t,o,i,s){n.activeWt=s,o.row>=0&&o.col>=0?r&&e.selection.setRangeEnd(o):r&&(o.row<0&&(e.selection.selectedHeader.cols?(e.selection.setRangeEnd(new S(e.countRows()-1,o.col)),e.selection.setSelectedHeaders(!1,!0)):e.selection.setRangeEnd(new S(o.row,o.col))),o.col<0&&(e.selection.selectedHeader.rows?(e.selection.setRangeEnd(new S(o.row,e.countCols()-1)),e.selection.setSelectedHeaders(!0,!1)):e.selection.setRangeEnd(new S(o.row,o.col)))),Handsontable.hooks.run(e,"afterOnCellMouseOver",t,o,i),n.activeWt=n.wt},onCellCornerMouseDown:function(t){t.preventDefault(),Handsontable.hooks.run(e,"afterOnCellCornerMouseDown",t)},beforeDraw:function(e){n.beforeRender(e)},onDraw:function(e){n.onDraw(e)},onScrollVertically:function(){e.runHooks("afterScrollVertically")},onScrollHorizontally:function(){e.runHooks("afterScrollHorizontally")},onBeforeDrawBorders:function(t,n){e.runHooks("beforeDrawBorders",t,n)},onBeforeTouchScroll:function(){e.runHooks("beforeTouchScroll")},onAfterMomentumScroll:function(){e.runHooks("afterMomentumScroll")},onBeforeStretchingColumnWidth:function(t,n){return e.runHooks("beforeStretchingColumnWidth",t,n)},viewportRowCalculatorOverride:function(t){var o=e.countRows(),i=n.settings.viewportRowRenderingOffset;if("auto"===i&&n.settings.fixedRowsTop&&(i=10),"number"==typeof i&&(t.startRow=Math.max(t.startRow-i,0),t.endRow=Math.min(t.endRow+i,o-1)),"auto"===i){var r=t.startRow+t.endRow-t.startRow,s=Math.ceil(r/o*12);t.startRow=Math.max(t.startRow-s,0),t.endRow=Math.min(t.endRow+s,o-1)}e.runHooks("afterViewportRowCalculatorOverride",t)},viewportColumnCalculatorOverride:function(t){var o=e.countCols(),i=n.settings.viewportColumnRenderingOffset;if("auto"===i&&n.settings.fixedColumnsLeft&&(i=10),"number"==typeof i&&(t.startColumn=Math.max(t.startColumn-i,0),t.endColumn=Math.min(t.endColumn+i,o-1)),"auto"===i){var r=t.startColumn+t.endColumn-t.startColumn,s=Math.ceil(r/o*12);t.startRow=Math.max(t.startColumn-s,0),t.endColumn=Math.min(t.endColumn+s,o-1)}e.runHooks("afterViewportColumnCalculatorOverride",t)},rowHeaderWidth:function(){return n.settings.rowHeaderWidth},columnHeaderHeight:function(){return n.settings.columnHeaderHeight}};Handsontable.hooks.run(e,"beforeInitWalkontable",l),this.wt=new T(l),this.activeWt=this.wt,this.eventManager.addEventListener(n.wt.wtTable.spreader,"mousedown",function(e){e.target===n.wt.wtTable.spreader&&3===e.which&&R(e)}),this.eventManager.addEventListener(n.wt.wtTable.spreader,"contextmenu",function(e){e.target===n.wt.wtTable.spreader&&3===e.which&&R(e)}),this.eventManager.addEventListener(document.documentElement,"click",function(){n.settings.observeDOMVisibility&&n.wt.drawInterrupted&&(n.instance.forceFullRender=!0,n.render())})}Object.defineProperties(n,{TableView:{get:function(){return o}},__esModule:{value:!0}});var i,r,s,a,l,u,c=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),d=c.addClass,h=c.empty,f=c.fastInnerHTML,p=c.fastInnerText,g=c.getScrollbarWidth,m=c.hasClass,v=c.isChildOf,w=c.isInput,y=c.isOutsideInput,b=(r=e("eventManager"),r&&r.__esModule&&r||{"default":r}).eventManager,C=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),R=C.stopPropagation,_=C.isImmediatePropagationStopped,S=(a=e("3rdparty/walkontable/src/cell/coords"),a&&a.__esModule&&a||{"default":a}).WalkontableCellCoords,E=(l=e("3rdparty/walkontable/src/selection"),l&&l.__esModule&&l||{"default":l}).WalkontableSelection,T=(u=e("3rdparty/walkontable/src/core"),u&&u.__esModule&&u||{"default":u}).Walkontable;Handsontable.TableView=o,o.prototype.isTextSelectionAllowed=function(e){if(w(e))return!0;var t=v(e,this.instance.view.wt.wtTable.spreader);return this.settings.fragmentSelection===!0&&t?!0:!("cell"!==this.settings.fragmentSelection||!this.isSelectedOnlyCell()||!t)},o.prototype.isSelectedOnlyCell=function(){var e=this.instance.getSelected()||[],t=e[0],n=e[1],o=e[2],i=e[3];return void 0!==t&&t===o&&n===i},o.prototype.isCellEdited=function(){var e=this.instance.getActiveEditor();return e&&e.isOpened()},o.prototype.beforeRender=function(e){e&&Handsontable.hooks.run(this.instance,"beforeRender",this.instance.forceFullRender)},o.prototype.onDraw=function(e){e&&Handsontable.hooks.run(this.instance,"afterRender",this.instance.forceFullRender)},o.prototype.render=function(){this.wt.draw(!this.instance.forceFullRender),this.instance.forceFullRender=!1,this.instance.renderCall=!1},o.prototype.getCellAtCoords=function(e,t){var n=this.wt.getCell(e,t);return 0>n?null:n},o.prototype.scrollViewport=function(e){this.wt.scrollViewport(e)},o.prototype.appendRowHeader=function(e,t){if(t.firstChild){var n=t.firstChild;if(!m(n,"relative"))return h(t),void this.appendRowHeader(e,t);this.updateCellHeader(n.querySelector(".rowHeader"),e,this.instance.getRowHeader)}else{var o=document.createElement("div"),i=document.createElement("span");o.className="relative",i.className="rowHeader",this.updateCellHeader(i,e,this.instance.getRowHeader),o.appendChild(i),t.appendChild(o)}Handsontable.hooks.run(this.instance,"afterGetRowHeader",e,t)},o.prototype.appendColHeader=function(e,t){if(t.firstChild){var n=t.firstChild;m(n,"relative")?this.updateCellHeader(n.querySelector(".colHeader"),e,this.instance.getColHeader):(h(t),this.appendColHeader(e,t))}else{var o=document.createElement("div"),i=document.createElement("span");o.className="relative",i.className="colHeader",this.updateCellHeader(i,e,this.instance.getColHeader),o.appendChild(i),t.appendChild(o)}Handsontable.hooks.run(this.instance,"afterGetColHeader",e,t)},o.prototype.updateCellHeader=function(e,t,n){t>-1?f(e,n(t)):(p(e,String.fromCharCode(160)),d(e,"cornerHeader"))},o.prototype.maximumVisibleElementWidth=function(e){var t=this.wt.wtViewport.getWorkspaceWidth(),n=t-e;return n>0?n:0},o.prototype.maximumVisibleElementHeight=function(e){var t=this.wt.wtViewport.getWorkspaceHeight(),n=t-e;return n>0?n:0},o.prototype.mainViewIsActive=function(){return this.wt===this.activeWt},o.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}],101:[function(e,t,n){"use strict";Object.defineProperties(n,{GhostTable:{get:function(){return f}},__esModule:{value:!0}});var o,i,r,s,a,l=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),u=l.addClass,c=l.outerHeight,d=l.outerWidth,h=(i=e("helpers/array"),i&&i.__esModule&&i||{"default":i}).arrayEach,f=((r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}).objectEach,(s=e("helpers/number"),s&&s.__esModule&&s||{"default":s}).rangeEach,(a=e("helpers/mixed"),a&&a.__esModule&&a||{"default":a}).stringify,function(e){this.hot=e,this.container=null,this.injected=!1,this.rows=[],this.columns=[],this.samples=null});$traceurRuntime.createClass(f,{addRow:function(e,t){if(this.columns.length)throw new Error("Doesn't support multi-dimensional table");this.rows.length||(this.container=this.createContainer(this.hot.rootElement.className));var n={row:e};this.rows.push(n),this.samples=t,this.table=this.createTable(this.hot.table.className),this.table.colGroup.appendChild(this.createColGroupsCol()),this.table.tr.appendChild(this.createRow(e)),this.container.container.appendChild(this.table.fragment),n.table=this.table.table},addColumn:function(e,t){if(this.rows.length)throw new Error("Doesn't support multi-dimensional table");this.columns.length||(this.container=this.createContainer(this.hot.rootElement.className));var n={col:e};this.columns.push(n),this.samples=t,this.table=this.createTable(this.hot.table.className),null!==this.hot.getColHeader(e)&&this.hot.view.appendColHeader(e,this.table.th),this.table.tBody.appendChild(this.createCol(e)),this.container.container.appendChild(this.table.fragment),n.table=this.table.table},getHeights:function(e){this.injected||this.injectTable(),h(this.rows,function(t){e(t.row,c(t.table)-1)})},getWidths:function(e){this.injected||this.injectTable(),h(this.columns,function(t){e(t.col,d(t.table))})},createColGroupsCol:function(){var e=this,t=document,n=t.createDocumentFragment();return n.appendChild(this.createColElement(-1)),this.samples.forEach(function(t){h(t.strings,function(t){n.appendChild(e.createColElement(t.col))})}),n},createRow:function(e){var t=this,n=document,o=n.createDocumentFragment(),i=n.createElement("th");return null!==this.hot.getRowHeader(e)&&this.hot.view.appendRowHeader(e,i),o.appendChild(i),this.samples.forEach(function(i){h(i.strings,function(i){var r=i.col,s=t.hot.getCellMeta(e,r);s.col=r,s.row=e;var a=t.hot.getCellRenderer(s),l=n.createElement("td");a(t.hot,l,e,r,t.hot.colToProp(r),i.value,s),o.appendChild(l)})}),o},createCol:function(e){var t=this,n=document,o=n.createDocumentFragment();return this.samples.forEach(function(i){h(i.strings,function(i){var r=i.row,s=t.hot.getCellMeta(r,e);s.col=e,s.row=r;var a=t.hot.getCellRenderer(s),l=n.createElement("td"),u=n.createElement("tr");a(t.hot,l,r,e,t.hot.colToProp(e),i.value,s),u.appendChild(l),o.appendChild(u)})}),o},clean:function(){this.rows.length=0,this.columns.length=0,this.samples&&this.samples.clear(),this.samples=null,this.removeTable()},injectTable:function(){var e=void 0!==arguments[0]?arguments[0]:null;this.injected||((e||this.hot.rootElement).appendChild(this.container.fragment),this.injected=!0)},removeTable:function(){this.injected&&this.container.container.parentNode&&(this.container.container.parentNode.removeChild(this.container.container),this.container=null,this.injected=!1)},createColElement:function(e){var t=document,n=t.createElement("col");return n.style.width=this.hot.view.wt.wtTable.getStretchedColumnWidth(e)+"px",n},createTable:function(){var e=void 0!==arguments[0]?arguments[0]:"",t=document,n=t.createDocumentFragment(),o=t.createElement("table"),i=t.createElement("thead"),r=t.createElement("tbody"),s=t.createElement("colgroup"),a=t.createElement("tr"),l=t.createElement("th");return this.isVertical()&&o.appendChild(s),this.isHorizontal()&&(a.appendChild(l),i.appendChild(a),o.style.tableLayout="auto",o.style.width="auto"),o.appendChild(i),this.isVertical()&&r.appendChild(a),o.appendChild(r),u(o,e),n.appendChild(o),{fragment:n,table:o,tHead:i,tBody:r,colGroup:s,tr:a,th:l}},createContainer:function(){var e=void 0!==arguments[0]?arguments[0]:"",t=document,n=t.createDocumentFragment(),o=t.createElement("div");return e="htGhostTable htAutoSize "+e.trim(),u(o,e),n.appendChild(o),{fragment:n,container:o}},isVertical:function(){return!(!this.rows.length||this.columns.length)},isHorizontal:function(){return!(!this.columns.length||this.rows.length)}},{}),Handsontable.utils=Handsontable.utils||{},Handsontable.utils.GhostTable=f},{"helpers/array":42,"helpers/dom/element":45,"helpers/mixed":49,"helpers/number":50,"helpers/object":51}],102:[function(e,t,n){"use strict";function o(e){return"string"==typeof e&&/fps$/.test(e)&&(e=1e3/parseInt(e.replace("fps","")||0,10)),e}Object.defineProperties(n,{Interval:{get:function(){return h}},__esModule:{value:!0}});var i,r,s,a,l,u=(i=e("helpers/feature"),i&&i.__esModule&&i||{"default":i}),c=u.requestAnimationFrame,d=u.cancelAnimationFrame,h=((r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}).arrayEach,(s=e("helpers/object"),s&&s.__esModule&&s||{"default":s}).objectEach,(a=e("helpers/number"),a&&a.__esModule&&a||{"default":a}).rangeEach,(l=e("helpers/mixed"),l&&l.__esModule&&l||{"default":l}).stringify,function(e,t){var n=this;this.timer=null,this.func=e,this.delay=o(t),this.stopped=!0,this._then=null,this._callback=function(){return n.__callback()}}),f=h;$traceurRuntime.createClass(h,{start:function(){return this.stopped&&(this._then=Date.now(),this.stopped=!1,this.timer=c(this._callback)),this},stop:function(){return this.stopped||(this.stopped=!0,d(this.timer),this.timer=null),this},__callback:function(){if(this.timer=c(this._callback),this.delay){var e=Date.now(),t=e-this._then;t>this.delay&&(this._then=e-t%this.delay,this.func())}else this.func()}},{create:function(e,t){return new f(e,t)}}),Handsontable.utils=Handsontable.utils||{},Handsontable.utils.Interval=h},{"helpers/array":42,"helpers/feature":47,"helpers/mixed":49,"helpers/number":50,"helpers/object":51}],103:[function(e,t,n){"use strict";var o;Object.defineProperties(n,{SamplesGenerator:{get:function(){return p}},__esModule:{value:!0}});var i,r,s,a,l,u=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),c=(u.addClass,u.outerHeight,u.outerWidth,(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}).arrayEach,s=e("helpers/object"),s&&s.__esModule&&s||{"default":s}),d=(c.objectEach,c.isObject),h=(a=e("helpers/number"),a&&a.__esModule&&a||{"default":a}).rangeEach,f=(l=e("helpers/mixed"),l&&l.__esModule&&l||{"default":l}).stringify,p=function(e){this.samples=null,this.dataFactory=e,this.customSampleCount=null},g=p;$traceurRuntime.createClass(p,(o={},Object.defineProperty(o,"getSampleCount",{value:function(){return this.customSampleCount?this.customSampleCount:g.SAMPLE_COUNT},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(o,"generateRowSamples",{value:function(e,t){return this.generateSamples("row",t,e)},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(o,"generateColumnSamples",{value:function(e,t){return this.generateSamples("col",t,e)},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(o,"generateSamples",{value:function(e,t,n){var o=this,i=new Map;return"number"==typeof n&&(n={from:n,to:n}),h(n.from,n.to,function(n){var r=o.generateSample(e,t,n);i.set(n,r)}),i},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(o,"generateSample",{value:function(e,t,n){var o,i=this,r=new Map,s=[];return h(t.from,t.to,function(t){var a,l;if("row"===e)l=i.dataFactory(n,t);else{if("col"!==e)throw new Error("Unsupported sample type");l=i.dataFactory(t,n)}o=d(l)?Object.keys(l).length:Array.isArray(l)?l.length:f(l).length,r.has(o)||r.set(o,{needed:i.getSampleCount(),strings:[]});var u=r.get(o);if(u.needed){var c=s.indexOf(l)>-1;if(!c){var h="row"===e?"col":"row";u.strings.push((a={},Object.defineProperty(a,"value",{value:l,configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(a,h,{value:t,configurable:!0,enumerable:!0,writable:!0}),a)),s.push(l),u.needed--}}}),r},configurable:!0,enumerable:!0,writable:!0}),o),{get SAMPLE_COUNT(){return 3}}),Handsontable.utils=Handsontable.utils||{},Handsontable.utils.SamplesGenerator=p},{"helpers/array":42,"helpers/dom/element":45,"helpers/mixed":49,"helpers/number":50,"helpers/object":51}],104:[function(e,t,n){"use strict";function o(e,t){var n=e,o="string"==typeof n?n.toLowerCase():null;return function(e){for(var i=!1,s=0,a=e.length;a>s;s++){if(n===e[s]){i=!0;break}if(o===r(e[s]).toLowerCase()){i=!0;break}}t(i)}}var i,r=(i=e("helpers/mixed"),i&&i.__esModule&&i||{"default":i}).stringify;Handsontable.AutocompleteValidator=function(e,t){this.strict&&this.source?"function"==typeof this.source?this.source(e,o(e,t)):o(e,t)(this.source):t(!0)}},{"helpers/mixed":49}],105:[function(e,t,n){"use strict";var o,i,r=(o=e("moment"),o&&o.__esModule&&o||{"default":o})["default"],s=(i=e("editors"),i&&i.__esModule&&i||{"default":i}).getEditor;Handsontable.DateValidator=function(e,t){var n=!0,o=s("date",this.instance);null==e&&(e="");var i=r(new Date(e)).isValid(),l=r(e,this.dateFormat||o.defaultDateFormat,!0).isValid();if(this.allowEmpty&&""===e&&(i=!0,l=!0),i||(n=!1),!i&&l&&(n=!0),i&&!l)if(this.correctFormat===!0){var u=a(e,this.dateFormat);this.instance.setDataAtCell(this.row,this.col,u,"dateValidator"),n=!0}else n=!1;t(n)};var a=function(e,t){var n=r(new Date(e)),o=n.format("YYYY"),i=r().format("YYYY");return o.substr(0,2)!==i.substr(0,2)?e.match(new RegExp(o))||n.year(o.replace(o.substr(0,2),i.substr(0,2))):o.length>4&&n.year((n.year()+"").substr(0,4)),n.format(t)}},{editors:29,moment:"moment"}],106:[function(e,t,n){"use strict";Handsontable.NumericValidator=function(e,t){null==e&&(e=""),t(this.allowEmpty&&""===e?!0:""===e?!1:/^-?\d*(\.|\,)?\d*$/.test(e))}},{}],107:[function(e,t,n){"use strict";var o,i,r=(o=e("moment"),o&&o.__esModule&&o||{"default":o})["default"],s=((i=e("editors"),i&&i.__esModule&&i||{"default":i}).getEditor,["YYYY-MM-DDTHH:mm:ss.SSSZ"]);Handsontable.TimeValidator=function(e,t){var n=!0,o=this.timeFormat||"h:mm:ss a";null===e&&(e=""),"number"==typeof e&&(e=""+e),/^\d{9,10}$/.test(e)?e=new Date(parseInt(e+"000",10)):/^\d{13}$/.test(e)&&(e=new Date(parseInt(e,10)));var i=r(e,s,!0).isValid()?r(new Date(e)):r(e,o),a=i.isValid(),l=r(e,o,!0).isValid();if(this.allowEmpty&&""===e&&(a=!0,l=!0),a||(n=!1),!a&&l&&(n=!0),a&&!l)if(this.correctFormat===!0){var u=i.format(o);this.instance.setDataAtCell(this.row,this.col,u,"timeValidator"),n=!0}else n=!1;t(n)}},{editors:29,moment:"moment"}],SheetClip:[function(e,t,n){"use strict";!function(e){function t(e){return e.split('"').length-1}var o={parse:function(e){var n,o,i,r,s,a,l,u=[],c=0;for(i=e.split("\n"),i.length>1&&""===i[i.length-1]&&i.pop(),n=0,o=i.length;o>n;n+=1){for(i[n]=i[n].split(" "),r=0,s=i[n].length;s>r;r+=1)u[c]||(u[c]=[]),a&&0===r?(l=u[c].length-1,u[c][l]=u[c][l]+"\n"+i[n][0],a&&1&t(i[n][0])&&(a=!1,u[c][l]=u[c][l].substring(0,u[c][l].length-1).replace(/""/g,'"'))):r===s-1&&0===i[n][r].indexOf('"')&&1&t(i[n][r])?(u[c].push(i[n][r].substring(1).replace(/""/g,'"')),a=!0):(u[c].push(i[n][r].replace(/""/g,'"')),a=!1);a||(c+=1)}return u},stringify:function(e){var t,n,o,i,r,s="";for(t=0,n=e.length;n>t;t+=1){for(i=e[t].length,o=0;i>o;o+=1)o>0&&(s+=" "),r=e[t][o],s+="string"==typeof r?r.indexOf("\n")>-1?'"'+r.replace(/"/g,'""')+'"':r:null===r||void 0===r?"":r;s+="\n"}return s}};"undefined"!=typeof n?(n.parse=o.parse,n.stringify=o.stringify):e.SheetClip=o}(window)},{}],autoResize:[function(e,t,n){"use strict";function o(){var e,t={minHeight:200,maxHeight:300,minWidth:100,maxWidth:300},n=document.body,o=document.createTextNode(""),i=document.createElement("SPAN"),r=function(e,t,n){window.attachEvent?e.attachEvent("on"+t,n):e.addEventListener(t,n,!1)},s=function(e,t,n){window.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent("on"+t,n)},a=function(r){var s,a;r?/^[a-zA-Z \.,\\\/\|0-9]$/.test(r)||(r="."):r="",void 0!==o.textContent?o.textContent=e.value+r:o.data=e.value+r,i.style.fontSize=Handsontable.Dom.getComputedStyle(e).fontSize,i.style.fontFamily=Handsontable.Dom.getComputedStyle(e).fontFamily,i.style.whiteSpace="pre",n.appendChild(i),s=i.clientWidth+2,n.removeChild(i),e.style.height=t.minHeight+"px",t.minWidth>s?e.style.width=t.minWidth+"px":s>t.maxWidth?e.style.width=t.maxWidth+"px":e.style.width=s+"px",a=e.scrollHeight?e.scrollHeight-1:0,t.minHeight>a?e.style.height=t.minHeight+"px":t.maxHeight-1||"true"===e.contentEditable}var n=this,o=!1;if(e.metaKey?o=!0:e.ctrlKey&&-1===navigator.userAgent.indexOf("Mac")&&(o=!0),o){if(document.activeElement!==this.elTextarea&&(""!==this.getSelectionText()||t()))return;this.selectNodeText(this.elTextarea),setTimeout(function(){document.activeElement!==n.elTextarea&&n.selectNodeText(n.elTextarea)},0)}!o||67!==e.keyCode&&86!==e.keyCode&&88!==e.keyCode||(88===e.keyCode?setTimeout(function(){n.triggerCut(e)},0):86===e.keyCode&&setTimeout(function(){n.triggerPaste(e)},0))},i.prototype.selectNodeText=function(e){e&&e.select()},i.prototype.getSelectionText=function(){var e="";return window.getSelection?e=window.getSelection().toString():document.selection&&"Control"!==document.selection.type&&(e=document.selection.createRange().text),e},i.prototype.copyable=function(e){if("string"!=typeof e&&void 0===e.toString)throw new Error("copyable requires string parameter");this.elTextarea.value=e,this.selectNodeText(this.elTextarea)},i.prototype.onCut=function(e){this.cutCallbacks.push(e)},i.prototype.onPaste=function(e){this.pasteCallbacks.push(e)},i.prototype.removeCallback=function(e){var t,n;for(t=0,n=this.copyCallbacks.length;n>t;t++)if(this.copyCallbacks[t]===e)return this.copyCallbacks.splice(t,1),!0;for(t=0,n=this.cutCallbacks.length;n>t;t++)if(this.cutCallbacks[t]===e)return this.cutCallbacks.splice(t,1),!0;for(t=0,n=this.pasteCallbacks.length;n>t;t++)if(this.pasteCallbacks[t]===e)return this.pasteCallbacks.splice(t,1),!0;return!1},i.prototype.triggerCut=function(e){var t=this;t.cutCallbacks&&setTimeout(function(){for(var n=0,o=t.cutCallbacks.length;o>n;n++)t.cutCallbacks[n](e)},50)},i.prototype.triggerPaste=function(e,t){var n=this;n.pasteCallbacks&&setTimeout(function(){for(var o=t||n.elTextarea.value,i=0,r=n.pasteCallbacks.length;r>i;i++)n.pasteCallbacks[i](o,e)},50)},i.prototype.destroy=function(){this.hasBeenDestroyed()||0!==--this.refCounter||(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)},i.prototype.hasBeenDestroyed=function(){return!this.refCounter}},{}],es6collections:[function(e,t,n){"use strict";!function(e){function t(e,t){function o(e){return this&&this.constructor===o?(this._keys=[],this._values=[],this._itp=[],this.objectOnly=t,void(e&&n.call(this,e))):new o(e)}return t||y(e,"size",{get:m}),e.constructor=o,o.prototype=e,o}function n(e){this.add?e.forEach(this.add,this):e.forEach(function(e){this.set(e[0],e[1])},this)}function o(e){return this.has(e)&&(this._keys.splice(w,1),this._values.splice(w,1),this._itp.forEach(function(e){w-1}function i(e){return this.has(e)?this._values[w]:void 0}function r(e,t){if(this.objectOnly&&t!==Object(t))throw new TypeError("Invalid value used as weak collection key");if(t!=t||0===t)for(w=e.length;w--&&!b(e[w],t););else w=e.indexOf(t);return w>-1}function s(e){return r.call(this,this._values,e)}function a(e){return r.call(this,this._keys,e)}function l(e,t){return this.has(e)?this._values[w]=t:this._values[this._keys.push(e)-1]=t,this}function u(e){return this.has(e)||this._values.push(e),this}function c(){this._values.length=0}function d(){return g(this._itp,this._keys)}function h(){return g(this._itp,this._values)}function f(){return g(this._itp,this._keys,this._values)}function p(){return g(this._itp,this._values,this._values)}function g(e,t,n){var o=[0],i=!1;return e.push(o),{next:function(){var r,s=o[0];return!i&&st;t++)if(w[t].obj===e)return w[t]}function r(e){for(var t=0,n=w.length;n>t;t++)w[t]===e&&w.splice(t,1)}function s(e,t){for(var n=0,o=e.observers.length;o>n;n++)if(e.observers[n].callback===t)return e.observers[n].observer}function a(e,t){for(var n=0,o=e.observers.length;o>n;n++)if(e.observers[n].observer===t)return e.observers.splice(n,1),void(e.observers.length||r(e))}function l(e,t){h(t),Object.observe?d(t,e):clearTimeout(t.next);var n=i(e);a(n,t)}function u(e,t){var n,r=[],a=e,l=i(e);if(l?n=s(l,t):(l=new y(e),w.push(l)),n)return n;if(Object.observe)n=function(i){d(n,e),c(n,e);for(var s=0,l=i.length;l>s;){if(("length"!==i[s].name||!R(i[s].object))&&"__Jasmine_been_here_before__"!==i[s].name){var u=i[s].type;switch(u){case"new":u="add";break;case"deleted":u="delete";break;case"updated":u="update"}v[u].call(i[s],r,o(a,i[s].object))}s++}r&&t&&t(r),n.patches=r,r=[]};else if(n={},l.value=JSON.parse(JSON.stringify(e)),t){n.callback=t,n.next=null;var u=this.intervals||[100,1e3,1e4,6e4],f=0,p=function(){h(n)},g=function(){clearTimeout(n.next),n.next=setTimeout(function(){p(),f=0,n.next=setTimeout(m,u[f++])},0)},m=function(){p(),f==u.length&&(f=u.length-1), +n.next=setTimeout(m,u[f++])};"undefined"!=typeof window&&(window.addEventListener?(window.addEventListener("mousedown",g),window.addEventListener("mouseup",g),window.addEventListener("keydown",g)):(window.attachEvent("onmousedown",g),window.attachEvent("onmouseup",g),window.attachEvent("onkeydown",g))),n.next=setTimeout(m,u[f++])}return n.patches=r,n.object=e,l.observers.push(new b(t,n)),c(n,e)}function c(e,t){if(Object.observe){Object.observe(t,e);for(var n in t)if(t.hasOwnProperty(n)){var o=t[n];o&&"object"==typeof o&&c(e,o)}}return e}function d(e,t){if(Object.observe){Object.unobserve(t,e);for(var n in t)if(t.hasOwnProperty(n)){var o=t[n];o&&"object"==typeof o&&d(e,o)}}return e}function h(e){if(Object.observe)Object.deliverChangeRecords(e);else{for(var t,n=0,o=w.length;o>n;n++)if(w[n].obj===e.object){t=w[n];break}t&&f(t.value,e.object,e.patches,"")}var i=e.patches;return i.length>0&&(e.patches=[],e.callback&&e.callback(i)),i}function f(e,n,o,i){for(var r=C(n),s=C(e),a=!1,l=!1,u=s.length-1;u>=0;u--){var c=s[u],d=e[c];if(n.hasOwnProperty(c)){var h=n[c];d instanceof Object?f(d,h,o,i+"/"+t(c)):d!=h&&(a=!0,o.push({op:"replace",path:i+"/"+t(c),value:h}),e[c]=h)}else o.push({op:"remove",path:i+"/"+t(c)}),delete e[c],l=!0}if(l||r.length!=s.length)for(var u=0;ui;){n=t[i];for(var s=n.path.split("/"),a=e,l=1,u=s.length;;)if(R(a)){var c=parseInt(s[l],10);if(l++,l>=u){o=m[n.op].call(n,a,c,e);break}a=a[c]}else{var d=s[l];if(-1!=d.indexOf("~")&&(d=d.replace(/~1/g,"/").replace(/~0/g,"~")),l++,l>=u){o=g[n.op].call(n,a,d,e);break}a=a[d]}i++}return o}var g={add:function(e,t){return e[t]=this.value,!0},remove:function(e,t){return delete e[t],!0},replace:function(e,t){return e[t]=this.value,!0},move:function(e,t,n){var o={op:"_get",path:this.from};return p(n,[o]),p(n,[{op:"remove",path:this.from}]),p(n,[{op:"add",path:this.path,value:o.value}]),!0},copy:function(e,t,n){var o={op:"_get",path:this.from};return p(n,[o]),p(n,[{op:"add",path:this.path,value:o.value}]),!0},test:function(e,t){return JSON.stringify(e[t])===JSON.stringify(this.value)},_get:function(e,t){this.value=e[t]}},m={add:function(e,t){return e.splice(t,0,this.value),!0},remove:function(e,t){return e.splice(t,1),!0},replace:function(e,t){return e[t]=this.value,!0},move:g.move,copy:g.copy,test:g.test,_get:g._get},v={add:function(e,n){var o={op:"add",path:n+t(this.name),value:this.object[this.name]};e.push(o)},"delete":function(e,n){var o={op:"remove",path:n+t(this.name)};e.push(o)},update:function(e,n){var o={op:"replace",path:n+t(this.name),value:this.object[this.name]};e.push(o)}},w=[];e.intervals;var y=function(){function e(e){this.observers=[],this.obj=e}return e}(),b=function(){function e(e,t){this.callback=e,this.observer=t}return e}();e.unobserve=l,e.observe=u,e.generate=h;var C;C=Object.keys?Object.keys:function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t};var R;R=Array.isArray?Array.isArray:function(e){return e.push&&"number"==typeof e.length},e.apply=p}(o||(o={})),"undefined"!=typeof n&&(n.apply=o.apply,n.observe=o.observe,n.unobserve=o.unobserve,n.generate=o.generate)},{}],moment:[function(t,n,o){!function(t,i){"object"==typeof o&&"undefined"!=typeof n?n.exports=i():"function"==typeof e&&e.amd?e(i):t.moment=i()}(this,function(){"use strict";function e(){return Kn.apply(null,arguments)}function o(e){Kn=e}function i(e){return"[object Array]"===Object.prototype.toString.call(e)}function r(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function s(e,t){var n,o=[];for(n=0;n0)for(n in Zn)o=Zn[n],i=t[o],p(i)||(e[o]=i);return e}function m(t){g(this,t),this._d=new Date(null!=t._d?t._d.getTime():NaN),Jn===!1&&(Jn=!0,e.updateOffset(this),Jn=!1)}function v(e){return e instanceof m||null!=e&&null!=e._isAMomentObject}function w(e){return 0>e?Math.ceil(e):Math.floor(e)}function y(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=w(t)),n}function b(e,t,n){var o,i=Math.min(e.length,t.length),r=Math.abs(e.length-t.length),s=0;for(o=0;i>o;o++)(n&&e[o]!==t[o]||!n&&y(e[o])!==y(t[o]))&&s++;return s+r}function C(){}function R(e){return e?e.toLowerCase().replace("_","-"):e}function _(e){for(var t,n,o,i,r=0;r0;){if(o=S(i.slice(0,t).join("-")))return o;if(n&&n.length>=t&&b(i,n,!0)>=t-1)break;t--}r++}return null}function S(e){var o=null;if(!Qn[e]&&"undefined"!=typeof n&&n&&n.exports)try{o=qn._abbr,t("./locale/"+e),E(o)}catch(i){}return Qn[e]}function E(e,t){var n;return e&&(n=p(t)?M(e):T(e,t),n&&(qn=n)),qn._abbr}function T(e,t){return null!==t?(t.abbr=e,Qn[e]=Qn[e]||new C,Qn[e].set(t),E(e),Qn[e]):(delete Qn[e],null)}function M(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return qn;if(!i(e)){if(t=S(e))return t;e=[e]}return _(e)}function O(e,t){var n=e.toLowerCase();eo[n]=eo[n+"s"]=eo[t]=e}function k(e){return"string"==typeof e?eo[e]||eo[e.toLowerCase()]:void 0}function H(e){var t,n,o={};for(n in e)a(e,n)&&(t=k(n),t&&(o[t]=e[n]));return o}function D(e){return e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function x(t,n){return function(o){return null!=o?(P(this,t,o),e.updateOffset(this,n),this):A(this,t)}}function A(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function P(e,t,n){e.isValid()&&e._d["set"+(e._isUTC?"UTC":"")+t](n)}function N(e,t){var n;if("object"==typeof e)for(n in e)this.set(n,e[n]);else if(e=k(e),D(this[e]))return this[e](t);return this}function L(e,t,n){var o=""+Math.abs(e),i=t-o.length,r=e>=0;return(r?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+o}function W(e,t,n,o){var i=o;"string"==typeof o&&(i=function(){return this[o]()}),e&&(io[e]=i),t&&(io[t[0]]=function(){return L(i.apply(this,arguments),t[1],t[2])}),n&&(io[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function I(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function j(e){var t,n,o=e.match(to);for(t=0,n=o.length;n>t;t++)io[o[t]]?o[t]=io[o[t]]:o[t]=I(o[t]);return function(i){var r="";for(t=0;n>t;t++)r+=o[t]instanceof Function?o[t].call(i,e):o[t];return r}}function V(e,t){return e.isValid()?(t=F(t,e.localeData()),oo[t]=oo[t]||j(t),oo[t](e)):e.localeData().invalidDate()}function F(e,t){function n(e){return t.longDateFormat(e)||e}var o=5;for(no.lastIndex=0;o>=0&&no.test(e);)e=e.replace(no,n),no.lastIndex=0,o-=1;return e}function B(e,t,n){_o[e]=D(t)?t:function(e,o){return e&&n?n:t}}function z(e,t){return a(_o,e)?_o[e](t._strict,t._locale):new RegExp(Y(e))}function Y(e){return U(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,o,i){return t||n||o||i}))}function U(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function G(e,t){var n,o=t;for("string"==typeof e&&(e=[e]),"number"==typeof t&&(o=function(e,n){n[t]=y(e)}),n=0;no;o++){if(i=u([2e3,o]),n&&!this._longMonthsParse[o]&&(this._longMonthsParse[o]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[o]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),n||this._monthsParse[o]||(r="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[o]=new RegExp(r.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[o].test(e))return o;if(n&&"MMM"===t&&this._shortMonthsParse[o].test(e))return o;if(!n&&this._monthsParse[o].test(e))return o}}function Q(e,t){var n;return e.isValid()?"string"==typeof t&&(t=e.localeData().monthsParse(t),"number"!=typeof t)?e:(n=Math.min(e.date(),K(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,n),e):e}function ee(t){return null!=t?(Q(this,t),e.updateOffset(this,!0),this):A(this,"Month")}function te(){return K(this.year(),this.month())}function ne(e){return this._monthsParseExact?(a(this,"_monthsRegex")||ie.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex}function oe(e){return this._monthsParseExact?(a(this,"_monthsRegex")||ie.call(this),e?this._monthsStrictRegex:this._monthsRegex):this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex}function ie(){function e(e,t){return t.length-e.length}var t,n,o=[],i=[],r=[];for(t=0;12>t;t++)n=u([2e3,t]),o.push(this.monthsShort(n,"")),i.push(this.months(n,"")),r.push(this.months(n,"")),r.push(this.monthsShort(n,""));for(o.sort(e),i.sort(e),r.sort(e),t=0;12>t;t++)o[t]=U(o[t]),i[t]=U(i[t]),r[t]=U(r[t]);this._monthsRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+i.join("|")+")$","i"),this._monthsShortStrictRegex=new RegExp("^("+o.join("|")+")$","i")}function re(e){var t,n=e._a;return n&&-2===d(e).overflow&&(t=n[To]<0||n[To]>11?To:n[Mo]<1||n[Mo]>K(n[Eo],n[To])?Mo:n[Oo]<0||n[Oo]>24||24===n[Oo]&&(0!==n[ko]||0!==n[Ho]||0!==n[Do])?Oo:n[ko]<0||n[ko]>59?ko:n[Ho]<0||n[Ho]>59?Ho:n[Do]<0||n[Do]>999?Do:-1,d(e)._overflowDayOfYear&&(Eo>t||t>Mo)&&(t=Mo),d(e)._overflowWeeks&&-1===t&&(t=xo),d(e)._overflowWeekday&&-1===t&&(t=Ao),d(e).overflow=t),e}function se(t){e.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+t)}function ae(e,t){var n=!0;return l(function(){return n&&(se(e+"\nArguments: "+Array.prototype.slice.call(arguments).join(", ")+"\n"+(new Error).stack),n=!1),t.apply(this,arguments)},t)}function le(e,t){jo[e]||(se(t),jo[e]=!0)}function ue(e){var t,n,o,i,r,s,a=e._i,l=Vo.exec(a)||Fo.exec(a);if(l){for(d(e).iso=!0,t=0,n=zo.length;n>t;t++)if(zo[t][1].exec(l[1])){i=zo[t][0],o=zo[t][2]!==!1;break}if(null==i)return void(e._isValid=!1);if(l[3]){for(t=0,n=Yo.length;n>t;t++)if(Yo[t][1].exec(l[3])){r=(l[2]||" ")+Yo[t][0];break}if(null==r)return void(e._isValid=!1)}if(!o&&null!=r)return void(e._isValid=!1);if(l[4]){if(!Bo.exec(l[4]))return void(e._isValid=!1);s="Z"}e._f=i+(r||"")+(s||""),Se(e)}else e._isValid=!1}function ce(t){var n=Uo.exec(t._i);return null!==n?void(t._d=new Date(+n[1])):(ue(t),void(t._isValid===!1&&(delete t._isValid,e.createFromInputFallback(t))))}function de(e,t,n,o,i,r,s){var a=new Date(e,t,n,o,i,r,s);return 100>e&&e>=0&&isFinite(a.getFullYear())&&a.setFullYear(e),a}function he(e){var t=new Date(Date.UTC.apply(null,arguments));return 100>e&&e>=0&&isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e),t}function fe(e){return pe(e)?366:365}function pe(e){return e%4===0&&e%100!==0||e%400===0}function ge(){return pe(this.year())}function me(e,t,n){var o=7+t-n,i=(7+he(e,0,o).getUTCDay()-t)%7;return-i+o-1}function ve(e,t,n,o,i){var r,s,a=(7+n-o)%7,l=me(e,o,i),u=1+7*(t-1)+a+l;return 0>=u?(r=e-1,s=fe(r)+u):u>fe(e)?(r=e+1,s=u-fe(e)):(r=e,s=u),{year:r,dayOfYear:s}}function we(e,t,n){var o,i,r=me(e.year(),t,n),s=Math.floor((e.dayOfYear()-r-1)/7)+1;return 1>s?(i=e.year()-1,o=s+ye(i,t,n)):s>ye(e.year(),t,n)?(o=s-ye(e.year(),t,n),i=e.year()+1):(i=e.year(),o=s),{week:o,year:i}}function ye(e,t,n){var o=me(e,t,n),i=me(e+1,t,n);return(fe(e)-o+i)/7}function be(e,t,n){return null!=e?e:null!=t?t:n}function Ce(t){var n=new Date(e.now());return t._useUTC?[n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate()]:[n.getFullYear(),n.getMonth(),n.getDate()]}function Re(e){var t,n,o,i,r=[];if(!e._d){for(o=Ce(e),e._w&&null==e._a[Mo]&&null==e._a[To]&&_e(e),e._dayOfYear&&(i=be(e._a[Eo],o[Eo]),e._dayOfYear>fe(i)&&(d(e)._overflowDayOfYear=!0),n=he(i,0,e._dayOfYear),e._a[To]=n.getUTCMonth(),e._a[Mo]=n.getUTCDate()),t=0;3>t&&null==e._a[t];++t)e._a[t]=r[t]=o[t];for(;7>t;t++)e._a[t]=r[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[Oo]&&0===e._a[ko]&&0===e._a[Ho]&&0===e._a[Do]&&(e._nextDay=!0,e._a[Oo]=0),e._d=(e._useUTC?he:de).apply(null,r),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[Oo]=24)}}function _e(e){var t,n,o,i,r,s,a,l;t=e._w,null!=t.GG||null!=t.W||null!=t.E?(r=1,s=4,n=be(t.GG,e._a[Eo],we(xe(),1,4).year),o=be(t.W,1),i=be(t.E,1),(1>i||i>7)&&(l=!0)):(r=e._locale._week.dow,s=e._locale._week.doy,n=be(t.gg,e._a[Eo],we(xe(),r,s).year),o=be(t.w,1),null!=t.d?(i=t.d,(0>i||i>6)&&(l=!0)):null!=t.e?(i=t.e+r,(t.e<0||t.e>6)&&(l=!0)):i=r),1>o||o>ye(n,r,s)?d(e)._overflowWeeks=!0:null!=l?d(e)._overflowWeekday=!0:(a=ve(n,o,i,r,s),e._a[Eo]=a.year,e._dayOfYear=a.dayOfYear)}function Se(t){if(t._f===e.ISO_8601)return void ue(t);t._a=[],d(t).empty=!0;var n,o,i,r,s,a=""+t._i,l=a.length,u=0;for(i=F(t._f,t._locale).match(to)||[],n=0;n0&&d(t).unusedInput.push(s),a=a.slice(a.indexOf(o)+o.length),u+=o.length),io[r]?(o?d(t).empty=!1:d(t).unusedTokens.push(r),X(r,o,t)):t._strict&&!o&&d(t).unusedTokens.push(r);d(t).charsLeftOver=l-u,a.length>0&&d(t).unusedInput.push(a),d(t).bigHour===!0&&t._a[Oo]<=12&&t._a[Oo]>0&&(d(t).bigHour=void 0),t._a[Oo]=Ee(t._locale,t._a[Oo],t._meridiem),Re(t),re(t)}function Ee(e,t,n){var o;return null==n?t:null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?(o=e.isPM(n),o&&12>t&&(t+=12),o||12!==t||(t=0),t):t}function Te(e){var t,n,o,i,r;if(0===e._f.length)return d(e).invalidFormat=!0,void(e._d=new Date(NaN));for(i=0;ir)&&(o=r,n=t));l(e,n||t)}function Me(e){if(!e._d){var t=H(e._i);e._a=s([t.year,t.month,t.day||t.date,t.hour,t.minute,t.second,t.millisecond],function(e){return e&&parseInt(e,10)}),Re(e)}}function Oe(e){var t=new m(re(ke(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function ke(e){var t=e._i,n=e._f;return e._locale=e._locale||M(e._l),null===t||void 0===n&&""===t?f({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),v(t)?new m(re(t)):(i(n)?Te(e):n?Se(e):r(t)?e._d=t:He(e),h(e)||(e._d=null),e))}function He(t){var n=t._i;void 0===n?t._d=new Date(e.now()):r(n)?t._d=new Date(+n):"string"==typeof n?ce(t):i(n)?(t._a=s(n.slice(0),function(e){return parseInt(e,10)}),Re(t)):"object"==typeof n?Me(t):"number"==typeof n?t._d=new Date(n):e.createFromInputFallback(t)}function De(e,t,n,o,i){var r={};return"boolean"==typeof n&&(o=n,n=void 0),r._isAMomentObject=!0,r._useUTC=r._isUTC=i,r._l=n,r._i=e,r._f=t,r._strict=o,Oe(r)}function xe(e,t,n,o){return De(e,t,n,o,!1)}function Ae(e,t){var n,o;if(1===t.length&&i(t[0])&&(t=t[0]),!t.length)return xe();for(n=t[0],o=1;oe&&(e=-e,n="-"),n+L(~~(e/60),2)+t+L(~~e%60,2)})}function je(e,t){var n=(t||"").match(e)||[],o=n[n.length-1]||[],i=(o+"").match(qo)||["-",0,0],r=+(60*i[1])+y(i[2]);return"+"===i[0]?r:-r}function Ve(t,n){var o,i;return n._isUTC?(o=n.clone(),i=(v(t)||r(t)?+t:+xe(t))-+o,o._d.setTime(+o._d+i),e.updateOffset(o,!1),o):xe(t).local()}function Fe(e){return 15*-Math.round(e._d.getTimezoneOffset()/15)}function Be(t,n){var o,i=this._offset||0;return this.isValid()?null!=t?("string"==typeof t?t=je(bo,t):Math.abs(t)<16&&(t=60*t),!this._isUTC&&n&&(o=Fe(this)),this._offset=t,this._isUTC=!0,null!=o&&this.add(o,"m"),i!==t&&(!n||this._changeInProgress?it(this,Qe(t-i,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?i:Fe(this):null!=t?this:NaN}function ze(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function Ye(e){return this.utcOffset(0,e)}function Ue(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Fe(this),"m")),this}function Ge(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(je(yo,this._i)),this}function $e(e){return this.isValid()?(e=e?xe(e).utcOffset():0,(this.utcOffset()-e)%60===0):!1}function Xe(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Ke(){if(!p(this._isDSTShifted))return this._isDSTShifted;var e={};if(g(e,this),e=ke(e),e._a){var t=e._isUTC?u(e._a):xe(e._a);this._isDSTShifted=this.isValid()&&b(e._a,t.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function qe(){return this.isValid()?!this._isUTC:!1}function Ze(){return this.isValid()?this._isUTC:!1}function Je(){return this.isValid()?this._isUTC&&0===this._offset:!1}function Qe(e,t){var n,o,i,r=e,s=null;return We(e)?r={ms:e._milliseconds,d:e._days,M:e._months}:"number"==typeof e?(r={},t?r[t]=e:r.milliseconds=e):(s=Zo.exec(e))?(n="-"===s[1]?-1:1,r={y:0,d:y(s[Mo])*n,h:y(s[Oo])*n,m:y(s[ko])*n,s:y(s[Ho])*n,ms:y(s[Do])*n}):(s=Jo.exec(e))?(n="-"===s[1]?-1:1,r={y:et(s[2],n),M:et(s[3],n),d:et(s[4],n),h:et(s[5],n),m:et(s[6],n),s:et(s[7],n),w:et(s[8],n)}):null==r?r={}:"object"==typeof r&&("from"in r||"to"in r)&&(i=nt(xe(r.from),xe(r.to)),r={},r.ms=i.milliseconds,r.M=i.months),o=new Le(r),We(e)&&a(e,"_locale")&&(o._locale=e._locale),o}function et(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function tt(e,t){var n={milliseconds:0,months:0};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function nt(e,t){var n;return e.isValid()&&t.isValid()?(t=Ve(t,e),e.isBefore(t)?n=tt(e,t):(n=tt(t,e),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function ot(e,t){return function(n,o){var i,r;return null===o||isNaN(+o)||(le(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period)."),r=n,n=o,o=r),n="string"==typeof n?+n:n,i=Qe(n,o),it(this,i,e),this}}function it(t,n,o,i){var r=n._milliseconds,s=n._days,a=n._months;t.isValid()&&(i=null==i?!0:i,r&&t._d.setTime(+t._d+r*o),s&&P(t,"Date",A(t,"Date")+s*o),a&&Q(t,A(t,"Month")+a*o),i&&e.updateOffset(t,s||a))}function rt(e,t){var n=e||xe(),o=Ve(n,this).startOf("day"),i=this.diff(o,"days",!0),r=-6>i?"sameElse":-1>i?"lastWeek":0>i?"lastDay":1>i?"sameDay":2>i?"nextDay":7>i?"nextWeek":"sameElse",s=t&&(D(t[r])?t[r]():t[r]);return this.format(s||this.localeData().calendar(r,this,xe(n)))}function st(){return new m(this)}function at(e,t){var n=v(e)?e:xe(e);return this.isValid()&&n.isValid()?(t=k(p(t)?"millisecond":t),"millisecond"===t?+this>+n:+n<+this.clone().startOf(t)):!1}function lt(e,t){var n=v(e)?e:xe(e);return this.isValid()&&n.isValid()?(t=k(p(t)?"millisecond":t),"millisecond"===t?+n>+this:+this.clone().endOf(t)<+n):!1}function ut(e,t,n){return this.isAfter(e,n)&&this.isBefore(t,n)}function ct(e,t){var n,o=v(e)?e:xe(e);return this.isValid()&&o.isValid()?(t=k(t||"millisecond"),"millisecond"===t?+this===+o:(n=+o,+this.clone().startOf(t)<=n&&n<=+this.clone().endOf(t))):!1}function dt(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function ht(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function ft(e,t,n){var o,i,r,s;return this.isValid()?(o=Ve(e,this),o.isValid()?(i=6e4*(o.utcOffset()-this.utcOffset()),t=k(t),"year"===t||"month"===t||"quarter"===t?(s=pt(this,o),"quarter"===t?s/=3:"year"===t&&(s/=12)):(r=this-o,s="second"===t?r/1e3:"minute"===t?r/6e4:"hour"===t?r/36e5:"day"===t?(r-i)/864e5:"week"===t?(r-i)/6048e5:r),n?s:w(s)):NaN):NaN}function pt(e,t){var n,o,i=12*(t.year()-e.year())+(t.month()-e.month()),r=e.clone().add(i,"months");return 0>t-r?(n=e.clone().add(i-1,"months"),o=(t-r)/(r-n)):(n=e.clone().add(i+1,"months"),o=(t-r)/(n-r)),-(i+o)}function gt(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function mt(){var e=this.clone().utc();return 0r&&(t=r),Bt.call(this,e,t,n,o,i))}function Bt(e,t,n,o,i){var r=ve(e,t,n,o,i),s=he(r.year,0,r.dayOfYear);return this.year(s.getUTCFullYear()),this.month(s.getUTCMonth()),this.date(s.getUTCDate()),this}function zt(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)}function Yt(e){return we(e,this._week.dow,this._week.doy).week}function Ut(){return this._week.dow}function Gt(){return this._week.doy}function $t(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")}function Xt(e){var t=we(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")}function Kt(e,t){return"string"!=typeof e?e:isNaN(e)?(e=t.weekdaysParse(e),"number"==typeof e?e:null):parseInt(e,10)}function qt(e,t){return i(this._weekdays)?this._weekdays[e.day()]:this._weekdays[this._weekdays.isFormat.test(t)?"format":"standalone"][e.day()]}function Zt(e){return this._weekdaysShort[e.day()]}function Jt(e){return this._weekdaysMin[e.day()]}function Qt(e,t,n){var o,i,r;for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),o=0;7>o;o++){if(i=xe([2e3,1]).day(o),n&&!this._fullWeekdaysParse[o]&&(this._fullWeekdaysParse[o]=new RegExp("^"+this.weekdays(i,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[o]=new RegExp("^"+this.weekdaysShort(i,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[o]=new RegExp("^"+this.weekdaysMin(i,"").replace(".",".?")+"$","i")),this._weekdaysParse[o]||(r="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[o]=new RegExp(r.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[o].test(e))return o;if(n&&"ddd"===t&&this._shortWeekdaysParse[o].test(e))return o;if(n&&"dd"===t&&this._minWeekdaysParse[o].test(e))return o;if(!n&&this._weekdaysParse[o].test(e))return o}}function en(e){if(!this.isValid())return null!=e?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=Kt(e,this.localeData()),this.add(e-t,"d")):t}function tn(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")}function nn(e){return this.isValid()?null==e?this.day()||7:this.day(this.day()%7?e:e-7):null!=e?this:NaN}function on(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")}function rn(){return this.hours()%12||12}function sn(e,t){W(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function an(e,t){return t._meridiemParse}function ln(e){return"p"===(e+"").toLowerCase().charAt(0)}function un(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}function cn(e,t){t[Do]=y(1e3*("0."+e))}function dn(){return this._isUTC?"UTC":""}function hn(){return this._isUTC?"Coordinated Universal Time":""}function fn(e){return xe(1e3*e)}function pn(){return xe.apply(null,arguments).parseZone()}function gn(e,t,n){var o=this._calendar[e];return D(o)?o.call(t,n):o}function mn(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.replace(/MMMM|MM|DD|dddd/g,function(e){return e.slice(1)}),this._longDateFormat[e])}function vn(){return this._invalidDate}function wn(e){return this._ordinal.replace("%d",e)}function yn(e){return e}function bn(e,t,n,o){var i=this._relativeTime[n];return D(i)?i(e,t,n,o):i.replace(/%d/i,e)}function Cn(e,t){var n=this._relativeTime[e>0?"future":"past"];return D(n)?n(t):n.replace(/%s/i,t)}function Rn(e){var t,n;for(n in e)t=e[n],D(t)?this[n]=t:this["_"+n]=t;this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function _n(e,t,n,o){var i=M(),r=u().set(o,t);return i[n](r,e)}function Sn(e,t,n,o,i){if("number"==typeof e&&(t=e,e=void 0),e=e||"",null!=t)return _n(e,t,n,i);var r,s=[];for(r=0;o>r;r++)s[r]=_n(e,r,n,i);return s}function En(e,t){return Sn(e,t,"months",12,"month")}function Tn(e,t){return Sn(e,t,"monthsShort",12,"month")}function Mn(e,t){return Sn(e,t,"weekdays",7,"day")}function On(e,t){return Sn(e,t,"weekdaysShort",7,"day")}function kn(e,t){return Sn(e,t,"weekdaysMin",7,"day")}function Hn(){var e=this._data;return this._milliseconds=Ri(this._milliseconds),this._days=Ri(this._days),this._months=Ri(this._months),e.milliseconds=Ri(e.milliseconds),e.seconds=Ri(e.seconds),e.minutes=Ri(e.minutes),e.hours=Ri(e.hours),e.months=Ri(e.months),e.years=Ri(e.years),this}function Dn(e,t,n,o){var i=Qe(t,n);return e._milliseconds+=o*i._milliseconds,e._days+=o*i._days,e._months+=o*i._months,e._bubble()}function xn(e,t){return Dn(this,e,t,1)}function An(e,t){return Dn(this,e,t,-1)}function Pn(e){return 0>e?Math.floor(e):Math.ceil(e)}function Nn(){var e,t,n,o,i,r=this._milliseconds,s=this._days,a=this._months,l=this._data;return r>=0&&s>=0&&a>=0||0>=r&&0>=s&&0>=a||(r+=864e5*Pn(Wn(a)+s),s=0,a=0),l.milliseconds=r%1e3,e=w(r/1e3),l.seconds=e%60,t=w(e/60),l.minutes=t%60,n=w(t/60),l.hours=n%24,s+=w(n/24),i=w(Ln(s)),a+=i,s-=Pn(Wn(i)),o=w(a/12),a%=12,l.days=s,l.months=a,l.years=o,this}function Ln(e){return 4800*e/146097}function Wn(e){return 146097*e/4800}function In(e){var t,n,o=this._milliseconds;if(e=k(e),"month"===e||"year"===e)return t=this._days+o/864e5,n=this._months+Ln(t),"month"===e?n:n/12;switch(t=this._days+Math.round(Wn(this._months)),e){case"week":return t/7+o/6048e5;case"day":return t+o/864e5;case"hour":return 24*t+o/36e5;case"minute":return 1440*t+o/6e4;case"second":return 86400*t+o/1e3;case"millisecond":return Math.floor(864e5*t)+o;default:throw new Error("Unknown unit "+e)}}function jn(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*y(this._months/12)}function Vn(e){return function(){return this.as(e)}}function Fn(e){return e=k(e),this[e+"s"]()}function Bn(e){return function(){return this._data[e]}}function zn(){return w(this.days()/7)}function Yn(e,t,n,o,i){return i.relativeTime(t||1,!!n,e,o)}function Un(e,t,n){var o=Qe(e).abs(),i=Ii(o.as("s")),r=Ii(o.as("m")),s=Ii(o.as("h")),a=Ii(o.as("d")),l=Ii(o.as("M")),u=Ii(o.as("y")),c=i=r&&["m"]||r=s&&["h"]||s=a&&["d"]||a=l&&["M"]||l=u&&["y"]||["yy",u];return c[2]=t,c[3]=+e>0,c[4]=n,Yn.apply(null,c)}function Gn(e,t){return void 0===ji[e]?!1:void 0===t?ji[e]:(ji[e]=t,!0)}function $n(e){var t=this.localeData(),n=Un(this,!e,t);return e&&(n=t.pastFuture(+this,n)),t.postformat(n)}function Xn(){var e,t,n,o=Vi(this._milliseconds)/1e3,i=Vi(this._days),r=Vi(this._months);e=w(o/60),t=w(e/60),o%=60,e%=60,n=w(r/12),r%=12;var s=n,a=r,l=i,u=t,c=e,d=o,h=this.asSeconds();return h?(0>h?"-":"")+"P"+(s?s+"Y":"")+(a?a+"M":"")+(l?l+"D":"")+(u||c||d?"T":"")+(u?u+"H":"")+(c?c+"M":"")+(d?d+"S":""):"P0D"}var Kn,qn,Zn=e.momentProperties=[],Jn=!1,Qn={},eo={},to=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,no=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,oo={},io={},ro=/\d/,so=/\d\d/,ao=/\d{3}/,lo=/\d{4}/,uo=/[+-]?\d{6}/,co=/\d\d?/,ho=/\d\d\d\d?/,fo=/\d\d\d\d\d\d?/,po=/\d{1,3}/,go=/\d{1,4}/,mo=/[+-]?\d{1,6}/,vo=/\d+/,wo=/[+-]?\d+/,yo=/Z|[+-]\d\d:?\d\d/gi,bo=/Z|[+-]\d\d(?::?\d\d)?/gi,Co=/[+-]?\d+(\.\d{1,3})?/,Ro=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,_o={},So={},Eo=0,To=1,Mo=2,Oo=3,ko=4,Ho=5,Do=6,xo=7,Ao=8;W("M",["MM",2],"Mo",function(){return this.month()+1}),W("MMM",0,0,function(e){return this.localeData().monthsShort(this,e); +}),W("MMMM",0,0,function(e){return this.localeData().months(this,e)}),O("month","M"),B("M",co),B("MM",co,so),B("MMM",function(e,t){return t.monthsShortRegex(e)}),B("MMMM",function(e,t){return t.monthsRegex(e)}),G(["M","MM"],function(e,t){t[To]=y(e)-1}),G(["MMM","MMMM"],function(e,t,n,o){var i=n._locale.monthsParse(e,o,n._strict);null!=i?t[To]=i:d(n).invalidMonth=e});var Po=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/,No="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Lo="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Wo=Ro,Io=Ro,jo={};e.suppressDeprecationWarnings=!1;var Vo=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,Fo=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,Bo=/Z|[+-]\d\d(?::?\d\d)?/,zo=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],Yo=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Uo=/^\/?Date\((\-?\d+)/i;e.createFromInputFallback=ae("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(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),W("Y",0,0,function(){var e=this.year();return 9999>=e?""+e:"+"+e}),W(0,["YY",2],0,function(){return this.year()%100}),W(0,["YYYY",4],0,"year"),W(0,["YYYYY",5],0,"year"),W(0,["YYYYYY",6,!0],0,"year"),O("year","y"),B("Y",wo),B("YY",co,so),B("YYYY",go,lo),B("YYYYY",mo,uo),B("YYYYYY",mo,uo),G(["YYYYY","YYYYYY"],Eo),G("YYYY",function(t,n){n[Eo]=2===t.length?e.parseTwoDigitYear(t):y(t)}),G("YY",function(t,n){n[Eo]=e.parseTwoDigitYear(t)}),G("Y",function(e,t){t[Eo]=parseInt(e,10)}),e.parseTwoDigitYear=function(e){return y(e)+(y(e)>68?1900:2e3)};var Go=x("FullYear",!1);e.ISO_8601=function(){};var $o=ae("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var e=xe.apply(null,arguments);return this.isValid()&&e.isValid()?this>e?this:e:f()}),Xo=ae("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var e=xe.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:f()}),Ko=function(){return Date.now?Date.now():+new Date};Ie("Z",":"),Ie("ZZ",""),B("Z",bo),B("ZZ",bo),G(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=je(bo,e)});var qo=/([\+\-]|\d\d)/gi;e.updateOffset=function(){};var Zo=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?\d*)?$/,Jo=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/;Qe.fn=Le.prototype;var Qo=ot(1,"add"),ei=ot(-1,"subtract");e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";var ti=ae("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});W(0,["gg",2],0,function(){return this.weekYear()%100}),W(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Lt("gggg","weekYear"),Lt("ggggg","weekYear"),Lt("GGGG","isoWeekYear"),Lt("GGGGG","isoWeekYear"),O("weekYear","gg"),O("isoWeekYear","GG"),B("G",wo),B("g",wo),B("GG",co,so),B("gg",co,so),B("GGGG",go,lo),B("gggg",go,lo),B("GGGGG",mo,uo),B("ggggg",mo,uo),$(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,o){t[o.substr(0,2)]=y(e)}),$(["gg","GG"],function(t,n,o,i){n[i]=e.parseTwoDigitYear(t)}),W("Q",0,"Qo","quarter"),O("quarter","Q"),B("Q",ro),G("Q",function(e,t){t[To]=3*(y(e)-1)}),W("w",["ww",2],"wo","week"),W("W",["WW",2],"Wo","isoWeek"),O("week","w"),O("isoWeek","W"),B("w",co),B("ww",co,so),B("W",co),B("WW",co,so),$(["w","ww","W","WW"],function(e,t,n,o){t[o.substr(0,1)]=y(e)});var ni={dow:0,doy:6};W("D",["DD",2],"Do","date"),O("date","D"),B("D",co),B("DD",co,so),B("Do",function(e,t){return e?t._ordinalParse:t._ordinalParseLenient}),G(["D","DD"],Mo),G("Do",function(e,t){t[Mo]=y(e.match(co)[0],10)});var oi=x("Date",!0);W("d",0,"do","day"),W("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),W("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),W("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),W("e",0,0,"weekday"),W("E",0,0,"isoWeekday"),O("day","d"),O("weekday","e"),O("isoWeekday","E"),B("d",co),B("e",co),B("E",co),B("dd",Ro),B("ddd",Ro),B("dddd",Ro),$(["dd","ddd","dddd"],function(e,t,n,o){var i=n._locale.weekdaysParse(e,o,n._strict);null!=i?t.d=i:d(n).invalidWeekday=e}),$(["d","e","E"],function(e,t,n,o){t[o]=y(e)});var ii="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),ri="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),si="Su_Mo_Tu_We_Th_Fr_Sa".split("_");W("DDD",["DDDD",3],"DDDo","dayOfYear"),O("dayOfYear","DDD"),B("DDD",po),B("DDDD",ao),G(["DDD","DDDD"],function(e,t,n){n._dayOfYear=y(e)}),W("H",["HH",2],0,"hour"),W("h",["hh",2],0,rn),W("hmm",0,0,function(){return""+rn.apply(this)+L(this.minutes(),2)}),W("hmmss",0,0,function(){return""+rn.apply(this)+L(this.minutes(),2)+L(this.seconds(),2)}),W("Hmm",0,0,function(){return""+this.hours()+L(this.minutes(),2)}),W("Hmmss",0,0,function(){return""+this.hours()+L(this.minutes(),2)+L(this.seconds(),2)}),sn("a",!0),sn("A",!1),O("hour","h"),B("a",an),B("A",an),B("H",co),B("h",co),B("HH",co,so),B("hh",co,so),B("hmm",ho),B("hmmss",fo),B("Hmm",ho),B("Hmmss",fo),G(["H","HH"],Oo),G(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),G(["h","hh"],function(e,t,n){t[Oo]=y(e),d(n).bigHour=!0}),G("hmm",function(e,t,n){var o=e.length-2;t[Oo]=y(e.substr(0,o)),t[ko]=y(e.substr(o)),d(n).bigHour=!0}),G("hmmss",function(e,t,n){var o=e.length-4,i=e.length-2;t[Oo]=y(e.substr(0,o)),t[ko]=y(e.substr(o,2)),t[Ho]=y(e.substr(i)),d(n).bigHour=!0}),G("Hmm",function(e,t,n){var o=e.length-2;t[Oo]=y(e.substr(0,o)),t[ko]=y(e.substr(o))}),G("Hmmss",function(e,t,n){var o=e.length-4,i=e.length-2;t[Oo]=y(e.substr(0,o)),t[ko]=y(e.substr(o,2)),t[Ho]=y(e.substr(i))});var ai=/[ap]\.?m?\.?/i,li=x("Hours",!0);W("m",["mm",2],0,"minute"),O("minute","m"),B("m",co),B("mm",co,so),G(["m","mm"],ko);var ui=x("Minutes",!1);W("s",["ss",2],0,"second"),O("second","s"),B("s",co),B("ss",co,so),G(["s","ss"],Ho);var ci=x("Seconds",!1);W("S",0,0,function(){return~~(this.millisecond()/100)}),W(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),W(0,["SSS",3],0,"millisecond"),W(0,["SSSS",4],0,function(){return 10*this.millisecond()}),W(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),W(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),W(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),W(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),W(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),O("millisecond","ms"),B("S",po,ro),B("SS",po,so),B("SSS",po,ao);var di;for(di="SSSS";di.length<=9;di+="S")B(di,vo);for(di="S";di.length<=9;di+="S")G(di,cn);var hi=x("Milliseconds",!1);W("z",0,0,"zoneAbbr"),W("zz",0,0,"zoneName");var fi=m.prototype;fi.add=Qo,fi.calendar=rt,fi.clone=st,fi.diff=ft,fi.endOf=Et,fi.format=vt,fi.from=wt,fi.fromNow=yt,fi.to=bt,fi.toNow=Ct,fi.get=N,fi.invalidAt=Pt,fi.isAfter=at,fi.isBefore=lt,fi.isBetween=ut,fi.isSame=ct,fi.isSameOrAfter=dt,fi.isSameOrBefore=ht,fi.isValid=xt,fi.lang=ti,fi.locale=Rt,fi.localeData=_t,fi.max=Xo,fi.min=$o,fi.parsingFlags=At,fi.set=N,fi.startOf=St,fi.subtract=ei,fi.toArray=kt,fi.toObject=Ht,fi.toDate=Ot,fi.toISOString=mt,fi.toJSON=Dt,fi.toString=gt,fi.unix=Mt,fi.valueOf=Tt,fi.creationData=Nt,fi.year=Go,fi.isLeapYear=ge,fi.weekYear=Wt,fi.isoWeekYear=It,fi.quarter=fi.quarters=zt,fi.month=ee,fi.daysInMonth=te,fi.week=fi.weeks=$t,fi.isoWeek=fi.isoWeeks=Xt,fi.weeksInYear=Vt,fi.isoWeeksInYear=jt,fi.date=oi,fi.day=fi.days=en,fi.weekday=tn,fi.isoWeekday=nn,fi.dayOfYear=on,fi.hour=fi.hours=li,fi.minute=fi.minutes=ui,fi.second=fi.seconds=ci,fi.millisecond=fi.milliseconds=hi,fi.utcOffset=Be,fi.utc=Ye,fi.local=Ue,fi.parseZone=Ge,fi.hasAlignedHourOffset=$e,fi.isDST=Xe,fi.isDSTShifted=Ke,fi.isLocal=qe,fi.isUtcOffset=Ze,fi.isUtc=Je,fi.isUTC=Je,fi.zoneAbbr=dn,fi.zoneName=hn,fi.dates=ae("dates accessor is deprecated. Use date instead.",oi),fi.months=ae("months accessor is deprecated. Use month instead",ee),fi.years=ae("years accessor is deprecated. Use year instead",Go),fi.zone=ae("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",ze);var pi=fi,gi={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},mi={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"},vi="Invalid date",wi="%d",yi=/\d{1,2}/,bi={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"},Ci=C.prototype;Ci._calendar=gi,Ci.calendar=gn,Ci._longDateFormat=mi,Ci.longDateFormat=mn,Ci._invalidDate=vi,Ci.invalidDate=vn,Ci._ordinal=wi,Ci.ordinal=wn,Ci._ordinalParse=yi,Ci.preparse=yn,Ci.postformat=yn,Ci._relativeTime=bi,Ci.relativeTime=bn,Ci.pastFuture=Cn,Ci.set=Rn,Ci.months=q,Ci._months=No,Ci.monthsShort=Z,Ci._monthsShort=Lo,Ci.monthsParse=J,Ci._monthsRegex=Io,Ci.monthsRegex=oe,Ci._monthsShortRegex=Wo,Ci.monthsShortRegex=ne,Ci.week=Yt,Ci._week=ni,Ci.firstDayOfYear=Gt,Ci.firstDayOfWeek=Ut,Ci.weekdays=qt,Ci._weekdays=ii,Ci.weekdaysMin=Jt,Ci._weekdaysMin=si,Ci.weekdaysShort=Zt,Ci._weekdaysShort=ri,Ci.weekdaysParse=Qt,Ci.isPM=ln,Ci._meridiemParse=ai,Ci.meridiem=un,E("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,n=1===y(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+n}}),e.lang=ae("moment.lang is deprecated. Use moment.locale instead.",E),e.langData=ae("moment.langData is deprecated. Use moment.localeData instead.",M);var Ri=Math.abs,_i=Vn("ms"),Si=Vn("s"),Ei=Vn("m"),Ti=Vn("h"),Mi=Vn("d"),Oi=Vn("w"),ki=Vn("M"),Hi=Vn("y"),Di=Bn("milliseconds"),xi=Bn("seconds"),Ai=Bn("minutes"),Pi=Bn("hours"),Ni=Bn("days"),Li=Bn("months"),Wi=Bn("years"),Ii=Math.round,ji={s:45,m:45,h:22,d:26,M:11},Vi=Math.abs,Fi=Le.prototype;Fi.abs=Hn,Fi.add=xn,Fi.subtract=An,Fi.as=In,Fi.asMilliseconds=_i,Fi.asSeconds=Si,Fi.asMinutes=Ei,Fi.asHours=Ti,Fi.asDays=Mi,Fi.asWeeks=Oi,Fi.asMonths=ki,Fi.asYears=Hi,Fi.valueOf=jn,Fi._bubble=Nn,Fi.get=Fn,Fi.milliseconds=Di,Fi.seconds=xi,Fi.minutes=Ai,Fi.hours=Pi,Fi.days=Ni,Fi.weeks=zn,Fi.months=Li,Fi.years=Wi,Fi.humanize=$n,Fi.toISOString=Xn,Fi.toString=Xn,Fi.toJSON=Xn,Fi.locale=Rt,Fi.localeData=_t,Fi.toIsoString=ae("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Xn),Fi.lang=ti,W("X",0,0,"unix"),W("x",0,0,"valueOf"),B("x",wo),B("X",Co),G("X",function(e,t,n){n._d=new Date(1e3*parseFloat(e,10))}),G("x",function(e,t,n){n._d=new Date(y(e))}),e.version="2.11.2",o(xe),e.fn=pi,e.min=Pe,e.max=Ne,e.now=Ko,e.utc=u,e.unix=fn,e.months=En,e.isDate=r,e.locale=E,e.invalid=f,e.duration=Qe,e.isMoment=v,e.weekdays=Mn,e.parseZone=pn,e.localeData=M,e.isDuration=We,e.monthsShort=Tn,e.weekdaysMin=kn,e.defineLocale=T,e.weekdaysShort=On,e.normalizeUnits=k,e.relativeTimeThreshold=Gn,e.prototype=pi;var Bi=e;return Bi})},{}],numeral:[function(t,n,o){"use strict";(function(){function t(e){this._value=e}function o(e,t,n,o){var i,r,s=Math.pow(10,t);return r=(n(e*s)/s).toFixed(t),o&&(i=new RegExp("0{1,"+o+"}$"),r=r.replace(i,"")),r}function i(e,t,n){var o;return o=t.indexOf("$")>-1?s(e,t,n):t.indexOf("%")>-1?a(e,t,n):t.indexOf(":")>-1?l(e,t):c(e._value,t,n)}function r(e,t){var n,o,i,r,s,a=t,l=["KB","MB","GB","TB","PB","EB","ZB","YB"],c=!1;if(t.indexOf(":")>-1)e._value=u(t);else if(t===w)e._value=0;else{for("."!==m[v].delimiters.decimal&&(t=t.replace(/\./g,"").replace(m[v].delimiters.decimal,".")),n=new RegExp("[^a-zA-Z]"+m[v].abbreviations.thousand+"(?:\\)|(\\"+m[v].currency.symbol+")?(?:\\))?)?$"),o=new RegExp("[^a-zA-Z]"+m[v].abbreviations.million+"(?:\\)|(\\"+m[v].currency.symbol+")?(?:\\))?)?$"),i=new RegExp("[^a-zA-Z]"+m[v].abbreviations.billion+"(?:\\)|(\\"+m[v].currency.symbol+")?(?:\\))?)?$"),r=new RegExp("[^a-zA-Z]"+m[v].abbreviations.trillion+"(?:\\)|(\\"+m[v].currency.symbol+")?(?:\\))?)?$"),s=0;s<=l.length&&!(c=t.indexOf(l[s])>-1?Math.pow(1024,s+1):!1);s++);e._value=(c?c:1)*(a.match(n)?Math.pow(10,3):1)*(a.match(o)?Math.pow(10,6):1)*(a.match(i)?Math.pow(10,9):1)*(a.match(r)?Math.pow(10,12):1)*(t.indexOf("%")>-1?.01:1)*((t.split("-").length+Math.min(t.split("(").length-1,t.split(")").length-1))%2?1:-1)*Number(t.replace(/[^0-9\.]+/g,"")),e._value=c?Math.ceil(e._value):e._value}return e._value}function s(e,t,n){var o,i,r=t.indexOf("$"),s=t.indexOf("("),a=t.indexOf("-"),l="";return t.indexOf(" $")>-1?(l=" ",t=t.replace(" $","")):t.indexOf("$ ")>-1?(l=" ",t=t.replace("$ ","")):t=t.replace("$",""),i=c(e._value,t,n),1>=r?i.indexOf("(")>-1||i.indexOf("-")>-1?(i=i.split(""),o=1,(s>r||a>r)&&(o=0),i.splice(o,0,m[v].currency.symbol+l),i=i.join("")):i=m[v].currency.symbol+l+i:i.indexOf(")")>-1?(i=i.split(""),i.splice(-1,0,l+m[v].currency.symbol),i=i.join("")):i=i+l+m[v].currency.symbol,i}function a(e,t,n){var o,i="",r=100*e._value;return t.indexOf(" %")>-1?(i=" ",t=t.replace(" %","")):t=t.replace("%",""),o=c(r,t,n),o.indexOf(")")>-1?(o=o.split(""),o.splice(-1,0,i+"%"),o=o.join("")):o=o+i+"%",o}function l(e){var t=Math.floor(e._value/60/60),n=Math.floor((e._value-60*t*60)/60),o=Math.round(e._value-60*t*60-60*n);return t+":"+(10>n?"0"+n:n)+":"+(10>o?"0"+o:o)}function u(e){var t=e.split(":"),n=0;return 3===t.length?(n+=60*Number(t[0])*60,n+=60*Number(t[1]),n+=Number(t[2])):2===t.length&&(n+=60*Number(t[0]),n+=Number(t[1])),Number(n)}function c(e,t,n){var i,r,s,a,l,u,c=!1,d=!1,h=!1,f="",p=!1,g=!1,y=!1,b=!1,C=!1,R="",_="",S=Math.abs(e),E=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],T="",M=!1;if(0===e&&null!==w)return w;if(t.indexOf("(")>-1?(c=!0,t=t.slice(1,-1)):t.indexOf("+")>-1&&(d=!0,t=t.replace(/\+/g,"")),t.indexOf("a")>-1&&(p=t.indexOf("aK")>=0,g=t.indexOf("aM")>=0,y=t.indexOf("aB")>=0,b=t.indexOf("aT")>=0,C=p||g||y||b,t.indexOf(" a")>-1?(f=" ",t=t.replace(" a","")):t=t.replace("a",""),S>=Math.pow(10,12)&&!C||b?(f+=m[v].abbreviations.trillion,e/=Math.pow(10,12)):S=Math.pow(10,9)&&!C||y?(f+=m[v].abbreviations.billion,e/=Math.pow(10,9)):S=Math.pow(10,6)&&!C||g?(f+=m[v].abbreviations.million,e/=Math.pow(10,6)):(S=Math.pow(10,3)&&!C||p)&&(f+=m[v].abbreviations.thousand,e/=Math.pow(10,3))),t.indexOf("b")>-1)for(t.indexOf(" b")>-1?(R=" ",t=t.replace(" b","")):t=t.replace("b",""),s=0;s<=E.length;s++)if(i=Math.pow(1024,s),r=Math.pow(1024,s+1),e>=i&&r>e){R+=E[s],i>0&&(e/=i);break}return t.indexOf("o")>-1&&(t.indexOf(" o")>-1?(_=" ",t=t.replace(" o","")):t=t.replace("o",""),_+=m[v].ordinal(e)),t.indexOf("[.]")>-1&&(h=!0,t=t.replace("[.]",".")),a=e.toString().split(".")[0],l=t.split(".")[1],u=t.indexOf(","),l?(l.indexOf("[")>-1?(l=l.replace("]",""),l=l.split("["),T=o(e,l[0].length+l[1].length,n,l[1].length)):T=o(e,l.length,n),a=T.split(".")[0],T=T.split(".")[1].length?m[v].delimiters.decimal+T.split(".")[1]:"",h&&0===Number(T.slice(1))&&(T="")):a=o(e,null,n),a.indexOf("-")>-1&&(a=a.slice(1),M=!0),u>-1&&(a=a.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+m[v].delimiters.thousands)),0===t.indexOf(".")&&(a=""),(c&&M?"(":"")+(!c&&M?"-":"")+(!M&&d?"+":"")+a+T+(_?_:"")+(f?f:"")+(R?R:"")+(c&&M?")":"")}function d(e,t){m[e]=t}function h(e){var t=e.toString().split(".");return t.length<2?1:Math.pow(10,t[1].length)}function f(){var e=Array.prototype.slice.call(arguments);return e.reduce(function(e,t){var n=h(e),o=h(t);return n>o?n:o},-(1/0))}var p,g="1.5.3",m={},v="en",w=null,y="0,0",b="undefined"!=typeof n&&n.exports;p=function(e){return p.isNumeral(e)?e=e.value():0===e||"undefined"==typeof e?e=0:Number(e)||(e=p.fn.unformat(e)),new t(Number(e))},p.version=g,p.isNumeral=function(e){return e instanceof t},p.language=function(e,t){if(!e)return v;if(e&&!t){if(!m[e])throw new Error("Unknown language : "+e);v=e}return!t&&m[e]||d(e,t),p},p.languageData=function(e){if(!e)return m[v];if(!m[e])throw new Error("Unknown language : "+e);return m[e]},p.language("en",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(e){var t=e%10;return 1===~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th"},currency:{symbol:"$"}}),p.zeroFormat=function(e){w="string"==typeof e?e:null},p.defaultFormat=function(e){y="string"==typeof e?e:"0.0"},p.validate=function(e,t){var n,o,i,r,s,a,l,u;if("string"!=typeof e&&(e+="",console.warn&&console.warn("Numeral.js: Value is not string. It has been co-erced to: ",e)),e=e.trim(),""===e)return!1;e=e.replace(/^[+-]?/,"");try{l=p.languageData(t)}catch(c){l=p.languageData(p.language())}return i=l.currency.symbol,s=l.abbreviations,n=l.delimiters.decimal,o="."===l.delimiters.thousands?"\\.":l.delimiters.thousands,u=e.match(/^[^\d\.\,]+/),null!==u&&(e=e.substr(1),u[0]!==i)?!1:(u=e.match(/[^\d]+$/),null!==u&&(e=e.slice(0,-1),u[0]!==s.thousand&&u[0]!==s.million&&u[0]!==s.billion&&u[0]!==s.trillion)?!1:e.match(/^\d+$/)?!0:(a=new RegExp(o+"{2}"),e.match(/[^\d.,]/g)?!1:(r=e.split(n),r.length>2?!1:r.length<2?!!r[0].match(/^\d+.*\d$/)&&!r[0].match(a):""===r[0]?!r[0].match(a)&&!!r[1].match(/^\d+$/):1===r[0].length?!!r[0].match(/^\d+$/)&&!r[0].match(a)&&!!r[1].match(/^\d+$/):!!r[0].match(/^\d+.*\d$/)&&!r[0].match(a)&&!!r[1].match(/^\d+$/))))},"function"!=typeof Array.prototype.reduce&&(Array.prototype.reduce=function(e,t){if(null===this||"undefined"==typeof this)throw new TypeError("Array.prototype.reduce called on null or undefined");if("function"!=typeof e)throw new TypeError(e+" is not a function");var n,o,i=this.length>>>0,r=!1;for(1n;++n)this.hasOwnProperty(n)&&(r?o=e(o,this[n],n,this):(o=this[n],r=!0));if(!r)throw new TypeError("Reduce of empty array with no initial value");return o}),p.fn=t.prototype={clone:function(){return p(this)},format:function(e,t){return i(this,e?e:y,void 0!==t?t:Math.round)},unformat:function(e){return"[object Number]"===Object.prototype.toString.call(e)?e:r(this,e?e:y)},value:function(){return this._value},valueOf:function(){return this._value},set:function(e){return this._value=Number(e),this},add:function(e){function t(e,t,o,i){return e+n*t}var n=f.call(null,this._value,e);return this._value=[this._value,e].reduce(t,0)/n,this},subtract:function(e){function t(e,t,o,i){return e-n*t}var n=f.call(null,this._value,e);return this._value=[e].reduce(t,this._value*n)/n,this},multiply:function(e){function t(e,t,n,o){var i=f(e,t);return e*i*(t*i)/(i*i)}return this._value=[this._value,e].reduce(t,1),this},divide:function(e){function t(e,t,n,o){var i=f(e,t);return e*i/(t*i)}return this._value=[this._value,e].reduce(t),this},difference:function(e){return Math.abs(p(this._value).subtract(e).value())}},b&&(n.exports=p),"undefined"==typeof ender&&(this.numeral=p),"function"==typeof e&&e.amd&&e([],function(){return p})}).call(window)},{}],pikaday:[function(t,n,o){/*! * Pikaday * * Copyright © 2014 David Bushell | BSD & MIT license | https://github.com/dbushell/Pikaday */ -!function(r,i){"use strict";var s;if("object"==typeof o){try{s=t("moment")}catch(a){}n.exports=i(s)}else"function"==typeof e&&e.amd?e(function(e){var t="moment";try{s=e(t)}catch(n){}return i(s)}):r.Pikaday=i(r.moment)}(this,function(e){"use strict";var t="function"==typeof e,n=!!window.addEventListener,o=window.document,r=window.setTimeout,i=function(e,t,o,r){n?e.addEventListener(t,o,!!r):e.attachEvent("on"+t,o)},s=function(e,t,o,r){n?e.removeEventListener(t,o,!!r):e.detachEvent("on"+t,o)},a=function(e,t,n){var r;o.createEvent?(r=o.createEvent("HTMLEvents"),r.initEvent(t,!0,!1),r=y(r,n),e.dispatchEvent(r)):o.createEventObject&&(r=o.createEventObject(),r=y(r,n),e.fireEvent("on"+t,r))},l=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},u=function(e,t){return-1!==(" "+e.className+" ").indexOf(" "+t+" ")},c=function(e,t){u(e,t)||(e.className=""===e.className?t:e.className+" "+t)},d=function(e,t){e.className=l((" "+e.className+" ").replace(" "+t+" "," "))},h=function(e){return/Array/.test(Object.prototype.toString.call(e))},f=function(e){return/Date/.test(Object.prototype.toString.call(e))&&!isNaN(e.getTime())},p=function(e){var t=e.getDay();return 0===t||6===t},g=function(e){return e%4===0&&e%100!==0||e%400===0},m=function(e,t){return[31,g(e)?29:28,31,30,31,30,31,31,30,31,30,31][t]},v=function(e){f(e)&&e.setHours(0,0,0,0)},w=function(e,t){return e.getTime()===t.getTime()},y=function(e,t,n){var o,r;for(o in t)r=void 0!==e[o],r&&"object"==typeof t[o]&&null!==t[o]&&void 0===t[o].nodeName?f(t[o])?n&&(e[o]=new Date(t[o].getTime())):h(t[o])?n&&(e[o]=t[o].slice(0)):e[o]=y({},t[o],n):(n||!r)&&(e[o]=t[o]);return e},b=function(e){return e.month<0&&(e.year-=Math.ceil(Math.abs(e.month)/12),e.month+=12),e.month>11&&(e.year+=Math.floor(Math.abs(e.month)/12),e.month-=12),e},C={field:null,bound:void 0,position:"bottom left",reposition:!0,format:"YYYY-MM-DD",defaultDate:null,setDefaultDate:!1,firstDay:0,minDate:null,maxDate:null,yearRange:10,showWeekNumber:!1,minYear:0,maxYear:9999,minMonth:void 0,maxMonth:void 0,startRange:null,endRange:null,isRTL:!1,yearSuffix:"",showMonthAfterYear:!1,numberOfMonths:1,mainCalendar:"left",container:void 0,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:null,onSelect:null,onOpen:null,onClose:null,onDraw:null},R=function(e,t,n){for(t+=e.firstDay;t>=7;)t-=7;return n?e.i18n.weekdaysShort[t]:e.i18n.weekdays[t]},_=function(e){if(e.isEmpty)return'';var t=[];return e.isDisabled&&t.push("is-disabled"),e.isToday&&t.push("is-today"),e.isSelected&&t.push("is-selected"),e.isInRange&&t.push("is-inrange"),e.isStartRange&&t.push("is-startrange"),e.isEndRange&&t.push("is-endrange"),'"},S=function(e,t,n){var o=new Date(n,0,1),r=Math.ceil(((new Date(n,t,e)-o)/864e5+o.getDay()+1)/7);return''+r+""},E=function(e,t){return""+(t?e.reverse():e).join("")+""},T=function(e){return""+e.join("")+""},M=function(e){var t,n=[];for(e.showWeekNumber&&n.push(""),t=0;7>t;t++)n.push(''+R(e,t,!0)+"");return""+(e.isRTL?n.reverse():n).join("")+""},O=function(e,t,n,o,r){var i,s,a,l,u,c=e._o,d=n===c.minYear,f=n===c.maxYear,p='
',g=!0,m=!0;for(a=[],i=0;12>i;i++)a.push('");for(l='
'+c.i18n.months[o]+'
",h(c.yearRange)?(i=c.yearRange[0],s=c.yearRange[1]+1):(i=n-c.yearRange,s=1+n+c.yearRange),a=[];s>i&&i<=c.maxYear;i++)i>=c.minYear&&a.push('");return u='
'+n+c.yearSuffix+'
",p+=c.showMonthAfterYear?u+l:l+u,d&&(0===o||c.minMonth>=o)&&(g=!1),f&&(11===o||c.maxMonth<=o)&&(m=!1),0===t&&(p+='"),t===e._o.numberOfMonths-1&&(p+='"),p+="
"},k=function(e,t){return''+M(e)+T(t)+"
"},H=function(s){var a=this,l=a.config(s);a._onMouseDown=function(e){if(a._v){e=e||window.event;var t=e.target||e.srcElement;if(t)if(u(t,"is-disabled")||(u(t,"pika-button")&&!u(t,"is-empty")?(a.setDate(new Date(t.getAttribute("data-pika-year"),t.getAttribute("data-pika-month"),t.getAttribute("data-pika-day"))),l.bound&&r(function(){a.hide(),l.field&&l.field.blur()},100)):u(t,"pika-prev")?a.prevMonth():u(t,"pika-next")&&a.nextMonth()),u(t,"pika-select"))a._c=!0;else{if(!e.preventDefault)return e.returnValue=!1,!1;e.preventDefault()}}},a._onChange=function(e){e=e||window.event;var t=e.target||e.srcElement;t&&(u(t,"pika-select-month")?a.gotoMonth(t.value):u(t,"pika-select-year")&&a.gotoYear(t.value))},a._onInputChange=function(n){var o;n.firedBy!==a&&(t?(o=e(l.field.value,l.format),o=o&&o.isValid()?o.toDate():null):o=new Date(Date.parse(l.field.value)),f(o)&&a.setDate(o),a._v||a.show())},a._onInputFocus=function(){a.show()},a._onInputClick=function(){a.show()},a._onInputBlur=function(){var e=o.activeElement;do if(u(e,"pika-single"))return;while(e=e.parentNode);a._c||(a._b=r(function(){a.hide()},50)),a._c=!1},a._onClick=function(e){e=e||window.event;var t=e.target||e.srcElement,o=t;if(t){!n&&u(t,"pika-select")&&(t.onchange||(t.setAttribute("onchange","return;"),i(t,"change",a._onChange)));do if(u(o,"pika-single")||o===l.trigger)return;while(o=o.parentNode);a._v&&t!==l.trigger&&o!==l.trigger&&a.hide()}},a.el=o.createElement("div"),a.el.className="pika-single"+(l.isRTL?" is-rtl":"")+(l.theme?" "+l.theme:""),i(a.el,"mousedown",a._onMouseDown,!0),i(a.el,"touchend",a._onMouseDown,!0),i(a.el,"change",a._onChange),l.field&&(l.container?l.container.appendChild(a.el):l.bound?o.body.appendChild(a.el):l.field.parentNode.insertBefore(a.el,l.field.nextSibling),i(l.field,"change",a._onInputChange),l.defaultDate||(t&&l.field.value?l.defaultDate=e(l.field.value,l.format).toDate():l.defaultDate=new Date(Date.parse(l.field.value)),l.setDefaultDate=!0));var c=l.defaultDate;f(c)?l.setDefaultDate?a.setDate(c,!0):a.gotoDate(c):a.gotoDate(new Date),l.bound?(this.hide(),a.el.className+=" is-bound",i(l.trigger,"click",a._onInputClick),i(l.trigger,"focus",a._onInputFocus),i(l.trigger,"blur",a._onInputBlur)):this.show()};return H.prototype={config:function(e){this._o||(this._o=y({},C,!0));var t=y(this._o,e,!0);t.isRTL=!!t.isRTL,t.field=t.field&&t.field.nodeName?t.field:null,t.theme="string"==typeof t.theme&&t.theme?t.theme:null,t.bound=!!(void 0!==t.bound?t.field&&t.bound:t.field),t.trigger=t.trigger&&t.trigger.nodeName?t.trigger:t.field,t.disableWeekends=!!t.disableWeekends,t.disableDayFn="function"==typeof t.disableDayFn?t.disableDayFn:null;var n=parseInt(t.numberOfMonths,10)||1;if(t.numberOfMonths=n>4?4:n,f(t.minDate)||(t.minDate=!1),f(t.maxDate)||(t.maxDate=!1),t.minDate&&t.maxDate&&t.maxDate100&&(t.yearRange=100);return t},toString:function(n){return f(this._d)?t?e(this._d).format(n||this._o.format):this._d.toDateString():""},getMoment:function(){return t?e(this._d):null},setMoment:function(n,o){t&&e.isMoment(n)&&this.setDate(n.toDate(),o)},getDate:function(){return f(this._d)?new Date(this._d.getTime()):null},setDate:function(e,t){if(!e)return this._d=null,this._o.field&&(this._o.field.value="",a(this._o.field,"change",{firedBy:this})),this.draw();if("string"==typeof e&&(e=new Date(Date.parse(e))),f(e)){var n=this._o.minDate,o=this._o.maxDate;f(n)&&n>e?e=n:f(o)&&e>o&&(e=o),this._d=new Date(e.getTime()),v(this._d),this.gotoDate(this._d),this._o.field&&(this._o.field.value=this.toString(),a(this._o.field,"change",{firedBy:this})),t||"function"!=typeof this._o.onSelect||this._o.onSelect.call(this,this.getDate())}},gotoDate:function(e){var t=!0;if(f(e)){if(this.calendars){var n=new Date(this.calendars[0].year,this.calendars[0].month,1),o=new Date(this.calendars[this.calendars.length-1].year,this.calendars[this.calendars.length-1].month,1),r=e.getTime();o.setMonth(o.getMonth()+1),o.setDate(o.getDate()-1),t=r=o&&(this._y=o,!isNaN(s)&&this._m>s&&(this._m=s));for(var l=0;l'+O(this,l,this.calendars[l].year,this.calendars[l].month,this.calendars[0].year)+this.render(this.calendars[l].year,this.calendars[l].month)+"";if(this.el.innerHTML=a,t.bound&&"hidden"!==t.field.type&&r(function(){t.trigger.focus()},1),"function"==typeof this._o.onDraw){var u=this;r(function(){u._o.onDraw.call(u)},0)}}},adjustPosition:function(){var e,t,n,r,i,s,a,l,u,c;if(!this._o.container){if(this.el.style.position="absolute",e=this._o.trigger,t=e,n=this.el.offsetWidth,r=this.el.offsetHeight,i=window.innerWidth||o.documentElement.clientWidth,s=window.innerHeight||o.documentElement.clientHeight,a=window.pageYOffset||o.body.scrollTop||o.documentElement.scrollTop,"function"==typeof e.getBoundingClientRect)c=e.getBoundingClientRect(),l=c.left+window.pageXOffset,u=c.bottom+window.pageYOffset;else for(l=t.offsetLeft,u=t.offsetTop+t.offsetHeight;t=t.offsetParent;)l+=t.offsetLeft,u+=t.offsetTop;(this._o.reposition&&l+n>i||this._o.position.indexOf("right")>-1&&l-n+e.offsetWidth>0)&&(l=l-n+e.offsetWidth),(this._o.reposition&&u+r>s+a||this._o.position.indexOf("top")>-1&&u-r-e.offsetHeight>0)&&(u=u-r-e.offsetHeight),this.el.style.left=l+"px",this.el.style.top=u+"px"}},render:function(e,t){var n=this._o,o=new Date,r=m(e,t),i=new Date(e,t,1).getDay(),s=[],a=[];v(o),n.firstDay>0&&(i-=n.firstDay,0>i&&(i+=7));for(var l=r+i,u=l;u>7;)u-=7;l+=7-u;for(var c=0,d=0;l>c;c++){var h=new Date(e,t,1+(c-i)),g=f(this._d)?w(h,this._d):!1,y=w(h,o),b=i>c||c>=r+i,C=n.startRange&&w(n.startRange,h),R=n.endRange&&w(n.endRange,h),T=n.startRange&&n.endRange&&n.startRangen.maxDate||n.disableWeekends&&p(h)||n.disableDayFn&&n.disableDayFn(h),O={day:1+(c-i),month:t,year:e,isSelected:g,isToday:y,isDisabled:M,isEmpty:b,isStartRange:C,isEndRange:R,isInRange:T};a.push(_(O)),7===++d&&(n.showWeekNumber&&a.unshift(S(c-i,t,e)),s.push(E(a,n.isRTL)),a=[],d=0)}return k(n,s)},isVisible:function(){return this._v},show:function(){this._v||(d(this.el,"is-hidden"),this._v=!0,this.draw(),this._o.bound&&(i(o,"click",this._onClick),this.adjustPosition()),"function"==typeof this._o.onOpen&&this._o.onOpen.call(this))},hide:function(){var e=this._v;e!==!1&&(this._o.bound&&s(o,"click",this._onClick),this.el.style.position="static",this.el.style.left="auto",this.el.style.top="auto",c(this.el,"is-hidden"),this._v=!1,void 0!==e&&"function"==typeof this._o.onClose&&this._o.onClose.call(this))},destroy:function(){this.hide(),s(this.el,"mousedown",this._onMouseDown,!0),s(this.el,"touchend",this._onMouseDown,!0),s(this.el,"change",this._onChange),this._o.field&&(s(this._o.field,"change",this._onInputChange),this._o.bound&&(s(this._o.trigger,"click",this._onInputClick),s(this._o.trigger,"focus",this._onInputFocus),s(this._o.trigger,"blur",this._onInputBlur))),this.el.parentNode&&this.el.parentNode.removeChild(this.el)}},H})},{moment:"moment"}],zeroclipboard:[function(t,n,o){/*! +!function(i,r){"use strict";var s;if("object"==typeof o){try{s=t("moment")}catch(a){}n.exports=r(s)}else"function"==typeof e&&e.amd?e(function(e){var t="moment";try{s=e(t)}catch(n){}return r(s)}):i.Pikaday=r(i.moment)}(this,function(e){"use strict";var t="function"==typeof e,n=!!window.addEventListener,o=window.document,i=window.setTimeout,r=function(e,t,o,i){n?e.addEventListener(t,o,!!i):e.attachEvent("on"+t,o)},s=function(e,t,o,i){n?e.removeEventListener(t,o,!!i):e.detachEvent("on"+t,o)},a=function(e,t,n){var i;o.createEvent?(i=o.createEvent("HTMLEvents"),i.initEvent(t,!0,!1),i=y(i,n),e.dispatchEvent(i)):o.createEventObject&&(i=o.createEventObject(),i=y(i,n),e.fireEvent("on"+t,i))},l=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},u=function(e,t){return-1!==(" "+e.className+" ").indexOf(" "+t+" ")},c=function(e,t){u(e,t)||(e.className=""===e.className?t:e.className+" "+t)},d=function(e,t){e.className=l((" "+e.className+" ").replace(" "+t+" "," "))},h=function(e){return/Array/.test(Object.prototype.toString.call(e))},f=function(e){return/Date/.test(Object.prototype.toString.call(e))&&!isNaN(e.getTime())},p=function(e){var t=e.getDay();return 0===t||6===t},g=function(e){return e%4===0&&e%100!==0||e%400===0},m=function(e,t){return[31,g(e)?29:28,31,30,31,30,31,31,30,31,30,31][t]},v=function(e){f(e)&&e.setHours(0,0,0,0)},w=function(e,t){return e.getTime()===t.getTime()},y=function(e,t,n){var o,i;for(o in t)i=void 0!==e[o],i&&"object"==typeof t[o]&&null!==t[o]&&void 0===t[o].nodeName?f(t[o])?n&&(e[o]=new Date(t[o].getTime())):h(t[o])?n&&(e[o]=t[o].slice(0)):e[o]=y({},t[o],n):!n&&i||(e[o]=t[o]);return e},b=function(e){return e.month<0&&(e.year-=Math.ceil(Math.abs(e.month)/12),e.month+=12),e.month>11&&(e.year+=Math.floor(Math.abs(e.month)/12),e.month-=12),e},C={field:null,bound:void 0,position:"bottom left",reposition:!0,format:"YYYY-MM-DD",defaultDate:null,setDefaultDate:!1,firstDay:0,minDate:null,maxDate:null,yearRange:10,showWeekNumber:!1,minYear:0,maxYear:9999,minMonth:void 0,maxMonth:void 0,startRange:null,endRange:null,isRTL:!1,yearSuffix:"",showMonthAfterYear:!1,numberOfMonths:1,mainCalendar:"left",container:void 0,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:null,onSelect:null,onOpen:null,onClose:null,onDraw:null},R=function(e,t,n){for(t+=e.firstDay;t>=7;)t-=7;return n?e.i18n.weekdaysShort[t]:e.i18n.weekdays[t]},_=function(e){if(e.isEmpty)return'';var t=[];return e.isDisabled&&t.push("is-disabled"),e.isToday&&t.push("is-today"),e.isSelected&&t.push("is-selected"),e.isInRange&&t.push("is-inrange"),e.isStartRange&&t.push("is-startrange"),e.isEndRange&&t.push("is-endrange"),'"},S=function(e,t,n){var o=new Date(n,0,1),i=Math.ceil(((new Date(n,t,e)-o)/864e5+o.getDay()+1)/7);return''+i+""},E=function(e,t){return""+(t?e.reverse():e).join("")+""},T=function(e){return""+e.join("")+""},M=function(e){var t,n=[];for(e.showWeekNumber&&n.push(""),t=0;7>t;t++)n.push(''+R(e,t,!0)+"");return""+(e.isRTL?n.reverse():n).join("")+""},O=function(e,t,n,o,i){var r,s,a,l,u,c=e._o,d=n===c.minYear,f=n===c.maxYear,p='
',g=!0,m=!0;for(a=[],r=0;12>r;r++)a.push('");for(l='
'+c.i18n.months[o]+'
",h(c.yearRange)?(r=c.yearRange[0],s=c.yearRange[1]+1):(r=n-c.yearRange,s=1+n+c.yearRange),a=[];s>r&&r<=c.maxYear;r++)r>=c.minYear&&a.push('");return u='
'+n+c.yearSuffix+'
",p+=c.showMonthAfterYear?u+l:l+u,d&&(0===o||c.minMonth>=o)&&(g=!1),f&&(11===o||c.maxMonth<=o)&&(m=!1),0===t&&(p+='"),t===e._o.numberOfMonths-1&&(p+='"),p+="
"},k=function(e,t){return''+M(e)+T(t)+"
"},H=function(s){var a=this,l=a.config(s);a._onMouseDown=function(e){if(a._v){e=e||window.event;var t=e.target||e.srcElement;if(t)if(u(t,"is-disabled")||(u(t,"pika-button")&&!u(t,"is-empty")?(a.setDate(new Date(t.getAttribute("data-pika-year"),t.getAttribute("data-pika-month"),t.getAttribute("data-pika-day"))),l.bound&&i(function(){a.hide(),l.field&&l.field.blur()},100)):u(t,"pika-prev")?a.prevMonth():u(t,"pika-next")&&a.nextMonth()),u(t,"pika-select"))a._c=!0;else{if(!e.preventDefault)return e.returnValue=!1,!1;e.preventDefault()}}},a._onChange=function(e){e=e||window.event;var t=e.target||e.srcElement;t&&(u(t,"pika-select-month")?a.gotoMonth(t.value):u(t,"pika-select-year")&&a.gotoYear(t.value))},a._onInputChange=function(n){var o;n.firedBy!==a&&(t?(o=e(l.field.value,l.format),o=o&&o.isValid()?o.toDate():null):o=new Date(Date.parse(l.field.value)),f(o)&&a.setDate(o),a._v||a.show())},a._onInputFocus=function(){a.show()},a._onInputClick=function(){a.show()},a._onInputBlur=function(){var e=o.activeElement;do if(u(e,"pika-single"))return;while(e=e.parentNode);a._c||(a._b=i(function(){a.hide()},50)),a._c=!1},a._onClick=function(e){e=e||window.event;var t=e.target||e.srcElement,o=t;if(t){!n&&u(t,"pika-select")&&(t.onchange||(t.setAttribute("onchange","return;"),r(t,"change",a._onChange)));do if(u(o,"pika-single")||o===l.trigger)return;while(o=o.parentNode);a._v&&t!==l.trigger&&o!==l.trigger&&a.hide()}},a.el=o.createElement("div"),a.el.className="pika-single"+(l.isRTL?" is-rtl":"")+(l.theme?" "+l.theme:""),r(a.el,"mousedown",a._onMouseDown,!0),r(a.el,"touchend",a._onMouseDown,!0),r(a.el,"change",a._onChange),l.field&&(l.container?l.container.appendChild(a.el):l.bound?o.body.appendChild(a.el):l.field.parentNode.insertBefore(a.el,l.field.nextSibling),r(l.field,"change",a._onInputChange),l.defaultDate||(t&&l.field.value?l.defaultDate=e(l.field.value,l.format).toDate():l.defaultDate=new Date(Date.parse(l.field.value)),l.setDefaultDate=!0));var c=l.defaultDate;f(c)?l.setDefaultDate?a.setDate(c,!0):a.gotoDate(c):a.gotoDate(new Date),l.bound?(this.hide(),a.el.className+=" is-bound",r(l.trigger,"click",a._onInputClick),r(l.trigger,"focus",a._onInputFocus),r(l.trigger,"blur",a._onInputBlur)):this.show()};return H.prototype={config:function(e){this._o||(this._o=y({},C,!0));var t=y(this._o,e,!0);t.isRTL=!!t.isRTL,t.field=t.field&&t.field.nodeName?t.field:null,t.theme="string"==typeof t.theme&&t.theme?t.theme:null,t.bound=!!(void 0!==t.bound?t.field&&t.bound:t.field),t.trigger=t.trigger&&t.trigger.nodeName?t.trigger:t.field,t.disableWeekends=!!t.disableWeekends,t.disableDayFn="function"==typeof t.disableDayFn?t.disableDayFn:null;var n=parseInt(t.numberOfMonths,10)||1;if(t.numberOfMonths=n>4?4:n,f(t.minDate)||(t.minDate=!1),f(t.maxDate)||(t.maxDate=!1),t.minDate&&t.maxDate&&t.maxDate100&&(t.yearRange=100);return t},toString:function(n){return f(this._d)?t?e(this._d).format(n||this._o.format):this._d.toDateString():""},getMoment:function(){return t?e(this._d):null},setMoment:function(n,o){t&&e.isMoment(n)&&this.setDate(n.toDate(),o)},getDate:function(){return f(this._d)?new Date(this._d.getTime()):null},setDate:function(e,t){if(!e)return this._d=null,this._o.field&&(this._o.field.value="",a(this._o.field,"change",{firedBy:this})),this.draw();if("string"==typeof e&&(e=new Date(Date.parse(e))),f(e)){var n=this._o.minDate,o=this._o.maxDate;f(n)&&n>e?e=n:f(o)&&e>o&&(e=o),this._d=new Date(e.getTime()),v(this._d),this.gotoDate(this._d),this._o.field&&(this._o.field.value=this.toString(),a(this._o.field,"change",{firedBy:this})),t||"function"!=typeof this._o.onSelect||this._o.onSelect.call(this,this.getDate())}},gotoDate:function(e){var t=!0;if(f(e)){if(this.calendars){var n=new Date(this.calendars[0].year,this.calendars[0].month,1),o=new Date(this.calendars[this.calendars.length-1].year,this.calendars[this.calendars.length-1].month,1),i=e.getTime();o.setMonth(o.getMonth()+1),o.setDate(o.getDate()-1),t=i=o&&(this._y=o,!isNaN(s)&&this._m>s&&(this._m=s));for(var l=0;l'+O(this,l,this.calendars[l].year,this.calendars[l].month,this.calendars[0].year)+this.render(this.calendars[l].year,this.calendars[l].month)+"";if(this.el.innerHTML=a,t.bound&&"hidden"!==t.field.type&&i(function(){t.trigger.focus()},1),"function"==typeof this._o.onDraw){var u=this;i(function(){u._o.onDraw.call(u)},0)}}},adjustPosition:function(){var e,t,n,i,r,s,a,l,u,c;if(!this._o.container){if(this.el.style.position="absolute",e=this._o.trigger,t=e,n=this.el.offsetWidth,i=this.el.offsetHeight,r=window.innerWidth||o.documentElement.clientWidth,s=window.innerHeight||o.documentElement.clientHeight,a=window.pageYOffset||o.body.scrollTop||o.documentElement.scrollTop,"function"==typeof e.getBoundingClientRect)c=e.getBoundingClientRect(),l=c.left+window.pageXOffset,u=c.bottom+window.pageYOffset;else for(l=t.offsetLeft,u=t.offsetTop+t.offsetHeight;t=t.offsetParent;)l+=t.offsetLeft,u+=t.offsetTop;(this._o.reposition&&l+n>r||this._o.position.indexOf("right")>-1&&l-n+e.offsetWidth>0)&&(l=l-n+e.offsetWidth),(this._o.reposition&&u+i>s+a||this._o.position.indexOf("top")>-1&&u-i-e.offsetHeight>0)&&(u=u-i-e.offsetHeight),this.el.style.left=l+"px",this.el.style.top=u+"px"}},render:function(e,t){var n=this._o,o=new Date,i=m(e,t),r=new Date(e,t,1).getDay(),s=[],a=[];v(o),n.firstDay>0&&(r-=n.firstDay,0>r&&(r+=7));for(var l=i+r,u=l;u>7;)u-=7;l+=7-u;for(var c=0,d=0;l>c;c++){var h=new Date(e,t,1+(c-r)),g=f(this._d)?w(h,this._d):!1,y=w(h,o),b=r>c||c>=i+r,C=n.startRange&&w(n.startRange,h),R=n.endRange&&w(n.endRange,h),T=n.startRange&&n.endRange&&n.startRangen.maxDate||n.disableWeekends&&p(h)||n.disableDayFn&&n.disableDayFn(h),O={day:1+(c-r),month:t,year:e,isSelected:g,isToday:y,isDisabled:M,isEmpty:b,isStartRange:C,isEndRange:R,isInRange:T};a.push(_(O)),7===++d&&(n.showWeekNumber&&a.unshift(S(c-r,t,e)),s.push(E(a,n.isRTL)),a=[],d=0)}return k(n,s)},isVisible:function(){return this._v},show:function(){this._v||(d(this.el,"is-hidden"),this._v=!0,this.draw(),this._o.bound&&(r(o,"click",this._onClick),this.adjustPosition()),"function"==typeof this._o.onOpen&&this._o.onOpen.call(this))},hide:function(){var e=this._v;e!==!1&&(this._o.bound&&s(o,"click",this._onClick),this.el.style.position="static",this.el.style.left="auto",this.el.style.top="auto",c(this.el,"is-hidden"),this._v=!1,void 0!==e&&"function"==typeof this._o.onClose&&this._o.onClose.call(this))},destroy:function(){this.hide(),s(this.el,"mousedown",this._onMouseDown,!0),s(this.el,"touchend",this._onMouseDown,!0),s(this.el,"change",this._onChange),this._o.field&&(s(this._o.field,"change",this._onInputChange),this._o.bound&&(s(this._o.trigger,"click",this._onInputClick),s(this._o.trigger,"focus",this._onInputFocus),s(this._o.trigger,"blur",this._onInputBlur))),this.el.parentNode&&this.el.parentNode.removeChild(this.el)}},H})},{moment:"moment"}],zeroclipboard:[function(t,n,o){/*! * 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 @@ -51,4 +51,4 @@ if(t.indexOf(":")>-1)e._value=u(t);else if(t===w)e._value=0;else{for("."!==m[v]. * http://zeroclipboard.org/ * v2.2.0 */ -!function(t,o){"use strict";var r,i,s,a=t,l=a.document,u=a.navigator,c=a.setTimeout,d=a.clearTimeout,h=a.setInterval,f=a.clearInterval,p=a.getComputedStyle,g=a.encodeURIComponent,m=a.ActiveXObject,v=a.Error,w=a.Number.parseInt||a.parseInt,y=a.Number.parseFloat||a.parseFloat,b=a.Number.isNaN||a.isNaN,C=a.Date.now,R=a.Object.keys,_=a.Object.defineProperty,S=a.Object.prototype.hasOwnProperty,E=a.Array.prototype.slice,T=function(){var e=function(e){return e};if("function"==typeof a.wrap&&"function"==typeof a.unwrap)try{var t=l.createElement("div"),n=a.unwrap(t);1===t.nodeType&&n&&1===n.nodeType&&(e=a.unwrap)}catch(o){}return e}(),M=function(e){return E.call(e,0)},O=function(){var e,t,n,r,i,s,a=M(arguments),l=a[0]||{};for(e=1,t=a.length;t>e;e++)if(null!=(n=a[e]))for(r in n)S.call(n,r)&&(i=l[r],s=n[r],l!==s&&s!==o&&(l[r]=s));return l},k=function(e){var t,n,o,r;if("object"!=typeof e||null==e||"number"==typeof e.nodeType)t=e;else if("number"==typeof e.length)for(t=[],n=0,o=e.length;o>n;n++)S.call(e,n)&&(t[n]=k(e[n]));else{t={};for(r in e)S.call(e,r)&&(t[r]=k(e[r]))}return t},H=function(e,t){for(var n={},o=0,r=t.length;r>o;o++)t[o]in e&&(n[t[o]]=e[t[o]]);return n},D=function(e,t){var n={};for(var o in e)-1===t.indexOf(o)&&(n[o]=e[o]);return n},x=function(e){if(e)for(var t in e)S.call(e,t)&&delete e[t];return e},A=function(e,t){if(e&&1===e.nodeType&&e.ownerDocument&&t&&(1===t.nodeType&&t.ownerDocument&&t.ownerDocument===e.ownerDocument||9===t.nodeType&&!t.ownerDocument&&t===e.ownerDocument))do{if(e===t)return!0;e=e.parentNode}while(e);return!1},P=function(e){var t;return"string"==typeof e&&e&&(t=e.split("#")[0].split("?")[0],t=e.slice(0,e.lastIndexOf("/")+1)),t},N=function(e){var t,n;return"string"==typeof e&&e&&(n=e.match(/^(?:|[^:@]*@|.+\)@(?=http[s]?|file)|.+?\s+(?: at |@)(?:[^:\(]+ )*[\(]?)((?:http[s]?|file):\/\/[\/]?.+?\/[^:\)]*?)(?::\d+)(?::\d+)?/),n&&n[1]?t=n[1]:(n=e.match(/\)@((?:http[s]?|file):\/\/[\/]?.+?\/[^:\)]*?)(?::\d+)(?::\d+)?/),n&&n[1]&&(t=n[1]))),t},L=function(){var e,t;try{throw new v}catch(n){t=n}return t&&(e=t.sourceURL||t.fileName||N(t.stack)),e},W=function(){var e,t,n;if(l.currentScript&&(e=l.currentScript.src))return e;if(t=l.getElementsByTagName("script"),1===t.length)return t[0].src||o;if("readyState"in t[0])for(n=t.length;n--;)if("interactive"===t[n].readyState&&(e=t[n].src))return e;return"loading"===l.readyState&&(e=t[t.length-1].src)?e:(e=L())?e:o},I=function(){var e,t,n,r=l.getElementsByTagName("script");for(e=r.length;e--;){if(!(n=r[e].src)){t=null;break}if(n=P(n),null==t)t=n;else if(t!==n){t=null;break}}return t||o},j=function(){var e=P(W())||I()||"";return e+"ZeroClipboard.swf"},V=function(){return null==t.opener&&(!!t.top&&t!=t.top||!!t.parent&&t!=t.parent)}(),B={bridge:null,version:"0.0.0",pluginType:"unknown",disabled:null,outdated:null,sandboxed:null,unavailable:null,degraded:null,deactivated:null,overdue:null,ready:null},F="11.0.0",z={},Y={},U=null,G=0,$=0,K={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"}},X=["flash-unavailable","flash-degraded","flash-overdue","version-mismatch","config-mismatch","clipboard-error"],q=["flash-disabled","flash-outdated","flash-sandboxed","flash-unavailable","flash-degraded","flash-deactivated","flash-overdue"],Z=new RegExp("^flash-("+q.map(function(e){return e.replace(/^flash-/,"")}).join("|")+")$"),J=new RegExp("^flash-("+q.slice(1).map(function(e){return e.replace(/^flash-/,"")}).join("|")+")$"),Q={swfPath:j(),trustedDomains:t.location.host?[t.location.host]:[],cacheBust:!0,forceEnhancedClipboard:!1,flashLoadTimeout:3e4,autoActivate:!0,bubbleEvents:!0,containerId:"global-zeroclipboard-html-bridge",containerClass:"global-zeroclipboard-container",swfObjectId:"global-zeroclipboard-flash-bridge",hoverClass:"zeroclipboard-is-hover",activeClass:"zeroclipboard-is-active",forceHandCursor:!1,title:null,zIndex:999999999},ee=function(e){if("object"==typeof e&&null!==e)for(var t in e)if(S.call(e,t))if(/^(?:forceHandCursor|title|zIndex|bubbleEvents)$/.test(t))Q[t]=e[t];else if(null==B.bridge)if("containerId"===t||"swfObjectId"===t){if(!ge(e[t]))throw new Error("The specified `"+t+"` value is not valid as an HTML4 Element ID");Q[t]=e[t]}else Q[t]=e[t];{if("string"!=typeof e||!e)return k(Q);if(S.call(Q,e))return Q[e]}},te=function(){return $e(),{browser:H(u,["userAgent","platform","appName"]),flash:D(B,["bridge"]),zeroclipboard:{version:Xe.version,config:Xe.config()}}},ne=function(){return!!(B.disabled||B.outdated||B.sandboxed||B.unavailable||B.degraded||B.deactivated)},oe=function(e,t){var n,i,s,a={};if("string"==typeof e&&e)s=e.toLowerCase().split(/\s+/);else if("object"==typeof e&&e&&"undefined"==typeof t)for(n in e)S.call(e,n)&&"string"==typeof n&&n&&"function"==typeof e[n]&&Xe.on(n,e[n]);if(s&&s.length){for(n=0,i=s.length;i>n;n++)e=s[n].replace(/^on/,""),a[e]=!0,z[e]||(z[e]=[]),z[e].push(t);if(a.ready&&B.ready&&Xe.emit({type:"ready"}),a.error){for(n=0,i=q.length;i>n;n++)if(B[q[n].replace(/^flash-/,"")]===!0){Xe.emit({type:"error",name:q[n]});break}r!==o&&Xe.version!==r&&Xe.emit({type:"error",name:"version-mismatch",jsVersion:Xe.version,swfVersion:r})}}return Xe},re=function(e,t){var n,o,r,i,s;if(0===arguments.length)i=R(z);else if("string"==typeof e&&e)i=e.split(/\s+/);else if("object"==typeof e&&e&&"undefined"==typeof t)for(n in e)S.call(e,n)&&"string"==typeof n&&n&&"function"==typeof e[n]&&Xe.off(n,e[n]);if(i&&i.length)for(n=0,o=i.length;o>n;n++)if(e=i[n].toLowerCase().replace(/^on/,""),s=z[e],s&&s.length)if(t)for(r=s.indexOf(t);-1!==r;)s.splice(r,1),r=s.indexOf(t,r);else s.length=0;return Xe},ie=function(e){var t;return t="string"==typeof e&&e?k(z[e])||null:k(z)},se=function(e){var t,n,o;return e=me(e),e&&!_e(e)?"ready"===e.type&&B.overdue===!0?Xe.emit({type:"error",name:"flash-overdue"}):(t=O({},e),Ce.call(this,t),"copy"===e.type&&(o=De(Y),n=o.data,U=o.formatMap),n):void 0},ae=function(){var e=B.sandboxed;if($e(),"boolean"!=typeof B.ready&&(B.ready=!1),B.sandboxed!==e&&B.sandboxed===!0)B.ready=!1,Xe.emit({type:"error",name:"flash-sandboxed"});else if(!Xe.isFlashUnusable()&&null===B.bridge){var t=Q.flashLoadTimeout;"number"==typeof t&&t>=0&&(G=c(function(){"boolean"!=typeof B.deactivated&&(B.deactivated=!0),B.deactivated===!0&&Xe.emit({type:"error",name:"flash-deactivated"})},t)),B.overdue=!1,ke()}},le=function(){Xe.clearData(),Xe.blur(),Xe.emit("destroy"),He(),Xe.off()},ue=function(e,t){var n;if("object"==typeof e&&e&&"undefined"==typeof t)n=e,Xe.clearData();else{if("string"!=typeof e||!e)return;n={},n[e]=t}for(var o in n)"string"==typeof o&&o&&S.call(n,o)&&"string"==typeof n[o]&&n[o]&&(Y[o]=n[o])},ce=function(e){"undefined"==typeof e?(x(Y),U=null):"string"==typeof e&&S.call(Y,e)&&delete Y[e]},de=function(e){return"undefined"==typeof e?k(Y):"string"==typeof e&&S.call(Y,e)?Y[e]:void 0},he=function(e){if(e&&1===e.nodeType){i&&(je(i,Q.activeClass),i!==e&&je(i,Q.hoverClass)),i=e,Ie(e,Q.hoverClass);var t=e.getAttribute("title")||Q.title;if("string"==typeof t&&t){var n=Oe(B.bridge);n&&n.setAttribute("title",t)}var o=Q.forceHandCursor===!0||"pointer"===Ve(e,"cursor");Ue(o),Ye()}},fe=function(){var e=Oe(B.bridge);e&&(e.removeAttribute("title"),e.style.left="0px",e.style.top="-9999px",e.style.width="1px",e.style.height="1px"),i&&(je(i,Q.hoverClass),je(i,Q.activeClass),i=null)},pe=function(){return i||null},ge=function(e){return"string"==typeof e&&e&&/^[A-Za-z][A-Za-z0-9_:\-\.]*$/.test(e)},me=function(e){var t;if("string"==typeof e&&e?(t=e,e={}):"object"==typeof e&&e&&"string"==typeof e.type&&e.type&&(t=e.type),t){t=t.toLowerCase(),!e.target&&(/^(copy|aftercopy|_click)$/.test(t)||"error"===t&&"clipboard-error"===e.name)&&(e.target=s),O(e,{type:t,target:e.target||i||null,relatedTarget:e.relatedTarget||null,currentTarget:B&&B.bridge||null,timeStamp:e.timeStamp||C()||null});var n=K[e.type];return"error"===e.type&&e.name&&n&&(n=n[e.name]),n&&(e.message=n),"ready"===e.type&&O(e,{target:null,version:B.version}),"error"===e.type&&(Z.test(e.name)&&O(e,{target:null,minimumVersion:F}),J.test(e.name)&&O(e,{version:B.version})),"copy"===e.type&&(e.clipboardData={setData:Xe.setData,clearData:Xe.clearData}),"aftercopy"===e.type&&(e=xe(e,U)),e.target&&!e.relatedTarget&&(e.relatedTarget=ve(e.target)),we(e)}},ve=function(e){var t=e&&e.getAttribute&&e.getAttribute("data-clipboard-target");return t?l.getElementById(t):null},we=function(e){if(e&&/^_(?:click|mouse(?:over|out|down|up|move))$/.test(e.type)){var t=e.target,n="_mouseover"===e.type&&e.relatedTarget?e.relatedTarget:o,r="_mouseout"===e.type&&e.relatedTarget?e.relatedTarget:o,i=Be(t),s=a.screenLeft||a.screenX||0,u=a.screenTop||a.screenY||0,c=l.body.scrollLeft+l.documentElement.scrollLeft,d=l.body.scrollTop+l.documentElement.scrollTop,h=i.left+("number"==typeof e._stageX?e._stageX:0),f=i.top+("number"==typeof e._stageY?e._stageY:0),p=h-c,g=f-d,m=s+p,v=u+g,w="number"==typeof e.movementX?e.movementX:0,y="number"==typeof e.movementY?e.movementY:0;delete e._stageX,delete e._stageY,O(e,{srcElement:t,fromElement:n,toElement:r,screenX:m,screenY:v,pageX:h,pageY:f,clientX:p,clientY:g,x:p,y:g,movementX:w,movementY:y,offsetX:0,offsetY:0,layerX:0,layerY:0})}return e},ye=function(e){var t=e&&"string"==typeof e.type&&e.type||"";return!/^(?:(?:before)?copy|destroy)$/.test(t)},be=function(e,t,n,o){o?c(function(){e.apply(t,n)},0):e.apply(t,n)},Ce=function(e){if("object"==typeof e&&e&&e.type){var t=ye(e),n=z["*"]||[],o=z[e.type]||[],r=n.concat(o);if(r&&r.length){var i,s,l,u,c,d=this;for(i=0,s=r.length;s>i;i++)l=r[i],u=d,"string"==typeof l&&"function"==typeof a[l]&&(l=a[l]),"object"==typeof l&&l&&"function"==typeof l.handleEvent&&(u=l,l=l.handleEvent),"function"==typeof l&&(c=O({},e),be(l,u,[c],t))}return this}},Re=function(e){var t=null;return(V===!1||e&&"error"===e.type&&e.name&&-1!==X.indexOf(e.name))&&(t=!1),t},_e=function(e){var t=e.target||i||null,n="swf"===e._source;switch(delete e._source,e.type){case"error":var o="flash-sandboxed"===e.name||Re(e);"boolean"==typeof o&&(B.sandboxed=o),-1!==q.indexOf(e.name)?O(B,{disabled:"flash-disabled"===e.name,outdated:"flash-outdated"===e.name,unavailable:"flash-unavailable"===e.name,degraded:"flash-degraded"===e.name,deactivated:"flash-deactivated"===e.name,overdue:"flash-overdue"===e.name,ready:!1}):"version-mismatch"===e.name&&(r=e.swfVersion,O(B,{disabled:!1,outdated:!1,unavailable:!1,degraded:!1,deactivated:!1,overdue:!1,ready:!1})),ze();break;case"ready":r=e.swfVersion;var a=B.deactivated===!0;O(B,{disabled:!1,outdated:!1,sandboxed:!1,unavailable:!1,degraded:!1,deactivated:!1,overdue:a,ready:!a}),ze();break;case"beforecopy":s=t;break;case"copy":var l,u,c=e.relatedTarget;!Y["text/html"]&&!Y["text/plain"]&&c&&(u=c.value||c.outerHTML||c.innerHTML)&&(l=c.value||c.textContent||c.innerText)?(e.clipboardData.clearData(),e.clipboardData.setData("text/plain",l),u!==l&&e.clipboardData.setData("text/html",u)):!Y["text/plain"]&&e.target&&(l=e.target.getAttribute("data-clipboard-text"))&&(e.clipboardData.clearData(),e.clipboardData.setData("text/plain",l));break;case"aftercopy":Se(e),Xe.clearData(),t&&t!==We()&&t.focus&&t.focus();break;case"_mouseover":Xe.focus(t),Q.bubbleEvents===!0&&n&&(t&&t!==e.relatedTarget&&!A(e.relatedTarget,t)&&Ee(O({},e,{type:"mouseenter",bubbles:!1,cancelable:!1})),Ee(O({},e,{type:"mouseover"})));break;case"_mouseout":Xe.blur(),Q.bubbleEvents===!0&&n&&(t&&t!==e.relatedTarget&&!A(e.relatedTarget,t)&&Ee(O({},e,{type:"mouseleave",bubbles:!1,cancelable:!1})),Ee(O({},e,{type:"mouseout"})));break;case"_mousedown":Ie(t,Q.activeClass),Q.bubbleEvents===!0&&n&&Ee(O({},e,{type:e.type.slice(1)}));break;case"_mouseup":je(t,Q.activeClass),Q.bubbleEvents===!0&&n&&Ee(O({},e,{type:e.type.slice(1)}));break;case"_click":s=null,Q.bubbleEvents===!0&&n&&Ee(O({},e,{type:e.type.slice(1)}));break;case"_mousemove":Q.bubbleEvents===!0&&n&&Ee(O({},e,{type:e.type.slice(1)}))}return/^_(?:click|mouse(?:over|out|down|up|move))$/.test(e.type)?!0:void 0},Se=function(e){if(e.errors&&e.errors.length>0){var t=k(e);O(t,{type:"error",name:"clipboard-error"}),delete t.success,c(function(){Xe.emit(t)},0)}},Ee=function(e){if(e&&"string"==typeof e.type&&e){var t,n=e.target||null,o=n&&n.ownerDocument||l,r={view:o.defaultView||a,canBubble:!0,cancelable:!0,detail:"click"===e.type?1:0,button:"number"==typeof e.which?e.which-1:"number"==typeof e.button?e.button:o.createEvent?0:1},i=O(r,e);n&&o.createEvent&&n.dispatchEvent&&(i=[i.type,i.canBubble,i.cancelable,i.view,i.detail,i.screenX,i.screenY,i.clientX,i.clientY,i.ctrlKey,i.altKey,i.shiftKey,i.metaKey,i.button,i.relatedTarget],t=o.createEvent("MouseEvents"),t.initMouseEvent&&(t.initMouseEvent.apply(t,i),t._source="js",n.dispatchEvent(t)))}},Te=function(){var e=Q.flashLoadTimeout;if("number"==typeof e&&e>=0){var t=Math.min(1e3,e/10),n=Q.swfObjectId+"_fallbackContent";$=h(function(){var e=l.getElementById(n);Fe(e)&&(ze(),B.deactivated=null,Xe.emit({type:"error",name:"swf-not-found"}))},t)}},Me=function(){var e=l.createElement("div");return e.id=Q.containerId,e.className=Q.containerClass,e.style.position="absolute",e.style.left="0px",e.style.top="-9999px",e.style.width="1px",e.style.height="1px",e.style.zIndex=""+Ge(Q.zIndex),e},Oe=function(e){for(var t=e&&e.parentNode;t&&"OBJECT"===t.nodeName&&t.parentNode;)t=t.parentNode;return t||null},ke=function(){var e,t=B.bridge,n=Oe(t);if(!t){var o=Le(a.location.host,Q),r="never"===o?"none":"all",i=Pe(O({jsVersion:Xe.version},Q)),s=Q.swfPath+Ae(Q.swfPath,Q);n=Me();var u=l.createElement("div");n.appendChild(u),l.body.appendChild(n);var c=l.createElement("div"),d="activex"===B.pluginType;c.innerHTML='"+(d?'':"")+'
 
',t=c.firstChild,c=null,T(t).ZeroClipboard=Xe,n.replaceChild(t,u),Te()}return t||(t=l[Q.swfObjectId],t&&(e=t.length)&&(t=t[e-1]),!t&&n&&(t=n.firstChild)),B.bridge=t||null,t},He=function(){var e=B.bridge;if(e){var t=Oe(e);t&&("activex"===B.pluginType&&"readyState"in e?(e.style.display="none",function n(){if(4===e.readyState){for(var o in e)"function"==typeof e[o]&&(e[o]=null);e.parentNode&&e.parentNode.removeChild(e),t.parentNode&&t.parentNode.removeChild(t)}else c(n,10)}()):(e.parentNode&&e.parentNode.removeChild(e),t.parentNode&&t.parentNode.removeChild(t))),ze(),B.ready=null,B.bridge=null,B.deactivated=null,r=o}},De=function(e){var t={},n={};if("object"==typeof e&&e){for(var o in e)if(o&&S.call(e,o)&&"string"==typeof e[o]&&e[o])switch(o.toLowerCase()){case"text/plain":case"text":case"air:text":case"flash:text":t.text=e[o],n.text=o;break;case"text/html":case"html":case"air:html":case"flash:html":t.html=e[o],n.html=o;break;case"application/rtf":case"text/rtf":case"rtf":case"richtext":case"air:rtf":case"flash:rtf":t.rtf=e[o],n.rtf=o}return{data:t,formatMap:n}}},xe=function(e,t){if("object"!=typeof e||!e||"object"!=typeof t||!t)return e;var n={};for(var o in e)if(S.call(e,o))if("errors"===o){n[o]=e[o]?e[o].slice():[];for(var r=0,i=n[o].length;i>r;r++)n[o][r].format=t[n[o][r].format]}else if("success"!==o&&"data"!==o)n[o]=e[o];else{n[o]={};var s=e[o];for(var a in s)a&&S.call(s,a)&&S.call(t,a)&&(n[o][t[a]]=s[a])}return n},Ae=function(e,t){var n=null==t||t&&t.cacheBust===!0;return n?(-1===e.indexOf("?")?"?":"&")+"noCache="+C():""},Pe=function(e){var t,n,o,r,i="",s=[];if(e.trustedDomains&&("string"==typeof e.trustedDomains?r=[e.trustedDomains]:"object"==typeof e.trustedDomains&&"length"in e.trustedDomains&&(r=e.trustedDomains)),r&&r.length)for(t=0,n=r.length;n>t;t++)if(S.call(r,t)&&r[t]&&"string"==typeof r[t]){if(o=Ne(r[t]),!o)continue;if("*"===o){s.length=0,s.push(o);break}s.push.apply(s,[o,"//"+o,a.location.protocol+"//"+o])}return s.length&&(i+="trustedOrigins="+g(s.join(","))),e.forceEnhancedClipboard===!0&&(i+=(i?"&":"")+"forceEnhancedClipboard=true"),"string"==typeof e.swfObjectId&&e.swfObjectId&&(i+=(i?"&":"")+"swfObjectId="+g(e.swfObjectId)),"string"==typeof e.jsVersion&&e.jsVersion&&(i+=(i?"&":"")+"jsVersion="+g(e.jsVersion)),i},Ne=function(e){if(null==e||""===e)return null;if(e=e.replace(/^\s+|\s+$/g,""),""===e)return null;var t=e.indexOf("//");e=-1===t?e:e.slice(t+2);var n=e.indexOf("/");return e=-1===n?e:-1===t||0===n?null:e.slice(0,n),e&&".swf"===e.slice(-4).toLowerCase()?null:e||null},Le=function(){var e=function(e){var t,n,o,r=[];if("string"==typeof e&&(e=[e]),"object"!=typeof e||!e||"number"!=typeof e.length)return r;for(t=0,n=e.length;n>t;t++)if(S.call(e,t)&&(o=Ne(e[t]))){if("*"===o){r.length=0,r.push("*");break}-1===r.indexOf(o)&&r.push(o)}return r};return function(t,n){var o=Ne(n.swfPath);null===o&&(o=t);var r=e(n.trustedDomains),i=r.length;if(i>0){if(1===i&&"*"===r[0])return"always";if(-1!==r.indexOf(t))return 1===i&&t===o?"sameDomain":"always"}return"never"}}(),We=function(){try{return l.activeElement}catch(e){return null}},Ie=function(e,t){var n,o,r,i=[];if("string"==typeof t&&t&&(i=t.split(/\s+/)),e&&1===e.nodeType&&i.length>0)if(e.classList)for(n=0,o=i.length;o>n;n++)e.classList.add(i[n]);else if(e.hasOwnProperty("className")){for(r=" "+e.className+" ",n=0,o=i.length;o>n;n++)-1===r.indexOf(" "+i[n]+" ")&&(r+=i[n]+" ");e.className=r.replace(/^\s+|\s+$/g,"")}return e},je=function(e,t){var n,o,r,i=[];if("string"==typeof t&&t&&(i=t.split(/\s+/)),e&&1===e.nodeType&&i.length>0)if(e.classList&&e.classList.length>0)for(n=0,o=i.length;o>n;n++)e.classList.remove(i[n]);else if(e.className){for(r=(" "+e.className+" ").replace(/[\r\n\t]/g," "),n=0,o=i.length;o>n;n++)r=r.replace(" "+i[n]+" "," ");e.className=r.replace(/^\s+|\s+$/g,"")}return e},Ve=function(e,t){var n=p(e,null).getPropertyValue(t);return"cursor"!==t||n&&"auto"!==n||"A"!==e.nodeName?n:"pointer"},Be=function(e){var t={left:0,top:0,width:0,height:0};if(e.getBoundingClientRect){var n=e.getBoundingClientRect(),o=a.pageXOffset,r=a.pageYOffset,i=l.documentElement.clientLeft||0,s=l.documentElement.clientTop||0,u=0,c=0;if("relative"===Ve(l.body,"position")){var d=l.body.getBoundingClientRect(),h=l.documentElement.getBoundingClientRect();u=d.left-h.left||0,c=d.top-h.top||0}t.left=n.left+o-i-u,t.top=n.top+r-s-c,t.width="width"in n?n.width:n.right-n.left,t.height="height"in n?n.height:n.bottom-n.top}return t},Fe=function(e){if(!e)return!1;var t=p(e,null),n=y(t.height)>0,o=y(t.width)>0,r=y(t.top)>=0,i=y(t.left)>=0,s=n&&o&&r&&i,a=s?null:Be(e),l="none"!==t.display&&"collapse"!==t.visibility&&(s||!!a&&(n||a.height>0)&&(o||a.width>0)&&(r||a.top>=0)&&(i||a.left>=0));return l},ze=function(){d(G),G=0,f($),$=0},Ye=function(){var e;if(i&&(e=Oe(B.bridge))){var t=Be(i);O(e.style,{width:t.width+"px",height:t.height+"px",top:t.top+"px",left:t.left+"px",zIndex:""+Ge(Q.zIndex)})}},Ue=function(e){B.ready===!0&&(B.bridge&&"function"==typeof B.bridge.setHandCursor?B.bridge.setHandCursor(e):B.ready=!1)},Ge=function(e){if(/^(?:auto|inherit)$/.test(e))return e;var t;return"number"!=typeof e||b(e)?"string"==typeof e&&(t=Ge(w(e,10))):t=e,"number"==typeof t?t:"auto"},$e=function(e){var n,o,r,i=B.sandboxed,s=null;if(e=e===!0,V===!1)s=!1;else{try{o=t.frameElement||null}catch(a){r={name:a.name,message:a.message}}if(o&&1===o.nodeType&&"IFRAME"===o.nodeName)try{s=o.hasAttribute("sandbox")}catch(a){s=null}else{try{n=document.domain||null}catch(a){n=null}(null===n||r&&"SecurityError"===r.name&&/(^|[\s\(\[@])sandbox(es|ed|ing|[\s\.,!\)\]@]|$)/.test(r.message.toLowerCase()))&&(s=!0)}}return B.sandboxed=s,i===s||e||Ke(m),s},Ke=function(e){function t(e){var t=e.match(/[\d]+/g);return t.length=3,t.join(".")}function n(e){return!!e&&(e=e.toLowerCase())&&(/^(pepflashplayer\.dll|libpepflashplayer\.so|pepperflashplayer\.plugin)$/.test(e)||"chrome.plugin"===e.slice(-13))}function o(e){e&&(a=!0,e.version&&(d=t(e.version)),!d&&e.description&&(d=t(e.description)),e.filename&&(c=n(e.filename)))}var r,i,s,a=!1,l=!1,c=!1,d="";if(u.plugins&&u.plugins.length)r=u.plugins["Shockwave Flash"],o(r),u.plugins["Shockwave Flash 2.0"]&&(a=!0,d="2.0.0.11");else if(u.mimeTypes&&u.mimeTypes.length)s=u.mimeTypes["application/x-shockwave-flash"],r=s&&s.enabledPlugin,o(r);else if("undefined"!=typeof e){l=!0;try{i=new e("ShockwaveFlash.ShockwaveFlash.7"),a=!0,d=t(i.GetVariable("$version"))}catch(h){try{i=new e("ShockwaveFlash.ShockwaveFlash.6"),a=!0,d="6.0.21"}catch(f){try{i=new e("ShockwaveFlash.ShockwaveFlash"),a=!0,d=t(i.GetVariable("$version"))}catch(p){l=!1}}}}B.disabled=a!==!0,B.outdated=d&&y(d)n;n++)e=s[n].replace(/^on/,""),a[e]=!0,u[e]||(u[e]=[]),u[e].push(t);if(a.ready&&B.ready&&this.emit({type:"ready",client:this}),a.error){for(n=0,i=q.length;i>n;n++)if(B[q[n].replace(/^flash-/,"")]){this.emit({type:"error",name:q[n],client:this});break}r!==o&&Xe.version!==r&&this.emit({type:"error",name:"version-mismatch",jsVersion:Xe.version,swfVersion:r})}}return this},ot=function(e,t){var n,o,r,i,s,a=Ze[this.id],l=a&&a.handlers;if(!l)return this;if(0===arguments.length)i=R(l);else if("string"==typeof e&&e)i=e.split(/\s+/);else if("object"==typeof e&&e&&"undefined"==typeof t)for(n in e)S.call(e,n)&&"string"==typeof n&&n&&"function"==typeof e[n]&&this.off(n,e[n]);if(i&&i.length)for(n=0,o=i.length;o>n;n++)if(e=i[n].toLowerCase().replace(/^on/,""),s=l[e],s&&s.length)if(t)for(r=s.indexOf(t);-1!==r;)s.splice(r,1),r=s.indexOf(t,r);else s.length=0;return this},rt=function(e){var t=null,n=Ze[this.id]&&Ze[this.id].handlers;return n&&(t="string"==typeof e&&e?n[e]?n[e].slice(0):[]:k(n)),t},it=function(e){if(ct.call(this,e)){"object"==typeof e&&e&&"string"==typeof e.type&&e.type&&(e=O({},e));var t=O({},me(e),{client:this});dt.call(this,t)}return this},st=function(e){if(!Ze[this.id])throw new Error("Attempted to clip element(s) to a destroyed ZeroClipboard client instance");e=ht(e);for(var t=0;t0,r=!e.target||o&&-1!==n.indexOf(e.target),i=e.relatedTarget&&o&&-1!==n.indexOf(e.relatedTarget),s=e.client&&e.client===this;return t&&(r||i||s)?!0:!1},dt=function(e){var t=Ze[this.id];if("object"==typeof e&&e&&e.type&&t){var n=ye(e),o=t&&t.handlers["*"]||[],r=t&&t.handlers[e.type]||[],i=o.concat(r);if(i&&i.length){var s,l,u,c,d,h=this;for(s=0,l=i.length;l>s;s++)u=i[s],c=h,"string"==typeof u&&"function"==typeof a[u]&&(u=a[u]),"object"==typeof u&&u&&"function"==typeof u.handleEvent&&(c=u,u=u.handleEvent),"function"==typeof u&&(d=O({},e),be(u,c,[d],n))}}},ht=function(e){return"string"==typeof e&&(e=[]),"number"!=typeof e.length?[e]:e},ft=function(e){if(e&&1===e.nodeType){var t=function(e){(e||(e=a.event))&&("js"!==e._source&&(e.stopImmediatePropagation(),e.preventDefault()),delete e._source)},n=function(n){(n||(n=a.event))&&(t(n),Xe.focus(e))};e.addEventListener("mouseover",n,!1),e.addEventListener("mouseout",t,!1),e.addEventListener("mouseenter",t,!1),e.addEventListener("mouseleave",t,!1),e.addEventListener("mousemove",t,!1),et[e.zcClippingId]={mouseover:n,mouseout:t,mouseenter:t,mouseleave:t,mousemove:t}}},pt=function(e){if(e&&1===e.nodeType){var t=et[e.zcClippingId];if("object"==typeof t&&t){for(var n,o,r=["move","leave","enter","out","over"],i=0,s=r.length;s>i;i++)n="mouse"+r[i],o=t[n],"function"==typeof o&&e.removeEventListener(n,o,!1);delete et[e.zcClippingId]}}};Xe._createClient=function(){tt.apply(this,M(arguments))},Xe.prototype.on=function(){return nt.apply(this,M(arguments))},Xe.prototype.off=function(){return ot.apply(this,M(arguments))},Xe.prototype.handlers=function(){return rt.apply(this,M(arguments))},Xe.prototype.emit=function(){return it.apply(this,M(arguments))},Xe.prototype.clip=function(){return st.apply(this,M(arguments))},Xe.prototype.unclip=function(){return at.apply(this,M(arguments))},Xe.prototype.elements=function(){return lt.apply(this,M(arguments))},Xe.prototype.destroy=function(){return ut.apply(this,M(arguments))},Xe.prototype.setText=function(e){if(!Ze[this.id])throw new Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance");return Xe.setData("text/plain",e),this},Xe.prototype.setHtml=function(e){if(!Ze[this.id])throw new Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance");return Xe.setData("text/html",e),this},Xe.prototype.setRichText=function(e){if(!Ze[this.id])throw new Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance");return Xe.setData("application/rtf",e),this},Xe.prototype.setData=function(){if(!Ze[this.id])throw new Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance");return Xe.setData.apply(this,M(arguments)),this},Xe.prototype.clearData=function(){if(!Ze[this.id])throw new Error("Attempted to clear pending clipboard data from a destroyed ZeroClipboard client instance");return Xe.clearData.apply(this,M(arguments)),this},Xe.prototype.getData=function(){if(!Ze[this.id])throw new Error("Attempted to get pending clipboard data from a destroyed ZeroClipboard client instance");return Xe.getData.apply(this,M(arguments))},"function"==typeof e&&e.amd?e(function(){return Xe}):"object"==typeof n&&n&&"object"==typeof n.exports&&n.exports?n.exports=Xe:t.ZeroClipboard=Xe}(function(){return this||window}())},{}]},{},[23,59,61,60,62,83,84,85,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,86,87,88,89,102,103,104,92,93,94,95,96,97,31,35,32,33,40,34,36,37,38,39])("zeroclipboard")}); \ No newline at end of file +!function(t,o){"use strict";var i,r,s,a=t,l=a.document,u=a.navigator,c=a.setTimeout,d=a.clearTimeout,h=a.setInterval,f=a.clearInterval,p=a.getComputedStyle,g=a.encodeURIComponent,m=a.ActiveXObject,v=a.Error,w=a.Number.parseInt||a.parseInt,y=a.Number.parseFloat||a.parseFloat,b=a.Number.isNaN||a.isNaN,C=a.Date.now,R=a.Object.keys,_=a.Object.defineProperty,S=a.Object.prototype.hasOwnProperty,E=a.Array.prototype.slice,T=function(){var e=function(e){return e};if("function"==typeof a.wrap&&"function"==typeof a.unwrap)try{var t=l.createElement("div"),n=a.unwrap(t);1===t.nodeType&&n&&1===n.nodeType&&(e=a.unwrap)}catch(o){}return e}(),M=function(e){return E.call(e,0)},O=function(){var e,t,n,i,r,s,a=M(arguments),l=a[0]||{};for(e=1,t=a.length;t>e;e++)if(null!=(n=a[e]))for(i in n)S.call(n,i)&&(r=l[i],s=n[i],l!==s&&s!==o&&(l[i]=s));return l},k=function(e){var t,n,o,i;if("object"!=typeof e||null==e||"number"==typeof e.nodeType)t=e;else if("number"==typeof e.length)for(t=[],n=0,o=e.length;o>n;n++)S.call(e,n)&&(t[n]=k(e[n]));else{t={};for(i in e)S.call(e,i)&&(t[i]=k(e[i]))}return t},H=function(e,t){for(var n={},o=0,i=t.length;i>o;o++)t[o]in e&&(n[t[o]]=e[t[o]]);return n},D=function(e,t){var n={};for(var o in e)-1===t.indexOf(o)&&(n[o]=e[o]);return n},x=function(e){if(e)for(var t in e)S.call(e,t)&&delete e[t];return e},A=function(e,t){if(e&&1===e.nodeType&&e.ownerDocument&&t&&(1===t.nodeType&&t.ownerDocument&&t.ownerDocument===e.ownerDocument||9===t.nodeType&&!t.ownerDocument&&t===e.ownerDocument))do{if(e===t)return!0;e=e.parentNode}while(e);return!1},P=function(e){var t;return"string"==typeof e&&e&&(t=e.split("#")[0].split("?")[0],t=e.slice(0,e.lastIndexOf("/")+1)),t},N=function(e){var t,n;return"string"==typeof e&&e&&(n=e.match(/^(?:|[^:@]*@|.+\)@(?=http[s]?|file)|.+?\s+(?: at |@)(?:[^:\(]+ )*[\(]?)((?:http[s]?|file):\/\/[\/]?.+?\/[^:\)]*?)(?::\d+)(?::\d+)?/),n&&n[1]?t=n[1]:(n=e.match(/\)@((?:http[s]?|file):\/\/[\/]?.+?\/[^:\)]*?)(?::\d+)(?::\d+)?/),n&&n[1]&&(t=n[1]))),t},L=function(){var e,t;try{throw new v}catch(n){t=n}return t&&(e=t.sourceURL||t.fileName||N(t.stack)),e},W=function(){var e,t,n;if(l.currentScript&&(e=l.currentScript.src))return e;if(t=l.getElementsByTagName("script"),1===t.length)return t[0].src||o;if("readyState"in t[0])for(n=t.length;n--;)if("interactive"===t[n].readyState&&(e=t[n].src))return e;return"loading"===l.readyState&&(e=t[t.length-1].src)?e:(e=L())?e:o},I=function(){var e,t,n,i=l.getElementsByTagName("script");for(e=i.length;e--;){if(!(n=i[e].src)){t=null;break}if(n=P(n),null==t)t=n;else if(t!==n){t=null;break}}return t||o},j=function(){var e=P(W())||I()||"";return e+"ZeroClipboard.swf"},V=function(){return null==t.opener&&(!!t.top&&t!=t.top||!!t.parent&&t!=t.parent)}(),F={bridge:null,version:"0.0.0",pluginType:"unknown",disabled:null,outdated:null,sandboxed:null,unavailable:null,degraded:null,deactivated:null,overdue:null,ready:null},B="11.0.0",z={},Y={},U=null,G=0,$=0,X={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"}},K=["flash-unavailable","flash-degraded","flash-overdue","version-mismatch","config-mismatch","clipboard-error"],q=["flash-disabled","flash-outdated","flash-sandboxed","flash-unavailable","flash-degraded","flash-deactivated","flash-overdue"],Z=new RegExp("^flash-("+q.map(function(e){return e.replace(/^flash-/,"")}).join("|")+")$"),J=new RegExp("^flash-("+q.slice(1).map(function(e){return e.replace(/^flash-/,"")}).join("|")+")$"),Q={swfPath:j(),trustedDomains:t.location.host?[t.location.host]:[],cacheBust:!0,forceEnhancedClipboard:!1,flashLoadTimeout:3e4,autoActivate:!0,bubbleEvents:!0,containerId:"global-zeroclipboard-html-bridge",containerClass:"global-zeroclipboard-container",swfObjectId:"global-zeroclipboard-flash-bridge",hoverClass:"zeroclipboard-is-hover",activeClass:"zeroclipboard-is-active",forceHandCursor:!1,title:null,zIndex:999999999},ee=function(e){if("object"==typeof e&&null!==e)for(var t in e)if(S.call(e,t))if(/^(?:forceHandCursor|title|zIndex|bubbleEvents)$/.test(t))Q[t]=e[t];else if(null==F.bridge)if("containerId"===t||"swfObjectId"===t){if(!ge(e[t]))throw new Error("The specified `"+t+"` value is not valid as an HTML4 Element ID");Q[t]=e[t]}else Q[t]=e[t];{if("string"!=typeof e||!e)return k(Q);if(S.call(Q,e))return Q[e]}},te=function(){return $e(),{browser:H(u,["userAgent","platform","appName"]),flash:D(F,["bridge"]),zeroclipboard:{version:Ke.version,config:Ke.config()}}},ne=function(){return!!(F.disabled||F.outdated||F.sandboxed||F.unavailable||F.degraded||F.deactivated)},oe=function(e,t){var n,r,s,a={};if("string"==typeof e&&e)s=e.toLowerCase().split(/\s+/);else if("object"==typeof e&&e&&"undefined"==typeof t)for(n in e)S.call(e,n)&&"string"==typeof n&&n&&"function"==typeof e[n]&&Ke.on(n,e[n]);if(s&&s.length){for(n=0,r=s.length;r>n;n++)e=s[n].replace(/^on/,""),a[e]=!0,z[e]||(z[e]=[]),z[e].push(t);if(a.ready&&F.ready&&Ke.emit({type:"ready"}),a.error){for(n=0,r=q.length;r>n;n++)if(F[q[n].replace(/^flash-/,"")]===!0){Ke.emit({type:"error",name:q[n]});break}i!==o&&Ke.version!==i&&Ke.emit({type:"error",name:"version-mismatch",jsVersion:Ke.version,swfVersion:i})}}return Ke},ie=function(e,t){var n,o,i,r,s;if(0===arguments.length)r=R(z);else if("string"==typeof e&&e)r=e.split(/\s+/);else if("object"==typeof e&&e&&"undefined"==typeof t)for(n in e)S.call(e,n)&&"string"==typeof n&&n&&"function"==typeof e[n]&&Ke.off(n,e[n]);if(r&&r.length)for(n=0,o=r.length;o>n;n++)if(e=r[n].toLowerCase().replace(/^on/,""),s=z[e],s&&s.length)if(t)for(i=s.indexOf(t);-1!==i;)s.splice(i,1),i=s.indexOf(t,i);else s.length=0;return Ke},re=function(e){var t;return t="string"==typeof e&&e?k(z[e])||null:k(z)},se=function(e){var t,n,o;return e=me(e),e&&!_e(e)?"ready"===e.type&&F.overdue===!0?Ke.emit({type:"error",name:"flash-overdue"}):(t=O({},e),Ce.call(this,t),"copy"===e.type&&(o=De(Y),n=o.data,U=o.formatMap),n):void 0},ae=function(){var e=F.sandboxed;if($e(),"boolean"!=typeof F.ready&&(F.ready=!1),F.sandboxed!==e&&F.sandboxed===!0)F.ready=!1,Ke.emit({type:"error",name:"flash-sandboxed"});else if(!Ke.isFlashUnusable()&&null===F.bridge){var t=Q.flashLoadTimeout;"number"==typeof t&&t>=0&&(G=c(function(){"boolean"!=typeof F.deactivated&&(F.deactivated=!0),F.deactivated===!0&&Ke.emit({type:"error",name:"flash-deactivated"})},t)),F.overdue=!1,ke()}},le=function(){Ke.clearData(),Ke.blur(),Ke.emit("destroy"),He(),Ke.off()},ue=function(e,t){var n;if("object"==typeof e&&e&&"undefined"==typeof t)n=e,Ke.clearData();else{if("string"!=typeof e||!e)return;n={},n[e]=t}for(var o in n)"string"==typeof o&&o&&S.call(n,o)&&"string"==typeof n[o]&&n[o]&&(Y[o]=n[o])},ce=function(e){"undefined"==typeof e?(x(Y),U=null):"string"==typeof e&&S.call(Y,e)&&delete Y[e]},de=function(e){return"undefined"==typeof e?k(Y):"string"==typeof e&&S.call(Y,e)?Y[e]:void 0},he=function(e){if(e&&1===e.nodeType){r&&(je(r,Q.activeClass),r!==e&&je(r,Q.hoverClass)),r=e,Ie(e,Q.hoverClass);var t=e.getAttribute("title")||Q.title;if("string"==typeof t&&t){var n=Oe(F.bridge);n&&n.setAttribute("title",t)}var o=Q.forceHandCursor===!0||"pointer"===Ve(e,"cursor");Ue(o),Ye()}},fe=function(){var e=Oe(F.bridge);e&&(e.removeAttribute("title"),e.style.left="0px",e.style.top="-9999px",e.style.width="1px",e.style.height="1px"),r&&(je(r,Q.hoverClass),je(r,Q.activeClass),r=null)},pe=function(){return r||null},ge=function(e){return"string"==typeof e&&e&&/^[A-Za-z][A-Za-z0-9_:\-\.]*$/.test(e)},me=function(e){var t;if("string"==typeof e&&e?(t=e,e={}):"object"==typeof e&&e&&"string"==typeof e.type&&e.type&&(t=e.type),t){t=t.toLowerCase(),!e.target&&(/^(copy|aftercopy|_click)$/.test(t)||"error"===t&&"clipboard-error"===e.name)&&(e.target=s),O(e,{type:t,target:e.target||r||null,relatedTarget:e.relatedTarget||null,currentTarget:F&&F.bridge||null,timeStamp:e.timeStamp||C()||null});var n=X[e.type];return"error"===e.type&&e.name&&n&&(n=n[e.name]),n&&(e.message=n),"ready"===e.type&&O(e,{target:null,version:F.version}),"error"===e.type&&(Z.test(e.name)&&O(e,{target:null,minimumVersion:B}),J.test(e.name)&&O(e,{version:F.version})),"copy"===e.type&&(e.clipboardData={setData:Ke.setData,clearData:Ke.clearData}),"aftercopy"===e.type&&(e=xe(e,U)),e.target&&!e.relatedTarget&&(e.relatedTarget=ve(e.target)),we(e)}},ve=function(e){var t=e&&e.getAttribute&&e.getAttribute("data-clipboard-target");return t?l.getElementById(t):null},we=function(e){if(e&&/^_(?:click|mouse(?:over|out|down|up|move))$/.test(e.type)){var t=e.target,n="_mouseover"===e.type&&e.relatedTarget?e.relatedTarget:o,i="_mouseout"===e.type&&e.relatedTarget?e.relatedTarget:o,r=Fe(t),s=a.screenLeft||a.screenX||0,u=a.screenTop||a.screenY||0,c=l.body.scrollLeft+l.documentElement.scrollLeft,d=l.body.scrollTop+l.documentElement.scrollTop,h=r.left+("number"==typeof e._stageX?e._stageX:0),f=r.top+("number"==typeof e._stageY?e._stageY:0),p=h-c,g=f-d,m=s+p,v=u+g,w="number"==typeof e.movementX?e.movementX:0,y="number"==typeof e.movementY?e.movementY:0;delete e._stageX,delete e._stageY,O(e,{srcElement:t,fromElement:n,toElement:i,screenX:m,screenY:v,pageX:h,pageY:f,clientX:p,clientY:g,x:p,y:g,movementX:w,movementY:y,offsetX:0,offsetY:0,layerX:0,layerY:0})}return e},ye=function(e){var t=e&&"string"==typeof e.type&&e.type||"";return!/^(?:(?:before)?copy|destroy)$/.test(t)},be=function(e,t,n,o){o?c(function(){e.apply(t,n)},0):e.apply(t,n)},Ce=function(e){if("object"==typeof e&&e&&e.type){var t=ye(e),n=z["*"]||[],o=z[e.type]||[],i=n.concat(o);if(i&&i.length){var r,s,l,u,c,d=this;for(r=0,s=i.length;s>r;r++)l=i[r],u=d,"string"==typeof l&&"function"==typeof a[l]&&(l=a[l]),"object"==typeof l&&l&&"function"==typeof l.handleEvent&&(u=l,l=l.handleEvent),"function"==typeof l&&(c=O({},e),be(l,u,[c],t))}return this}},Re=function(e){var t=null;return(V===!1||e&&"error"===e.type&&e.name&&-1!==K.indexOf(e.name))&&(t=!1),t},_e=function(e){var t=e.target||r||null,n="swf"===e._source;switch(delete e._source,e.type){case"error":var o="flash-sandboxed"===e.name||Re(e);"boolean"==typeof o&&(F.sandboxed=o),-1!==q.indexOf(e.name)?O(F,{disabled:"flash-disabled"===e.name,outdated:"flash-outdated"===e.name,unavailable:"flash-unavailable"===e.name,degraded:"flash-degraded"===e.name,deactivated:"flash-deactivated"===e.name,overdue:"flash-overdue"===e.name,ready:!1}):"version-mismatch"===e.name&&(i=e.swfVersion,O(F,{disabled:!1,outdated:!1,unavailable:!1,degraded:!1,deactivated:!1,overdue:!1,ready:!1})),ze();break;case"ready":i=e.swfVersion;var a=F.deactivated===!0;O(F,{disabled:!1,outdated:!1,sandboxed:!1,unavailable:!1,degraded:!1,deactivated:!1,overdue:a,ready:!a}),ze();break;case"beforecopy":s=t;break;case"copy":var l,u,c=e.relatedTarget;!Y["text/html"]&&!Y["text/plain"]&&c&&(u=c.value||c.outerHTML||c.innerHTML)&&(l=c.value||c.textContent||c.innerText)?(e.clipboardData.clearData(),e.clipboardData.setData("text/plain",l),u!==l&&e.clipboardData.setData("text/html",u)):!Y["text/plain"]&&e.target&&(l=e.target.getAttribute("data-clipboard-text"))&&(e.clipboardData.clearData(),e.clipboardData.setData("text/plain",l));break;case"aftercopy":Se(e),Ke.clearData(),t&&t!==We()&&t.focus&&t.focus();break;case"_mouseover":Ke.focus(t),Q.bubbleEvents===!0&&n&&(t&&t!==e.relatedTarget&&!A(e.relatedTarget,t)&&Ee(O({},e,{type:"mouseenter",bubbles:!1,cancelable:!1})),Ee(O({},e,{type:"mouseover"})));break;case"_mouseout":Ke.blur(),Q.bubbleEvents===!0&&n&&(t&&t!==e.relatedTarget&&!A(e.relatedTarget,t)&&Ee(O({},e,{type:"mouseleave",bubbles:!1,cancelable:!1})),Ee(O({},e,{type:"mouseout"})));break;case"_mousedown":Ie(t,Q.activeClass),Q.bubbleEvents===!0&&n&&Ee(O({},e,{type:e.type.slice(1)}));break;case"_mouseup":je(t,Q.activeClass),Q.bubbleEvents===!0&&n&&Ee(O({},e,{type:e.type.slice(1)}));break;case"_click":s=null,Q.bubbleEvents===!0&&n&&Ee(O({},e,{type:e.type.slice(1)}));break;case"_mousemove":Q.bubbleEvents===!0&&n&&Ee(O({},e,{type:e.type.slice(1)}))}return/^_(?:click|mouse(?:over|out|down|up|move))$/.test(e.type)?!0:void 0},Se=function(e){if(e.errors&&e.errors.length>0){var t=k(e);O(t,{type:"error",name:"clipboard-error"}),delete t.success,c(function(){Ke.emit(t)},0)}},Ee=function(e){if(e&&"string"==typeof e.type&&e){var t,n=e.target||null,o=n&&n.ownerDocument||l,i={view:o.defaultView||a,canBubble:!0,cancelable:!0,detail:"click"===e.type?1:0,button:"number"==typeof e.which?e.which-1:"number"==typeof e.button?e.button:o.createEvent?0:1},r=O(i,e);n&&o.createEvent&&n.dispatchEvent&&(r=[r.type,r.canBubble,r.cancelable,r.view,r.detail,r.screenX,r.screenY,r.clientX,r.clientY,r.ctrlKey,r.altKey,r.shiftKey,r.metaKey,r.button,r.relatedTarget],t=o.createEvent("MouseEvents"),t.initMouseEvent&&(t.initMouseEvent.apply(t,r),t._source="js",n.dispatchEvent(t)))}},Te=function(){var e=Q.flashLoadTimeout;if("number"==typeof e&&e>=0){var t=Math.min(1e3,e/10),n=Q.swfObjectId+"_fallbackContent";$=h(function(){var e=l.getElementById(n);Be(e)&&(ze(),F.deactivated=null,Ke.emit({type:"error",name:"swf-not-found"}))},t)}},Me=function(){var e=l.createElement("div");return e.id=Q.containerId,e.className=Q.containerClass,e.style.position="absolute",e.style.left="0px",e.style.top="-9999px",e.style.width="1px",e.style.height="1px",e.style.zIndex=""+Ge(Q.zIndex),e},Oe=function(e){for(var t=e&&e.parentNode;t&&"OBJECT"===t.nodeName&&t.parentNode;)t=t.parentNode;return t||null},ke=function(){var e,t=F.bridge,n=Oe(t);if(!t){var o=Le(a.location.host,Q),i="never"===o?"none":"all",r=Pe(O({jsVersion:Ke.version},Q)),s=Q.swfPath+Ae(Q.swfPath,Q);n=Me();var u=l.createElement("div");n.appendChild(u),l.body.appendChild(n);var c=l.createElement("div"),d="activex"===F.pluginType;c.innerHTML='"+(d?'':"")+'
 
',t=c.firstChild,c=null,T(t).ZeroClipboard=Ke,n.replaceChild(t,u),Te()}return t||(t=l[Q.swfObjectId],t&&(e=t.length)&&(t=t[e-1]),!t&&n&&(t=n.firstChild)),F.bridge=t||null,t},He=function(){var e=F.bridge;if(e){var t=Oe(e);t&&("activex"===F.pluginType&&"readyState"in e?(e.style.display="none",function n(){if(4===e.readyState){for(var o in e)"function"==typeof e[o]&&(e[o]=null);e.parentNode&&e.parentNode.removeChild(e),t.parentNode&&t.parentNode.removeChild(t)}else c(n,10)}()):(e.parentNode&&e.parentNode.removeChild(e),t.parentNode&&t.parentNode.removeChild(t))),ze(),F.ready=null,F.bridge=null,F.deactivated=null,i=o}},De=function(e){var t={},n={};if("object"==typeof e&&e){for(var o in e)if(o&&S.call(e,o)&&"string"==typeof e[o]&&e[o])switch(o.toLowerCase()){case"text/plain":case"text":case"air:text":case"flash:text":t.text=e[o],n.text=o;break;case"text/html":case"html":case"air:html":case"flash:html":t.html=e[o],n.html=o;break;case"application/rtf":case"text/rtf":case"rtf":case"richtext":case"air:rtf":case"flash:rtf":t.rtf=e[o],n.rtf=o}return{data:t,formatMap:n}}},xe=function(e,t){if("object"!=typeof e||!e||"object"!=typeof t||!t)return e;var n={};for(var o in e)if(S.call(e,o))if("errors"===o){n[o]=e[o]?e[o].slice():[];for(var i=0,r=n[o].length;r>i;i++)n[o][i].format=t[n[o][i].format]}else if("success"!==o&&"data"!==o)n[o]=e[o];else{n[o]={};var s=e[o];for(var a in s)a&&S.call(s,a)&&S.call(t,a)&&(n[o][t[a]]=s[a])}return n},Ae=function(e,t){var n=null==t||t&&t.cacheBust===!0;return n?(-1===e.indexOf("?")?"?":"&")+"noCache="+C():""},Pe=function(e){var t,n,o,i,r="",s=[];if(e.trustedDomains&&("string"==typeof e.trustedDomains?i=[e.trustedDomains]:"object"==typeof e.trustedDomains&&"length"in e.trustedDomains&&(i=e.trustedDomains)),i&&i.length)for(t=0,n=i.length;n>t;t++)if(S.call(i,t)&&i[t]&&"string"==typeof i[t]){if(o=Ne(i[t]),!o)continue;if("*"===o){s.length=0,s.push(o);break}s.push.apply(s,[o,"//"+o,a.location.protocol+"//"+o])}return s.length&&(r+="trustedOrigins="+g(s.join(","))),e.forceEnhancedClipboard===!0&&(r+=(r?"&":"")+"forceEnhancedClipboard=true"),"string"==typeof e.swfObjectId&&e.swfObjectId&&(r+=(r?"&":"")+"swfObjectId="+g(e.swfObjectId)),"string"==typeof e.jsVersion&&e.jsVersion&&(r+=(r?"&":"")+"jsVersion="+g(e.jsVersion)),r},Ne=function(e){if(null==e||""===e)return null;if(e=e.replace(/^\s+|\s+$/g,""),""===e)return null;var t=e.indexOf("//");e=-1===t?e:e.slice(t+2);var n=e.indexOf("/");return e=-1===n?e:-1===t||0===n?null:e.slice(0,n),e&&".swf"===e.slice(-4).toLowerCase()?null:e||null},Le=function(){var e=function(e){var t,n,o,i=[];if("string"==typeof e&&(e=[e]),"object"!=typeof e||!e||"number"!=typeof e.length)return i;for(t=0,n=e.length;n>t;t++)if(S.call(e,t)&&(o=Ne(e[t]))){if("*"===o){i.length=0,i.push("*");break}-1===i.indexOf(o)&&i.push(o)}return i};return function(t,n){var o=Ne(n.swfPath);null===o&&(o=t);var i=e(n.trustedDomains),r=i.length;if(r>0){if(1===r&&"*"===i[0])return"always";if(-1!==i.indexOf(t))return 1===r&&t===o?"sameDomain":"always"}return"never"}}(),We=function(){try{return l.activeElement}catch(e){return null}},Ie=function(e,t){var n,o,i,r=[];if("string"==typeof t&&t&&(r=t.split(/\s+/)),e&&1===e.nodeType&&r.length>0)if(e.classList)for(n=0,o=r.length;o>n;n++)e.classList.add(r[n]);else if(e.hasOwnProperty("className")){for(i=" "+e.className+" ",n=0,o=r.length;o>n;n++)-1===i.indexOf(" "+r[n]+" ")&&(i+=r[n]+" ");e.className=i.replace(/^\s+|\s+$/g,"")}return e},je=function(e,t){var n,o,i,r=[];if("string"==typeof t&&t&&(r=t.split(/\s+/)),e&&1===e.nodeType&&r.length>0)if(e.classList&&e.classList.length>0)for(n=0,o=r.length;o>n;n++)e.classList.remove(r[n]);else if(e.className){for(i=(" "+e.className+" ").replace(/[\r\n\t]/g," "),n=0,o=r.length;o>n;n++)i=i.replace(" "+r[n]+" "," ");e.className=i.replace(/^\s+|\s+$/g,"")}return e},Ve=function(e,t){var n=p(e,null).getPropertyValue(t);return"cursor"!==t||n&&"auto"!==n||"A"!==e.nodeName?n:"pointer"},Fe=function(e){var t={left:0,top:0,width:0,height:0};if(e.getBoundingClientRect){var n=e.getBoundingClientRect(),o=a.pageXOffset,i=a.pageYOffset,r=l.documentElement.clientLeft||0,s=l.documentElement.clientTop||0,u=0,c=0;if("relative"===Ve(l.body,"position")){var d=l.body.getBoundingClientRect(),h=l.documentElement.getBoundingClientRect();u=d.left-h.left||0,c=d.top-h.top||0}t.left=n.left+o-r-u,t.top=n.top+i-s-c,t.width="width"in n?n.width:n.right-n.left,t.height="height"in n?n.height:n.bottom-n.top}return t},Be=function(e){if(!e)return!1;var t=p(e,null),n=y(t.height)>0,o=y(t.width)>0,i=y(t.top)>=0,r=y(t.left)>=0,s=n&&o&&i&&r,a=s?null:Fe(e),l="none"!==t.display&&"collapse"!==t.visibility&&(s||!!a&&(n||a.height>0)&&(o||a.width>0)&&(i||a.top>=0)&&(r||a.left>=0));return l},ze=function(){d(G),G=0,f($),$=0},Ye=function(){var e;if(r&&(e=Oe(F.bridge))){var t=Fe(r);O(e.style,{width:t.width+"px",height:t.height+"px",top:t.top+"px",left:t.left+"px",zIndex:""+Ge(Q.zIndex)})}},Ue=function(e){F.ready===!0&&(F.bridge&&"function"==typeof F.bridge.setHandCursor?F.bridge.setHandCursor(e):F.ready=!1)},Ge=function(e){if(/^(?:auto|inherit)$/.test(e))return e;var t;return"number"!=typeof e||b(e)?"string"==typeof e&&(t=Ge(w(e,10))):t=e,"number"==typeof t?t:"auto"},$e=function(e){var n,o,i,r=F.sandboxed,s=null;if(e=e===!0,V===!1)s=!1;else{try{o=t.frameElement||null}catch(a){i={name:a.name,message:a.message}}if(o&&1===o.nodeType&&"IFRAME"===o.nodeName)try{s=o.hasAttribute("sandbox")}catch(a){s=null}else{try{n=document.domain||null}catch(a){n=null}(null===n||i&&"SecurityError"===i.name&&/(^|[\s\(\[@])sandbox(es|ed|ing|[\s\.,!\)\]@]|$)/.test(i.message.toLowerCase()))&&(s=!0)}}return F.sandboxed=s,r===s||e||Xe(m),s},Xe=function(e){function t(e){var t=e.match(/[\d]+/g);return t.length=3,t.join(".")}function n(e){return!!e&&(e=e.toLowerCase())&&(/^(pepflashplayer\.dll|libpepflashplayer\.so|pepperflashplayer\.plugin)$/.test(e)||"chrome.plugin"===e.slice(-13))}function o(e){e&&(a=!0,e.version&&(d=t(e.version)),!d&&e.description&&(d=t(e.description)),e.filename&&(c=n(e.filename)))}var i,r,s,a=!1,l=!1,c=!1,d="";if(u.plugins&&u.plugins.length)i=u.plugins["Shockwave Flash"],o(i),u.plugins["Shockwave Flash 2.0"]&&(a=!0,d="2.0.0.11");else if(u.mimeTypes&&u.mimeTypes.length)s=u.mimeTypes["application/x-shockwave-flash"],i=s&&s.enabledPlugin,o(i);else if("undefined"!=typeof e){l=!0;try{r=new e("ShockwaveFlash.ShockwaveFlash.7"),a=!0,d=t(r.GetVariable("$version"))}catch(h){try{r=new e("ShockwaveFlash.ShockwaveFlash.6"),a=!0,d="6.0.21"}catch(f){try{r=new e("ShockwaveFlash.ShockwaveFlash"),a=!0,d=t(r.GetVariable("$version"))}catch(p){l=!1}}}}F.disabled=a!==!0,F.outdated=d&&y(d)n;n++)e=s[n].replace(/^on/,""),a[e]=!0,u[e]||(u[e]=[]),u[e].push(t);if(a.ready&&F.ready&&this.emit({type:"ready",client:this}),a.error){for(n=0,r=q.length;r>n;n++)if(F[q[n].replace(/^flash-/,"")]){this.emit({type:"error",name:q[n],client:this});break}i!==o&&Ke.version!==i&&this.emit({type:"error",name:"version-mismatch",jsVersion:Ke.version,swfVersion:i})}}return this},ot=function(e,t){var n,o,i,r,s,a=Ze[this.id],l=a&&a.handlers;if(!l)return this;if(0===arguments.length)r=R(l);else if("string"==typeof e&&e)r=e.split(/\s+/);else if("object"==typeof e&&e&&"undefined"==typeof t)for(n in e)S.call(e,n)&&"string"==typeof n&&n&&"function"==typeof e[n]&&this.off(n,e[n]);if(r&&r.length)for(n=0,o=r.length;o>n;n++)if(e=r[n].toLowerCase().replace(/^on/,""),s=l[e],s&&s.length)if(t)for(i=s.indexOf(t);-1!==i;)s.splice(i,1),i=s.indexOf(t,i);else s.length=0;return this},it=function(e){var t=null,n=Ze[this.id]&&Ze[this.id].handlers;return n&&(t="string"==typeof e&&e?n[e]?n[e].slice(0):[]:k(n)),t},rt=function(e){if(ct.call(this,e)){"object"==typeof e&&e&&"string"==typeof e.type&&e.type&&(e=O({},e));var t=O({},me(e),{client:this});dt.call(this,t)}return this},st=function(e){if(!Ze[this.id])throw new Error("Attempted to clip element(s) to a destroyed ZeroClipboard client instance");e=ht(e);for(var t=0;t0,i=!e.target||o&&-1!==n.indexOf(e.target),r=e.relatedTarget&&o&&-1!==n.indexOf(e.relatedTarget),s=e.client&&e.client===this;return!(!t||!(i||r||s))},dt=function(e){var t=Ze[this.id];if("object"==typeof e&&e&&e.type&&t){var n=ye(e),o=t&&t.handlers["*"]||[],i=t&&t.handlers[e.type]||[],r=o.concat(i);if(r&&r.length){var s,l,u,c,d,h=this;for(s=0,l=r.length;l>s;s++)u=r[s],c=h,"string"==typeof u&&"function"==typeof a[u]&&(u=a[u]),"object"==typeof u&&u&&"function"==typeof u.handleEvent&&(c=u,u=u.handleEvent),"function"==typeof u&&(d=O({},e),be(u,c,[d],n))}}},ht=function(e){return"string"==typeof e&&(e=[]),"number"!=typeof e.length?[e]:e},ft=function(e){if(e&&1===e.nodeType){var t=function(e){(e||(e=a.event))&&("js"!==e._source&&(e.stopImmediatePropagation(),e.preventDefault()),delete e._source)},n=function(n){(n||(n=a.event))&&(t(n),Ke.focus(e))};e.addEventListener("mouseover",n,!1),e.addEventListener("mouseout",t,!1),e.addEventListener("mouseenter",t,!1),e.addEventListener("mouseleave",t,!1),e.addEventListener("mousemove",t,!1),et[e.zcClippingId]={mouseover:n,mouseout:t,mouseenter:t,mouseleave:t,mousemove:t}}},pt=function(e){if(e&&1===e.nodeType){var t=et[e.zcClippingId];if("object"==typeof t&&t){for(var n,o,i=["move","leave","enter","out","over"],r=0,s=i.length;s>r;r++)n="mouse"+i[r],o=t[n],"function"==typeof o&&e.removeEventListener(n,o,!1);delete et[e.zcClippingId]}}};Ke._createClient=function(){tt.apply(this,M(arguments))},Ke.prototype.on=function(){return nt.apply(this,M(arguments))},Ke.prototype.off=function(){return ot.apply(this,M(arguments))},Ke.prototype.handlers=function(){return it.apply(this,M(arguments))},Ke.prototype.emit=function(){return rt.apply(this,M(arguments))},Ke.prototype.clip=function(){return st.apply(this,M(arguments))},Ke.prototype.unclip=function(){return at.apply(this,M(arguments))},Ke.prototype.elements=function(){return lt.apply(this,M(arguments))},Ke.prototype.destroy=function(){return ut.apply(this,M(arguments))},Ke.prototype.setText=function(e){if(!Ze[this.id])throw new Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance");return Ke.setData("text/plain",e),this},Ke.prototype.setHtml=function(e){if(!Ze[this.id])throw new Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance");return Ke.setData("text/html",e),this},Ke.prototype.setRichText=function(e){if(!Ze[this.id])throw new Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance");return Ke.setData("application/rtf",e),this},Ke.prototype.setData=function(){if(!Ze[this.id])throw new Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance");return Ke.setData.apply(this,M(arguments)),this},Ke.prototype.clearData=function(){if(!Ze[this.id])throw new Error("Attempted to clear pending clipboard data from a destroyed ZeroClipboard client instance");return Ke.clearData.apply(this,M(arguments)),this},Ke.prototype.getData=function(){if(!Ze[this.id])throw new Error("Attempted to get pending clipboard data from a destroyed ZeroClipboard client instance");return Ke.getData.apply(this,M(arguments))},"function"==typeof e&&e.amd?e(function(){return Ke}):"object"==typeof n&&n&&"object"==typeof n.exports&&n.exports?n.exports=Ke:t.ZeroClipboard=Ke}(function(){return this||window}())},{}]},{},[23,60,62,61,63,84,85,86,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,87,88,89,90,104,105,106,107,93,94,95,96,97,98,31,35,32,33,40,34,36,37,38,39])("zeroclipboard")}); \ No newline at end of file diff --git a/bower_components/handsontable/dist/handsontable.js b/bower_components/handsontable/dist/handsontable.js index da52214..25b7f2c 100644 --- a/bower_components/handsontable/dist/handsontable.js +++ b/bower_components/handsontable/dist/handsontable.js @@ -1264,7 +1264,7 @@ var Walkontable = function Walkontable(settings) { 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){ +},{"event":8,"helpers/dom/element":45,"helpers/object":51,"helpers/string":53,"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() { @@ -1409,7 +1409,8 @@ 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)) { + var referenceTABLE = closest(TD, ['TABLE']); + if (TD && isChildOf(TD, TABLE) && referenceTABLE == TABLE) { cell.coords = this.instance.wtTable.getCoords(TD); cell.TD = TD; } else if (hasClass(elem, 'wtBorder') && hasClass(elem, 'current')) { @@ -1549,6 +1550,12 @@ var $WalkontableOverlay = WalkontableOverlay; shouldBeRendered: function() { return true; }, + updateTrimmingContainer: function() { + this.trimmingContainer = getTrimmingContainer(this.hider.parentNode.parentNode); + }, + updateMainScrollableElement: function() { + this.mainTableScrollableElement = getScrollableElement(this.wot.wtTable.TABLE); + }, makeClone: function(direction) { if ($WalkontableOverlay.CLONE_TYPES.indexOf(direction) === -1) { throw new Error('Clone type "' + direction + '" is not supported.'); @@ -1629,7 +1636,7 @@ var $WalkontableOverlay = WalkontableOverlay; window.WalkontableOverlay = WalkontableOverlay; //# -},{"eventManager":41,"helpers/dom/element":45,"helpers/object":50}],12:[function(require,module,exports){ +},{"eventManager":41,"helpers/dom/element":45,"helpers/object":51}],12:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { WalkontableDebugOverlay: {get: function() { @@ -1674,7 +1681,8 @@ var $__0 = ($___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47 outerWidth = $__0.outerWidth, innerHeight = $__0.innerHeight, removeClass = $__0.removeClass, - setOverlayPosition = $__0.setOverlayPosition; + setOverlayPosition = $__0.setOverlayPosition, + resetCssTransform = $__0.resetCssTransform; 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); @@ -1710,6 +1718,7 @@ var $WalkontableLeftOverlay = WalkontableLeftOverlay; setOverlayPosition(overlayRoot, finalLeft, finalTop); } else { headerPosition = this.getScrollPosition(); + resetCssTransform(overlayRoot); } this.adjustHeaderBordersPosition(headerPosition); this.adjustElementsSize(); @@ -1735,6 +1744,7 @@ var $WalkontableLeftOverlay = WalkontableLeftOverlay; }, adjustElementsSize: function() { var force = arguments[0] !== (void 0) ? arguments[0] : false; + this.updateTrimmingContainer(); if (this.needFullRender || force) { this.adjustRootElementSize(); this.adjustRootChildrenSize(); @@ -1754,6 +1764,8 @@ var $WalkontableLeftOverlay = WalkontableLeftOverlay; var height = this.wot.wtViewport.getWorkspaceHeight() - scrollbarHeight; height = Math.min(height, innerHeight(this.wot.wtTable.wtRootElement)); overlayRootStyle.height = height + 'px'; + } else { + overlayRootStyle.height = ''; } this.clone.wtTable.holder.style.height = overlayRootStyle.height; tableWidth = outerWidth(this.clone.wtTable.TABLE); @@ -1863,7 +1875,8 @@ var $__0 = ($___46__46__47__46__46__47__46__46__47__46__46__47_helpers_47_dom_47 outerHeight = $__0.outerHeight, innerWidth = $__0.innerWidth, removeClass = $__0.removeClass, - setOverlayPosition = $__0.setOverlayPosition; + setOverlayPosition = $__0.setOverlayPosition, + resetCssTransform = $__0.resetCssTransform; 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); @@ -1899,6 +1912,7 @@ var $WalkontableTopOverlay = WalkontableTopOverlay; setOverlayPosition(overlayRoot, finalLeft, finalTop); } else { headerPosition = this.getScrollPosition(); + resetCssTransform(overlayRoot); } this.adjustHeaderBordersPosition(headerPosition); this.adjustElementsSize(); @@ -1925,6 +1939,7 @@ var $WalkontableTopOverlay = WalkontableTopOverlay; }, adjustElementsSize: function() { var force = arguments[0] !== (void 0) ? arguments[0] : false; + this.updateTrimmingContainer(); if (this.needFullRender || force) { this.adjustRootElementSize(); this.adjustRootChildrenSize(); @@ -1944,6 +1959,8 @@ var $WalkontableTopOverlay = WalkontableTopOverlay; var width = this.wot.wtViewport.getWorkspaceWidth() - scrollbarWidth; width = Math.min(width, innerWidth(this.wot.wtTable.wtRootElement)); overlayRootStyle.width = width + 'px'; + } else { + overlayRootStyle.width = ''; } this.clone.wtTable.holder.style.width = overlayRootStyle.width; tableHeight = outerHeight(this.clone.wtTable.TABLE); @@ -2054,7 +2071,8 @@ var $___46__46__47__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__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; + setOverlayPosition = $__0.setOverlayPosition, + resetCssTransform = $__0.resetCssTransform; 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); @@ -2066,6 +2084,7 @@ var $WalkontableTopLeftCornerOverlay = WalkontableTopLeftCornerOverlay; return (this.wot.getSetting('fixedRowsTop') || this.wot.getSetting('columnHeaders').length) && (this.wot.getSetting('fixedColumnsLeft') || this.wot.getSetting('rowHeaders').length) ? true : false; }, resetFixedPosition: function() { + this.updateTrimmingContainer(); if (!this.wot.wtTable.holder.parentNode) { return; } @@ -2092,6 +2111,8 @@ var $WalkontableTopLeftCornerOverlay = WalkontableTopLeftCornerOverlay; } } setOverlayPosition(overlayRoot, finalLeft, finalTop); + } else { + resetCssTransform(overlayRoot); } overlayRoot.style.height = (tableHeight === 0 ? tableHeight : tableHeight + 4) + 'px'; overlayRoot.style.width = (tableWidth === 0 ? tableWidth : tableWidth + 4) + 'px'; @@ -2181,6 +2202,7 @@ var WalkontableOverlays = function WalkontableOverlays(wotInstance) { this.verticalScrolling = false; this.horizontalScrolling = false; this.delegatedScrollCallback = false; + this.registeredListeners = []; this.registerListeners(); }; ($traceurRuntime.createClass)(WalkontableOverlays, { @@ -2204,51 +2226,52 @@ var WalkontableOverlays = function WalkontableOverlays(wotInstance) { }, registerListeners: function() { var $__3 = this; - this.eventManager.addEventListener(document.documentElement, 'keydown', (function(event) { + var topOverlayScrollable = this.topOverlay.mainTableScrollableElement; + var leftOverlayScrollable = this.leftOverlay.mainTableScrollableElement; + var listenersToRegister = []; + listenersToRegister.push([document.documentElement, 'keydown', (function(event) { return $__3.onKeyDown(event); - })); - this.eventManager.addEventListener(document.documentElement, 'keyup', (function() { + })]); + listenersToRegister.push([document.documentElement, 'keyup', (function() { return $__3.onKeyUp(); - })); - this.eventManager.addEventListener(document, 'visibilitychange', (function() { + })]); + listenersToRegister.push([document, 'visibilitychange', (function() { return $__3.onKeyUp(); - })); - var topOverlayScrollable = this.topOverlay.mainTableScrollableElement; - var leftOverlayScrollable = this.leftOverlay.mainTableScrollableElement; - this.eventManager.addEventListener(topOverlayScrollable, 'scroll', (function(event) { + })]); + listenersToRegister.push([topOverlayScrollable, 'scroll', (function(event) { return $__3.onTableScroll(event); - })); + })]); if (topOverlayScrollable !== leftOverlayScrollable) { - this.eventManager.addEventListener(leftOverlayScrollable, 'scroll', (function(event) { + listenersToRegister.push([leftOverlayScrollable, 'scroll', (function(event) { return $__3.onTableScroll(event); - })); + })]); } if (this.topOverlay.needFullRender) { - this.eventManager.addEventListener(this.topOverlay.clone.wtTable.holder, 'scroll', (function(event) { + listenersToRegister.push([this.topOverlay.clone.wtTable.holder, 'scroll', (function(event) { return $__3.onTableScroll(event); - })); - this.eventManager.addEventListener(this.topOverlay.clone.wtTable.holder, 'wheel', (function(event) { + })]); + listenersToRegister.push([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) { + listenersToRegister.push([this.bottomOverlay.clone.wtTable.holder, 'scroll', (function(event) { return $__3.onTableScroll(event); - })); - this.eventManager.addEventListener(this.bottomOverlay.clone.wtTable.holder, 'wheel', (function(event) { + })]); + listenersToRegister.push([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) { + listenersToRegister.push([this.leftOverlay.clone.wtTable.holder, 'scroll', (function(event) { return $__3.onTableScroll(event); - })); - this.eventManager.addEventListener(this.leftOverlay.clone.wtTable.holder, 'wheel', (function(event) { + })]); + listenersToRegister.push([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) { + listenersToRegister.push([window, 'wheel', (function(event) { var overlay; var deltaY = event.wheelDeltaY || event.deltaY; var deltaX = event.wheelDeltaX || event.deltaX; @@ -2266,7 +2289,18 @@ var WalkontableOverlays = function WalkontableOverlays(wotInstance) { } else if (overlay == 'bottom' && deltaY !== 0) { event.preventDefault(); } - })); + })]); + } + while (listenersToRegister.length) { + var listener = listenersToRegister.pop(); + this.eventManager.addEventListener(listener[0], listener[1], listener[2]); + this.registeredListeners.push(listener); + } + }, + deregisterListeners: function() { + while (this.registeredListeners.length) { + var listener = this.registeredListeners.pop(); + this.eventManager.removeEventListener(listener[0], listener[1], listener[2]); } }, onTableScroll: function(event) { @@ -2484,6 +2518,16 @@ var WalkontableOverlays = function WalkontableOverlays(wotInstance) { this.leftOverlay.clone.wtTable.holder.scrollTop = master.scrollTop; } }, + updateMainScrollableElements: function() { + this.deregisterListeners(); + this.leftOverlay.updateMainScrollableElement(); + this.topOverlay.updateMainScrollableElement(); + if (this.bottomOverlay.needFullRender) { + this.bottomOverlay.updateMainScrollableElement(); + } + this.scrollableElement = getScrollableElement(this.wot.wtTable.TABLE); + this.registerListeners(); + }, destroy: function() { this.eventManager.destroy(); this.topOverlay.destroy(); @@ -2559,7 +2603,7 @@ var WalkontableOverlays = function WalkontableOverlays(wotInstance) { window.WalkontableOverlays = WalkontableOverlays; //# -},{"eventManager":41,"helpers/dom/element":45,"helpers/unicode":53}],17:[function(require,module,exports){ +},{"eventManager":41,"helpers/dom/element":45,"helpers/unicode":54}],17:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { WalkontableScroll: {get: function() { @@ -2741,7 +2785,7 @@ var WalkontableScroll = function WalkontableScroll(wotInstance) { window.WalkontableScroll = WalkontableScroll; //# -},{"helpers/dom/element":45,"helpers/number":49}],18:[function(require,module,exports){ +},{"helpers/dom/element":45,"helpers/number":50}],18:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { WalkontableSelection: {get: function() { @@ -4125,6 +4169,7 @@ var $__shims_47_classes__, $__helpers_47_array__, $__helpers_47_browser__, $__helpers_47_data__, + $__helpers_47_feature__, $__helpers_47_function__, $__helpers_47_mixed__, $__helpers_47_number__, @@ -4153,6 +4198,7 @@ if (!Handsontable.hooks) { 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 featureHelpers = ($__helpers_47_feature__ = require("helpers/feature"), $__helpers_47_feature__ && $__helpers_47_feature__.__esModule && $__helpers_47_feature__ || {default: $__helpers_47_feature__}); 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__}); @@ -4162,11 +4208,11 @@ var stringHelpers = ($__helpers_47_string__ = require("helpers/string"), $__help 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 HELPERS = [arrayHelpers, browserHelpers, dataHelpers, featureHelpers, functionHelpers, mixedHelpers, numberHelpers, objectHelpers, settingHelpers, stringHelpers, unicodeHelpers]; var DOM = [domHelpers, domEventHelpers]; -Handsontable.buildDate = 'Fri Feb 19 2016 12:38:26 GMT+0100 (CET)'; +Handsontable.buildDate = 'Wed Mar 16 2016 12:23:01 GMT+0100 (CET)'; Handsontable.packageName = 'handsontable'; -Handsontable.version = '0.23.0'; +Handsontable.version = '0.24.1'; var baseVersion = '@@baseVersion'; if (!/^@@/.test(baseVersion)) { Handsontable.baseVersion = baseVersion; @@ -4193,7 +4239,7 @@ arrayHelpers.arrayEach(DOM, (function(helper) { })); //# -},{"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":91,"shims/classes":98}],24:[function(require,module,exports){ +},{"cellTypes":24,"core":25,"es6collections":"es6collections","helpers/array":42,"helpers/browser":43,"helpers/data":44,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/feature":47,"helpers/function":48,"helpers/mixed":49,"helpers/number":50,"helpers/object":51,"helpers/setting":52,"helpers/string":53,"helpers/unicode":54,"pluginHooks":57,"plugins":58,"plugins/jqueryHandsontable":1,"renderers/_cellDecorator":92,"shims/classes":99}],24:[function(require,module,exports){ "use strict"; var $__helpers_47_browser__, $__editors__, @@ -4216,6 +4262,7 @@ var $__helpers_47_browser__, $__renderers_47_textRenderer__, $__validators_47_autocompleteValidator__, $__validators_47_dateValidator__, + $__validators_47_timeValidator__, $__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; @@ -4238,6 +4285,7 @@ var PasswordRenderer = ($__renderers_47_passwordRenderer__ = require("renderers/ 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 TimeValidator = ($__validators_47_timeValidator__ = require("validators/timeValidator"), $__validators_47_timeValidator__ && $__validators_47_timeValidator__.__esModule && $__validators_47_timeValidator__ || {default: $__validators_47_timeValidator__}).TimeValidator; 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 = { @@ -4264,6 +4312,11 @@ Handsontable.DateCell = { validator: Handsontable.DateValidator, renderer: getRenderer('autocomplete') }; +Handsontable.TimeCell = { + editor: getEditorConstructor('text'), + validator: Handsontable.TimeValidator, + renderer: getRenderer('text') +}; Handsontable.HandsontableCell = { editor: getEditorConstructor('handsontable'), renderer: getRenderer('autocomplete') @@ -4281,6 +4334,7 @@ Handsontable.DropdownCell = { Handsontable.cellTypes = { text: Handsontable.TextCell, date: Handsontable.DateCell, + time: Handsontable.TimeCell, numeric: Handsontable.NumericCell, checkbox: Handsontable.CheckboxCell, autocomplete: Handsontable.AutocompleteCell, @@ -4294,7 +4348,7 @@ Handsontable.cellLookup = {validator: { }}; //# -},{"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":90,"renderers/autocompleteRenderer":92,"renderers/checkboxRenderer":93,"renderers/htmlRenderer":94,"renderers/numericRenderer":95,"renderers/passwordRenderer":96,"renderers/textRenderer":97,"validators/autocompleteValidator":102,"validators/dateValidator":103,"validators/numericValidator":104}],25:[function(require,module,exports){ +},{"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":91,"renderers/autocompleteRenderer":93,"renderers/checkboxRenderer":94,"renderers/htmlRenderer":95,"renderers/numericRenderer":96,"renderers/passwordRenderer":97,"renderers/textRenderer":98,"validators/autocompleteValidator":104,"validators/dateValidator":105,"validators/numericValidator":106,"validators/timeValidator":107}],25:[function(require,module,exports){ "use strict"; var $__numeral__, $__helpers_47_dom_47_element__, @@ -4456,11 +4510,12 @@ Handsontable.Core = function Core(rootElement, userSettings) { selection.refreshBorders(); break; case 'remove_col': + var logicalColumnIndex = translateColIndex(index); datamap.removeCol(index, amount); for (var row$__20 = 0, len$__21 = instance.countSourceRows(); row$__20 < len$__21; row$__20++) { if (priv.cellSettings[row$__20]) { - priv.cellSettings[row$__20].splice(index, amount); + priv.cellSettings[row$__20].splice(logicalColumnIndex, amount); } } var fixedColumnsLeft = instance.getSettings().fixedColumnsLeft; @@ -4468,17 +4523,16 @@ Handsontable.Core = function Core(rootElement, userSettings) { instance.getSettings().fixedColumnsLeft -= Math.min(amount, fixedColumnsLeft - index); } if (Array.isArray(instance.getSettings().colHeaders)) { - if (typeof index == 'undefined') { - index = -1; + if (typeof logicalColumnIndex == 'undefined') { + logicalColumnIndex = -1; } - instance.getSettings().colHeaders.splice(index, amount); + instance.getSettings().colHeaders.splice(logicalColumnIndex, amount); } grid.adjustRowsAndCols(); selection.refreshBorders(); break; default: throw new Error('There is no such action "' + action + '"'); - break; } if (!keepEmptyRows) { grid.adjustRowsAndCols(); @@ -5000,8 +5054,7 @@ Handsontable.Core = function Core(rootElement, userSettings) { } 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); + var cellProperties = instance.getCellMeta(row, col); 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; @@ -5110,8 +5163,10 @@ Handsontable.Core = function Core(rootElement, userSettings) { }); }, 0)); } else { - cellProperties.valid = true; - done(cellProperties.valid); + instance._registerTimeout(setTimeout(function() { + cellProperties.valid = true; + done(cellProperties.valid); + }, 0)); } }; function setDataInputToArray(row, propOrCol, value) { @@ -5231,6 +5286,9 @@ Handsontable.Core = function Core(rootElement, userSettings) { } else { instance.dataType = 'object'; } + if (datamap) { + datamap.destroy(); + } datamap = new DataMap(instance, priv, GridSettings); dataSource.data = data; dataSource.dataType = instance.dataType; @@ -5309,8 +5367,10 @@ Handsontable.Core = function Core(rootElement, userSettings) { proto = priv.columnSettings[i].prototype; if (GridSettings.prototype.columns) { column = GridSettings.prototype.columns[i]; - extend(proto, column); - extend(proto, expandType(column)); + if (column) { + extend(proto, column); + extend(proto, expandType(column)); + } } } } @@ -5331,12 +5391,31 @@ Handsontable.Core = function Core(rootElement, userSettings) { addClass(instance.rootElement, settings.className); } } - if (typeof settings.height != 'undefined') { - var height = settings.height; - if (typeof height == 'function') { - height = height(); + var currentHeight = instance.rootElement.style.height; + if (currentHeight !== '') { + currentHeight = parseInt(instance.rootElement.style.height, 10); + } + var height = settings.height; + if (typeof height == 'function') { + height = height(); + } + if (init) { + var initialStyle = instance.rootElement.getAttribute('style'); + if (initialStyle) { + instance.rootElement.setAttribute('data-initialstyle', instance.rootElement.getAttribute('style')); + } + } + if (height === null) { + var initialStyle$__22 = instance.rootElement.getAttribute('data-initialstyle'); + if (initialStyle$__22 && (initialStyle$__22.indexOf('height') > -1 || initialStyle$__22.indexOf('overflow') > -1)) { + instance.rootElement.setAttribute('style', initialStyle$__22); + } else { + instance.rootElement.style.height = ''; + instance.rootElement.style.overflow = ''; } + } else if (height !== void 0) { instance.rootElement.style.height = height + 'px'; + instance.rootElement.style.overflow = 'hidden'; } if (typeof settings.width != 'undefined') { var width = settings.width; @@ -5345,9 +5424,6 @@ Handsontable.Core = function Core(rootElement, userSettings) { } instance.rootElement.style.width = width + 'px'; } - if (height) { - instance.rootElement.style.overflow = 'hidden'; - } if (!init) { Handsontable.hooks.run(instance, 'afterUpdateSettings'); } @@ -5356,6 +5432,9 @@ Handsontable.Core = function Core(rootElement, userSettings) { instance.forceFullRender = true; selection.refreshBorders(null, true); } + if (!init && instance.view && (currentHeight === '' || height === '' || height === void 0) && currentHeight !== height) { + instance.view.wt.wtOverlays.updateMainScrollableElements(); + } }; this.getValue = function() { var sel = instance.getSelected(); @@ -5868,8 +5947,11 @@ Handsontable.Core = function Core(rootElement, userSettings) { } } } - priv = null; + if (datamap) { + datamap.destroy(); + } datamap = null; + priv = null; grid = null; selection = null; editorManager = null; @@ -6067,12 +6149,13 @@ DefaultSettings.prototype = { trimRows: void 0, rowHeaderWidth: void 0, columnHeaderHeight: void 0, - observeChanges: void 0 + observeChanges: void 0, + sortFunction: 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":90,"tableView":99}],26:[function(require,module,exports){ +},{"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":50,"helpers/object":51,"helpers/setting":52,"helpers/string":53,"numeral":"numeral","plugins":58,"renderers":91,"tableView":100}],26:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { DataMap: {get: function() { @@ -6085,6 +6168,7 @@ var $__SheetClip__, $__helpers_47_setting__, $__helpers_47_object__, $__helpers_47_array__, + $__utils_47_interval__, $__helpers_47_number__, $__multiMap__; var SheetClip = ($__SheetClip__ = require("SheetClip"), $__SheetClip__ && $__SheetClip__.__esModule && $__SheetClip__ || {default: $__SheetClip__}).default; @@ -6096,19 +6180,26 @@ var $__3 = ($__helpers_47_object__ = require("helpers/object"), $__helpers_47_ob 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 Interval = ($__utils_47_interval__ = require("utils/interval"), $__utils_47_interval__ && $__utils_47_interval__.__esModule && $__utils_47_interval__ || {default: $__utils_47_interval__}).Interval; 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) { + var $__8 = this; this.instance = instance; this.priv = priv; this.GridSettings = GridSettings; this.dataSource = this.instance.getSettings().data; + this.cachedLength = null; + this.latestSourceRowsCount = 0; if (this.dataSource[0]) { this.duckSchema = this.recursiveDuckSchema(this.dataSource[0]); } else { this.duckSchema = {}; } this.createMap(); + this.interval = Interval.create((function() { + return $__8.clearLengthCache(); + }), '15fps'); } DataMap.prototype.DESTINATION_RENDERER = 1; DataMap.prototype.DESTINATION_CLIPBOARD_GENERATOR = 2; @@ -6173,7 +6264,7 @@ DataMap.prototype.propToCol = function(prop) { } else { col = this.propToColCache.get(prop); } - col = Handsontable.hooks.run(this.instance, 'modifyCol', col); + col = Handsontable.hooks.run(this.instance, 'unmodifyCol', col); return col; }; DataMap.prototype.getSchema = function() { @@ -6269,12 +6360,16 @@ DataMap.prototype.removeRow = function(index, amount) { } index = (this.instance.countSourceRows() + index) % this.instance.countSourceRows(); var logicRows = this.physicalRowsToLogical(index, amount); + var descendingLogicRows = logicRows.slice(0).sort(function(a, b) { + return b - a; + }); 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) { + var newData; + newData = data.filter(function(row, index) { return logicRows.indexOf(index) == -1; }); data.length = 0; @@ -6293,16 +6388,38 @@ DataMap.prototype.removeCol = function(index, amount) { index = -amount; } index = (this.instance.countCols() + index) % this.instance.countCols(); - var actionWasNotCancelled = Handsontable.hooks.run(this.instance, 'beforeRemoveCol', index, amount); + var logicColumns = this.physicalColumnsToLogical(index, amount); + var descendingLogicColumns = logicColumns.slice(0).sort(function(a, b) { + return b - a; + }); + var actionWasNotCancelled = Handsontable.hooks.run(this.instance, 'beforeRemoveCol', index, amount, logicColumns); if (actionWasNotCancelled === false) { return; } + var isTableUniform = true; + var removedColumnsCount = descendingLogicColumns.length; var data = this.dataSource; - for (var r = 0, - rlen = this.instance.countSourceRows(); r < rlen; r++) { - data[r].splice(index, amount); + for (var c = 0; c < removedColumnsCount; c++) { + if (isTableUniform && logicColumns[0] !== logicColumns[c] - c) { + isTableUniform = false; + } + } + if (isTableUniform) { + for (var r = 0, + rlen = this.instance.countSourceRows(); r < rlen; r++) { + data[r].splice(logicColumns[0], amount); + } + } else { + for (var r$__9 = 0, + rlen$__10 = this.instance.countSourceRows(); r$__9 < rlen$__10; r$__9++) { + for (var c$__11 = 0; c$__11 < removedColumnsCount; c$__11++) { + data[r$__9].splice(descendingLogicColumns[c$__11], 1); + } + } + for (var c$__12 = 0; c$__12 < removedColumnsCount; c$__12++) { + this.priv.columnSettings.splice(logicColumns[c$__12], 1); + } } - this.priv.columnSettings.splice(index, amount); Handsontable.hooks.run(this.instance, 'afterRemoveCol', index, amount); this.instance.forceFullRender = true; }; @@ -6402,6 +6519,19 @@ DataMap.prototype.physicalRowsToLogical = function(index, amount) { } return logicRows; }; +DataMap.prototype.physicalColumnsToLogical = function(index, amount) { + var totalCols = this.instance.countCols(); + var physicalCol = (totalCols + index) % totalCols; + var logicalCols = []; + var colsToRemove = amount; + while (physicalCol < totalCols && colsToRemove) { + var col = Handsontable.hooks.run(this.instance, 'modifyCol', physicalCol); + logicalCols.push(col); + colsToRemove--; + physicalCol++; + } + return logicalCols; +}; DataMap.prototype.clear = function() { for (var r = 0; r < this.instance.countSourceRows(); r++) { for (var c = 0; c < this.instance.countCols(); c++) { @@ -6409,16 +6539,32 @@ DataMap.prototype.clear = function() { } } }; +DataMap.prototype.clearLengthCache = function() { + this.cachedLength = null; +}; DataMap.prototype.getLength = function() { - var $__7 = this; + var $__8 = 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--; - } - })); + var reValidate = false; + this.interval.start(); + if (length !== this.latestSourceRowsCount) { + reValidate = true; + } + this.latestSourceRowsCount = length; + if (this.cachedLength === null || reValidate) { + rangeEach(length - 1, (function(row) { + row = Handsontable.hooks.run($__8.instance, 'modifyRow', row); + if (row === null) { + --length; + } + })); + this.cachedLength = length; + } else { + length = this.cachedLength; + } + } else { + this.interval.stop(); } return length; }; @@ -6469,11 +6615,21 @@ DataMap.prototype.getText = function(start, end) { DataMap.prototype.getCopyableText = function(start, end) { return SheetClip.stringify(this.getRange(start, end, this.DESTINATION_CLIPBOARD_GENERATOR)); }; +DataMap.prototype.destroy = function() { + this.interval.stop(); + this.interval = null; + this.instance = null; + this.priv = null; + this.GridSettings = null; + this.dataSource = null; + this.cachedLength = null; + this.duckSchema = null; +}; ; 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){ +},{"SheetClip":"SheetClip","helpers/array":42,"helpers/data":44,"helpers/number":50,"helpers/object":51,"helpers/setting":52,"multiMap":56,"utils/interval":102}],27:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { DataSource: {get: function() { @@ -6562,7 +6718,7 @@ var DataSource = function DataSource(hotInstance) { ; //# -},{"helpers/array":42,"helpers/data":44,"helpers/number":49,"helpers/object":50,"helpers/setting":51}],28:[function(require,module,exports){ +},{"helpers/array":42,"helpers/data":44,"helpers/number":50,"helpers/object":51,"helpers/setting":52}],28:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { EditorManager: {get: function() { @@ -6858,7 +7014,7 @@ function EditorManager(instance, priv, selection) { } //# -},{"3rdparty/walkontable/src/cell/coords":5,"editors":29,"eventManager":41,"helpers/dom/event":46,"helpers/unicode":53}],29:[function(require,module,exports){ +},{"3rdparty/walkontable/src/cell/coords":5,"editors":29,"eventManager":41,"helpers/dom/event":46,"helpers/unicode":54}],29:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { registerEditor: {get: function() { @@ -6940,7 +7096,7 @@ function hasEditor(editorName) { } //# -},{"helpers/string":52}],30:[function(require,module,exports){ +},{"helpers/string":53}],30:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { BaseEditor: {get: function() { @@ -7153,7 +7309,7 @@ BaseEditor.prototype.checkEditorSection = function() { }; //# -},{"3rdparty/walkontable/src/cell/coords":5,"helpers/mixed":48}],31:[function(require,module,exports){ +},{"3rdparty/walkontable/src/cell/coords":5,"helpers/mixed":49}],31:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { AutocompleteEditor: {get: function() { @@ -7417,7 +7573,7 @@ AutocompleteEditor.prototype.allowKeyEventPropagation = function(keyCode) { 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){ +},{"editors":29,"handsontableEditor":35,"helpers/array":42,"helpers/dom/element":45,"helpers/mixed":49,"helpers/unicode":54}],32:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { CheckboxEditor: {get: function() { @@ -7641,7 +7797,7 @@ var $DateEditor = DateEditor; registerEditor('date', DateEditor); //# -},{"editors":29,"eventManager":41,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/object":50,"helpers/unicode":53,"moment":undefined,"pikaday":undefined,"textEditor":40}],34:[function(require,module,exports){ +},{"editors":29,"eventManager":41,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/object":51,"helpers/unicode":54,"moment":undefined,"pikaday":undefined,"textEditor":40}],34:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { DropdownEditor: {get: function() { @@ -7828,7 +7984,7 @@ HandsontableEditor.prototype.assignHooks = function() { 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){ +},{"editors":29,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/object":51,"helpers/unicode":54,"textEditor":40}],36:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { MobileTextEditor: {get: function() { @@ -8087,7 +8243,7 @@ MobileTextEditor.prototype.destroy = function() { 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){ +},{"_baseEditor":30,"editors":29,"eventManager":41,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/unicode":54}],37:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { NumericEditor: {get: function() { @@ -8381,7 +8537,7 @@ SelectEditor.prototype.getEditedCell = function() { registerEditor('select', SelectEditor); //# -},{"_baseEditor":30,"editors":29,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/unicode":53}],40:[function(require,module,exports){ +},{"_baseEditor":30,"editors":29,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/unicode":54}],40:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { TextEditor: {get: function() { @@ -8636,7 +8792,7 @@ TextEditor.prototype.refreshDimensions = function() { if (cssTransformOffset && cssTransformOffset != -1) { this.textareaParentStyle[cssTransformOffset[0]] = cssTransformOffset[1]; } else { - resetCssTransform(this.textareaParentStyle); + resetCssTransform(this.TEXTAREA_PARENT); } this.textareaParentStyle.top = editTop + 'px'; this.textareaParentStyle.left = editLeft + 'px'; @@ -8699,7 +8855,7 @@ TextEditor.prototype.destroy = function() { 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){ +},{"_baseEditor":30,"autoResize":"autoResize","editors":29,"eventManager":41,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/unicode":54}],41:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { EventManager: {get: function() { @@ -8711,12 +8867,12 @@ Object.defineProperties(exports, { __esModule: {value: true} }); var $__helpers_47_dom_47_element__, - $__helpers_47_browser__, + $__helpers_47_feature__, $__helpers_47_dom_47_event__; 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 isWebComponentSupportedNatively = ($__helpers_47_feature__ = require("helpers/feature"), $__helpers_47_feature__ && $__helpers_47_feature__.__esModule && $__helpers_47_feature__ || {default: $__helpers_47_feature__}).isWebComponentSupportedNatively; var _stopImmediatePropagation = ($__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__}).stopImmediatePropagation; var EventManager = function EventManager() { var context = arguments[0] !== (void 0) ? arguments[0] : null; @@ -8904,7 +9060,7 @@ function eventManager(context) { } //# -},{"helpers/browser":43,"helpers/dom/element":45,"helpers/dom/event":46}],42:[function(require,module,exports){ +},{"helpers/dom/element":45,"helpers/dom/event":46,"helpers/feature":47}],42:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { to2dArray: {get: function() { @@ -9081,15 +9237,6 @@ Object.defineProperties(exports, { 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); @@ -9114,39 +9261,6 @@ function isMobileBrowser(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 = 't
t'; - var CAPTION = document.createElement('CAPTION'); - CAPTION.innerHTML = 'c
c
c
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){ @@ -9278,7 +9392,7 @@ function cellMethodLookupFactory(methodName, allowUndefined) { } //# -},{"object":50}],45:[function(require,module,exports){ +},{"object":51}],45:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { closest: {get: function() { @@ -9410,20 +9524,15 @@ Object.defineProperties(exports, { isOutsideInput: {get: function() { return isOutsideInput; }}, - requestAnimationFrame: {get: function() { - return requestAnimationFrame; - }}, - cancelAnimationFrame: {get: function() { - return cancelAnimationFrame; - }}, __esModule: {value: true} }); -var $___46__46__47_browser__; +var $___46__46__47_browser__, + $___46__46__47_feature__; 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; + isSafari = $__0.isSafari; +var hasCaptionProblem = ($___46__46__47_feature__ = require("../feature"), $___46__46__47_feature__ && $___46__46__47_feature__.__esModule && $___46__46__47_feature__ || {default: $___46__46__47_feature__}).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)) { @@ -9949,10 +10058,10 @@ function getCssTransform(element) { return -1; } function resetCssTransform(element) { - if (element.transform && element.transform !== '') { - element.transform = ''; - } else if (element['-webkit-transform'] && element['-webkit-transform'] !== '') { - element['-webkit-transform'] = ''; + if (element.style.transform && element.style.transform !== '') { + element.style.transform = ''; + } else if (element.style['-webkit-transform'] && element.style['-webkit-transform'] !== '') { + element.style['-webkit-transform'] = ''; } } function isInput(element) { @@ -9962,39 +10071,9 @@ function isInput(element) { 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){ +},{"../browser":43,"../feature":47}],46:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { stopImmediatePropagation: {get: function() { @@ -10048,6 +10127,116 @@ function pageY(event) { //# },{"element":45}],47:[function(require,module,exports){ "use strict"; +Object.defineProperties(exports, { + requestAnimationFrame: {get: function() { + return requestAnimationFrame; + }}, + cancelAnimationFrame: {get: function() { + return cancelAnimationFrame; + }}, + isTouchSupported: {get: function() { + return isTouchSupported; + }}, + isWebComponentSupportedNatively: {get: function() { + return isWebComponentSupportedNatively; + }}, + hasCaptionProblem: {get: function() { + return hasCaptionProblem; + }}, + getComparisonFunction: {get: function() { + return getComparisonFunction; + }}, + __esModule: {value: true} +}); +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); +} +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 = 't
t'; + var CAPTION = document.createElement('CAPTION'); + CAPTION.innerHTML = 'c
c
c
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; +} +var comparisonFunction; +function getComparisonFunction(language) { + var options = arguments[1] !== (void 0) ? arguments[1] : {}; + if (comparisonFunction) { + return comparisonFunction; + } + if (typeof Intl === 'object') { + comparisonFunction = new Intl.Collator(language, options).compare; + } else if (typeof String.prototype.localeCompare === 'function') { + comparisonFunction = (function(a, b) { + return (a + '').localeCompare(b); + }); + } else { + comparisonFunction = (function(a, b) { + if (a === b) { + return 0; + } + return a > b ? -1 : 1; + }); + } + return comparisonFunction; +} + +//# +},{}],48:[function(require,module,exports){ +"use strict"; Object.defineProperties(exports, { proxy: {get: function() { return proxy; @@ -10215,7 +10404,7 @@ function curryRight(func) { } //# -},{"array":42}],48:[function(require,module,exports){ +},{"array":42}],49:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { stringify: {get: function() { @@ -10243,7 +10432,7 @@ function stringify(value) { } //# -},{}],49:[function(require,module,exports){ +},{}],50:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { isNumeric: {get: function() { @@ -10297,7 +10486,7 @@ function valueAccordingPercent(value, percent) { } //# -},{}],50:[function(require,module,exports){ +},{}],51:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { duckSchema: {get: function() { @@ -10510,7 +10699,7 @@ function getProperty(object, name) { } //# -},{"array":42}],51:[function(require,module,exports){ +},{"array":42}],52:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { columnFactory: {get: function() { @@ -10532,7 +10721,7 @@ function columnFactory(GridSettings, conflictList) { } //# -},{"object":50}],52:[function(require,module,exports){ +},{"object":51}],53:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { toUpperCaseFirst: {get: function() { @@ -10647,7 +10836,7 @@ function padStart(string, maxLength) { ; //# -},{"mixed":48,"number":49}],53:[function(require,module,exports){ +},{"mixed":49,"number":50}],54:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { KEY_CODES: {get: function() { @@ -10736,7 +10925,7 @@ function isKey(keyCode, baseCode) { } //# -},{"array":42}],54:[function(require,module,exports){ +},{"array":42}],55:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { localHooks: {get: function() { @@ -10781,7 +10970,7 @@ Handsontable.utils = Handsontable.utils || {}; Handsontable.utils.localHooks = localHooks; //# -},{"helpers/array":42,"helpers/object":50}],55:[function(require,module,exports){ +},{"helpers/array":42,"helpers/object":51}],56:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { MultiMap: {get: function() { @@ -10833,7 +11022,7 @@ function MultiMap() { } //# -},{}],56:[function(require,module,exports){ +},{}],57:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { Hooks: {get: function() { @@ -10843,7 +11032,7 @@ Object.defineProperties(exports, { }); 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 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', 'unmodifyCol', '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() { @@ -10984,7 +11173,7 @@ Handsontable.utils = Handsontable.utils || {}; Handsontable.utils.Hooks = Hooks; //# -},{"helpers/array":42,"helpers/object":50}],57:[function(require,module,exports){ +},{"helpers/array":42,"helpers/object":51}],58:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { registerPlugin: {get: function() { @@ -11056,7 +11245,7 @@ function getPluginName(hotInstance, plugin) { ; //# -},{"helpers/object":50,"helpers/string":52}],58:[function(require,module,exports){ +},{"helpers/object":51,"helpers/string":53}],59:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { default: {get: function() { @@ -11189,7 +11378,7 @@ var $__default = BasePlugin; Handsontable.plugins.BasePlugin = BasePlugin; //# -},{"helpers/array":42,"helpers/object":50,"plugins":57}],59:[function(require,module,exports){ +},{"helpers/array":42,"helpers/object":51,"plugins":58}],60:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { AutoColumnSize: {get: function() { @@ -11199,6 +11388,7 @@ Object.defineProperties(exports, { }); var $___46__46__47__95_base__, $___46__46__47__46__46__47_helpers_47_array__, + $___46__46__47__46__46__47_helpers_47_feature__, $___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__, @@ -11211,33 +11401,33 @@ var BasePlugin = ($___46__46__47__95_base__ = require("_base"), $___46__46__47__ 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__}), +var $__2 = ($___46__46__47__46__46__47_helpers_47_feature__ = require("helpers/feature"), $___46__46__47__46__46__47_helpers_47_feature__ && $___46__46__47__46__46__47_helpers_47_feature__.__esModule && $___46__46__47__46__46__47_helpers_47_feature__ || {default: $___46__46__47__46__46__47_helpers_47_feature__}), cancelAnimationFrame = $__2.cancelAnimationFrame, - requestAnimationFrame = $__2.requestAnimationFrame, - isVisible = $__2.isVisible; + requestAnimationFrame = $__2.requestAnimationFrame; +var isVisible = ($___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__}).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 $__5 = ($___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 = $__5.isObject, + objectEach = $__5.objectEach; +var $__6 = ($___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 = $__6.valueAccordingPercent, + rangeEach = $__6.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; + var $__11 = 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); + return $__11.hot.getDataAtCell(row, col); })); this.firstCalculation = true; this.inProgress = false; this.addHook('beforeColumnResize', (function(col, size, isDblClick) { - return $__10.onBeforeColumnResize(col, size, isDblClick); + return $__11.onBeforeColumnResize(col, size, isDblClick); })); }; var $AutoColumnSize = AutoColumnSize; @@ -11246,7 +11436,7 @@ var $AutoColumnSize = AutoColumnSize; return this.hot.getSettings().autoColumnSize !== false && !this.hot.getSettings().colWidths; }, enablePlugin: function() { - var $__10 = this; + var $__11 = this; if (this.enabled) { return; } @@ -11256,16 +11446,16 @@ var $AutoColumnSize = AutoColumnSize; this.samplesGenerator.customSampleCount = parseInt(samplingRatio, 10); } this.addHook('afterLoadData', (function() { - return $__10.onAfterLoadData(); + return $__11.onAfterLoadData(); })); this.addHook('beforeChange', (function(changes) { - return $__10.onBeforeChange(changes); + return $__11.onBeforeChange(changes); })); this.addHook('beforeRender', (function(force) { - return $__10.onBeforeRender(force); + return $__11.onBeforeRender(force); })); this.addHook('modifyColWidth', (function(width, col) { - return $__10.getColumnWidth(col, width); + return $__11.getColumnWidth(col, width); })); $traceurRuntime.superGet(this, $AutoColumnSize.prototype, "enablePlugin").call(this); }, @@ -11282,7 +11472,7 @@ var $AutoColumnSize = AutoColumnSize; to: this.hot.countRows() - 1 }; var force = arguments[2] !== (void 0) ? arguments[2] : false; - var $__10 = this; + var $__11 = this; if (typeof colRange === 'number') { colRange = { from: colRange, @@ -11296,16 +11486,16 @@ var $AutoColumnSize = AutoColumnSize; }; } 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); + if (force || ($__11.widths[col] === void 0 && !$__11.hot._getColWidthFromSettings(col))) { + var samples = $__11.samplesGenerator.generateColumnSamples(col, rowRange); samples.forEach((function(sample, col) { - return $__10.ghostTable.addColumn(col, sample); + return $__11.ghostTable.addColumn(col, sample); })); } })); if (this.ghostTable.columns.length) { this.ghostTable.getWidths((function(col, width) { - return $__10.widths[col] = width; + return $__11.widths[col] = width; })); this.ghostTable.clean(); } @@ -11315,18 +11505,18 @@ var $AutoColumnSize = AutoColumnSize; from: 0, to: this.hot.countRows() - 1 }; - var $__10 = this; + var $__11 = this; var current = 0; var length = this.hot.countCols() - 1; var timer = null; this.inProgress = true; var loop = (function() { - if (!$__10.hot) { + if (!$__11.hot) { cancelAnimationFrame(timer); - $__10.inProgress = false; + $__11.inProgress = false; return; } - $__10.calculateColumnsWidth({ + $__11.calculateColumnsWidth({ from: current, to: Math.min(current + $AutoColumnSize.CALCULATION_STEP, length) }, rowRange); @@ -11335,10 +11525,10 @@ var $AutoColumnSize = AutoColumnSize; 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(); + $__11.inProgress = false; + $__11.hot.view.wt.wtOverlays.adjustElementsSize(true); + if ($__11.hot.view.wt.wtOverlays.leftOverlay.needFullRender) { + $__11.hot.view.wt.wtOverlays.leftOverlay.clone.draw(); } } }); @@ -11430,21 +11620,21 @@ var $AutoColumnSize = AutoColumnSize; } }, onAfterLoadData: function() { - var $__10 = this; + var $__11 = this; if (this.hot.view) { this.recalculateAllColumnsWidth(); } else { setTimeout((function() { - if ($__10.hot) { - $__10.recalculateAllColumnsWidth(); + if ($__11.hot) { + $__11.recalculateAllColumnsWidth(); } }), 0); } }, onBeforeChange: function(changes) { - var $__10 = this; + var $__11 = this; arrayEach(changes, (function(data) { - return $__10.widths[$__10.hot.propToCol(data[1])] = void 0; + return $__11.widths[$__11.hot.propToCol(data[1])] = void 0; })); }, onBeforeColumnResize: function(col, size, isDblClick) { @@ -11470,7 +11660,7 @@ var $AutoColumnSize = AutoColumnSize; 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":100,"utils/samplesGenerator":101}],60:[function(require,module,exports){ +},{"3rdparty/walkontable/src/calculator/viewportColumns":3,"_base":59,"helpers/array":42,"helpers/dom/element":45,"helpers/feature":47,"helpers/number":50,"helpers/object":51,"helpers/string":53,"plugins":58,"utils/ghostTable":101,"utils/samplesGenerator":103}],61:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { AutoRowSize: {get: function() { @@ -11480,6 +11670,7 @@ Object.defineProperties(exports, { }); var $___46__46__47__95_base__, $___46__46__47__46__46__47_helpers_47_array__, + $___46__46__47__46__46__47_helpers_47_feature__, $___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__, @@ -11491,32 +11682,32 @@ var BasePlugin = ($___46__46__47__95_base__ = require("_base"), $___46__46__47__ 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__}), +var $__2 = ($___46__46__47__46__46__47_helpers_47_feature__ = require("helpers/feature"), $___46__46__47__46__46__47_helpers_47_feature__ && $___46__46__47__46__46__47_helpers_47_feature__.__esModule && $___46__46__47__46__46__47_helpers_47_feature__ || {default: $___46__46__47__46__46__47_helpers_47_feature__}), cancelAnimationFrame = $__2.cancelAnimationFrame, - requestAnimationFrame = $__2.requestAnimationFrame, - isVisible = $__2.isVisible; + requestAnimationFrame = $__2.requestAnimationFrame; +var isVisible = ($___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__}).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 $__5 = ($___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 = $__5.isObject, + objectEach = $__5.objectEach; +var $__6 = ($___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 = $__6.valueAccordingPercent, + rangeEach = $__6.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; + var $__10 = 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); + return $__10.hot.getDataAtCell(row, col); })); this.firstCalculation = true; this.inProgress = false; this.addHook('beforeRowResize', (function(row, size, isDblClick) { - return $__9.onBeforeRowResize(row, size, isDblClick); + return $__10.onBeforeRowResize(row, size, isDblClick); })); }; var $AutoRowSize = AutoRowSize; @@ -11525,7 +11716,7 @@ var $AutoRowSize = AutoRowSize; return this.hot.getSettings().autoRowSize === true || isObject(this.hot.getSettings().autoRowSize); }, enablePlugin: function() { - var $__9 = this; + var $__10 = this; if (this.enabled) { return; } @@ -11535,28 +11726,28 @@ var $AutoRowSize = AutoRowSize; this.samplesGenerator.customSampleCount = parseInt(samplingRatio, 10); } this.addHook('afterLoadData', (function() { - return $__9.onAfterLoadData(); + return $__10.onAfterLoadData(); })); this.addHook('beforeChange', (function(changes) { - return $__9.onBeforeChange(changes); + return $__10.onBeforeChange(changes); })); this.addHook('beforeColumnMove', (function() { - return $__9.recalculateAllRowsHeight(); + return $__10.recalculateAllRowsHeight(); })); this.addHook('beforeColumnResize', (function() { - return $__9.recalculateAllRowsHeight(); + return $__10.recalculateAllRowsHeight(); })); this.addHook('beforeColumnSort', (function() { - return $__9.clearCache(); + return $__10.clearCache(); })); this.addHook('beforeRender', (function(force) { - return $__9.onBeforeRender(force); + return $__10.onBeforeRender(force); })); this.addHook('beforeRowMove', (function(rowStart, rowEnd) { - return $__9.onBeforeRowMove(rowStart, rowEnd); + return $__10.onBeforeRowMove(rowStart, rowEnd); })); this.addHook('modifyRowHeight', (function(height, row) { - return $__9.getRowHeight(row, height); + return $__10.getRowHeight(row, height); })); $traceurRuntime.superGet(this, $AutoRowSize.prototype, "enablePlugin").call(this); }, @@ -11573,7 +11764,7 @@ var $AutoRowSize = AutoRowSize; to: this.hot.countCols() - 1 }; var force = arguments[2] !== (void 0) ? arguments[2] : false; - var $__9 = this; + var $__10 = this; if (typeof rowRange === 'number') { rowRange = { from: rowRange, @@ -11587,16 +11778,16 @@ var $AutoRowSize = AutoRowSize; }; } rangeEach(rowRange.from, rowRange.to, (function(row) { - if (force || $__9.heights[row] === void 0) { - var samples = $__9.samplesGenerator.generateRowSamples(row, colRange); + if (force || $__10.heights[row] === void 0) { + var samples = $__10.samplesGenerator.generateRowSamples(row, colRange); samples.forEach((function(sample, row) { - return $__9.ghostTable.addRow(row, sample); + return $__10.ghostTable.addRow(row, sample); })); } })); if (this.ghostTable.rows.length) { this.ghostTable.getHeights((function(row, height) { - return $__9.heights[row] = height; + return $__10.heights[row] = height; })); this.ghostTable.clean(); } @@ -11606,18 +11797,18 @@ var $AutoRowSize = AutoRowSize; from: 0, to: this.hot.countCols() - 1 }; - var $__9 = this; + var $__10 = this; var current = 0; var length = this.hot.countRows() - 1; var timer = null; this.inProgress = true; var loop = (function() { - if (!$__9.hot) { + if (!$__10.hot) { cancelAnimationFrame(timer); - $__9.inProgress = false; + $__10.inProgress = false; return; } - $__9.calculateRowsHeight({ + $__10.calculateRowsHeight({ from: current, to: Math.min(current + $AutoRowSize.CALCULATION_STEP, length) }, colRange); @@ -11626,10 +11817,10 @@ var $AutoRowSize = AutoRowSize; 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(); + $__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(); } } }); @@ -11698,7 +11889,7 @@ var $AutoRowSize = AutoRowSize; this.heights.length = 0; }, clearCacheByRange: function(range) { - var $__9 = this; + var $__10 = this; if (typeof range === 'number') { range = { from: range, @@ -11706,7 +11897,7 @@ var $AutoRowSize = AutoRowSize; }; } rangeEach(Math.min(range.from, range.to), Math.max(range.from, range.to), (function(row) { - return $__9.heights[row] = void 0; + return $__10.heights[row] = void 0; })); }, isNeedRecalculate: function() { @@ -11747,13 +11938,13 @@ var $AutoRowSize = AutoRowSize; return size; }, onAfterLoadData: function() { - var $__9 = this; + var $__10 = this; if (this.hot.view) { this.recalculateAllRowsHeight(); } else { setTimeout((function() { - if ($__9.hot) { - $__9.recalculateAllRowsHeight(); + if ($__10.hot) { + $__10.recalculateAllRowsHeight(); } }), 0); } @@ -11788,7 +11979,7 @@ var $AutoRowSize = AutoRowSize; 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":100,"utils/samplesGenerator":101}],61:[function(require,module,exports){ +},{"_base":59,"helpers/array":42,"helpers/dom/element":45,"helpers/feature":47,"helpers/number":50,"helpers/object":51,"helpers/string":53,"plugins":58,"utils/ghostTable":101,"utils/samplesGenerator":103}],62:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { Autofill: {get: function() { @@ -12064,7 +12255,7 @@ function settingsFactory(settings) { Handsontable.Autofill = Autofill; //# -},{"3rdparty/walkontable/src/cell/coords":5,"eventManager":41,"helpers/dom/element":45,"plugins":57}],62:[function(require,module,exports){ +},{"3rdparty/walkontable/src/cell/coords":5,"eventManager":41,"helpers/dom/element":45,"plugins":58}],63:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { ColumnSorting: {get: function() { @@ -12323,6 +12514,27 @@ var $ColumnSorting = ColumnSorting; return 0; }; }, + numericSort: function(sortOrder) { + return function(a, b) { + var parsedA = parseFloat(a[1]); + var parsedB = parseFloat(b[1]); + if (parsedA === parsedB || (isNaN(parsedA) && isNaN(parsedB))) { + return 0; + } + if (isNaN(parsedA)) { + return 1; + } + if (isNaN(parsedB)) { + return -1; + } + if (parsedA < parsedB) { + return sortOrder ? -1 : 1; + } else if (parsedA > parsedB) { + return sortOrder ? 1 : -1; + } + return 0; + }; + }, sort: function() { if (typeof this.hot.sortOrder == 'undefined') { this.hot.sortIndex.length = 0; @@ -12337,12 +12549,19 @@ var $ColumnSorting = ColumnSorting; this.hot.sortIndex.push([i, this.hot.getDataAtCell(i, this.hot.sortColumn)]); } colMeta = this.hot.getCellMeta(0, this.hot.sortColumn); - switch (colMeta.type) { - case 'date': - sortFunction = this.dateSort; - break; - default: - sortFunction = this.defaultSort; + if (colMeta.sortFunction) { + sortFunction = colMeta.sortFunction; + } else { + switch (colMeta.type) { + case 'date': + sortFunction = this.dateSort; + break; + case 'numeric': + sortFunction = this.numericSort; + 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++) { @@ -12443,7 +12662,7 @@ var $ColumnSorting = ColumnSorting; registerPlugin('columnSorting', ColumnSorting); //# -},{"_base":58,"eventManager":41,"helpers/array":42,"helpers/dom/element":45,"plugins":57}],63:[function(require,module,exports){ +},{"_base":59,"eventManager":41,"helpers/array":42,"helpers/dom/element":45,"plugins":58}],64:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { CommentEditor: {get: function() { @@ -12531,7 +12750,7 @@ var $CommentEditor = CommentEditor; ; //# -},{"helpers/dom/element":45}],64:[function(require,module,exports){ +},{"helpers/dom/element":45}],65:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { Comments: {get: function() { @@ -12826,7 +13045,7 @@ var $Comments = Comments; 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){ +},{"3rdparty/walkontable/src/cell/coords":5,"_base":59,"commentEditor":64,"eventManager":41,"helpers/dom/element":45,"plugins":58}],66:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { CommandExecutor: {get: function() { @@ -12899,7 +13118,7 @@ function findSubCommand(subCommandName, subCommands) { ; //# -},{"helpers/array":42}],66:[function(require,module,exports){ +},{"helpers/array":42}],67:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { ContextMenu: {get: function() { @@ -13093,7 +13312,7 @@ 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){ +},{"_base":59,"commandExecutor":66,"eventManager":41,"helpers/array":42,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/object":51,"itemsFactory":69,"menu":70,"plugins":58,"predefinedItems":71}],68:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { Cursor: {get: function() { @@ -13173,7 +13392,7 @@ Handsontable.plugins.utils = Handsontable.plugins.utils || {}; Handsontable.plugins.utils.Cursor = Cursor; //# -},{"helpers/dom/element":45,"helpers/dom/event":46}],68:[function(require,module,exports){ +},{"helpers/dom/element":45,"helpers/dom/event":46}],69:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { ItemsFactory: {get: function() { @@ -13292,7 +13511,7 @@ function getItems() { ; //# -},{"helpers/array":42,"helpers/object":50,"predefinedItems":70}],69:[function(require,module,exports){ +},{"helpers/array":42,"helpers/object":51,"predefinedItems":71}],70:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { Menu: {get: function() { @@ -13414,6 +13633,7 @@ var $Menu = Menu; }], renderAllRows: true, fragmentSelection: 'cell', + disableVisualSelection: 'area', beforeKeyDown: (function(event) { return $__11.onBeforeKeyDown(event); }), @@ -13455,7 +13675,7 @@ var $Menu = Menu; }, openSubMenu: function(row) { if (!this.hotMenu) { - return; + return false; } var cell = this.hotMenu.getCell(row, 0); this.closeAllSubMenus(); @@ -13802,7 +14022,7 @@ 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){ +},{"cursor":68,"eventManager":41,"helpers/array":42,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/function":48,"helpers/object":51,"helpers/unicode":54,"mixins/localHooks":55,"predefinedItems":71,"utils":72}],71:[function(require,module,exports){ "use strict"; var $__4; Object.defineProperties(exports, { @@ -13959,7 +14179,8 @@ var _predefinedItems = ($__4 = {}, Object.defineProperty($__4, SEPARATOR, { } 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; + var onlyOneColumn = this.countCols() == 1; + return selected[1] < 0 || this.countCols() >= this.getSettings().maxCols || (!onlyOneColumn && rowSelected); }, hidden: function() { return !this.getSettings().allowInsertColumn; @@ -13985,7 +14206,8 @@ var _predefinedItems = ($__4 = {}, Object.defineProperty($__4, SEPARATOR, { } 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; + var onlyOneColumn = this.countCols() == 1; + return selected[1] < 0 || this.countCols() >= this.getSettings().maxCols || (!onlyOneColumn && rowSelected); }, hidden: function() { return !this.getSettings().allowInsertColumn; @@ -14359,7 +14581,7 @@ var _predefinedItems = ($__4 = {}, Object.defineProperty($__4, SEPARATOR, { }), $__4); //# -},{"helpers/number":49,"helpers/object":50,"utils":71}],71:[function(require,module,exports){ +},{"helpers/number":50,"helpers/object":51,"utils":72}],72:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { normalizeSelection: {get: function() { @@ -14498,7 +14720,7 @@ function markLabelAsSelected(label) { } //# -},{"helpers/dom/element":45}],72:[function(require,module,exports){ +},{"helpers/dom/element":45}],73:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { ContextMenuCopyPaste: {get: function() { @@ -14630,7 +14852,7 @@ var $ContextMenuCopyPaste = ContextMenuCopyPaste; registerPlugin('contextMenuCopyPaste', ContextMenuCopyPaste); //# -},{"_base":58,"eventManager":41,"helpers/array":42,"helpers/dom/element":45,"plugins":57,"zeroclipboard":undefined}],73:[function(require,module,exports){ +},{"_base":59,"eventManager":41,"helpers/array":42,"helpers/dom/element":45,"plugins":58,"zeroclipboard":undefined}],74:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { CopyPastePlugin: {get: function() { @@ -14833,7 +15055,7 @@ 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){ +},{"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":48,"helpers/number":50,"helpers/unicode":54,"plugins":58}],75:[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__, @@ -15170,7 +15392,7 @@ Handsontable.hooks.add('afterInit', function() { Handsontable.CustomBorders = CustomBorders; //# -},{"3rdparty/walkontable/src/cell/range":6,"3rdparty/walkontable/src/selection":18,"plugins":57}],75:[function(require,module,exports){ +},{"3rdparty/walkontable/src/cell/range":6,"3rdparty/walkontable/src/selection":18,"plugins":58}],76:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { DragToScroll: {get: function() { @@ -15258,7 +15480,7 @@ Handsontable.hooks.add('afterOnCellCornerMouseDown', function() { Handsontable.plugins.DragToScroll = DragToScroll; //# -},{"eventManager":41,"plugins":57}],76:[function(require,module,exports){ +},{"eventManager":41,"plugins":58}],77:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { ManualColumnFreeze: {get: function() { @@ -15272,6 +15494,8 @@ var BasePlugin = ($___46__46__47__95_base__ = require("_base"), $___46__46__47__ 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); + this.manualColumnMovePlugin = null; + this.frozenColumnsBasePositions = []; }; var $ManualColumnFreeze = ManualColumnFreeze; ($traceurRuntime.createClass)(ManualColumnFreeze, { @@ -15291,26 +15515,21 @@ var $ManualColumnFreeze = ManualColumnFreeze; })); $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; }, + getManualColumnMovePlugin: function() { + if (!this.manualColumnMovePlugin) { + this.manualColumnMovePlugin = this.hot.getPlugin('manualColumnMove'); + } + return this.manualColumnMovePlugin; + }, onModifyCol: function(column) { - if (this.hot.manualColumnPositionsPluginUsages.length > 1) { + if (this.getManualColumnMovePlugin().isEnabled()) { return column; } - return this.getModifiedColumnIndex(column); - }, - getModifiedColumnIndex: function(column) { - return this.hot.manualColumnPositions[column]; + return this.getLogicalColumnIndex(column); }, addContextMenuEntry: function(defaultOptions) { var _this = this; @@ -15342,9 +15561,10 @@ var $ManualColumnFreeze = ManualColumnFreeze; if (column <= this.fixedColumnsCount - 1) { return; } - var modifiedColumn = this.getModifiedColumnIndex(column) || column; - this.checkPositionData(modifiedColumn); - this.modifyColumnOrder(modifiedColumn, column, null, 'freeze'); + if (column !== this.getLogicalColumnIndex(column)) { + this.frozenColumnsBasePositions[this.fixedColumnsCount] = column; + } + this.changeColumnPositions(column, this.fixedColumnsCount); this.addFixedColumn(); this.hot.view.wt.wtOverlays.leftOverlay.refresh(); this.hot.view.wt.wtOverlays.adjustElementsSize(); @@ -15354,9 +15574,7 @@ var $ManualColumnFreeze = ManualColumnFreeze; return; } var returnCol = this.getBestColumnReturnPosition(column); - var modifiedColumn = this.getModifiedColumnIndex(column) || column; - this.checkPositionData(modifiedColumn); - this.modifyColumnOrder(modifiedColumn, column, returnCol, 'unfreeze'); + this.changeColumnPositions(column, returnCol); this.removeFixedColumn(); this.hot.view.wt.wtOverlays.leftOverlay.refresh(); this.hot.view.wt.wtOverlays.adjustElementsSize(); @@ -15369,53 +15587,42 @@ var $ManualColumnFreeze = ManualColumnFreeze; 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); + getBestColumnReturnPosition: function(column) { + var i = this.fixedColumnsCount; + var j = this.getLogicalColumnIndex(i); + var initialCol; + if (this.frozenColumnsBasePositions[column] == null) { + initialCol = this.getLogicalColumnIndex(column); + while (j < initialCol) { + i++; + j = this.getLogicalColumnIndex(i); } } 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; + initialCol = this.frozenColumnsBasePositions[column]; + this.frozenColumnsBasePositions[column] = void 0; + while (j <= initialCol) { + i++; + j = this.getLogicalColumnIndex(i); } + i = j; } + return i - 1; }, - 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]); - } + getVisibleColumnIndex: function(column) { + return this.getManualColumnMovePlugin().getVisibleColumnIndex(column); }, - 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; + getLogicalColumnIndex: function(column) { + return this.getManualColumnMovePlugin().getLogicalColumnIndex(column); + }, + changeColumnPositions: function(sourceColumn, destinationColumn) { + this.getManualColumnMovePlugin().changeColumnPositions(sourceColumn, destinationColumn); } }, {}, BasePlugin); ; registerPlugin('manualColumnFreeze', ManualColumnFreeze); //# -},{"_base":58,"plugins":57}],77:[function(require,module,exports){ +},{"_base":59,"plugins":58}],78:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { ManualColumnMove: {get: function() { @@ -15423,267 +15630,336 @@ Object.defineProperties(exports, { }}, __esModule: {value: true} }); -var $___46__46__47__46__46__47_helpers_47_dom_47_element__, +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_helpers_47_array__, + $___46__46__47__46__46__47_helpers_47_number__, $___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 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 $__2 = ($___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 = $__2.arrayEach, + arrayMap = $__2.arrayMap; +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 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 $__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__}), + pageX = $__5.pageX, + pageY = $__5.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 privatePool = new WeakMap(); +var ManualColumnMove = function ManualColumnMove(hotInstance) { + var $__7 = this; + $traceurRuntime.superConstructor($ManualColumnMove).call(this, hotInstance); + privatePool.set(this, { + guideClassName: 'manualColumnMoverGuide', + handleClassName: 'manualColumnMover', + startOffset: null, + pressed: null, + startCol: null, + endCol: null, + currentCol: null, + startX: null, + startY: null + }); + this.guideElement = null; + this.handleElement = null; + this.currentTH = null; + this.columnPositions = []; + this.eventManager = eventManagerObject(this); + this.addHook('init', (function() { + return $__7.onInit(); + })); +}; +var $ManualColumnMove = ManualColumnMove; +($traceurRuntime.createClass)(ManualColumnMove, { + isEnabled: function() { + return !!this.hot.getSettings().manualColumnMove; + }, + enablePlugin: function() { + var $__7 = this; + var priv = privatePool.get(this); + var initialSettings = this.hot.getSettings().manualColumnMove; + var loadedManualColumnPositions = this.loadManualColumnPositions(); + this.handleElement = document.createElement('DIV'); + this.handleElement.className = priv.handleClassName; + this.guideElement = document.createElement('DIV'); + this.guideElement.className = priv.guideClassName; + this.addHook('modifyCol', (function(col) { + return $__7.onModifyCol(col); + })); + this.addHook('unmodifyCol', (function(col) { + return $__7.onUnmodifyCol(col); + })); + this.addHook('afterRemoveCol', (function(index, amount) { + return $__7.onAfterRemoveCol(index, amount); + })); + this.addHook('afterCreateCol', (function(index, amount) { + return $__7.onAfterCreateCol(index, amount); + })); + this.registerEvents(); + if (typeof loadedManualColumnPositions != 'undefined') { + this.columnPositions = loadedManualColumnPositions; + } else if (Array.isArray(initialSettings)) { + this.columnPositions = initialSettings; + } else if (!initialSettings || this.columnPositions === void 0) { + this.columnPositions = []; + } + $traceurRuntime.superGet(this, $ManualColumnMove.prototype, "enablePlugin").call(this); + }, + updatePlugin: function() { + this.disablePlugin(); + this.enablePlugin(); + $traceurRuntime.superGet(this, $ManualColumnMove.prototype, "updatePlugin").call(this); + }, + disablePlugin: function() { + var pluginSetting = this.hot.getSettings().manualColumnMove; + if (Array.isArray(pluginSetting)) { + this.unregisterEvents(); + this.columnPositions = []; + } + $traceurRuntime.superGet(this, $ManualColumnMove.prototype, "disablePlugin").call(this); + }, + registerEvents: function() { + var $__7 = this; + this.eventManager.addEventListener(this.hot.rootElement, 'mouseover', (function(event) { + return $__7.onMouseOver(event); + })); + this.eventManager.addEventListener(this.hot.rootElement, 'mousedown', (function(event) { + return $__7.onMouseDown(event); + })); + this.eventManager.addEventListener(window, 'mousemove', (function(event) { + return $__7.onMouseMove(event); + })); + this.eventManager.addEventListener(window, 'mouseup', (function(event) { + return $__7.onMouseUp(event); + })); + }, + unregisterEvents: function() { + this.eventManager.clear(); + }, + saveManualColumnPositions: function() { + Handsontable.hooks.run(this.hot, 'persistentStateSave', 'manualColumnPositions', this.columnPositions); + }, + loadManualColumnPositions: function() { var storedState = {}; - Handsontable.hooks.run(instance, 'persistentStateLoad', 'manualColumnPositions', storedState); + Handsontable.hooks.run(this.hot, 'persistentStateLoad', 'manualColumnPositions', storedState); return storedState.value; - }; - function setupHandlePosition(TH) { - instance = this; - currentTH = TH; - var col = this.view.wt.wtTable.getCoords(TH).col; + }, + completeSettingsArray: function() { + var $__7 = this; + var columnCount = this.hot.countCols(); + if (this.columnPositions.length === columnCount) { + return; + } + rangeEach(0, columnCount - 1, (function(i) { + if ($__7.columnPositions.indexOf(i) === -1) { + $__7.columnPositions.push(i); + } + })); + }, + setupHandlePosition: function(TH) { + var priv = privatePool.get(this); + var col = this.hot.view.wt.wtTable.getCoords(TH).col; + this.currentTH = TH; 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); + var box = this.currentTH.getBoundingClientRect(); + priv.currentCol = col; + priv.startOffset = box.left; + this.handleElement.style.top = box.top + 'px'; + this.handleElement.style.left = priv.startOffset + 'px'; + this.hot.rootElement.appendChild(this.handleElement); } - } - function refreshHandlePosition(TH, delta) { + }, + refreshHandlePosition: function(TH, delta) { var box = TH.getBoundingClientRect(); var handleWidth = 6; if (delta > 0) { - handle.style.left = (box.left + box.width - handleWidth) + 'px'; + this.handleElement.style.left = (box.left + box.width - handleWidth) + 'px'; } else { - handle.style.left = box.left + 'px'; + this.handleElement.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) { + }, + setupGuidePosition: function() { + var box = this.currentTH.getBoundingClientRect(); + var priv = privatePool.get(this); + addClass(this.handleElement, 'active'); + addClass(this.guideElement, 'active'); + this.guideElement.style.width = box.width + 'px'; + this.guideElement.style.height = this.hot.view.maximumVisibleElementHeight(0) + 'px'; + this.guideElement.style.top = this.handleElement.style.top; + this.guideElement.style.left = priv.startOffset + 'px'; + this.hot.rootElement.appendChild(this.guideElement); + }, + refreshGuidePosition: function(diff) { + var priv = privatePool.get(this); + this.guideElement.style.left = priv.startOffset + diff + 'px'; + }, + hideHandleAndGuide: function() { + removeClass(this.handleElement, 'active'); + removeClass(this.guideElement, 'active'); + }, + checkColumnHeader: function(element) { + if (element != this.hot.rootElement) { var parent = element.parentNode; if (parent.tagName === 'THEAD') { return true; } - return checkColumnHeader.call(this, parent); + return this.checkColumnHeader(parent); } return false; - }; - var getTHFromTargetElement = function(element) { + }, + createPositionData: function(len) { + var positionArr = this.columnPositions; + if (positionArr.length < len) { + rangeEach(positionArr.length, len - 1, (function(i) { + positionArr[i] = i; + })); + } + }, + getTHFromTargetElement: function(element) { if (element.tagName != 'TABLE') { if (element.tagName == 'TH') { return element; } else { - return getTHFromTargetElement(element.parentNode); + return this.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; - } + }, + changeColumnPositions: function(columnIndex, destinationIndex) { + var maxLength = Math.max(columnIndex, destinationIndex); + if (maxLength > this.columnPositions.length - 1) { + this.createPositionData(maxLength + 1); } - }; - 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']; + this.columnPositions.splice(destinationIndex, 0, this.columnPositions.splice(columnIndex, 1)[0]); + }, + getVisibleColumnIndex: function(column) { + if (column > this.columnPositions.length - 1) { + this.createPositionData(column); + } + return this.columnPositions.indexOf(column); + }, + getLogicalColumnIndex: function(column) { + return this.columnPositions[column]; + }, + onMouseOver: function(event) { + var priv = privatePool.get(this); + if (this.checkColumnHeader(event.target)) { + var th = this.getTHFromTargetElement(event.target); + if (th) { + if (priv.pressed) { + var col = this.hot.view.wt.wtTable.getCoords(th).col; + if (col >= 0) { + priv.endCol = col; + this.refreshHandlePosition(th, priv.endCol - priv.startCol); + } } else { - instance.manualColumnPositionsPluginUsages.push('manualColumnMove'); - } - unbindEvents.call(this); - bindEvents.call(this); - if (this.manualColumnPositions && this.manualColumnPositions.length > 0) { - this.forceFullRender = true; - this.render(); + this.setupHandlePosition(th); } } - } 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]; + }, + onMouseDown: function(event) { + var priv = privatePool.get(this); + if (hasClass(event.target, priv.handleClassName)) { + priv.startX = pageX(event); + this.setupGuidePosition(); + priv.pressed = this.hot; + priv.startCol = priv.currentCol; + priv.endCol = priv.currentCol; } - return col; - }; - this.afterRemoveCol = function(index, amount) { - if (!this.getSettings().manualColumnMove) { + }, + onMouseMove: function(event) { + var priv = privatePool.get(this); + if (priv.pressed) { + this.refreshGuidePosition(pageX(event) - priv.startX); + } + }, + onMouseUp: function(event) { + var priv = privatePool.get(this); + if (priv.pressed) { + this.hideHandleAndGuide(); + priv.pressed = false; + this.createPositionData(this.hot.countCols()); + this.changeColumnPositions(priv.startCol, priv.endCol); + Handsontable.hooks.run(this.hot, 'beforeColumnMove', priv.startCol, priv.endCol); + this.hot.forceFullRender = true; + this.hot.view.render(); + this.saveManualColumnPositions(); + Handsontable.hooks.run(this.hot, 'afterColumnMove', priv.startCol, priv.endCol); + this.setupHandlePosition(this.currentTH); + } + }, + onModifyCol: function(col) { + if (typeof this.getVisibleColumnIndex(col) == -1) { + this.createPositionData(col + 1); + } + return this.getLogicalColumnIndex(col); + }, + onUnmodifyCol: function(col) { + if (typeof this.getVisibleColumnIndex(col) == -1) { + this.createPositionData(col + 1); + } + return this.getVisibleColumnIndex(col); + }, + onAfterRemoveCol: function(index, amount) { + if (!this.isEnabled()) { return; } - var rmindx, - colpos = this.manualColumnPositions; + var rmindx; + var colpos = this.columnPositions; rmindx = colpos.splice(index, amount); - colpos = colpos.map(function(colpos) { + colpos = arrayMap(colpos, function(value, index) { var i, - newpos = colpos; - for (i = 0; i < rmindx.length; i++) { - if (colpos > rmindx[i]) { + newpos = value; + arrayEach(rmindx, (function(elem, index) { + if (value > elem) { newpos--; } - } + })); return newpos; }); - this.manualColumnPositions = colpos; - }; - this.afterCreateCol = function(index, amount) { - if (!this.getSettings().manualColumnMove) { + this.columnPositions = colpos; + }, + onAfterCreateCol: function(index, amount) { + if (!this.isEnabled()) { return; } - var colpos = this.manualColumnPositions; + var colpos = this.columnPositions; if (!colpos.length) { return; } var addindx = []; - for (var i = 0; i < amount; i++) { + rangeEach(0, amount - 1, (function(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 = arrayMap(colpos, function(value, ind) { + return (value >= index) ? (value + amount) : value; }); 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); + this.columnPositions = colpos; + }, + onInit: function() { + this.completeSettingsArray(); + } +}, {}, BasePlugin); +; +registerPlugin('manualColumnMove', ManualColumnMove); Handsontable.hooks.register('beforeColumnMove'); Handsontable.hooks.register('afterColumnMove'); +Handsontable.hooks.register('unmodifyCol'); //# -},{"eventManager":41,"helpers/dom/element":45,"helpers/dom/event":46,"plugins":57}],78:[function(require,module,exports){ +},{"_base.js":59,"eventManager":41,"helpers/array":42,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/number":50,"plugins":58}],79:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { ManualColumnResize: {get: function() { @@ -15944,7 +16220,7 @@ var $ManualColumnResize = ManualColumnResize; registerPlugin('manualColumnResize', ManualColumnResize); //# -},{"_base.js":58,"eventManager":41,"helpers/dom/element":45,"helpers/dom/event":46,"plugins":57}],79:[function(require,module,exports){ +},{"_base.js":59,"eventManager":41,"helpers/dom/element":45,"helpers/dom/event":46,"plugins":58}],80:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { ManualRowMove: {get: function() { @@ -15952,221 +16228,321 @@ Object.defineProperties(exports, { }}, __esModule: {value: true} }); -var $___46__46__47__46__46__47_helpers_47_dom_47_element__, +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_helpers_47_array__, + $___46__46__47__46__46__47_helpers_47_number__, $___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 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 $__2 = ($___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 = $__2.arrayEach, + arrayMap = $__2.arrayMap; +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 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 $__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__}), + pageX = $__5.pageX, + pageY = $__5.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); +var privatePool = new WeakMap(); +var ManualRowMove = function ManualRowMove(hotInstance) { + $traceurRuntime.superConstructor($ManualRowMove).call(this, hotInstance); + privatePool.set(this, { + guideClassName: 'manualRowMoverGuide', + handleClassName: 'manualRowMover', + startOffset: null, + pressed: null, + startRow: null, + endRow: null, + currentRow: null, + startX: null, + startY: null + }); + this.guideElement = null; + this.handleElement = null; + this.currentTH = null; + this.rowPositions = []; + this.eventManager = eventManagerObject(this); +}; +var $ManualRowMove = ManualRowMove; +($traceurRuntime.createClass)(ManualRowMove, { + isEnabled: function() { + return !!this.hot.getSettings().manualRowMove; + }, + enablePlugin: function() { + var $__7 = this; + var priv = privatePool.get(this); + var initialSettings = this.hot.getSettings().manualRowMove; + var loadedManualRowPositions = this.loadManualRowPositions(); + this.handleElement = document.createElement('DIV'); + this.handleElement.className = priv.handleClassName; + this.guideElement = document.createElement('DIV'); + this.guideElement.className = priv.guideClassName; + this.addHook('modifyRow', (function(row) { + return $__7.onModifyRow(row); + })); + this.addHook('afterRemoveRow', (function(index, amount) { + return $__7.onAfterRemoveRow(index, amount); + })); + this.addHook('afterCreateRow', (function(index, amount) { + return $__7.onAfterCreateRow(index, amount); + })); + this.addHook('init', (function() { + return $__7.onInit(); + })); + this.registerEvents(); + if (typeof loadedManualRowPositions != 'undefined') { + this.rowPositions = loadedManualRowPositions; + } else if (Array.isArray(initialSettings)) { + this.rowPositions = initialSettings; + } else if (!initialSettings || this.rowPositions === void 0) { + this.rowPositions = []; + } + $traceurRuntime.superGet(this, $ManualRowMove.prototype, "enablePlugin").call(this); + }, + updatePlugin: function() { + this.disablePlugin(); + this.enablePlugin(); + $traceurRuntime.superGet(this, $ManualRowMove.prototype, "updatePlugin").call(this); + }, + disablePlugin: function() { + var pluginSetting = this.hot.getSettings().manualRowMove; + if (Array.isArray(pluginSetting)) { + this.unregisterEvents(); + this.rowPositions = []; + } + $traceurRuntime.superGet(this, $ManualRowMove.prototype, "disablePlugin").call(this); + }, + registerEvents: function() { + var $__7 = this; + this.eventManager.addEventListener(this.hot.rootElement, 'mouseover', (function(event) { + return $__7.onMouseOver(event); + })); + this.eventManager.addEventListener(this.hot.rootElement, 'mousedown', (function(event) { + return $__7.onMouseDown(event); + })); + this.eventManager.addEventListener(window, 'mousemove', (function(event) { + return $__7.onMouseMove(event); + })); + this.eventManager.addEventListener(window, 'mouseup', (function(event) { + return $__7.onMouseUp(event); + })); + }, + unregisterEvents: function() { + this.eventManager.clear(); + }, + saveManualRowPositions: function() { + Handsontable.hooks.run(this.hot, 'persistentStateSave', 'manualRowPositions', this.rowPositions); + }, + loadManualRowPositions: function() { + var storedState = {}; + Handsontable.hooks.run(this.hot, 'persistentStateLoad', 'manualRowPositions', storedState); return storedState.value; - }; - function setupHandlePosition(TH) { - var instance = this; - currentTH = TH; - var row = this.view.wt.wtTable.getCoords(TH).row; + }, + completeSettingsArray: function() { + var $__7 = this; + var rowCount = this.hot.countRows(); + if (this.rowPositions.length === rowCount) { + return; + } + rangeEach(0, rowCount - 1, (function(i) { + if ($__7.rowPositions.indexOf(i) === -1) { + $__7.rowPositions.push(i); + } + })); + }, + setupHandlePosition: function(TH) { + var priv = privatePool.get(this); + var row = this.hot.view.wt.wtTable.getCoords(TH).row; + this.currentTH = TH; 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); + var box = this.currentTH.getBoundingClientRect(); + priv.currentRow = row; + priv.startOffset = box.top; + this.handleElement.style.top = priv.startOffset + 'px'; + this.handleElement.style.left = box.left + 'px'; + this.hot.rootElement.appendChild(this.handleElement); } - } - function refreshHandlePosition(TH, delta) { + }, + refreshHandlePosition: function(TH, delta) { var box = TH.getBoundingClientRect(); var handleHeight = 6; if (delta > 0) { - handle.style.top = (box.top + box.height - handleHeight) + 'px'; + this.handleElement.style.top = (box.top + box.height - handleHeight) + 'px'; } else { - handle.style.top = box.top + 'px'; + this.handleElement.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) { + }, + setupGuidePosition: function() { + var box = this.currentTH.getBoundingClientRect(); + var priv = privatePool.get(this); + addClass(this.handleElement, 'active'); + addClass(this.guideElement, 'active'); + this.guideElement.style.height = box.height + 'px'; + this.guideElement.style.width = this.hot.view.maximumVisibleElementWidth(0) + 'px'; + this.guideElement.style.top = priv.startOffset + 'px'; + this.guideElement.style.left = this.handleElement.style.left; + this.hot.rootElement.appendChild(this.guideElement); + }, + refreshGuidePosition: function(diff) { + var priv = privatePool.get(this); + this.guideElement.style.top = priv.startOffset + diff + 'px'; + }, + hideHandleAndGuide: function() { + removeClass(this.handleElement, 'active'); + removeClass(this.guideElement, 'active'); + }, + checkRowHeader: function(element) { + if (element != this.hot.rootElement) { var parent = element.parentNode; - if (parent.tagName == 'TBODY') { + if (parent.tagName === 'TBODY') { return true; } - return checkRowHeader.call(this, parent); + return this.checkRowHeader(parent); } return false; - }; - var getTHFromTargetElement = function(element) { + }, + createPositionData: function(len) { + var positionArr = this.rowPositions; + if (positionArr.length < len) { + rangeEach(positionArr.length, len - 1, (function(i) { + positionArr[i] = i; + })); + } + }, + getTHFromTargetElement: function(element) { if (element.tagName != 'TABLE') { if (element.tagName == 'TH') { return element; } else { - return getTHFromTargetElement(element.parentNode); + return this.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); - } + }, + changeRowPositions: function(rowIndex, destinationIndex) { + var maxLength = Math.max(rowIndex, destinationIndex); + if (maxLength > this.rowPositions.length - 1) { + this.createPositionData(maxLength + 1); + } + this.rowPositions.splice(destinationIndex, 0, this.rowPositions.splice(rowIndex, 1)[0]); + }, + getVisibleRowIndex: function(row) { + if (row > this.rowPositions.length - 1) { + this.createPositionData(row); + } + return this.rowPositions.indexOf(row); + }, + getLogicalRowIndex: function(row) { + return this.rowPositions[row]; + }, + onMouseOver: function(event) { + var priv = privatePool.get(this); + if (this.checkRowHeader(event.target)) { + var th = this.getTHFromTargetElement(event.target); + if (th) { + if (priv.pressed) { + priv.endRow = this.hot.view.wt.wtTable.getCoords(th).row; + this.refreshHandlePosition(th, priv.endRow - priv.startRow); + } else { + this.setupHandlePosition(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(); + }, + onMouseDown: function(event) { + var priv = privatePool.get(this); + if (hasClass(event.target, priv.handleClassName)) { + priv.startY = pageY(event); + this.setupGuidePosition(); + priv.pressed = this.hot; + priv.startRow = priv.currentRow; + priv.endRow = priv.currentRow; + } + }, + onMouseMove: function(event) { + var priv = privatePool.get(this); + if (priv.pressed) { + this.refreshGuidePosition(pageY(event) - priv.startY); + } + }, + onMouseUp: function(event) { + var priv = privatePool.get(this); + if (priv.pressed) { + this.hideHandleAndGuide(); + priv.pressed = false; + this.createPositionData(this.hot.countRows()); + this.changeRowPositions(priv.startRow, priv.endRow); + Handsontable.hooks.run(this.hot, 'beforeRowMove', priv.startRow, priv.endRow); + this.hot.forceFullRender = true; + this.hot.view.render(); + this.saveManualRowPositions(); + Handsontable.hooks.run(this.hot, 'afterRowMove', priv.startRow, priv.endRow); + this.setupHandlePosition(this.currentTH); + } + }, + onModifyRow: function(row) { + if (typeof this.getVisibleRowIndex(row) === 'undefined') { + this.createPositionData(row + 1); + } + return this.getLogicalRowIndex(row); + }, + onAfterRemoveRow: function(index, amount) { + if (!this.isEnabled()) { + return; + } + var rmindx; + var rowpos = this.rowPositions; + rmindx = rowpos.splice(index, amount); + rowpos = arrayMap(rowpos, function(value, index) { + var newpos = value; + arrayEach(rmindx, (function(elem, index) { + if (value > elem) { + newpos--; } - } - } else { - var pluginUsagesIndex = instance.manualRowPositionsPluginUsages ? instance.manualRowPositionsPluginUsages.indexOf('manualColumnMove') : -1; - if (pluginUsagesIndex > -1) { - unbindEvents.call(this); - instance.manualRowPositions = []; - instance.manualRowPositionsPluginUsages[pluginUsagesIndex] = void 0; - } + })); + return newpos; + }); + this.rowPositions = rowpos; + }, + onAfterCreateRow: function(index, amount) { + if (!this.isEnabled()) { + return; } - }; - 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]; + var rowpos = this.rowPositions; + if (!rowpos.length) { + return; } - 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); + var addindx = []; + for (var i = 0; i < amount; i++) { + addindx.push(index + i); + } + if (index >= rowpos.length) { + rowpos.concat(addindx); + } else { + rowpos = arrayMap(rowpos, function(value, ind) { + return (value >= index) ? (value + amount) : value; + }); + rowpos.splice.apply(rowpos, [index, 0].concat(addindx)); + } + this.rowPositions = rowpos; + }, + onInit: function() { + this.completeSettingsArray(); + } +}, {}, BasePlugin); +; +registerPlugin('ManualRowMove', ManualRowMove); 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){ +},{"_base.js":59,"eventManager":41,"helpers/array":42,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/number":50,"plugins":58}],81:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { ManualRowResize: {get: function() { @@ -16407,7 +16783,7 @@ var $ManualRowResize = ManualRowResize; registerPlugin('manualRowResize', ManualRowResize); //# -},{"_base.js":58,"eventManager":41,"helpers/dom/element":45,"helpers/dom/event":46,"plugins":57}],81:[function(require,module,exports){ +},{"_base.js":59,"eventManager":41,"helpers/dom/element":45,"helpers/dom/event":46,"plugins":58}],82:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { MergeCells: {get: function() { @@ -16945,7 +17321,7 @@ 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){ +},{"3rdparty/walkontable/src/cell/coords":5,"3rdparty/walkontable/src/cell/range":6,"3rdparty/walkontable/src/table":20,"helpers/dom/event":46,"plugins":58}],83:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { MultipleSelectionHandles: {get: function() { @@ -17232,7 +17608,7 @@ var $MultipleSelectionHandles = MultipleSelectionHandles; registerPlugin('multipleSelectionHandles', MultipleSelectionHandles); //# -},{"_base":58,"eventManager":41,"helpers/dom/element":45,"plugins":57}],83:[function(require,module,exports){ +},{"_base":59,"eventManager":41,"helpers/dom/element":45,"plugins":58}],84:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { DataObserver: {get: function() { @@ -17287,7 +17663,7 @@ mixin(DataObserver, localHooks); ; //# -},{"../../helpers/object":50,"../../mixins/localHooks":54,"jsonpatch":"jsonpatch","utils":85}],84:[function(require,module,exports){ +},{"../../helpers/object":51,"../../mixins/localHooks":55,"jsonpatch":"jsonpatch","utils":86}],85:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { ObserveChanges: {get: function() { @@ -17431,7 +17807,7 @@ var $ObserveChanges = ObserveChanges; registerPlugin('observeChanges', ObserveChanges); //# -},{"_base":58,"dataObserver":83,"helpers/array":42,"jsonpatch":"jsonpatch","plugins":57}],85:[function(require,module,exports){ +},{"_base":59,"dataObserver":84,"helpers/array":42,"jsonpatch":"jsonpatch","plugins":58}],86:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { cleanPatches: {get: function() { @@ -17490,7 +17866,7 @@ function parsePath(path) { } //# -},{"../../helpers/array":42}],86:[function(require,module,exports){ +},{"../../helpers/array":42}],87:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { HandsontablePersistentState: {get: function() { @@ -17602,7 +17978,7 @@ Handsontable.hooks.add('beforeInit', htPersistentState.init); Handsontable.hooks.add('afterUpdateSettings', htPersistentState.init); //# -},{"plugins":57}],87:[function(require,module,exports){ +},{"plugins":58}],88:[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__; @@ -17710,7 +18086,7 @@ Handsontable.hooks.add('afterInit', init); Handsontable.hooks.add('afterUpdateSettings', init); //# -},{"helpers/dom/element":45,"renderers":90}],88:[function(require,module,exports){ +},{"helpers/dom/element":45,"renderers":91}],89:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { TouchScroll: {get: function() { @@ -17823,13 +18199,19 @@ var $TouchScroll = TouchScroll; registerPlugin('touchScroll', TouchScroll); //# -},{"_base":58,"helpers/dom/element":45,"plugins":57}],89:[function(require,module,exports){ +},{"_base":59,"helpers/dom/element":45,"plugins":58}],90:[function(require,module,exports){ "use strict"; -var $___46__46__47__46__46__47_helpers_47_object__, +var $___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_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 arrayMap = ($___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__}).arrayMap; +var $__1 = ($___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 = $__1.rangeEach, + rangeEachReverse = $__1.rangeEachReverse; +var $__2 = ($___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 = $__2.inherit, + deepClone = $__2.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; @@ -17865,24 +18247,33 @@ Handsontable.UndoRedo = function(instance) { plugin.done(action); }); instance.addHook('beforeRemoveCol', function(index, amount) { - var originalData = plugin.instance.getSourceData(); + var originalData = plugin.instance.getData(); index = (plugin.instance.countCols() + index) % plugin.instance.countCols(); var removedData = []; - for (var i = 0, - len = originalData.length; i < len; i++) { + var headers = []; + var indexes = []; + rangeEach(0, originalData.length - 1, (function(i) { removedData[i] = originalData[i].slice(index, index + amount); - } - var headers; + })); + rangeEach(0, amount - 1, (function(i) { + indexes.push(instance.runHooks('modifyCol', index + i)); + })); if (Array.isArray(instance.getSettings().colHeaders)) { - headers = instance.getSettings().colHeaders.slice(index, index + removedData.length); + rangeEach(0, amount - 1, (function(i) { + headers.push(instance.getSettings().colHeaders[instance.runHooks('modifyCol', index + i)] || null); + })); } - var action = new Handsontable.UndoRedo.RemoveColumnAction(index, removedData, headers); + var manualColumnMovePlugin = plugin.instance.getPlugin('manualColumnMove'); + var action = new Handsontable.UndoRedo.RemoveColumnAction(indexes, removedData, headers, manualColumnMovePlugin ? manualColumnMovePlugin.columnPositions : []); plugin.done(action); }); instance.addHook('beforeCellAlignment', function(stateBefore, range, type, alignment) { var action = new Handsontable.UndoRedo.CellAlignmentAction(stateBefore, range, type, alignment); plugin.done(action); }); + instance.addHook('beforeFilter', function(formulaStacks) { + plugin.done(new Handsontable.UndoRedo.FiltersAction(formulaStacks)); + }); }; Handsontable.UndoRedo.prototype.done = function(action) { if (!this.ignoreNewActions) { @@ -18034,34 +18425,63 @@ Handsontable.UndoRedo.CellAlignmentAction.prototype.redo = function(instance, un instance.addHookOnce('afterRender', undoneCallback); instance.render(); }; -Handsontable.UndoRedo.RemoveColumnAction = function(index, data, headers) { - this.index = index; +Handsontable.UndoRedo.RemoveColumnAction = function(indexes, data, headers, columnPositions) { + this.indexes = indexes; this.data = data; this.amount = this.data[0].length; this.headers = headers; + this.columnPositions = columnPositions.slice(0); }; 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++) { + var $__4 = this; + var row; + var ascendingIndexes = this.indexes.slice(0).sort(); + var sortByIndexes = (function(elem, j, arr) { + return arr[$__4.indexes.indexOf(ascendingIndexes[j])]; + }); + var sortedData = []; + rangeEach(0, this.data.length - 1, (function(i) { + sortedData[i] = arrayMap($__4.data[i], sortByIndexes); + })); + var sortedHeaders = []; + sortedHeaders = arrayMap(this.headers, sortByIndexes); + rangeEach(0, this.data.length - 1, (function(i) { row = instance.getSourceDataAtRow(i); - spliceArgs = [this.index, 0]; - Array.prototype.push.apply(spliceArgs, this.data[i]); - Array.prototype.splice.apply(row, spliceArgs); - } + rangeEach(0, ascendingIndexes.length - 1, (function(j) { + row.splice(ascendingIndexes[j], 0, sortedData[i][j]); + })); + })); if (typeof this.headers != 'undefined') { - spliceArgs = [this.index, 0]; - Array.prototype.push.apply(spliceArgs, this.headers); - Array.prototype.splice.apply(instance.getSettings().colHeaders, spliceArgs); + rangeEach(0, sortedHeaders.length - 1, (function(j) { + instance.getSettings().colHeaders.splice(ascendingIndexes[j], 0, sortedHeaders[j]); + })); + } + if (instance.getPlugin('manualColumnMove')) { + instance.getPlugin('manualColumnMove').columnPositions = this.columnPositions; } 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); + instance.alter('remove_col', instance.runHooks('unmodifyCol', this.indexes[0]), this.amount); +}; +Handsontable.UndoRedo.FiltersAction = function(formulaStacks) { + this.formulaStacks = formulaStacks; +}; +inherit(Handsontable.UndoRedo.FiltersAction, Handsontable.UndoRedo.Action); +Handsontable.UndoRedo.FiltersAction.prototype.undo = function(instance, undoneCallback) { + var filters = instance.getPlugin('filters'); + instance.addHookOnce('afterRender', undoneCallback); + filters.formulaCollection.importAllFormulas(this.formulaStacks.slice(0, this.formulaStacks.length - 1)); + filters.filter(); +}; +Handsontable.UndoRedo.FiltersAction.prototype.redo = function(instance, redoneCallback) { + var filters = instance.getPlugin('filters'); + instance.addHookOnce('afterRender', redoneCallback); + filters.formulaCollection.importAllFormulas(this.formulaStacks); + filters.filter(); }; function init() { var instance = this; @@ -18129,7 +18549,7 @@ Handsontable.hooks.add('afterInit', init); Handsontable.hooks.add('afterUpdateSettings', init); //# -},{"helpers/dom/event":46,"helpers/object":50}],90:[function(require,module,exports){ +},{"helpers/array":42,"helpers/dom/event":46,"helpers/number":50,"helpers/object":51}],91:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { registerRenderer: {get: function() { @@ -18174,7 +18594,7 @@ function hasRenderer(rendererName) { ; //# -},{"helpers/string":52}],91:[function(require,module,exports){ +},{"helpers/string":53}],92:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { cellDecorator: {get: function() { @@ -18216,7 +18636,7 @@ function cellDecorator(instance, TD, row, col, prop, value, cellProperties) { } //# -},{"helpers/dom/element":45,"renderers":90}],92:[function(require,module,exports){ +},{"helpers/dom/element":45,"renderers":91}],93:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { autocompleteRenderer: {get: function() { @@ -18273,7 +18693,7 @@ function autocompleteRenderer(instance, TD, row, col, prop, value, cellPropertie registerRenderer('autocomplete', autocompleteRenderer); //# -},{"3rdparty/walkontable/src/cell/coords":5,"eventManager":41,"helpers/dom/element":45,"renderers":90}],93:[function(require,module,exports){ +},{"3rdparty/walkontable/src/cell/coords":5,"eventManager":41,"helpers/dom/element":45,"renderers":91}],94:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { checkboxRenderer: {get: function() { @@ -18348,8 +18768,9 @@ function checkboxRenderer(instance, TD, row, col, prop, value, cellProperties) { if (cellProperties.readOnly) { eventManager.addEventListener(input, 'click', preventDefault); } else { - eventManager.addEventListener(input, 'mousedown', stopPropagation); - eventManager.addEventListener(input, 'mouseup', stopPropagation); + eventManager.addEventListener(input, 'mouseup', (function() { + return setTimeout(instance.listen, 10); + })); eventManager.addEventListener(input, 'change', (function(event) { instance.setDataAtRowProp(row, prop, event.target.checked ? cellProperties.checkedTemplate : cellProperties.uncheckedTemplate); })); @@ -18417,6 +18838,7 @@ function createInput() { input.className = 'htCheckboxRendererInput'; input.type = 'checkbox'; input.setAttribute('autocomplete', 'off'); + input.setAttribute('tabindex', '-1'); return input.cloneNode(false); } function createLabel(text) { @@ -18430,7 +18852,7 @@ function preventDefault(event) { } //# -},{"eventManager":41,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/string":52,"helpers/unicode":53,"renderers":90}],94:[function(require,module,exports){ +},{"eventManager":41,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/string":53,"helpers/unicode":54,"renderers":91}],95:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { htmlRenderer: {get: function() { @@ -18455,7 +18877,7 @@ function htmlRenderer(instance, TD, row, col, prop, value, cellProperties) { registerRenderer('html', htmlRenderer); //# -},{"helpers/dom/element":45,"renderers":90}],95:[function(require,module,exports){ +},{"helpers/dom/element":45,"renderers":91}],96:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { numericRenderer: {get: function() { @@ -18487,7 +18909,7 @@ function numericRenderer(instance, TD, row, col, prop, value, cellProperties) { registerRenderer('numeric', numericRenderer); //# -},{"helpers/dom/element":45,"helpers/number":49,"numeral":"numeral","renderers":90}],96:[function(require,module,exports){ +},{"helpers/dom/element":45,"helpers/number":50,"numeral":"numeral","renderers":91}],97:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { passwordRenderer: {get: function() { @@ -18514,7 +18936,7 @@ function passwordRenderer(instance, TD, row, col, prop, value, cellProperties) { registerRenderer('password', passwordRenderer); //# -},{"helpers/dom/element":45,"renderers":90}],97:[function(require,module,exports){ +},{"helpers/dom/element":45,"renderers":91}],98:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { textRenderer: {get: function() { @@ -18557,7 +18979,7 @@ function textRenderer(instance, TD, row, col, prop, value, cellProperties) { registerRenderer('text', textRenderer); //# -},{"helpers/dom/element":45,"helpers/mixed":48,"renderers":90}],98:[function(require,module,exports){ +},{"helpers/dom/element":45,"helpers/mixed":49,"renderers":91}],99:[function(require,module,exports){ "use strict"; (function(global) { 'use strict'; @@ -18825,7 +19247,20 @@ registerRenderer('text', textRenderer); 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.'); + valueToSpread[$toProperty(Symbol.iterator)] = function() { + var value = this; + var length = value.length; + var index = 0; + return {next: function() { + var result = {done: true}; + if (index < length) { + result.done = false; + result.value = value[index]; + ++index; + } + return result; + }}; + }; } var iter = valueToSpread[$toProperty(Symbol.iterator)](); while (!(iterResult = iter.next()).done) { @@ -18940,7 +19375,7 @@ registerRenderer('text', textRenderer); })(); //# -},{}],99:[function(require,module,exports){ +},{}],100:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { TableView: {get: function() { @@ -19127,7 +19562,9 @@ function TableView(instance) { preventOverflow: (function() { return $__6.settings.preventOverflow; }), - stretchH: this.settings.stretchH, + stretchH: function() { + return that.settings.stretchH; + }, data: instance.getDataAtCell, totalRows: (function() { return instance.countRows(); @@ -19463,7 +19900,7 @@ TableView.prototype.destroy = function() { ; //# -},{"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}],100:[function(require,module,exports){ +},{"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}],101:[function(require,module,exports){ "use strict"; Object.defineProperties(exports, { GhostTable: {get: function() { @@ -19688,7 +20125,83 @@ Handsontable.utils = Handsontable.utils || {}; Handsontable.utils.GhostTable = GhostTable; //# -},{"helpers/array":42,"helpers/dom/element":45,"helpers/mixed":48,"helpers/number":49,"helpers/object":50}],101:[function(require,module,exports){ +},{"helpers/array":42,"helpers/dom/element":45,"helpers/mixed":49,"helpers/number":50,"helpers/object":51}],102:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + Interval: {get: function() { + return Interval; + }}, + __esModule: {value: true} +}); +var $___46__46__47_helpers_47_feature__, + $___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_feature__ = require("helpers/feature"), $___46__46__47_helpers_47_feature__ && $___46__46__47_helpers_47_feature__.__esModule && $___46__46__47_helpers_47_feature__ || {default: $___46__46__47_helpers_47_feature__}), + requestAnimationFrame = $__0.requestAnimationFrame, + cancelAnimationFrame = $__0.cancelAnimationFrame; +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 Interval = function Interval(func, delay) { + var $__5 = this; + this.timer = null; + this.func = func; + this.delay = parseDelay(delay); + this.stopped = true; + this._then = null; + this._callback = (function() { + return $__5.__callback(); + }); +}; +var $Interval = Interval; +($traceurRuntime.createClass)(Interval, { + start: function() { + if (this.stopped) { + this._then = Date.now(); + this.stopped = false; + this.timer = requestAnimationFrame(this._callback); + } + return this; + }, + stop: function() { + if (!this.stopped) { + this.stopped = true; + cancelAnimationFrame(this.timer); + this.timer = null; + } + return this; + }, + __callback: function() { + this.timer = requestAnimationFrame(this._callback); + if (this.delay) { + var now = Date.now(); + var elapsed = now - this._then; + if (elapsed > this.delay) { + this._then = now - (elapsed % this.delay); + this.func(); + } + } else { + this.func(); + } + } +}, {create: function(func, delay) { + return new $Interval(func, delay); + }}); +; +function parseDelay(delay) { + if (typeof delay === 'string' && /fps$/.test(delay)) { + delay = 1000 / parseInt(delay.replace('fps', '') || 0, 10); + } + return delay; +} +Handsontable.utils = Handsontable.utils || {}; +Handsontable.utils.Interval = Interval; + +//# +},{"helpers/array":42,"helpers/feature":47,"helpers/mixed":49,"helpers/number":50,"helpers/object":51}],103:[function(require,module,exports){ "use strict"; var $__7; Object.defineProperties(exports, { @@ -19824,7 +20337,7 @@ Handsontable.utils = Handsontable.utils || {}; Handsontable.utils.SamplesGenerator = SamplesGenerator; //# -},{"helpers/array":42,"helpers/dom/element":45,"helpers/mixed":48,"helpers/number":49,"helpers/object":50}],102:[function(require,module,exports){ +},{"helpers/array":42,"helpers/dom/element":45,"helpers/mixed":49,"helpers/number":50,"helpers/object":51}],104:[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; @@ -19859,7 +20372,7 @@ function process(value, callback) { } //# -},{"helpers/mixed":48}],103:[function(require,module,exports){ +},{"helpers/mixed":49}],105:[function(require,module,exports){ "use strict"; var $__moment__, $___46__46__47_editors__; @@ -19909,7 +20422,7 @@ var correctFormat = function correctFormat(value, dateFormat) { }; //# -},{"editors":29,"moment":undefined}],104:[function(require,module,exports){ +},{"editors":29,"moment":undefined}],106:[function(require,module,exports){ "use strict"; Handsontable.NumericValidator = function(value, callback) { if (value == null) { @@ -19925,7 +20438,54 @@ Handsontable.NumericValidator = function(value, callback) { }; //# -},{}],"SheetClip":[function(require,module,exports){ +},{}],107:[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; +var STRICT_FORMATS = ['YYYY-MM-DDTHH:mm:ss.SSSZ']; +Handsontable.TimeValidator = function(value, callback) { + var valid = true; + var timeFormat = this.timeFormat || 'h:mm:ss a'; + if (value === null) { + value = ''; + } + if (typeof value === 'number') { + value = ("" + value); + } + if (/^\d{9,10}$/.test(value)) { + value = new Date(parseInt((value + "000"), 10)); + } else if (/^\d{13}$/.test(value)) { + value = new Date(parseInt(value, 10)); + } + var date = moment(value, STRICT_FORMATS, true).isValid() ? moment(new Date(value)) : moment(value, timeFormat); + var isValidTime = date.isValid(); + var isValidFormat = moment(value, timeFormat, true).isValid(); + if (this.allowEmpty && value === '') { + isValidTime = true; + isValidFormat = true; + } + if (!isValidTime) { + valid = false; + } + if (!isValidTime && isValidFormat) { + valid = true; + } + if (isValidTime && !isValidFormat) { + if (this.correctFormat === true) { + var correctedValue = date.format(timeFormat); + this.instance.setDataAtCell(this.row, this.col, correctedValue, 'timeValidator'); + valid = true; + } else { + valid = false; + } + } + callback(valid); +}; + +//# +},{"editors":29,"moment":undefined}],"SheetClip":[function(require,module,exports){ "use strict"; (function(global) { "use strict"; @@ -21516,5 +22076,5 @@ if (typeof exports !== "undefined") { }).call(window); //# -},{}]},{},[23,59,61,60,62,83,84,85,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,86,87,88,89,102,103,104,92,93,94,95,96,97,31,35,32,33,40,34,36,37,38,39])("numeral") +},{}]},{},[23,60,62,61,63,84,85,86,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,87,88,89,90,104,105,106,107,93,94,95,96,97,98,31,35,32,33,40,34,36,37,38,39])("numeral") }); \ No newline at end of file diff --git a/bower_components/handsontable/dist/handsontable.min.js b/bower_components/handsontable/dist/handsontable.min.js index 20aa13a..e0de5ce 100644 --- a/bower_components/handsontable/dist/handsontable.min.js +++ b/bower_components/handsontable/dist/handsontable.min.js @@ -24,16 +24,17 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.Handsontable=e()}}(function(){var e;return function(e,t,n){return function o(e,t,n){function r(l,a){if(!t[l]){if(!e[l]){var u="function"==typeof require&&require;if(!a&&u)return u(l,!0);if(i)return i(l,!0);if(s[l]&&"undefined"!=typeof window[s[l]])return window[s[l]];var c=new Error("Cannot find module '"+l+"'");throw c.code="MODULE_NOT_FOUND",c}var d=t[l]={exports:{}};e[l][0].call(d.exports,function(t){var n=e[l][1][t];return r(n?n:t)},d,d.exports,o,e,t,n)}return t[l].exports}for(var i="function"==typeof require&&require,s=JSON.parse('{"zeroclipboard":"ZeroClipboard","moment":"moment","pikaday":"Pikaday"}')||{},l=0;l1)for(t=1,o=arguments.length;o>t;t++)r.push(arguments[t]);if(a){if("undefined"==typeof a[e])throw new Error("Handsontable do not provide action: "+e);i=a[e].apply(a,r),"destroy"===e&&l.removeData()}return i}}(window,jQuery,Handsontable)},{}],2:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableBorder:{get:function(){return b}},__esModule:{value:!0}});var o,r,i,s,l,a=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),u=a.getComputedStyle,c=a.getTrimmingContainer,d=a.innerWidth,h=a.innerHeight,f=a.offset,g=a.outerHeight,p=a.outerWidth,m=(r=e("helpers/dom/event"),r&&r.__esModule&&r||{"default":r}).stopImmediatePropagation,w=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).EventManager,v=(s=e("cell/coords"),s&&s.__esModule&&s||{"default":s}).WalkontableCellCoords,b=((l=e("overlay/_base.js"),l&&l.__esModule&&l||{"default":l}).WalkontableOverlay,function(e,t){t&&(this.eventManager=new w(e),this.instance=e,this.wot=e,this.settings=t,this.mouseDown=!1,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(t),this.registerListeners())});$traceurRuntime.createClass(b,{registerListeners:function(){var e=this;this.eventManager.addEventListener(document.body,"mousedown",function(){return e.onMouseDown()}),this.eventManager.addEventListener(document.body,"mouseup",function(){return e.onMouseUp()});for(var t=this,n=function(n,o){t.eventManager.addEventListener(t.main.childNodes[n],"mouseenter",function(t){return e.onMouseEnter(t,e.main.childNodes[n])})},o=0,r=this.main.childNodes.length;r>o;o++)n(o,r)},onMouseDown:function(){this.mouseDown=!0},onMouseUp:function(){this.mouseDown=!1},onMouseEnter:function(e,t){function n(e){return e.clientYMath.ceil(i.top+i.height)?!0:e.clientXMath.ceil(i.left+i.width)?!0:void 0}function o(e){n(e)&&(r.eventManager.removeEventListener(document.body,"mousemove",o),t.style.display="block")}if(this.mouseDown&&this.wot.getSetting("hideBorderOnMouseDownOver")){e.preventDefault(),m(e);var r=this,i=t.getBoundingClientRect();t.style.display="none",this.eventManager.addEventListener(document.body,"mousemove",o)}},createBorders:function(e){this.main=document.createElement("div");var t=["top","left","bottom","right","corner"],n=this.main.style;n.position="absolute",n.top=0,n.left=0;for(var o=0;5>o;o++){var r=t[o],i=document.createElement("div");i.className="wtBorder "+(this.settings.className||""),this.settings[r]&&this.settings[r].hide&&(i.className+=" hidden"),n=i.style,n.backgroundColor=this.settings[r]&&this.settings[r].color?this.settings[r].color:e.border.color,n.height=this.settings[r]&&this.settings[r].width?this.settings[r].width+"px":e.border.width+"px",n.width=this.settings[r]&&this.settings[r].width?this.settings[r].width+"px":e.border.width+"px",this.main.appendChild(i)}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(" "),Handsontable.mobileBrowser&&this.createMultipleSelectorHandles(),this.disappear(),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 e=10,t=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 n={position:"absolute",height:t+"px",width:t+"px","border-radius":parseInt(t/1.5,10)+"px"};for(var o in n)n.hasOwnProperty(o)&&(this.selectionHandles.styles.bottomRightHitArea[o]=n[o],this.selectionHandles.styles.topLeftHitArea[o]=n[o]);var r={position:"absolute",height:e+"px",width:e+"px","border-radius":parseInt(e/1.5,10)+"px",background:"#F5F5FF",border:"1px solid #4285c8"};for(var i in r)r.hasOwnProperty(i)&&(this.selectionHandles.styles.bottomRight[i]=r[i],this.selectionHandles.styles.topLeft[i]=r[i]);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(e,t){return!this.wot.selections.area.cellRange||e==this.wot.selections.area.cellRange.to.row&&t==this.wot.selections.area.cellRange.to.col?!1:!0},updateMultipleSelectionHandlesPosition:function(e,t,n,o,r,i){var s=parseInt(this.selectionHandles.styles.topLeft.width,10),l=parseInt(this.selectionHandles.styles.topLeftHitArea.width,10);this.selectionHandles.styles.topLeft.top=parseInt(n-s,10)+"px",this.selectionHandles.styles.topLeft.left=parseInt(o-s,10)+"px",this.selectionHandles.styles.topLeftHitArea.top=parseInt(n-l/4*3,10)+"px",this.selectionHandles.styles.topLeftHitArea.left=parseInt(o-l/4*3,10)+"px",this.selectionHandles.styles.bottomRight.top=parseInt(n+i,10)+"px",this.selectionHandles.styles.bottomRight.left=parseInt(o+r,10)+"px",this.selectionHandles.styles.bottomRightHitArea.top=parseInt(n+i-l/4,10)+"px",this.selectionHandles.styles.bottomRightHitArea.left=parseInt(o+r-l/4,10)+"px",this.settings.border.multipleSelectionHandlesVisible&&this.settings.border.multipleSelectionHandlesVisible()?(this.selectionHandles.styles.topLeft.display="block",this.selectionHandles.styles.topLeftHitArea.display="block",this.isPartRange(e,t)?(this.selectionHandles.styles.bottomRight.display="none",this.selectionHandles.styles.bottomRightHitArea.display="none"):(this.selectionHandles.styles.bottomRight.display="block",this.selectionHandles.styles.bottomRightHitArea.display="block")):(this.selectionHandles.styles.topLeft.display="none",this.selectionHandles.styles.bottomRight.display="none",this.selectionHandles.styles.topLeftHitArea.display="none",this.selectionHandles.styles.bottomRightHitArea.display="none"),e==this.wot.wtSettings.getSetting("fixedRowsTop")||t==this.wot.wtSettings.getSetting("fixedColumnsLeft")?(this.selectionHandles.styles.topLeft.zIndex="9999",this.selectionHandles.styles.topLeftHitArea.zIndex="9999"):(this.selectionHandles.styles.topLeft.zIndex="",this.selectionHandles.styles.topLeftHitArea.zIndex="")},appear:function(e){if(!this.disabled){var t,n,o,r,i,s,l,a,m,w,b,C,y,R,S,E,T,O,_;_=this.wot.wtTable.getRenderedRowsCount();for(var M=0;_>M;M++){var H=this.wot.wtTable.rowFilter.renderedToSource(M);if(H>=e[0]&&H<=e[2]){y=H;break}}for(var k=_-1;k>=0;k--){var A=this.wot.wtTable.rowFilter.renderedToSource(k);if(A>=e[0]&&A<=e[2]){S=A;break}}_=this.wot.wtTable.getRenderedColumnsCount();for(var P=0;_>P;P++){var x=this.wot.wtTable.columnFilter.renderedToSource(P);if(x>=e[1]&&x<=e[3]){R=x;break}}for(var D=_-1;D>=0;D--){var N=this.wot.wtTable.columnFilter.renderedToSource(D);if(N>=e[1]&&N<=e[3]){E=N;break}}if(void 0===y||void 0===R)return void this.disappear();t=y!==S||R!==E,n=this.wot.wtTable.getCell(new v(y,R)),o=t?this.wot.wtTable.getCell(new v(S,E)):n,r=f(n),i=t?f(o):r,s=f(this.wot.wtTable.TABLE),a=r.top,b=i.top+g(o)-a,w=r.left,C=i.left+p(o)-w,l=a-s.top-1,m=w-s.left-1;var L=u(n);parseInt(L.borderTopWidth,10)>0&&(l+=1,b=b>0?b-1:0),parseInt(L.borderLeftWidth,10)>0&&(m+=1,C=C>0?C-1:0),this.topStyle.top=l+"px",this.topStyle.left=m+"px",this.topStyle.width=C+"px",this.topStyle.display="block",this.leftStyle.top=l+"px",this.leftStyle.left=m+"px",this.leftStyle.height=b+"px",this.leftStyle.display="block";var W=Math.floor(this.settings.border.width/2);this.bottomStyle.top=l+b-W+"px",this.bottomStyle.left=m+"px",this.bottomStyle.width=C+"px",this.bottomStyle.display="block",this.rightStyle.top=l+"px",this.rightStyle.left=m+C-W+"px",this.rightStyle.height=b+1+"px",this.rightStyle.display="block",Handsontable.mobileBrowser||!this.hasSetting(this.settings.border.cornerVisible)||this.isPartRange(S,E)?this.cornerStyle.display="none":(this.cornerStyle.top=l+b-4+"px",this.cornerStyle.left=m+C-4+"px",this.cornerStyle.borderRightWidth=this.cornerDefaultStyle.borderWidth,this.cornerStyle.width=this.cornerDefaultStyle.width,this.cornerStyle.display="block",T=c(this.wot.wtTable.TABLE),E===this.wot.getSetting("totalColumns")-1&&(O=o.offsetLeft+p(o)>=d(T),O&&(this.cornerStyle.left=Math.floor(m+C-3-parseInt(this.cornerDefaultStyle.width)/2)+"px",this.cornerStyle.borderRightWidth=0)),S===this.wot.getSetting("totalRows")-1&&(O=o.offsetTop+g(o)>=h(T),O&&(this.cornerStyle.top=Math.floor(l+b-3-parseInt(this.cornerDefaultStyle.height)/2)+"px",this.cornerStyle.borderBottomWidth=0))),Handsontable.mobileBrowser&&this.updateMultipleSelectionHandlesPosition(y,R,l,m,C,b)}},disappear:function(){this.topStyle.display="none",this.leftStyle.display="none",this.bottomStyle.display="none",this.rightStyle.display="none",this.cornerStyle.display="none",Handsontable.mobileBrowser&&(this.selectionHandles.styles.topLeft.display="none",this.selectionHandles.styles.bottomRight.display="none")},hasSetting:function(e){return"function"==typeof e?e():!!e}},{}),window.WalkontableBorder=b},{"cell/coords":5,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,"overlay/_base.js":11}],3:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableViewportColumnsCalculator:{get:function(){return r}},__esModule:{value:!0}});var o=new WeakMap,r=function(e,t,n,r,i,s,l){var a=void 0!==arguments[7]?arguments[7]:function(e){return e};o.set(this,{viewportWidth:e,scrollOffset:t,totalColumns:n,columnWidthFn:r,overrideFn:i,onlyFullyVisible:s,stretchingColumnWidthFn:a}),this.count=0,this.startColumn=null,this.endColumn=null,this.startPosition=null,this.stretchAllRatio=0,this.stretchLastWidth=0,this.stretch=l,this.totalTargetWidth=0,this.needVerifyLastColumnWidth=!0,this.stretchAllColumnsWidth=[],this.calculate()},i=r;$traceurRuntime.createClass(r,{calculate:function(){for(var e,t=0,n=!0,r=[],i=o.get(this),s=i.onlyFullyVisible,l=i.overrideFn,a=i.scrollOffset,u=i.totalColumns,c=i.viewportWidth,d=0;u>d;d++)if(e=this._getColumnWidth(d),a>=t&&!s&&(this.startColumn=d),t>=a&&a+c>=t+e&&(null==this.startColumn&&(this.startColumn=d),this.endColumn=d),r.push(t),t+=e,s||(this.endColumn=d),t>=a+c){n=!1;break}if(this.endColumn===u-1&&n)for(this.startColumn=this.endColumn;this.startColumn>0;){var h=r[this.endColumn]+e-r[this.startColumn-1];if((c>=h||!s)&&this.startColumn--,h>c)break}null!==this.startColumn&&l&&l(this),this.startPosition=r[this.startColumn],void 0==this.startPosition&&(this.startPosition=null),null!==this.startColumn&&(this.count=this.endColumn-this.startColumn+1)},refreshStretching:function(e){if("none"!==this.stretch){this.totalTargetWidth=e;for(var t=o.get(this),n=t.totalColumns,r=0,i=0;n>i;i++){var s=this._getColumnWidth(i),l=t.stretchingColumnWidthFn(void 0,i);"number"==typeof l?e-=l:r+=s}var a=e-r;if("all"===this.stretch&&a>0)this.stretchAllRatio=e/r,this.stretchAllColumnsWidth=[],this.needVerifyLastColumnWidth=!0;else if("last"===this.stretch&&e!==1/0){var u=this._getColumnWidth(n-1),c=a+u;this.stretchLastWidth=c>=0?c:u}}},getStretchedColumnWidth:function(e,t){var n=null;return"all"===this.stretch&&0!==this.stretchAllRatio?n=this._getStretchedAllColumnWidth(e,t):"last"===this.stretch&&0!==this.stretchLastWidth&&(n=this._getStretchedLastColumnWidth(e)),n},_getStretchedAllColumnWidth:function(e,t){var n=0,r=o.get(this),i=r.totalColumns;if(!this.stretchAllColumnsWidth[e]){var s=Math.round(t*this.stretchAllRatio),l=r.stretchingColumnWidthFn(s,e);void 0===l?this.stretchAllColumnsWidth[e]=s:this.stretchAllColumnsWidth[e]=isNaN(l)?this._getColumnWidth(e):l}if(this.stretchAllColumnsWidth.length===i&&this.needVerifyLastColumnWidth){this.needVerifyLastColumnWidth=!1;for(var a=0;af;f++){var g=a(f);if(void 0===g&&(g=i.DEFAULT_HEIGHT),u>=e&&!s&&(this.startRow=f),e>=u&&u+d-h>=e+g&&(null===this.startRow&&(this.startRow=f),this.endRow=f),n.push(e),e+=g,s||(this.endRow=f),e>=u+d-h){t=!1;break}}if(this.endRow===c-1&&t)for(this.startRow=this.endRow;this.startRow>0;){var p=n[this.endRow]+g-n[this.startRow-1];if((d-h>=p||!s)&&this.startRow--,p>=d-h)break}null!==this.startRow&&l&&l(this),this.startPosition=n[this.startRow],void 0==this.startPosition&&(this.startPosition=null),null!==this.startRow&&(this.count=this.endRow-this.startRow+1)}},{get DEFAULT_HEIGHT(){return 23}}),window.WalkontableViewportRowsCalculator=r},{}],5:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableCellCoords:{get:function(){return o}},__esModule:{value:!0}});var o=function(e,t){"undefined"!=typeof e&&"undefined"!=typeof t?(this.row=e,this.col=t):(this.row=null,this.col=null)};$traceurRuntime.createClass(o,{isValid:function(e){return this.row<0||this.col<0?!1:this.row>=e.getSetting("totalRows")||this.col>=e.getSetting("totalColumns")?!1:!0},isEqual:function(e){return e===this?!0:this.row===e.row&&this.col===e.col},isSouthEastOf:function(e){return this.row>=e.row&&this.col>=e.col},isNorthWestOf:function(e){return this.row<=e.row&&this.col<=e.col},isSouthWestOf:function(e){return this.row>=e.row&&this.col<=e.col},isNorthEastOf:function(e){return this.row<=e.row&&this.col>=e.col}},{}),window.WalkontableCellCoords=o},{}],6:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableCellRange:{get:function(){return i}},__esModule:{value:!0}});var o,r=(o=e("cell/coords"),o&&o.__esModule&&o||{"default":o}).WalkontableCellCoords,i=function(e,t,n){this.highlight=e,this.from=t,this.to=n},s=i;$traceurRuntime.createClass(i,{isValid:function(e){return this.from.isValid(e)&&this.to.isValid(e)},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(e){var t=this.getTopLeftCorner(),n=this.getBottomRightCorner();return e.row<0&&(e.row=0),e.col<0&&(e.col=0),t.row<=e.row&&n.row>=e.row&&t.col<=e.col&&n.col>=e.col},includesRange:function(e){return this.includes(e.getTopLeftCorner())&&this.includes(e.getBottomRightCorner())},isEqual:function(e){return Math.min(this.from.row,this.to.row)==Math.min(e.from.row,e.to.row)&&Math.max(this.from.row,this.to.row)==Math.max(e.from.row,e.to.row)&&Math.min(this.from.col,this.to.col)==Math.min(e.from.col,e.to.col)&&Math.max(this.from.col,this.to.col)==Math.max(e.from.col,e.to.col)},overlaps:function(e){return e.isSouthEastOf(this.getTopLeftCorner())&&e.isNorthWestOf(this.getBottomRightCorner())},isSouthEastOf:function(e){return this.getTopLeftCorner().isSouthEastOf(e)||this.getBottomRightCorner().isSouthEastOf(e)},isNorthWestOf:function(e){return this.getTopLeftCorner().isNorthWestOf(e)||this.getBottomRightCorner().isNorthWestOf(e)},expand:function(e){var t=this.getTopLeftCorner(),n=this.getBottomRightCorner();return e.rown.row||e.col>n.col?(this.from=new r(Math.min(t.row,e.row),Math.min(t.col,e.col)),this.to=new r(Math.max(n.row,e.row),Math.max(n.col,e.col)),!0):!1},expandByRange:function(e){if(this.includesRange(e)||!this.overlaps(e))return!1;var t=this.getTopLeftCorner(),n=this.getBottomRightCorner(),o=(this.getTopRightCorner(),this.getBottomLeftCorner(),e.getTopLeftCorner()),i=e.getBottomRightCorner(),l=Math.min(t.row,o.row),a=Math.min(t.col,o.col),u=Math.max(n.row,i.row),c=Math.max(n.col,i.col),d=new r(l,a),h=new r(u,c),f=new s(d,d,h).isCorner(this.from,e),g=e.isEqual(new s(d,d,h));return f&&!g&&(this.from.col>d.col&&(d.col=c,h.col=a),this.from.row>d.row&&(d.row=u,h.row=l)),this.from=d,this.to=h,!0},getDirection:function(){return this.from.isNorthWestOf(this.to)?"NW-SE":this.from.isNorthEastOf(this.to)?"NE-SW":this.from.isSouthEastOf(this.to)?"SE-NW":this.from.isSouthWestOf(this.to)?"SW-NE":void 0},setDirection:function(e){switch(e){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()}},getTopLeftCorner:function(){return new r(Math.min(this.from.row,this.to.row),Math.min(this.from.col,this.to.col))},getBottomRightCorner:function(){return new r(Math.max(this.from.row,this.to.row),Math.max(this.from.col,this.to.col))},getTopRightCorner:function(){return new r(Math.min(this.from.row,this.to.row),Math.max(this.from.col,this.to.col))},getBottomLeftCorner:function(){return new r(Math.max(this.from.row,this.to.row),Math.min(this.from.col,this.to.col))},isCorner:function(e,t){return t&&t.includes(e)&&(this.getTopLeftCorner().isEqual(new r(t.from.row,t.from.col))||this.getTopRightCorner().isEqual(new r(t.from.row,t.to.col))||this.getBottomLeftCorner().isEqual(new r(t.to.row,t.from.col))||this.getBottomRightCorner().isEqual(new r(t.to.row,t.to.col)))?!0:e.isEqual(this.getTopLeftCorner())||e.isEqual(this.getTopRightCorner())||e.isEqual(this.getBottomLeftCorner())||e.isEqual(this.getBottomRightCorner())},getOppositeCorner:function(e,t){if(!(e instanceof r))return!1;if(t&&t.includes(e)){if(this.getTopLeftCorner().isEqual(new r(t.from.row,t.from.col)))return this.getBottomRightCorner();if(this.getTopRightCorner().isEqual(new r(t.from.row,t.to.col)))return this.getBottomLeftCorner();if(this.getBottomLeftCorner().isEqual(new r(t.to.row,t.from.col)))return this.getTopRightCorner();if(this.getBottomRightCorner().isEqual(new r(t.to.row,t.to.col)))return this.getTopLeftCorner()}return e.isEqual(this.getBottomRightCorner())?this.getTopLeftCorner():e.isEqual(this.getTopLeftCorner())?this.getBottomRightCorner():e.isEqual(this.getTopRightCorner())?this.getBottomLeftCorner():e.isEqual(this.getBottomLeftCorner())?this.getTopRightCorner():void 0},getBordersSharedWith:function(e){if(!this.includesRange(e))return[];var t={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)},n={top:Math.min(e.from.row,e.to.row),bottom:Math.max(e.from.row,e.to.row),left:Math.min(e.from.col,e.to.col),right:Math.max(e.from.col,e.to.col)},o=[];return t.top==n.top&&o.push("top"),t.right==n.right&&o.push("right"),t.bottom==n.bottom&&o.push("bottom"),t.left==n.left&&o.push("left"),o},getInner:function(){for(var e=this.getTopLeftCorner(),t=this.getBottomRightCorner(),n=[],o=e.row;o<=t.row;o++)for(var i=e.col;i<=t.col;i++)this.from.row===o&&this.from.col===i||this.to.row===o&&this.to.col===i||n.push(new r(o,i));return n},getAll:function(){for(var e=this.getTopLeftCorner(),t=this.getBottomRightCorner(),n=[],o=e.row;o<=t.row;o++)for(var i=e.col;i<=t.col;i++)e.row===o&&e.col===i?n.push(e):t.row===o&&t.col===i?n.push(t):n.push(new r(o,i));return n},forAll:function(e){for(var t=this.getTopLeftCorner(),n=this.getBottomRightCorner(),o=t.row;o<=n.row;o++)for(var r=t.col;r<=n.col;r++){var i=e(o,r);if(i===!1)return}}},{}),window.WalkontableCellRange=i},{"cell/coords":5}],7:[function(e,t,n){"use strict";Object.defineProperties(n,{Walkontable:{get:function(){return P}},__esModule:{value:!0}});var o,r,i,s,l,a,u,c,d,h,f,g,p,m,w=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),v=w.addClass,b=w.fastInnerText,C=w.isVisible,y=w.removeClass,R=(r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}).objectEach,S=(i=e("helpers/string"),i&&i.__esModule&&i||{"default":i}),E=S.toUpperCaseFirst,T=S.randomString,O=(s=e("event"),s&&s.__esModule&&s||{"default":s}).WalkontableEvent,_=(l=e("overlays"),l&&l.__esModule&&l||{"default":l}).WalkontableOverlays,M=(a=e("scroll"),a&&a.__esModule&&a||{"default":a}).WalkontableScroll,H=(u=e("settings"),u&&u.__esModule&&u||{"default":u}).WalkontableSettings,k=(c=e("table"),c&&c.__esModule&&c||{"default":c}).WalkontableTable,A=(d=e("viewport"),d&&d.__esModule&&d||{"default":d}).WalkontableViewport,P=((h=e("overlay/_base.js"),h&&h.__esModule&&h||{"default":h}).WalkontableOverlay,(f=e("overlay/top.js"),f&&f.__esModule&&f||{"default":f}).WalkontableTopOverlay,(g=e("overlay/left.js"),g&&g.__esModule&&g||{"default":g}).WalkontableLeftOverlay,(p=e("overlay/debug.js"),p&&p.__esModule&&p||{"default":p}).WalkontableDebugOverlay,(m=e("overlay/topLeftCorner.js"),m&&m.__esModule&&m||{"default":m}).WalkontableTopLeftCornerOverlay,function(e){var t=[];if(this.guid="wt_"+T(),e.cloneSource?(this.cloneSource=e.cloneSource,this.cloneOverlay=e.cloneOverlay,this.wtSettings=e.cloneSource.wtSettings,this.wtTable=new k(this,e.table,e.wtRootElement),this.wtScroll=new M(this),this.wtViewport=e.cloneSource.wtViewport,this.wtEvent=new O(this),this.selections=this.cloneSource.selections):(this.wtSettings=new H(this,e),this.wtTable=new k(this,e.table),this.wtScroll=new M(this),this.wtViewport=new A(this),this.wtEvent=new O(this),this.selections=this.getSetting("selections"),this.wtOverlays=new _(this),this.exportSettingsAsClassNames()),this.wtTable.THEAD.childNodes.length&&this.wtTable.THEAD.childNodes[0].childNodes.length){for(var n=0,o=this.wtTable.THEAD.childNodes[0].childNodes.length;o>n;n++)t.push(this.wtTable.THEAD.childNodes[0].childNodes[n].innerHTML);this.getSetting("columnHeaders").length||this.update("columnHeaders",[function(e,n){b(n,t[e])}])}this.drawn=!1,this.drawInterrupted=!1});$traceurRuntime.createClass(P,{draw:function(){var e=void 0!==arguments[0]?arguments[0]:!1;return this.drawInterrupted=!1,e||C(this.wtTable.TABLE)?this.wtTable.draw(e):this.drawInterrupted=!0,this},getCell:function(e){var t=void 0!==arguments[1]?arguments[1]:!1;if(!t)return this.wtTable.getCell(e);var n=this.wtSettings.getSetting("totalRows"),o=this.wtSettings.getSetting("fixedRowsTop"),r=this.wtSettings.getSetting("fixedRowsBottom"),i=this.wtSettings.getSetting("fixedColumnsLeft");if(e.row=n-r){if(this.wtOverlays.bottomLeftCornerOverlay.clone)return this.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.getCell(e)}else{if(e.coln-r&&this.wtOverlays.bottomOverlay.clone)return this.wtOverlays.bottomOverlay.clone.wtTable.getCell(e)}return this.wtTable.getCell(e)},update:function(e,t){return this.wtSettings.update(e,t)},scrollVertical:function(e){return this.wtOverlays.topOverlay.scrollTo(e),this.getSetting("onScrollVertically"),this},scrollHorizontal:function(e){return this.wtOverlays.leftOverlay.scrollTo(e),this.getSetting("onScrollHorizontally"),this},scrollViewport:function(e){return this.wtScroll.scrollViewport(e),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(e){return this.cloneOverlay?this.cloneOverlay.type===e:!1},exportSettingsAsClassNames:function(){var e=this,t={rowHeaders:["array"],columnHeaders:["array"]},n=[],o=[];R(t,function(t,r){t.indexOf("array")>-1&&e.getSetting(r).length&&o.push("ht"+E(r)),n.push("ht"+E(r))}),y(this.wtTable.wtRootElement.parentNode,n),v(this.wtTable.wtRootElement.parentNode,o)},getSetting:function(e,t,n,o,r){return this.wtSettings.getSetting(e,t,n,o,r)},hasSetting:function(e){return this.wtSettings.has(e)},destroy:function(){this.wtOverlays.destroy(),this.wtEvent.destroy()}},{}),window.Walkontable=P},{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(e,t,n){"use strict";function o(e){var t=this,n=c(e);this.instance=e;var o=[null,null];this.dblClickTimeout=[null,null];var r,i=function(e){var n=t.parentCell(e.realTarget);a(e.realTarget,"corner")?t.instance.getSetting("onCellCornerMouseDown",e,e.realTarget):n.TD&&t.instance.hasSetting("onCellMouseDown")&&t.instance.getSetting("onCellMouseDown",e,n.coords,n.TD,t.instance),2!==e.button&&n.TD&&(o[0]=n.TD,clearTimeout(t.dblClickTimeout[0]),t.dblClickTimeout[0]=setTimeout(function(){o[0]=null},1e3))},s=function(e){t.instance.touchMoving=!0},d=function(e){n.addEventListener(this,"touchmove",s),t.checkIfTouchMove=setTimeout(function(){return t.instance.touchMoving===!0?(t.instance.touchMoving=void 0,void n.removeEventListener("touchmove",s,!1)):void i(e)},30)},h=function(e){var n,o,r;t.instance.hasSetting("onCellMouseOver")&&(n=t.instance.wtTable.TABLE,o=l(e.realTarget,["TD","TH"],n),r=t.instance.cloneSource||t.instance,o&&o!==r.lastMouseOver&&u(o,n)&&(r.lastMouseOver=o,t.instance.getSetting("onCellMouseOver",e,t.instance.wtTable.getCoords(o),o,t.instance)))},f=function(e){if(2!==e.button){var n=t.parentCell(e.realTarget);n.TD===o[0]&&n.TD===o[1]?(a(e.realTarget,"corner")?t.instance.getSetting("onCellCornerDblClick",e,n.coords,n.TD,t.instance):t.instance.getSetting("onCellDblClick",e,n.coords,n.TD,t.instance),o[0]=null,o[1]=null):n.TD===o[0]&&(o[1]=n.TD,clearTimeout(t.dblClickTimeout[1]),t.dblClickTimeout[1]=setTimeout(function(){o[1]=null},500))}},g=function(e){clearTimeout(r),e.preventDefault(),f(e)};if(n.addEventListener(this.instance.wtTable.holder,"mousedown",i),n.addEventListener(this.instance.wtTable.TABLE,"mouseover",h),n.addEventListener(this.instance.wtTable.holder,"mouseup",f),this.instance.wtTable.holder.parentNode.parentNode&&Handsontable.mobileBrowser&&!t.instance.wtTable.isWorkingOnClone()){var p="."+this.instance.wtTable.holder.parentNode.className.split(" ").join(".");n.addEventListener(this.instance.wtTable.holder,"touchstart",function(e){t.instance.touchApplied=!0,u(e.target,p)&&d.call(e.target,e)}),n.addEventListener(this.instance.wtTable.holder,"touchend",function(e){t.instance.touchApplied=!1,u(e.target,p)&&g.call(e.target,e)}),t.instance.momentumScrolling||(t.instance.momentumScrolling={}),n.addEventListener(this.instance.wtTable.holder,"scroll",function(e){clearTimeout(t.instance.momentumScrolling._timeout),t.instance.momentumScrolling.ongoing||t.instance.getSetting("onBeforeTouchScroll"),t.instance.momentumScrolling.ongoing=!0,t.instance.momentumScrolling._timeout=setTimeout(function(){t.instance.touchApplied||(t.instance.momentumScrolling.ongoing=!1,t.instance.getSetting("onAfterMomentumScroll"))},200)})}n.addEventListener(window,"resize",function(){"none"!==t.instance.getSetting("stretchH")&&t.instance.draw()}),this.destroy=function(){clearTimeout(this.dblClickTimeout[0]),clearTimeout(this.dblClickTimeout[1]),n.destroy()}}Object.defineProperties(n,{WalkontableEvent:{get:function(){return o}},__esModule:{value:!0}});var r,i,s=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),l=s.closest,a=s.hasClass,u=s.isChildOf,c=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager;o.prototype.parentCell=function(e){var t={},n=this.instance.wtTable.TABLE,o=l(e,["TD","TH"],n);return o&&u(o,n)?(t.coords=this.instance.wtTable.getCoords(o),t.TD=o):a(e,"wtBorder")&&a(e,"current")?(t.coords=this.instance.selections.current.cellRange.highlight,t.TD=this.instance.wtTable.getCell(t.coords)):a(e,"wtBorder")&&a(e,"area")&&this.instance.selections.area.cellRange&&(t.coords=this.instance.selections.area.cellRange.to,t.TD=this.instance.wtTable.getCell(t.coords)),t},window.WalkontableEvent=o},{eventManager:41,"helpers/dom/element":45}],9:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableColumnFilter:{get:function(){return o}},__esModule:{value:!0}});var o=function(e,t,n){this.offset=e,this.total=t,this.countTH=n};$traceurRuntime.createClass(o,{offsetted:function(e){return e+this.offset},unOffsetted:function(e){return e-this.offset},renderedToSource:function(e){return this.offsetted(e)},sourceToRendered:function(e){return this.unOffsetted(e)},offsettedTH:function(e){return e-this.countTH},unOffsettedTH:function(e){return e+this.countTH},visibleRowHeadedColumnToSourceColumn:function(e){return this.renderedToSource(this.offsettedTH(e))}, -sourceColumnToVisibleRowHeadedColumn:function(e){return this.unOffsettedTH(this.sourceToRendered(e))}},{}),window.WalkontableColumnFilter=o},{}],10:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableRowFilter:{get:function(){return o}},__esModule:{value:!0}});var o=function(e,t,n){this.offset=e,this.total=t,this.countTH=n};$traceurRuntime.createClass(o,{offsetted:function(e){return e+this.offset},unOffsetted:function(e){return e-this.offset},renderedToSource:function(e){return this.offsetted(e)},sourceToRendered:function(e){return this.unOffsetted(e)},offsettedTH:function(e){return e-this.countTH},unOffsettedTH:function(e){return e+this.countTH},visibleColHeadedRowToSourceRow:function(e){return this.renderedToSource(this.offsettedTH(e))},sourceRowToVisibleColHeadedRow:function(e){return this.unOffsettedTH(this.sourceToRendered(e))}},{}),window.WalkontableRowFilter=o},{}],11:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableOverlay:{get:function(){return h}},__esModule:{value:!0}});var o,r,i,s=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),l=s.getScrollableElement,a=s.getTrimmingContainer,u=(r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}).defineGetter,c=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager,d={},h=function(e){u(this,"wot",e,{writable:!1}),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=a(this.hider.parentNode.parentNode),this.needFullRender=this.shouldBeRendered(),this.areElementSizesAdjusted=!1},f=h;$traceurRuntime.createClass(h,{shouldBeRendered:function(){return!0},makeClone:function(e){if(-1===f.CLONE_TYPES.indexOf(e))throw new Error('Clone type "'+e+'" is not supported.');var t=document.createElement("DIV"),n=document.createElement("TABLE");t.className="ht_clone_"+e+" handsontable",t.style.position="absolute",t.style.top=0,t.style.left=0,t.style.overflow="hidden",n.className=this.wot.wtTable.TABLE.className,t.appendChild(n),this.type=e,this.wot.wtTable.wtRootElement.parentNode.appendChild(t);var o=this.wot.getSetting("preventOverflow");return o===!0||"horizontal"===o&&this.type===f.CLONE_TOP||"vertical"===o&&this.type===f.CLONE_LEFT?this.mainTableScrollableElement=window:this.mainTableScrollableElement=l(this.wot.wtTable.TABLE),new Walkontable({cloneSource:this.wot,cloneOverlay:this,table:n})},refresh:function(){var e=void 0!==arguments[0]?arguments[0]:!1,t=this.shouldBeRendered();this.clone&&(this.needFullRender||t)&&this.clone.draw(e),this.needFullRender=t},destroy:function(){c(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[f.CLONE_TOP,f.CLONE_BOTTOM,f.CLONE_LEFT,f.CLONE_TOP_LEFT_CORNER,f.CLONE_BOTTOM_LEFT_CORNER,f.CLONE_DEBUG]},registerOverlay:function(e,t){if(-1===f.CLONE_TYPES.indexOf(e))throw new Error("Unsupported overlay ("+e+").");d[e]=t},createOverlay:function(e,t){return new d[e](t)},isOverlayTypeOf:function(e,t){return e&&d[t]?e instanceof d[t]:!1}}),window.WalkontableOverlay=h},{eventManager:41,"helpers/dom/element":45,"helpers/object":50}],12:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableDebugOverlay:{get:function(){return l}},__esModule:{value:!0}});var o,r,i=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}).addClass,s=(r=e("_base"),r&&r.__esModule&&r||{"default":r}).WalkontableOverlay,l=function(e){$traceurRuntime.superConstructor(a).call(this,e),this.clone=this.makeClone(s.CLONE_DEBUG),this.clone.wtTable.holder.style.opacity=.4,this.clone.wtTable.holder.style.textShadow="0 0 2px #ff0000",i(this.clone.wtTable.holder.parentNode,"wtDebugVisible")},a=l;$traceurRuntime.createClass(l,{},{},s),window.WalkontableDebugOverlay=l,s.registerOverlay(s.CLONE_DEBUG,l)},{_base:11,"helpers/dom/element":45}],13:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableLeftOverlay:{get:function(){return m}},__esModule:{value:!0}});var o,r,i=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),s=i.addClass,l=i.getScrollbarWidth,a=i.getScrollLeft,u=i.getWindowScrollTop,c=i.hasClass,d=i.outerWidth,h=i.innerHeight,f=i.removeClass,g=i.setOverlayPosition,p=(r=e("_base"),r&&r.__esModule&&r||{"default":r}).WalkontableOverlay,m=function(e){$traceurRuntime.superConstructor(w).call(this,e),this.clone=this.makeClone(p.CLONE_LEFT)},w=m;$traceurRuntime.createClass(m,{shouldBeRendered:function(){return this.wot.getSetting("fixedColumnsLeft")||this.wot.getSetting("rowHeaders").length?!0:!1},resetFixedPosition:function(){if(this.needFullRender&&this.wot.wtTable.holder.parentNode){var e=this.clone.wtTable.holder.parentNode,t=0,n=this.wot.getSetting("preventOverflow");if(this.trimmingContainer!==window||n&&"horizontal"===n)t=this.getScrollPosition();else{var o,r,i=this.wot.wtTable.hider.getBoundingClientRect(),s=Math.ceil(i.left),l=Math.ceil(i.right);r=this.wot.wtTable.hider.style.top,r=""===r?0:r,o=0>s&&l-e.offsetWidth>0?-s:0,t=o,o+="px",g(e,o,r)}this.adjustHeaderBordersPosition(t),this.adjustElementsSize()}},setScrollPosition:function(e){this.mainTableScrollableElement===window?window.scrollTo(e,u()):this.mainTableScrollableElement.scrollLeft=e},onScroll:function(){this.wot.getSetting("onScrollVertically")},sumCellSizes:function(e,t){for(var n=0,o=this.wot.wtSettings.defaultColumnWidth;t>e;)n+=this.wot.wtTable.getStretchedColumnWidth(e)||o,e++;return n},adjustElementsSize:function(){var e=void 0!==arguments[0]?arguments[0]:!1;(this.needFullRender||e)&&(this.adjustRootElementSize(),this.adjustRootChildrenSize(),e||(this.areElementSizesAdjusted=!0))},adjustRootElementSize:function(){var e,t=this.wot.wtTable.holder,n=t.clientHeight===t.offsetHeight?0:l(),o=this.clone.wtTable.holder.parentNode,r=o.style,i=this.wot.getSetting("preventOverflow");if(this.trimmingContainer!==window||"vertical"===i){var s=this.wot.wtViewport.getWorkspaceHeight()-n;s=Math.min(s,h(this.wot.wtTable.wtRootElement)),r.height=s+"px"}this.clone.wtTable.holder.style.height=r.height,e=d(this.clone.wtTable.TABLE),r.width=(0===e?e:e+4)+"px"},adjustRootChildrenSize:function(){var e=l();this.clone.wtTable.hider.style.height=this.hider.style.height,this.clone.wtTable.holder.style.height=this.clone.wtTable.holder.parentNode.style.height,0===e&&(e=30),this.clone.wtTable.holder.style.width=parseInt(this.clone.wtTable.holder.parentNode.style.width,10)+e+"px"},applyToDOM:function(){var e=this.wot.getSetting("totalColumns");if(this.areElementSizesAdjusted||this.adjustElementsSize(),"number"==typeof this.wot.wtViewport.columnsRenderCalculator.startPosition)this.spreader.style.left=this.wot.wtViewport.columnsRenderCalculator.startPosition+"px";else{if(0!==e)throw new Error("Incorrect value of the columnsRenderCalculator");this.spreader.style.left="0"}this.spreader.style.right="",this.needFullRender&&this.syncOverlayOffset()},syncOverlayOffset:function(){"number"==typeof this.wot.wtViewport.rowsRenderCalculator.startPosition?this.clone.wtTable.spreader.style.top=this.wot.wtViewport.rowsRenderCalculator.startPosition+"px":this.clone.wtTable.spreader.style.top=""},scrollTo:function(e,t){var n=this.getTableParentOffset(),o=this.wot.cloneSource?this.wot.cloneSource:this.wot,r=o.wtTable.holder,i=0;t&&r.offsetWidth!==r.clientWidth&&(i=l()),t?(n+=this.sumCellSizes(0,e+1),n-=this.wot.wtViewport.getViewportWidth()):n+=this.sumCellSizes(this.wot.getSetting("fixedColumnsLeft"),e),n+=i,this.setScrollPosition(n)},getTableParentOffset:function(){var e=this.wot.getSetting("preventOverflow"),t=0;return e||this.trimmingContainer!==window||(t=this.wot.wtTable.holderOffset.left),t},getScrollPosition:function(){return a(this.mainTableScrollableElement)},adjustHeaderBordersPosition:function(e){var t=this.wot.wtTable.holder.parentNode,n=this.wot.getSetting("rowHeaders"),o=this.wot.getSetting("fixedColumnsLeft");if(o&&!n.length)s(t,"innerBorderLeft");else if(!o&&n.length){var r=c(t,"innerBorderLeft");e?s(t,"innerBorderLeft"):f(t,"innerBorderLeft"),(!r&&e||r&&!e)&&this.wot.wtOverlays.adjustElementsSize()}}},{},p),window.WalkontableLeftOverlay=m,p.registerOverlay(p.CLONE_LEFT,m)},{_base:11,"helpers/dom/element":45}],14:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableTopOverlay:{get:function(){return m}},__esModule:{value:!0}});var o,r,i=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),s=i.addClass,l=i.getScrollbarWidth,a=i.getScrollTop,u=i.getWindowScrollLeft,c=i.hasClass,d=i.outerHeight,h=i.innerWidth,f=i.removeClass,g=i.setOverlayPosition,p=(r=e("_base"),r&&r.__esModule&&r||{"default":r}).WalkontableOverlay,m=function(e){$traceurRuntime.superConstructor(w).call(this,e),this.clone=this.makeClone(p.CLONE_TOP)},w=m;$traceurRuntime.createClass(m,{shouldBeRendered:function(){return this.wot.getSetting("fixedRowsTop")||this.wot.getSetting("columnHeaders").length?!0:!1},resetFixedPosition:function(){if(this.needFullRender&&this.wot.wtTable.holder.parentNode){var e=this.clone.wtTable.holder.parentNode,t=0,n=this.wot.getSetting("preventOverflow");if(this.trimmingContainer!==window||n&&"vertical"===n)t=this.getScrollPosition();else{var o,r,i=this.wot.wtTable.hider.getBoundingClientRect(),s=Math.ceil(i.top),l=Math.ceil(i.bottom);o=this.wot.wtTable.hider.style.left,o=""===o?0:o,r=0>s&&l-e.offsetHeight>0?-s:0,t=r,r+="px",g(e,o,r)}this.adjustHeaderBordersPosition(t),this.adjustElementsSize()}},setScrollPosition:function(e){this.mainTableScrollableElement===window?window.scrollTo(u(),e):this.mainTableScrollableElement.scrollTop=e},onScroll:function(){this.wot.getSetting("onScrollHorizontally")},sumCellSizes:function(e,t){for(var n=0,o=this.wot.wtSettings.settings.defaultRowHeight;t>e;){var r=this.wot.wtTable.getRowHeight(e);n+=void 0===r?o:r,e++}return n},adjustElementsSize:function(){var e=void 0!==arguments[0]?arguments[0]:!1;(this.needFullRender||e)&&(this.adjustRootElementSize(),this.adjustRootChildrenSize(),e||(this.areElementSizesAdjusted=!0))},adjustRootElementSize:function(){var e,t=this.wot.wtTable.holder,n=t.clientWidth===t.offsetWidth?0:l(),o=this.clone.wtTable.holder.parentNode,r=o.style,i=this.wot.getSetting("preventOverflow");if(this.trimmingContainer!==window||"horizontal"===i){var s=this.wot.wtViewport.getWorkspaceWidth()-n;s=Math.min(s,h(this.wot.wtTable.wtRootElement)),r.width=s+"px"}this.clone.wtTable.holder.style.width=r.width,e=d(this.clone.wtTable.TABLE),r.height=(0===e?e:e+4)+"px"},adjustRootChildrenSize:function(){var e=l();this.clone.wtTable.hider.style.width=this.hider.style.width,this.clone.wtTable.holder.style.width=this.clone.wtTable.holder.parentNode.style.width,0===e&&(e=30),this.clone.wtTable.holder.style.height=parseInt(this.clone.wtTable.holder.parentNode.style.height,10)+e+"px"},applyToDOM:function(){var e=this.wot.getSetting("totalRows");if(this.areElementSizesAdjusted||this.adjustElementsSize(),"number"==typeof this.wot.wtViewport.rowsRenderCalculator.startPosition)this.spreader.style.top=this.wot.wtViewport.rowsRenderCalculator.startPosition+"px";else{if(0!==e)throw new Error("Incorrect value of the rowsRenderCalculator");this.spreader.style.top="0"}this.spreader.style.bottom="",this.needFullRender&&this.syncOverlayOffset()},syncOverlayOffset:function(){"number"==typeof this.wot.wtViewport.columnsRenderCalculator.startPosition?this.clone.wtTable.spreader.style.left=this.wot.wtViewport.columnsRenderCalculator.startPosition+"px":this.clone.wtTable.spreader.style.left=""},scrollTo:function(e,t){var n=this.getTableParentOffset(),o=this.wot.cloneSource?this.wot.cloneSource:this.wot,r=o.wtTable.holder,i=0;if(t&&r.offsetHeight!==r.clientHeight&&(i=l()),t){var s=this.wot.getSetting("fixedRowsBottom"),a=(this.wot.getSetting("fixedRowsTop"),this.wot.getSetting("totalRows"));n+=this.sumCellSizes(0,e+1),n-=this.wot.wtViewport.getViewportHeight()-this.sumCellSizes(a-s,a),n+=1}else n+=this.sumCellSizes(this.wot.getSetting("fixedRowsTop"),e);n+=i,this.setScrollPosition(n)},getTableParentOffset:function(){return this.mainTableScrollableElement===window?this.wot.wtTable.holderOffset.top:0},getScrollPosition:function(){return a(this.mainTableScrollableElement)},adjustHeaderBordersPosition:function(e){if(0===this.wot.getSetting("fixedRowsTop")&&this.wot.getSetting("columnHeaders").length>0){var t=this.wot.wtTable.holder.parentNode,n=c(t,"innerBorderTop");e||0===this.wot.getSetting("totalRows")?s(t,"innerBorderTop"):f(t,"innerBorderTop"),(!n&&e||n&&!e)&&this.wot.wtOverlays.adjustElementsSize()}if(0===this.wot.getSetting("rowHeaders").length){var o=this.clone.wtTable.THEAD.querySelectorAll("th:nth-of-type(2)");if(o)for(var r=0;ru&&d-e.offsetWidth>0&&(h=-u+"px"),o&&"horizontal"!==o||0>i&&c-e.offsetHeight>0&&(f=-i+"px"),a(e,h,f)}e.style.height=(0===t?t:t+4)+"px",e.style.width=(0===n?n:n+4)+"px"}}},{},u),window.WalkontableTopLeftCornerOverlay=c,u.registerOverlay(u.CLONE_TOP_LEFT_CORNER,c)},{_base:11,"helpers/dom/element":45}],16:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableOverlays:{get:function(){return f}},__esModule:{value:!0}});var o,r,i,s=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),l=s.getScrollableElement,a=s.getScrollbarWidth,u=s.getScrollLeft,c=s.getScrollTop,d=(r=e("helpers/unicode"),r&&r.__esModule&&r||{"default":r}).isKey,h=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).EventManager,f=function(e){this.wot=e,this.instance=this.wot,this.eventManager=new h(this.wot),this.wot.update("scrollbarWidth",a()),this.wot.update("scrollbarHeight",a()),this.scrollableElement=l(this.wot.wtTable.TABLE),this.topOverlay=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_TOP,this.wot),"undefined"==typeof WalkontableBottomOverlay?this.bottomOverlay={needFullRender:!1}:this.bottomOverlay=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_BOTTOM,this.wot),this.leftOverlay=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_LEFT,this.wot),this.topOverlay.needFullRender&&this.leftOverlay.needFullRender&&(this.topLeftCornerOverlay=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_TOP_LEFT_CORNER,this.wot)),this.bottomOverlay.needFullRender&&this.leftOverlay.needFullRender&&"undefined"!=typeof WalkontableBottomLeftCornerOverlay?this.bottomLeftCornerOverlay=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER,this.wot):this.bottomLeftCornerOverlay={needFullRender:!1},this.wot.getSetting("debug")&&(this.debug=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_DEBUG,this.wot)),this.destroyed=!1,this.keyPressed=!1,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.pendingScrollCallbacks={master:{top:0,left:0},top:{left:0},bottom:{left:0},left:{top:0}},this.verticalScrolling=!1,this.horizontalScrolling=!1,this.delegatedScrollCallback=!1,this.registerListeners()};$traceurRuntime.createClass(f,{refreshAll:function(){if(this.wot.drawn){if(!this.wot.wtTable.holder.parentNode)return void this.destroy();this.wot.draw(!0),this.verticalScrolling&&this.leftOverlay.onScroll(),this.horizontalScrolling&&this.topOverlay.onScroll(),this.verticalScrolling=!1,this.horizontalScrolling=!1}},registerListeners:function(){var e=this;this.eventManager.addEventListener(document.documentElement,"keydown",function(t){return e.onKeyDown(t)}),this.eventManager.addEventListener(document.documentElement,"keyup",function(){return e.onKeyUp()}),this.eventManager.addEventListener(document,"visibilitychange",function(){return e.onKeyUp()});var t=this.topOverlay.mainTableScrollableElement,n=this.leftOverlay.mainTableScrollableElement;this.eventManager.addEventListener(t,"scroll",function(t){return e.onTableScroll(t)}),t!==n&&this.eventManager.addEventListener(n,"scroll",function(t){return e.onTableScroll(t)}),this.topOverlay.needFullRender&&(this.eventManager.addEventListener(this.topOverlay.clone.wtTable.holder,"scroll",function(t){return e.onTableScroll(t)}),this.eventManager.addEventListener(this.topOverlay.clone.wtTable.holder,"wheel",function(t){return e.onTableScroll(t)})),this.bottomOverlay.needFullRender&&(this.eventManager.addEventListener(this.bottomOverlay.clone.wtTable.holder,"scroll",function(t){return e.onTableScroll(t)}),this.eventManager.addEventListener(this.bottomOverlay.clone.wtTable.holder,"wheel",function(t){return e.onTableScroll(t)})),this.leftOverlay.needFullRender&&(this.eventManager.addEventListener(this.leftOverlay.clone.wtTable.holder,"scroll",function(t){return e.onTableScroll(t)}),this.eventManager.addEventListener(this.leftOverlay.clone.wtTable.holder,"wheel",function(t){return e.onTableScroll(t)})),this.topOverlay.trimmingContainer!==window&&this.leftOverlay.trimmingContainer!==window&&this.eventManager.addEventListener(window,"wheel",function(t){var n,o=t.wheelDeltaY||t.deltaY,r=t.wheelDeltaX||t.deltaX;e.topOverlay.clone.wtTable.holder.contains(t.realTarget)?n="top":e.bottomOverlay.clone&&e.bottomOverlay.clone.wtTable.holder.contains(t.realTarget)?n="bottom":e.leftOverlay.clone.wtTable.holder.contains(t.realTarget)&&(n="left"),"top"==n&&0!==o?t.preventDefault():"left"==n&&0!==r?t.preventDefault():"bottom"==n&&0!==o&&t.preventDefault()})},onTableScroll:function(e){if(!Handsontable.mobileBrowser){var t=this.leftOverlay.mainTableScrollableElement,n=this.topOverlay.mainTableScrollableElement,o=e.target;this.keyPressed&&(n!==window&&o!==window&&!e.target.contains(n)||t!==window&&o!==window&&!e.target.contains(t))||("scroll"===e.type?this.syncScrollPositions(e):this.translateMouseWheelToScroll(e))}},onKeyDown:function(e){this.keyPressed=d(e.keyCode,"ARROW_UP|ARROW_RIGHT|ARROW_DOWN|ARROW_LEFT")},onKeyUp:function(){this.keyPressed=!1},translateMouseWheelToScroll:function(e){var t,n=this.topOverlay.clone.wtTable.holder,o=this.bottomOverlay.clone?this.bottomOverlay.clone.wtTable.holder:null,r=this.leftOverlay.clone.wtTable.holder,i={type:"wheel"},s=e.target,l=e.wheelDeltaY||-1*e.deltaY,a=e.wheelDeltaX||-1*e.deltaX;for(1===e.deltaMode&&(l=120*l,a=120*a);s!=document&&null!=s;){if(s.className.indexOf("wtHolder")>-1){t=s;break}s=s.parentNode}return i.target=t,t==n?this.syncScrollPositions(i,-.2*l):t==o?this.syncScrollPositions(i,-.2*l):t==r&&this.syncScrollPositions(i,-.2*a),!1},syncScrollPositions:function(e){var t=void 0!==arguments[1]?arguments[1]:null;if(!this.destroyed){if(0===arguments.length)return void this.syncScrollWithMaster();var n,o,r,i=this.leftOverlay.mainTableScrollableElement,s=this.topOverlay.mainTableScrollableElement,l=e.target,a=0,d=!1,h=!1,f=this.wot.getSetting("preventOverflow");this.topOverlay.needFullRender&&(n=this.topOverlay.clone.wtTable.holder),this.bottomOverlay.needFullRender&&(r=this.bottomOverlay.clone.wtTable.holder),this.leftOverlay.needFullRender&&(o=this.leftOverlay.clone.wtTable.holder),l===document&&(l=window),l===i||l===s?(a=u(f?this.scrollableElement:l),this.horizontalScrolling=!0,this.overlayScrollPositions.master.left=a,d=!0,this.pendingScrollCallbacks.master.left>0?this.pendingScrollCallbacks.master.left--:(n&&n.scrollLeft!==a&&(null==t&&this.pendingScrollCallbacks.top.left++,n.scrollLeft=a,h=i!==window),r&&r.scrollLeft!==a&&(null==t&&this.pendingScrollCallbacks.bottom.left++,r.scrollLeft=a,h=i!==window)),a=c(l),this.verticalScrolling=!0,this.overlayScrollPositions.master.top=a,d=!0,this.pendingScrollCallbacks.master.top>0?this.pendingScrollCallbacks.master.top--:o&&o.scrollTop!==a&&(null==t&&this.pendingScrollCallbacks.left.top++,o.scrollTop=a,h=s!==window)):l===r?(a=u(l),this.horizontalScrolling=!0,this.overlayScrollPositions.bottom.left=a,d=!0,this.pendingScrollCallbacks.bottom.left>0?this.pendingScrollCallbacks.bottom.left--:(null==t&&this.pendingScrollCallbacks.master.left++,i.scrollLeft=a,n&&n.scrollLeft!==a&&(null==t&&this.pendingScrollCallbacks.top.left++,n.scrollLeft=a,h=s!==window)),null!==t&&(d=!0,s.scrollTop+=t)):l===n?(a=u(l),this.horizontalScrolling=!0,this.overlayScrollPositions.top.left=a,d=!0,this.pendingScrollCallbacks.top.left>0?this.pendingScrollCallbacks.top.left--:(null==t&&this.pendingScrollCallbacks.master.left++,i.scrollLeft=a),null!==t&&(d=!0,s.scrollTop+=t),r&&r.scrollLeft!==a&&(null==t&&this.pendingScrollCallbacks.bottom.left++,r.scrollLeft=a,h=s!==window)):l===o&&(a=c(l),this.overlayScrollPositions.left.top!==a&&(this.verticalScrolling=!0,this.overlayScrollPositions.left.top=a,d=!0,this.pendingScrollCallbacks.left.top>0?this.pendingScrollCallbacks.left.top--:(null==t&&this.pendingScrollCallbacks.master.top++,s.scrollTop=a)),null!==t&&(d=!0,s.scrollLeft+=t)),!this.keyPressed&&d&&"scroll"===e.type&&(this.delegatedScrollCallback?this.delegatedScrollCallback=!1:this.refreshAll(),h&&(this.delegatedScrollCallback=!0))}},syncScrollWithMaster:function(){var e=this.topOverlay.mainTableScrollableElement;this.topOverlay.needFullRender&&(this.topOverlay.clone.wtTable.holder.scrollLeft=e.scrollLeft),this.leftOverlay.needFullRender&&(this.leftOverlay.clone.wtTable.holder.scrollTop=e.scrollTop)},destroy:function(){this.eventManager.destroy(),this.topOverlay.destroy(),this.bottomOverlay.clone&&this.bottomOverlay.destroy(),this.leftOverlay.destroy(),this.topLeftCornerOverlay&&this.topLeftCornerOverlay.destroy(),this.bottomLeftCornerOverlay&&this.bottomLeftCornerOverlay.clone&&this.bottomLeftCornerOverlay.destroy(),this.debug&&this.debug.destroy(),this.destroyed=!0},refresh:function(){var e=void 0!==arguments[0]?arguments[0]:!1;if(this.topOverlay.areElementSizesAdjusted&&this.leftOverlay.areElementSizesAdjusted){var t=this.wot.wtTable.wtRootElement.parentNode||this.wot.wtTable.wtRootElement,n=t.clientWidth,o=t.clientHeight;(n!==this.spreaderLastSize.width||o!==this.spreaderLastSize.height)&&(this.spreaderLastSize.width=n,this.spreaderLastSize.height=o,this.adjustElementsSize())}this.bottomOverlay.clone&&this.bottomOverlay.refresh(e),this.leftOverlay.refresh(e),this.topOverlay.refresh(e),this.topLeftCornerOverlay&&this.topLeftCornerOverlay.refresh(e),this.bottomLeftCornerOverlay&&this.bottomLeftCornerOverlay.clone&&this.bottomLeftCornerOverlay.refresh(e),this.debug&&this.debug.refresh(e)},adjustElementsSize:function(){var e=void 0!==arguments[0]?arguments[0]:!1,t=this.wot.getSetting("totalColumns"),n=this.wot.getSetting("totalRows"),o=this.wot.wtViewport.getRowHeaderWidth(),r=this.wot.wtViewport.getColumnHeaderHeight(),i=this.wot.wtTable.hider.style;i.width=o+this.leftOverlay.sumCellSizes(0,t)+"px",i.height=r+this.topOverlay.sumCellSizes(0,n)+1+"px",this.topOverlay.adjustElementsSize(e),this.leftOverlay.adjustElementsSize(e),this.bottomOverlay.clone&&this.bottomOverlay.adjustElementsSize(e)},applyToDOM:function(){this.topOverlay.areElementSizesAdjusted&&this.leftOverlay.areElementSizesAdjusted||this.adjustElementsSize(),this.topOverlay.applyToDOM(),this.bottomOverlay.clone&&this.bottomOverlay.applyToDOM(),this.leftOverlay.applyToDOM()}},{}),window.WalkontableOverlays=f},{eventManager:41,"helpers/dom/element":45,"helpers/unicode":53}],17:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableScroll:{get:function(){return g}},__esModule:{value:!0}});var o,r,i=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),s=i.innerHeight,l=i.innerWidth,a=i.getScrollLeft,u=i.getScrollTop,c=i.offset,d=(r=e("helpers/number"),r&&r.__esModule&&r||{"default":r}),h=d.rangeEach,f=d.rangeEachReverse,g=function(e){this.wot=e,this.instance=e};$traceurRuntime.createClass(g,{scrollViewport:function(e){if(this.wot.drawn){var t=this._getVariables(),n=t.topOverlay,o=t.leftOverlay,r=t.totalRows,i=t.totalColumns,s=t.fixedRowsTop,l=t.fixedRowsBottom,a=t.fixedColumnsLeft;if(e.row<0||e.row>r-1)throw new Error("row "+e.row+" does not exist");if(e.col<0||e.col>i-1)throw new Error("column "+e.col+" does not exist");e.row>=s&&e.rowthis.getLastVisibleRow()&&e.row=a&&e.colthis.getLastVisibleColumn()&&o.scrollTo(e.col,!0)}},getFirstVisibleRow:function(){var e=this._getVariables(),t=e.topOverlay,n=e.wtTable,o=e.wtViewport,r=e.totalRows,i=e.fixedRowsTop,l=n.getFirstVisibleRow();if(t.mainTableScrollableElement===window){var a=c(n.wtRootElement),d=s(n.hider),h=s(window),g=u(window);if(a.top+d-h<=g){var p=o.getColumnHeaderHeight();p+=t.sumCellSizes(0,i),f(r,1,function(e){return p+=t.sumCellSizes(e-1,e),a.top+d-p<=g?(l=e,!1):void 0})}}return l},getLastVisibleRow:function(){var e=this._getVariables(),t=e.topOverlay,n=e.wtTable,o=e.wtViewport,r=e.totalRows,i=n.getLastVisibleRow();if(t.mainTableScrollableElement===window){var l=c(n.wtRootElement),a=s(window),d=u(window);if(l.top>d){var f=o.getColumnHeaderHeight();h(1,r,function(e){return f+=t.sumCellSizes(e-1,e),l.top+f-d>=a?(i=e-2,!1):void 0})}}return i},getFirstVisibleColumn:function(){var e=this._getVariables(),t=e.leftOverlay,n=e.wtTable,o=e.wtViewport,r=e.totalColumns,i=(e.fixedColumnsLeft,n.getFirstVisibleColumn());if(t.mainTableScrollableElement===window){var s=c(n.wtRootElement),u=l(n.hider),d=l(window),h=a(window);if(s.left+u-d<=h){var g=o.getRowHeaderWidth();f(r,1,function(e){return g+=t.sumCellSizes(e-1,e),s.left+u-g<=h?(i=e,!1):void 0})}}return i},getLastVisibleColumn:function(){var e=this._getVariables(),t=e.leftOverlay,n=e.wtTable,o=e.wtViewport,r=e.totalColumns,i=n.getLastVisibleColumn();if(t.mainTableScrollableElement===window){var s=c(n.wtRootElement),u=l(window),d=a(window);if(s.left>d){var f=o.getRowHeaderWidth();h(1,r,function(e){return f+=t.sumCellSizes(e-1,e),s.left+f-d>=u?(i=e-2,!1):void 0})}}return i},_getVariables:function(){var e=this.wot,t=e.wtOverlays.topOverlay,n=e.wtOverlays.leftOverlay,o=e.wtTable,r=e.wtViewport,i=e.getSetting("totalRows"),s=e.getSetting("totalColumns"),l=e.getSetting("fixedRowsTop"),a=e.getSetting("fixedRowsBottom"),u=e.getSetting("fixedColumnsLeft");return{topOverlay:t,leftOverlay:n,wtTable:o,wtViewport:r,totalRows:i,totalColumns:s,fixedRowsTop:l,fixedRowsBottom:a,fixedColumnsLeft:u}}},{}),window.WalkontableScroll=g},{"helpers/dom/element":45,"helpers/number":49}],18:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableSelection:{get:function(){return d}},__esModule:{value:!0}});var o,r,i,s,l=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}).addClass,a=(r=e("border"),r&&r.__esModule&&r||{"default":r}).WalkontableBorder,u=(i=e("cell/coords"),i&&i.__esModule&&i||{"default":i}).WalkontableCellCoords,c=(s=e("cell/range"),s&&s.__esModule&&s||{"default":s}).WalkontableCellRange,d=function(e,t){this.settings=e,this.cellRange=t||null,this.instanceBorders={}};$traceurRuntime.createClass(d,{getBorder:function(e){return this.instanceBorders[e.guid]?this.instanceBorders[e.guid]:void(this.instanceBorders[e.guid]=new a(e,this.settings))},isEmpty:function(){return null===this.cellRange},add:function(e){this.isEmpty()?this.cellRange=new c(e,e,e):this.cellRange.expand(e)},replace:function(e,t){if(!this.isEmpty()){if(this.cellRange.from.isEqual(e))return this.cellRange.from=t,!0;if(this.cellRange.to.isEqual(e))return this.cellRange.to=t,!0}return!1},clear:function(){this.cellRange=null},getCorners:function(){var e=this.cellRange.getTopLeftCorner(),t=this.cellRange.getBottomRightCorner();return[e.row,e.col,t.row,t.col]},addClassAtCoords:function(e,t,n,o){var r=e.wtTable.getCell(new u(t,n));"object"==typeof r&&l(r,o)},draw:function(e){if(this.isEmpty()){if(this.settings.border){var t=this.getBorder(e);t&&t.disappear()}}else{for(var n,o,r,i=e.wtTable.getRenderedRowsCount(),s=e.wtTable.getRenderedColumnsCount(),a=this.getCorners(),u=0;s>u;u++)o=e.wtTable.columnFilter.renderedToSource(u),o>=a[1]&&o<=a[3]&&(r=e.wtTable.getColumnHeader(o),r&&this.settings.highlightColumnClassName&&l(r,this.settings.highlightColumnClassName));for(var c=0;i>c;c++){n=e.wtTable.rowFilter.renderedToSource(c),n>=a[0]&&n<=a[2]&&(r=e.wtTable.getRowHeader(n),r&&this.settings.highlightRowClassName&&l(r,this.settings.highlightRowClassName));for(var d=0;s>d;d++)o=e.wtTable.columnFilter.renderedToSource(d),n>=a[0]&&n<=a[2]&&o>=a[1]&&o<=a[3]?this.settings.className&&this.addClassAtCoords(e,n,o,this.settings.className):n>=a[0]&&n<=a[2]?this.settings.highlightRowClassName&&this.addClassAtCoords(e,n,o,this.settings.highlightRowClassName):o>=a[1]&&o<=a[3]&&this.settings.highlightColumnClassName&&this.addClassAtCoords(e,n,o,this.settings.highlightColumnClassName)}if(e.getSetting("onBeforeDrawBorders",a,this.settings.className),this.settings.border){var h=this.getBorder(e);h&&h.appear(a)}}}},{}),window.WalkontableSelection=d},{border:2,"cell/coords":5,"cell/range":6,"helpers/dom/element":45}],19:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableSettings:{get:function(){return i}},__esModule:{value:!0}});var o,r=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}).fastInnerText,i=function(e,t){var n=this;this.wot=e,this.instance=e,this.defaults={table:void 0,debug:!1,externalRowCalculator:!1,stretchH:"none",currentRowClassName:null,currentColumnClassName:null,preventOverflow:function(){return!1},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(e,t,o){var i=n.getSetting("data",e,t);r(o,void 0===i||null===i?"":i)},columnWidth:function(e){},rowHeight:function(e){},defaultRowHeight:23,defaultColumnWidth:50,selections:null,hideBorderOnMouseDownOver:!1,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(e){return e},scrollbarWidth:10,scrollbarHeight:10,renderAllRows:!1,groups:!1,rowHeaderWidth:null,columnHeaderHeight:null},this.settings={};for(var o in this.defaults)if(this.defaults.hasOwnProperty(o))if(void 0!==t[o])this.settings[o]=t[o];else{if(void 0===this.defaults[o])throw new Error('A required setting "'+o+'" was not provided');this.settings[o]=this.defaults[o]}};$traceurRuntime.createClass(i,{update:function(e,t){if(void 0===t)for(var n in e)e.hasOwnProperty(n)&&(this.settings[n]=e[n]);else this.settings[e]=t;return this.wot},getSetting:function(e,t,n,o,r){ -return"function"==typeof this.settings[e]?this.settings[e](t,n,o,r):void 0!==t&&Array.isArray(this.settings[e])?this.settings[e][t]:this.settings[e]},has:function(e){return!!this.settings[e]}},{}),window.WalkontableSettings=i},{"helpers/dom/element":45}],20:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableTable:{get:function(){return S}},__esModule:{value:!0}});var o,r,i,s,l,a,u=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),c=u.getStyle,d=u.getTrimmingContainer,h=u.hasClass,f=u.index,g=u.offset,p=u.removeClass,m=u.removeTextNodes,w=u.overlayContainsElement,v=u.closest,b=(r=e("cell/coords"),r&&r.__esModule&&r||{"default":r}).WalkontableCellCoords,C=((i=e("cell/range"),i&&i.__esModule&&i||{"default":i}).WalkontableCellRange,(s=e("filter/column"),s&&s.__esModule&&s||{"default":s}).WalkontableColumnFilter),y=(l=e("filter/row"),l&&l.__esModule&&l||{"default":l}).WalkontableRowFilter,R=(a=e("tableRenderer"),a&&a.__esModule&&a||{"default":a}).WalkontableTableRenderer,S=function(e,t){this.wot=e,this.instance=this.wot,this.TABLE=t,this.TBODY=null,this.THEAD=null,this.COLGROUP=null,this.tableOffset=0,this.holderOffset=0,m(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(S,{fixTableDomTree:function(){this.TBODY=this.TABLE.querySelector("tbody"),this.TBODY||(this.TBODY=document.createElement("tbody"),this.TABLE.appendChild(this.TBODY)),this.THEAD=this.TABLE.querySelector("thead"),this.THEAD||(this.THEAD=document.createElement("thead"),this.TABLE.insertBefore(this.THEAD,this.TBODY)),this.COLGROUP=this.TABLE.querySelector("colgroup"),this.COLGROUP||(this.COLGROUP=document.createElement("colgroup"),this.TABLE.insertBefore(this.COLGROUP,this.THEAD)),this.wot.getSetting("columnHeaders").length&&!this.THEAD.childNodes.length&&this.THEAD.appendChild(document.createElement("TR"))},createSpreader:function(e){var t,n=e.parentNode;return n&&1===n.nodeType&&h(n,"wtHolder")||(t=document.createElement("div"),t.className="wtSpreader",n&&n.insertBefore(t,e),t.appendChild(e)),t.style.position="relative",t},createHider:function(e){var t,n=e.parentNode;return n&&1===n.nodeType&&h(n,"wtHolder")||(t=document.createElement("div"),t.className="wtHider",n&&n.insertBefore(t,e),t.appendChild(e)),t},createHolder:function(e){var t,n=e.parentNode;return n&&1===n.nodeType&&h(n,"wtHolder")||(t=document.createElement("div"),t.style.position="relative",t.className="wtHolder",n&&n.insertBefore(t,e),this.isWorkingOnClone()||(t.parentNode.className+="ht_master handsontable"),t.appendChild(e)),t},alignOverlaysWithTrimmingContainer:function(){var e=d(this.wtRootElement);if(!this.isWorkingOnClone())if(this.holder.parentNode.style.position="relative",e===window){var t=this.wot.getSetting("preventOverflow");t||(this.holder.style.overflow="visible",this.wtRootElement.style.overflow="visible")}else this.holder.style.width=c(e,"width"),this.holder.style.height=c(e,"height"),this.holder.style.overflow=""},isWorkingOnClone:function(){return!!this.wot.cloneSource},draw:function(e){var t=this.instance.getSetting("totalRows");if(this.isWorkingOnClone()||(this.holderOffset=g(this.holder),e=this.wot.wtViewport.createRenderCalculators(e)),e)this.isWorkingOnClone()||this.wot.wtViewport.createVisibleCalculators(),this.wot.wtOverlays&&this.wot.wtOverlays.refresh(!0);else{this.isWorkingOnClone()?this.tableOffset=this.wot.cloneSource.wtTable.tableOffset:this.tableOffset=g(this.TABLE);var n;n=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)?0:WalkontableOverlay.isOverlayTypeOf(this.instance.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM)||WalkontableOverlay.isOverlayTypeOf(this.instance.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER)?Math.max(t-this.wot.getSetting("fixedRowsBottom"),0):this.wot.wtViewport.rowsRenderCalculator.startRow;var o;o=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)?0:this.wot.wtViewport.columnsRenderCalculator.startColumn,this.rowFilter=new y(n,t,this.wot.getSetting("columnHeaders").length),this.columnFilter=new C(o,this.wot.getSetting("totalColumns"),this.wot.getSetting("rowHeaders").length),this._doDraw(),this.alignOverlaysWithTrimmingContainer()}return this.refreshSelections(e),this.isWorkingOnClone()||(this.wot.wtOverlays.topOverlay.resetFixedPosition(),this.wot.wtOverlays.bottomOverlay.clone&&this.wot.wtOverlays.bottomOverlay.resetFixedPosition(),this.wot.wtOverlays.leftOverlay.resetFixedPosition(),this.wot.wtOverlays.topLeftCornerOverlay&&this.wot.wtOverlays.topLeftCornerOverlay.resetFixedPosition(),this.instance.wtOverlays.bottomLeftCornerOverlay&&this.instance.wtOverlays.bottomLeftCornerOverlay.clone&&this.wot.wtOverlays.bottomLeftCornerOverlay.resetFixedPosition()),this.wot.drawn=!0,this},_doDraw:function(){var e=new R(this);e.render()},removeClassFromCells:function(e){for(var t=this.TABLE.querySelectorAll("."+e),n=0,o=t.length;o>n;n++)p(t[n],e)},refreshSelections:function(e){if(this.wot.selections){var t=this.wot.selections.length;if(e)for(var n=0;t>n;n++)this.wot.selections[n].settings.className&&this.removeClassFromCells(this.wot.selections[n].settings.className),this.wot.selections[n].settings.highlightRowClassName&&this.removeClassFromCells(this.wot.selections[n].settings.highlightRowClassName),this.wot.selections[n].settings.highlightColumnClassName&&this.removeClassFromCells(this.wot.selections[n].settings.highlightColumnClassName);for(var o=0;t>o;o++)this.wot.selections[o].draw(this.wot,e)}},getCell:function(e){if(this.isRowBeforeRenderedRows(e.row))return-1;if(this.isRowAfterRenderedRows(e.row))return-2;var t=this.TBODY.childNodes[this.rowFilter.sourceToRendered(e.row)];return t?t.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(e.col)]:void 0},getColumnHeader:function(e){var t=void 0!==arguments[1]?arguments[1]:0,n=this.THEAD.childNodes[t];return n?n.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(e)]:void 0},getRowHeader:function(e){if(0===this.columnFilter.sourceColumnToVisibleRowHeadedColumn(0))return null;var t=this.TBODY.childNodes[this.rowFilter.sourceToRendered(e)];return t?t.childNodes[0]:void 0},getCoords:function(e){"TD"!==e.nodeName&&"TH"!==e.nodeName&&(e=v(e,["TD","TH"]));var t=e.parentNode,n=t.parentNode,o=f(t),r=e.cellIndex;return w(WalkontableOverlay.CLONE_TOP_LEFT_CORNER,e)||w(WalkontableOverlay.CLONE_TOP,e)?"THEAD"===n.nodeName&&(o-=n.childNodes.length):o=n===this.THEAD?this.rowFilter.visibleColHeadedRowToSourceRow(o):this.rowFilter.renderedToSource(o),r=w(WalkontableOverlay.CLONE_TOP_LEFT_CORNER,e)||w(WalkontableOverlay.CLONE_LEFT,e)?this.columnFilter.offsettedTH(r):this.columnFilter.visibleRowHeadedColumnToSourceColumn(r),new b(o,r)},getTrForRow:function(e){return this.TBODY.childNodes[this.rowFilter.sourceToRendered(e)]},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(e){return this.rowFilter.sourceToRendered(e)<0&&e>=0},isRowAfterViewport:function(e){return this.rowFilter.sourceToRendered(e)>this.getLastVisibleRow()},isRowAfterRenderedRows:function(e){return this.rowFilter.sourceToRendered(e)>this.getLastRenderedRow()},isColumnBeforeViewport:function(e){return this.columnFilter.sourceToRendered(e)<0&&e>=0},isColumnAfterViewport:function(e){return this.columnFilter.sourceToRendered(e)>this.getLastVisibleColumn()},isLastRowFullyVisible:function(){return this.getLastVisibleRow()===this.getLastRenderedRow()},isLastColumnFullyVisible:function(){return this.getLastVisibleColumn()===this.getLastRenderedColumn()},getRenderedColumnsCount:function(){var e=this.wot.wtViewport.columnsRenderCalculator.count,t=this.wot.getSetting("totalColumns");if(this.wot.isOverlayName(WalkontableOverlay.CLONE_DEBUG))e=t;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"),t);return e},getRenderedRowsCount:function(){var e=this.wot.wtViewport.rowsRenderCalculator.count,t=this.wot.getSetting("totalRows");return this.wot.isOverlayName(WalkontableOverlay.CLONE_DEBUG)?e=t:this.wot.isOverlayName(WalkontableOverlay.CLONE_TOP)||this.wot.isOverlayName(WalkontableOverlay.CLONE_TOP_LEFT_CORNER)?e=Math.min(this.wot.getSetting("fixedRowsTop"),t):(this.wot.isOverlayName(WalkontableOverlay.CLONE_BOTTOM)||this.wot.isOverlayName(WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER))&&(e=Math.min(this.wot.getSetting("fixedRowsBottom"),t)),e},getVisibleRowsCount:function(){return this.wot.wtViewport.rowsVisibleCalculator.count},allRowsInViewport:function(){return this.wot.getSetting("totalRows")==this.getVisibleRowsCount()},getRowHeight:function(e){var t=this.wot.wtSettings.settings.rowHeight(e),n=this.wot.wtViewport.oversizedRows[e];return void 0!==n&&(t=void 0===t?n:Math.max(t,n)),t},getColumnHeaderHeight:function(e){var t=this.wot.wtSettings.settings.defaultRowHeight,n=this.wot.wtViewport.oversizedColumnHeaders[e];return void 0!==n&&(t=t?Math.max(t,n):n),t},getVisibleColumnsCount:function(){return this.wot.wtViewport.columnsVisibleCalculator.count},allColumnsInViewport:function(){return this.wot.getSetting("totalColumns")==this.getVisibleColumnsCount()},getColumnWidth:function(e){var t=this.wot.wtSettings.settings.columnWidth;return"function"==typeof t?t=t(e):"object"==typeof t&&(t=t[e]),t||this.wot.wtSettings.settings.defaultColumnWidth},getStretchedColumnWidth:function(e){var t=this.getColumnWidth(e),n=null==t?this.instance.wtSettings.settings.defaultColumnWidth:t,o=this.wot.wtViewport.columnsRenderCalculator;if(o){var r=o.getStretchedColumnWidth(e,n);r&&(n=r)}return n}},{}),window.WalkontableTable=S},{"cell/coords":5,"cell/range":6,"filter/column":9,"filter/row":10,"helpers/dom/element":45,tableRenderer:21}],21:[function(e,t,n){"use strict";function o(e,t){var n=document.createElement("TH");return t.insertBefore(n,e),t.removeChild(e),n}function r(e,t){var n=document.createElement("TD");return t.insertBefore(n,e),t.removeChild(e),n}Object.defineProperties(n,{WalkontableTableRenderer:{get:function(){return f}},__esModule:{value:!0}});var i,s=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),l=s.addClass,a=s.empty,u=s.getScrollbarWidth,c=s.hasClass,d=s.innerHeight,h=s.outerWidth,f=function(e){this.wtTable=e,this.wot=e.instance,this.instance=e.instance,this.rowFilter=e.rowFilter,this.columnFilter=e.columnFilter,this.TABLE=e.TABLE,this.THEAD=e.THEAD,this.TBODY=e.TBODY,this.COLGROUP=e.COLGROUP,this.rowHeaders=[],this.rowHeaderCount=0,this.columnHeaders=[],this.columnHeaderCount=0,this.fixedRowsTop=0,this.fixedRowsBottom=0};$traceurRuntime.createClass(f,{render:function(){this.wtTable.isWorkingOnClone()||this.wot.getSetting("beforeDraw",!0),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 e,t=this.wtTable.getRenderedColumnsCount(),n=this.wtTable.getRenderedRowsCount(),o=this.wot.getSetting("totalColumns"),r=this.wot.getSetting("totalRows"),i=!1;if((WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER))&&(this.columnHeaders=[],this.columnHeaderCount=0),o>0&&(this.adjustAvailableNodes(),i=!0,this.renderColumnHeaders(),this.renderRows(r,n,t),this.wtTable.isWorkingOnClone()||(e=this.wot.wtViewport.getWorkspaceWidth(),this.wot.wtViewport.containerWidth=null),this.adjustColumnHeaderHeights(),this.adjustColumnWidths(t),this.markOversizedColumns()),i||this.adjustAvailableNodes(),this.removeRedundantRows(n),(!this.wtTable.isWorkingOnClone()||this.wot.isOverlayName(WalkontableOverlay.CLONE_BOTTOM))&&this.markOversizedRows(),this.wtTable.isWorkingOnClone())this.wot.isOverlayName(WalkontableOverlay.CLONE_BOTTOM)&&this.wot.cloneSource.wtOverlays.adjustElementsSize();else{this.wot.wtViewport.createVisibleCalculators(),this.wot.wtOverlays.refresh(!1);var s=h(this.wtTable.hider),l=h(this.wtTable.TABLE);if(0!==s&&l!==s&&this.adjustColumnWidths(t),this.wot.wtOverlays.applyToDOM(),e!==this.wot.wtViewport.getWorkspaceWidth()){this.wot.wtViewport.containerWidth=null;var a=this.wtTable.getFirstRenderedColumn(),u=this.wtTable.getLastRenderedColumn(),c=this.wot.getSetting("rowHeaderWidth");if(null!=c)for(var d=0;df;f++){var g=this.wtTable.getStretchedColumnWidth(f),p=this.columnFilter.sourceToRendered(f);this.COLGROUP.childNodes[p+this.rowHeaderCount].style.width=g+"px"}}this.wot.getSetting("onDraw",!0)}},removeRedundantRows:function(e){for(;this.wtTable.tbodyChildrenLength>e;)this.TBODY.removeChild(this.TBODY.lastChild),this.wtTable.tbodyChildrenLength--},renderRows:function(e,t,n){for(var o,r,i=0,s=this.rowFilter.renderedToSource(i),l=this.wtTable.isWorkingOnClone();e>s&&s>=0&&(i>1e3&&console.error("Security brake: Too much TRs. Please define height for your table, which will enforce scrollbars."),void 0===t||i!==t);){if(r=this.getOrCreateTrForRow(i,r),this.renderRowHeaders(s,r),this.adjustColumns(r,n+this.rowHeaderCount),o=this.renderCells(s,r,n),(!l||this.wot.isOverlayName(WalkontableOverlay.CLONE_BOTTOM))&&this.resetOversizedRow(s),r.firstChild){var a=this.wot.wtTable.getRowHeight(s);a?(a--,r.firstChild.style.height=a+"px"):r.firstChild.style.height=""}i++,s=this.rowFilter.renderedToSource(i)}},resetOversizedRow:function(e){this.wot.getSetting("externalRowCalculator")||this.wot.wtViewport.oversizedRows&&this.wot.wtViewport.oversizedRows[e]&&(this.wot.wtViewport.oversizedRows[e]=void 0)},markOversizedRows:function(){if(!this.wot.getSetting("externalRowCalculator")){var e,t,n,o,r,i=this.instance.wtTable.TBODY.childNodes.length,s=i*this.instance.wtSettings.settings.defaultRowHeight,l=d(this.instance.wtTable.TBODY)-1;this.instance.getSetting("totalRows");if(s!==l||this.instance.getSetting("fixedRowsBottom"))for(;i;)i--,n=this.instance.wtTable.rowFilter.renderedToSource(i),e=this.instance.wtTable.getRowHeight(n),o=this.instance.wtTable.getTrForRow(n),r=o.querySelector("th"),t=r?d(r):d(o)-1,(!e&&this.instance.wtSettings.settings.defaultRowHeighte)&&(this.instance.wtViewport.oversizedRows[n]=++t)}},markOversizedColumns:function(){var e=this.wot.getOverlayName();if(this.columnHeaderCount&&!this.wot.wtViewport.isMarkedOversizedColumn[e]&&!this.wtTable.isWorkingOnClone()){for(var t=this.wtTable.getRenderedColumnsCount(),n=0;no;o++)this.markIfOversizedColumnHeader(o);this.wot.wtViewport.isMarkedOversizedColumn[e]=!0}},adjustColumnHeaderHeights:function(){for(var e=this.wot.getSetting("columnHeaders"),t=this.wot.wtTable.THEAD.childNodes,n=this.wot.wtViewport.oversizedColumnHeaders,o=0,r=e.length;r>o;o++)if(n[o]){if(0===t[o].childNodes.length)return;t[o].childNodes[0].style.height=n[o]+"px"}},markIfOversizedColumnHeader:function(e){for(var t,n,o,r=this.wot.wtTable.columnFilter.renderedToSource(e),i=this.columnHeaderCount,s=this.wot.wtSettings.settings.defaultRowHeight,l=this.wot.getSetting("columnHeaderHeight")||[];i;)i--,t=this.wot.wtTable.getColumnHeaderHeight(i),n=this.wot.wtTable.getColumnHeader(r,i),n&&(o=d(n),(!t&&o>s||o>t)&&(this.wot.wtViewport.oversizedColumnHeaders[i]=o),this.wot.wtViewport.oversizedColumnHeaders[i]<(l[i]||l)&&(this.wot.wtViewport.oversizedColumnHeaders[i]=l[i]||l))},renderCells:function(e,t,n){for(var o,i,s=0;n>s;s++)i=this.columnFilter.renderedToSource(s),o=0===s?t.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(i)]:o.nextSibling,"TH"==o.nodeName&&(o=r(o,t)),c(o,"hide")||(o.className=""),o.removeAttribute("style"),this.wot.wtSettings.settings.cellRenderer(e,i,o);return o},adjustColumnWidths:function(e){var t=0,n=this.wot.cloneSource?this.wot.cloneSource:this.wot,o=n.wtTable.holder;o.offsetHeights;s++){var l=this.wtTable.getStretchedColumnWidth(this.columnFilter.renderedToSource(s));this.COLGROUP.childNodes[s+this.rowHeaderCount].style.width=l+"px"}},appendToTbody:function(e){this.TBODY.appendChild(e),this.wtTable.tbodyChildrenLength++},getOrCreateTrForRow:function(e,t){var n;return e>=this.wtTable.tbodyChildrenLength?(n=this.createRow(),this.appendToTbody(n)):n=0===e?this.TBODY.firstChild:t.nextSibling,n.className&&n.removeAttribute("class"),n},createRow:function(){for(var e=document.createElement("TR"),t=0;to;o++){var r=this.columnFilter.renderedToSource(o);this.renderColumnHeader(t,r,n.childNodes[o+this.rowHeaderCount])}},adjustColGroups:function(){for(var e=this.wtTable.getRenderedColumnsCount();this.wtTable.colgroupChildrenLengthe+this.rowHeaderCount;)this.COLGROUP.removeChild(this.COLGROUP.lastChild),this.wtTable.colgroupChildrenLength--;this.rowHeaderCount&&l(this.COLGROUP.childNodes[0],"rowHeader")},adjustThead:function(){var e=this.wtTable.getRenderedColumnsCount(),t=this.THEAD.firstChild;if(this.columnHeaders.length){for(var n=0,o=this.columnHeaders.length;o>n;n++){for(t=this.THEAD.childNodes[n],t||(t=document.createElement("TR"),this.THEAD.appendChild(t)),this.theadChildrenLength=t.childNodes.length;this.theadChildrenLengthe+this.rowHeaderCount;)t.removeChild(t.lastChild),this.theadChildrenLength--}var r=this.THEAD.childNodes.length;if(r>this.columnHeaders.length)for(var i=this.columnHeaders.length;r>i;i++)this.THEAD.removeChild(this.THEAD.lastChild)}else t&&a(t)},getTrForColumnHeaders:function(e){return this.THEAD.childNodes[e]},renderColumnHeader:function(e,t,n){return n.className="",n.removeAttribute("style"),this.columnHeaders[e](t,n,e)},adjustColumns:function(e,t){for(var n=e.childNodes.length;t>n;){var o=document.createElement("TD");e.appendChild(o),n++}for(;n>t;)e.removeChild(e.lastChild),n--},removeRedundantColumns:function(e){for(;this.wtTable.tbodyChildrenLength>e;)this.TBODY.removeChild(this.TBODY.lastChild),this.wtTable.tbodyChildrenLength--}},{}),window.WalkontableTableRenderer=f},{"helpers/dom/element":45}],22:[function(e,t,n){"use strict";Object.defineProperties(n,{WalkontableViewport:{get:function(){return m}},__esModule:{value:!0}});var o,r,i,s,l=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),a=l.getScrollbarWidth,u=(l.getScrollTop,l.getStyle),c=l.offset,d=l.outerHeight,h=l.outerWidth,f=(r=e("eventManager"),r&&r.__esModule&&r||{"default":r}).EventManager,g=(i=e("calculator/viewportColumns"),i&&i.__esModule&&i||{"default":i}).WalkontableViewportColumnsCalculator,p=(s=e("calculator/viewportRows"),s&&s.__esModule&&s||{"default":s}).WalkontableViewportRowsCalculator,m=function(e){var t=this;this.wot=e,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 f(this.wot),this.eventManager.addEventListener(window,"resize",function(){t.clientHeight=t.getWorkspaceHeight()})};$traceurRuntime.createClass(m,{getWorkspaceHeight:function(){var e,t=this.instance.wtOverlays.topOverlay.trimmingContainer,n=0;return t===window?n=document.documentElement.clientHeight:(e=d(t),n=e>0&&t.clientHeight>0?t.clientHeight:1/0),n},getWorkspaceWidth:function(){var e,t,n=this.wot.getSetting("totalColumns"),o=this.instance.wtOverlays.leftOverlay.trimmingContainer,r=this.wot.getSetting("stretchH"),i=document.documentElement.offsetWidth,s=this.wot.getSetting("preventOverflow");return s?h(this.instance.wtTable.wtRootElement):(e=Handsontable.freezeOverlays?Math.min(i-this.getWorkspaceOffset().left,i):Math.min(this.getContainerFillWidth(),i-this.getWorkspaceOffset().left,i),o===window&&n>0&&this.sumColumnWidths(0,n-1)>e?document.documentElement.clientWidth:o!==window&&(t=u(this.instance.wtOverlays.leftOverlay.trimmingContainer,"overflow"),"scroll"==t||"hidden"==t||"auto"==t)?Math.max(e,o.clientWidth):"none"!==r&&r?e:Math.max(e,h(this.instance.wtTable.TABLE)))},hasVerticalScroll:function(){return this.getWorkspaceActualHeight()>this.getWorkspaceHeight()},hasHorizontalScroll:function(){return this.getWorkspaceActualWidth()>this.getWorkspaceWidth()},sumColumnWidths:function(e,t){for(var n=0;t>e;)n+=this.wot.wtTable.getColumnWidth(e),e++;return n},getContainerFillWidth:function(){if(this.containerWidth)return this.containerWidth;var e,t,n=this.instance.wtTable.holder;return t=document.createElement("div"),t.style.width="100%",t.style.height="1px",n.appendChild(t),e=t.offsetWidth,this.containerWidth=e,n.removeChild(t),e},getWorkspaceOffset:function(){return c(this.wot.wtTable.TABLE)},getWorkspaceActualHeight:function(){return d(this.wot.wtTable.TABLE)},getWorkspaceActualWidth:function(){return h(this.wot.wtTable.TABLE)||h(this.wot.wtTable.TBODY)||h(this.wot.wtTable.THEAD)},getColumnHeaderHeight:function(){return isNaN(this.columnHeaderHeight)&&(this.columnHeaderHeight=d(this.wot.wtTable.THEAD)),this.columnHeaderHeight},getViewportHeight:function(){var e,t=this.getWorkspaceHeight();return t===1/0?t:(e=this.getColumnHeaderHeight(),e>0&&(t-=e),t)},getRowHeaderWidth:function(){var e=this.instance.getSetting("rowHeaderWidth"),t=this.instance.getSetting("rowHeaders");if(e){this.rowHeaderWidth=0;for(var n=0,o=t.length;o>n;n++)this.rowHeaderWidth+=e[n]||e}if(this.wot.cloneSource)return this.wot.cloneSource.wtViewport.getRowHeaderWidth();if(isNaN(this.rowHeaderWidth))if(t.length){var r=this.instance.wtTable.TABLE.querySelector("TH");this.rowHeaderWidth=0;for(var i=0,s=t.length;s>i;i++)r?(this.rowHeaderWidth+=h(r),r=r.nextSibling):this.rowHeaderWidth+=50}else this.rowHeaderWidth=0;return this.rowHeaderWidth},getViewportWidth:function(){var e,t=this.getWorkspaceWidth();return t===1/0?t:(e=this.getRowHeaderWidth(),e>0?t-e:t)},createRowsCalculator:function(){var e,t,n,o,r,i,s,l=void 0!==arguments[0]?arguments[0]:!1,u=this;return this.rowHeaderWidth=NaN,e=this.wot.wtSettings.settings.renderAllRows?1/0:this.getViewportHeight(),t=this.wot.wtOverlays.topOverlay.getScrollPosition()-this.wot.wtOverlays.topOverlay.getTableParentOffset(),0>t&&(t=0),n=this.wot.getSetting("fixedRowsTop"),r=this.wot.getSetting("fixedRowsBottom"),s=this.wot.getSetting("totalRows"),n&&(i=this.wot.wtOverlays.topOverlay.sumCellSizes(0,n),t+=i,e-=i),r&&this.wot.wtOverlays.bottomOverlay.clone&&(i=this.wot.wtOverlays.bottomOverlay.sumCellSizes(s-r,s),e-=i),o=this.wot.wtTable.holder.clientHeight===this.wot.wtTable.holder.offsetHeight?0:a(),new p(e,t,this.wot.getSetting("totalRows"),function(e){return u.wot.wtTable.getRowHeight(e)},l?null:this.wot.wtSettings.settings.viewportRowCalculatorOverride,l,o)},createColumnsCalculator:function(){var e,t,n=void 0!==arguments[0]?arguments[0]:!1,o=this,r=this.getViewportWidth();if(this.columnHeaderHeight=NaN,e=this.wot.wtOverlays.leftOverlay.getScrollPosition()-this.wot.wtOverlays.leftOverlay.getTableParentOffset(),0>e&&(e=0),t=this.wot.getSetting("fixedColumnsLeft")){var i=this.wot.wtOverlays.leftOverlay.sumCellSizes(0,t);e+=i,r-=i}return this.wot.wtTable.holder.clientWidth!==this.wot.wtTable.holder.offsetWidth&&(r-=a()),new g(r,e,this.wot.getSetting("totalColumns"),function(e){return o.wot.wtTable.getColumnWidth(e)},n?null:this.wot.wtSettings.settings.viewportColumnCalculatorOverride,n,this.wot.getSetting("stretchH"),function(e,t){return o.wot.getSetting("onBeforeStretchingColumnWidth",e,t)})},createRenderCalculators:function(){var e=void 0!==arguments[0]?arguments[0]:!1;if(e){var t=this.createRowsCalculator(!0),n=this.createColumnsCalculator(!0);this.areAllProposedVisibleRowsAlreadyRendered(t)&&this.areAllProposedVisibleColumnsAlreadyRendered(n)||(e=!1)}return e||(this.rowsRenderCalculator=this.createRowsCalculator(),this.columnsRenderCalculator=this.createColumnsCalculator()),this.rowsVisibleCalculator=null,this.columnsVisibleCalculator=null,e},createVisibleCalculators:function(){this.rowsVisibleCalculator=this.createRowsCalculator(!0),this.columnsVisibleCalculator=this.createColumnsCalculator(!0)},areAllProposedVisibleRowsAlreadyRendered:function(e){return this.rowsVisibleCalculator?e.startRow0?!1:e.endRow>this.rowsRenderCalculator.endRow||e.endRow===this.rowsRenderCalculator.endRow&&e.endRow0?!1:e.endColumn>this.columnsRenderCalculator.endColumn||e.endColumn===this.columnsRenderCalculator.endColumn&&e.endColumn=0;s--)if(null===e[s])e.splice(s,1);else{var l=e[s][0],a=d.propToCol(e[s][1]),u=m.runHooks("modifyCol",a),c=m.getCellMeta(l,u);if("numeric"===c.type&&"string"==typeof e[s][3]&&e[s][3].length>0&&(/^-?[\d\s]*(\.|\,)?\d*$/.test(e[s][3])||c.format)){var h=e[s][3].length;"undefined"==typeof c.language?R.language("en"):e[s][3].indexOf(".")===h-3&&-1===e[s][3].indexOf(",")?R.language("en"):R.language(c.language),R.validate(e[s][3])&&(e[s][3]=R().unformat(e[s][3]))}m.getCellValidator(c)&&(i.addValidatorToQueue(),m.validateCell(e[s][3],c,function(t,n){return function(o){if("boolean"!=typeof o)throw new Error("Validation error: result is not boolean");o===!1&&n.allowInvalid===!1&&(e.splice(t,1),n.valid=!0,--t),i.removeValidatorFormQueue()}}(s,c),t))}i.checkIfQueueIsEmpty()}function r(e,t){var n=e.length-1;if(!(0>n)){for(;n>=0;n--)if(null!==e[n]){if(null!=e[n][2]||null!=e[n][3]){if(c.settings.allowInsertRow)for(;e[n][0]>m.countRows()-1;)d.createRow();if("array"===m.dataType&&c.settings.allowInsertColumn)for(;d.propToCol(e[n][1])>m.countCols()-1;)d.createCol();d.set(e[n][0],e[n][1],e[n][3])}}else e.splice(n,1);m.forceFullRender=!0,f.adjustRowsAndCols(),Handsontable.hooks.run(m,"beforeChangeRender",e,t),g.refreshBorders(null,!0),m.view.wt.wtOverlays.adjustElementsSize(),Handsontable.hooks.run(m,"afterChange",e,t||"edit")}}function i(e,t,n){return"object"==typeof e?e:[[e,t,n]]}function s(e){if(e.hasOwnProperty("type")){var t,n={};if("object"==typeof e.type)t=e.type;else if("string"==typeof e.type&&(t=Handsontable.cellTypes[e.type],void 0===t))throw new Error('You declared cell type "'+e.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 o in t)t.hasOwnProperty(o)&&!e.hasOwnProperty(o)&&(n[o]=t[o]);return n}}function l(e){return Handsontable.hooks.run(m,"modifyRow",e)}function a(e){return Handsontable.hooks.run(m,"modifyCol",e)}function u(){throw new Error("This method cannot be called because this Handsontable instance has been destroyed")}var c,d,h,f,g,p,m=this,w=function(){},v=A(m);x(w.prototype,Z.prototype),x(w.prototype,t),x(w.prototype,s(t)),this.rootElement=e,this.isHotTableEnv=O(this.rootElement),Handsontable.eventManager.isHotTableEnv=this.isHotTableEnv,this.container=document.createElement("DIV"),this.renderCall=!1,e.insertBefore(this.container,e.firstChild),this.guid="ht_"+F(),h=new G(m),this.rootElement.id&&"ht_"!==this.rootElement.id.substring(0,3)||(this.rootElement.id=this.guid),c={cellSettings:[],columnSettings:[],columnsSettingConflicts:["data","width"],settings:new w,selRange:null,isPopulated:null,scrollable:null,firstRun:!0},f={alter:function(e,t,n,o,r){function i(e,t,n,o){var r=function(){var e;return"array"===o?e=[]:"object"===o&&(e={}),e},i=j(new Array(n),function(){return r()});i.unshift(t,0),e.splice.apply(e,i)}var s;switch(n=n||1,e){case"insert_row":if(m.getSettings().maxRows===m.countSourceRows())return;s=d.createRow(t,n),i(c.cellSettings,t,n,"array"),s&&(g.isSelected()&&c.selRange.from.row>=t?(c.selRange.from.row=c.selRange.from.row+s,g.transformEnd(s,0)):g.refreshBorders());break;case"insert_col":s=d.createCol(t,n);for(var l=0,a=m.countSourceRows();a>l;l++)c.cellSettings[l]&&i(c.cellSettings[l],t,n);if(s){if(Array.isArray(m.getSettings().colHeaders)){var u=[t,0];u.length+=s,Array.prototype.splice.apply(m.getSettings().colHeaders,u)}g.isSelected()&&c.selRange.from.col>=t?(c.selRange.from.col=c.selRange.from.col+s,g.transformEnd(0,s)):g.refreshBorders()}break;case"remove_row":d.removeRow(t,n),c.cellSettings.splice(t,n);var h=m.countRows(),p=m.getSettings().fixedRowsTop;p>=t+1&&(m.getSettings().fixedRowsTop-=Math.min(n,p-t));var w=m.getSettings().fixedRowsBottom;w&&t>=h-w&&(m.getSettings().fixedRowsBottom-=Math.min(n,w)),f.adjustRowsAndCols(),g.refreshBorders();break;case"remove_col":d.removeCol(t,n);for(var v=0,b=m.countSourceRows();b>v;v++)c.cellSettings[v]&&c.cellSettings[v].splice(t,n);var C=m.getSettings().fixedColumnsLeft;C>=t+1&&(m.getSettings().fixedColumnsLeft-=Math.min(n,C-t)),Array.isArray(m.getSettings().colHeaders)&&("undefined"==typeof t&&(t=-1),m.getSettings().colHeaders.splice(t,n)),f.adjustRowsAndCols(),g.refreshBorders();break;default:throw new Error('There is no such action "'+e+'"')}r||f.adjustRowsAndCols()},adjustRowsAndCols:function(){if(c.settings.minRows){var e=m.countRows();if(et;t++)d.createRow(m.countRows(),1,!0)}if(c.settings.minSpareRows){var o=m.countEmptyRows(!0);if(oi-1?(a=i-1,l=!0,h>a&&(h=a)):h>i-1&&(h=i-1,l=!0,a>h&&(a=h)),u>s-1?(u=s-1,l=!0,f>u&&(f=u)):f>s-1&&(f=s-1,l=!0,u>f&&(u=f)),l&&m.selectCell(a,u,h,f)}m.view&&m.view.wt.wtOverlays.adjustElementsSize()},populateFromArray:function(e,t,n,o,r,i,s){var l,a,u,d,h=[],f={};if(a=t.length,0===a)return!1;var g,p,w,v;({row:null===n?null:n.row,col:null===n?null:n.col});switch(r){case"shift_down":for(g=n?n.col-e.col+1:0,p=n?n.row-e.row+1:0,t=K(t),u=0,d=t.length,w=Math.max(d,g);w>u;u++)if(d>u){for(l=0,a=t[u].length;p-a>l;l++)t[u].push(t[u][l%a]);t[u].unshift(e.col+u,e.row,0),m.spliceCol.apply(m,t[u])}else t[u%d][0]=e.col+u,m.spliceCol.apply(m,t[u%d]);break;case"shift_right":for(g=n?n.col-e.col+1:0,p=n?n.row-e.row+1:0,l=0,a=t.length,v=Math.max(a,p);v>l;l++)if(a>l){for(u=0,d=t[l].length;g-d>u;u++)t[l].push(t[l][u%d]);t[l].unshift(e.row+l,e.col,0),m.spliceRow.apply(m,t[l])}else t[l%a][0]=e.row+l,m.spliceRow.apply(m,t[l%a]);break;case"overwrite":default:f.row=e.row,f.col=e.col;var b,C={row:n&&e?n.row-e.row+1:1,col:n&&e?n.col-e.col+1:1},y=0,R=0,S=!0,E=function(e){var n=void 0!==arguments[1]?arguments[1]:null,o=t[e%t.length];return null!==n?o[n%o.length]:o},T=t.length,O=n?n.row-e.row+1:0;for(a=n?O:Math.max(T,O),l=0;a>l&&!(n&&f.row>n.row&&O>T||!c.settings.allowInsertRow&&f.row>m.countRows()-1||f.row>=c.settings.maxRows);l++){var _=l-y,M=E(_).length,H=n?n.col-e.col+1:0;if(d=n?H:Math.max(M,H),f.col=e.col,b=m.getCellMeta(f.row,f.col),"paste"!==o&&"autofill"!==o||!b.skipRowOnPaste){for(R=0,u=0;d>u&&!(n&&f.col>n.col&&H>M||!c.settings.allowInsertColumn&&f.col>m.countCols()-1||f.col>=c.settings.maxCols);u++)if(b=m.getCellMeta(f.row,f.col),"paste"!==o&&"autofill"!==o||!b.skipColumnOnPaste)if(b.readOnly)f.col++;else{var k=u-R,A=E(_,k),P=m.getDataAtCell(f.row,f.col),x={row:_,col:k};if("autofill"===o){var W=m.runHooks("beforeAutofillInsidePopulate",x,i,t,s,{},C);W&&(A="undefined"==typeof W.value?A:W.value)}if(null!==A&&"object"==typeof A)if(null===P||"object"!=typeof P)S=!1;else{var I=D(P[0]||P),j=D(A[0]||A);N(I,j)?A=L(A):S=!1}else null!==P&&"object"==typeof P&&(S=!1);S&&h.push([f.row,f.col,A]),S=!0,f.col++}else R++,f.col++,d++;f.row++}else y++,f.row++,a++}m.setDataAtCell(h,null,null,o||"populateFromArray")}}},this.selection=g={inProgress:!1,selectedHeader:{cols:!1,rows:!1},setSelectedHeaders:function(e,t){m.selection.selectedHeader.rows=e,m.selection.selectedHeader.cols=t},begin:function(){m.selection.inProgress=!0},finish:function(){var e=m.getSelected();Handsontable.hooks.run(m,"afterSelectionEnd",e[0],e[1],e[2],e[3]),Handsontable.hooks.run(m,"afterSelectionEndByProp",e[0],m.colToProp(e[1]),e[2],m.colToProp(e[3])),m.selection.inProgress=!1},isInProgress:function(){return m.selection.inProgress},setRangeStart:function(e,t){Handsontable.hooks.run(m,"beforeSetRangeStart",e),c.selRange=new Q(e,e,e),g.setRangeEnd(e,null,t)},setRangeEnd:function(e,t,n){if(null!==c.selRange){var o,r=!1,i=!0,s=m.view.wt.wtTable.getFirstVisibleRow(),l=m.view.wt.wtTable.getFirstVisibleColumn(),a={row:null,col:null};Handsontable.hooks.run(m,"beforeSetRangeEnd",e),m.selection.begin(),a.row=e.row<0?s:e.row,a.col=e.col<0?l:e.col,c.selRange.to=new q(a.row,a.col),c.settings.multiSelect||(c.selRange.from=e),m.view.wt.selections.current.clear(),o=m.getCellMeta(c.selRange.highlight.row,c.selRange.highlight.col).disableVisualSelection,"string"==typeof o&&(o=[o]),(o===!1||Array.isArray(o)&&-1===o.indexOf("current"))&&m.view.wt.selections.current.add(c.selRange.highlight),m.view.wt.selections.area.clear(),(o===!1||Array.isArray(o)&&-1===o.indexOf("area"))&&g.isMultiple()&&(m.view.wt.selections.area.add(c.selRange.from),m.view.wt.selections.area.add(c.selRange.to)),(c.settings.currentRowClassName||c.settings.currentColClassName)&&(m.view.wt.selections.highlight.clear(),m.view.wt.selections.highlight.add(c.selRange.from),m.view.wt.selections.highlight.add(c.selRange.to)),Handsontable.hooks.run(m,"afterSelection",c.selRange.from.row,c.selRange.from.col,c.selRange.to.row,c.selRange.to.col),Handsontable.hooks.run(m,"afterSelectionByProp",c.selRange.from.row,d.colToProp(c.selRange.from.col),c.selRange.to.row,d.colToProp(c.selRange.to.col)),(0===c.selRange.from.row&&c.selRange.to.row===m.countRows()-1&&m.countRows()>1||0===c.selRange.from.col&&c.selRange.to.col===m.countCols()-1&&m.countCols()>1)&&(r=!0),(e.row<0||e.col<0)&&(i=!1),t!==!1&&!r&&i&&(c.selRange.from&&!g.isMultiple()?m.view.scrollViewport(c.selRange.from):m.view.scrollViewport(e)),g.refreshBorders(null,n)}},refreshBorders:function(e,t){t||p.destroyEditor(e),m.view.render(),g.isSelected()&&!t&&p.prepareEditor()},isMultiple:function(){var e=!(c.selRange.to.col===c.selRange.from.col&&c.selRange.to.row===c.selRange.from.row),t=Handsontable.hooks.run(m,"afterIsMultipleSelection",e);return e?t:void 0},transformStart:function(e,t,n,o){var r,i,s,l,a=new q(e,t),u=0,d=0;m.runHooks("modifyTransformStart",a),r=m.countRows(),i=m.countCols(),l=m.getSettings().fixedRowsBottom,c.selRange.highlight.row+e>r-1?n&&c.settings.minSpareRows>0&&!(l&&c.selRange.highlight.row>=r-l-1)?(m.alter("insert_row",r),r=m.countRows()):c.settings.autoWrapCol&&(a.row=1-r,a.col=c.selRange.highlight.col+a.col==i-1?1-i:1):c.settings.autoWrapCol&&c.selRange.highlight.row+a.row<0&&c.selRange.highlight.col+a.col>=0&&(a.row=r-1,a.col=c.selRange.highlight.col+a.col==0?i-1:-1),c.selRange.highlight.col+a.col>i-1?n&&c.settings.minSpareCols>0?(m.alter("insert_col",i),i=m.countCols()):c.settings.autoWrapRow&&(a.row=c.selRange.highlight.row+a.row==r-1?1-r:1,a.col=1-i):c.settings.autoWrapRow&&c.selRange.highlight.col+a.col<0&&c.selRange.highlight.row+a.row>=0&&(a.row=c.selRange.highlight.row+a.row==0?r-1:-1,a.col=i-1),s=new q(c.selRange.highlight.row+a.row,c.selRange.highlight.col+a.col),s.row<0?(u=-1,s.row=0):s.row>0&&s.row>=r&&(u=1,s.row=r-1),s.col<0?(d=-1,s.col=0):s.col>0&&s.col>=i&&(d=1,s.col=i-1),m.runHooks("afterModifyTransformStart",s,u,d),g.setRangeStart(s,o)},transformEnd:function(e,t){var n,o,r,i=new q(e,t),s=0,l=0;m.runHooks("modifyTransformEnd",i),n=m.countRows(),o=m.countCols(),r=new q(c.selRange.to.row+i.row,c.selRange.to.col+i.col),r.row<0?(s=-1,r.row=0):r.row>0&&r.row>=n&&(s=1,r.row=n-1),r.col<0?(l=-1,r.col=0):r.col>0&&r.col>=o&&(l=1,r.col=o-1),m.runHooks("afterModifyTransformEnd",r,s,l),g.setRangeEnd(r,!0)},isSelected:function(){return null!==c.selRange},inInSelection:function(e){return g.isSelected()?c.selRange.includes(e):!1},deselect:function(){g.isSelected()&&(m.selection.inProgress=!1,c.selRange=null,m.view.wt.selections.current.clear(),m.view.wt.selections.area.clear(),(c.settings.currentRowClassName||c.settings.currentColClassName)&&m.view.wt.selections.highlight.clear(),p.destroyEditor(),g.refreshBorders(),Handsontable.hooks.run(m,"afterDeselect"))},selectAll:function(){c.settings.multiSelect&&(g.setRangeStart(new q(0,0)),g.setRangeEnd(new q(m.countRows()-1,m.countCols()-1),!1))},empty:function(){if(g.isSelected()){var e,t,n=c.selRange.getTopLeftCorner(),o=c.selRange.getBottomRightCorner(),r=[];for(e=n.row;e<=o.row;e++)for(t=n.col;t<=o.col;t++)m.getCellMeta(e,t).readOnly||r.push([e,t,""]);m.setDataAtCell(r)}}},this.init=function(){h.setData(c.settings.data),Handsontable.hooks.run(m,"beforeInit"),Handsontable.mobileBrowser&&E(m.rootElement,"mobile"),this.updateSettings(c.settings,!0),this.view=new U(this),p=new k(m,c,g,d),this.forceFullRender=!0,Handsontable.hooks.run(m,"init"),this.view.render(),"object"==typeof c.firstRun&&(Handsontable.hooks.run(m,"afterChange",c.firstRun[0],c.firstRun[1]),c.firstRun=!1),Handsontable.hooks.run(m,"afterInit")},this.validateCell=function(e,t,n,o){function r(e){var o=t.visualCol,r=t.visualRow,i=m.getCell(r,o,!0);i&&m.view.wt.wtSettings.settings.cellRenderer(r,o,i),n(e)}var i=m.getCellValidator(t);"[object RegExp]"===Object.prototype.toString.call(i)&&(i=function(e){return function(t,n){n(e.test(t))}}(i)),"function"==typeof i?(e=Handsontable.hooks.run(m,"beforeValidate",e,t.visualRow,t.prop,o),m._registerTimeout(setTimeout(function(){i.call(t,e,function(n){n=Handsontable.hooks.run(m,"afterValidate",n,e,t.visualRow,t.prop,o),t.valid=n,r(n),Handsontable.hooks.run(m,"postAfterValidate",n,e,t.visualRow,t.prop,o)})},0))):(t.valid=!0,r(t.valid))},this.setDataAtCell=function(e,t,n,s){var l,a,u,c=i(e,t,n),h=[];for(l=0,a=c.length;a>l;l++){if("object"!=typeof c[l])throw new Error("Method `setDataAtCell` accepts row number or changes array of arrays as its first parameter");if("number"!=typeof c[l][1])throw new Error("Method `setDataAtCell` accepts row and column number as its parameters. If you want to use object property name, use method `setDataAtRowProp`");u=d.colToProp(c[l][1]),h.push([c[l][0],u,d.get(c[l][0],u),c[l][2]])}s||"object"!=typeof e||(s=t),o(h,s,function(){r(h,s)})},this.setDataAtRowProp=function(e,t,n,s){var l,a,u=i(e,t,n),c=[];for(l=0,a=u.length;a>l;l++)c.push([u[l][0],u[l][1],d.get(u[l][0],u[l][1]),u[l][2]]);s||"object"!=typeof e||(s=t),o(c,s,function(){r(c,s)})},this.listen=function(){Handsontable.activeGuid=m.guid},this.unlisten=function(){Handsontable.activeGuid=null},this.isListening=function(){return Handsontable.activeGuid===m.guid},this.destroyEditor=function(e){g.refreshBorders(e)},this.populateFromArray=function(e,t,n,o,r,i,s,l,a){var u;if("object"!=typeof n||"object"!=typeof n[0])throw new Error("populateFromArray parameter `input` must be an array of arrays");return u="number"==typeof o?new q(o,r):null,f.populateFromArray(new q(e,t),n,u,i,s,l,a)},this.spliceCol=function(e,t,n){return d.spliceCol.apply(d,arguments)},this.spliceRow=function(e,t,n){return d.spliceRow.apply(d,arguments)},this.getSelected=function(){return g.isSelected()?[c.selRange.from.row,c.selRange.from.col,c.selRange.to.row,c.selRange.to.col]:void 0},this.getSelectedRange=function(){return g.isSelected()?c.selRange:void 0},this.render=function(){m.view&&(m.renderCall=!0,m.forceFullRender=!0,g.refreshBorders(null,!0))},this.loadData=function(e){function t(){c.cellSettings.length=0}if("object"==typeof e&&null!==e)e.push&&e.splice||(e=[e]);else{if(null!==e)throw new Error("loadData only accepts array of objects or array of arrays ("+typeof e+" given)");e=[];for(var n,o=0,r=c.settings.startRows;r>o;o++){n=[];for(var i=0,s=c.settings.startCols;s>i;i++)n.push(null);e.push(n)}}c.isPopulated=!1,w.prototype.data=e,Array.isArray(c.settings.dataSchema)||Array.isArray(e[0])?m.dataType="array":"function"==typeof c.settings.dataSchema?m.dataType="function":m.dataType="object",d=new H(m,c,w),h.data=e,h.dataType=m.dataType,h.colToProp=d.colToProp.bind(d),h.propToCol=d.propToCol.bind(d),t(),f.adjustRowsAndCols(),Handsontable.hooks.run(m,"afterLoadData",c.firstRun),c.firstRun?c.firstRun=[null,"loadData"]:(Handsontable.hooks.run(m,"afterChange",null,"loadData"),m.render()),c.isPopulated=!0},this.getData=function(e,t,n,o){return"undefined"==typeof e?d.getAll():d.getRange(new q(e,t),new q(n,o),d.DESTINATION_RENDERER)},this.getCopyableText=function(e,t,n,o){return d.getCopyableText(new q(e,t),new q(n,o))},this.getCopyableData=function(e,t){return d.getCopyable(e,d.colToProp(t))},this.getSchema=function(){return d.getSchema()},this.updateSettings=function(e,t){var n,o;if("undefined"!=typeof e.rows)throw new Error('"rows" setting is no longer supported. do you mean startRows, minRows or maxRows?');if("undefined"!=typeof e.cols)throw new Error('"cols" setting is no longer supported. do you mean startCols, minCols or maxCols?');for(n in e)"data"!==n&&(Handsontable.hooks.getRegistered().indexOf(n)>-1?("function"==typeof e[n]||Array.isArray(e[n]))&&m.addHook(n,e[n]):!t&&e.hasOwnProperty(n)&&(w.prototype[n]=e[n]));if(void 0===e.data&&void 0===c.settings.data?m.loadData(null):void 0!==e.data?m.loadData(e.data):void 0!==e.columns&&d.createMap(),o=m.countCols(),(void 0!==e.cell||void 0!==e.cells||void 0!==e.columns)&&(c.cellSettings.length=0),o>0){var r,i;for(n=0;o>n;n++)c.columnSettings[n]=M(w,c.columnsSettingConflicts),r=c.columnSettings[n].prototype,w.prototype.columns&&(i=w.prototype.columns[n],x(r,i),x(r,s(i)))}if("undefined"!=typeof e.cell)for(n in e.cell)if(e.cell.hasOwnProperty(n)){var l=e.cell[n];m.setCellMetaObject(l.row,l.col,l)}if(Handsontable.hooks.run(m,"afterCellMetaReset"),"undefined"!=typeof e.className&&(w.prototype.className&&_(m.rootElement,w.prototype.className),e.className&&E(m.rootElement,e.className)),"undefined"!=typeof e.height){var a=e.height;"function"==typeof a&&(a=a()),m.rootElement.style.height=a+"px"}if("undefined"!=typeof e.width){var u=e.width;"function"==typeof u&&(u=u()),m.rootElement.style.width=u+"px"}a&&(m.rootElement.style.overflow="hidden"),t||Handsontable.hooks.run(m,"afterUpdateSettings"),f.adjustRowsAndCols(),m.view&&!c.firstRun&&(m.forceFullRender=!0,g.refreshBorders(null,!0))},this.getValue=function(){var e=m.getSelected();if(w.prototype.getValue){if("function"==typeof w.prototype.getValue)return w.prototype.getValue.call(m);if(e)return m.getData()[e[0]][w.prototype.getValue]}else if(e)return m.getDataAtCell(e[0],e[1])},this.getSettings=function(){return c.settings},this.clear=function(){g.selectAll(),g.empty()},this.alter=function(e,t,n,o,r){f.alter(e,t,n,o,r)},this.getCell=function(e,t,n){return m.view.getCellAtCoords(new q(e,t),n)},this.getCoords=function(e){return this.view.wt.wtTable.getCoords.call(this.view.wt.wtTable,e)},this.colToProp=function(e){return d.colToProp(e)},this.propToCol=function(e){return d.propToCol(e)},this.getDataAtCell=function(e,t){return d.get(e,d.colToProp(t))},this.getDataAtRowProp=function(e,t){return d.get(e,t)},this.getDataAtCol=function(e){var t=[];return t.concat.apply(t,d.getRange(new q(0,e),new q(c.settings.data.length-1,e),d.DESTINATION_RENDERER))},this.getDataAtProp=function(e){var t,n=[];return t=d.getRange(new q(0,d.propToCol(e)),new q(c.settings.data.length-1,d.propToCol(e)),d.DESTINATION_RENDERER),n.concat.apply(n,t)},this.getSourceData=function(e,t,n,o){var r;return r=void 0===e?h.getData():h.getByRange(new q(e,t),new q(n,o))},this.getSourceDataAtCol=function(e){return h.getAtColumn(e)},this.getSourceDataAtRow=function(e){return h.getAtRow(e)},this.getSourceDataAtCell=function(e,t){return h.getAtCell(e,t)},this.getDataAtRow=function(e){var t=d.getRange(new q(e,0),new q(e,this.countCols()-1),d.DESTINATION_RENDERER);return t[0]},this.getDataType=function(e,t,n,o){var r=this,i=null,s=null;void 0===e&&(e=0,n=this.countRows(),t=0,o=this.countCols()),void 0===n&&(n=e),void 0===o&&(o=t);var l="mixed";return z(Math.min(e,n),Math.max(e,n),function(e){var n=!0;return z(Math.min(t,o),Math.max(t,o),function(t){var o=r.getCellMeta(e,t);return s=o.type,i?n=i===s:i=s,n}),l=n?s:"mixed",n}),l},this.removeCellMeta=function(e,t,n){var o=m.getCellMeta(e,t);void 0!=o[n]&&delete c.cellSettings[e][t][n]},this.setCellMetaObject=function(e,t,n){if("object"==typeof n)for(var o in n)if(n.hasOwnProperty(o)){var r=n[o];this.setCellMeta(e,t,o,r)}},this.setCellMeta=function(e,t,n,o){c.cellSettings[e]||(c.cellSettings[e]=[]),c.cellSettings[e][t]||(c.cellSettings[e][t]=new c.columnSettings[t]),c.cellSettings[e][t][n]=o,Handsontable.hooks.run(m,"afterSetCellMeta",e,t,n,o)},this.getCellsMeta=function(){return I(c.cellSettings)},this.getCellMeta=function(e,t){var n,o=d.colToProp(t),r=e,i=t;if(e=l(e),t=a(t),c.columnSettings[t]||(c.columnSettings[t]=M(w,c.columnsSettingConflicts)),c.cellSettings[e]||(c.cellSettings[e]=[]),c.cellSettings[e][t]||(c.cellSettings[e][t]=new c.columnSettings[t]),n=c.cellSettings[e][t],n.row=e,n.col=t,n.visualRow=r,n.visualCol=i,n.prop=o,n.instance=m,Handsontable.hooks.run(m,"beforeGetCellMeta",e,t,n),x(n,s(n)),n.cells){var u=n.cells.call(n,e,t,o);u&&(x(n,u),x(n,s(u)))}return Handsontable.hooks.run(m,"afterGetCellMeta",e,t,n),n},this.isColumnModificationAllowed=function(){return!("object"===m.dataType||m.getSettings().columns)};var b=X("renderer");this.getCellRenderer=function(e,t){var n=b.call(this,e,t);return V(n)},this.getCellEditor=X("editor"),this.getCellValidator=X("validator"),this.validateCells=function(e){var t=new n;e&&(t.onQueueEmpty=e);for(var o=m.countRows()-1;o>=0;){for(var r=m.countCols()-1;r>=0;)t.addValidatorToQueue(),m.validateCell(m.getDataAtCell(o,r),m.getCellMeta(o,r),function(e){if("boolean"!=typeof e)throw new Error("Validation error: result is not boolean");e===!1&&(t.valid=!1),t.removeValidatorFormQueue()},"validateCells"),r--;o--}t.checkIfQueueIsEmpty()},this.getRowHeader=function(e){var t=c.settings.rowHeaders;return void 0!==e&&(e=Handsontable.hooks.run(m,"modifyRowHeader",e)),void 0===e?(t=[],z(m.countRows()-1,function(e){t.push(m.getRowHeader(e))})):Array.isArray(t)&&void 0!==t[e]?t=t[e]:"function"==typeof t?t=t(e):t&&"string"!=typeof t&&"number"!=typeof t&&(t=e+1),t},this.hasRowHeaders=function(){return!!c.settings.rowHeaders},this.hasColHeaders=function(){if(void 0!==c.settings.colHeaders&&null!==c.settings.colHeaders)return!!c.settings.colHeaders;for(var e=0,t=m.countCols();t>e;e++)if(m.getColHeader(e))return!0;return!1},this.getColHeader=function(e){if(e=Handsontable.hooks.run(m,"modifyColHeader",e),void 0===e){for(var t=[],n=0,o=m.countCols();o>n;n++)t.push(m.getColHeader(n));return t}var r=e;return e=Handsontable.hooks.run(m,"modifyCol",e),c.settings.columns&&c.settings.columns[e]&&c.settings.columns[e].title?c.settings.columns[e].title:Array.isArray(c.settings.colHeaders)&&void 0!==c.settings.colHeaders[e]?c.settings.colHeaders[e]:"function"==typeof c.settings.colHeaders?c.settings.colHeaders(e):c.settings.colHeaders&&"string"!=typeof c.settings.colHeaders&&"number"!=typeof c.settings.colHeaders?Y(r):c.settings.colHeaders},this._getColWidthFromSettings=function(e){var t=m.getCellMeta(0,e),n=t.width;if((void 0===n||n===c.settings.width)&&(n=t.colWidths),void 0!==n&&null!==n){switch(typeof n){case"object":n=n[e];break;case"function":n=n(e)}"string"==typeof n&&(n=parseInt(n,10))}return n},this.getColWidth=function(e){var t=m._getColWidthFromSettings(e);return t=Handsontable.hooks.run(m,"modifyColWidth",t,e),void 0===t&&(t=J.DEFAULT_WIDTH),t},this._getRowHeightFromSettings=function(e){var t=c.settings.rowHeights;if(void 0!==t&&null!==t){switch(typeof t){case"object":t=t[e];break;case"function":t=t(e)}"string"==typeof t&&(t=parseInt(t,10))}return t},this.getRowHeight=function(e){var t=m._getRowHeightFromSettings(e);return t=Handsontable.hooks.run(m,"modifyRowHeight",t,e)},this.countSourceRows=function(){return m.getSourceData()?m.getSourceData().length:0},this.countRows=function(){return d.getLength()},this.countCols=function(){return"object"===m.dataType||"function"===m.dataType?c.settings.columns&&c.settings.columns.length?c.settings.columns.length:d.colToPropCache.length:"array"===m.dataType?c.settings.columns&&c.settings.columns.length?c.settings.columns.length:c.settings.data&&c.settings.data[0]&&c.settings.data[0].length?c.settings.data[0].length:0:void 0},this.getColspanOffset=function(e,t){var n=0;if(m.colspanArray){for(var o=0;e>o;o++)n+=m.colspanArray[t][o]-1||0;return n}for(var n=0,r=m.view.wt.wtTable.THEAD.childNodes.length-t-1,i=m.view.wt.wtTable.THEAD.querySelector("tr:nth-child("+parseInt(r+1,10)+")"),s=m.view.wt.wtSettings.settings.rowHeaders().length,o=s;s+e>o;o++)i.childNodes[o].hasAttribute("colspan")&&(n+=parseInt(i.childNodes[o].getAttribute("colspan"),10)-1);return n},this.getHeaderColspan=function(e,t){var n=m.view.wt.wtTable.THEAD.childNodes.length-t-1,o=m.view.wt.wtSettings.settings.rowHeaders().length,r=m.view.wt.wtTable.THEAD.querySelector("tr:nth-child("+parseInt(n+1,10)+")"),i=o+e-m.view.wt.wtViewport.columnsRenderCalculator.startColumn;return r.childNodes[i].hasAttribute("colspan")?parseInt(r.childNodes[i].getAttribute("colspan"),10):0},this.rowOffset=function(){return m.view.wt.wtTable.getFirstRenderedRow()},this.colOffset=function(){return m.view.wt.wtTable.getFirstRenderedColumn()},this.countRenderedRows=function(){return m.view.wt.drawn?m.view.wt.wtTable.getRenderedRowsCount():-1},this.countVisibleRows=function(){return m.view.wt.drawn?m.view.wt.wtTable.getVisibleRowsCount():-1},this.countRenderedCols=function(){return m.view.wt.drawn?m.view.wt.wtTable.getRenderedColumnsCount():-1},this.countVisibleCols=function(){return m.view.wt.drawn?m.view.wt.wtTable.getVisibleColumnsCount():-1},this.countEmptyRows=function(e){for(var t,n=m.countRows()-1,o=0;n>=0;){if(t=Handsontable.hooks.run(this,"modifyRow",n),m.isEmptyRow(t))o++;else if(e)break;n--}return o},this.countEmptyCols=function(e){if(m.countRows()<1)return 0;for(var t=m.countCols()-1,n=0;t>=0;){if(m.isEmptyCol(t))n++;else if(e)break;t--}return n},this.isEmptyRow=function(e){return c.settings.isEmptyRow.call(m,e)},this.isEmptyCol=function(e){return c.settings.isEmptyCol.call(m,e)},this.selectCell=function(e,t,n,o,r,i){var s;if(i="undefined"==typeof i||i===!0,"number"!=typeof e||0>e||e>=m.countRows())return!1;if("number"!=typeof t||0>t||t>=m.countCols())return!1;if("undefined"!=typeof n){if("number"!=typeof n||0>n||n>=m.countRows())return!1;if("number"!=typeof o||0>o||o>=m.countCols())return!1}return s=new q(e,t),c.selRange=new Q(s,s,s),i&&m.listen(),"undefined"==typeof n?g.setRangeEnd(c.selRange.from,r):g.setRangeEnd(new q(n,o),r),m.selection.finish(),!0},this.selectCellByProp=function(e,t,n,o,r){return arguments[1]=d.propToCol(arguments[1]),"undefined"!=typeof arguments[3]&&(arguments[3]=d.propToCol(arguments[3])),m.selectCell.apply(m,arguments)},this.deselectCell=function(){g.deselect()},this.destroy=function(){m._clearTimeouts(),m.view&&m.view.destroy(),h&&h.destroy(),h=null,T(m.rootElement),v.destroy(),Handsontable.hooks.run(m,"afterDestroy"),Handsontable.hooks.destroy(m);for(var e in m)m.hasOwnProperty(e)&&("function"==typeof m[e]?m[e]=u:"guid"!==e&&(m[e]=null));c=null,d=null,f=null,g=null,p=null,m=null,w=null},this.getActiveEditor=function(){return p.getActiveEditor()},this.getPlugin=function(e){return B(this,e)},this.getInstance=function(){return m},this.addHook=function(e,t){Handsontable.hooks.add(e,t,m)},this.hasHook=function(e){return Handsontable.hooks.has(e,m)},this.addHookOnce=function(e,t){ -Handsontable.hooks.once(e,t,m)},this.removeHook=function(e,t){Handsontable.hooks.remove(e,t,m)},this.runHooks=function(e,t,n,o,r,i,s){return Handsontable.hooks.run(m,e,t,n,o,r,i,s)},this.timeouts=[],this._registerTimeout=function(e){this.timeouts.push(e)},this._clearTimeouts=function(){for(var e=0,t=this.timeouts.length;t>e;e++)clearTimeout(this.timeouts[e])},this.version=Handsontable.version,Handsontable.hooks.run(m,"construct")};var Z=function(){};Z.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:!1,customBorders:!1,minRows:0,minCols:0,maxRows:1/0,maxCols:1/0,minSpareRows:0,minSpareCols:0,allowInsertRow:!0,allowInsertColumn:!0,allowRemoveRow:!0,allowRemoveColumn:!0,multiSelect:!0,fillHandle:!0,fixedRowsTop:0,fixedRowsBottom:0,fixedColumnsLeft:0,outsideClickDeselects:!0,enterBeginsEditing:!0,enterMoves:{row:1,col:0},tabMoves:{row:0,col:1},autoWrapRow:!1,autoWrapCol:!1,copyRowsLimit:1e3,copyColsLimit:1e3,pasteMode:"overwrite",persistentState:void 0,currentRowClassName:void 0,currentColClassName:void 0,className:void 0,tableClassName:void 0,stretchH:"none",isEmptyRow:function(e){var t,n,o,r;for(t=0,n=this.countCols();n>t;t++)if(o=this.getDataAtCell(e,t),""!==o&&null!==o&&"undefined"!=typeof o)return"object"==typeof o?(r=this.getCellMeta(e,t),N(this.getSchema()[r.prop],o)):!1;return!0},isEmptyCol:function(e){var t,n,o;for(t=0,n=this.countRows();n>t;t++)if(o=this.getDataAtCell(t,e),""!==o&&null!==o&&"undefined"!=typeof o)return!1;return!0},observeDOMVisibility:!0,allowInvalid:!0,allowEmpty:!0,invalidCellClassName:"htInvalid",placeholder:!1,placeholderCellClassName:"htPlaceholder",readOnlyCellClassName:"htDimmed",renderer:void 0,commentedCellClassName:"htCommentCell",fragmentSelection:!1,readOnly:!1,skipColumnOnPaste:!1,search:!1,type:"text",copyable:!0,editor:void 0,autoComplete:void 0,visibleRows:10,trimDropdown:!0,debug:!1,wordWrap:!0,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:!1,viewportRowRenderingOffset:"auto",viewportColumnRenderingOffset:"auto",validator:void 0,disableVisualSelection:!1,sortIndicator:void 0,manualColumnFreeze:void 0,trimWhitespace:!0,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:!1,defaultDate:void 0,strict:void 0,renderAllRows:void 0,preventOverflow:!1,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,observeChanges:void 0},Handsontable.DefaultSettings=Z},{"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:90,tableView:99}],26:[function(e,t,n){"use strict";function o(e,t,n){this.instance=e,this.priv=t,this.GridSettings=n,this.dataSource=this.instance.getSettings().data,this.dataSource[0]?this.duckSchema=this.recursiveDuckSchema(this.dataSource[0]):this.duckSchema={},this.createMap()}Object.defineProperties(n,{DataMap:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,l,a,u,c,d=(r=e("SheetClip"),r&&r.__esModule&&r||{"default":r})["default"],h=(i=e("helpers/data"),i&&i.__esModule&&i||{"default":i}).cellMethodLookupFactory,f=(s=e("helpers/setting"),s&&s.__esModule&&s||{"default":s}).columnFactory,g=(l=e("helpers/object"),l&&l.__esModule&&l||{"default":l}),p=g.duckSchema,m=g.deepExtend,w=(a=e("helpers/array"),a&&a.__esModule&&a||{"default":a}),v=w.extendArray,b=w.to2dArray,C=(u=e("helpers/number"),u&&u.__esModule&&u||{"default":u}).rangeEach,y=(c=e("multiMap"),c&&c.__esModule&&c||{"default":c}).MultiMap;o.prototype.DESTINATION_RENDERER=1,o.prototype.DESTINATION_CLIPBOARD_GENERATOR=2,o.prototype.recursiveDuckSchema=function(e){return p(e)},o.prototype.recursiveDuckColumns=function(e,t,n){var o,r;if("undefined"==typeof t&&(t=0,n=""),"object"==typeof e&&!Array.isArray(e))for(r in e)e.hasOwnProperty(r)&&(null===e[r]?(o=n+r,this.colToPropCache.push(o),this.propToColCache.set(o,t),t++):t=this.recursiveDuckColumns(e[r],t,r+"."));return t},o.prototype.createMap=function(){var e,t,n=this.getSchema();if("undefined"==typeof n)throw new Error("trying to create `columns` definition but you didnt' provide `schema` nor `data`");this.colToPropCache=[],this.propToColCache=new y;var o=this.instance.getSettings().columns;if(o)for(e=0,t=o.length;t>e;e++)"undefined"!=typeof o[e].data&&(this.colToPropCache[e]=o[e].data,this.propToColCache.set(o[e].data,e));else this.recursiveDuckColumns(n)},o.prototype.colToProp=function(e){return e=Handsontable.hooks.run(this.instance,"modifyCol",e),this.colToPropCache&&"undefined"!=typeof this.colToPropCache[e]?this.colToPropCache[e]:e},o.prototype.propToCol=function(e){var t;return t="undefined"==typeof this.propToColCache.get(e)?e:this.propToColCache.get(e),t=Handsontable.hooks.run(this.instance,"modifyCol",t)},o.prototype.getSchema=function(){var e=this.instance.getSettings().dataSchema;return e?"function"==typeof e?e():e:this.duckSchema},o.prototype.createRow=function(e,t,n){var o,r,i=this.instance.countCols(),s=0;t||(t=1),("number"!=typeof e||e>=this.instance.countSourceRows())&&(e=this.instance.countSourceRows()),r=e;for(var l=this.instance.getSettings().maxRows;t>s&&this.instance.countSourceRows()a;a++)o.push(null)}else"function"===this.instance.dataType?o=this.instance.getSettings().dataSchema(e):(o={},m(o,this.getSchema()));e===this.instance.countSourceRows()?this.dataSource.push(o):this.dataSource.splice(e,0,o),s++,r++}return Handsontable.hooks.run(this.instance,"afterCreateRow",e,s,n),this.instance.forceFullRender=!0,s},o.prototype.createCol=function(e,t,n){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 o,r,i=this.instance.countSourceRows(),s=this.dataSource,l=0;t||(t=1),r=e;for(var a=this.instance.getSettings().maxCols;t>l&&this.instance.countCols()=this.instance.countCols()){for(var u=0;i>u;u++)"undefined"==typeof s[u]&&(s[u]=[]),s[u].push(null);this.priv.columnSettings.push(o)}else{for(var u=0;i>u;u++)s[u].splice(r,0,null);this.priv.columnSettings.splice(r,0,o)}l++,r++}return Handsontable.hooks.run(this.instance,"afterCreateCol",e,l,n),this.instance.forceFullRender=!0,l},o.prototype.removeRow=function(e,t){t||(t=1),"number"!=typeof e&&(e=-t),e=(this.instance.countSourceRows()+e)%this.instance.countSourceRows();var n=this.physicalRowsToLogical(e,t),o=Handsontable.hooks.run(this.instance,"beforeRemoveRow",e,t,n);if(o!==!1){var r=this.dataSource,i=r.filter(function(e,t){return-1==n.indexOf(t)});r.length=0,Array.prototype.push.apply(r,i),Handsontable.hooks.run(this.instance,"afterRemoveRow",e,t,n),this.instance.forceFullRender=!0}},o.prototype.removeCol=function(e,t){if("object"===this.instance.dataType||this.instance.getSettings().columns)throw new Error("cannot remove column with object data source or columns option specified");t||(t=1),"number"!=typeof e&&(e=-t),e=(this.instance.countCols()+e)%this.instance.countCols();var n=Handsontable.hooks.run(this.instance,"beforeRemoveCol",e,t);if(n!==!1){for(var o=this.dataSource,r=0,i=this.instance.countSourceRows();i>r;r++)o[r].splice(e,t);this.priv.columnSettings.splice(e,t),Handsontable.hooks.run(this.instance,"afterRemoveCol",e,t),this.instance.forceFullRender=!0}},o.prototype.spliceCol=function(e,t,n){var o=4<=arguments.length?[].slice.call(arguments,3):[],r=this.instance.getDataAtCol(e),i=r.slice(t,t+n),s=r.slice(t+n);v(o,s);for(var l=0;n>l;)o.push(null),l++;return b(o),this.instance.populateFromArray(t,e,o,null,null,"spliceCol"),i},o.prototype.spliceRow=function(e,t,n){var o=4<=arguments.length?[].slice.call(arguments,3):[],r=this.instance.getSourceDataAtRow(e),i=r.slice(t,t+n),s=r.slice(t+n);v(o,s);for(var l=0;n>l;)o.push(null),l++;return this.instance.populateFromArray(e,t,[o],null,null,"spliceRow"),i},o.prototype.get=function(e,t){e=Handsontable.hooks.run(this.instance,"modifyRow",e);var n=this.dataSource[e];if(n&&n.hasOwnProperty&&n.hasOwnProperty(t))return n[t];if("string"==typeof t&&t.indexOf(".")>-1){var o=t.split("."),r=n;if(!r)return null;for(var i=0,s=o.length;s>i;i++)if(r=r[o[i]],"undefined"==typeof r)return null;return r}return"function"==typeof t?t(this.dataSource.slice(e,e+1)[0]):null};var R=h("copyable",!1);o.prototype.getCopyable=function(e,t){return R.call(this.instance,e,this.propToCol(t))?this.get(e,t):""},o.prototype.set=function(e,t,n,o){e=Handsontable.hooks.run(this.instance,"modifyRow",e,o||"datamapGet");var r=this.dataSource[e];if(r&&r.hasOwnProperty&&r.hasOwnProperty(t))r[t]=n;else if("string"==typeof t&&t.indexOf(".")>-1){for(var i=t.split("."),s=r,l=0,a=i.length-1;a>l;l++)"undefined"==typeof s[i[l]]&&(s[i[l]]={}),s=s[i[l]];s[i[l]]=n}else"function"==typeof t?t(this.dataSource.slice(e,e+1)[0],n):r[t]=n},o.prototype.physicalRowsToLogical=function(e,t){for(var n,o=this.instance.countSourceRows(),r=(o+e)%o,i=[],s=t;o>r&&s;)n=Handsontable.hooks.run(this.instance,"modifyRow",r),i.push(n),s--,r++;return i},o.prototype.clear=function(){for(var e=0;e=o;o++){l=[];var c=Handsontable.hooks.run(this.instance,"modifyRow",o);for(i=Math.min(e.col,t.col);s>=i;i++){if(null===c)break;l.push(u.call(this,o,this.colToProp(i)))}null!==c&&a.push(l)}return a},o.prototype.getText=function(e,t){return d.stringify(this.getRange(e,t,this.DESTINATION_RENDERER))},o.prototype.getCopyableText=function(e,t){return d.stringify(this.getRange(e,t,this.DESTINATION_CLIPBOARD_GENERATOR))},Handsontable.DataMap=o},{SheetClip:"SheetClip","helpers/array":42,"helpers/data":44,"helpers/number":49,"helpers/object":50,"helpers/setting":51,multiMap:55}],27:[function(e,t,n){"use strict";Object.defineProperties(n,{DataSource:{get:function(){return f}},__esModule:{value:!0}});var o,r,i,s,l,a=((o=e("helpers/data"),o&&o.__esModule&&o||{"default":o}).cellMethodLookupFactory,(r=e("helpers/setting"),r&&r.__esModule&&r||{"default":r}).columnFactory,i=e("helpers/object"),i&&i.__esModule&&i||{"default":i}),u=(a.duckSchema,a.deepExtend,a.getProperty),c=(s=e("helpers/array"),s&&s.__esModule&&s||{"default":s}),d=(c.extendArray,c.arrayEach),h=(l=e("helpers/number"),l&&l.__esModule&&l||{"default":l}).rangeEach,f=function(e){var t=void 0!==arguments[1]?arguments[1]:[];this.hot=e,this.data=t,this.dataType="array",this.colToProp=function(){},this.propToCol=function(){}};$traceurRuntime.createClass(f,{getData:function(){return this.data},setData:function(e){this.data=e},getAtColumn:function(e){var t=this,n=[];return d(this.data,function(o){var r=t.colToProp(e);o="string"==typeof r?u(o,r):o[r],n.push(o)}),n},getAtRow:function(e){return this.data[e]},getAtCell:function(e,t){return this.data[e][this.colToProp(t)]},getByRange:function(e,t){var n=this,o=Math.min(e.row,t.row),r=Math.min(e.col,t.col),i=Math.max(e.row,t.row),s=Math.max(e.col,t.col),l=[];return h(o,i,function(e){var t,o=n.getAtRow(e);"array"===n.dataType?t=o.slice(r,s):"object"===n.dataType&&(t={},h(r,s,function(e){var r=n.colToProp(e);t[r]=o[r]})),l.push(t)}),l},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(e,t,n){"use strict";function o(e,t,n){function o(e){var o="function"==typeof t.settings.enterMoves?t.settings.enterMoves(event):t.settings.enterMoves;e?n.transformStart(-o.row,-o.col):n.transformStart(o.row,o.col,!0)}function r(e){e?n.transformEnd(-1,0):n.transformStart(-1,0)}function i(e){e?n.transformEnd(1,0):n.transformStart(1,0)}function s(e){e?n.transformEnd(0,1):n.transformStart(0,1)}function l(e){e?n.transformEnd(0,-1):n.transformStart(0,-1)}function a(a){var c,g;if(e.isListening()&&(Handsontable.hooks.run(e,"beforeKeyDown",a),!y&&!w(a)&&(t.lastKeyCode=a.keyCode,n.isSelected()))){if(c=(a.ctrlKey||a.metaKey)&&!a.altKey,b&&!b.isWaiting()&&!(h(a.keyCode)||f(a.keyCode)||c||C.isEditorOpened()))return void C.openEditor("",a);switch(g=a.shiftKey?n.setRangeEnd:n.setRangeStart,a.keyCode){case d.A:!C.isEditorOpened()&&c&&(n.selectAll(),a.preventDefault(),p(a));break;case d.ARROW_UP:C.isEditorOpened()&&!b.isWaiting()&&C.closeEditorAndSaveChanges(c),r(a.shiftKey),a.preventDefault(),p(a);break;case d.ARROW_DOWN:C.isEditorOpened()&&!b.isWaiting()&&C.closeEditorAndSaveChanges(c),i(a.shiftKey),a.preventDefault(),p(a);break;case d.ARROW_RIGHT:C.isEditorOpened()&&!b.isWaiting()&&C.closeEditorAndSaveChanges(c),s(a.shiftKey),a.preventDefault(),p(a);break;case d.ARROW_LEFT:C.isEditorOpened()&&!b.isWaiting()&&C.closeEditorAndSaveChanges(c),l(a.shiftKey),a.preventDefault(),p(a);break;case d.TAB:var v="function"==typeof t.settings.tabMoves?t.settings.tabMoves(a):t.settings.tabMoves;a.shiftKey?n.transformStart(-v.row,-v.col):n.transformStart(v.row,v.col,!0),a.preventDefault(),p(a);break;case d.BACKSPACE:case d.DELETE:n.empty(a),C.prepareEditor(),a.preventDefault();break;case d.F2:C.openEditor(null,a),b&&b.enableFullEditMode(),a.preventDefault();break;case d.ENTER:C.isEditorOpened()?(b&&b.state!==Handsontable.EditorState.WAITING&&C.closeEditorAndSaveChanges(c),o(a.shiftKey)):e.getSettings().enterBeginsEditing?(C.openEditor(null,a),b&&b.enableFullEditMode()):o(a.shiftKey),a.preventDefault(),m(a);break;case d.ESCAPE:C.isEditorOpened()&&C.closeEditorAndRestoreOriginalValue(c),a.preventDefault();break;case d.HOME:g(a.ctrlKey||a.metaKey?new u(0,t.selRange.from.col):new u(t.selRange.from.row,0)),a.preventDefault(),p(a);break;case d.END:g(a.ctrlKey||a.metaKey?new u(e.countRows()-1,t.selRange.from.col):new u(t.selRange.from.row,e.countCols()-1)),a.preventDefault(),p(a);break;case d.PAGE_UP:n.transformStart(-e.countVisibleRows(),0),a.preventDefault(),p(a);break;case d.PAGE_DOWN:n.transformStart(e.countVisibleRows(),0),a.preventDefault(),p(a)}}}function c(){function t(e,t,n){"TD"==n.nodeName&&(C.openEditor(),b&&b.enableFullEditMode())}e.addHook("afterDocumentKeyDown",a),g.addEventListener(document.documentElement,"keydown",function(t){e.runHooks("afterDocumentKeyDown",t)}),e.view.wt.update("onCellDblClick",t),e.addHook("afterDestroy",function(){y=!0})}var g,b,C=this,y=!1;g=v(e),this.destroyEditor=function(e){this.closeEditor(e)},this.getActiveEditor=function(){return b},this.prepareEditor=function(){var n,o,r,i,s,l,a;return b&&b.isWaiting()?void this.closeEditor(!1,!1,function(e){e&&C.prepareEditor()}):(n=t.selRange.highlight.row,o=t.selRange.highlight.col,r=e.colToProp(o),i=e.getCell(n,o),s=e.getDataAtCell(n,o),l=e.getCellMeta(n,o),a=e.getCellEditor(l),void(a?(b=Handsontable.editors.getEditor(a,e),b.prepare(n,o,r,i,s,l)):b=void 0))},this.isEditorOpened=function(){return b&&b.isOpened()},this.openEditor=function(e,t){b&&!b.cellProperties.readOnly?b.beginEditing(e,t):b&&b.cellProperties.readOnly&&t&&t.keyCode===d.ENTER&&o()},this.closeEditor=function(e,t,n){b?b.finishEditing(e,t,n):n&&n(!1)},this.closeEditorAndSaveChanges=function(e){return this.closeEditor(!1,e)},this.closeEditorAndRestoreOriginalValue=function(e){return this.closeEditor(!0,e)},c()}Object.defineProperties(n,{EditorManager:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,l,a,u=(r=e("3rdparty/walkontable/src/cell/coords"),r&&r.__esModule&&r||{"default":r}).WalkontableCellCoords,c=(i=e("helpers/unicode"),i&&i.__esModule&&i||{"default":i}),d=c.KEY_CODES,h=c.isMetaKey,f=c.isCtrlKey,g=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),p=g.stopPropagation,m=g.stopImmediatePropagation,w=g.isImmediatePropagationStopped,v=((l=e("editors"),l&&l.__esModule&&l||{"default":l}).getEditor,(a=e("eventManager"),a&&a.__esModule&&a||{"default":a}).eventManager);Handsontable.EditorManager=o},{"3rdparty/walkontable/src/cell/coords":5,editors:29,eventManager:41,"helpers/dom/event":46,"helpers/unicode":53}],29:[function(e,t,n){"use strict";function o(e){var t,n;n={},t=e,this.getConstructor=function(){return e},this.getInstance=function(e){return e.guid in n||(n[e.guid]=new t(e)),n[e.guid]}}function r(e,t){var n=new o(t);"string"==typeof e&&(c[e]=n,Handsontable.editors[u(e)+"Editor"]=t),d.set(t,n)}function i(e,t){var n;if("function"==typeof e)d.get(e)||r(null,e),n=d.get(e);else{if("string"!=typeof e)throw Error('Only strings and functions can be passed as "editor" parameter ');n=c[e]}if(!n)throw Error('No editor registered under name "'+e+'"');return n.getInstance(t)}function s(e){var t;if("string"!=typeof e)throw Error('Only strings and functions can be passed as "editor" parameter ');if(t=c[e],!t)throw Error('No editor registered under name "'+e+'"');return t.getConstructor()}function l(e){return c[e]?!0:!1}Object.defineProperties(n,{registerEditor:{get:function(){return r}},getEditor:{get:function(){return i}},hasEditor:{get:function(){return l}},getEditorConstructor:{get:function(){return s}},__esModule:{value:!0}});var a,u=(a=e("helpers/string"),a&&a.__esModule&&a||{"default":a}).toUpperCaseFirst,c={},d=new WeakMap;Handsontable.editors=Handsontable.editors||{},Handsontable.editors.registerEditor=r,Handsontable.editors.getEditor=i},{"helpers/string":52}],30:[function(e,t,n){"use strict";function o(e){this.instance=e,this.state=Handsontable.EditorState.VIRGIN,this._opened=!1,this._fullEditMode=!1,this._closeCallback=null,this.init()}Object.defineProperties(n,{BaseEditor:{get:function(){return o}},__esModule:{value:!0}});var r,i,s=(r=e("helpers/mixed"),r&&r.__esModule&&r||{"default":r}).stringify,l=(i=e("3rdparty/walkontable/src/cell/coords"),i&&i.__esModule&&i||{"default":i}).WalkontableCellCoords;Handsontable.editors=Handsontable.editors||{},Handsontable.editors.BaseEditor=o,Handsontable.EditorState={VIRGIN:"STATE_VIRGIN",EDITING:"STATE_EDITING",WAITING:"STATE_WAITING",FINISHED:"STATE_FINISHED"},o.prototype._fireCallbacks=function(e){this._closeCallback&&(this._closeCallback(e),this._closeCallback=null)},o.prototype.init=function(){},o.prototype.getValue=function(){throw Error("Editor getValue() method unimplemented")},o.prototype.setValue=function(e){throw Error("Editor setValue() method unimplemented")},o.prototype.open=function(){throw Error("Editor open() method unimplemented")},o.prototype.close=function(){throw Error("Editor close() method unimplemented")},o.prototype.prepare=function(e,t,n,o,r,i){this.TD=o,this.row=e,this.col=t,this.prop=n,this.originalValue=r,this.cellProperties=i,this.instance.view.isMouseDown()&&document.activeElement&&document.activeElement!==document.body?document.activeElement.blur():document.activeElement||document.body.focus(),this.state=Handsontable.EditorState.VIRGIN},o.prototype.extend=function(){function e(){n.apply(this,arguments)}function t(e,t){function n(){}return n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e,e}var n=this.constructor;return t(e,n)},o.prototype.saveValue=function(e,t){var n,o;t?(n=this.instance.getSelected(),n[0]>n[2]&&(o=n[0],n[0]=n[2],n[2]=o),n[1]>n[3]&&(o=n[1],n[1]=n[3],n[3]=o),this.instance.populateFromArray(n[0],n[1],e,n[2],n[3],"edit")):this.instance.populateFromArray(this.row,this.col,e,null,null,"edit")},o.prototype.beginEditing=function(e,t){this.state==Handsontable.EditorState.VIRGIN&&(this.instance.view.scrollViewport(new l(this.row,this.col)),this.instance.view.render(),this.state=Handsontable.EditorState.EDITING,e="string"==typeof e?e:this.originalValue,this.setValue(s(e)),this.open(t),this._opened=!0,this.focus(),this.instance.view.render())},o.prototype.finishEditing=function(e,t,n){var o,r=this;if(n){var i=this._closeCallback;this._closeCallback=function(e){i&&i(e),n(e)}}if(!this.isWaiting()){if(this.state==Handsontable.EditorState.VIRGIN)return void this.instance._registerTimeout(setTimeout(function(){r._fireCallbacks(!0)},0));if(this.state==Handsontable.EditorState.EDITING){if(e)return this.cancelChanges(),void this.instance.view.render();var s=this.getValue();o=this.instance.getSettings().trimWhitespace?[["string"==typeof s?String.prototype.trim.call(s||""):s]]:[[s]],this.state=Handsontable.EditorState.WAITING,this.saveValue(o,t),this.instance.getCellValidator(this.cellProperties)?this.instance.addHookOnce("postAfterValidate",function(e){r.state=Handsontable.EditorState.FINISHED,r.discardEditor(e)}):(this.state=Handsontable.EditorState.FINISHED,this.discardEditor(!0))}}},o.prototype.cancelChanges=function(){this.state=Handsontable.EditorState.FINISHED,this.discardEditor()},o.prototype.discardEditor=function(e){this.state===Handsontable.EditorState.FINISHED&&(e===!1&&this.cellProperties.allowInvalid!==!0?(this.instance.selectCell(this.row,this.col),this.focus(),this.state=Handsontable.EditorState.EDITING,this._fireCallbacks(!1)):(this.close(),this._opened=!1,this._fullEditMode=!1,this.state=Handsontable.EditorState.VIRGIN,this._fireCallbacks(!0)))},o.prototype.enableFullEditMode=function(){this._fullEditMode=!0},o.prototype.isInFullEditMode=function(){return this._fullEditMode},o.prototype.isOpened=function(){return this._opened},o.prototype.isWaiting=function(){return this.state===Handsontable.EditorState.WAITING},o.prototype.checkEditorSection=function(){var e=this.instance.countRows(),t="";return this.row=e-this.instance.getSettings().fixedRowsBottom?t=this.col"+l+"")))},autoColumnSize:!0,modifyColWidth:function(e,t){var o=this.getPlugin("autoColumnSize").widths;return o[t]&&(e=o[t]),n?e:e+15}}),this.htEditor.view.wt.wtTable.holder.parentNode.style["padding-right"]=v()+2+"px",O&&(O=!1),t.instance._registerTimeout(setTimeout(function(){t.queryChoices(t.TEXTAREA.value)},0))},T.prototype.close=function(){E.prototype.close.apply(this,arguments)},T.prototype.queryChoices=function(e){if(this.query=e,"function"==typeof this.cellProperties.source){var t=this;this.cellProperties.source(e,function(e){t.updateChoicesList(e)})}else if(Array.isArray(this.cellProperties.source)){var n;if(e&&this.cellProperties.filter!==!1){var o=this.cellProperties.filteringCaseSensitive===!0,r=e.toLowerCase();n=this.cellProperties.source.filter(function(t){return o?-1!=t.indexOf(e):-1!=t.toLowerCase().indexOf(r)})}else n=this.cellProperties.source;this.updateChoicesList(n)}else this.updateChoicesList([])},T.prototype.updateChoicesList=function(e){var t,n=w(this.TEXTAREA),o=b(this.TEXTAREA),r=T.sortByRelevance(this.getValue(),e,this.cellProperties.filteringCaseSensitive);if(0==this.cellProperties.filter)t=r[0];else{for(var i=[],s=0,l=r.length;l>s;s++)i.push(e[r[s]]);t=0,e=i}this.choices=e,this.htEditor.loadData(g([e])),this.updateDropdownHeight(),this.cellProperties.strict===!0&&this.highlightBestMatchingChoice(t),this.instance.listen(),this.TEXTAREA.focus(),y(this.TEXTAREA,n,n==o?void 0:o)},T.prototype.updateDropdownHeight=function(){var e=this.htEditor.getColWidth(0)+v()+2,t=void 0===this.cellProperties.trimDropdown?!0:this.cellProperties.trimDropdown;this.htEditor.updateSettings({height:this.getDropdownHeight(),width:t?void 0:e}),this.htEditor.view.wt.wtTable.alignOverlaysWithTrimmingContainer()},T.prototype.finishEditing=function(e){e||this.instance.removeHook("beforeKeyDown",o),E.prototype.finishEditing.apply(this,arguments)},T.prototype.highlightBestMatchingChoice=function(e){"number"==typeof e?this.htEditor.selectCell(e,0):this.htEditor.deselectCell()},T.sortByRelevance=function(e,t,n){var o,r,i,s,l,a=[],u=e.length,c=[];if(0===u){for(s=0,l=t.length;l>s;s++)c.push(s);return c}for(s=0,l=t.length;l>s;s++)o=f(t[s]),r=n?o.indexOf(e):o.toLowerCase().indexOf(e.toLowerCase()),-1!=r&&(i=o.length-r-u,a.push({baseIndex:s,index:r,charsLeft:i,value:o}));for(a.sort(function(e,t){return-1===t.index?-1:-1===e.index?1:e.indext.charsLeft?1:0:void 0}),s=0,l=a.length;l>s;s++)c.push(a[s].baseIndex);return c},T.prototype.getDropdownHeight=function(){var e=this.htEditor.getInstance().getRowHeight(0)||23,t=this.cellProperties.visibleRows;return this.choices.length>=t?t*e:this.choices.length*e+8},T.prototype.allowKeyEventPropagation=function(e){var t={row:this.htEditor.getSelectedRange()?this.htEditor.getSelectedRange().from.row:-1},n=!1;return e===d.ARROW_DOWN&&t.row-1&&(n=!0),n},S("autocomplete",T)},{editors:29,handsontableEditor:35,"helpers/array":42,"helpers/dom/element":45,"helpers/mixed":48,"helpers/unicode":53}],32:[function(e,t,n){"use strict";Object.defineProperties(n,{CheckboxEditor:{get:function(){return u}},__esModule:{value:!0}});var o,r,i,s=(o=e("editors"),o&&o.__esModule&&o||{"default":o}).registerEditor,l=(r=e("_baseEditor"),r&&r.__esModule&&r||{"default":r}).BaseEditor,a=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}).hasClass,u=function(){$traceurRuntime.superConstructor(c).apply(this,arguments)},c=u;$traceurRuntime.createClass(u,{beginEditing:function(){var e=this.TD.querySelector('input[type="checkbox"]');a(e,"htBadValue")||e.click()},finishEditing:function(){},init:function(){},open:function(){},close:function(){},getValue:function(){},setValue:function(){},focus:function(){}},{},l),s("checkbox",u)},{_baseEditor:30,editors:29,"helpers/dom/element":45}],33:[function(e,t,n){"use strict";Object.defineProperties(n,{DateEditor:{get:function(){return E}},__esModule:{value:!0}});var o,r,i,s,l,a,u,c,d,h=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),f=h.addClass,g=h.outerHeight,p=(r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}).deepExtend,m=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).EventManager,w=(s=e("editors"),s&&s.__esModule&&s||{"default":s}),v=(w.getEditor,w.registerEditor),b=(l=e("helpers/unicode"),l&&l.__esModule&&l||{"default":l}).isMetaKey,C=(a=e("helpers/dom/event"),a&&a.__esModule&&a||{"default":a}).stopPropagation,y=(u=e("textEditor"),u&&u.__esModule&&u||{"default":u}).TextEditor,R=(c=e("moment"),c&&c.__esModule&&c||{"default":c})["default"],S=(d=e("pikaday"),d&&d.__esModule&&d||{"default":d})["default"];Handsontable.editors=Handsontable.editors||{},Handsontable.editors.DateEditor=E;var E=function(e){this.$datePicker=null,this.datePicker=null,this.datePickerStyle=null,this.defaultDateFormat="DD/MM/YYYY",this.isCellEdited=!1,this.parentDestroyed=!1,$traceurRuntime.superConstructor(T).call(this,e)},T=E;$traceurRuntime.createClass(E,{init:function(){var e=this;if("function"!=typeof R)throw new Error("You need to include moment.js to your project.");if("function"!=typeof S)throw new Error("You need to include Pikaday to your project.");$traceurRuntime.superGet(this,T.prototype,"init").call(this),this.instance.addHook("afterDestroy",function(){e.parentDestroyed=!0,e.destroyElements()})},createElements:function(){$traceurRuntime.superGet(this,T.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,f(this.datePicker,"htDatepickerHolder"),document.body.appendChild(this.datePicker),this.$datePicker=new S(this.getDatePickerConfig());var e=new m(this);e.addEventListener(this.datePicker,"mousedown",function(e){return C(e)}),this.hideDatepicker()},destroyElements:function(){this.$datePicker.destroy()},prepare:function(e,t,n,o,r,i){this._opened=!1,$traceurRuntime.superGet(this,T.prototype,"prepare").call(this,e,t,n,o,r,i)},open:function(){var e=void 0!==arguments[0]?arguments[0]:null;$traceurRuntime.superGet(this,T.prototype,"open").call(this),this.showDatepicker(e)},close:function(){var e=this;this._opened=!1,this.instance._registerTimeout(setTimeout(function(){e.instance.selection.refreshBorders(); -},0)),$traceurRuntime.superGet(this,T.prototype,"close").call(this)},finishEditing:function(){var e=void 0!==arguments[0]?arguments[0]:!1,t=void 0!==arguments[1]?arguments[1]:!1;if(e){var n=this.originalValue;void 0!==n&&this.setValue(n)}this.hideDatepicker(),$traceurRuntime.superGet(this,T.prototype,"finishEditing").call(this,e,t)},showDatepicker:function(e){this.$datePicker.config(this.getDatePickerConfig());var t,n=this.TD.getBoundingClientRect(),o=this.cellProperties.dateFormat||this.defaultDateFormat,r=this.$datePicker.config(),i=this.instance.view.isMouseDown(),s=e?b(e.keyCode):!1;this.datePickerStyle.top=window.pageYOffset+n.top+g(this.TD)+"px",this.datePickerStyle.left=window.pageXOffset+n.left+"px",this.$datePicker._onInputFocus=function(){},r.format=o,this.originalValue?(t=this.originalValue,R(t,o,!0).isValid()&&this.$datePicker.setMoment(R(t,o),!0),s||i||this.setValue("")):this.cellProperties.defaultDate?(t=this.cellProperties.defaultDate,r.defaultDate=t,R(t,o,!0).isValid()&&this.$datePicker.setMoment(R(t,o),!0),s||i||this.setValue("")):this.$datePicker.gotoToday(),this.datePickerStyle.display="block",this.$datePicker.show()},hideDatepicker:function(){this.datePickerStyle.display="none",this.$datePicker.hide()},getDatePickerConfig:function(){var e=this,t=this.TEXTAREA,n={};this.cellProperties&&this.cellProperties.datePickerConfig&&p(n,this.cellProperties.datePickerConfig);var o=n.onSelect,r=n.onClose;return n.field=t,n.trigger=t,n.container=this.datePicker,n.bound=!1,n.format=n.format||this.defaultDateFormat,n.reposition=n.reposition||!1,n.onSelect=function(t){isNaN(t.getTime())||(t=R(t).format(e.cellProperties.dateFormat||e.defaultDateFormat)),e.setValue(t),e.hideDatepicker(),o&&o()},n.onClose=function(){e.parentDestroyed||e.finishEditing(!1),r&&r()},n}},{},y),v("date",E)},{editors:29,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/object":50,"helpers/unicode":53,moment:void 0,pikaday:void 0,textEditor:40}],34:[function(e,t,n){"use strict";Object.defineProperties(n,{DropdownEditor:{get:function(){return a}},__esModule:{value:!0}});var o,r,i=(o=e("editors"),o&&o.__esModule&&o||{"default":o}),s=(i.getEditor,i.registerEditor),l=(r=e("autocompleteEditor"),r&&r.__esModule&&r||{"default":r}).AutocompleteEditor,a=function(){$traceurRuntime.superConstructor(u).apply(this,arguments)},u=a;$traceurRuntime.createClass(a,{prepare:function(e,t,n,o,r,i){$traceurRuntime.superGet(this,u.prototype,"prepare").call(this,e,t,n,o,r,i),this.cellProperties.filter=!1,this.cellProperties.strict=!0}},{},l),Handsontable.hooks.add("beforeValidate",function(e,t,n,o){var r=this.getCellMeta(t,n);r.editor===Handsontable.editors.DropdownEditor&&void 0===r.strict&&(r.filter=!1,r.strict=!0)}),s("dropdown",a)},{autocompleteEditor:31,editors:29}],35:[function(e,t,n){"use strict";Object.defineProperties(n,{HandsontableEditor:{get:function(){return v}},__esModule:{value:!0}});var o,r,i,s,l,a,u=(o=e("helpers/unicode"),o&&o.__esModule&&o||{"default":o}).KEY_CODES,c=(r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}).extend,d=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}).setCaretPosition,h=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),f=h.stopImmediatePropagation,g=h.isImmediatePropagationStopped,p=(l=e("editors"),l&&l.__esModule&&l||{"default":l}),m=(p.getEditor,p.registerEditor),w=(a=e("textEditor"),a&&a.__esModule&&a||{"default":a}).TextEditor,v=w.prototype.extend();v.prototype.createElements=function(){w.prototype.createElements.apply(this,arguments);var e=document.createElement("DIV");e.className="handsontableEditor",this.TEXTAREA_PARENT.appendChild(e),this.htContainer=e,this.assignHooks()},v.prototype.prepare=function(e,t,n,o,r,i){w.prototype.prepare.apply(this,arguments);var s=this,l={startRows:0,startCols:0,minRows:0,minCols:0,className:"listbox",copyPaste:!1,autoColumnSize:!1,autoRowSize:!1,readOnly:!0,fillHandle:!1,afterOnCellMouseDown:function(){var e=this.getValue();void 0!==e&&s.setValue(e),s.instance.destroyEditor()}};this.cellProperties.handsontable&&c(l,i.handsontable),this.htOptions=l};var b=function(e){if(!g(e)){var t,n=this.getActiveEditor(),o=n.htEditor.getInstance();if(e.keyCode==u.ARROW_DOWN)if(o.getSelected()){var r=o.getSelected()[0],i=o.countRows()-1;t=Math.min(i,r+1)}else t=0;else if(e.keyCode==u.ARROW_UP&&o.getSelected()){var r=o.getSelected()[0];t=r-1}void 0!==t&&(0>t?o.deselectCell():o.selectCell(t,0),o.getData().length&&(e.preventDefault(),f(e),n.instance.listen(),n.TEXTAREA.focus()))}};v.prototype.open=function(){this.instance.addHook("beforeKeyDown",b),w.prototype.open.apply(this,arguments),this.htEditor&&this.htEditor.destroy(),this.htEditor=new Handsontable(this.htContainer,this.htOptions),this.cellProperties.strict?(this.htEditor.selectCell(0,0),this.TEXTAREA.style.visibility="hidden"):(this.htEditor.deselectCell(),this.TEXTAREA.style.visibility="visible"),d(this.TEXTAREA,0,this.TEXTAREA.value.length)},v.prototype.close=function(){this.instance.removeHook("beforeKeyDown",b),this.instance.listen(),w.prototype.close.apply(this,arguments)},v.prototype.focus=function(){this.instance.listen(),w.prototype.focus.apply(this,arguments)},v.prototype.beginEditing=function(e){var t=this.instance.getSettings().onBeginEditing;t&&t()===!1||w.prototype.beginEditing.apply(this,arguments)},v.prototype.finishEditing=function(e,t){if(this.htEditor&&this.htEditor.isListening()&&this.instance.listen(),this.htEditor&&this.htEditor.getSelected()){var n=this.htEditor.getInstance().getValue();void 0!==n&&this.setValue(n)}return w.prototype.finishEditing.apply(this,arguments)},v.prototype.assignHooks=function(){var e=this;this.instance.addHook("afterDestroy",function(){e.htEditor&&e.htEditor.destroy()})},m("handsontable",v)},{editors:29,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/object":50,"helpers/unicode":53,textEditor:40}],36:[function(e,t,n){"use strict";Object.defineProperties(n,{MobileTextEditor:{get:function(){return M}},__esModule:{value:!0}});var o,r,i,s,l,a,u=(o=e("helpers/unicode"),o&&o.__esModule&&o||{"default":o}).KEY_CODES,c=(r=e("helpers/dom/event"),r&&r.__esModule&&r||{"default":r}),d=c.stopImmediatePropagation,h=c.isImmediatePropagationStopped,f=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),g=f.addClass,p=f.getScrollLeft,m=f.getScrollTop,w=f.hasClass,v=f.isChildOf,b=f.offset,C=f.outerHeight,y=f.outerWidth,R=f.removeClass,S=f.setCaretPosition,E=(s=e("editors"),s&&s.__esModule&&s||{"default":s}),T=(E.getEditor,E.registerEditor),O=(l=e("_baseEditor"),l&&l.__esModule&&l||{"default":l}).BaseEditor,_=(a=e("eventManager"),a&&a.__esModule&&a||{"default":a}).eventManager,M=O.prototype.extend(),H={},k=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 e in this.controls)this.controls.hasOwnProperty(e)&&this.positionControls.appendChild(this.controls[e])};M.prototype.valueChanged=function(){return this.initValue!=this.getValue()},M.prototype.init=function(){var e=this;this.eventManager=_(this.instance),this.createElements(),this.bindEvents(),this.instance.addHook("afterDestroy",function(){e.destroy()})},M.prototype.getValue=function(){return this.TEXTAREA.value},M.prototype.setValue=function(e){this.initValue=e,this.TEXTAREA.value=e},M.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"),g(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),k.call(this),document.body.appendChild(this.editorContainer)},M.prototype.onBeforeKeyDown=function(e){var t=this,n=t.getActiveEditor();if(e.target===n.TEXTAREA&&!h(e))switch(e.keyCode){case u.ENTER:n.close(),e.preventDefault();break;case u.BACKSPACE:d(e)}},M.prototype.open=function(){this.instance.addHook("beforeKeyDown",this.onBeforeKeyDown),g(this.editorContainer,"active"),R(this.cellPointer,"hidden"),this.updateEditorPosition()},M.prototype.focus=function(){this.TEXTAREA.focus(),S(this.TEXTAREA,this.TEXTAREA.value.length)},M.prototype.close=function(){this.TEXTAREA.blur(),this.instance.removeHook("beforeKeyDown",this.onBeforeKeyDown),R(this.editorContainer,"active")},M.prototype.scrollToView=function(){var e=this.instance.getSelectedRange().highlight;this.instance.view.scrollViewport(e)},M.prototype.hideCellPointer=function(){w(this.cellPointer,"hidden")||g(this.cellPointer,"hidden")},M.prototype.updateEditorPosition=function(e,t){if(e&&t)e=parseInt(e,10),t=parseInt(t,10),this.editorContainer.style.top=t+"px",this.editorContainer.style.left=e+"px";else{var n=this.instance.getSelected(),o=this.instance.getCell(n[0],n[1]);if(H.cellPointer||(H.cellPointer={height:C(this.cellPointer),width:y(this.cellPointer)}),H.editorContainer||(H.editorContainer={width:y(this.editorContainer)}),void 0!==o){var r=this.instance.view.wt.wtOverlays.leftOverlay.trimmingContainer==window?0:p(this.instance.view.wt.wtOverlays.leftOverlay.holder),i=this.instance.view.wt.wtOverlays.topOverlay.trimmingContainer==window?0:m(this.instance.view.wt.wtOverlays.topOverlay.holder),s=b(o),l=y(o),a={x:r,y:i};this.editorContainer.style.top=parseInt(s.top+C(o)-a.y+H.cellPointer.height,10)+"px",this.editorContainer.style.left=parseInt(window.innerWidth/2-H.editorContainer.width/2,10)+"px",s.left+l/2>parseInt(this.editorContainer.style.left,10)+H.editorContainer.width?this.editorContainer.style.left=window.innerWidth-H.editorContainer.width+"px":s.left+l/2n;n++)t[e[n]]=e[n];else"object"==typeof e&&(t=e);return t},E.prototype.getValue=function(){return this.select.value},E.prototype.setValue=function(e){this.select.value=e};var T=function(e){var t=this,n=t.getActiveEditor();switch(e.keyCode){case C.ARROW_UP:var o=n.select.selectedIndex-1;o>=0&&(n.select[o].selected=!0),b(e),e.preventDefault();break;case C.ARROW_DOWN:var r=n.select.selectedIndex+1;r<=n.select.length-1&&(n.select[r].selected=!0),b(e),e.preventDefault()}};E.prototype.open=function(){this._opened=!0,this.refreshDimensions(),this.select.style.display="",this.instance.addHook("beforeKeyDown",T)},E.prototype.close=function(){this._opened=!1,this.select.style.display="none",this.instance.removeHook("beforeKeyDown",T)},E.prototype.focus=function(){this.select.focus()},E.prototype.refreshDimensions=function(){if(this.state===Handsontable.EditorState.EDITING){if(this.TD=this.getEditedCell(),!this.TD)return void this.close();var e,t=w(this.TD)+1,n=m(this.TD)+1,o=p(this.TD),r=p(this.instance.rootElement),i=g(this.TD),s=o.top-r.top-1-(i.scrollTop||0),l=o.left-r.left-1-(i.scrollLeft||0),a=this.checkEditorSection(),u=this.instance.getSettings();u.rowHeaders?1:0,u.colHeaders?1:0;switch(a){case"top":e=f(this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.holder.parentNode);break;case"left":e=f(this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.holder.parentNode);break;case"top-left-corner":e=f(this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.holder.parentNode);break;case"bottom-left-corner":e=f(this.instance.view.wt.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.holder.parentNode);break;case"bottom":e=f(this.instance.view.wt.wtOverlays.bottomOverlay.clone.wtTable.holder.parentNode)}0===this.instance.getSelected()[0]&&(s+=1),0===this.instance.getSelected()[1]&&(l+=1);var c=this.select.style;e&&-1!=e?c[e[0]]=e[1]:v(this.select);var d=h(this.TD);parseInt(d.borderTopWidth,10)>0&&(n-=1),parseInt(d.borderLeftWidth,10)>0&&(t-=1),c.height=n+"px",c.minWidth=t+"px",c.top=s+"px",c.left=l+"px",c.margin="0px"}},E.prototype.getEditedCell=function(){var e,t=this.checkEditorSection();switch(t){case"top":e=this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.select.style.zIndex=101;break;case"corner":e=this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.select.style.zIndex=103;break;case"left":e=this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.select.style.zIndex=102;break;default:e=this.instance.getCell(this.row,this.col),this.select.style.zIndex=""}return-1!=e&&-2!=e?e:void 0},R("select",E)},{_baseEditor:30,editors:29,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/unicode":53}],40:[function(e,t,n){"use strict";Object.defineProperties(n,{TextEditor:{get:function(){return x}},__esModule:{value:!0}});var o,r,i,s,l,a,u,c=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),d=c.addClass,h=c.getCaretPosition,f=c.getComputedStyle,g=c.getCssTransform,p=c.getScrollableElement,m=c.getScrollbarWidth,w=c.innerWidth,v=c.offset,b=c.resetCssTransform,C=c.setCaretPosition,y=c.hasVerticalScrollbar,R=c.hasHorizontalScrollbar,S=(r=e("autoResize"),r&&r.__esModule&&r||{"default":r})["default"],E=(i=e("_baseEditor"),i&&i.__esModule&&i||{"default":i}).BaseEditor,T=(s=e("eventManager"),s&&s.__esModule&&s||{"default":s}).eventManager,O=(l=e("editors"),l&&l.__esModule&&l||{"default":l}),_=(O.getEditor,O.registerEditor),M=(a=e("helpers/unicode"),a&&a.__esModule&&a||{"default":a}).KEY_CODES,H=(u=e("helpers/dom/event"),u&&u.__esModule&&u||{"default":u}),k=H.stopPropagation,A=H.stopImmediatePropagation,P=H.isImmediatePropagationStopped,x=E.prototype.extend();x.prototype.init=function(){var e=this;this.createElements(),this.eventManager=T(this),this.bindEvents(),this.autoResize=S(),this.instance.addHook("afterDestroy",function(){e.destroy()})},x.prototype.getValue=function(){return this.TEXTAREA.value},x.prototype.setValue=function(e){this.TEXTAREA.value=e};var D=function(e){var t,n=this,o=n.getActiveEditor();if(t=(e.ctrlKey||e.metaKey)&&!e.altKey,e.target===o.TEXTAREA&&!P(e)){if(17===e.keyCode||224===e.keyCode||91===e.keyCode||93===e.keyCode)return void A(e);switch(e.keyCode){case M.ARROW_RIGHT:o.isInFullEditMode()&&(!o.isWaiting()&&!o.allowKeyEventPropagation||!o.isWaiting()&&o.allowKeyEventPropagation&&!o.allowKeyEventPropagation(e.keyCode))&&A(e);break;case M.ARROW_LEFT:o.isInFullEditMode()&&(!o.isWaiting()&&!o.allowKeyEventPropagation||!o.isWaiting()&&o.allowKeyEventPropagation&&!o.allowKeyEventPropagation(e.keyCode))&&A(e);break;case M.ARROW_UP:case M.ARROW_DOWN:o.isInFullEditMode()&&(!o.isWaiting()&&!o.allowKeyEventPropagation||!o.isWaiting()&&o.allowKeyEventPropagation&&!o.allowKeyEventPropagation(e.keyCode))&&A(e);break;case M.ENTER:var r=o.instance.getSelected(),i=!(r[0]===r[2]&&r[1]===r[3]);if(t&&!i||e.altKey){if(o.isOpened()){var s=h(o.TEXTAREA),l=o.getValue(),a=l.slice(0,s)+"\n"+l.slice(s);o.setValue(a),C(o.TEXTAREA,s+1)}else o.beginEditing(o.originalValue+"\n");A(e)}e.preventDefault();break;case M.A:case M.X:case M.C:case M.V:t&&A(e);break;case M.BACKSPACE:case M.DELETE:case M.HOME:case M.END:A(e)}-1===[M.ARROW_UP,M.ARROW_RIGHT,M.ARROW_DOWN,M.ARROW_LEFT].indexOf(e.keyCode)&&o.autoResize.resize(String.fromCharCode(e.keyCode))}};x.prototype.open=function(){this.refreshDimensions(),this.instance.addHook("beforeKeyDown",D)},x.prototype.close=function(e){this.textareaParentStyle.display="none",this.autoResize.unObserve(),document.activeElement===this.TEXTAREA&&this.instance.listen(),this.instance.removeHook("beforeKeyDown",D)},x.prototype.focus=function(){this.TEXTAREA.focus(),C(this.TEXTAREA,this.TEXTAREA.value.length)},x.prototype.createElements=function(){this.TEXTAREA=document.createElement("TEXTAREA"),d(this.TEXTAREA,"handsontableInput"),this.textareaStyle=this.TEXTAREA.style,this.textareaStyle.width=0,this.textareaStyle.height=0,this.TEXTAREA_PARENT=document.createElement("DIV"),d(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 e=this;this.instance._registerTimeout(setTimeout(function(){e.refreshDimensions()},0))},x.prototype.getEditedCell=function(){var e,t=this.checkEditorSection();switch(t){case"top":e=this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.textareaParentStyle.zIndex=101;break;case"top-left-corner":e=this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.textareaParentStyle.zIndex=103;break;case"bottom-left-corner":e=this.instance.view.wt.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.textareaParentStyle.zIndex=103;break;case"left":e=this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.textareaParentStyle.zIndex=102;break;case"bottom":e=this.instance.view.wt.wtOverlays.bottomOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.textareaParentStyle.zIndex=102;break;default:e=this.instance.getCell(this.row,this.col),this.textareaParentStyle.zIndex=""}return-1!=e&&-2!=e?e:void 0},x.prototype.refreshDimensions=function(){if(this.state===Handsontable.EditorState.EDITING){if(this.TD=this.getEditedCell(),!this.TD)return void this.close(!0);var e,t=v(this.TD),n=v(this.instance.rootElement),o=p(this.TD),r=this.instance.countRows(),i=t.top-n.top-1-(o.scrollTop||0),s=t.left-n.left-1-(o.scrollLeft||0),l=this.instance.getSettings(),a=(this.instance.hasRowHeaders(),this.instance.hasColHeaders()),u=this.checkEditorSection(),c=this.TD.style.backgroundColor;switch(u){case"top":e=g(this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.holder.parentNode);break;case"left":e=g(this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.holder.parentNode);break;case"top-left-corner":e=g(this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.holder.parentNode);break;case"bottom-left-corner":e=g(this.instance.view.wt.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.holder.parentNode);break;case"bottom":e=g(this.instance.view.wt.wtOverlays.bottomOverlay.clone.wtTable.holder.parentNode)}(a&&0===this.instance.getSelected()[0]||l.fixedRowsBottom&&this.instance.getSelected()[0]===r-l.fixedRowsBottom)&&(i+=1),0===this.instance.getSelected()[1]&&(s+=1),e&&-1!=e?this.textareaParentStyle[e[0]]=e[1]:b(this.textareaParentStyle),this.textareaParentStyle.top=i+"px",this.textareaParentStyle.left=s+"px";var d=this.instance.view.wt.wtViewport.rowsRenderCalculator.startPosition,h=this.instance.view.wt.wtViewport.columnsRenderCalculator.startPosition,C=this.instance.view.wt.wtOverlays.leftOverlay.getScrollPosition(),S=this.instance.view.wt.wtOverlays.topOverlay.getScrollPosition(),E=m(),T=this.TD.offsetTop+d-S,O=this.TD.offsetLeft+h-C,_=w(this.TD)-8,M=y(o)?E:0,H=R(o)?E:0,k=this.instance.view.maximumVisibleElementWidth(O)-9-M,A=this.TD.scrollHeight+1,P=Math.max(this.instance.view.maximumVisibleElementHeight(T)-H,23),x=f(this.TD);this.TEXTAREA.style.fontSize=x.fontSize,this.TEXTAREA.style.fontFamily=x.fontFamily,this.TEXTAREA.style.backgroundColor="",this.TEXTAREA.style.backgroundColor=c?c:f(this.TEXTAREA).backgroundColor,this.autoResize.init(this.TEXTAREA,{minHeight:Math.min(A,P),maxHeight:P,minWidth:Math.min(_,k),maxWidth:k},!0),this.textareaParentStyle.display="block"}},x.prototype.bindEvents=function(){var e=this;this.eventManager.addEventListener(this.TEXTAREA,"cut",function(e){k(e)}),this.eventManager.addEventListener(this.TEXTAREA,"paste",function(e){k(e)}),this.instance.addHook("afterScrollHorizontally",function(){e.refreshDimensions()}),this.instance.addHook("afterScrollVertically",function(){e.refreshDimensions()}),this.instance.addHook("afterColumnResize",function(){e.refreshDimensions(),e.focus()}),this.instance.addHook("afterRowResize",function(){e.refreshDimensions(),e.focus()}),this.instance.addHook("afterDestroy",function(){e.eventManager.destroy()})},x.prototype.destroy=function(){this.eventManager.destroy()},_("text",x)},{_baseEditor:30,autoResize:"autoResize",editors:29,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/unicode":53}],41:[function(e,t,n){"use strict";function o(e,t){var n,o,r,i,s,l,a="HOT-TABLE";if(t.isTargetWebComponent=!1,t.realTarget=t.target,l=t.stopImmediatePropagation,t.stopImmediatePropagation=function(){l.apply(this),h(this)},!Handsontable.eventManager.isHotTableEnv)return t;for(t=u(t),s=t.path?t.path.length:0;s--;){if(t.path[s].nodeName===a)n=!0;else if(n&&t.path[s].shadowRoot){i=t.path[s];break}0!==s||i||(i=t.path[s])}return i||(i=t.target),t.isTargetWebComponent=!0,d()?t.realTarget=t.srcElement||t.toElement:(e instanceof Handsontable.Core||e instanceof Walkontable)&&(e instanceof Handsontable.Core?o=e.view?e.view.wt.wtTable.TABLE:null:e instanceof Walkontable&&(o=e.wtTable.TABLE.parentNode.parentNode),r=c(t.target,[a],o),r?t.realTarget=o.querySelector(a)||t.target:t.realTarget=t.target),Object.defineProperty(t,"target",{get:function(){return u(i)},enumerable:!0,configurable:!0}),t}function r(e){return new f(e)}Object.defineProperties(n,{EventManager:{get:function(){return f}},eventManager:{get:function(){return r}},__esModule:{value:!0}});var i,s,l,a=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),u=a.polymerWrap,c=a.closest,d=(s=e("helpers/browser"),s&&s.__esModule&&s||{"default":s}).isWebComponentSupportedNatively,h=(l=e("helpers/dom/event"),l&&l.__esModule&&l||{"default":l}).stopImmediatePropagation,f=function(){var e=void 0!==arguments[0]?arguments[0]:null;this.context=e||this,this.context.eventListeners||(this.context.eventListeners=[])};$traceurRuntime.createClass(f,{addEventListener:function(e,t,n){function r(e){void 0==e.target&&void 0!=e.srcElement&&(e.definePoperty?e.definePoperty("target",{value:e.srcElement}):e.target=e.srcElement),void 0==e.preventDefault&&(e.definePoperty?e.definePoperty("preventDefault",{value:function(){this.returnValue=!1}}):e.preventDefault=function(){this.returnValue=!1}),e=o(s,e),n.call(this,e)}var i=this,s=this.context;return this.context.eventListeners.push({element:e,event:t,callback:n,callbackProxy:r}),window.addEventListener?e.addEventListener(t,r,!1):e.attachEvent("on"+t,r),Handsontable.countEventManagerListeners++,function(){i.removeEventListener(e,t,n)}},removeEventListener:function(e,t,n){for(var o,r=this.context.eventListeners.length;r--;)if(o=this.context.eventListeners[r],o.event==t&&o.element==e){if(n&&n!=o.callback)continue;this.context.eventListeners.splice(r,1),o.element.removeEventListener?o.element.removeEventListener(o.event,o.callbackProxy,!1):o.element.detachEvent("on"+o.event,o.callbackProxy),Handsontable.countEventManagerListeners--}},clearEvents:function(){if(this.context)for(var e=this.context.eventListeners.length;e--;){var t=this.context.eventListeners[e];t&&this.removeEventListener(t.element,t.event,t.callback)}},clear:function(){this.clearEvents()},destroy:function(){this.clearEvents(),this.context=null},fireEvent:function(e,t){var n,o={bubbles:!0,cancelable:"mousemove"!==t,view:window,detail:0,screenX:0,screenY:0,clientX:1,clientY:1,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:void 0};document.createEvent?(n=document.createEvent("MouseEvents"),n.initMouseEvent(t,o.bubbles,o.cancelable,o.view,o.detail,o.screenX,o.screenY,o.clientX,o.clientY,o.ctrlKey,o.altKey,o.shiftKey,o.metaKey,o.button,o.relatedTarget||document.body.parentNode)):n=document.createEventObject(),e.dispatchEvent?e.dispatchEvent(n):e.fireEvent("on"+t,n)}},{}),window.Handsontable=window.Handsontable||{},Handsontable.countEventManagerListeners=0,Handsontable.eventManager=r},{"helpers/browser":43,"helpers/dom/element":45,"helpers/dom/event":46}],42:[function(e,t,n){"use strict";function o(e){for(var t=0,n=e.length;n>t;)e[t]=[e[t]],t++}function r(e,t){for(var n=0,o=t.length;o>n;)e.push(t[n]),n++}function i(e){var t=[];if(!e||0===e.length||!e[0]||0===e[0].length)return t;for(var n=e.length,o=e[0].length,r=0;n>r;r++)for(var i=0;o>i;i++)t[i]||(t[i]=[]),t[i][r]=e[r][i];return t}function s(e,t,n,o){var r=-1,i=e.length;for(o&&i&&(n=e[++r]);++rt?e:t},Array.isArray(e)?e[0]:void 0)}function h(e){return s(e,function(e,t){return t>e?e:t},Array.isArray(e)?e[0]:void 0)}function f(e){return e.length?c(e)/e.length:0}function g(e){return s(e,function(e,t){return e.concat(Array.isArray(t)?g(t):t)},[])}function p(e){var t=[];return u(e,function(e){-1===t.indexOf(e)&&t.push(e)}),t}Object.defineProperties(n,{to2dArray:{get:function(){return o}},extendArray:{get:function(){return r}},pivot:{get:function(){return i}},arrayReduce:{get:function(){return s}},arrayFilter:{get:function(){return l; -}},arrayMap:{get:function(){return a}},arrayEach:{get:function(){return u}},arraySum:{get:function(){return c}},arrayMax:{get:function(){return d}},arrayMin:{get:function(){return h}},arrayAvg:{get:function(){return f}},arrayFlatten:{get:function(){return g}},arrayUnique:{get:function(){return p}},__esModule:{value:!0}})},{}],43:[function(e,t,n){"use strict";function o(){return f}function r(){return g}function i(){return p}function s(){return m}function l(e){return e||(e=navigator.userAgent),/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(e)}function a(){return"ontouchstart"in window}function u(){var e=document.createElement("div");return e.createShadowRoot&&e.createShadowRoot.toString().match(/\[native code\]/)?!0:!1}function c(){var e=document.createElement("TABLE");e.style.borderSpacing=0,e.style.borderWidth=0,e.style.padding=0;var t=document.createElement("TBODY");e.appendChild(t),t.appendChild(document.createElement("TR")),t.firstChild.appendChild(document.createElement("TD")),t.firstChild.firstChild.innerHTML="t
t";var n=document.createElement("CAPTION");n.innerHTML="c
c
c
c",n.style.padding=0,n.style.margin=0,e.insertBefore(n,t),document.body.appendChild(e),h=e.offsetHeight<2*e.lastChild.offsetHeight,document.body.removeChild(e)}function d(){return void 0===h&&c(),h}Object.defineProperties(n,{isIE8:{get:function(){return o}},isIE9:{get:function(){return r}},isSafari:{get:function(){return i}},isChrome:{get:function(){return s}},isMobileBrowser:{get:function(){return l}},isTouchSupported:{get:function(){return a}},isWebComponentSupportedNatively:{get:function(){return u}},hasCaptionProblem:{get:function(){return d}},__esModule:{value:!0}});var h,f=!document.createTextNode("test").textContent,g=!!document.documentMode,p=/Safari/.test(navigator.userAgent)&&/Apple Computer/.test(navigator.vendor),m=/Chrome/.test(navigator.userAgent)&&/Google/.test(navigator.vendor)},{}],44:[function(e,t,n){"use strict";function o(e){for(var t,n=e+1,o="";n>0;)t=(n-1)%26,o=String.fromCharCode(65+t)+o,n=parseInt((n-t)/26,10);return o}function r(e,t){e="number"==typeof e?e:100,t="number"==typeof t?t:4;var n,r,i=[];for(n=0;e>n;n++){var s=[];for(r=0;t>r;r++)s.push(o(r)+(n+1));i.push(s)}return i}function i(e,t){e="number"==typeof e?e:100,t="number"==typeof t?t:4;var n,r,i=[];for(n=0;e>n;n++){var s={};for(r=0;t>r;r++)s["prop"+r]=o(r)+(n+1);i.push(s)}return i}function s(e,t){for(var n,o=[],r=0;e>r;r++){n=[];for(var i=0;t>i;i++)n.push("");o.push(n)}return o}function l(e){var t,n,o,r,i=[],s=0;for(t=0,n=e.length;n>t;t++)for(o=0,r=e[t].length;r>o;o++)o==s&&(i.push([]),s++),i[o].push(e[t][o]);return i}function a(e,t){function n(e){var t=Handsontable.cellTypes[e];if("undefined"==typeof t)throw new Error('You declared cell type "'+e+'" 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 t}return t="undefined"==typeof t?!0:t,function(o,r){return function i(o){if(o){if(o.hasOwnProperty(e)&&void 0!==o[e])return o[e];if(o.hasOwnProperty("type")&&o.type){var r;if("string"!=typeof o.type)throw new Error("Cell type must be a string ");if(r=n(o.type),r.hasOwnProperty(e))return r[e];if(t)return}return i(c(o))}}("number"==typeof o?this.getCellMeta(o,r):o)}}Object.defineProperties(n,{spreadsheetColumnLabel:{get:function(){return o}},createSpreadsheetData:{get:function(){return r}},createSpreadsheetObjectData:{get:function(){return i}},createEmptySpreadsheetData:{get:function(){return s}},translateRowsToColumns:{get:function(){return l}},cellMethodLookupFactory:{get:function(){return a}},__esModule:{value:!0}});var u,c=(u=e("object"),u&&u.__esModule&&u||{"default":u}).getPrototypeOf},{object:50}],45:[function(e,t,n){"use strict";function o(e,t,n){for(;null!=e&&e!==n;){if(e.nodeType===Node.ELEMENT_NODE&&(t.indexOf(e.nodeName)>-1||t.indexOf(e)>-1))return e;e=e.host&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE?e.host:e.parentNode}return null}function r(e,t){var n=e.parentNode,o=[];for("string"==typeof t?o=Array.prototype.slice.call(document.querySelectorAll(t),0):o.push(t);null!=n;){if(o.indexOf(n)>-1)return!0;n=n.parentNode}return!1}function i(e){function t(e){return e.nodeType===Node.ELEMENT_NODE&&e.nodeName===o.toUpperCase()}var n,o="hot-table",r=!1;for(n=s(e);null!=n;){if(t(n)){r=!0;break}if(n.host&&n.nodeType===Node.DOCUMENT_FRAGMENT_NODE){if(r=t(n.host))break;n=n.host}n=n.parentNode}return r}function s(e){return"undefined"!=typeof Polymer&&"function"==typeof wrap?wrap(e):e}function l(e){return"undefined"!=typeof Polymer&&"function"==typeof unwrap?unwrap(e):e}function a(e){var t=0;if(e.previousSibling)for(;e=e.previousSibling;)++t;return t}function u(e,t){var n=document.querySelector(".ht_clone_"+e);return n?n.contains(t):null}function c(e){var t=0,n=[];if(!e||!e.length)return n;for(;e[t];)n.push(e[t]),t++;return n}function d(e,t){return q(e,t)}function h(e,t){return Q(e,t)}function f(e,t){return J(e,t)}function g(e,t){if(3===e.nodeType)t.removeChild(e);else if(["TABLE","THEAD","TBODY","TFOOT","TR"].indexOf(e.nodeName)>-1)for(var n=e.childNodes,o=n.length-1;o>=0;o--)g(n[o],e)}function p(e){for(var t;t=e.lastChild;)e.removeChild(t)}function m(e,t){ae.test(t)?e.innerHTML=t:w(e,t)}function w(e,t){var n=e.firstChild;n&&3===n.nodeType&&null===n.nextSibling?ue?n.textContent=t:n.data=t:(p(e),e.appendChild(document.createTextNode(t)))}function v(e){for(var t=e;l(t)!==document.documentElement;){if(null===t)return!1;if(t.nodeType===Node.DOCUMENT_FRAGMENT_NODE){if(t.host){if(t.host.impl)return v(t.host.impl);if(t.host)return v(t.host);throw new Error("Lost in Web Components world")}return!1}if("none"===t.style.display)return!1;t=t.parentNode}return!0}function b(e){var t,n,o,r,i;if(r=document.documentElement,oe()&&e.firstChild&&"CAPTION"===e.firstChild.nodeName)return i=e.getBoundingClientRect(),{top:i.top+(window.pageYOffset||r.scrollTop)-(r.clientTop||0),left:i.left+(window.pageXOffset||r.scrollLeft)-(r.clientLeft||0)};for(t=e.offsetLeft,n=e.offsetTop,o=e;(e=e.offsetParent)&&e!==document.body;)t+=e.offsetLeft,n+=e.offsetTop,o=e;return o&&"fixed"===o.style.position&&(t+=window.pageXOffset||r.scrollLeft,n+=window.pageYOffset||r.scrollTop),{left:t,top:n}}function C(){var e=window.scrollY;return void 0===e&&(e=document.documentElement.scrollTop),e}function y(){var e=window.scrollX;return void 0===e&&(e=document.documentElement.scrollLeft),e}function R(e){return e===window?C():e.scrollTop}function S(e){return e===window?y():e.scrollLeft}function E(e){for(var t,n,o,r=e.parentNode,i=["auto","scroll"],s="",l="",a="",u="";r&&r.style&&document.body!==r;){if(t=r.style.overflow,n=r.style.overflowX,o=r.style.overflowY,"scroll"==t||"scroll"==n||"scroll"==o)return r;if(window.getComputedStyle&&(s=window.getComputedStyle(r),l=s.getPropertyValue("overflow"),a=s.getPropertyValue("overflow-y"),u=s.getPropertyValue("overflow-x"),"scroll"===l||"scroll"===u||"scroll"===a))return r;if(r.clientHeight<=r.scrollHeight&&(-1!==i.indexOf(o)||-1!==i.indexOf(t)||-1!==i.indexOf(l)||-1!==i.indexOf(a)))return r;if(r.clientWidth<=r.scrollWidth&&(-1!==i.indexOf(n)||-1!==i.indexOf(t)||-1!==i.indexOf(l)||-1!==i.indexOf(u)))return r;r=r.parentNode}return window}function T(e){for(var t=e.parentNode;t&&t.style&&document.body!==t;){if("visible"!==t.style.overflow&&""!==t.style.overflow)return t;if(window.getComputedStyle){var n=window.getComputedStyle(t);if("visible"!==n.getPropertyValue("overflow")&&""!==n.getPropertyValue("overflow"))return t}t=t.parentNode}return window}function O(e,t){if(e){if(e!==window){var n,o=e.style[t];return""!==o&&void 0!==o?o:(n=_(e),""!==n[t]&&void 0!==n[t]?n[t]:void 0)}if("width"===t)return window.innerWidth+"px";if("height"===t)return window.innerHeight+"px"}}function _(e){return e.currentStyle||document.defaultView.getComputedStyle(e)}function M(e){return e.offsetWidth}function H(e){return oe()&&e.firstChild&&"CAPTION"===e.firstChild.nodeName?e.offsetHeight+e.firstChild.offsetHeight:e.offsetHeight}function k(e){return e.clientHeight||e.innerHeight}function A(e){return e.clientWidth||e.innerWidth}function P(e,t,n){window.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)}function x(e,t,n){window.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent("on"+t,n)}function D(e){if(e.selectionStart)return e.selectionStart;if(document.selection){e.focus();var t=document.selection.createRange();if(null==t)return 0;var n=e.createTextRange(),o=n.duplicate();return n.moveToBookmark(t.getBookmark()),o.setEndPoint("EndToStart",n),o.text.length}return 0}function N(e){if(e.selectionEnd)return e.selectionEnd;if(document.selection){var t=document.selection.createRange();if(null==t)return 0;var n=e.createTextRange();return n.text.indexOf(t.text)+t.text.length}}function L(){var e="";return window.getSelection?e=window.getSelection().toString():document.selection&&"Control"!==document.selection.type&&(e=document.selection.createRange().text),e}function W(e,t,n){if(void 0===n&&(n=t),e.setSelectionRange){e.focus();try{e.setSelectionRange(t,n)}catch(o){var r=e.parentNode,i=r.style.display;r.style.display="block",e.setSelectionRange(t,n),r.style.display=i}}else if(e.createTextRange){var s=e.createTextRange();s.collapse(!0),s.moveEnd("character",n),s.moveStart("character",t),s.select()}}function I(){var e=document.createElement("p");e.style.width="100%",e.style.height="200px";var t=document.createElement("div");t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.visibility="hidden",t.style.width="200px",t.style.height="150px",t.style.overflow="hidden",t.appendChild(e),(document.body||document.documentElement).appendChild(t);var n=e.offsetWidth;t.style.overflow="scroll";var o=e.offsetWidth;return n==o&&(o=t.clientWidth),(document.body||document.documentElement).removeChild(t),n-o}function j(){return void 0===le&&(le=I()),le}function B(e){return e.offsetWidth!==e.clientWidth}function V(e){return e.offsetHeight!==e.clientHeight}function F(e,t,n){ee()||te()?(e.style.top=n,e.style.left=t):ne()?e.style["-webkit-transform"]="translate3d("+t+","+n+",0)":e.style.transform="translate3d("+t+","+n+",0)"}function z(e){var t;return e.style.transform&&""!==(t=e.style.transform)?["transform",t]:e.style["-webkit-transform"]&&""!==(t=e.style["-webkit-transform"])?["-webkit-transform",t]:-1}function U(e){e.transform&&""!==e.transform?e.transform="":e["-webkit-transform"]&&""!==e["-webkit-transform"]&&(e["-webkit-transform"]="")}function G(e){var t=["INPUT","SELECT","TEXTAREA"];return e&&(t.indexOf(e.nodeName)>-1||"true"===e.contentEditable)}function $(e){return G(e)&&-1==e.className.indexOf("handsontableInput")&&-1==e.className.indexOf("copyPaste")}function K(e){return he.call(window,e)}function X(e){fe.call(window,e)}Object.defineProperties(n,{closest:{get:function(){return o}},isChildOf:{get:function(){return r}},isChildOfWebComponentTable:{get:function(){return i}},polymerWrap:{get:function(){return s}},polymerUnwrap:{get:function(){return l}},index:{get:function(){return a}},overlayContainsElement:{get:function(){return u}},hasClass:{get:function(){return d}},addClass:{get:function(){return h}},removeClass:{get:function(){return f}},removeTextNodes:{get:function(){return g}},empty:{get:function(){return p}},HTML_CHARACTERS:{get:function(){return ae}},fastInnerHTML:{get:function(){return m}},fastInnerText:{get:function(){return w}},isVisible:{get:function(){return v}},offset:{get:function(){return b}},getWindowScrollTop:{get:function(){return C}},getWindowScrollLeft:{get:function(){return y}},getScrollTop:{get:function(){return R}},getScrollLeft:{get:function(){return S}},getScrollableElement:{get:function(){return E}},getTrimmingContainer:{get:function(){return T}},getStyle:{get:function(){return O}},getComputedStyle:{get:function(){return _}},outerWidth:{get:function(){return M}},outerHeight:{get:function(){return H}},innerHeight:{get:function(){return k}},innerWidth:{get:function(){return A}},addEvent:{get:function(){return P}},removeEvent:{get:function(){return x}},getCaretPosition:{get:function(){return D}},getSelectionEndPosition:{get:function(){return N}},getSelectionText:{get:function(){return L}},setCaretPosition:{get:function(){return W}},getScrollbarWidth:{get:function(){return j}},hasVerticalScrollbar:{get:function(){return B}},hasHorizontalScrollbar:{get:function(){return V}},setOverlayPosition:{get:function(){return F}},getCssTransform:{get:function(){return z}},resetCssTransform:{get:function(){return U}},isInput:{get:function(){return G}},isOutsideInput:{get:function(){return $}},requestAnimationFrame:{get:function(){return K}},cancelAnimationFrame:{get:function(){return X}},__esModule:{value:!0}});var Y,q,Q,J,Z=(Y=e("../browser"),Y&&Y.__esModule&&Y||{"default":Y}),ee=Z.isIE8,te=Z.isIE9,ne=Z.isSafari,oe=Z.hasCaptionProblem,re=document.documentElement.classList?!0:!1;if(re){var ie=function(){var e=document.createElement("div");return e.classList.add("test","test2"),e.classList.contains("test2")}();q=function(e,t){return""===t?!1:e.classList.contains(t)},Q=function(e,t){var n=0;if("string"==typeof t&&(t=t.split(" ")),t=c(t),ie)e.classList.add.apply(e.classList,t);else for(;t&&t[n];)e.classList.add(t[n]),n++},J=function(e,t){var n=0;if("string"==typeof t&&(t=t.split(" ")),t=c(t),ie)e.classList.remove.apply(e.classList,t);else for(;t&&t[n];)e.classList.remove(t[n]),n++}}else{var se=function(e){return new RegExp("(\\s|^)"+e+"(\\s|$)")};q=function(e,t){return e.className.match(se(t))?!0:!1},Q=function(e,t){var n=0,o=e.className;if("string"==typeof t&&(t=t.split(" ")),""===o)o=t.join(" ");else for(;t&&t[n];)se(t[n]).test(o)||(o+=" "+t[n]),n++;e.className=o},J=function(e,t){var n=0,o=e.className;for("string"==typeof t&&(t=t.split(" "));t&&t[n];)o=o.replace(se(t[n])," ").trim(),n++;e.className!==o&&(e.className=o)}}for(var le,ae=/(<(.*)>|&(.*);)/,ue=document.createTextNode("test").textContent?!0:!1,ce=0,de=["ms","moz","webkit","o"],he=window.requestAnimationFrame,fe=window.cancelAnimationFrame,ge=0;ge=n?e.apply(this,l):t(l)}}var n=e.length;return t([])}function c(e){function t(o){return function(){for(var r=[],i=0;i=n?e.apply(this,l):t(l)}}var n=e.length;return t([])}Object.defineProperties(n,{proxy:{get:function(){return o}},throttle:{get:function(){return r}},throttleAfterHits:{get:function(){return i}},debounce:{get:function(){return s}},pipe:{get:function(){return l}},partial:{get:function(){return a}},curry:{get:function(){return u}},curryRight:{get:function(){return c}},__esModule:{value:!0}});var d,h=(d=e("array"),d&&d.__esModule&&d||{"default":d}).arrayReduce},{array:42}],48:[function(e,t,n){"use strict";function o(e){switch(typeof e){case"string":case"number":return e+"";case"object":return null===e?"":e.toString();case"undefined":return"";default:return e.toString()}}Object.defineProperties(n,{stringify:{get:function(){return o}},__esModule:{value:!0}})},{}],49:[function(e,t,n){"use strict";function o(e){var t=typeof e;return"number"==t?!isNaN(e)&&isFinite(e):"string"==t?e.length?1==e.length?/\d/.test(e):/^\s*[+-]?\s*(?:(?:\d+(?:\.\d+)?(?:e[+-]?\d+)?)|(?:0x[a-f\d]+))\s*$/i.test(e):!1:"object"==t?!(!e||"number"!=typeof e.valueOf()||e instanceof Date):!1}function r(e,t,n){var o=-1;for("function"==typeof t?(n=t,t=e):o=e-1;++o<=t&&n(o)!==!1;);}function i(e,t,n){var o=e+1;for("function"==typeof t&&(n=t,t=0);--o>=t&&n(o)!==!1;);}function s(e,t){return t=parseInt(t.toString().replace("%",""),10),t=parseInt(e*t/100)}Object.defineProperties(n,{isNumeric:{get:function(){return o}},rangeEach:{get:function(){return r}},rangeEachReverse:{get:function(){return i}},valueAccordingPercent:{get:function(){return s}},__esModule:{value:!0}})},{}],50:[function(e,t,n){"use strict";function o(e){var t;return Array.isArray(e)?t=[]:(t={},g(e,function(e,n){e&&"object"==typeof e&&!Array.isArray(e)?t[n]=o(e):Array.isArray(e)?e.length&&"object"==typeof e[0]&&!Array.isArray(e[0])?t[n]=[o(e[0])]:t[n]=[]:t[n]=null})),t}function r(e,t){return t.prototype.constructor=t,e.prototype=new t,e.prototype.constructor=e,e}function i(e,t){return g(t,function(t,n){e[n]=t}),e}function s(e,t){g(t,function(n,o){t[o]&&"object"==typeof t[o]?(e[o]||(Array.isArray(t[o])?e[o]=[]:"[object Date]"===Object.prototype.toString.call(t[o])?e[o]=t[o]:e[o]={}),s(e[o],t[o])):e[o]=t[o]})}function l(e){return"object"==typeof e?JSON.parse(JSON.stringify(e)):e}function a(e){var t={};return g(e,function(e,n){t[n]=e}),t}function u(e){for(var t=[],n=1;no;o++)n.prototype[t[o]]=void 0;return n}Object.defineProperties(n,{columnFactory:{get:function(){return o}},__esModule:{value:!0}});var r,i=(r=e("object"),r&&r.__esModule&&r||{"default":r}).inherit},{object:50}],52:[function(e,t,n){"use strict";function o(e){return e[0].toUpperCase()+e.substr(1)}function r(e,t){var n=!0;return g(t.length-1,function(o){return e.charAt(o)!==t.charAt(o)?(n=!1,!1):void 0}),n}function i(e,t){var n=!0,o=t.length-1,r=e.length-1;return g(o,function(i){var s=r-i,l=o-i;return e.charAt(s)!==t.charAt(l)?(n=!1,!1):void 0}),n}function s(){for(var e=[],t=0;t=t)return e;n=String(n);var o=n.length;o||(n=" ");var r=t-e.length,i=Math.ceil(r/n.length),s="";return g(i,function(e){s+=n}),s=s.slice(0,r),s+e}Object.defineProperties(n,{toUpperCaseFirst:{get:function(){return o}},startsWith:{get:function(){return r}},endsWith:{get:function(){return i}},equalsIgnoreCase:{get:function(){return s}},randomString:{get:function(){return l}},isPercentValue:{get:function(){return a}},substitute:{get:function(){return u}},padStart:{get:function(){return c}},__esModule:{value:!0}});var d,h,f=(d=e("mixed"),d&&d.__esModule&&d||{"default":d}).stringify,g=(h=e("number"),h&&h.__esModule&&h||{"default":h}).rangeEach},{mixed:48,number:49}],53:[function(e,t,n){"use strict";function o(e){return 32==e||e>=48&&57>=e||e>=96&&111>=e||e>=186&&192>=e||e>=219&&222>=e||e>=226||e>=65&&90>=e}function r(e){var t=[u.ARROW_DOWN,u.ARROW_UP,u.ARROW_LEFT,u.ARROW_RIGHT,u.HOME,u.END,u.DELETE,u.BACKSPACE,u.F1,u.F2,u.F3,u.F4,u.F5,u.F6,u.F7,u.F8,u.F9,u.F10,u.F11,u.F12,u.TAB,u.PAGE_DOWN,u.PAGE_UP,u.ENTER,u.ESCAPE,u.SHIFT,u.CAPS_LOCK,u.ALT];return-1!==t.indexOf(e)}function i(e){return-1!==[u.CONTROL_LEFT,224,u.COMMAND_LEFT,u.COMMAND_RIGHT].indexOf(e)}function s(e,t){var n=t.split("|"),o=!1;return a(n,function(t){return e===u[t]?(o=!0,!1):void 0}),o}Object.defineProperties(n,{KEY_CODES:{get:function(){return u}},isPrintableChar:{get:function(){return o}},isMetaKey:{get:function(){return r}},isCtrlKey:{get:function(){return i}},isKey:{get:function(){return s}},__esModule:{value:!0}});var l,a=(l=e("array"),l&&l.__esModule&&l||{"default":l}).arrayEach,u={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}},{array:42}],54:[function(e,t,n){"use strict";Object.defineProperties(n,{localHooks:{get:function(){return a}},__esModule:{value:!0}});var o,r,i=(o=e("helpers/array"),o&&o.__esModule&&o||{"default":o}).arrayEach,s=(r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}).defineGetter,l="localHooks",a={_localHooks:Object.create(null),addLocalHook:function(e,t){this._localHooks[e]||(this._localHooks[e]=[]),this._localHooks[e].push(t)},runLocalHooks:function(e){for(var t=[],n=1;n=0?(t.skip=!0,!0):!1},has:function(e){var t=void 0!==arguments[1]?arguments[1]:null,n=this.getBucket(t);return void 0!==n[e]&&n[e].length?!0:!1},run:function(e,t,n,o,r,i,s,l){var a=this.globalBucket[t],u=-1,c=a?a.length:0;if(c)for(;++u=0},getRegistered:function(){return i}},{}),Handsontable.utils=Handsontable.utils||{},Handsontable.utils.Hooks=a},{"helpers/array":42,"helpers/object":50}],57:[function(e,t,n){"use strict";function o(e,t){e=c(e),Handsontable.plugins[e]=t,Handsontable.hooks.add("construct",function(){var n;d.has(this)||d.set(this,{}),n=d.get(this),n[e]||(n[e]=new t(this))}),Handsontable.hooks.add("afterDestroy",function(){if(d.has(this)){var e=d.get(this);u(e,function(e){return e.destroy()}),d["delete"](this)}})}function r(e,t){if("string"!=typeof t)throw Error('Only strings can be passed as "plugin" parameter');var n=c(t);if(d.has(e)&&d.get(e)[n])return d.get(e)[n]}function i(e){return d.has(e)?Object.keys(d.get(e)):[]}function s(e,t){var n=null;return d.has(e)&&u(d.get(e),function(e,o){e===t&&(n=o)}),n}Object.defineProperties(n,{registerPlugin:{get:function(){return o}},getPlugin:{get:function(){return r}},getRegistredPluginNames:{get:function(){return i}},getPluginName:{get:function(){return s}},__esModule:{value:!0}});var l,a,u=(l=e("helpers/object"),l&&l.__esModule&&l||{"default":l}).objectEach,c=(a=e("helpers/string"),a&&a.__esModule&&a||{"default":a}).toUpperCaseFirst,d=new WeakMap},{"helpers/object":50,"helpers/string":52}],58:[function(e,t,n){"use strict";Object.defineProperties(n,{"default":{get:function(){return m}},__esModule:{value:!0}});var o,r,i,s=(o=e("helpers/object"),o&&o.__esModule&&o||{"default":o}),l=s.defineGetter,a=s.objectEach,u=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}).arrayEach,c=(i=e("plugins"),i&&i.__esModule&&i||{"default":i}),d=c.getRegistredPluginNames,h=c.getPluginName,f=new WeakMap,g=null,p=function(e){var t=this;l(this,"hot",e,{writable:!1}),f.set(this,{hooks:{}}),g=null,this.pluginName=null,this.pluginsInitializedCallbacks=[],this.isPluginsReady=!1,this.enabled=!1,this.initialized=!1,this.hot.addHook("afterPluginsInitialized",function(){return t.onAfterPluginsInitialized()}),this.hot.addHook("afterUpdateSettings",function(){return t.onUpdateSettings()}),this.hot.addHook("beforeInit",function(){return t.init()})};$traceurRuntime.createClass(p,{init:function(){this.pluginName=h(this.hot,this),this.isEnabled&&this.isEnabled()&&this.enablePlugin(),g||(g=d(this.hot)),g.indexOf(this.pluginName)>=0&&g.splice(g.indexOf(this.pluginName),1),g.length||this.hot.runHooks("afterPluginsInitialized"),this.initialized=!0},enablePlugin:function(){this.enabled=!0},disablePlugin:function(){this.eventManager&&this.eventManager.clear(),this.clearHooks(),this.enabled=!1},addHook:function(e,t){var n=f.get(this).hooks[e]=f.get(this).hooks[e]||[];this.hot.addHook(e,t),n.push(t),f.get(this).hooks[e]=n},removeHooks:function(e){var t=this;u(f.get(this).hooks[e]||[],function(n){t.hot.removeHook(e,n); -})},clearHooks:function(){var e=this,t=f.get(this).hooks;a(t,function(t,n){return e.removeHooks(n)}),t.length=0},callOnPluginsReady:function(e){this.isPluginsReady?e():this.pluginsInitializedCallbacks.push(e)},onAfterPluginsInitialized:function(){u(this.pluginsInitializedCallbacks,function(e){return e()}),this.pluginsInitializedCallbacks.length=0,this.isPluginsReady=!0},onUpdateSettings:function(){this.isEnabled&&(this.enabled&&!this.isEnabled()&&this.disablePlugin(),!this.enabled&&this.isEnabled()&&this.enablePlugin(),this.enabled&&this.isEnabled()&&this.updatePlugin())},updatePlugin:function(){},destroy:function(){var e=this;this.eventManager&&this.eventManager.destroy(),this.clearHooks(),a(this,function(t,n){"hot"!==n&&(e[n]=null)}),delete this.hot}},{});var m=p;Handsontable.plugins.BasePlugin=p},{"helpers/array":42,"helpers/object":50,plugins:57}],59:[function(e,t,n){"use strict";Object.defineProperties(n,{AutoColumnSize:{get:function(){return A}},__esModule:{value:!0}});var o,r,i,s,l,a,u,c,d,h,f=(o=e("_base"),o&&o.__esModule&&o||{"default":o})["default"],g=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}),p=g.arrayEach,m=g.arrayFilter,w=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),v=w.cancelAnimationFrame,b=w.requestAnimationFrame,C=w.isVisible,y=(s=e("utils/ghostTable"),s&&s.__esModule&&s||{"default":s}).GhostTable,R=(l=e("helpers/object"),l&&l.__esModule&&l||{"default":l}),S=R.isObject,E=(R.objectEach,a=e("helpers/number"),a&&a.__esModule&&a||{"default":a}),T=E.valueAccordingPercent,O=E.rangeEach,_=(u=e("plugins"),u&&u.__esModule&&u||{"default":u}).registerPlugin,M=(c=e("utils/samplesGenerator"),c&&c.__esModule&&c||{"default":c}).SamplesGenerator,H=(d=e("helpers/string"),d&&d.__esModule&&d||{"default":d}).isPercentValue,k=(h=e("3rdparty/walkontable/src/calculator/viewportColumns"),h&&h.__esModule&&h||{"default":h}).WalkontableViewportColumnsCalculator,A=function(e){var t=this;$traceurRuntime.superConstructor(P).call(this,e),this.widths=[],this.ghostTable=new y(this.hot),this.samplesGenerator=new M(function(e,n){return t.hot.getDataAtCell(e,n)}),this.firstCalculation=!0,this.inProgress=!1,this.addHook("beforeColumnResize",function(e,n,o){return t.onBeforeColumnResize(e,n,o)})},P=A;$traceurRuntime.createClass(A,{isEnabled:function(){return this.hot.getSettings().autoColumnSize!==!1&&!this.hot.getSettings().colWidths},enablePlugin:function(){var e=this;if(!this.enabled){var t=this.hot.getSettings().autoColumnSize,n=t&&t.hasOwnProperty("samplingRatio")?this.hot.getSettings().autoColumnSize.samplingRatio:void 0;n&&!isNaN(n)&&(this.samplesGenerator.customSampleCount=parseInt(n,10)),this.addHook("afterLoadData",function(){return e.onAfterLoadData()}),this.addHook("beforeChange",function(t){return e.onBeforeChange(t)}),this.addHook("beforeRender",function(t){return e.onBeforeRender(t)}),this.addHook("modifyColWidth",function(t,n){return e.getColumnWidth(n,t)}),$traceurRuntime.superGet(this,P.prototype,"enablePlugin").call(this)}},disablePlugin:function(){$traceurRuntime.superGet(this,P.prototype,"disablePlugin").call(this)},calculateColumnsWidth:function(){var e=void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countCols()-1},t=void 0!==arguments[1]?arguments[1]:{from:0,to:this.hot.countRows()-1},n=void 0!==arguments[2]?arguments[2]:!1,o=this;"number"==typeof e&&(e={from:e,to:e}),"number"==typeof t&&(t={from:t,to:t}),O(e.from,e.to,function(e){if(n||void 0===o.widths[e]&&!o.hot._getColWidthFromSettings(e)){var r=o.samplesGenerator.generateColumnSamples(e,t);r.forEach(function(e,t){return o.ghostTable.addColumn(t,e)})}}),this.ghostTable.columns.length&&(this.ghostTable.getWidths(function(e,t){return o.widths[e]=t}),this.ghostTable.clean())},calculateAllColumnsWidth:function(){var e=void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countRows()-1},t=this,n=0,o=this.hot.countCols()-1,r=null;this.inProgress=!0;var i=function(){return t.hot?(t.calculateColumnsWidth({from:n,to:Math.min(n+P.CALCULATION_STEP,o)},e),n=n+P.CALCULATION_STEP+1,void(o>n?r=b(i):(v(r),t.inProgress=!1,t.hot.view.wt.wtOverlays.adjustElementsSize(!0),t.hot.view.wt.wtOverlays.leftOverlay.needFullRender&&t.hot.view.wt.wtOverlays.leftOverlay.clone.draw()))):(v(r),void(t.inProgress=!1))};this.firstCalculation&&this.getSyncCalculationLimit()&&(this.calculateColumnsWidth({from:0,to:this.getSyncCalculationLimit()},e),this.firstCalculation=!1,n=this.getSyncCalculationLimit()+1),o>n?i():this.inProgress=!1},recalculateAllColumnsWidth:function(){this.hot.view&&C(this.hot.view.wt.wtTable.TABLE)&&(this.clearCache(),this.calculateAllColumnsWidth())},getSyncCalculationLimit:function(){var e=P.SYNC_CALCULATION_LIMIT,t=this.hot.countCols()-1;return S(this.hot.getSettings().autoColumnSize)&&(e=this.hot.getSettings().autoColumnSize.syncLimit,H(e)?e=T(t,e):e>>=0),Math.min(e,t)},getColumnWidth:function(e){var t=arguments[1],n=void 0!==arguments[2]?arguments[2]:!0,o=t;return void 0===o&&(o=this.widths[e],n&&"number"==typeof o&&(o=Math.max(o,k.DEFAULT_WIDTH))),o},getFirstVisibleColumn:function(){var e=this.hot.view.wt;return e.wtViewport.columnsVisibleCalculator?e.wtTable.getFirstVisibleColumn():e.wtViewport.columnsRenderCalculator?e.wtTable.getFirstRenderedColumn():-1},getLastVisibleColumn:function(){var e=this.hot.view.wt;return e.wtViewport.columnsVisibleCalculator?e.wtTable.getLastVisibleColumn():e.wtViewport.columnsRenderCalculator?e.wtTable.getLastRenderedColumn():-1},clearCache:function(){this.widths.length=0},isNeedRecalculate:function(){return m(this.widths,function(e){return void 0===e}).length?!0:!1},onBeforeRender:function(){var e=this.hot.renderCall,t=this.hot.countRows();t&&(this.calculateColumnsWidth({from:this.getFirstVisibleColumn(),to:this.getLastVisibleColumn()},void 0,e),this.isNeedRecalculate()&&!this.inProgress&&this.calculateAllColumnsWidth())},onAfterLoadData:function(){var e=this;this.hot.view?this.recalculateAllColumnsWidth():setTimeout(function(){e.hot&&e.recalculateAllColumnsWidth()},0)},onBeforeChange:function(e){var t=this;p(e,function(e){return t.widths[t.hot.propToCol(e[1])]=void 0})},onBeforeColumnResize:function(e,t,n){return n&&(this.calculateColumnsWidth(e,void 0,!0),t=this.getColumnWidth(e,void 0,!1)),t},destroy:function(){this.ghostTable.clean(),$traceurRuntime.superGet(this,P.prototype,"destroy").call(this)}},{get CALCULATION_STEP(){return 50},get SYNC_CALCULATION_LIMIT(){return 50}},f),_("autoColumnSize",A)},{"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":100,"utils/samplesGenerator":101}],60:[function(e,t,n){"use strict";Object.defineProperties(n,{AutoRowSize:{get:function(){return M}},__esModule:{value:!0}});var o,r,i,s,l,a,u,c,d,h=(o=e("_base"),o&&o.__esModule&&o||{"default":o})["default"],f=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}),g=(f.arrayEach,f.arrayFilter),p=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),m=p.cancelAnimationFrame,w=p.requestAnimationFrame,v=p.isVisible,b=(s=e("utils/ghostTable"),s&&s.__esModule&&s||{"default":s}).GhostTable,C=(l=e("helpers/object"),l&&l.__esModule&&l||{"default":l}),y=C.isObject,R=(C.objectEach,a=e("helpers/number"),a&&a.__esModule&&a||{"default":a}),S=R.valueAccordingPercent,E=R.rangeEach,T=(u=e("plugins"),u&&u.__esModule&&u||{"default":u}).registerPlugin,O=(c=e("utils/samplesGenerator"),c&&c.__esModule&&c||{"default":c}).SamplesGenerator,_=(d=e("helpers/string"),d&&d.__esModule&&d||{"default":d}).isPercentValue,M=function(e){var t=this;$traceurRuntime.superConstructor(H).call(this,e),this.heights=[],this.ghostTable=new b(this.hot),this.samplesGenerator=new O(function(e,n){return t.hot.getDataAtCell(e,n)}),this.firstCalculation=!0,this.inProgress=!1,this.addHook("beforeRowResize",function(e,n,o){return t.onBeforeRowResize(e,n,o)})},H=M;$traceurRuntime.createClass(M,{isEnabled:function(){return this.hot.getSettings().autoRowSize===!0||y(this.hot.getSettings().autoRowSize)},enablePlugin:function(){var e=this;if(!this.enabled){var t=this.hot.getSettings().autoRowSize,n=t&&t.hasOwnProperty("samplingRatio")?this.hot.getSettings().autoRowSize.samplingRatio:void 0;n&&!isNaN(n)&&(this.samplesGenerator.customSampleCount=parseInt(n,10)),this.addHook("afterLoadData",function(){return e.onAfterLoadData()}),this.addHook("beforeChange",function(t){return e.onBeforeChange(t)}),this.addHook("beforeColumnMove",function(){return e.recalculateAllRowsHeight()}),this.addHook("beforeColumnResize",function(){return e.recalculateAllRowsHeight()}),this.addHook("beforeColumnSort",function(){return e.clearCache()}),this.addHook("beforeRender",function(t){return e.onBeforeRender(t)}),this.addHook("beforeRowMove",function(t,n){return e.onBeforeRowMove(t,n)}),this.addHook("modifyRowHeight",function(t,n){return e.getRowHeight(n,t)}),$traceurRuntime.superGet(this,H.prototype,"enablePlugin").call(this)}},disablePlugin:function(){$traceurRuntime.superGet(this,H.prototype,"disablePlugin").call(this)},calculateRowsHeight:function(){var e=void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countRows()-1},t=void 0!==arguments[1]?arguments[1]:{from:0,to:this.hot.countCols()-1},n=void 0!==arguments[2]?arguments[2]:!1,o=this;"number"==typeof e&&(e={from:e,to:e}),"number"==typeof t&&(t={from:t,to:t}),E(e.from,e.to,function(e){if(n||void 0===o.heights[e]){var r=o.samplesGenerator.generateRowSamples(e,t);r.forEach(function(e,t){return o.ghostTable.addRow(t,e)})}}),this.ghostTable.rows.length&&(this.ghostTable.getHeights(function(e,t){return o.heights[e]=t}),this.ghostTable.clean())},calculateAllRowsHeight:function(){var e=void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countCols()-1},t=this,n=0,o=this.hot.countRows()-1,r=null;this.inProgress=!0;var i=function(){return t.hot?(t.calculateRowsHeight({from:n,to:Math.min(n+H.CALCULATION_STEP,o)},e),n=n+H.CALCULATION_STEP+1,void(o>n?r=w(i):(m(r),t.inProgress=!1,t.hot.view.wt.wtOverlays.adjustElementsSize(!0),t.hot.view.wt.wtOverlays.leftOverlay.needFullRender&&t.hot.view.wt.wtOverlays.leftOverlay.clone.draw()))):(m(r),void(t.inProgress=!1))};this.firstCalculation&&this.getSyncCalculationLimit()&&(this.calculateRowsHeight({from:0,to:this.getSyncCalculationLimit()},e),this.firstCalculation=!1,n=this.getSyncCalculationLimit()+1),o>n?i():this.inProgress=!1},recalculateAllRowsHeight:function(){v(this.hot.view.wt.wtTable.TABLE)&&(this.clearCache(),this.calculateAllRowsHeight())},getSyncCalculationLimit:function(){var e=H.SYNC_CALCULATION_LIMIT,t=this.hot.countRows()-1;return y(this.hot.getSettings().autoRowSize)&&(e=this.hot.getSettings().autoRowSize.syncLimit,_(e)?e=S(t,e):e>>=0),Math.min(e,t)},getRowHeight:function(e){var t=arguments[1],n=t;return void 0!==this.heights[e]&&this.heights[e]>(t||0)&&(n=this.heights[e]),n},getFirstVisibleRow:function(){var e=this.hot.view.wt;return e.wtViewport.rowsVisibleCalculator?e.wtTable.getFirstVisibleRow():e.wtViewport.rowsRenderCalculator?e.wtTable.getFirstRenderedRow():-1},getLastVisibleRow:function(){var e=this.hot.view.wt;return e.wtViewport.rowsVisibleCalculator?e.wtTable.getLastVisibleRow():e.wtViewport.rowsRenderCalculator?e.wtTable.getLastRenderedRow():-1},clearCache:function(){this.heights.length=0},clearCacheByRange:function(e){var t=this;"number"==typeof e&&(e={from:e,to:e}),E(Math.min(e.from,e.to),Math.max(e.from,e.to),function(e){return t.heights[e]=void 0})},isNeedRecalculate:function(){return g(this.heights,function(e){return void 0===e}).length?!0:!1},onBeforeRender:function(){var e=this.hot.renderCall;this.calculateRowsHeight({from:this.getFirstVisibleRow(),to:this.getLastVisibleRow()},void 0,e);var t=this.hot.getSettings().fixedRowsBottom;if(t){var n=this.hot.countRows()-1;this.calculateRowsHeight({from:n-t,to:n})}this.isNeedRecalculate()&&!this.inProgress&&this.calculateAllRowsHeight()},onBeforeRowMove:function(e,t){this.clearCacheByRange({from:e,to:t}),this.calculateAllRowsHeight()},onBeforeRowResize:function(e,t,n){return n&&(this.calculateRowsHeight(e,void 0,!0),t=this.getRowHeight(e)),t},onAfterLoadData:function(){var e=this;this.hot.view?this.recalculateAllRowsHeight():setTimeout(function(){e.hot&&e.recalculateAllRowsHeight()},0)},onBeforeChange:function(e){var t=null;1===e.length?t=e[0][0]:e.length>1&&(t={from:e[0][0],to:e[e.length-1][0]}),null!==t&&this.clearCacheByRange(t)},destroy:function(){this.ghostTable.clean(),$traceurRuntime.superGet(this,H.prototype,"destroy").call(this)}},{get CALCULATION_STEP(){return 50},get SYNC_CALCULATION_LIMIT(){return 500}},h),T("autoRowSize",M)},{_base:58,"helpers/array":42,"helpers/dom/element":45,"helpers/number":49,"helpers/object":50,"helpers/string":52,plugins:57,"utils/ghostTable":100,"utils/samplesGenerator":101}],61:[function(e,t,n){"use strict";function o(e,t,n,o){var r,i,s,l,a,u=n.length,c=n?n[0].length:0,d=[],h=[];if(r=t.row-e.row,i=t.col-e.col,-1!==["down","up"].indexOf(o)){for(var f=0;i>=f;f++)s=parseInt(n[0][f],10),l=parseInt(n[u-1][f],10),a=("down"===o?l-s:s-l)/(u-1)||0,h.push(a);d.push(h)}if(-1!==["right","left"].indexOf(o))for(var g=0;r>=g;g++)s=parseInt(n[g][0],10),l=parseInt(n[g][c-1],10),a=("right"===o?l-s:s-l)/(c-1)||0,h=[],h.push(a),d.push(h);return d}function r(e){function t(t){return e.autofill?void(e.autofill.handle&&e.autofill.handle.isDragged&&(e.autofill.handle.isDragged>1&&e.autofill.apply(),e.autofill.handle.isDragged=0,l=!1)):!0}function n(e){var t,n;return s.instance.autofill?(t=d(s.instance.table).top-(window.pageYOffset||document.documentElement.scrollTop)+h(s.instance.table),n=d(s.instance.table).left-(window.pageXOffset||document.documentElement.scrollLeft)+f(s.instance.table),s.addingStarted===!1&&s.instance.autofill.handle.isDragged>0&&e.clientY>t&&e.clientX<=n?(s.instance.mouseDragOutside=!0,s.addingStarted=!0):s.instance.mouseDragOutside=!1,void(s.instance.mouseDragOutside&&m("autoInsertRow")&&setTimeout(function(){s.addingStarted=!1,s.instance.alter("insert_row")},200))):!1}var o,r,i,s=this,l=!1;this.instance=e,this.addingStarted=!1,i=g(e),i.addEventListener(document,"mouseup",t),i.addEventListener(document,"mousemove",n),o=this.instance.view.wt.wtSettings.settings.onCellCornerMouseDown,this.instance.view.wt.wtSettings.settings.onCellCornerMouseDown=function(t){e.autofill.handle.isDragged=1,l=!0,o(t)},r=this.instance.view.wt.wtSettings.settings.onCellMouseOver,this.instance.view.wt.wtSettings.settings.onCellMouseOver=function(t,n,o,i){e.autofill&&l&&!e.view.isMouseDown()&&e.autofill.handle&&e.autofill.handle.isDragged&&(e.autofill.handle.isDragged++,e.autofill.showBorder(n),e.autofill.checkIfNewRowNeeded()),r(t,n,o,i)},this.instance.view.wt.wtSettings.settings.onCellCornerDblClick=function(){e.autofill.selectAdjacent()}}function i(e){return function(t){var n;return"direction"===t?n="string"==typeof e?e:"object"==typeof e&&void 0!==e[t]?e[t]:!0:"autoInsertRow"===t?n="object"==typeof e&&void 0!==e[t]?e[t]:!0:"fillHandle"===t&&(n=e?!0:!1),n}}Object.defineProperties(n,{Autofill:{get:function(){return r}},__esModule:{value:!0}});var s,l,a,u,c=(s=e("helpers/dom/element"),s&&s.__esModule&&s||{"default":s}),d=c.offset,h=c.outerHeight,f=c.outerWidth,g=(l=e("eventManager"),l&&l.__esModule&&l||{"default":l}).eventManager,p=((a=e("plugins"),a&&a.__esModule&&a||{"default":a}).registerPlugin,(u=e("3rdparty/walkontable/src/cell/coords"),u&&u.__esModule&&u||{"default":u}).WalkontableCellCoords);r.prototype.init=function(){this.handle={}},r.prototype.disable=function(){this.handle.disabled=!0},r.prototype.selectAdjacent=function(){var e,t,n,o,r;e=this.instance.selection.isMultiple()?this.instance.view.wt.selections.area.getCorners():this.instance.view.wt.selections.current.getCorners(),t=this.instance.getData();e:for(n=e[2]+1;nt[3]?(s="right",n=new p(e[0],t[3]+1),r=new p(e[2],e[3])):e[0]t[2]&&e[1]===t[1]&&(s="down",n=new p(t[2]+1,e[1]),r=new p(e[2],e[3])),n&&n.row>-1&&n.col>-1?(a={from:this.instance.getSelectedRange().from,to:this.instance.getSelectedRange().to},i=this.instance.getData(a.from.row,a.from.col,a.to.row,a.to.col),l=o(n,r,i,s),Handsontable.hooks.run(this.instance,"beforeAutofill",n,r,i),this.instance.populateFromArray(n.row,n.col,i,r.row,r.col,"autofill",null,s,l),this.instance.selection.setRangeStart(new p(e[0],e[1])),this.instance.selection.setRangeEnd(new p(e[2],e[3]))):this.instance.selection.refreshBorders())},r.prototype.showBorder=function(e){var t=this.instance.getSelectedRange().getTopLeftCorner(),n=this.instance.getSelectedRange().getBottomRightCorner();if("horizontal"!==m("direction")&&(n.rowe.row))e=new p(e.row,n.col);else{if("vertical"===m("direction"))return;e=new p(n.row,e.col)}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(e),this.instance.view.render()},r.prototype.checkIfNewRowNeeded=function(){var e,t,n=this.instance.countRows(),o=this;this.instance.view.wt.selections.fill.cellRange&&this.addingStarted===!1&&m("autoInsertRow")&&(t=this.instance.getSelected(),e=this.instance.view.wt.selections.fill.getCorners(),t[2]n[1]?e?1:-1:0}},dateSort:function(e){return function(t,n){if(t[1]===n[1])return 0;if(null===t[1]||""===t[1])return 1;if(null===n[1]||""===n[1])return-1;var o=new Date(t[1]),r=new Date(n[1]);return r>o?e?-1:1:o>r?e?1:-1:0}},sort:function(){if("undefined"==typeof this.hot.sortOrder)return void(this.hot.sortIndex.length=0);var e,t;this.hot.sortingEnabled=!1,this.hot.sortIndex.length=0;for(var n=0,o=this.hot.countRows()-this.hot.getSettings().minSpareRows;o>n;n++)this.hot.sortIndex.push([n,this.hot.getDataAtCell(n,this.hot.sortColumn)]);switch(e=this.hot.getCellMeta(0,this.hot.sortColumn),e.type){case"date":t=this.dateSort;break;default:t=this.defaultSort}this.hot.sortIndex.sort(t(this.hot.sortOrder));for(var r=this.hot.sortIndex.length;r=0&&-1===r&&u(n,"columnSorting"),f(n,"descending"),f(n,"ascending"),this.sortIndicators[e]&&e===this.hot.sortColumn&&("ascending"===this.sortOrderClass?u(n,"ascending"):"descending"===this.sortOrderClass&&u(n,"descending")))},isSorted:function(){return"undefined"!=typeof this.hot.sortColumn},afterCreateRow:function(e,t){if(this.isSorted()){for(var n=0;n=e&&(this.hot.sortIndex[n][0]+=t);for(var n=0;t>n;n++)this.hot.sortIndex.splice(e+n,0,[e+n,this.hot.getSourceData()[e+n][this.hot.sortColumn+this.hot.colOffset()]]);this.saveSortingState()}},afterRemoveRow:function(e,t){function n(e){return m(o,function(t,n){return e>n&&t++,t},0)}if(this.isSorted()){var o=this.hot.sortIndex.splice(e,t);o=p(o,function(e){return e[0]}),this.hot.sortIndex=p(this.hot.sortIndex,function(e,t){var o=n(e[0]);return o&&(e[0]-=o),e}),this.saveSortingState()}}},{},v),b("columnSorting",C)},{_base:58,eventManager:41,"helpers/array":42,"helpers/dom/element":45,plugins:57}],63:[function(e,t,n){"use strict";Object.defineProperties(n,{CommentEditor:{get:function(){return i}},__esModule:{value:!0}});var o,r=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}).addClass,i=function(){this.editor=this.createEditor(),this.editorStyle=this.editor.style,this.editorStyle.position="absolute",this.editorStyle.zIndex=100,this.hide()},s=i;$traceurRuntime.createClass(i,{setPosition:function(e,t){this.editorStyle.left=e+"px",this.editorStyle.top=t+"px"},show:function(){this.editorStyle.display="block"},hide:function(){this.editorStyle.display="none"},isVisible:function(){return"block"===this.editorStyle.display},setValue:function(){var e=void 0!==arguments[0]?arguments[0]:"";e=e||"",this.getInputElement().value=e},getValue:function(){return this.getInputElement().value},isFocused:function(){return document.activeElement===this.getInputElement()},focus:function(){this.getInputElement().focus()},createEditor:function(){var e,t,n=document.querySelector("."+s.CLASS_EDITOR_CONTAINER);return n||(n=document.createElement("div"),r(n,s.CLASS_EDITOR_CONTAINER),document.body.appendChild(n)),e=document.createElement("div"),r(e,s.CLASS_EDITOR),t=document.createElement("textarea"),r(t,s.CLASS_INPUT),e.appendChild(t),n.appendChild(e),e},getInputElement:function(){return this.editor.querySelector("."+s.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(e,t,n){"use strict";Object.defineProperties(n,{Comments:{get:function(){return R}},__esModule:{value:!0}});var o,r,i,s,l,a,u=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),c=u.addClass,d=u.closest,h=u.getWindowScrollLeft,f=u.getWindowScrollTop,g=u.hasClass,p=u.offset,m=(r=e("eventManager"),r&&r.__esModule&&r||{"default":r}).EventManager,w=(i=e("3rdparty/walkontable/src/cell/coords"),i&&i.__esModule&&i||{"default":i}).WalkontableCellCoords,v=(s=e("plugins"),s&&s.__esModule&&s||{"default":s}),b=v.registerPlugin,C=(v.getPlugin,(l=e("_base"),l&&l.__esModule&&l||{"default":l})["default"]),y=(a=e("commentEditor"),a&&a.__esModule&&a||{"default":a}).CommentEditor,R=function(e){$traceurRuntime.superConstructor(S).call(this,e),this.editor=null,this.eventManager=null,this.range={},this.mouseDown=!1,this.contextMenuEvent=!1,this.timer=null},S=R;$traceurRuntime.createClass(R,{isEnabled:function(){return this.hot.getSettings().comments},enablePlugin:function(){var e=this;this.enabled||(this.editor||(this.editor=new y),this.eventManager||(this.eventManager=new m(this)),this.addHook("afterContextMenuDefaultOptions",function(t){return e.addToContextMenu(t)}),this.addHook("afterRenderer",function(t,n,o,r,i,s){return e.onAfterRenderer(t,s)}),this.addHook("afterScrollHorizontally",function(){return e.refreshEditorPosition()}),this.addHook("afterScrollVertically",function(){return e.refreshEditorPosition()}),this.addHook("afterColumnResize",function(){return e.refreshEditorPosition()}),this.addHook("afterRowResize",function(){return e.refreshEditorPosition()}),this.registerListeners(),$traceurRuntime.superGet(this,S.prototype,"enablePlugin").call(this))},disablePlugin:function(){$traceurRuntime.superGet(this,S.prototype,"disablePlugin").call(this)},registerListeners:function(){var e=this;this.eventManager.addEventListener(document,"mouseover",function(t){return e.onMouseOver(t)}),this.eventManager.addEventListener(document,"mousedown",function(t){return e.onMouseDown(t)}),this.eventManager.addEventListener(document,"mousemove",function(t){return e.onMouseMove(t)}),this.eventManager.addEventListener(document,"mouseup",function(t){return e.onMouseUp(t)}),this.eventManager.addEventListener(this.editor.getInputElement(),"blur",function(t){return e.onEditorBlur(t)})},setRange:function(e){this.range=e},clearRange:function(){this.range={}},targetIsCellWithComment:function(e){return g(e.target,"htCommentCell")&&d(e.target,[this.hot.rootElement])?!0:!1},targetIsCommentTextArea:function(e){return this.editor.getInputElement()===e.target},saveComment:function(){if(!this.range.from)throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');var e=this.editor.getValue(),t=this.range.from.row,n=this.range.from.col;this.hot.setCellMeta(t,n,"comment",e),this.hot.render()},saveCommentAtCell:function(e,t){this.setRange({from:new w(e,t)}),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(e,t){this.setRange({from:new w(e,t)}),this.removeComment()},show:function(){if(!this.range.from)throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');var e=this.hot.getCellMeta(this.range.from.row,this.range.from.col);return this.refreshEditorPosition(!0),this.editor.setValue(e.comment||""),this.editor.show(),!0},showAtCell:function(e,t){return this.setRange({from:new w(e,t)}),this.show()},hide:function(){this.editor.hide()},refreshEditorPosition:function(){var e=void 0!==arguments[0]?arguments[0]:!1;if(e||this.range.from&&this.editor.isVisible()){var t=this.hot.view.wt.wtTable.getCell(this.range.from),n=p(t),o=this.hot.getColWidth(this.range.from.col),r=n.top,i=n.left,s=0,l=0;this.hot.view.wt.wtViewport.hasVerticalScroll()&&(r-=this.hot.view.wt.wtOverlays.topOverlay.getScrollPosition(),s=20),this.hot.view.wt.wtViewport.hasHorizontalScroll()&&(i-=this.hot.view.wt.wtOverlays.leftOverlay.getScrollPosition(),l=20);var a=i+o,u=r,c=this.hot.view.wt.wtTable.holder.getBoundingClientRect(),d={left:c.left+h()+l,right:c.right+h()-15, -top:c.top+f()+s,bottom:c.bottom+f()};a<=d.left||a>d.right||u<=d.top||u>d.bottom?this.hide():this.editor.setPosition(a,u)}},onMouseDown:function(e){this.mouseDown=!0,this.hot.view&&this.hot.view.wt&&(this.contextMenuEvent||this.targetIsCommentTextArea(e)||this.targetIsCellWithComment(e)||this.hide(),this.contextMenuEvent=!1)},onMouseOver:function(e){if(!this.mouseDown&&!this.editor.isFocused())if(this.targetIsCellWithComment(e)){var t=this.hot.view.wt.wtTable.getCoords(e.target),n={from:new w(t.row,t.col)};this.setRange(n),this.show()}else this.targetIsCommentTextArea(e)||this.editor.isFocused()||this.hide()},onMouseMove:function(e){var t=this;this.targetIsCommentTextArea(e)&&(this.mouseDown=!0,clearTimeout(this.timer),this.timer=setTimeout(function(){t.mouseDown=!1},200))},onMouseUp:function(e){this.mouseDown=!1},onAfterRenderer:function(e,t){t.comment&&c(e,t.commentedCellClassName)},onEditorBlur:function(e){this.saveComment()},checkSelectionCommentsConsistency:function(){var e=this.hot.getSelectedRange();if(!e)return!1;var t=!1,n=e.from;return this.hot.getCellMeta(n.row,n.col).comment&&(t=!0),t},onContextMenuAddComment:function(){var e=this,t=this.hot.getSelectedRange();this.contextMenuEvent=!0,this.setRange({from:t.from}),this.show(),setTimeout(function(){e.hot&&(e.hot.deselectCell(),e.editor.focus())},10)},onContextMenuRemoveComment:function(e,t){this.contextMenuEvent=!0,this.removeCommentAtCell(t.start.row,t.start.col)},addToContextMenu:function(e){var t=this;e.items.push(Handsontable.plugins.ContextMenu.SEPARATOR,{key:"commentsAddEdit",name:function(){return t.checkSelectionCommentsConsistency()?"Edit Comment":"Add Comment"},callback:function(){return t.onContextMenuAddComment()},disabled:function(){return this.getSelected()?!1:!0}},{key:"commentsRemove",name:function(){return"Delete Comment"},callback:function(e,n){return t.onContextMenuRemoveComment(e,n)},disabled:function(){return!t.checkSelectionCommentsConsistency()}})},destroy:function(){this.editor&&this.editor.destroy(),$traceurRuntime.superGet(this,S.prototype,"destroy").call(this)}},{},C),b("comments",R)},{"3rdparty/walkontable/src/cell/coords":5,_base:58,commentEditor:63,eventManager:41,"helpers/dom/element":45,plugins:57}],65:[function(e,t,n){"use strict";function o(e,t){var n;return i(t,function(t){var o=t.key?t.key.split(":"):null;return Array.isArray(o)&&o[1]===e?(n=t,!1):void 0}),n}Object.defineProperties(n,{CommandExecutor:{get:function(){return s}},__esModule:{value:!0}});var r,i=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}).arrayEach,s=function(e){this.hot=e,this.commands={},this.commonCallback=null};$traceurRuntime.createClass(s,{registerCommand:function(e,t){this.commands[e]=t},setCommonCallback:function(e){this.commonCallback=e},execute:function(e){for(var t=[],n=1;n0;if(s)return}}else if(!(t(i)||v(i,"current")&&v(i,"wtBorder")))return;this.open(e)},onMenuAfterOpen:function(){this.hot.runHooks("afterContextMenuShow",this)},onMenuAfterClose:function(){this.hot.listen(),this.hot.runHooks("afterContextMenuHide",this)},destroy:function(){this.close(),this.menu&&this.menu.destroy(),$traceurRuntime.superGet(this,z.prototype,"destroy").call(this)}},{get DEFAULT_ITEMS(){return[A,P,V,x,D,V,N,L,V,W,I,V,j,V,B]}},g),F.SEPARATOR={name:V},Handsontable.hooks.register("afterContextMenuDefaultOptions"),Handsontable.hooks.register("afterContextMenuShow"),Handsontable.hooks.register("afterContextMenuHide"),Handsontable.hooks.register("afterContextMenuExecute"),R("contextMenu",F)},{_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(e,t,n){"use strict";Object.defineProperties(n,{Cursor:{get:function(){return d}},__esModule:{value:!0}});var o,r,i=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),s=i.getWindowScrollLeft,l=i.getWindowScrollTop,a=(r=e("helpers/dom/event"),r&&r.__esModule&&r||{"default":r}),u=a.pageX,c=a.pageY,d=function(e){var t,n,o,r,i,a,d=l(),h=s();this.type=this.getSourceType(e),"literal"===this.type?(t=parseInt(e.top,10),o=parseInt(e.left,10),i=e.height||0,a=e.width||0,n=t,r=o,t+=d,o+=h):"event"===this.type&&(t=parseInt(c(e),10),o=parseInt(u(e),10),i=e.target.clientHeight,a=e.target.clientWidth,n=t-d,r=o-h),this.top=t,this.topRelative=n,this.left=o,this.leftRelative=r,this.scrollTop=d,this.scrollLeft=h,this.cellHeight=i,this.cellWidth=a};$traceurRuntime.createClass(d,{getSourceType:function(e){var t="literal";return e instanceof Event&&(t="event"),t},fitsAbove:function(e){return this.topRelative>=e.offsetHeight},fitsBelow:function(e){var t=void 0!==arguments[1]?arguments[1]:window.innerHeight;return this.topRelative+e.offsetHeight<=t},fitsOnRight:function(e){var t=void 0!==arguments[1]?arguments[1]:window.innerWidth;return this.leftRelative+this.cellWidth+e.offsetWidth<=t},fitsOnLeft:function(e){return this.leftRelative>=e.offsetWidth}},{}),Handsontable.plugins.utils=Handsontable.plugins.utils||{},Handsontable.plugins.utils.Cursor=d},{"helpers/dom/element":45,"helpers/dom/event":46}],68:[function(e,t,n){"use strict";function o(){var e=void 0!==arguments[0]?arguments[0]:null,t=void 0!==arguments[1]?arguments[1]:[],n=void 0!==arguments[2]?arguments[2]:{},o=[];return e&&e.items?e=e.items:Array.isArray(e)||(e=t),u(e)?a(e,function(e,t){var r=n["string"==typeof e?e:t];r||(r=e),u(e)?c(r,e):"string"==typeof r&&(r={name:r}),void 0===r.key&&(r.key=t),o.push(r)}):d(e,function(e,t){var r=n[e];!r&&g.indexOf(e)>=0||(r||(r={name:e,key:t+""}),u(e)&&c(r,e),void 0===r.key&&(r.key=t),o.push(r))}),o[0].name===f&&o.shift(),o}Object.defineProperties(n,{ItemsFactory:{get:function(){return m}},__esModule:{value:!0}});var r,i,s,l=(r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}),a=l.objectEach,u=l.isObject,c=l.extend,d=(i=e("helpers/array"),i&&i.__esModule&&i||{"default":i}).arrayEach,h=(s=e("predefinedItems"),s&&s.__esModule&&s||{"default":s}),f=h.SEPARATOR,g=h.ITEMS,p=h.predefinedItems,m=function(e){var t=void 0!==arguments[1]?arguments[1]:null;this.hot=e,this.predefinedItems=p(),this.defaultOrderPattern=t};$traceurRuntime.createClass(m,{setPredefinedItems:function(e){var t=this,n={};this.defaultOrderPattern.length=0,a(e,function(e,o){var r="";e.name===f?(n[f]=e,r=f):isNaN(parseInt(o,10))?(e.key=void 0===e.key?o:e.key,n[o]=e,r=e.key):(n[e.key]=e,r=e.key),t.defaultOrderPattern.push(r)}),this.predefinedItems=n},getVisibleItems:function(){var e=void 0!==arguments[0]?arguments[0]:null,t=this,n={};return a(this.predefinedItems,function(e,o){(!e.hidden||e.hidden&&!e.hidden.apply(t.hot))&&(n[o]=e)}),o(e,this.defaultOrderPattern,n)},getItems:function(){var e=void 0!==arguments[0]?arguments[0]:null;return o(e,this.defaultOrderPattern,this.predefinedItems)}},{})},{"helpers/array":42,"helpers/object":50,predefinedItems:70}],69:[function(e,t,n){"use strict";Object.defineProperties(n,{Menu:{get:function(){return V}},__esModule:{value:!0}});var o,r,i,s,l,a,u,c,d,h,f,g=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),p=g.addClass,m=g.empty,w=g.fastInnerHTML,v=(g.getComputedStyle,g.getScrollbarWidth),b=(g.getWindowScrollLeft,g.getWindowScrollTop,g.hasClass,g.isChildOf),C=g.removeClass,y=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}),R=y.arrayEach,S=y.arrayReduce,E=(i=e("cursor"),i&&i.__esModule&&i||{"default":i}).Cursor,T=(s=e("eventManager"),s&&s.__esModule&&s||{"default":s}).EventManager,O=(l=e("helpers/object"),l&&l.__esModule&&l||{"default":l}),_=(O.extend,O.isObject,O.objectEach,O.mixin),M=(a=e("helpers/function"),a&&a.__esModule&&a||{"default":a}).debounce,H=(u=e("utils"),u&&u.__esModule&&u||{"default":u}),k=H.isSeparator,A=H.isDisabled,P=H.isSelectionDisabled,x=H.hasSubMenu,D=H.normalizeSelection,N=(c=e("helpers/unicode"),c&&c.__esModule&&c||{"default":c}).KEY_CODES,L=(d=e("mixins/localHooks"),d&&d.__esModule&&d||{"default":d}).localHooks,W=(h=e("predefinedItems"),h&&h.__esModule&&h||{"default":h}),I=W.SEPARATOR,j=(W.predefinedItems,f=e("helpers/dom/event"),f&&f.__esModule&&f||{"default":f}),B=(j.stopPropagation,j.stopImmediatePropagation),V=(j.pageX,j.pageY,function(e,t){this.hot=e,this.options=t||{parent:null,name:null,className:"",keepInViewport:!0,standalone:!1},this.eventManager=new T(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()}),F=V;$traceurRuntime.createClass(V,{registerEvents:function(){var e=this;this.eventManager.addEventListener(document.documentElement,"mousedown",function(t){return e.onDocumentMouseDown(t)})},setMenuItems:function(e){this.menuItems=e},setOffset:function(e){var t=void 0!==arguments[1]?arguments[1]:0;this.offset[e]=t},isSubMenu:function(){return null!==this.parentMenu},open:function(){var e=this;this.container.removeAttribute("style"),this.container.style.display="block";var t=M(function(t){return e.openSubMenu(t)},300),n={data:this.menuItems,colHeaders:!1,colWidths:[200],autoRowSize:!1,readOnly:!0,copyPaste:!1,columns:[{data:"name",renderer:function(t,n,o,r,i,s){return e.menuItemRenderer(t,n,o,r,i,s)}}],renderAllRows:!0,fragmentSelection:"cell",beforeKeyDown:function(t){return e.onBeforeKeyDown(t)},afterOnCellMouseOver:function(n,o,r){e.isAllSubMenusClosed()?t(o.row):e.openSubMenu(o.row)}};this.origOutsideClickDeselects=this.hot.getSettings().outsideClickDeselects,this.hot.getSettings().outsideClickDeselects=!1,this.hotMenu=new Handsontable.Core(this.container,n),this.hotMenu.addHook("afterInit",function(){return e.onAfterInit()}),this.hotMenu.init(),this.hotMenu.listen(),this.blockMainTableCallbacks(),this.runLocalHooks("afterOpen")},close:function(){var e=void 0!==arguments[0]?arguments[0]:!1;this.isOpened()&&(e&&this.parentMenu?this.parentMenu.close():(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(e){if(this.hotMenu){var t=this.hotMenu.getCell(e,0);if(this.closeAllSubMenus(),!t||!x(t))return!1;var n=this.hotMenu.getSourceDataAtRow(e),o=new F(this.hot,{parent:this,name:n.name,className:this.options.className,keepInViewport:!0});return o.setMenuItems(n.submenu.items),o.open(),o.setPosition(t.getBoundingClientRect()),this.hotSubMenus[n.key]=o,o}},closeSubMenu:function(e){var t=this.hotMenu.getSourceDataAtRow(e),n=this.hotSubMenus[t.key];n&&(n.destroy(),delete this.hotSubMenus[t.key])},closeAllSubMenus:function(){var e=this;R(this.hotMenu.getData(),function(t,n){return e.closeSubMenu(n)})},isAllSubMenusClosed:function(){return 0===Object.keys(this.hotSubMenus).length},destroy:function(){this.clearLocalHooks(),this.close(),this.parentMenu=null,this.eventManager.destroy()},isOpened:function(){return null!==this.hotMenu},executeCommand:function(e){if(this.isOpened()&&this.hotMenu.getSelected()){var t=this.hotMenu.getSourceDataAtRow(this.hotMenu.getSelected()[0]);if(this.runLocalHooks("select",t,e),t.isCommand!==!1&&t.name!==I){var n=this.hot.getSelectedRange(),o=n?D(n):{};this.runLocalHooks("executeCommand",t.key,o,e),this.isSubMenu()&&this.parentMenu.runLocalHooks("executeCommand",t.key,o,e),t.disabled===!0||"function"==typeof t.disabled&&t.disabled.call(this.hot)===!0||t.submenu||this.close(!0)}}},setPosition:function(e){var t=new E(e);this.options.keepInViewport?(t.fitsBelow(this.container)?this.setPositionBelowCursor(t):t.fitsAbove(this.container)?this.setPositionAboveCursor(t):this.setPositionBelowCursor(t),t.fitsOnRight(this.container)?this.setPositionOnRightOfCursor(t):this.setPositionOnLeftOfCursor(t)):(this.setPositionBelowCursor(t),this.setPositionOnRightOfCursor(t))},setPositionAboveCursor:function(e){var t=this.offset.above+e.top-this.container.offsetHeight;this.isSubMenu()&&(t=e.top+e.cellHeight-this.container.offsetHeight+3),this.container.style.top=t+"px"},setPositionBelowCursor:function(e){var t=this.offset.below+e.top;this.isSubMenu()&&(t=e.top-1),this.container.style.top=t+"px"},setPositionOnRightOfCursor:function(e){var t;t=this.isSubMenu()?1+e.left+e.cellWidth:this.offset.right+1+e.left,this.container.style.left=t+"px"},setPositionOnLeftOfCursor:function(e){var t=this.offset.left+e.left-this.container.offsetWidth+v()+4;this.container.style.left=t+"px"},selectFirstCell:function(){var e=this.hotMenu.getCell(0,0);k(e)||A(e)||P(e)?this.selectNextCell(0,0):this.hotMenu.selectCell(0,0)},selectLastCell:function(){var e=this.hotMenu.countRows()-1,t=this.hotMenu.getCell(e,0);k(t)||A(t)||P(t)?this.selectPrevCell(e,0):this.hotMenu.selectCell(e,0)},selectNextCell:function(e,t){var n=e+1,o=n=0?this.hotMenu.getCell(n,t):null;o&&(k(o)||A(o)||P(o)?this.selectPrevCell(n,t):this.hotMenu.selectCell(n,t))},menuItemRenderer:function(e,t,n,o,r,i){var s=this,l=e.getSourceDataAtRow(n),a=document.createElement("div"),u=function(e){return e.hasOwnProperty("submenu")},c=function(e){return new RegExp(I,"i").test(e.name)},d=function(e){return e.disabled===!0||"function"==typeof e.disabled&&e.disabled.call(s.hot)===!0},h=function(e){return"function"==typeof e.hidden&&e.hidden.call(s.hot)===!0},f=function(e){return e.disableSelection},g=h(l);"function"==typeof i&&(i=i.call(this.hot)),m(t),p(a,"htItemWrapper"),t.appendChild(a),c(l)?p(t,"htSeparator"):g||"function"!=typeof l.renderer?w(a,i):(p(t,"htCustomMenuRenderer"),t.appendChild(l.renderer(e,a,n,o,r,i))),g?t.parentNode&&p(t.parentNode,"htHidden"):d(l)?(p(t,"htDisabled"),this.eventManager.addEventListener(t,"mouseenter",function(){return e.deselectCell()})):f(l)?(p(t,"htSelectionDisabled"),this.eventManager.addEventListener(t,"mouseenter",function(){return e.deselectCell()})):u(l)?(p(t,"htSubmenu"),f(l)?this.eventManager.addEventListener(t,"mouseenter",function(){return e.deselectCell()}):this.eventManager.addEventListener(t,"mouseenter",function(){return e.selectCell(n,o,void 0,void 0,void 0,!1)})):(C(t,"htSubmenu"),C(t,"htDisabled"),f(l)?this.eventManager.addEventListener(t,"mouseenter",function(){return e.deselectCell()}):this.eventManager.addEventListener(t,"mouseenter",function(){return e.selectCell(n,o,void 0,void 0,void 0,!1)}))},createContainer:function(){var e=void 0!==arguments[0]?arguments[0]:null;e&&(e=e.replace(/ /g,"_"),e=this.options.className+"Sub_"+e);var t;return t=e?document.querySelector("."+this.options.className+"."+e):document.querySelector("."+this.options.className),t||(t=document.createElement("div"),p(t,"htMenu "+this.options.className),e&&p(t,e),document.getElementsByTagName("body")[0].appendChild(t)),t},blockMainTableCallbacks:function(){this._afterScrollCallback=function(){},this.hot.addHook("afterScrollVertically",this._afterScrollCallback),this.hot.addHook("afterScrollHorizontally",this._afterScrollCallback)},releaseMainTableCallbacks:function(){this._afterScrollCallback&&(this.hot.removeHook("afterScrollVertically",this._afterScrollCallback),this.hot.removeHook("afterScrollHorizontally",this._afterScrollCallback),this._afterScrollCallback=null)},onBeforeKeyDown:function(e){var t=this.hotMenu.getSelected(),n=!1;switch(e.keyCode){case N.ESCAPE:this.close(),n=!0;break;case N.ENTER:t&&(this.hotMenu.getSourceDataAtRow(t[0]).submenu?n=!0:(this.executeCommand(e),this.close(!0)));break;case N.ARROW_DOWN:t?this.selectNextCell(t[0],t[1]):this.selectFirstCell(),n=!0;break;case N.ARROW_UP:t?this.selectPrevCell(t[0],t[1]):this.selectLastCell(),n=!0;break;case N.ARROW_RIGHT:if(t){var o=this.openSubMenu(t[0]);o&&o.selectFirstCell()}n=!0;break;case N.ARROW_LEFT:t&&this.isSubMenu()&&(this.close(),this.parentMenu&&this.parentMenu.hotMenu.listen(),n=!0)}n&&(e.preventDefault(),B(e))},onAfterInit:function(){var e=this.hotMenu.getSettings().data,t=this.hotMenu.view.wt.wtTable.hider.style,n=this.hotMenu.view.wt.wtTable.holder.style,o=parseInt(t.width,10),r=S(e,function(e,t){return e+(t.name===I?1:26)},0);n.width=o+22+"px",n.height=r+4+"px"},onDocumentMouseDown:function(e){this.isOpened()&&(this.container&&b(e.target,this.container)&&this.executeCommand(e),this.options.standalone&&this.hotMenu&&!b(e.target,this.hotMenu.rootElement)?this.close(!0):(this.isAllSubMenusClosed()||this.isSubMenu())&&!b(e.target,".htMenu")&&b(e.target,document)&&this.close(!0))}},{}),_(V,L)},{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(e,t,n){"use strict";function o(){var e={};return c(A,function(t,n){return e[n]=d(t)}),e}function r(e,t){-1===k.indexOf(e)&&(A[e]=t)}var i;Object.defineProperties(n,{ROW_ABOVE:{get:function(){return v}},ROW_BELOW:{get:function(){return b}},COLUMN_LEFT:{get:function(){return C}},COLUMN_RIGHT:{get:function(){return y}},CLEAR_COLUMN:{get:function(){return R}},REMOVE_ROW:{get:function(){return S}},REMOVE_COLUMN:{get:function(){return E}},UNDO:{get:function(){return T}},REDO:{get:function(){return O}},READ_ONLY:{get:function(){return _}},ALIGNMENT:{get:function(){return M}},SEPARATOR:{get:function(){return H}},ITEMS:{get:function(){return k}},predefinedItems:{get:function(){return o}},addItem:{get:function(){return r}},__esModule:{value:!0}});var s,l,a,u=(s=e("helpers/object"),s&&s.__esModule&&s||{"default":s}),c=u.objectEach,d=u.clone,h=((l=e("helpers/number"),l&&l.__esModule&&l||{"default":l}).rangeEach,a=e("utils"),a&&a.__esModule&&a||{"default":a}),f=h.align,g=h.getAlignmentClasses,p=h.getValidSelection,m=h.checkSelectionConsistency,w=h.markLabelAsSelected,v="row_above",b="row_below",C="col_left",y="col_right",R="clear_column",S="remove_row",E="remove_col",T="undo",O="redo",_="make_read_only",M="alignment",H="---------",k=[v,b,C,y,R,S,E,T,O,_,M,H],A=(i={},Object.defineProperty(i,H,{value:{name:H},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,v,{value:{key:v,name:"Insert row above",callback:function(e,t){this.alter("insert_row",t.start.row)},disabled:function(){var e=p(this);if(!e||this.countRows()>=this.getSettings().maxRows)return!0;var t=this.countRows(),n=[0,e[1],t-1,e[1]];return n.join(",")===e.join(",")&&t>1},hidden:function(){return!this.getSettings().allowInsertRow}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,b,{value:{key:b,name:"Insert row below",callback:function(e,t){this.alter("insert_row",t.end.row+1)},disabled:function(){var e=p(this);if(!e||this.countRows()>=this.getSettings().maxRows)return!0;var t=this.countRows(),n=[0,e[1],t-1,e[1]];return n.join(",")===e.join(",")&&t>1},hidden:function(){return!this.getSettings().allowInsertRow}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,C,{value:{key:C,name:"Insert column on the left",callback:function(e,t){this.alter("insert_col",t.start.col)},disabled:function(){var e=p(this);if(!e)return!0;if(!this.isColumnModificationAllowed())return!0;var t=[e[0],0,e[0],this.countCols()-1],n=t.join(",")==e.join(",");return e[1]<0||this.countCols()>=this.getSettings().maxCols||n},hidden:function(){return!this.getSettings().allowInsertColumn}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,y,{value:{key:y,name:"Insert column on the right",callback:function(e,t){this.alter("insert_col",t.end.col+1)},disabled:function(){var e=p(this);if(!e)return!0;if(!this.isColumnModificationAllowed())return!0;var t=[e[0],0,e[0],this.countCols()-1],n=t.join(",")==e.join(",");return e[1]<0||this.countCols()>=this.getSettings().maxCols||n},hidden:function(){return!this.getSettings().allowInsertColumn}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,R,{value:{key:R,name:"Clear column",callback:function(e,t){var n=t.start.col;this.countRows()&&this.populateFromArray(0,n,[[null]],Math.max(t.start.row,t.end.row),n)},disabled:function(){var e=p(this);if(!e)return!0;var t=[e[0],0,e[0],this.countCols()-1],n=t.join(",")==e.join(",");return e[1]<0||this.countCols()>=this.getSettings().maxCols||n}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,S,{value:{key:S,name:"Remove row",callback:function(e,t){var n=t.end.row-t.start.row+1;this.alter("remove_row",t.start.row,n)},disabled:function(){var e=p(this);if(!e)return!0;var t=[0,e[1],this.countRows()-1,e[1]];return t.join(",")===e.join(",")},hidden:function(){return!this.getSettings().allowRemoveRow}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,E,{value:{key:E,name:"Remove column",callback:function(e,t){var n=t.end.col-t.start.col+1;this.alter("remove_col",t.start.col,n)},disabled:function(){var e=p(this);if(!e)return!0;if(!this.isColumnModificationAllowed())return!0;var t=[e[0],0,e[0],this.countCols()-1],n=t.join(",")==e.join(",");return e[1]<0||n},hidden:function(){return!this.getSettings().allowRemoveColumn}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,T,{value:{key:T,name:"Undo",callback:function(){this.undo()},disabled:function(){return this.undoRedo&&!this.undoRedo.isUndoAvailable()}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,O,{value:{key:O,name:"Redo",callback:function(){this.redo()},disabled:function(){return this.undoRedo&&!this.undoRedo.isRedoAvailable()}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,_,{value:{key:_,name:function(){var e=this,t="Read only",n=m(this.getSelectedRange(),function(t,n){return e.getCellMeta(t,n).readOnly});return n&&(t=w(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=m(t,function(t,n){return e.getCellMeta(t,n).readOnly});t.forAll(function(t,o){e.getCellMeta(t,o).readOnly=n?!1:!0}),this.render()},disabled:function(){return this.getSelectedRange()?!1:!0}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,M,{value:{key:M,name:"Alignment",disabled:function(){return this.getSelectedRange()?!1:!0},submenu:{items:[{key:M+":left",name:function(){var e=this,t="Left",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htLeft")?!0:void 0});return n&&(t=w(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=g(t,function(t,n){return e.getCellMeta(t,n).className}),o="horizontal",r="htLeft";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1},{key:M+":center",name:function(){var e=this,t="Center",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htCenter")?!0:void 0});return n&&(t=w(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=g(t,function(t,n){return e.getCellMeta(t,n).className}),o="horizontal",r="htCenter";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1},{key:M+":right",name:function(){var e=this,t="Right",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htRight")?!0:void 0});return n&&(t=w(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=g(t,function(t,n){return e.getCellMeta(t,n).className}),o="horizontal",r="htRight";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1},{key:M+":justify",name:function(){var e=this,t="Justify",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htJustify")?!0:void 0});return n&&(t=w(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=g(t,function(t,n){return e.getCellMeta(t,n).className}),o="horizontal",r="htJustify";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1},{name:H},{key:M+":top",name:function(){var e=this,t="Top",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htTop")?!0:void 0});return n&&(t=w(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=g(t,function(t,n){return e.getCellMeta(t,n).className}),o="vertical",r="htTop";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1},{key:M+":middle",name:function(){var e=this,t="Middle",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htMiddle")?!0:void 0});return n&&(t=w(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=g(t,function(t,n){return e.getCellMeta(t,n).className}),o="vertical",r="htMiddle";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1},{key:M+":bottom",name:function(){var e=this,t="Bottom",n=m(this.getSelectedRange(),function(t,n){var o=e.getCellMeta(t,n).className;return o&&-1!==o.indexOf("htBottom")?!0:void 0});return n&&(t=w(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),n=g(t,function(t,n){return e.getCellMeta(t,n).className}),o="vertical",r="htBottom";this.runHooks("beforeCellAlignment",n,t,o,r),f(t,o,r,function(t,n){return e.getCellMeta(t,n)}),this.render()},disabled:!1}]}},configurable:!0,enumerable:!0,writable:!0}),i)},{"helpers/number":49,"helpers/object":50,utils:71}],71:[function(e,t,n){"use strict";function o(e){return{start:e.getTopLeftCorner(),end:e.getBottomRightCorner()}}function r(e){return w(e,"htSeparator")}function i(e){return w(e,"htSubmenu")}function s(e){return w(e,"htDisabled")}function l(e){return w(e,"htSelectionDisabled")}function a(e){var t=e.getSelected();return t?t[0]<0?null:t:null}function u(e,t){return-1!=e.indexOf(t)?e:(e=e.replace("htTop","").replace("htMiddle","").replace("htBottom","").replace(" ",""),e+=" "+t)}function c(e,t){return-1!=e.indexOf(t)?e:(e=e.replace("htLeft","").replace("htCenter","").replace("htRight","").replace("htJustify","").replace(" ",""),e+=" "+t)}function d(e,t){for(var n={},o=e.from.row;o<=e.to.row;o++)for(var r=e.from.col;r<=e.to.col;r++)n[o]||(n[o]=[]),n[o][r]=t(o,r);return n}function h(e,t,n,o){if(e.from.row==e.to.row&&e.from.col==e.to.col)f(e.from.row,e.from.col,t,n,o);else for(var r=e.from.row;r<=e.to.row;r++)for(var i=e.from.col;i<=e.to.col;i++)f(r,i,t,n,o)}function f(e,t,n,o,r){var i=r(e,t),s=o;i.className&&(s="vertical"===n?u(i.className,o):c(i.className,o)),i.className=s}function g(e,t){var n=!1;return e&&e.forAll(function(e,o){return t(e,o)?(n=!0,!1):void 0}),n}function p(e){return''+String.fromCharCode(10003)+""+e}Object.defineProperties(n,{normalizeSelection:{get:function(){return o}},isSeparator:{get:function(){return r}},hasSubMenu:{get:function(){return i}},isDisabled:{get:function(){return s}},isSelectionDisabled:{get:function(){return l}},getValidSelection:{get:function(){return a}},prepareVerticalAlignClass:{get:function(){return u}},prepareHorizontalAlignClass:{get:function(){return c}},getAlignmentClasses:{get:function(){return d}},align:{get:function(){return h}},checkSelectionConsistency:{get:function(){return g}},markLabelAsSelected:{get:function(){return p}},__esModule:{value:!0}});var m,w=(m=e("helpers/dom/element"),m&&m.__esModule&&m||{"default":m}).hasClass},{"helpers/dom/element":45}],72:[function(e,t,n){"use strict";Object.defineProperties(n,{ContextMenuCopyPaste:{get:function(){return p}},__esModule:{value:!0}});var o,r,i,s,l,a,u=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}).removeClass,c=(r=e("helpers/array"), -r&&r.__esModule&&r||{"default":r}).arrayEach,d=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).EventManager,h=(s=e("plugins"),s&&s.__esModule&&s||{"default":s}).registerPlugin,f=(l=e("_base"),l&&l.__esModule&&l||{"default":l})["default"],g=(a=e("zeroclipboard"),a&&a.__esModule&&a||{"default":a})["default"],p=function(e){$traceurRuntime.superConstructor(m).call(this,e),this.eventManager=new d(this),this.swfPath=null,this.outsideClickDeselectsCache=null},m=p;$traceurRuntime.createClass(p,{isEnabled:function(){return this.hot.getSettings().contextMenuCopyPaste},enablePlugin:function(){var e=this;if(!this.enabled){"object"==typeof this.hot.getSettings().contextMenuCopyPaste&&(this.swfPath=this.hot.getSettings().contextMenuCopyPaste.swfPath),"undefined"==typeof g&&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(t){"undefined"==typeof navigator.mimeTypes["application/x-shockwave-flash"]&&console.error("To be able to use the Copy/Paste feature from the context menu, your browser needs to have Flash Plugin installed.")}this.swfPath&&g.config({swfPath:this.swfPath}),this.hot.addHook("afterContextMenuShow",function(){return e.onAfterContextMenuShow()}),this.hot.addHook("afterContextMenuDefaultOptions",function(t){return e.onAfterContextMenuDefaultOptions(t)}),this.registerEvents(),$traceurRuntime.superGet(this,m.prototype,"enablePlugin").call(this)}},disablePlugin:function(){$traceurRuntime.superGet(this,m.prototype,"disablePlugin").call(this)},registerEvents:function(){var e=this;this.eventManager.addEventListener(document,"mouseenter",function(){return e.removeCurrentClass()}),this.eventManager.addEventListener(document,"mouseleave",function(){return e.removeZeroClipboardClass()})},getCopyValue:function(){return this.hot.copyPaste.setCopyableText(),this.hot.copyPaste.copyPasteInstance.elTextarea.value},onAfterContextMenuDefaultOptions:function(e){e.items.unshift({key:"copy",name:"Copy"},{key:"paste",name:"Paste",callback:function(){this.copyPaste.triggerPaste()}},Handsontable.plugins.ContextMenu.SEPARATOR)},onAfterContextMenuShow:function(){var e=this,t=this.hot.getPlugin("contextMenu"),n=t.menu.hotMenu.getSourceData();c(n,function(n,o){if("copy"===n.key){var r=new g(t.menu.hotMenu.getCell(o,0));return r.off(),r.on("copy",function(t){var n=t.clipboardData;n.setData("text/plain",e.getCopyValue()),e.hot.getSettings().outsideClickDeselects=e.outsideClickDeselectsCache}),!1}})},removeCurrentClass:function(){var e=this.hot.getPlugin("contextMenu");if(e.menu.isOpened()){var t=e.menu.hotMenu.rootElement.querySelector("td.current");t&&u(t,"current")}this.outsideClickDeselectsCache=this.hot.getSettings().outsideClickDeselects,this.hot.getSettings().outsideClickDeselects=!1},removeZeroClipboardClass:function(){var e=this.hot.getPlugin("contextMenu");if(e.menu.isOpened()){var t=e.menu.hotMenu.rootElement.querySelector("td.zeroclipboard-is-hover");t&&u(t,"zeroclipboard-is-hover")}this.hot.getSettings().outsideClickDeselects=this.outsideClickDeselectsCache}},{},f),h("contextMenuCopyPaste",p)},{_base:58,eventManager:41,"helpers/array":42,"helpers/dom/element":45,plugins:57,zeroclipboard:void 0}],73:[function(e,t,n){"use strict";function o(e){function t(){e.isListening()&&e.selection.empty()}function n(t){var n,o,r,i,s,l,a,u,c,d;if(e.isListening()&&e.selection.isSelected()){n=t,o=w.parse(n),r=e.getSelected(),i=new M(r[0],r[1]),s=new M(r[2],r[3]),l=new H(i,i,s),a=l.getTopLeftCorner(),u=l.getBottomRightCorner(),c=a,d=new M(Math.max(u.row,o.length-1+a.row),Math.max(u.col,o[0].length-1+a.col));var h=s.row-i.row>=o.length-1,f=s.col-i.col>=o[0].length-1;e.addHookOnce("afterChange",function(t,n){var o=t?t.length:0;if(o){var r={row:0,col:0},i=-1;y(t,function(e,n){var s=o>n+1?t[n+1]:null;s&&(h||(r.row=r.row+Math.max(s[0]-e[0]-1,0)),!f&&e[1]>i&&(i=e[1],r.col=r.col+Math.max(s[1]-e[1]-1,0)))}),e.selectCell(c.row,c.col,d.row+r.row,d.col+r.col)}}),e.populateFromArray(c.row,c.col,o,d.row,d.col,"paste",e.getSettings().pasteMode)}}function o(t){if(e.getSelected()&&!(e.getActiveEditor()&&e.getActiveEditor().isOpened()||T(t))){if(C(t.keyCode)){if(e.getSettings().fragmentSelection&&O())return;return r.setCopyableText(),void E(t)}var n=(t.ctrlKey||t.metaKey)&&!t.altKey;t.keyCode==b.A&&n&&e._registerTimeout(setTimeout(_(r.setCopyableText,r),0))}}var r=this;this.copyPasteInstance=m(),this.copyPasteInstance.onCut(t),this.copyPasteInstance.onPaste(n),this.onPaste=n,e.addHook("beforeKeyDown",o),this.destroy=function(){this.copyPasteInstance&&(this.copyPasteInstance.removeCallback(t),this.copyPasteInstance.removeCallback(n),this.copyPasteInstance.destroy(),this.copyPasteInstance=null),e.removeHook("beforeKeyDown",o)},e.addHook("afterDestroy",_(this.destroy,this)),this.triggerPaste=_(this.copyPasteInstance.triggerPaste,this.copyPasteInstance),this.triggerCut=_(this.copyPasteInstance.triggerCut,this.copyPasteInstance),this.setCopyableText=function(){var t=e.getSettings(),n=t.copyRowsLimit,o=t.copyColsLimit,r=e.getSelectedRange(),i=r.getTopLeftCorner(),s=r.getBottomRightCorner(),l=i.row,a=i.col,u=s.row,c=s.col,d=Math.min(u,l+n-1),h=Math.min(c,a+o-1),f=[];f.push({startRow:l,startCol:a,endRow:d,endCol:h}),f=Handsontable.hooks.run(e,"modifyCopyableRange",f);var g=this.getRangedCopyableData(f);e.copyPaste.copyPasteInstance.copyable(g),(u!==d||c!==h)&&Handsontable.hooks.run(e,"afterCopyLimit",u-l+1,c-a+1,n,o)},this.getRangedCopyableData=function(t){var n=[],o=[],r=[];return y(t,function(e){R(e.startRow,e.endRow,function(e){-1===o.indexOf(e)&&o.push(e)}),R(e.startCol,e.endCol,function(e){-1===r.indexOf(e)&&r.push(e)})}),y(o,function(t){var o=[];y(r,function(n){o.push(e.getCopyableData(t,n))}),n.push(o)}),w.stringify(n)}}function r(){var e=this,t=e.getSettings().copyPaste!==!1;t&&!e.copyPaste?e.copyPaste=new o(e):!t&&e.copyPaste&&(e.copyPaste.destroy(),e.copyPaste=null)}Object.defineProperties(n,{CopyPastePlugin:{get:function(){return o}},__esModule:{value:!0}});var i,s,l,a,u,c,d,h,f,g,p,m=(i=e("copyPaste"),i&&i.__esModule&&i||{"default":i})["default"],w=(s=e("SheetClip"),s&&s.__esModule&&s||{"default":s})["default"],v=(l=e("helpers/unicode"),l&&l.__esModule&&l||{"default":l}),b=v.KEY_CODES,C=v.isCtrlKey,y=(a=e("helpers/array"),a&&a.__esModule&&a||{"default":a}).arrayEach,R=(u=e("helpers/number"),u&&u.__esModule&&u||{"default":u}).rangeEach,S=(c=e("helpers/dom/event"),c&&c.__esModule&&c||{"default":c}),E=S.stopImmediatePropagation,T=S.isImmediatePropagationStopped,O=(d=e("helpers/dom/element"),d&&d.__esModule&&d||{"default":d}).getSelectionText,_=(h=e("helpers/function"),h&&h.__esModule&&h||{"default":h}).proxy,M=((f=e("plugins"),f&&f.__esModule&&f||{"default":f}).registerPlugin,(g=e("3rdparty/walkontable/src/cell/coords"),g&&g.__esModule&&g||{"default":g}).WalkontableCellCoords),H=(p=e("3rdparty/walkontable/src/cell/range"),p&&p.__esModule&&p||{"default":p}).WalkontableCellRange;Handsontable.hooks.add("afterInit",r),Handsontable.hooks.add("afterUpdateSettings",r),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(e,t,n){"use strict";function o(){}var r,i,s,l,a=((r=e("plugins"),r&&r.__esModule&&r||{"default":r}).registerPlugin,(i=e("3rdparty/walkontable/src/cell/range"),i&&i.__esModule&&i||{"default":i}).WalkontableCellRange),u=(s=e("3rdparty/walkontable/src/selection"),s&&s.__esModule&&s||{"default":s}).WalkontableSelection,c=function(e){return"boolean"==typeof e&&e===!0?!0:"object"==typeof e&&e.length>0?!0:!1},d=function(){c(this.getSettings().customBorders)&&(this.customBorders||(l=this,this.customBorders=new o))},h=function(e){for(var t=0;t=0?l.view.wt.selections[o]=n:l.view.wt.selections.push(n)},g=function(e,t,n){var o=C(e,t);o=y(o,n),this.setCellMeta(e,t,"borders",o),f(o)},p=function(e){for(var t=e.range,n=t.from.row;n<=t.to.row;n++)for(var o=t.from.col;o<=t.to.col;o++){var r=C(n,o),i=0;n==t.from.row&&(i++,e.hasOwnProperty("top")&&(r.top=e.top)),n==t.to.row&&(i++,e.hasOwnProperty("bottom")&&(r.bottom=e.bottom)),o==t.from.col&&(i++,e.hasOwnProperty("left")&&(r.left=e.left)),o==t.to.col&&(i++,e.hasOwnProperty("right")&&(r.right=e.right)),i>0&&(this.setCellMeta(n,o,"borders",r),f(r))}},m=function(e,t){return"border_row"+e+"col"+t},w=function(){return{width:1,color:"#000"}},v=function(){return{hide:!0}},b=function(){return{width:1,color:"#000",cornerVisible:!1}},C=function(e,t){return{className:m(e,t),border:b(),row:e,col:t,top:v(),right:v(),bottom:v(),left:v()}},y=function(e,t){return t.hasOwnProperty("border")&&(e.border=t.border),t.hasOwnProperty("top")&&(e.top=t.top),t.hasOwnProperty("right")&&(e.right=t.right),t.hasOwnProperty("bottom")&&(e.bottom=t.bottom),t.hasOwnProperty("left")&&(e.left=t.left),e},R=function(e){for(var t=document.querySelectorAll("."+e),n=0;n'+String.fromCharCode(10003)+""+e},M=function(e){this.getSettings().customBorders&&(e.items.push(Handsontable.plugins.ContextMenu.SEPARATOR),e.items.push({key:"borders",name:"Borders",submenu:{items:[{key:"borders:top",name:function(){var e="Top",t=O(this,"top");return t&&(e=_(e)),e},callback:function(){var e=O(this,"top");T.call(this,this.getSelectedRange(),"top",e)},disabled:!1},{key:"borders:right",name:function(){var e="Right",t=O(this,"right");return t&&(e=_(e)),e},callback:function(){var e=O(this,"right");T.call(this,this.getSelectedRange(),"right",e)},disabled:!1},{key:"borders:bottom",name:function(){var e="Bottom",t=O(this,"bottom");return t&&(e=_(e)),e},callback:function(){var e=O(this,"bottom");T.call(this,this.getSelectedRange(),"bottom",e)},disabled:!1},{key:"borders:left",name:function(){var e="Left",t=O(this,"left");return t&&(e=_(e)),e},callback:function(){var e=O(this,"left");T.call(this,this.getSelectedRange(),"left",e)},disabled:!1},{key:"borders:no_borders",name:"Remove border(s)",callback:function(){T.call(this,this.getSelectedRange(),"noBorders")},disabled:function(){return!O(this)}}]}}))};Handsontable.hooks.add("beforeInit",d),Handsontable.hooks.add("afterContextMenuDefaultOptions",M),Handsontable.hooks.add("afterInit",function(){var e=this.getSettings().customBorders;if(e){for(var t=0;tthis.boundaries.bottom&&(o=t-this.boundaries.bottom),ethis.boundaries.right&&(n=e-this.boundaries.right),this.callback(n,o)};var l,a=function(e){e.dragToScrollListening=!1;var t=e.view.wt.wtTable.holder;l=new o,t!==window&&(l.setBoundaries(t.getBoundingClientRect()),l.setCallback(function(e,n){0>e?t.scrollLeft-=50:e>0&&(t.scrollLeft+=50),0>n?t.scrollTop-=20:n>0&&(t.scrollTop+=20)}),e.dragToScrollListening=!0)};Handsontable.hooks.add("afterInit",function(){var e=this,t=s(this);t.addEventListener(document,"mouseup",function(){e.dragToScrollListening=!1}),t.addEventListener(document,"mousemove",function(t){e.dragToScrollListening&&l.check(t.clientX,t.clientY)})}),Handsontable.hooks.add("afterDestroy",function(){s(this).clear()}),Handsontable.hooks.add("afterOnCellMouseDown",function(){a(this)}),Handsontable.hooks.add("afterOnCellCornerMouseDown",function(){a(this)}),Handsontable.plugins.DragToScroll=o},{eventManager:41,plugins:57}],76:[function(e,t,n){"use strict";Object.defineProperties(n,{ManualColumnFreeze:{get:function(){return l}},__esModule:{value:!0}});var o,r,i=(o=e("_base"),o&&o.__esModule&&o||{"default":o})["default"],s=(r=e("plugins"),r&&r.__esModule&&r||{"default":r}).registerPlugin,l=function(e){$traceurRuntime.superConstructor(a).call(this,e)},a=l;$traceurRuntime.createClass(l,{isEnabled:function(){return!!this.hot.getSettings().manualColumnFreeze},enablePlugin:function(){var e=this;this.enabled||(this.addHook("modifyCol",function(t){return e.onModifyCol(t)}),this.addHook("afterContextMenuDefaultOptions",function(t){return e.addContextMenuEntry(t)}),$traceurRuntime.superGet(this,a.prototype,"enablePlugin").call(this))},disablePlugin:function(){$traceurRuntime.superGet(this,a.prototype,"disablePlugin").call(this)},init:function(){$traceurRuntime.superGet(this,a.prototype,"init").call(this),"undefined"==typeof this.hot.manualColumnPositionsPluginUsages?this.hot.manualColumnPositionsPluginUsages=["manualColumnFreeze"]:this.hot.manualColumnPositionsPluginUsages.push("manualColumnFreeze"),this.fixedColumnsCount=this.hot.getSettings().fixedColumnsLeft},onModifyCol:function(e){return this.hot.manualColumnPositionsPluginUsages.length>1?e:this.getModifiedColumnIndex(e)},getModifiedColumnIndex:function(e){return this.hot.manualColumnPositions[e]},addContextMenuEntry:function(e){var t=this;e.items.push(Handsontable.plugins.ContextMenu.SEPARATOR,{key:"freeze_column",name:function(){var e=t.hot.getSelected()[1];return e>t.fixedColumnsCount-1?"Freeze this column":"Unfreeze this column"},disabled:function(){var e=t.hot.getSelected();return e[1]!==e[3]},callback:function(){var e=t.hot.getSelected()[1];e>t.fixedColumnsCount-1?t.freezeColumn(e):t.unfreezeColumn(e)}})},freezeColumn:function(e){if(!(e<=this.fixedColumnsCount-1)){var t=this.getModifiedColumnIndex(e)||e;this.checkPositionData(t),this.modifyColumnOrder(t,e,null,"freeze"),this.addFixedColumn(),this.hot.view.wt.wtOverlays.leftOverlay.refresh(),this.hot.view.wt.wtOverlays.adjustElementsSize()}},unfreezeColumn:function(e){if(!(e>this.fixedColumnsCount-1)){var t=this.getBestColumnReturnPosition(e),n=this.getModifiedColumnIndex(e)||e;this.checkPositionData(n),this.modifyColumnOrder(n,e,t,"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(e){this.hot.manualColumnPositions&&0!==this.hot.manualColumnPositions.length||this.hot.manualColumnPositions||(this.hot.manualColumnPositions=[]),e?this.hot.manualColumnPositions[e]||this.createPositionData(e+1):this.createPositionData(this.hot.countCols())},createPositionData:function(e){if(this.hot.manualColumnPositions.lengtht;t++)this.hot.manualColumnPositions[t]=t},modifyColumnOrder:function(e,t,n,o){null==n&&(n=e),"freeze"===o?this.hot.manualColumnPositions.splice(this.fixedColumnsCount,0,this.hot.manualColumnPositions.splice(t,1)[0]):"unfreeze"===o&&this.hot.manualColumnPositions.splice(n,0,this.hot.manualColumnPositions.splice(t,1)[0])},getBestColumnReturnPosition:function(e){for(var t=this.fixedColumnsCount,n=this.getModifiedColumnIndex(t),o=this.getModifiedColumnIndex(e);o>n;)t++,n=this.getModifiedColumnIndex(t);return t-1}},{},i),s("manualColumnFreeze",l)},{_base:58,plugins:57}],77:[function(e,t,n){"use strict";function o(){function e(e){p=this,m=e;var t=this.view.wt.wtTable.getCoords(e).col;if(t>=0){f=t;var n=m.getBoundingClientRect();a=n.left,w.style.top=n.top+"px",w.style.left=a+"px",p.rootElement.appendChild(w)}}function t(e,t){var n=e.getBoundingClientRect(),o=6;t>0?w.style.left=n.left+n.width-o+"px":w.style.left=n.left+"px"}function n(){var e=this;u(w,"active"),u(v,"active");var t=m.getBoundingClientRect();v.style.width=t.width+"px",v.style.height=e.view.maximumVisibleElementHeight(0)+"px",v.style.top=w.style.top,v.style.left=a+"px",e.rootElement.appendChild(v)}function o(e){v.style.left=a+e+"px"}function r(){d(w,"active"),d(v,"active")}var i,s,l,a,f,p,m,w=document.createElement("DIV"),v=document.createElement("DIV"),b=h(this);w.className="manualColumnMover",v.className="manualColumnMoverGuide";var C=function(){var e=this;Handsontable.hooks.run(e,"persistentStateSave","manualColumnPositions",e.manualColumnPositions)},y=function(){var e=this,t={};return Handsontable.hooks.run(e,"persistentStateLoad","manualColumnPositions",t),t.value},R=function(e){if(e!=this.rootElement){var t=e.parentNode;return"THEAD"===t.tagName?!0:R.call(this,t)}return!1},S=function(e){return"TABLE"!=e.tagName?"TH"==e.tagName?e:S(e.parentNode):null},E=function(){var a,u=this;b.addEventListener(u.rootElement,"mouseover",function(n){if(R.call(u,n.target)){var o=S(n.target);if(o)if(a){var r=u.view.wt.wtTable.getCoords(o).col;r>=0&&(s=r,t(n.target,s-i))}else e.call(u,o)}}),b.addEventListener(u.rootElement,"mousedown",function(e){c(e.target,"manualColumnMover")&&(l=g(e),n.call(u),a=u,i=f,s=f)}),b.addEventListener(window,"mousemove",function(e){a&&o(g(e)-l)}),b.addEventListener(window,"mouseup",function(t){a&&(r(),a=!1,O(u.manualColumnPositions,u.countCols()),u.manualColumnPositions.splice(s,0,u.manualColumnPositions.splice(i,1)[0]),Handsontable.hooks.run(u,"beforeColumnMove",i,s),u.forceFullRender=!0,u.view.render(),C.call(u),Handsontable.hooks.run(u,"afterColumnMove",i,s),e.call(u,m))}),u.addHook("afterDestroy",T)},T=function(){b.clear()},O=function(e,t){if(e.lengthn;n++)e[n]=n};this.beforeInit=function(){this.manualColumnPositions=[]},this.init=function(e){var t=this,n=!!this.getSettings().manualColumnMove;if(n){var o=this.getSettings().manualColumnMove,r=y.call(t);"undefined"!=typeof r?this.manualColumnPositions=r:Array.isArray(o)?this.manualColumnPositions=o:o&&void 0!==this.manualColumnPositions||(this.manualColumnPositions=[]),("afterInit"===e||"afterUpdateSettings"===e&&0===b.context.eventListeners.length)&&("undefined"==typeof t.manualColumnPositionsPluginUsages?t.manualColumnPositionsPluginUsages=["manualColumnMove"]:t.manualColumnPositionsPluginUsages.push("manualColumnMove"),T.call(this),E.call(this),this.manualColumnPositions&&this.manualColumnPositions.length>0&&(this.forceFullRender=!0,this.render()))}else{var i=t.manualColumnPositionsPluginUsages?t.manualColumnPositionsPluginUsages.indexOf("manualColumnMove"):-1;i>-1&&(T.call(this),this.manualColumnPositions=[],t.manualColumnPositionsPluginUsages[i]=void 0)}},this.modifyCol=function(e){return this.getSettings().manualColumnMove?("undefined"==typeof this.manualColumnPositions[e]&&O(this.manualColumnPositions,e+1),this.manualColumnPositions[e]):e},this.afterRemoveCol=function(e,t){if(this.getSettings().manualColumnMove){var n,o=this.manualColumnPositions;n=o.splice(e,t),o=o.map(function(e){var t,o=e;for(t=0;tn[t]&&o--;return o}),this.manualColumnPositions=o}},this.afterCreateCol=function(e,t){if(this.getSettings().manualColumnMove){var n=this.manualColumnPositions;if(n.length){for(var o=[],r=0;t>r;r++)o.push(e+r);e>=n.length?n.concat(o):(n=n.map(function(n){return n>=e?n+t:n}),n.splice.apply(n,[e,0].concat(o))),this.manualColumnPositions=n}}}}Object.defineProperties(n,{ManualColumnMove:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,l,a=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),u=a.addClass,c=a.hasClass,d=a.removeClass,h=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager,f=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),g=f.pageX,p=(f.pageY,(l=e("plugins"),l&&l.__esModule&&l||{"default":l}).registerPlugin,new o);Handsontable.hooks.add("beforeInit",p.beforeInit),Handsontable.hooks.add("afterInit",function(){p.init.call(this,"afterInit")}),Handsontable.hooks.add("afterUpdateSettings",function(){p.init.call(this,"afterUpdateSettings")}),Handsontable.hooks.add("modifyCol",p.modifyCol),Handsontable.hooks.add("afterRemoveCol",p.afterRemoveCol),Handsontable.hooks.add("afterCreateCol",p.afterCreateCol),Handsontable.hooks.register("beforeColumnMove"),Handsontable.hooks.register("afterColumnMove")},{eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,plugins:57}],78:[function(e,t,n){"use strict";Object.defineProperties(n,{ManualColumnResize:{get:function(){return w}},__esModule:{value:!0}});var o,r,i,s,l,a=(o=e("_base.js"),o&&o.__esModule&&o||{"default":o})["default"],u=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),c=u.addClass,d=u.hasClass,h=u.removeClass,f=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager,g=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),p=g.pageX,m=(g.pageY,(l=e("plugins"),l&&l.__esModule&&l||{"default":l}).registerPlugin),w=function(e){$traceurRuntime.superConstructor(v).call(this,e),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=f(this),this.pressed=null,this.dblclick=0,this.autoresizeTimeout=null,this.manualColumnWidths=[],c(this.handle,"manualColumnResizer"),c(this.guide,"manualColumnResizerGuide")},v=w;$traceurRuntime.createClass(w,{isEnabled:function(){return this.hot.getSettings().manualColumnResize},enablePlugin:function(){var e=this;if(!this.enabled){this.manualColumnWidths=[];var t=this.hot.getSettings().manualColumnResize,n=this.loadManualColumnWidths();this.addHook("modifyColWidth",function(t,n){return e.onModifyColWidth(t,n)}),this.addHook("beforeStretchingColumnWidth",function(t,n){return e.onBeforeStretchingColumnWidth(t,n)}),"undefined"!=typeof n?this.manualColumnWidths=n:Array.isArray(t)?this.manualColumnWidths=t:this.manualColumnWidths=[],Handsontable.hooks.register("beforeColumnResize"),Handsontable.hooks.register("afterColumnResize"),this.bindEvents(),$traceurRuntime.superGet(this,v.prototype,"enablePlugin").call(this)}},updatePlugin:function(){var e=this.hot.getSettings().manualColumnResize;Array.isArray(e)?this.manualColumnWidths=e:e||(this.manualColumnWidths=[])},disablePlugin:function(){$traceurRuntime.superGet(this,v.prototype,"disablePlugin").call(this)},saveManualColumnWidths:function(){this.hot.runHooks("persistentStateSave","manualColumnWidths",this.manualColumnWidths)},loadManualColumnWidths:function(){var e={};return this.hot.runHooks("persistentStateLoad","manualColumnWidths",e),e.value},setupHandlePosition:function(e){this.currentTH=e;var t=this.hot.view.wt.wtTable.getCoords(e).col;if(t>=0){var n=this.currentTH.getBoundingClientRect();this.currentCol=t,this.startOffset=n.left-6,this.startWidth=parseInt(n.width,10),this.handle.style.top=n.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(){c(this.handle,"active"),c(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(){h(this.handle,"active"),h(this.guide,"active")},checkIfColumnHeader:function(e){if(e!=this.hot.rootElement){var t=e.parentNode;return"THEAD"===t.tagName?!0:this.checkIfColumnHeader(t)}return!1},getTHFromTargetElement:function(e){return"TABLE"!=e.tagName?"TH"==e.tagName?e:this.getTHFromTargetElement(e.parentNode):null},onMouseOver:function(e){if(this.checkIfColumnHeader(e.target)){var t=this.getTHFromTargetElement(e.target);if(!t)return;var n=t.getAttribute("colspan");!t||null!==n&&1!==n||this.pressed||this.setupHandlePosition(t)}},afterMouseDownTimeout:function(){if(this.dblclick>=2){var e=this.hot.runHooks("beforeColumnResize",this.currentCol,this.newSize,!0);void 0!==e&&(this.newSize=e),"all"===this.hot.getSettings().stretchH?this.clearManualSize(this.currentCol):this.setManualSize(this.currentCol,this.newSize),this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.wt.wtOverlays.adjustElementsSize(!0),this.hot.runHooks("afterColumnResize",this.currentCol,this.newSize,!0)}this.dblclick=0,this.autoresizeTimeout=null},onMouseDown:function(e){var t=this;d(e.target,"manualColumnResizer")&&(this.setupGuidePosition(),this.pressed=this.hot,null===this.autoresizeTimeout&&(this.autoresizeTimeout=setTimeout(function(){return t.afterMouseDownTimeout()},500),this.hot._registerTimeout(this.autoresizeTimeout)),this.dblclick++,this.startX=p(e),this.newSize=this.startWidth)},onMouseMove:function(e){this.pressed&&(this.currentWidth=this.startWidth+(p(e)-this.startX),this.newSize=this.setManualSize(this.currentCol,this.currentWidth),this.refreshHandlePosition(),this.refreshGuidePosition())},onMouseUp:function(e){this.pressed&&(this.hideHandleAndGuide(),this.pressed=!1,this.newSize!=this.startWidth&&(this.hot.runHooks("beforeColumnResize",this.currentCol,this.newSize),this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.wt.wtOverlays.adjustElementsSize(!0),this.saveManualColumnWidths(),this.hot.runHooks("afterColumnResize",this.currentCol,this.newSize)),this.setupHandlePosition(this.currentTH))},bindEvents:function(){var e=this;this.eventManager.addEventListener(this.hot.rootElement,"mouseover",function(t){return e.onMouseOver(t)}),this.eventManager.addEventListener(this.hot.rootElement,"mousedown",function(t){return e.onMouseDown(t)}),this.eventManager.addEventListener(window,"mousemove",function(t){return e.onMouseMove(t)}),this.eventManager.addEventListener(window,"mouseup",function(t){return e.onMouseUp(t)})},setManualSize:function(e,t){return t=Math.max(t,20),e=this.hot.runHooks("modifyCol",e),this.manualColumnWidths[e]=t,t},clearManualSize:function(e){e=this.hot.runHooks("modifyCol",e),this.manualColumnWidths[e]=void 0},onModifyColWidth:function(e,t){return this.enabled&&(t=this.hot.runHooks("modifyCol",t),this.hot.getSettings().manualColumnResize&&this.manualColumnWidths[t])?this.manualColumnWidths[t]:e},onBeforeStretchingColumnWidth:function(e,t){var n=this.manualColumnWidths[t];return void 0===n&&(n=e),n}},{},a),m("manualColumnResize",w)},{"_base.js":58,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,plugins:57}],79:[function(e,t,n){"use strict";function o(){function e(e){var t=this;p=e;var n=this.view.wt.wtTable.getCoords(e).row;if(n>=0){f=n;var o=p.getBoundingClientRect();a=o.top,m.style.top=a+"px",m.style.left=o.left+"px",t.rootElement.appendChild(m)}}function t(e,t){var n=e.getBoundingClientRect(),o=6;t>0?m.style.top=n.top+n.height-o+"px":m.style.top=n.top+"px"}function n(){var e=this;u(m,"active"),u(w,"active");var t=p.getBoundingClientRect();w.style.width=e.view.maximumVisibleElementWidth(0)+"px",w.style.height=t.height+"px",w.style.top=a+"px",w.style.left=m.style.left,e.rootElement.appendChild(w)}function o(e){w.style.top=a+e+"px"}function r(){d(m,"active"),d(w,"active")}var i,s,l,a,f,p,m=document.createElement("DIV"),w=document.createElement("DIV"),v=h(this);m.className="manualRowMover",w.className="manualRowMoverGuide";var b=function(){var e=this;Handsontable.hooks.run(e,"persistentStateSave","manualRowPositions",e.manualRowPositions)},C=function(){var e=this,t={};return Handsontable.hooks.run(e,"persistentStateLoad","manualRowPositions",t),t.value},y=function(e){if(e!=this.rootElement){var t=e.parentNode;return"TBODY"==t.tagName?!0:y.call(this,t)}return!1},R=function(e){return"TABLE"!=e.tagName?"TH"==e.tagName?e:R(e.parentNode):null},S=function(){var a,u=this;v.addEventListener(u.rootElement,"mouseover",function(n){if(y.call(u,n.target)){var o=R(n.target);o&&(a?(s=u.view.wt.wtTable.getCoords(o).row,t(o,s-i)):e.call(u,o))}}),v.addEventListener(u.rootElement,"mousedown",function(e){c(e.target,"manualRowMover")&&(l=g(e),n.call(u),a=u,i=f,s=f)}),v.addEventListener(window,"mousemove",function(e){a&&o(g(e)-l)}),v.addEventListener(window,"mouseup",function(t){a&&(r(),a=!1,T(u.manualRowPositions,u.countRows()),u.manualRowPositions.splice(s,0,u.manualRowPositions.splice(i,1)[0]),Handsontable.hooks.run(u,"beforeRowMove",i,s),u.forceFullRender=!0,u.view.render(),b.call(u),Handsontable.hooks.run(u,"afterRowMove",i,s),e.call(u,p))}),u.addHook("afterDestroy",E)},E=function(){v.clear()},T=function(e,t){if(e.lengthn;n++)e[n]=n};this.beforeInit=function(){this.manualRowPositions=[]},this.init=function(e){var t=this,n=!!t.getSettings().manualRowMove;if(n){var o=t.getSettings().manualRowMove,r=C.call(t);"undefined"==typeof t.manualRowPositionsPluginUsages?t.manualRowPositionsPluginUsages=["manualColumnMove"]:t.manualRowPositionsPluginUsages.push("manualColumnMove"),"undefined"!=typeof r?this.manualRowPositions=r:Array.isArray(o)?this.manualRowPositions=o:o&&void 0!==this.manualRowPositions||(this.manualRowPositions=[]),("afterInit"===e||"afterUpdateSettings"===e&&0===v.context.eventListeners.length)&&(E.call(this),S.call(this),this.manualRowPositions&&this.manualRowPositions.length>0&&(t.forceFullRender=!0,t.render()))}else{var i=t.manualRowPositionsPluginUsages?t.manualRowPositionsPluginUsages.indexOf("manualColumnMove"):-1;i>-1&&(E.call(this),t.manualRowPositions=[],t.manualRowPositionsPluginUsages[i]=void 0)}},this.modifyRow=function(e){var t=this;return t.getSettings().manualRowMove?("undefined"==typeof t.manualRowPositions[e]&&T(this.manualRowPositions,e+1),t.manualRowPositions[e]):e}}Object.defineProperties(n,{ManualRowMove:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,l,a=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),u=a.addClass,c=a.hasClass,d=a.removeClass,h=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager,f=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),g=(f.pageX,f.pageY),p=((l=e("plugins"),l&&l.__esModule&&l||{"default":l}).registerPlugin,new o);Handsontable.hooks.add("beforeInit",p.beforeInit),Handsontable.hooks.add("afterInit",function(){ -p.init.call(this,"afterInit")}),Handsontable.hooks.add("afterUpdateSettings",function(){p.init.call(this,"afterUpdateSettings")}),Handsontable.hooks.add("modifyRow",p.modifyRow),Handsontable.hooks.register("beforeRowMove"),Handsontable.hooks.register("afterRowMove")},{eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,plugins:57}],80:[function(e,t,n){"use strict";Object.defineProperties(n,{ManualRowResize:{get:function(){return w}},__esModule:{value:!0}});var o,r,i,s,l,a=(o=e("_base.js"),o&&o.__esModule&&o||{"default":o})["default"],u=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),c=u.addClass,d=u.hasClass,h=u.removeClass,f=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager,g=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),p=(g.pageX,g.pageY),m=(l=e("plugins"),l&&l.__esModule&&l||{"default":l}).registerPlugin,w=function(e){$traceurRuntime.superConstructor(v).call(this,e),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=f(this),this.pressed=null,this.dblclick=0,this.autoresizeTimeout=null,this.manualRowHeights=[],c(this.handle,"manualRowResizer"),c(this.guide,"manualRowResizerGuide")},v=w;$traceurRuntime.createClass(w,{isEnabled:function(){return this.hot.getSettings().manualRowResize},enablePlugin:function(){var e=this;if(!this.enabled){this.manualRowHeights=[];var t=this.hot.getSettings().manualRowResize,n=this.loadManualRowHeights();"undefined"!=typeof n?this.manualRowHeights=n:Array.isArray(t)?this.manualRowHeights=t:this.manualRowHeights=[],this.addHook("modifyRowHeight",function(t,n){return e.onModifyRowHeight(t,n)}),Handsontable.hooks.register("beforeRowResize"),Handsontable.hooks.register("afterRowResize"),this.bindEvents(),$traceurRuntime.superGet(this,v.prototype,"enablePlugin").call(this)}},updatePlugin:function(){var e=this.hot.getSettings().manualRowResize;Array.isArray(e)?this.manualRowHeights=e:e||(this.manualRowHeights=[])},disablePlugin:function(){$traceurRuntime.superGet(this,v.prototype,"disablePlugin").call(this)},saveManualRowHeights:function(){this.hot.runHooks("persistentStateSave","manualRowHeights",this.manualRowHeights)},loadManualRowHeights:function(){var e={};return this.hot.runHooks("persistentStateLoad","manualRowHeights",e),e.value},setupHandlePosition:function(e){this.currentTH=e;var t=this.hot.view.wt.wtTable.getCoords(e).row;if(t>=0){var n=this.currentTH.getBoundingClientRect();this.currentRow=t,this.startOffset=n.top-6,this.startHeight=parseInt(n.height,10),this.handle.style.left=n.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(){c(this.handle,"active"),c(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(){h(this.handle,"active"),h(this.guide,"active")},checkIfRowHeader:function(e){if(e!=this.hot.rootElement){var t=e.parentNode;return"TBODY"===t.tagName?!0:this.checkIfRowHeader(t)}return!1},getTHFromTargetElement:function(e){return"TABLE"!=e.tagName?"TH"==e.tagName?e:this.getTHFromTargetElement(e.parentNode):null},onMouseOver:function(e){if(this.checkIfRowHeader(e.target)){var t=this.getTHFromTargetElement(e.target);t&&(this.pressed||this.setupHandlePosition(t))}},afterMouseDownTimeout:function(){if(this.dblclick>=2){var e=this.hot.runHooks("beforeRowResize",this.currentRow,this.newSize,!0);void 0!==e&&(this.newSize=e),this.setManualSize(this.currentRow,this.newSize),this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.wt.wtOverlays.adjustElementsSize(!0),this.hot.runHooks("afterRowResize",this.currentRow,this.newSize,!0)}this.dblclick=0,this.autoresizeTimeout=null},onMouseDown:function(e){var t=this;d(e.target,"manualRowResizer")&&(this.setupGuidePosition(),this.pressed=this.hot,null==this.autoresizeTimeout&&(this.autoresizeTimeout=setTimeout(function(){return t.afterMouseDownTimeout()},500),this.hot._registerTimeout(this.autoresizeTimeout)),this.dblclick++,this.startY=p(e),this.newSize=this.startHeight)},onMouseMove:function(e){this.pressed&&(this.currentHeight=this.startHeight+(p(e)-this.startY),this.newSize=this.setManualSize(this.currentRow,this.currentHeight),this.refreshHandlePosition(),this.refreshGuidePosition())},onMouseUp:function(e){this.pressed&&(this.hideHandleAndGuide(),this.pressed=!1,this.newSize!=this.startHeight&&(this.hot.runHooks("beforeRowResize",this.currentRow,this.newSize),this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.wt.wtOverlays.adjustElementsSize(!0),this.saveManualRowHeights(),this.hot.runHooks("afterRowResize",this.currentRow,this.newSize)),this.setupHandlePosition(this.currentTH))},bindEvents:function(){var e=this;this.eventManager.addEventListener(this.hot.rootElement,"mouseover",function(t){return e.onMouseOver(t)}),this.eventManager.addEventListener(this.hot.rootElement,"mousedown",function(t){return e.onMouseDown(t)}),this.eventManager.addEventListener(window,"mousemove",function(t){return e.onMouseMove(t)}),this.eventManager.addEventListener(window,"mouseup",function(t){return e.onMouseUp(t)})},setManualSize:function(e,t){return e=this.hot.runHooks("modifyRow",e),this.manualRowHeights[e]=t,t},onModifyRowHeight:function(e,t){if(this.enabled){var n=this.hot.getPlugin("autoRowSize"),o=n?n.heights[t]:null;t=this.hot.runHooks("modifyRow",t);var r=this.manualRowHeights[t];if(void 0!==r&&(r===o||r>(e||0)))return r}return e}},{},a),m("manualRowResize",w)},{"_base.js":58,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,plugins:57}],81:[function(e,t,n){"use strict";function o(){var e=[];return e.getInfo=function(e,t){for(var n=0,o=this.length;o>n;n++)if(this[n].row<=e&&this[n].row+this[n].rowspan-1>=e&&this[n].col<=t&&this[n].col+this[n].colspan-1>=t)return this[n]},e.setInfo=function(e){for(var t=0,n=this.length;n>t;t++)if(this[t].row===e.row&&this[t].col===e.col)return void(this[t]=e);this.push(e)},e.removeInfo=function(e,t){for(var n=0,o=this.length;o>n;n++)if(this[n].row===e&&this[n].col===t){this.splice(n,1);break}},e}function r(e){if(this.mergedCellInfoCollection=new o,Array.isArray(e))for(var t=0,n=e.length;n>t;t++)this.mergedCellInfoCollection.setInfo(e[t])}function i(e,t){var n=this.getSettings().mergeCells;if(n&&!this.selection.isMultiple()){var o=this.mergeCells.mergedCellInfoCollection.getInfo(e[0],e[1]);o&&(e[0]=o.row,e[1]=o.col,e[2]=o.row+o.rowspan-1,e[3]=o.col+o.colspan-1)}}function s(e,t){this.mergeCells&&this.mergeCells.shiftCollection("right",e,t)}function l(e,t){this.mergeCells&&this.mergeCells.shiftCollection("left",e,t)}function a(e,t){this.mergeCells&&this.mergeCells.shiftCollection("down",e,t)}function u(e,t){this.mergeCells&&this.mergeCells.shiftCollection("up",e,t)}Object.defineProperties(n,{MergeCells:{get:function(){return r}},__esModule:{value:!0}});var c,d,h,f,g,p=((c=e("plugins"),c&&c.__esModule&&c||{"default":c}).registerPlugin,(d=e("helpers/dom/event"),d&&d.__esModule&&d||{"default":d}).stopImmediatePropagation),m=(h=e("3rdparty/walkontable/src/cell/coords"),h&&h.__esModule&&h||{"default":h}).WalkontableCellCoords,w=(f=e("3rdparty/walkontable/src/cell/range"),f&&f.__esModule&&f||{"default":f}).WalkontableCellRange,v=(g=e("3rdparty/walkontable/src/table"),g&&g.__esModule&&g||{"default":g}).WalkontableTable;r.prototype.canMergeRange=function(e){return!e.isSingle()},r.prototype.mergeRange=function(e){if(this.canMergeRange(e)){var t=e.getTopLeftCorner(),n=e.getBottomRightCorner(),o={};o.row=t.row,o.col=t.col,o.rowspan=n.row-t.row+1,o.colspan=n.col-t.col+1,this.mergedCellInfoCollection.setInfo(o)}},r.prototype.mergeOrUnmergeSelection=function(e){var t=this.mergedCellInfoCollection.getInfo(e.from.row,e.from.col);t?this.unmergeSelection(e.from):this.mergeSelection(e)},r.prototype.mergeSelection=function(e){this.mergeRange(e)},r.prototype.unmergeSelection=function(e){var t=this.mergedCellInfoCollection.getInfo(e.row,e.col);this.mergedCellInfoCollection.removeInfo(t.row,t.col)},r.prototype.applySpanProperties=function(e,t,n){var o=this.mergedCellInfoCollection.getInfo(t,n);o?o.row===t&&o.col===n?(e.setAttribute("rowspan",o.rowspan),e.setAttribute("colspan",o.colspan)):(e.removeAttribute("rowspan"),e.removeAttribute("colspan"),e.style.display="none"):(e.removeAttribute("rowspan"),e.removeAttribute("colspan"))},r.prototype.modifyTransform=function(e,t,n){var o=function(e,t){return t.row>=e.row&&t.row<=e.row+e.rowspan-1?!0:!1},r=function(e,t){return t.col>=e.col&&t.col<=e.col+e.colspan-1?!0:!1},i=function(e){return new m(t.to.row+e.row,t.to.col+e.col)},s={row:n.row,col:n.col};if("modifyTransformStart"==e){this.lastDesiredCoords||(this.lastDesiredCoords=new m(null,null));for(var l,a=new m(t.highlight.row,t.highlight.col),u=this.mergedCellInfoCollection.getInfo(a.row,a.col),c=0,d=this.mergedCellInfoCollection.length;d>c;c++){var h=this.mergedCellInfoCollection[c];if(h=new m(h.row+h.rowspan-1,h.col+h.colspan-1),t.includes(h)){l=!0;break}}if(u){var f=new m(u.row,u.col),g=new m(u.row+u.rowspan-1,u.col+u.colspan-1),p=new w(f,f,g);p.includes(this.lastDesiredCoords)||(this.lastDesiredCoords=new m(null,null)),s.row=this.lastDesiredCoords.row?this.lastDesiredCoords.row-a.row:s.row,s.col=this.lastDesiredCoords.col?this.lastDesiredCoords.col-a.col:s.col,n.row>0?s.row=u.row+u.rowspan-1-a.row+n.row:n.row<0&&(s.row=a.row-u.row+n.row),n.col>0?s.col=u.col+u.colspan-1-a.col+n.col:n.col<0&&(s.col=a.col-u.col+n.col)}var v=new m(t.highlight.row+s.row,t.highlight.col+s.col),b=this.mergedCellInfoCollection.getInfo(v.row,v.col);b&&(this.lastDesiredCoords=v,s={row:b.row-a.row,col:b.col-a.col})}else if("modifyTransformEnd"==e)for(var c=0,d=this.mergedCellInfoCollection.length;d>c;c++){var C=this.mergedCellInfoCollection[c],f=new m(C.row,C.col),g=new m(C.row+C.rowspan-1,C.col+C.colspan-1),y=new w(f,f,g),R=t.getBordersSharedWith(y);if(y.isEqual(t))t.setDirection("NW-SE");else if(R.length>0){var S=t.highlight.isEqual(y.from);R.indexOf("top")>-1?t.to.isSouthEastOf(y.from)&&S?t.setDirection("NW-SE"):t.to.isSouthWestOf(y.from)&&S&&t.setDirection("NE-SW"):R.indexOf("bottom")>-1&&(t.to.isNorthEastOf(y.from)&&S?t.setDirection("SW-NE"):t.to.isNorthWestOf(y.from)&&S&&t.setDirection("SE-NW"))}var v=i(s),E=o(C,v),T=r(C,v);t.includesRange(y)&&(y.includes(v)||E||T)&&(E&&(s.row<0?s.row-=C.rowspan-1:s.row>0&&(s.row+=C.rowspan-1)),T&&(s.col<0?s.col-=C.colspan-1:s.col>0&&(s.col+=C.colspan-1)))}0!==s.row&&(n.row=s.row),0!==s.col&&(n.col=s.col)},r.prototype.shiftCollection=function(e,t,n){var o=[0,0];switch(e){case"right":o[0]+=1;break;case"left":o[0]-=1;break;case"down":o[1]+=1;break;case"up":o[1]-=1}for(var r=0;rn;n++)e.mergeCells.mergedCellInfoCollection.setInfo(t[n])}else e.mergeCells=new r(t);else e.mergeCells&&(e.mergeCells.mergedCellInfoCollection=new o)},R=function(e){if(this.mergeCells){var t=(e.ctrlKey||e.metaKey)&&!e.altKey;t&&77===e.keyCode&&(this.mergeCells.mergeOrUnmergeSelection(this.getSelectedRange()),this.render(),p(e))}},S=function(e){this.getSettings().mergeCells&&(e.items.push(Handsontable.plugins.ContextMenu.SEPARATOR),e.items.push({key:"mergeCells",name:function(){var e=this.getSelected(),t=this.mergeCells.mergedCellInfoCollection.getInfo(e[0],e[1]);return t?"Unmerge cells":"Merge cells"},callback:function(){this.mergeCells.mergeOrUnmergeSelection(this.getSelectedRange()),this.render()},disabled:function(){return!1}}))},E=function(e,t,n,o,r,i){this.mergeCells&&this.mergeCells.applySpanProperties(e,t,n)},T=function(e){return function(t){var n=this.getSettings().mergeCells;if(n){var o=this.getSelectedRange();if(this.mergeCells.modifyTransform(e,o,t),"modifyTransformEnd"===e){var r=this.countRows(),i=this.countCols();o.from.row<0?o.from.row=0:o.from.row>0&&o.from.row>=r&&(o.from.row=o.from-1),o.from.col<0?o.from.col=0:o.from.col>0&&o.from.col>=i&&(o.from.col=i-1)}}}},O=function(e){this.lastDesiredCoords=null;var t=this.getSettings().mergeCells;if(t){var n=this.getSelectedRange();n.highlight=new m(n.highlight.row,n.highlight.col),n.to=e;var o=!1;do{o=!1;for(var r=0,i=this.mergeCells.mergedCellInfoCollection.length;i>r;r++){var s=this.mergeCells.mergedCellInfoCollection[r],l=new m(s.row,s.col),a=new m(s.row+s.rowspan-1,s.col+s.colspan-1),u=new w(l,l,a);n.expandByRange(u)&&(e.row=n.to.row,e.col=n.to.col,o=!0)}}while(o)}},_=function(e,t){if(t&&"area"==t){var n=this.getSettings().mergeCells;if(n)for(var o=this.getSelectedRange(),r=new w(o.from,o.from,o.from),i=new w(o.to,o.to,o.to),s=0,l=this.mergeCells.mergedCellInfoCollection.length;l>s;s++){var a=this.mergeCells.mergedCellInfoCollection[s],u=new m(a.row,a.col),c=new m(a.row+a.rowspan-1,a.col+a.colspan-1),d=new w(u,u,c);r.expandByRange(d)&&(e[0]=r.from.row,e[1]=r.from.col),i.expandByRange(d)&&(e[2]=i.from.row,e[3]=i.from.col)}}},M=function(e,t,n){var o=this.getSettings().mergeCells;if(o){var r=this.mergeCells.mergedCellInfoCollection.getInfo(e,t);!r||r.row==e&&r.col==t||(n.copyable=!1)}},H=function(e){var t=this.getSettings().mergeCells;if(t)for(var n,o=this.countCols(),r=0;o>r;r++){if(n=this.mergeCells.mergedCellInfoCollection.getInfo(e.startRow,r),n&&n.rowe.endRow)return e.endRow=i,H.call(this,e)}}},k=function(e){var t=this.getSettings().mergeCells;if(t)for(var n,o=this.countRows(),r=0;o>r;r++){if(n=this.mergeCells.mergedCellInfoCollection.getInfo(r,e.startColumn),n&&n.cole.endColumn)return e.endColumn=i,k.call(this,e)}}},A=function(e){if(e&&this.mergeCells){var t=this.mergeCells.mergedCellInfoCollection,n=this.getSelectedRange();for(var o in t)if(n.highlight.row==t[o].row&&n.highlight.col==t[o].col&&n.to.row==t[o].row+t[o].rowspan-1&&n.to.col==t[o].col+t[o].colspan-1)return!1}return e};Handsontable.hooks.add("beforeInit",b),Handsontable.hooks.add("afterInit",C),Handsontable.hooks.add("afterUpdateSettings",y),Handsontable.hooks.add("beforeKeyDown",R),Handsontable.hooks.add("modifyTransformStart",T("modifyTransformStart")),Handsontable.hooks.add("modifyTransformEnd",T("modifyTransformEnd")),Handsontable.hooks.add("beforeSetRangeEnd",O),Handsontable.hooks.add("beforeDrawBorders",_),Handsontable.hooks.add("afterIsMultipleSelection",A),Handsontable.hooks.add("afterRenderer",E),Handsontable.hooks.add("afterContextMenuDefaultOptions",S),Handsontable.hooks.add("afterGetCellMeta",M),Handsontable.hooks.add("afterViewportRowCalculatorOverride",H),Handsontable.hooks.add("afterViewportColumnCalculatorOverride",k),Handsontable.hooks.add("afterAutofillApplyValues",i),Handsontable.hooks.add("afterCreateCol",s),Handsontable.hooks.add("afterRemoveCol",l),Handsontable.hooks.add("afterCreateRow",a),Handsontable.hooks.add("afterRemoveRow",u),Handsontable.MergeCells=r},{"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(e,t,n){"use strict";Object.defineProperties(n,{MultipleSelectionHandles:{get:function(){return g}},__esModule:{value:!0}});var o,r,i,s,l=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),a=l.getWindowScrollTop,u=l.hasClass,c=l.getWindowScrollLeft,d=(r=e("_base"),r&&r.__esModule&&r||{"default":r})["default"],h=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).EventManager,f=(s=e("plugins"),s&&s.__esModule&&s||{"default":s}).registerPlugin,g=function(e){$traceurRuntime.superConstructor(p).call(this,e),this.dragged=[],this.eventManager=null,this.lastSetCell=null},p=g;$traceurRuntime.createClass(g,{isEnabled:function(){return Handsontable.mobileBrowser},enablePlugin:function(){this.enabled||(this.eventManager||(this.eventManager=new h(this)),this.registerListeners(),$traceurRuntime.superGet(this,p.prototype,"enablePlugin").call(this))},registerListeners:function(){function e(e){if(1===t.dragged.length)return t.dragged.splice(0,t.dragged.length),!0;var n=t.dragged.indexOf(e);return-1==n?!1:void(0===n?t.dragged=t.dragged.slice(0,1):1==n&&(t.dragged=t.dragged.slice(-1)))}var t=this;this.eventManager.addEventListener(this.hot.rootElement,"touchstart",function(e){var n;return u(e.target,"topLeftSelectionHandle-HitArea")?(n=t.hot.getSelectedRange(),t.dragged.push("topLeft"),t.touchStartRange={width:n.getWidth(),height:n.getHeight(),direction:n.getDirection()},e.preventDefault(),!1):u(e.target,"bottomRightSelectionHandle-HitArea")?(n=t.hot.getSelectedRange(),t.dragged.push("bottomRight"),t.touchStartRange={width:n.getWidth(),height:n.getHeight(),direction:n.getDirection()},e.preventDefault(),!1):void 0}),this.eventManager.addEventListener(this.hot.rootElement,"touchend",function(n){return u(n.target,"topLeftSelectionHandle-HitArea")?(e.call(t,"topLeft"),t.touchStartRange=void 0,n.preventDefault(),!1):u(n.target,"bottomRightSelectionHandle-HitArea")?(e.call(t,"bottomRight"),t.touchStartRange=void 0,n.preventDefault(),!1):void 0}),this.eventManager.addEventListener(this.hot.rootElement,"touchmove",function(e){var n,o,r,i,s,l,u,d=a(),h=c();0!==t.dragged.length&&(n=document.elementFromPoint(e.touches[0].screenX-h,e.touches[0].screenY-d),n&&n!==t.lastSetCell&&(("TD"==n.nodeName||"TH"==n.nodeName)&&(o=t.hot.getCoords(n),-1==o.col&&(o.col=0),r=t.hot.getSelectedRange(),i=r.getWidth(),s=r.getHeight(),l=r.getDirection(),1==i&&1==s&&t.hot.selection.setRangeEnd(o),u=t.getCurrentRangeCoords(r,o,t.touchStartRange.direction,l,t.dragged[0]),null!==u.start&&t.hot.selection.setRangeStart(u.start),t.hot.selection.setRangeEnd(u.end),t.lastSetCell=n),e.preventDefault()))})},getCurrentRangeCoords:function(e,t,n,o,r){var i=e.getTopLeftCorner(),s=e.getBottomRightCorner(),l=e.getBottomLeftCorner(),a=e.getTopRightCorner(),u={start:null,end:null};switch(n){case"NE-SW":switch(o){case"NE-SW":case"NW-SE":u="topLeft"==r?{start:new WalkontableCellCoords(t.row,e.highlight.col),end:new WalkontableCellCoords(l.row,t.col)}:{start:new WalkontableCellCoords(e.highlight.row,t.col),end:new WalkontableCellCoords(t.row,i.col)};break;case"SE-NW":"bottomRight"==r&&(u={start:new WalkontableCellCoords(s.row,t.col),end:new WalkontableCellCoords(t.row,i.col)})}break;case"NW-SE":switch(o){case"NE-SW":"topLeft"==r?u={start:t,end:l}:u.end=t;break;case"NW-SE":"topLeft"==r?u={start:t,end:s}:u.end=t;break;case"SE-NW":"topLeft"==r?u={start:t,end:i}:u.end=t;break;case"SW-NE":"topLeft"==r?u={start:t,end:a}:u.end=t}break;case"SW-NE":switch(o){case"NW-SE":u="bottomRight"==r?{start:new WalkontableCellCoords(t.row,i.col),end:new WalkontableCellCoords(l.row,t.col)}:{start:new WalkontableCellCoords(i.row,t.col),end:new WalkontableCellCoords(t.row,s.col)};break;case"SW-NE":u="topLeft"==r?{start:new WalkontableCellCoords(e.highlight.row,t.col),end:new WalkontableCellCoords(t.row,s.col)}:{start:new WalkontableCellCoords(t.row,i.col),end:new WalkontableCellCoords(i.row,t.col)};break;case"SE-NW":"bottomRight"==r?u={start:new WalkontableCellCoords(t.row,a.col),end:new WalkontableCellCoords(i.row,t.col)}:"topLeft"==r&&(u={start:l,end:t})}break;case"SE-NW":switch(o){case"NW-SE":case"NE-SW":case"SW-NE":"topLeft"==r&&(u.end=t);break;case"SE-NW":"topLeft"==r?u.end=t:u={start:t,end:i}}}return u},isDragged:function(){return this.dragged.length>0}},{},d),f("multipleSelectionHandles",g)},{_base:58,eventManager:41,"helpers/dom/element":45,plugins:57}],83:[function(e,t,n){"use strict";Object.defineProperties(n,{DataObserver:{get:function(){return d}},__esModule:{value:!0}});var o,r,i,s,l=(o=e("jsonpatch"),o&&o.__esModule&&o||{"default":o})["default"],a=(r=e("../../mixins/localHooks"),r&&r.__esModule&&r||{"default":r}).localHooks,u=(i=e("../../helpers/object"),i&&i.__esModule&&i||{"default":i}).mixin,c=(s=e("utils"),s&&s.__esModule&&s||{"default":s}).cleanPatches,d=function(e){this.observedData=null,this.observer=null,this.paused=!1,this.setObservedData(e)};$traceurRuntime.createClass(d,{setObservedData:function(e){var t=this;this.observer&&l.unobserve(this.observedData,this.observer),this.observedData=e,this.observer=l.observe(this.observedData,function(e){return t.onChange(e)})},isPaused:function(){return this.paused},pause:function(){this.paused=!0},resume:function(){this.paused=!1},onChange:function(e){this.runLocalHooks("change",c(e))},destroy:function(){l.unobserve(this.observedData,this.observer),this.observedData=null,this.observer=null}},{}),u(d,a)},{"../../helpers/object":50,"../../mixins/localHooks":54,jsonpatch:"jsonpatch",utils:85}],84:[function(e,t,n){"use strict";Object.defineProperties(n,{ObserveChanges:{get:function(){return h}},__esModule:{value:!0}});var o,r,i,s,l,a=(o=e("_base"),o&&o.__esModule&&o||{"default":o})["default"],u=((r=e("jsonpatch"),r&&r.__esModule&&r||{"default":r})["default"],(i=e("dataObserver"),i&&i.__esModule&&i||{"default":i}).DataObserver),c=(s=e("helpers/array"),s&&s.__esModule&&s||{"default":s}).arrayEach,d=(l=e("plugins"),l&&l.__esModule&&l||{"default":l}).registerPlugin;Handsontable.hooks.register("afterChangesObserved");var h=function(e){$traceurRuntime.superConstructor(f).call(this,e),this.observer=null},f=h;$traceurRuntime.createClass(h,{isEnabled:function(){return this.hot.getSettings().observeChanges},enablePlugin:function(){var e=this;this.enabled||(this.observer||(this.observer=new u(this.hot.getSourceData()),this._exposePublicApi()),this.observer.addLocalHook("change",function(t){return e.onDataChange(t)}),this.addHook("afterCreateRow",function(){return e.onAfterTableAlter()}),this.addHook("afterRemoveRow",function(){return e.onAfterTableAlter()}),this.addHook("afterCreateCol",function(){return e.onAfterTableAlter()}),this.addHook("afterRemoveCol",function(){return e.onAfterTableAlter()}),this.addHook("afterChange",function(t,n){return e.onAfterTableAlter(n)}),this.addHook("afterLoadData",function(t){return e.onAfterLoadData(t)}),$traceurRuntime.superGet(this,f.prototype,"enablePlugin").call(this))},disablePlugin:function(){this.observer&&(this.observer.destroy(),this.observer=null,this._deletePublicApi()),$traceurRuntime.superGet(this,f.prototype,"disablePlugin").call(this)},onDataChange:function(e){var t=this;if(!this.observer.isPaused()){var n={add:function(e){isNaN(e.col)?t.hot.runHooks("afterCreateRow",e.row):t.hot.runHooks("afterCreateCol",e.col)},remove:function(e){isNaN(e.col)?t.hot.runHooks("afterRemoveRow",e.row,1):t.hot.runHooks("afterRemoveCol",e.col,1)},replace:function(e){t.hot.runHooks("afterChange",[e.row,e.col,null,e.value],"external")}};c(e,function(e){n[e.op]&&n[e.op](e)}),this.hot.render()}this.hot.runHooks("afterChangesObserved")},onAfterTableAlter:function(e){var t=this;"loadData"!==e&&(this.observer.pause(),this.hot.addHookOnce("afterChangesObserved",function(){return t.observer.resume()}))},onAfterLoadData:function(e){e||this.observer.setObservedData(this.hot.getSourceData())},destroy:function(){this.observer&&(this.observer.destroy(),this._deletePublicApi()),$traceurRuntime.superGet(this,f.prototype,"destroy").call(this)},_exposePublicApi:function(){var e=this,t=this.hot;t.pauseObservingChanges=function(){return e.observer.pause()},t.resumeObservingChanges=function(){return e.observer.resume()},t.isPausedObservingChanges=function(){return e.observer.isPaused()}},_deletePublicApi:function(){var e=this.hot;delete e.pauseObservingChanges,delete e.resumeObservingChanges,delete e.isPausedObservingChanges}},{},a),d("observeChanges",h)},{_base:58,dataObserver:83,"helpers/array":42,jsonpatch:"jsonpatch",plugins:57}],85:[function(e,t,n){"use strict";function o(e){var t=[];return e=l(e,function(e){return/[\/]length/gi.test(e.path)?!1:r(e.path)?!0:!1}),e=a(e,function(e){var t=r(e.path);return e.row=t.row,e.col=t.col,e}),e=l(e,function(e){if(-1!==["add","remove"].indexOf(e.op)&&!isNaN(e.col)){if(-1!==t.indexOf(e.col))return!1;t.push(e.col)}return!0}),t.length=0,e}function r(e){var t=e.match(/^\/(\d+)\/?(.*)?$/);if(!t)return null;var n=t,o=n[1],r=n[2];return{row:parseInt(o,10),col:/^\d*$/.test(r)?parseInt(r,10):r}}Object.defineProperties(n,{cleanPatches:{get:function(){return o}},parsePath:{get:function(){return r}},__esModule:{value:!0}});var i,s=(i=e("../../helpers/array"),i&&i.__esModule&&i||{"default":i}),l=s.arrayFilter,a=s.arrayMap},{"../../helpers/array":42}],86:[function(e,t,n){"use strict";function o(e){var t,n=function(){window.localStorage[e+"__persistentStateKeys"]=JSON.stringify(t)},o=function(){var n=window.localStorage[e+"__persistentStateKeys"],o="string"==typeof n?JSON.parse(n):void 0;t=o?o:[]},r=function(){t=[],n()};o(),this.saveValue=function(o,r){window.localStorage[e+"_"+o]=JSON.stringify(r),-1==t.indexOf(o)&&(t.push(o),n())},this.loadValue=function(t,n){t="undefined"==typeof t?n:t;var o=window.localStorage[e+"_"+t];return"undefined"==typeof o?void 0:JSON.parse(o)},this.reset=function(t){window.localStorage.removeItem(e+"_"+t)},this.resetAll=function(){for(var n=0;nl;l++)for(var a=0;i>a;a++){var u=e.getDataAtCell(l,a),c=e.getCellMeta(l,a),d=c.search.callback||n,h=c.search.queryMethod||o,f=h(t,u);if(f){var g={row:l,col:a,data:u};s.push(g)}d&&d(e,l,a,u,f)}return s}},Handsontable.Search.DEFAULT_CALLBACK=function(e,t,n,o,r){e.getCellMeta(t,n).isSearchResult=r},Handsontable.Search.DEFAULT_QUERY_METHOD=function(e,t){return"undefined"!=typeof e&&null!=e&&e.toLowerCase&&0!==e.length?"undefined"==typeof t||null==t?!1:-1!=t.toString().toLowerCase().indexOf(e.toLowerCase()):!1},Handsontable.Search.DEFAULT_SEARCH_RESULT_CLASS="htSearchResult",Handsontable.Search.global=function(){var e=Handsontable.Search.DEFAULT_CALLBACK,t=Handsontable.Search.DEFAULT_QUERY_METHOD,n=Handsontable.Search.DEFAULT_SEARCH_RESULT_CLASS;return{getDefaultCallback:function(){return e},setDefaultCallback:function(t){e=t},getDefaultQueryMethod:function(){return t},setDefaultQueryMethod:function(e){t=e},getDefaultSearchResultClass:function(){return n},setDefaultSearchResultClass:function(e){n=e}}}(),Handsontable.SearchCellDecorator=function(e,t,n,o,r,i,s){var u=null!==s.search&&"object"==typeof s.search&&s.search.searchResultClass||Handsontable.Search.global.getDefaultSearchResultClass();s.isSearchResult?l(t,u):a(t,u)};var h=d("base");c("base",function(e,t,n,o,r,i,s){h.apply(this,arguments),Handsontable.SearchCellDecorator.apply(this,arguments)}),Handsontable.hooks.add("afterInit",o),Handsontable.hooks.add("afterUpdateSettings",o)},{"helpers/dom/element":45,renderers:90}],88:[function(e,t,n){"use strict";Object.defineProperties(n,{TouchScroll:{get:function(){return d}},__esModule:{value:!0}});var o,r,i,s=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),l=s.addClass,a=s.removeClass,u=(r=e("_base"),r&&r.__esModule&&r||{"default":r})["default"],c=(i=e("plugins"),i&&i.__esModule&&i||{"default":i}).registerPlugin,d=function(e){var t=this;$traceurRuntime.superConstructor(h).call(this,e),this.hot.addHook("afterInit",function(){return t.afterInit()}),this.hot.addHook("afterUpdateSettings",function(){return t.onAfterUpdateSettings()}),this.scrollbars=[],this.clones=[]},h=d;$traceurRuntime.createClass(d,{afterInit:function(){this.registerEvents(),this.onAfterUpdateSettings()},onAfterUpdateSettings:function(){var e=this;this.hot.addHookOnce("afterRender",function(){var t=e.hot.view.wt.wtOverlays;e.scrollbars=[],e.scrollbars.push(t.topOverlay),t.bottomOverlay.clone&&e.scrollbars.push(t.bottomOverlay),e.scrollbars.push(t.leftOverlay),t.topLeftCornerOverlay&&e.scrollbars.push(t.topLeftCornerOverlay),t.bottomLeftCornerOverlay&&t.bottomLeftCornerOverlay.clone&&e.scrollbars.push(t.bottomLeftCornerOverlay),e.clones=[],t.topOverlay.needFullRender&&e.clones.push(t.topOverlay.clone.wtTable.holder.parentNode),t.bottomOverlay.needFullRender&&e.clones.push(t.bottomOverlay.clone.wtTable.holder.parentNode),t.leftOverlay.needFullRender&&e.clones.push(t.leftOverlay.clone.wtTable.holder.parentNode),t.topLeftCornerOverlay&&e.clones.push(t.topLeftCornerOverlay.clone.wtTable.holder.parentNode),t.bottomLeftCornerOverlay&&t.bottomLeftCornerOverlay.clone&&e.clones.push(t.bottomLeftCornerOverlay.clone.wtTable.holder.parentNode)})},registerEvents:function(){var e=this;this.hot.addHook("beforeTouchScroll",function(){return e.onBeforeTouchScroll()}),this.hot.addHook("afterMomentumScroll",function(){return e.onAfterMomentumScroll()})},onBeforeTouchScroll:function(){Handsontable.freezeOverlays=!0;for(var e=0,t=this.clones.length;t>e;e++)l(this.clones[e],"hide-tween")},onAfterMomentumScroll:function(){Handsontable.freezeOverlays=!1;for(var e=this,t=0,n=this.clones.length;n>t;t++)a(this.clones[t],"hide-tween");for(var o=0,r=this.clones.length;r>o;o++)l(this.clones[o],"show-tween");setTimeout(function(){for(var t=0,n=e.clones.length;n>t;t++)a(e.clones[t],"show-tween")},400);for(var i=0,s=this.scrollbars.length;s>i;i++)this.scrollbars[i].refresh(),this.scrollbars[i].resetFixedPosition();this.hot.view.wt.wtOverlays.syncScrollWithMaster()}},{},u),c("touchScroll",d)},{_base:58,"helpers/dom/element":45,plugins:57}],89:[function(e,t,n){"use strict";function o(){var e=this,t="undefined"==typeof e.getSettings().undo||e.getSettings().undo;t?e.undoRedo||(e.undoRedo=new Handsontable.UndoRedo(e), -s(e),e.addHook("beforeKeyDown",r),e.addHook("afterChange",i)):e.undoRedo&&(delete e.undoRedo,l(e),e.removeHook("beforeKeyDown",r),e.removeHook("afterChange",i))}function r(e){var t=this,n=(e.ctrlKey||e.metaKey)&&!e.altKey;n&&(89===e.keyCode||e.shiftKey&&90===e.keyCode?(t.undoRedo.redo(),f(e)):90===e.keyCode&&(t.undoRedo.undo(),f(e)))}function i(e,t){var n=this;return"loadData"==t?n.undoRedo.clear():void 0}function s(e){e.undo=function(){return e.undoRedo.undo()},e.redo=function(){return e.undoRedo.redo()},e.isUndoAvailable=function(){return e.undoRedo.isUndoAvailable()},e.isRedoAvailable=function(){return e.undoRedo.isRedoAvailable()},e.clearUndo=function(){return e.undoRedo.clear()}}function l(e){delete e.undo,delete e.redo,delete e.isUndoAvailable,delete e.isRedoAvailable,delete e.clearUndo}var a,u,c=(a=e("helpers/object"),a&&a.__esModule&&a||{"default":a}),d=c.inherit,h=c.deepClone,f=(u=e("helpers/dom/event"),u&&u.__esModule&&u||{"default":u}).stopImmediatePropagation;Handsontable.UndoRedo=function(e){var t=this;this.instance=e,this.doneActions=[],this.undoneActions=[],this.ignoreNewActions=!1,e.addHook("afterChange",function(e,n){if(e){var o=new Handsontable.UndoRedo.ChangeAction(e);t.done(o)}}),e.addHook("afterCreateRow",function(e,n,o){if(!o){var r=new Handsontable.UndoRedo.CreateRowAction(e,n);t.done(r)}}),e.addHook("beforeRemoveRow",function(e,n){var o=t.instance.getSourceData();e=(o.length+e)%o.length;var r=o.slice(e,e+n),i=new Handsontable.UndoRedo.RemoveRowAction(e,r);t.done(i)}),e.addHook("afterCreateCol",function(e,n,o){if(!o){var r=new Handsontable.UndoRedo.CreateColumnAction(e,n);t.done(r)}}),e.addHook("beforeRemoveCol",function(n,o){var r=t.instance.getSourceData();n=(t.instance.countCols()+n)%t.instance.countCols();for(var i=[],s=0,l=r.length;l>s;s++)i[s]=r[s].slice(n,n+o);var a;Array.isArray(e.getSettings().colHeaders)&&(a=e.getSettings().colHeaders.slice(n,n+i.length));var u=new Handsontable.UndoRedo.RemoveColumnAction(n,i,a);t.done(u)}),e.addHook("beforeCellAlignment",function(e,n,o,r){var i=new Handsontable.UndoRedo.CellAlignmentAction(e,n,o,r);t.done(i)})},Handsontable.UndoRedo.prototype.done=function(e){this.ignoreNewActions||(this.doneActions.push(e),this.undoneActions.length=0)},Handsontable.UndoRedo.prototype.undo=function(){if(this.isUndoAvailable()){var e=this.doneActions.pop();this.ignoreNewActions=!0;var t=this;e.undo(this.instance,function(){t.ignoreNewActions=!1,t.undoneActions.push(e)})}},Handsontable.UndoRedo.prototype.redo=function(){if(this.isRedoAvailable()){var e=this.undoneActions.pop();this.ignoreNewActions=!0;var t=this;e.redo(this.instance,function(){t.ignoreNewActions=!1,t.doneActions.push(e)})}},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(e){this.changes=e},d(Handsontable.UndoRedo.ChangeAction,Handsontable.UndoRedo.Action),Handsontable.UndoRedo.ChangeAction.prototype.undo=function(e,t){for(var n=h(this.changes),o=e.countEmptyRows(!0),r=e.countEmptyCols(!0),i=0,s=n.length;s>i;i++)n[i].splice(3,1);e.addHookOnce("afterChange",t),e.setDataAtRowProp(n,null,null,"undo");for(var i=0,s=n.length;s>i;i++)e.getSettings().minSpareRows&&n[i][0]+1+e.getSettings().minSpareRows===e.countRows()&&o==e.getSettings().minSpareRows&&(e.alter("remove_row",parseInt(n[i][0]+1,10),e.getSettings().minSpareRows),e.undoRedo.doneActions.pop()),e.getSettings().minSpareCols&&n[i][1]+1+e.getSettings().minSpareCols===e.countCols()&&r==e.getSettings().minSpareCols&&(e.alter("remove_col",parseInt(n[i][1]+1,10),e.getSettings().minSpareCols),e.undoRedo.doneActions.pop())},Handsontable.UndoRedo.ChangeAction.prototype.redo=function(e,t){for(var n=h(this.changes),o=0,r=n.length;r>o;o++)n[o].splice(2,1);e.addHookOnce("afterChange",t),e.setDataAtRowProp(n,null,null,"redo")},Handsontable.UndoRedo.CreateRowAction=function(e,t){this.index=e,this.amount=t},d(Handsontable.UndoRedo.CreateRowAction,Handsontable.UndoRedo.Action),Handsontable.UndoRedo.CreateRowAction.prototype.undo=function(e,t){var n=e.countRows(),o=e.getSettings().minSpareRows;this.index>=n&&this.index-or;r++)n=e.getSourceDataAtRow(r),o=[this.index,0],Array.prototype.push.apply(o,this.data[r]),Array.prototype.splice.apply(n,o);"undefined"!=typeof this.headers&&(o=[this.index,0],Array.prototype.push.apply(o,this.headers),Array.prototype.splice.apply(e.getSettings().colHeaders,o)),e.addHookOnce("afterRender",t),e.render()},Handsontable.UndoRedo.RemoveColumnAction.prototype.redo=function(e,t){e.addHookOnce("afterRemoveCol",t),e.alter("remove_col",this.index,this.amount)},Handsontable.hooks.add("afterInit",o),Handsontable.hooks.add("afterUpdateSettings",o)},{"helpers/dom/event":46,"helpers/object":50}],90:[function(e,t,n){"use strict";function o(e,t){var n;a[e]=t,n=l(e)+"Renderer",Handsontable.renderers[n]=t,Handsontable[n]=t}function r(e){if("function"==typeof e)return e;if("string"!=typeof e)throw Error('Only strings and functions can be passed as "renderer" parameter');if(!(e in a))throw Error('No editor registered under name "'+e+'"');return a[e]}function i(e){return e in a}Object.defineProperties(n,{registerRenderer:{get:function(){return o}},getRenderer:{get:function(){return r}},hasRenderer:{get:function(){return i}},__esModule:{value:!0}});var s,l=(s=e("helpers/string"),s&&s.__esModule&&s||{"default":s}).toUpperCaseFirst,a={};Handsontable.renderers=Handsontable.renderers||{},Handsontable.renderers.registerRenderer=o,Handsontable.renderers.getRenderer=r},{"helpers/string":52}],91:[function(e,t,n){"use strict";function o(e,t,n,o,r,i,s){s.className&&(t.className?t.className=t.className+" "+s.className:t.className=s.className),s.readOnly&&l(t,s.readOnlyCellClassName),s.valid===!1&&s.invalidCellClassName?l(t,s.invalidCellClassName):a(t,s.invalidCellClassName),s.wordWrap===!1&&s.noWordWrapClassName&&l(t,s.noWordWrapClassName),!i&&s.placeholder&&l(t,s.placeholderCellClassName)}Object.defineProperties(n,{cellDecorator:{get:function(){return o}},__esModule:{value:!0}});var r,i,s=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),l=s.addClass,a=s.removeClass,u=(i=e("renderers"),i&&i.__esModule&&i||{"default":i}).registerRenderer;u("base",o),Handsontable.renderers.cellDecorator=o},{"helpers/dom/element":45,renderers:90}],92:[function(e,t,n){"use strict";function o(e,t,n,o,r,i,s){var l=(m.cloneNode(!0),w.cloneNode(!0));if(f("text")(e,t,n,o,r,i,s),t.appendChild(l),u(t,"htAutocomplete"),t.firstChild||t.appendChild(document.createTextNode(String.fromCharCode(160))),!e.acArrowListener){var a=d(e);e.acArrowListener=function(r){c(r.target,"htAutocompleteArrow")&&e.view.wt.getSetting("onCellDblClick",null,new p(n,o),t)},a.addEventListener(e.rootElement,"mousedown",e.acArrowListener),e.addHookOnce("afterDestroy",function(){a.destroy()})}}Object.defineProperties(n,{autocompleteRenderer:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,l,a=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),u=a.addClass,c=a.hasClass,d=(a.empty,(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager),h=(s=e("renderers"),s&&s.__esModule&&s||{"default":s}),f=h.getRenderer,g=h.registerRenderer,p=(l=e("3rdparty/walkontable/src/cell/coords"),l&&l.__esModule&&l||{"default":l}).WalkontableCellCoords,m=document.createElement("DIV");m.className="htAutocompleteWrapper";var w=document.createElement("DIV");w.className="htAutocompleteArrow",w.appendChild(document.createTextNode(String.fromCharCode(9660)));g("autocomplete",o)},{"3rdparty/walkontable/src/cell/coords":5,eventManager:41,"helpers/dom/element":45,renderers:90}],93:[function(e,t,n){"use strict";function o(e,t,n,o,l,a,u){function c(e){var t=[y.SPACE,y.ENTER,y.DELETE,y.BACKSPACE];-1===t.indexOf(e.keyCode)||T(e)||f(function(){E(e),e.preventDefault()}),(e.keyCode==y.SPACE||e.keyCode==y.ENTER)&&d(),(e.keyCode==y.DELETE||e.keyCode==y.BACKSPACE)&&d(!1)}function d(){var e=void 0!==arguments[0]?arguments[0]:null;f(function(t){for(var n=0,o=t.length;o>n;n++){if(m(t[n],_)&&null===e)return;h(t[n],e)}})}function h(e){var t=void 0!==arguments[1]?arguments[1]:null;null===t?e.checked=!e.checked:e.checked=t,b.fireEvent(e,"change")}function f(t){for(var n=e.getSelectedRange(),o=n.getTopLeftCorner(),r=n.getBottomRightCorner(),i=o.row;i<=r.row;i++)for(var s=o.col;s<=r.col;s++){var l=e.getCell(i,s),a=e.getCellMeta(i,s),u=l.querySelectorAll("input[type=checkbox]");u.length>0&&!a.readOnly&&t(u)}}var b=new v(e),C=r(),R=u.label,M=!1;if("undefined"==typeof u.checkedTemplate&&(u.checkedTemplate=!0),"undefined"==typeof u.uncheckedTemplate&&(u.uncheckedTemplate=!1),g(t),a===u.checkedTemplate||w(a,u.checkedTemplate)?C.checked=!0:a===u.uncheckedTemplate||w(a,u.uncheckedTemplate)?C.checked=!1:null===a?p(C,"noValue"):(C.style.display="none",p(C,_),M=!0),!M&&R){var H="";R.value?H="function"==typeof R.value?R.value.call(this,n,o,l,a):R.value:R.property&&(H=e.getDataAtRowProp(n,R.property));var k=i(H);"before"===R.position?k.appendChild(C):k.insertBefore(C,k.firstChild),C=k}t.appendChild(C),M&&t.appendChild(document.createTextNode("#bad-value#")),u.readOnly?b.addEventListener(C,"click",s):(b.addEventListener(C,"mousedown",S),b.addEventListener(C,"mouseup",S),b.addEventListener(C,"change",function(t){e.setDataAtRowProp(n,l,t.target.checked?u.checkedTemplate:u.uncheckedTemplate)})),O.has(e)||(O.set(e,!0),e.addHook("beforeKeyDown",c))}function r(){var e=document.createElement("input");return e.className="htCheckboxRendererInput",e.type="checkbox",e.setAttribute("autocomplete","off"),e.cloneNode(!1)}function i(e){var t=document.createElement("label");return t.className="htCheckboxRendererLabel",t.appendChild(document.createTextNode(e)),t.cloneNode(!0)}function s(e){e.preventDefault()}Object.defineProperties(n,{checkboxRenderer:{get:function(){return o}},__esModule:{value:!0}});var l,a,u,c,d,h,f=(l=e("helpers/dom/element"),l&&l.__esModule&&l||{"default":l}),g=f.empty,p=f.addClass,m=f.hasClass,w=(a=e("helpers/string"),a&&a.__esModule&&a||{"default":a}).equalsIgnoreCase,v=(u=e("eventManager"),u&&u.__esModule&&u||{"default":u}).EventManager,b=(c=e("renderers"),c&&c.__esModule&&c||{"default":c}),C=(b.getRenderer,b.registerRenderer),y=(d=e("helpers/unicode"),d&&d.__esModule&&d||{"default":d}).KEY_CODES,R=(h=e("helpers/dom/event"),h&&h.__esModule&&h||{"default":h}),S=R.stopPropagation,E=R.stopImmediatePropagation,T=R.isImmediatePropagationStopped,O=new WeakMap,_="htBadValue";C("checkbox",o)},{eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/string":52,"helpers/unicode":53,renderers:90}],94:[function(e,t,n){"use strict";function o(e,t,n,o,r,i,l){a("base").apply(this,arguments),(null===i||void 0===i)&&(i=""),s(t,i)}Object.defineProperties(n,{htmlRenderer:{get:function(){return o}},__esModule:{value:!0}});var r,i,s=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}).fastInnerHTML,l=(i=e("renderers"),i&&i.__esModule&&i||{"default":i}),a=l.getRenderer,u=l.registerRenderer;u("html",o)},{"helpers/dom/element":45,renderers:90}],95:[function(e,t,n){"use strict";function o(e,t,n,o,r,i,s){f(i)&&("undefined"!=typeof s.language&&a.language(s.language),i=a(i).format(s.format||"0"),u(t,"htNumeric")),d("text")(e,t,n,o,r,i,s)}Object.defineProperties(n,{numericRenderer:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,l,a=(r=e("numeral"),r&&r.__esModule&&r||{"default":r})["default"],u=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}).addClass,c=(s=e("renderers"),s&&s.__esModule&&s||{"default":s}),d=c.getRenderer,h=c.registerRenderer,f=(l=e("helpers/number"),l&&l.__esModule&&l||{"default":l}).isNumeric;h("numeric",o)},{"helpers/dom/element":45,"helpers/number":49,numeral:"numeral",renderers:90}],96:[function(e,t,n){"use strict";function o(e,t,n,o,r,i,l){a("text").apply(this,arguments),i=t.innerHTML;var u,c=l.hashLength||i.length,d=l.hashSymbol||"*";for(u="";u.split(d).length-13?("function"==typeof o&&(e.__proto__=o),e.prototype=d(l(o),i(t))):e.prototype=t,f(e,"prototype",{configurable:!1,writable:!1}),h(e,i(n))}function l(e){if("function"==typeof e){var t=e.prototype;if(u(t)===t||null===t)return e.prototype;throw new c("super prototype must be an Object or null")}if(null===e)return null;throw new c("Super expression must either be null or a function, not "+typeof e+".")}function a(e,t,o){null!==p(t)&&n(e,t,"constructor",o)}var u=Object,c=TypeError,d=u.create,h=$traceurRuntime.defineProperties,f=$traceurRuntime.defineProperty,g=$traceurRuntime.getOwnPropertyDescriptor,p=Object.getPrototypeOf,m=$traceurRuntime.toProperty,w=Object,v=w.getOwnPropertyNames,b=w.getOwnPropertySymbols;$traceurRuntime.createClass=s,$traceurRuntime.defaultSuperCall=a,$traceurRuntime.superCall=n,$traceurRuntime.superConstructor=t,$traceurRuntime.superGet=o,$traceurRuntime.superSet=r}()},{}],99:[function(e,t,n){"use strict";function o(e){var t=this,n=this;this.eventManager=C(e),this.instance=e,this.settings=e.getSettings(),this.selectionMouseDown=!1;var o=e.rootElement.getAttribute("style");o&&e.rootElement.setAttribute("data-originalstyle",o),d(e.rootElement,"handsontable");var r=document.createElement("TABLE");d(r,"htCore"),e.getSettings().tableClassName&&d(r,e.getSettings().tableClassName),this.THEAD=document.createElement("THEAD"),r.appendChild(this.THEAD),this.TBODY=document.createElement("TBODY"),r.appendChild(this.TBODY),e.table=r,e.container.insertBefore(r,e.container.firstChild),this.eventManager.addEventListener(e.rootElement,"mousedown",function(e){this.selectionMouseDown=!0,n.isTextSelectionAllowed(e.target)||(s(),e.preventDefault(),window.focus())}),this.eventManager.addEventListener(e.rootElement,"mouseup",function(e){this.selectionMouseDown=!1}),this.eventManager.addEventListener(e.rootElement,"mousemove",function(e){this.selectionMouseDown&&!n.isTextSelectionAllowed(e.target)&&(s(),e.preventDefault())}),this.eventManager.addEventListener(document.documentElement,"keyup",function(t){e.selection.isInProgress()&&!t.shiftKey&&e.selection.finish()});var i;this.isMouseDown=function(){return i},this.eventManager.addEventListener(document.documentElement,"mouseup",function(t){e.selection.isInProgress()&&1===t.which&&e.selection.finish(),i=!1,b(document.activeElement)&&e.unlisten()}),this.eventManager.addEventListener(document.documentElement,"mousedown",function(t){var o=t.target,r=t.x||t.clientX,s=t.y||t.clientY;if(!i&&e.rootElement){if(o===e.view.wt.wtTable.holder){var l=p();if(document.elementFromPoint(r+l,s)!==e.view.wt.wtTable.holder||document.elementFromPoint(r,s+l)!==e.view.wt.wtTable.holder)return}else for(;o!==document.documentElement;){if(null===o){if(t.isTargetWebComponent)break;return}if(o===e.rootElement)return;o=o.parentNode}n.settings.outsideClickDeselects?e.deselectCell():e.destroyEditor()}}),this.eventManager.addEventListener(r,"selectstart",function(e){n.settings.fragmentSelection||v(e.target)||e.preventDefault()});var s=function(){window.getSelection?window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges():document.selection&&document.selection.empty()},l=[new T({className:"current",border:{width:2,color:"#5292F7",cornerVisible:function(){return n.settings.fillHandle&&!n.isCellEdited()&&!e.selection.isMultiple()},multipleSelectionHandlesVisible:function(){return!n.isCellEdited()&&!e.selection.isMultiple()}}}),new T({className:"area",border:{width:1,color:"#89AFF9",cornerVisible:function(){return n.settings.fillHandle&&!n.isCellEdited()&&e.selection.isMultiple()},multipleSelectionHandlesVisible:function(){return!n.isCellEdited()&&e.selection.isMultiple()}}}),new T({className:"highlight",highlightRowClassName:n.settings.currentRowClassName,highlightColumnClassName:n.settings.currentColClassName}),new T({className:"fill",border:{width:1,color:"red"}})];l.current=l[0],l.area=l[1],l.highlight=l[2],l.fill=l[3];var a={debug:function(){return n.settings.debug},externalRowCalculator:this.instance.getPlugin("autoRowSize")&&this.instance.getPlugin("autoRowSize").isEnabled(),table:r,preventOverflow:function(){return t.settings.preventOverflow},stretchH:this.settings.stretchH,data:e.getDataAtCell,totalRows:function(){return e.countRows()},totalColumns:function(){return e.countCols()},fixedColumnsLeft:function(){return n.settings.fixedColumnsLeft},fixedRowsTop:function(){return n.settings.fixedRowsTop},fixedRowsBottom:function(){return n.settings.fixedRowsBottom},minSpareRows:function(){return n.settings.minSpareRows},renderAllRows:n.settings.renderAllRows,rowHeaders:function(){var t=[];return e.hasRowHeaders()&&t.push(function(e,t){n.appendRowHeader(e,t)}),Handsontable.hooks.run(e,"afterGetRowHeaderRenderers",t),t},columnHeaders:function(){var t=[];return e.hasColHeaders()&&t.push(function(e,t){n.appendColHeader(e,t)}),Handsontable.hooks.run(e,"afterGetColumnHeaderRenderers",t),t},columnWidth:e.getColWidth,rowHeight:e.getRowHeight,cellRenderer:function(e,t,o){var r=n.instance.colToProp(t),i=n.instance.getCellMeta(e,t),s=n.instance.getCellRenderer(i),l=n.instance.getDataAtRowProp(e,r);s(n.instance,o,e,t,r,l,i),Handsontable.hooks.run(n.instance,"afterRenderer",o,e,t,r,l,i)},selections:l,hideBorderOnMouseDownOver:function(){return n.settings.fragmentSelection},onCellMouseDown:function(t,o,r,s){var l,a,u=r.parentNode,c=u.parentNode;if(e.listen(),n.activeWt=s,i=!0,Handsontable.hooks.run(e,"beforeOnCellMouseDown",t,o,r),e.selection.setSelectedHeaders(!1,!1),!S(t)){if(2===t.button&&e.selection.inInSelection(o));else t.shiftKey?o.row>=0&&o.col>=0&&e.selection.setRangeEnd(o):(o.row<0||o.col<0)&&(o.row>=0||o.col>=0)?(o.row<0&&(l=c.childNodes.length-Array.prototype.indexOf.call(c.childNodes,u)-1,a=e.getHeaderColspan(o.col,l),e.selection.setSelectedHeaders(!1,!0),e.selectCell(0,o.col,e.countRows()-1,o.col+Math.max(0,a-1))),o.col<0&&(e.selection.setSelectedHeaders(!0,!1),e.selectCell(o.row,0,o.row,e.countCols()-1))):(o.row=o.row<0?0:o.row,o.col=o.col<0?0:o.col,e.selection.setRangeStart(o));Handsontable.hooks.run(e,"afterOnCellMouseDown",t,o,r),n.activeWt=n.wt}},onCellMouseOver:function(t,o,r,s){n.activeWt=s,o.row>=0&&o.col>=0?i&&e.selection.setRangeEnd(o):i&&(o.row<0&&(e.selection.selectedHeader.cols?(e.selection.setRangeEnd(new E(e.countRows()-1,o.col)),e.selection.setSelectedHeaders(!1,!0)):e.selection.setRangeEnd(new E(o.row,o.col))),o.col<0&&(e.selection.selectedHeader.rows?(e.selection.setRangeEnd(new E(o.row,e.countCols()-1)),e.selection.setSelectedHeaders(!0,!1)):e.selection.setRangeEnd(new E(o.row,o.col)))),Handsontable.hooks.run(e,"afterOnCellMouseOver",t,o,r),n.activeWt=n.wt},onCellCornerMouseDown:function(t){t.preventDefault(),Handsontable.hooks.run(e,"afterOnCellCornerMouseDown",t)},beforeDraw:function(e){n.beforeRender(e)},onDraw:function(e){n.onDraw(e)},onScrollVertically:function(){e.runHooks("afterScrollVertically")},onScrollHorizontally:function(){e.runHooks("afterScrollHorizontally")},onBeforeDrawBorders:function(t,n){e.runHooks("beforeDrawBorders",t,n)},onBeforeTouchScroll:function(){e.runHooks("beforeTouchScroll")},onAfterMomentumScroll:function(){e.runHooks("afterMomentumScroll")},onBeforeStretchingColumnWidth:function(t,n){return e.runHooks("beforeStretchingColumnWidth",t,n)},viewportRowCalculatorOverride:function(t){var o=e.countRows(),r=n.settings.viewportRowRenderingOffset;if("auto"===r&&n.settings.fixedRowsTop&&(r=10),"number"==typeof r&&(t.startRow=Math.max(t.startRow-r,0),t.endRow=Math.min(t.endRow+r,o-1)),"auto"===r){var i=t.startRow+t.endRow-t.startRow,s=Math.ceil(i/o*12);t.startRow=Math.max(t.startRow-s,0),t.endRow=Math.min(t.endRow+s,o-1)}e.runHooks("afterViewportRowCalculatorOverride",t)},viewportColumnCalculatorOverride:function(t){var o=e.countCols(),r=n.settings.viewportColumnRenderingOffset;if("auto"===r&&n.settings.fixedColumnsLeft&&(r=10),"number"==typeof r&&(t.startColumn=Math.max(t.startColumn-r,0),t.endColumn=Math.min(t.endColumn+r,o-1)),"auto"===r){var i=t.startColumn+t.endColumn-t.startColumn,s=Math.ceil(i/o*12);t.startRow=Math.max(t.startColumn-s,0),t.endColumn=Math.min(t.endColumn+s,o-1)}e.runHooks("afterViewportColumnCalculatorOverride",t)},rowHeaderWidth:function(){return n.settings.rowHeaderWidth},columnHeaderHeight:function(){return n.settings.columnHeaderHeight}};Handsontable.hooks.run(e,"beforeInitWalkontable",a),this.wt=new O(a),this.activeWt=this.wt,this.eventManager.addEventListener(n.wt.wtTable.spreader,"mousedown",function(e){e.target===n.wt.wtTable.spreader&&3===e.which&&R(e)}),this.eventManager.addEventListener(n.wt.wtTable.spreader,"contextmenu",function(e){e.target===n.wt.wtTable.spreader&&3===e.which&&R(e)}),this.eventManager.addEventListener(document.documentElement,"click",function(){n.settings.observeDOMVisibility&&n.wt.drawInterrupted&&(n.instance.forceFullRender=!0,n.render())})}Object.defineProperties(n,{TableView:{get:function(){return o}},__esModule:{value:!0}});var r,i,s,l,a,u,c=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),d=c.addClass,h=c.empty,f=c.fastInnerHTML,g=c.fastInnerText,p=c.getScrollbarWidth,m=c.hasClass,w=c.isChildOf,v=c.isInput,b=c.isOutsideInput,C=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).eventManager,y=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),R=y.stopPropagation,S=y.isImmediatePropagationStopped,E=(l=e("3rdparty/walkontable/src/cell/coords"),l&&l.__esModule&&l||{"default":l}).WalkontableCellCoords,T=(a=e("3rdparty/walkontable/src/selection"),a&&a.__esModule&&a||{"default":a}).WalkontableSelection,O=(u=e("3rdparty/walkontable/src/core"),u&&u.__esModule&&u||{"default":u}).Walkontable;Handsontable.TableView=o,o.prototype.isTextSelectionAllowed=function(e){if(v(e))return!0;var t=w(e,this.instance.view.wt.wtTable.spreader);return this.settings.fragmentSelection===!0&&t?!0:"cell"===this.settings.fragmentSelection&&this.isSelectedOnlyCell()&&t?!0:!1},o.prototype.isSelectedOnlyCell=function(){var e=this.instance.getSelected()||[],t=e[0],n=e[1],o=e[2],r=e[3];return void 0!==t&&t===o&&n===r},o.prototype.isCellEdited=function(){var e=this.instance.getActiveEditor();return e&&e.isOpened()},o.prototype.beforeRender=function(e){e&&Handsontable.hooks.run(this.instance,"beforeRender",this.instance.forceFullRender)},o.prototype.onDraw=function(e){e&&Handsontable.hooks.run(this.instance,"afterRender",this.instance.forceFullRender)},o.prototype.render=function(){this.wt.draw(!this.instance.forceFullRender),this.instance.forceFullRender=!1,this.instance.renderCall=!1},o.prototype.getCellAtCoords=function(e,t){var n=this.wt.getCell(e,t);return 0>n?null:n},o.prototype.scrollViewport=function(e){this.wt.scrollViewport(e)},o.prototype.appendRowHeader=function(e,t){if(t.firstChild){var n=t.firstChild;if(!m(n,"relative"))return h(t),void this.appendRowHeader(e,t);this.updateCellHeader(n.querySelector(".rowHeader"),e,this.instance.getRowHeader)}else{var o=document.createElement("div"),r=document.createElement("span");o.className="relative",r.className="rowHeader",this.updateCellHeader(r,e,this.instance.getRowHeader),o.appendChild(r),t.appendChild(o)}Handsontable.hooks.run(this.instance,"afterGetRowHeader",e,t)},o.prototype.appendColHeader=function(e,t){if(t.firstChild){var n=t.firstChild;m(n,"relative")?this.updateCellHeader(n.querySelector(".colHeader"),e,this.instance.getColHeader):(h(t),this.appendColHeader(e,t))}else{var o=document.createElement("div"),r=document.createElement("span");o.className="relative",r.className="colHeader",this.updateCellHeader(r,e,this.instance.getColHeader),o.appendChild(r),t.appendChild(o)}Handsontable.hooks.run(this.instance,"afterGetColHeader",e,t)},o.prototype.updateCellHeader=function(e,t,n){ -t>-1?f(e,n(t)):(g(e,String.fromCharCode(160)),d(e,"cornerHeader"))},o.prototype.maximumVisibleElementWidth=function(e){var t=this.wt.wtViewport.getWorkspaceWidth(),n=t-e;return n>0?n:0},o.prototype.maximumVisibleElementHeight=function(e){var t=this.wt.wtViewport.getWorkspaceHeight(),n=t-e;return n>0?n:0},o.prototype.mainViewIsActive=function(){return this.wt===this.activeWt},o.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}],100:[function(e,t,n){"use strict";Object.defineProperties(n,{GhostTable:{get:function(){return f}},__esModule:{value:!0}});var o,r,i,s,l,a=(o=e("helpers/dom/element"),o&&o.__esModule&&o||{"default":o}),u=a.addClass,c=a.outerHeight,d=a.outerWidth,h=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}).arrayEach,f=((i=e("helpers/object"),i&&i.__esModule&&i||{"default":i}).objectEach,(s=e("helpers/number"),s&&s.__esModule&&s||{"default":s}).rangeEach,(l=e("helpers/mixed"),l&&l.__esModule&&l||{"default":l}).stringify,function(e){this.hot=e,this.container=null,this.injected=!1,this.rows=[],this.columns=[],this.samples=null});$traceurRuntime.createClass(f,{addRow:function(e,t){if(this.columns.length)throw new Error("Doesn't support multi-dimensional table");this.rows.length||(this.container=this.createContainer(this.hot.rootElement.className));var n={row:e};this.rows.push(n),this.samples=t,this.table=this.createTable(this.hot.table.className),this.table.colGroup.appendChild(this.createColGroupsCol()),this.table.tr.appendChild(this.createRow(e)),this.container.container.appendChild(this.table.fragment),n.table=this.table.table},addColumn:function(e,t){if(this.rows.length)throw new Error("Doesn't support multi-dimensional table");this.columns.length||(this.container=this.createContainer(this.hot.rootElement.className));var n={col:e};this.columns.push(n),this.samples=t,this.table=this.createTable(this.hot.table.className),null!==this.hot.getColHeader(e)&&this.hot.view.appendColHeader(e,this.table.th),this.table.tBody.appendChild(this.createCol(e)),this.container.container.appendChild(this.table.fragment),n.table=this.table.table},getHeights:function(e){this.injected||this.injectTable(),h(this.rows,function(t){e(t.row,c(t.table)-1)})},getWidths:function(e){this.injected||this.injectTable(),h(this.columns,function(t){e(t.col,d(t.table))})},createColGroupsCol:function(){var e=this,t=document,n=t.createDocumentFragment();return n.appendChild(this.createColElement(-1)),this.samples.forEach(function(t){h(t.strings,function(t){n.appendChild(e.createColElement(t.col))})}),n},createRow:function(e){var t=this,n=document,o=n.createDocumentFragment(),r=n.createElement("th");return null!==this.hot.getRowHeader(e)&&this.hot.view.appendRowHeader(e,r),o.appendChild(r),this.samples.forEach(function(r){h(r.strings,function(r){var i=r.col,s=t.hot.getCellMeta(e,i);s.col=i,s.row=e;var l=t.hot.getCellRenderer(s),a=n.createElement("td");l(t.hot,a,e,i,t.hot.colToProp(i),r.value,s),o.appendChild(a)})}),o},createCol:function(e){var t=this,n=document,o=n.createDocumentFragment();return this.samples.forEach(function(r){h(r.strings,function(r){var i=r.row,s=t.hot.getCellMeta(i,e);s.col=e,s.row=i;var l=t.hot.getCellRenderer(s),a=n.createElement("td"),u=n.createElement("tr");l(t.hot,a,i,e,t.hot.colToProp(e),r.value,s),u.appendChild(a),o.appendChild(u)})}),o},clean:function(){this.rows.length=0,this.columns.length=0,this.samples&&this.samples.clear(),this.samples=null,this.removeTable()},injectTable:function(){var e=void 0!==arguments[0]?arguments[0]:null;this.injected||((e||this.hot.rootElement).appendChild(this.container.fragment),this.injected=!0)},removeTable:function(){this.injected&&this.container.container.parentNode&&(this.container.container.parentNode.removeChild(this.container.container),this.container=null,this.injected=!1)},createColElement:function(e){var t=document,n=t.createElement("col");return n.style.width=this.hot.view.wt.wtTable.getStretchedColumnWidth(e)+"px",n},createTable:function(){var e=void 0!==arguments[0]?arguments[0]:"",t=document,n=t.createDocumentFragment(),o=t.createElement("table"),r=t.createElement("thead"),i=t.createElement("tbody"),s=t.createElement("colgroup"),l=t.createElement("tr"),a=t.createElement("th");return this.isVertical()&&o.appendChild(s),this.isHorizontal()&&(l.appendChild(a),r.appendChild(l),o.style.tableLayout="auto",o.style.width="auto"),o.appendChild(r),this.isVertical()&&i.appendChild(l),o.appendChild(i),u(o,e),n.appendChild(o),{fragment:n,table:o,tHead:r,tBody:i,colGroup:s,tr:l,th:a}},createContainer:function(){var e=void 0!==arguments[0]?arguments[0]:"",t=document,n=t.createDocumentFragment(),o=t.createElement("div");return e="htGhostTable htAutoSize "+e.trim(),u(o,e),n.appendChild(o),{fragment:n,container:o}},isVertical:function(){return this.rows.length&&!this.columns.length?!0:!1},isHorizontal:function(){return this.columns.length&&!this.rows.length?!0:!1}},{}),Handsontable.utils=Handsontable.utils||{},Handsontable.utils.GhostTable=f},{"helpers/array":42,"helpers/dom/element":45,"helpers/mixed":48,"helpers/number":49,"helpers/object":50}],101:[function(e,t,n){"use strict";var o;Object.defineProperties(n,{SamplesGenerator:{get:function(){return g}},__esModule:{value:!0}});var r,i,s,l,a,u=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),c=(u.addClass,u.outerHeight,u.outerWidth,(i=e("helpers/array"),i&&i.__esModule&&i||{"default":i}).arrayEach,s=e("helpers/object"),s&&s.__esModule&&s||{"default":s}),d=(c.objectEach,c.isObject),h=(l=e("helpers/number"),l&&l.__esModule&&l||{"default":l}).rangeEach,f=(a=e("helpers/mixed"),a&&a.__esModule&&a||{"default":a}).stringify,g=function(e){this.samples=null,this.dataFactory=e,this.customSampleCount=null},p=g;$traceurRuntime.createClass(g,(o={},Object.defineProperty(o,"getSampleCount",{value:function(){return this.customSampleCount?this.customSampleCount:p.SAMPLE_COUNT},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(o,"generateRowSamples",{value:function(e,t){return this.generateSamples("row",t,e)},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(o,"generateColumnSamples",{value:function(e,t){return this.generateSamples("col",t,e)},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(o,"generateSamples",{value:function(e,t,n){var o=this,r=new Map;return"number"==typeof n&&(n={from:n,to:n}),h(n.from,n.to,function(n){var i=o.generateSample(e,t,n);r.set(n,i)}),r},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(o,"generateSample",{value:function(e,t,n){var o,r=this,i=new Map,s=[];return h(t.from,t.to,function(t){var l,a;if("row"===e)a=r.dataFactory(n,t);else{if("col"!==e)throw new Error("Unsupported sample type");a=r.dataFactory(t,n)}o=d(a)?Object.keys(a).length:Array.isArray(a)?a.length:f(a).length,i.has(o)||i.set(o,{needed:r.getSampleCount(),strings:[]});var u=i.get(o);if(u.needed){var c=s.indexOf(a)>-1;if(!c){var h="row"===e?"col":"row";u.strings.push((l={},Object.defineProperty(l,"value",{value:a,configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(l,h,{value:t,configurable:!0,enumerable:!0,writable:!0}),l)),s.push(a),u.needed--}}}),i},configurable:!0,enumerable:!0,writable:!0}),o),{get SAMPLE_COUNT(){return 3}}),Handsontable.utils=Handsontable.utils||{},Handsontable.utils.SamplesGenerator=g},{"helpers/array":42,"helpers/dom/element":45,"helpers/mixed":48,"helpers/number":49,"helpers/object":50}],102:[function(e,t,n){"use strict";function o(e,t){var n=e,o="string"==typeof n?n.toLowerCase():null;return function(e){for(var r=!1,s=0,l=e.length;l>s;s++){if(n===e[s]){r=!0;break}if(o===i(e[s]).toLowerCase()){r=!0;break}}t(r)}}var r,i=(r=e("helpers/mixed"),r&&r.__esModule&&r||{"default":r}).stringify;Handsontable.AutocompleteValidator=function(e,t){this.strict&&this.source?"function"==typeof this.source?this.source(e,o(e,t)):o(e,t)(this.source):t(!0)}},{"helpers/mixed":48}],103:[function(e,t,n){"use strict";var o,r,i=(o=e("moment"),o&&o.__esModule&&o||{"default":o})["default"],s=(r=e("editors"),r&&r.__esModule&&r||{"default":r}).getEditor;Handsontable.DateValidator=function(e,t){var n=!0,o=s("date",this.instance);null==e&&(e="");var r=i(new Date(e)).isValid(),a=i(e,this.dateFormat||o.defaultDateFormat,!0).isValid();if(this.allowEmpty&&""===e&&(r=!0,a=!0),r||(n=!1),!r&&a&&(n=!0),r&&!a)if(this.correctFormat===!0){var u=l(e,this.dateFormat);this.instance.setDataAtCell(this.row,this.col,u,"dateValidator"),n=!0}else n=!1;t(n)};var l=function(e,t){var n=i(new Date(e)),o=n.format("YYYY"),r=i().format("YYYY");return o.substr(0,2)!==r.substr(0,2)?e.match(new RegExp(o))||n.year(o.replace(o.substr(0,2),r.substr(0,2))):o.length>4&&n.year((n.year()+"").substr(0,4)),n.format(t)}},{editors:29,moment:void 0}],104:[function(e,t,n){"use strict";Handsontable.NumericValidator=function(e,t){null==e&&(e=""),t(this.allowEmpty&&""===e?!0:""===e?!1:/^-?\d*(\.|\,)?\d*$/.test(e))}},{}],SheetClip:[function(e,t,n){"use strict";!function(e){function t(e){return e.split('"').length-1}var o={parse:function(e){var n,o,r,i,s,l,a,u=[],c=0;for(r=e.split("\n"),r.length>1&&""===r[r.length-1]&&r.pop(),n=0,o=r.length;o>n;n+=1){for(r[n]=r[n].split(" "),i=0,s=r[n].length;s>i;i+=1)u[c]||(u[c]=[]),l&&0===i?(a=u[c].length-1,u[c][a]=u[c][a]+"\n"+r[n][0],l&&1&t(r[n][0])&&(l=!1,u[c][a]=u[c][a].substring(0,u[c][a].length-1).replace(/""/g,'"'))):i===s-1&&0===r[n][i].indexOf('"')&&1&t(r[n][i])?(u[c].push(r[n][i].substring(1).replace(/""/g,'"')),l=!0):(u[c].push(r[n][i].replace(/""/g,'"')),l=!1);l||(c+=1)}return u},stringify:function(e){var t,n,o,r,i,s="";for(t=0,n=e.length;n>t;t+=1){for(r=e[t].length,o=0;r>o;o+=1)o>0&&(s+=" "),i=e[t][o],s+="string"==typeof i?i.indexOf("\n")>-1?'"'+i.replace(/"/g,'""')+'"':i:null===i||void 0===i?"":i;s+="\n"}return s}};"undefined"!=typeof n?(n.parse=o.parse,n.stringify=o.stringify):e.SheetClip=o}(window)},{}],autoResize:[function(e,t,n){"use strict";function o(){var e,t={minHeight:200,maxHeight:300,minWidth:100,maxWidth:300},n=document.body,o=document.createTextNode(""),r=document.createElement("SPAN"),i=function(e,t,n){window.attachEvent?e.attachEvent("on"+t,n):e.addEventListener(t,n,!1)},s=function(e,t,n){window.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent("on"+t,n)},l=function(i){var s,l;i?/^[a-zA-Z \.,\\\/\|0-9]$/.test(i)||(i="."):i="",void 0!==o.textContent?o.textContent=e.value+i:o.data=e.value+i,r.style.fontSize=Handsontable.Dom.getComputedStyle(e).fontSize,r.style.fontFamily=Handsontable.Dom.getComputedStyle(e).fontFamily,r.style.whiteSpace="pre",n.appendChild(r),s=r.clientWidth+2,n.removeChild(r),e.style.height=t.minHeight+"px",t.minWidth>s?e.style.width=t.minWidth+"px":s>t.maxWidth?e.style.width=t.maxWidth+"px":e.style.width=s+"px",l=e.scrollHeight?e.scrollHeight-1:0,t.minHeight>l?e.style.height=t.minHeight+"px":t.maxHeight-1||"true"===e.contentEditable}var n=this,o=!1;if(e.metaKey?o=!0:e.ctrlKey&&-1===navigator.userAgent.indexOf("Mac")&&(o=!0),o){if(document.activeElement!==this.elTextarea&&(""!==this.getSelectionText()||t()))return;this.selectNodeText(this.elTextarea),setTimeout(function(){document.activeElement!==n.elTextarea&&n.selectNodeText(n.elTextarea)},0)}!o||67!==e.keyCode&&86!==e.keyCode&&88!==e.keyCode||(88===e.keyCode?setTimeout(function(){n.triggerCut(e)},0):86===e.keyCode&&setTimeout(function(){n.triggerPaste(e)},0))},r.prototype.selectNodeText=function(e){e&&e.select()},r.prototype.getSelectionText=function(){var e="";return window.getSelection?e=window.getSelection().toString():document.selection&&"Control"!==document.selection.type&&(e=document.selection.createRange().text),e},r.prototype.copyable=function(e){if("string"!=typeof e&&void 0===e.toString)throw new Error("copyable requires string parameter");this.elTextarea.value=e,this.selectNodeText(this.elTextarea)},r.prototype.onCut=function(e){this.cutCallbacks.push(e)},r.prototype.onPaste=function(e){this.pasteCallbacks.push(e)},r.prototype.removeCallback=function(e){var t,n;for(t=0,n=this.copyCallbacks.length;n>t;t++)if(this.copyCallbacks[t]===e)return this.copyCallbacks.splice(t,1),!0;for(t=0,n=this.cutCallbacks.length;n>t;t++)if(this.cutCallbacks[t]===e)return this.cutCallbacks.splice(t,1),!0;for(t=0,n=this.pasteCallbacks.length;n>t;t++)if(this.pasteCallbacks[t]===e)return this.pasteCallbacks.splice(t,1),!0;return!1},r.prototype.triggerCut=function(e){var t=this;t.cutCallbacks&&setTimeout(function(){for(var n=0,o=t.cutCallbacks.length;o>n;n++)t.cutCallbacks[n](e)},50)},r.prototype.triggerPaste=function(e,t){var n=this;n.pasteCallbacks&&setTimeout(function(){for(var o=t||n.elTextarea.value,r=0,i=n.pasteCallbacks.length;i>r;r++)n.pasteCallbacks[r](o,e)},50)},r.prototype.destroy=function(){this.hasBeenDestroyed()||0!==--this.refCounter||(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)},r.prototype.hasBeenDestroyed=function(){return!this.refCounter}},{}],es6collections:[function(e,t,n){"use strict";!function(e){function t(e,t){function o(e){return this&&this.constructor===o?(this._keys=[],this._values=[],this._itp=[],this.objectOnly=t,void(e&&n.call(this,e))):new o(e)}return t||b(e,"size",{get:m}),e.constructor=o,o.prototype=e,o}function n(e){this.add?e.forEach(this.add,this):e.forEach(function(e){this.set(e[0],e[1])},this)}function o(e){return this.has(e)&&(this._keys.splice(v,1),this._values.splice(v,1),this._itp.forEach(function(e){v-1}function r(e){return this.has(e)?this._values[v]:void 0}function i(e,t){if(this.objectOnly&&t!==Object(t))throw new TypeError("Invalid value used as weak collection key");if(t!=t||0===t)for(v=e.length;v--&&!C(e[v],t););else v=e.indexOf(t);return v>-1}function s(e){return i.call(this,this._values,e)}function l(e){return i.call(this,this._keys,e)}function a(e,t){return this.has(e)?this._values[v]=t:this._values[this._keys.push(e)-1]=t,this}function u(e){return this.has(e)||this._values.push(e),this}function c(){this._values.length=0}function d(){return p(this._itp,this._keys)}function h(){return p(this._itp,this._values)}function f(){return p(this._itp,this._keys,this._values)}function g(){return p(this._itp,this._values,this._values)}function p(e,t,n){var o=[0],r=!1;return e.push(o),{next:function(){var i,s=o[0];return!r&&st;t++)if(v[t].obj===e)return v[t]}function i(e){for(var t=0,n=v.length;n>t;t++)v[t]===e&&v.splice(t,1)}function s(e,t){for(var n=0,o=e.observers.length;o>n;n++)if(e.observers[n].callback===t)return e.observers[n].observer}function l(e,t){for(var n=0,o=e.observers.length;o>n;n++)if(e.observers[n].observer===t)return e.observers.splice(n,1),void(e.observers.length||i(e))}function a(e,t){h(t),Object.observe?d(t,e):clearTimeout(t.next);var n=r(e);l(n,t)}function u(e,t){var n,i=[],l=e,a=r(e);if(a?n=s(a,t):(a=new b(e),v.push(a)),n)return n;if(Object.observe)n=function(r){d(n,e),c(n,e);for(var s=0,a=r.length;a>s;){if(("length"!==r[s].name||!R(r[s].object))&&"__Jasmine_been_here_before__"!==r[s].name){var u=r[s].type;switch(u){case"new":u="add";break;case"deleted":u="delete";break;case"updated":u="update"}w[u].call(r[s],i,o(l,r[s].object))}s++}i&&t&&t(i),n.patches=i,i=[]};else if(n={},a.value=JSON.parse(JSON.stringify(e)),t){n.callback=t,n.next=null;var u=this.intervals||[100,1e3,1e4,6e4],f=0,g=function(){h(n)},p=function(){clearTimeout(n.next),n.next=setTimeout(function(){g(),f=0,n.next=setTimeout(m,u[f++])},0)},m=function(){g(),f==u.length&&(f=u.length-1),n.next=setTimeout(m,u[f++])};"undefined"!=typeof window&&(window.addEventListener?(window.addEventListener("mousedown",p),window.addEventListener("mouseup",p),window.addEventListener("keydown",p)):(window.attachEvent("onmousedown",p),window.attachEvent("onmouseup",p),window.attachEvent("onkeydown",p))),n.next=setTimeout(m,u[f++])}return n.patches=i,n.object=e,a.observers.push(new C(t,n)),c(n,e)}function c(e,t){if(Object.observe){Object.observe(t,e);for(var n in t)if(t.hasOwnProperty(n)){var o=t[n];o&&"object"==typeof o&&c(e,o)}}return e}function d(e,t){if(Object.observe){Object.unobserve(t,e);for(var n in t)if(t.hasOwnProperty(n)){var o=t[n];o&&"object"==typeof o&&d(e,o)}}return e}function h(e){if(Object.observe)Object.deliverChangeRecords(e);else{for(var t,n=0,o=v.length;o>n;n++)if(v[n].obj===e.object){t=v[n];break}t&&f(t.value,e.object,e.patches,"")}var r=e.patches;return r.length>0&&(e.patches=[],e.callback&&e.callback(r)),r}function f(e,n,o,r){for(var i=y(n),s=y(e),l=!1,a=!1,u=s.length-1;u>=0;u--){var c=s[u],d=e[c];if(n.hasOwnProperty(c)){var h=n[c];d instanceof Object?f(d,h,o,r+"/"+t(c)):d!=h&&(l=!0,o.push({op:"replace",path:r+"/"+t(c),value:h}),e[c]=h)}else o.push({op:"remove",path:r+"/"+t(c)}),delete e[c],a=!0}if(a||i.length!=s.length)for(var u=0;ur;){n=t[r];for(var s=n.path.split("/"),l=e,a=1,u=s.length;;)if(R(l)){var c=parseInt(s[a],10);if(a++,a>=u){o=m[n.op].call(n,l,c,e);break}l=l[c]}else{var d=s[a];if(-1!=d.indexOf("~")&&(d=d.replace(/~1/g,"/").replace(/~0/g,"~")),a++,a>=u){o=p[n.op].call(n,l,d,e);break}l=l[d]}r++}return o}var p={add:function(e,t){return e[t]=this.value,!0},remove:function(e,t){return delete e[t],!0},replace:function(e,t){return e[t]=this.value,!0},move:function(e,t,n){var o={op:"_get",path:this.from};return g(n,[o]),g(n,[{op:"remove",path:this.from}]),g(n,[{op:"add",path:this.path,value:o.value}]),!0},copy:function(e,t,n){var o={op:"_get",path:this.from};return g(n,[o]),g(n,[{op:"add",path:this.path,value:o.value}]),!0},test:function(e,t){return JSON.stringify(e[t])===JSON.stringify(this.value)},_get:function(e,t){this.value=e[t]}},m={add:function(e,t){return e.splice(t,0,this.value),!0},remove:function(e,t){return e.splice(t,1),!0},replace:function(e,t){return e[t]=this.value,!0},move:p.move,copy:p.copy,test:p.test,_get:p._get},w={add:function(e,n){var o={op:"add",path:n+t(this.name),value:this.object[this.name]};e.push(o)},"delete":function(e,n){var o={op:"remove",path:n+t(this.name)};e.push(o)},update:function(e,n){var o={op:"replace",path:n+t(this.name),value:this.object[this.name]};e.push(o)}},v=[];e.intervals;var b=function(){function e(e){this.observers=[],this.obj=e}return e}(),C=function(){function e(e,t){this.callback=e,this.observer=t}return e}();e.unobserve=a,e.observe=u,e.generate=h;var y;y=Object.keys?Object.keys:function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t};var R;R=Array.isArray?Array.isArray:function(e){return e.push&&"number"==typeof e.length},e.apply=g}(o||(o={})),"undefined"!=typeof n&&(n.apply=o.apply,n.observe=o.observe,n.unobserve=o.unobserve,n.generate=o.generate)},{}],numeral:[function(t,n,o){"use strict";(function(){function t(e){this._value=e}function o(e,t,n,o){var r,i,s=Math.pow(10,t);return i=(n(e*s)/s).toFixed(t),o&&(r=new RegExp("0{1,"+o+"}$"),i=i.replace(r,"")),i}function r(e,t,n){var o;return o=t.indexOf("$")>-1?s(e,t,n):t.indexOf("%")>-1?l(e,t,n):t.indexOf(":")>-1?a(e,t):c(e._value,t,n)}function i(e,t){var n,o,r,i,s,l=t,a=["KB","MB","GB","TB","PB","EB","ZB","YB"],c=!1;if(t.indexOf(":")>-1)e._value=u(t);else if(t===v)e._value=0;else{for("."!==m[w].delimiters.decimal&&(t=t.replace(/\./g,"").replace(m[w].delimiters.decimal,".")),n=new RegExp("[^a-zA-Z]"+m[w].abbreviations.thousand+"(?:\\)|(\\"+m[w].currency.symbol+")?(?:\\))?)?$"),o=new RegExp("[^a-zA-Z]"+m[w].abbreviations.million+"(?:\\)|(\\"+m[w].currency.symbol+")?(?:\\))?)?$"),r=new RegExp("[^a-zA-Z]"+m[w].abbreviations.billion+"(?:\\)|(\\"+m[w].currency.symbol+")?(?:\\))?)?$"),i=new RegExp("[^a-zA-Z]"+m[w].abbreviations.trillion+"(?:\\)|(\\"+m[w].currency.symbol+")?(?:\\))?)?$"),s=0;s<=a.length&&!(c=t.indexOf(a[s])>-1?Math.pow(1024,s+1):!1);s++);e._value=(c?c:1)*(l.match(n)?Math.pow(10,3):1)*(l.match(o)?Math.pow(10,6):1)*(l.match(r)?Math.pow(10,9):1)*(l.match(i)?Math.pow(10,12):1)*(t.indexOf("%")>-1?.01:1)*((t.split("-").length+Math.min(t.split("(").length-1,t.split(")").length-1))%2?1:-1)*Number(t.replace(/[^0-9\.]+/g,"")),e._value=c?Math.ceil(e._value):e._value}return e._value}function s(e,t,n){var o,r,i=t.indexOf("$"),s=t.indexOf("("),l=t.indexOf("-"),a="";return t.indexOf(" $")>-1?(a=" ",t=t.replace(" $","")):t.indexOf("$ ")>-1?(a=" ",t=t.replace("$ ","")):t=t.replace("$",""),r=c(e._value,t,n),1>=i?r.indexOf("(")>-1||r.indexOf("-")>-1?(r=r.split(""),o=1,(s>i||l>i)&&(o=0),r.splice(o,0,m[w].currency.symbol+a),r=r.join("")):r=m[w].currency.symbol+a+r:r.indexOf(")")>-1?(r=r.split(""),r.splice(-1,0,a+m[w].currency.symbol),r=r.join("")):r=r+a+m[w].currency.symbol,r}function l(e,t,n){var o,r="",i=100*e._value;return t.indexOf(" %")>-1?(r=" ",t=t.replace(" %","")):t=t.replace("%",""),o=c(i,t,n),o.indexOf(")")>-1?(o=o.split(""),o.splice(-1,0,r+"%"),o=o.join("")):o=o+r+"%",o}function a(e){var t=Math.floor(e._value/60/60),n=Math.floor((e._value-60*t*60)/60),o=Math.round(e._value-60*t*60-60*n);return t+":"+(10>n?"0"+n:n)+":"+(10>o?"0"+o:o)}function u(e){var t=e.split(":"),n=0;return 3===t.length?(n+=60*Number(t[0])*60,n+=60*Number(t[1]),n+=Number(t[2])):2===t.length&&(n+=60*Number(t[0]),n+=Number(t[1])),Number(n)}function c(e,t,n){var r,i,s,l,a,u,c=!1,d=!1,h=!1,f="",g=!1,p=!1,b=!1,C=!1,y=!1,R="",S="",E=Math.abs(e),T=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],O="",_=!1;if(0===e&&null!==v)return v;if(t.indexOf("(")>-1?(c=!0,t=t.slice(1,-1)):t.indexOf("+")>-1&&(d=!0,t=t.replace(/\+/g,"")),t.indexOf("a")>-1&&(g=t.indexOf("aK")>=0,p=t.indexOf("aM")>=0,b=t.indexOf("aB")>=0,C=t.indexOf("aT")>=0,y=g||p||b||C,t.indexOf(" a")>-1?(f=" ",t=t.replace(" a","")):t=t.replace("a",""),E>=Math.pow(10,12)&&!y||C?(f+=m[w].abbreviations.trillion,e/=Math.pow(10,12)):E=Math.pow(10,9)&&!y||b?(f+=m[w].abbreviations.billion,e/=Math.pow(10,9)):E=Math.pow(10,6)&&!y||p?(f+=m[w].abbreviations.million,e/=Math.pow(10,6)):(E=Math.pow(10,3)&&!y||g)&&(f+=m[w].abbreviations.thousand,e/=Math.pow(10,3))),t.indexOf("b")>-1)for(t.indexOf(" b")>-1?(R=" ",t=t.replace(" b","")):t=t.replace("b",""),s=0;s<=T.length;s++)if(r=Math.pow(1024,s),i=Math.pow(1024,s+1),e>=r&&i>e){R+=T[s],r>0&&(e/=r);break}return t.indexOf("o")>-1&&(t.indexOf(" o")>-1?(S=" ",t=t.replace(" o","")):t=t.replace("o",""),S+=m[w].ordinal(e)),t.indexOf("[.]")>-1&&(h=!0,t=t.replace("[.]",".")),l=e.toString().split(".")[0],a=t.split(".")[1],u=t.indexOf(","),a?(a.indexOf("[")>-1?(a=a.replace("]",""),a=a.split("["),O=o(e,a[0].length+a[1].length,n,a[1].length)):O=o(e,a.length,n),l=O.split(".")[0],O=O.split(".")[1].length?m[w].delimiters.decimal+O.split(".")[1]:"",h&&0===Number(O.slice(1))&&(O="")):l=o(e,null,n),l.indexOf("-")>-1&&(l=l.slice(1),_=!0),u>-1&&(l=l.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+m[w].delimiters.thousands)),0===t.indexOf(".")&&(l=""),(c&&_?"(":"")+(!c&&_?"-":"")+(!_&&d?"+":"")+l+O+(S?S:"")+(f?f:"")+(R?R:"")+(c&&_?")":"")}function d(e,t){m[e]=t}function h(e){var t=e.toString().split(".");return t.length<2?1:Math.pow(10,t[1].length)}function f(){var e=Array.prototype.slice.call(arguments);return e.reduce(function(e,t){var n=h(e),o=h(t);return n>o?n:o},-(1/0))}var g,p="1.5.3",m={},w="en",v=null,b="0,0",C="undefined"!=typeof n&&n.exports;g=function(e){return g.isNumeral(e)?e=e.value():0===e||"undefined"==typeof e?e=0:Number(e)||(e=g.fn.unformat(e)),new t(Number(e))},g.version=p,g.isNumeral=function(e){return e instanceof t},g.language=function(e,t){if(!e)return w;if(e&&!t){if(!m[e])throw new Error("Unknown language : "+e);w=e}return(t||!m[e])&&d(e,t),g},g.languageData=function(e){if(!e)return m[w];if(!m[e])throw new Error("Unknown language : "+e);return m[e]},g.language("en",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(e){var t=e%10;return 1===~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th"},currency:{symbol:"$"}}),g.zeroFormat=function(e){v="string"==typeof e?e:null},g.defaultFormat=function(e){b="string"==typeof e?e:"0.0"},g.validate=function(e,t){var n,o,r,i,s,l,a,u;if("string"!=typeof e&&(e+="",console.warn&&console.warn("Numeral.js: Value is not string. It has been co-erced to: ",e)),e=e.trim(),""===e)return!1;e=e.replace(/^[+-]?/,"");try{a=g.languageData(t)}catch(c){a=g.languageData(g.language())}return r=a.currency.symbol,s=a.abbreviations,n=a.delimiters.decimal,o="."===a.delimiters.thousands?"\\.":a.delimiters.thousands,u=e.match(/^[^\d\.\,]+/),null!==u&&(e=e.substr(1),u[0]!==r)?!1:(u=e.match(/[^\d]+$/),null!==u&&(e=e.slice(0,-1),u[0]!==s.thousand&&u[0]!==s.million&&u[0]!==s.billion&&u[0]!==s.trillion)?!1:e.match(/^\d+$/)?!0:(l=new RegExp(o+"{2}"),e.match(/[^\d.,]/g)?!1:(i=e.split(n),i.length>2?!1:i.length<2?!!i[0].match(/^\d+.*\d$/)&&!i[0].match(l):""===i[0]?!i[0].match(l)&&!!i[1].match(/^\d+$/):1===i[0].length?!!i[0].match(/^\d+$/)&&!i[0].match(l)&&!!i[1].match(/^\d+$/):!!i[0].match(/^\d+.*\d$/)&&!i[0].match(l)&&!!i[1].match(/^\d+$/))))},"function"!=typeof Array.prototype.reduce&&(Array.prototype.reduce=function(e,t){if(null===this||"undefined"==typeof this)throw new TypeError("Array.prototype.reduce called on null or undefined");if("function"!=typeof e)throw new TypeError(e+" is not a function");var n,o,r=this.length>>>0,i=!1;for(1n;++n)this.hasOwnProperty(n)&&(i?o=e(o,this[n],n,this):(o=this[n],i=!0));if(!i)throw new TypeError("Reduce of empty array with no initial value");return o}),g.fn=t.prototype={clone:function(){return g(this)},format:function(e,t){return r(this,e?e:b,void 0!==t?t:Math.round)},unformat:function(e){return"[object Number]"===Object.prototype.toString.call(e)?e:i(this,e?e:b)},value:function(){return this._value},valueOf:function(){return this._value},set:function(e){return this._value=Number(e),this},add:function(e){function t(e,t,o,r){return e+n*t}var n=f.call(null,this._value,e);return this._value=[this._value,e].reduce(t,0)/n,this},subtract:function(e){function t(e,t,o,r){return e-n*t}var n=f.call(null,this._value,e);return this._value=[e].reduce(t,this._value*n)/n,this},multiply:function(e){function t(e,t,n,o){var r=f(e,t);return e*r*(t*r)/(r*r)}return this._value=[this._value,e].reduce(t,1),this},divide:function(e){function t(e,t,n,o){var r=f(e,t);return e*r/(t*r)}return this._value=[this._value,e].reduce(t),this},difference:function(e){return Math.abs(g(this._value).subtract(e).value())}},C&&(n.exports=g),"undefined"==typeof ender&&(this.numeral=g),"function"==typeof e&&e.amd&&e([],function(){return g})}).call(window)},{}]},{},[23,59,61,60,62,83,84,85,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,86,87,88,89,102,103,104,92,93,94,95,96,97,31,35,32,33,40,34,36,37,38,39])("numeral")}); \ No newline at end of file +!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.Handsontable=e()}}(function(){var e;return function(e,t,o){return function n(e,t,o){function i(l,a){if(!t[l]){if(!e[l]){var u="function"==typeof require&&require;if(!a&&u)return u(l,!0);if(r)return r(l,!0);if(s[l]&&"undefined"!=typeof window[s[l]])return window[s[l]];var c=new Error("Cannot find module '"+l+"'");throw c.code="MODULE_NOT_FOUND",c}var h=t[l]={exports:{}};e[l][0].call(h.exports,function(t){var o=e[l][1][t];return i(o?o:t)},h,h.exports,n,e,t,o)}return t[l].exports}for(var r="function"==typeof require&&require,s=JSON.parse('{"zeroclipboard":"ZeroClipboard","moment":"moment","pikaday":"Pikaday"}')||{},l=0;l1)for(t=1,n=arguments.length;n>t;t++)i.push(arguments[t]);if(a){if("undefined"==typeof a[e])throw new Error("Handsontable do not provide action: "+e);r=a[e].apply(a,i),"destroy"===e&&l.removeData()}return r}}(window,jQuery,Handsontable)},{}],2:[function(e,t,o){"use strict";Object.defineProperties(o,{WalkontableBorder:{get:function(){return b}},__esModule:{value:!0}});var n,i,r,s,l,a=(n=e("helpers/dom/element"),n&&n.__esModule&&n||{"default":n}),u=a.getComputedStyle,c=a.getTrimmingContainer,h=a.innerWidth,d=a.innerHeight,f=a.offset,g=a.outerHeight,p=a.outerWidth,m=(i=e("helpers/dom/event"),i&&i.__esModule&&i||{"default":i}).stopImmediatePropagation,w=(r=e("eventManager"),r&&r.__esModule&&r||{"default":r}).EventManager,v=(s=e("cell/coords"),s&&s.__esModule&&s||{"default":s}).WalkontableCellCoords,b=((l=e("overlay/_base.js"),l&&l.__esModule&&l||{"default":l}).WalkontableOverlay,function(e,t){t&&(this.eventManager=new w(e),this.instance=e,this.wot=e,this.settings=t,this.mouseDown=!1,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(t),this.registerListeners())});$traceurRuntime.createClass(b,{registerListeners:function(){var e=this;this.eventManager.addEventListener(document.body,"mousedown",function(){return e.onMouseDown()}),this.eventManager.addEventListener(document.body,"mouseup",function(){return e.onMouseUp()});for(var t=this,o=function(o,n){t.eventManager.addEventListener(t.main.childNodes[o],"mouseenter",function(t){return e.onMouseEnter(t,e.main.childNodes[o])})},n=0,i=this.main.childNodes.length;i>n;n++)o(n,i)},onMouseDown:function(){this.mouseDown=!0},onMouseUp:function(){this.mouseDown=!1},onMouseEnter:function(e,t){function o(e){return e.clientYMath.ceil(r.top+r.height)?!0:e.clientXMath.ceil(r.left+r.width)?!0:void 0}function n(e){o(e)&&(i.eventManager.removeEventListener(document.body,"mousemove",n),t.style.display="block")}if(this.mouseDown&&this.wot.getSetting("hideBorderOnMouseDownOver")){e.preventDefault(),m(e);var i=this,r=t.getBoundingClientRect();t.style.display="none",this.eventManager.addEventListener(document.body,"mousemove",n)}},createBorders:function(e){this.main=document.createElement("div");var t=["top","left","bottom","right","corner"],o=this.main.style;o.position="absolute",o.top=0,o.left=0;for(var n=0;5>n;n++){var i=t[n],r=document.createElement("div");r.className="wtBorder "+(this.settings.className||""),this.settings[i]&&this.settings[i].hide&&(r.className+=" hidden"),o=r.style,o.backgroundColor=this.settings[i]&&this.settings[i].color?this.settings[i].color:e.border.color,o.height=this.settings[i]&&this.settings[i].width?this.settings[i].width+"px":e.border.width+"px",o.width=this.settings[i]&&this.settings[i].width?this.settings[i].width+"px":e.border.width+"px",this.main.appendChild(r)}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(" "),Handsontable.mobileBrowser&&this.createMultipleSelectorHandles(),this.disappear(),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 e=10,t=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 o={position:"absolute",height:t+"px",width:t+"px","border-radius":parseInt(t/1.5,10)+"px"};for(var n in o)o.hasOwnProperty(n)&&(this.selectionHandles.styles.bottomRightHitArea[n]=o[n],this.selectionHandles.styles.topLeftHitArea[n]=o[n]);var i={position:"absolute",height:e+"px",width:e+"px","border-radius":parseInt(e/1.5,10)+"px",background:"#F5F5FF",border:"1px solid #4285c8"};for(var r in i)i.hasOwnProperty(r)&&(this.selectionHandles.styles.bottomRight[r]=i[r],this.selectionHandles.styles.topLeft[r]=i[r]);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(e,t){return this.wot.selections.area.cellRange&&(e!=this.wot.selections.area.cellRange.to.row||t!=this.wot.selections.area.cellRange.to.col)},updateMultipleSelectionHandlesPosition:function(e,t,o,n,i,r){var s=parseInt(this.selectionHandles.styles.topLeft.width,10),l=parseInt(this.selectionHandles.styles.topLeftHitArea.width,10);this.selectionHandles.styles.topLeft.top=parseInt(o-s,10)+"px",this.selectionHandles.styles.topLeft.left=parseInt(n-s,10)+"px",this.selectionHandles.styles.topLeftHitArea.top=parseInt(o-l/4*3,10)+"px",this.selectionHandles.styles.topLeftHitArea.left=parseInt(n-l/4*3,10)+"px",this.selectionHandles.styles.bottomRight.top=parseInt(o+r,10)+"px",this.selectionHandles.styles.bottomRight.left=parseInt(n+i,10)+"px",this.selectionHandles.styles.bottomRightHitArea.top=parseInt(o+r-l/4,10)+"px",this.selectionHandles.styles.bottomRightHitArea.left=parseInt(n+i-l/4,10)+"px",this.settings.border.multipleSelectionHandlesVisible&&this.settings.border.multipleSelectionHandlesVisible()?(this.selectionHandles.styles.topLeft.display="block",this.selectionHandles.styles.topLeftHitArea.display="block",this.isPartRange(e,t)?(this.selectionHandles.styles.bottomRight.display="none",this.selectionHandles.styles.bottomRightHitArea.display="none"):(this.selectionHandles.styles.bottomRight.display="block",this.selectionHandles.styles.bottomRightHitArea.display="block")):(this.selectionHandles.styles.topLeft.display="none",this.selectionHandles.styles.bottomRight.display="none",this.selectionHandles.styles.topLeftHitArea.display="none",this.selectionHandles.styles.bottomRightHitArea.display="none"),e==this.wot.wtSettings.getSetting("fixedRowsTop")||t==this.wot.wtSettings.getSetting("fixedColumnsLeft")?(this.selectionHandles.styles.topLeft.zIndex="9999",this.selectionHandles.styles.topLeftHitArea.zIndex="9999"):(this.selectionHandles.styles.topLeft.zIndex="",this.selectionHandles.styles.topLeftHitArea.zIndex="")},appear:function(e){if(!this.disabled){var t,o,n,i,r,s,l,a,m,w,b,C,y,R,E,S,T,O,_;_=this.wot.wtTable.getRenderedRowsCount();for(var M=0;_>M;M++){var H=this.wot.wtTable.rowFilter.renderedToSource(M);if(H>=e[0]&&H<=e[2]){y=H;break}}for(var k=_-1;k>=0;k--){var A=this.wot.wtTable.rowFilter.renderedToSource(k);if(A>=e[0]&&A<=e[2]){E=A;break}}_=this.wot.wtTable.getRenderedColumnsCount();for(var P=0;_>P;P++){var x=this.wot.wtTable.columnFilter.renderedToSource(P);if(x>=e[1]&&x<=e[3]){R=x;break}}for(var D=_-1;D>=0;D--){var N=this.wot.wtTable.columnFilter.renderedToSource(D);if(N>=e[1]&&N<=e[3]){S=N;break}}if(void 0===y||void 0===R)return void this.disappear();t=y!==E||R!==S,o=this.wot.wtTable.getCell(new v(y,R)),n=t?this.wot.wtTable.getCell(new v(E,S)):o,i=f(o),r=t?f(n):i,s=f(this.wot.wtTable.TABLE),a=i.top,b=r.top+g(n)-a,w=i.left,C=r.left+p(n)-w,l=a-s.top-1,m=w-s.left-1;var L=u(o);parseInt(L.borderTopWidth,10)>0&&(l+=1,b=b>0?b-1:0),parseInt(L.borderLeftWidth,10)>0&&(m+=1,C=C>0?C-1:0),this.topStyle.top=l+"px",this.topStyle.left=m+"px",this.topStyle.width=C+"px",this.topStyle.display="block",this.leftStyle.top=l+"px",this.leftStyle.left=m+"px",this.leftStyle.height=b+"px",this.leftStyle.display="block";var W=Math.floor(this.settings.border.width/2);this.bottomStyle.top=l+b-W+"px",this.bottomStyle.left=m+"px",this.bottomStyle.width=C+"px",this.bottomStyle.display="block",this.rightStyle.top=l+"px",this.rightStyle.left=m+C-W+"px",this.rightStyle.height=b+1+"px",this.rightStyle.display="block",Handsontable.mobileBrowser||!this.hasSetting(this.settings.border.cornerVisible)||this.isPartRange(E,S)?this.cornerStyle.display="none":(this.cornerStyle.top=l+b-4+"px",this.cornerStyle.left=m+C-4+"px",this.cornerStyle.borderRightWidth=this.cornerDefaultStyle.borderWidth,this.cornerStyle.width=this.cornerDefaultStyle.width,this.cornerStyle.display="block",T=c(this.wot.wtTable.TABLE),S===this.wot.getSetting("totalColumns")-1&&(O=n.offsetLeft+p(n)>=h(T),O&&(this.cornerStyle.left=Math.floor(m+C-3-parseInt(this.cornerDefaultStyle.width)/2)+"px",this.cornerStyle.borderRightWidth=0)),E===this.wot.getSetting("totalRows")-1&&(O=n.offsetTop+g(n)>=d(T),O&&(this.cornerStyle.top=Math.floor(l+b-3-parseInt(this.cornerDefaultStyle.height)/2)+"px",this.cornerStyle.borderBottomWidth=0))),Handsontable.mobileBrowser&&this.updateMultipleSelectionHandlesPosition(y,R,l,m,C,b)}},disappear:function(){this.topStyle.display="none",this.leftStyle.display="none",this.bottomStyle.display="none",this.rightStyle.display="none",this.cornerStyle.display="none",Handsontable.mobileBrowser&&(this.selectionHandles.styles.topLeft.display="none",this.selectionHandles.styles.bottomRight.display="none")},hasSetting:function(e){return"function"==typeof e?e():!!e}},{}),window.WalkontableBorder=b},{"cell/coords":5,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,"overlay/_base.js":11}],3:[function(e,t,o){"use strict";Object.defineProperties(o,{WalkontableViewportColumnsCalculator:{get:function(){return i}},__esModule:{value:!0}});var n=new WeakMap,i=function(e,t,o,i,r,s,l){var a=void 0!==arguments[7]?arguments[7]:function(e){return e};n.set(this,{viewportWidth:e,scrollOffset:t,totalColumns:o,columnWidthFn:i,overrideFn:r,onlyFullyVisible:s,stretchingColumnWidthFn:a}),this.count=0,this.startColumn=null,this.endColumn=null,this.startPosition=null,this.stretchAllRatio=0,this.stretchLastWidth=0,this.stretch=l,this.totalTargetWidth=0,this.needVerifyLastColumnWidth=!0,this.stretchAllColumnsWidth=[],this.calculate()},r=i;$traceurRuntime.createClass(i,{calculate:function(){for(var e,t=0,o=!0,i=[],r=n.get(this),s=r.onlyFullyVisible,l=r.overrideFn,a=r.scrollOffset,u=r.totalColumns,c=r.viewportWidth,h=0;u>h;h++)if(e=this._getColumnWidth(h),a>=t&&!s&&(this.startColumn=h),t>=a&&a+c>=t+e&&(null==this.startColumn&&(this.startColumn=h),this.endColumn=h),i.push(t),t+=e,s||(this.endColumn=h),t>=a+c){o=!1;break}if(this.endColumn===u-1&&o)for(this.startColumn=this.endColumn;this.startColumn>0;){var d=i[this.endColumn]+e-i[this.startColumn-1];if((c>=d||!s)&&this.startColumn--,d>c)break}null!==this.startColumn&&l&&l(this),this.startPosition=i[this.startColumn],void 0==this.startPosition&&(this.startPosition=null),null!==this.startColumn&&(this.count=this.endColumn-this.startColumn+1)},refreshStretching:function(e){if("none"!==this.stretch){this.totalTargetWidth=e;for(var t=n.get(this),o=t.totalColumns,i=0,r=0;o>r;r++){var s=this._getColumnWidth(r),l=t.stretchingColumnWidthFn(void 0,r);"number"==typeof l?e-=l:i+=s}var a=e-i;if("all"===this.stretch&&a>0)this.stretchAllRatio=e/i,this.stretchAllColumnsWidth=[],this.needVerifyLastColumnWidth=!0;else if("last"===this.stretch&&e!==1/0){var u=this._getColumnWidth(o-1),c=a+u;this.stretchLastWidth=c>=0?c:u}}},getStretchedColumnWidth:function(e,t){var o=null;return"all"===this.stretch&&0!==this.stretchAllRatio?o=this._getStretchedAllColumnWidth(e,t):"last"===this.stretch&&0!==this.stretchLastWidth&&(o=this._getStretchedLastColumnWidth(e)),o},_getStretchedAllColumnWidth:function(e,t){var o=0,i=n.get(this),r=i.totalColumns;if(!this.stretchAllColumnsWidth[e]){var s=Math.round(t*this.stretchAllRatio),l=i.stretchingColumnWidthFn(s,e);void 0===l?this.stretchAllColumnsWidth[e]=s:this.stretchAllColumnsWidth[e]=isNaN(l)?this._getColumnWidth(e):l}if(this.stretchAllColumnsWidth.length===r&&this.needVerifyLastColumnWidth){this.needVerifyLastColumnWidth=!1;for(var a=0;af;f++){var g=a(f);if(void 0===g&&(g=r.DEFAULT_HEIGHT),u>=e&&!s&&(this.startRow=f),e>=u&&u+h-d>=e+g&&(null===this.startRow&&(this.startRow=f),this.endRow=f),o.push(e),e+=g,s||(this.endRow=f),e>=u+h-d){t=!1;break}}if(this.endRow===c-1&&t)for(this.startRow=this.endRow;this.startRow>0;){var p=o[this.endRow]+g-o[this.startRow-1];if((h-d>=p||!s)&&this.startRow--,p>=h-d)break}null!==this.startRow&&l&&l(this),this.startPosition=o[this.startRow],void 0==this.startPosition&&(this.startPosition=null),null!==this.startRow&&(this.count=this.endRow-this.startRow+1)}},{get DEFAULT_HEIGHT(){return 23}}),window.WalkontableViewportRowsCalculator=i},{}],5:[function(e,t,o){"use strict";Object.defineProperties(o,{WalkontableCellCoords:{get:function(){return n}},__esModule:{value:!0}});var n=function(e,t){"undefined"!=typeof e&&"undefined"!=typeof t?(this.row=e,this.col=t):(this.row=null,this.col=null)};$traceurRuntime.createClass(n,{isValid:function(e){return this.row<0||this.col<0?!1:!(this.row>=e.getSetting("totalRows")||this.col>=e.getSetting("totalColumns"))},isEqual:function(e){return e===this?!0:this.row===e.row&&this.col===e.col},isSouthEastOf:function(e){return this.row>=e.row&&this.col>=e.col},isNorthWestOf:function(e){return this.row<=e.row&&this.col<=e.col},isSouthWestOf:function(e){return this.row>=e.row&&this.col<=e.col},isNorthEastOf:function(e){return this.row<=e.row&&this.col>=e.col}},{}),window.WalkontableCellCoords=n},{}],6:[function(e,t,o){"use strict";Object.defineProperties(o,{WalkontableCellRange:{get:function(){return r}},__esModule:{value:!0}});var n,i=(n=e("cell/coords"),n&&n.__esModule&&n||{"default":n}).WalkontableCellCoords,r=function(e,t,o){this.highlight=e,this.from=t,this.to=o},s=r;$traceurRuntime.createClass(r,{isValid:function(e){return this.from.isValid(e)&&this.to.isValid(e)},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(e){var t=this.getTopLeftCorner(),o=this.getBottomRightCorner();return e.row<0&&(e.row=0),e.col<0&&(e.col=0),t.row<=e.row&&o.row>=e.row&&t.col<=e.col&&o.col>=e.col},includesRange:function(e){return this.includes(e.getTopLeftCorner())&&this.includes(e.getBottomRightCorner())},isEqual:function(e){return Math.min(this.from.row,this.to.row)==Math.min(e.from.row,e.to.row)&&Math.max(this.from.row,this.to.row)==Math.max(e.from.row,e.to.row)&&Math.min(this.from.col,this.to.col)==Math.min(e.from.col,e.to.col)&&Math.max(this.from.col,this.to.col)==Math.max(e.from.col,e.to.col)},overlaps:function(e){return e.isSouthEastOf(this.getTopLeftCorner())&&e.isNorthWestOf(this.getBottomRightCorner())},isSouthEastOf:function(e){return this.getTopLeftCorner().isSouthEastOf(e)||this.getBottomRightCorner().isSouthEastOf(e)},isNorthWestOf:function(e){return this.getTopLeftCorner().isNorthWestOf(e)||this.getBottomRightCorner().isNorthWestOf(e)},expand:function(e){var t=this.getTopLeftCorner(),o=this.getBottomRightCorner();return e.rowo.row||e.col>o.col?(this.from=new i(Math.min(t.row,e.row),Math.min(t.col,e.col)),this.to=new i(Math.max(o.row,e.row),Math.max(o.col,e.col)),!0):!1},expandByRange:function(e){if(this.includesRange(e)||!this.overlaps(e))return!1;var t=this.getTopLeftCorner(),o=this.getBottomRightCorner(),n=(this.getTopRightCorner(),this.getBottomLeftCorner(),e.getTopLeftCorner()),r=e.getBottomRightCorner(),l=Math.min(t.row,n.row),a=Math.min(t.col,n.col),u=Math.max(o.row,r.row),c=Math.max(o.col,r.col),h=new i(l,a),d=new i(u,c),f=new s(h,h,d).isCorner(this.from,e),g=e.isEqual(new s(h,h,d));return f&&!g&&(this.from.col>h.col&&(h.col=c,d.col=a),this.from.row>h.row&&(h.row=u,d.row=l)),this.from=h,this.to=d,!0},getDirection:function(){return this.from.isNorthWestOf(this.to)?"NW-SE":this.from.isNorthEastOf(this.to)?"NE-SW":this.from.isSouthEastOf(this.to)?"SE-NW":this.from.isSouthWestOf(this.to)?"SW-NE":void 0},setDirection:function(e){switch(e){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()}},getTopLeftCorner:function(){return new i(Math.min(this.from.row,this.to.row),Math.min(this.from.col,this.to.col))},getBottomRightCorner:function(){return new i(Math.max(this.from.row,this.to.row),Math.max(this.from.col,this.to.col))},getTopRightCorner:function(){return new i(Math.min(this.from.row,this.to.row),Math.max(this.from.col,this.to.col))},getBottomLeftCorner:function(){return new i(Math.max(this.from.row,this.to.row),Math.min(this.from.col,this.to.col))},isCorner:function(e,t){return t&&t.includes(e)&&(this.getTopLeftCorner().isEqual(new i(t.from.row,t.from.col))||this.getTopRightCorner().isEqual(new i(t.from.row,t.to.col))||this.getBottomLeftCorner().isEqual(new i(t.to.row,t.from.col))||this.getBottomRightCorner().isEqual(new i(t.to.row,t.to.col)))?!0:e.isEqual(this.getTopLeftCorner())||e.isEqual(this.getTopRightCorner())||e.isEqual(this.getBottomLeftCorner())||e.isEqual(this.getBottomRightCorner())},getOppositeCorner:function(e,t){if(!(e instanceof i))return!1;if(t&&t.includes(e)){if(this.getTopLeftCorner().isEqual(new i(t.from.row,t.from.col)))return this.getBottomRightCorner();if(this.getTopRightCorner().isEqual(new i(t.from.row,t.to.col)))return this.getBottomLeftCorner();if(this.getBottomLeftCorner().isEqual(new i(t.to.row,t.from.col)))return this.getTopRightCorner();if(this.getBottomRightCorner().isEqual(new i(t.to.row,t.to.col)))return this.getTopLeftCorner()}return e.isEqual(this.getBottomRightCorner())?this.getTopLeftCorner():e.isEqual(this.getTopLeftCorner())?this.getBottomRightCorner():e.isEqual(this.getTopRightCorner())?this.getBottomLeftCorner():e.isEqual(this.getBottomLeftCorner())?this.getTopRightCorner():void 0},getBordersSharedWith:function(e){if(!this.includesRange(e))return[];var t={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)},o={top:Math.min(e.from.row,e.to.row),bottom:Math.max(e.from.row,e.to.row),left:Math.min(e.from.col,e.to.col),right:Math.max(e.from.col,e.to.col)},n=[];return t.top==o.top&&n.push("top"),t.right==o.right&&n.push("right"),t.bottom==o.bottom&&n.push("bottom"),t.left==o.left&&n.push("left"),n},getInner:function(){for(var e=this.getTopLeftCorner(),t=this.getBottomRightCorner(),o=[],n=e.row;n<=t.row;n++)for(var r=e.col;r<=t.col;r++)this.from.row===n&&this.from.col===r||this.to.row===n&&this.to.col===r||o.push(new i(n,r));return o},getAll:function(){for(var e=this.getTopLeftCorner(),t=this.getBottomRightCorner(),o=[],n=e.row;n<=t.row;n++)for(var r=e.col;r<=t.col;r++)e.row===n&&e.col===r?o.push(e):t.row===n&&t.col===r?o.push(t):o.push(new i(n,r));return o},forAll:function(e){for(var t=this.getTopLeftCorner(),o=this.getBottomRightCorner(),n=t.row;n<=o.row;n++)for(var i=t.col;i<=o.col;i++){var r=e(n,i);if(r===!1)return}}},{}),window.WalkontableCellRange=r},{"cell/coords":5}],7:[function(e,t,o){"use strict";Object.defineProperties(o,{Walkontable:{get:function(){return P}},__esModule:{value:!0}});var n,i,r,s,l,a,u,c,h,d,f,g,p,m,w=(n=e("helpers/dom/element"),n&&n.__esModule&&n||{"default":n}),v=w.addClass,b=w.fastInnerText,C=w.isVisible,y=w.removeClass,R=(i=e("helpers/object"),i&&i.__esModule&&i||{"default":i}).objectEach,E=(r=e("helpers/string"),r&&r.__esModule&&r||{"default":r}),S=E.toUpperCaseFirst,T=E.randomString,O=(s=e("event"),s&&s.__esModule&&s||{"default":s}).WalkontableEvent,_=(l=e("overlays"),l&&l.__esModule&&l||{"default":l}).WalkontableOverlays,M=(a=e("scroll"),a&&a.__esModule&&a||{"default":a}).WalkontableScroll,H=(u=e("settings"),u&&u.__esModule&&u||{"default":u}).WalkontableSettings,k=(c=e("table"),c&&c.__esModule&&c||{"default":c}).WalkontableTable,A=(h=e("viewport"),h&&h.__esModule&&h||{"default":h}).WalkontableViewport,P=((d=e("overlay/_base.js"),d&&d.__esModule&&d||{"default":d}).WalkontableOverlay,(f=e("overlay/top.js"),f&&f.__esModule&&f||{"default":f}).WalkontableTopOverlay,(g=e("overlay/left.js"),g&&g.__esModule&&g||{"default":g}).WalkontableLeftOverlay,(p=e("overlay/debug.js"),p&&p.__esModule&&p||{"default":p}).WalkontableDebugOverlay,(m=e("overlay/topLeftCorner.js"),m&&m.__esModule&&m||{"default":m}).WalkontableTopLeftCornerOverlay,function(e){var t=[];if(this.guid="wt_"+T(),e.cloneSource?(this.cloneSource=e.cloneSource,this.cloneOverlay=e.cloneOverlay,this.wtSettings=e.cloneSource.wtSettings,this.wtTable=new k(this,e.table,e.wtRootElement),this.wtScroll=new M(this),this.wtViewport=e.cloneSource.wtViewport,this.wtEvent=new O(this),this.selections=this.cloneSource.selections):(this.wtSettings=new H(this,e),this.wtTable=new k(this,e.table),this.wtScroll=new M(this),this.wtViewport=new A(this),this.wtEvent=new O(this),this.selections=this.getSetting("selections"),this.wtOverlays=new _(this),this.exportSettingsAsClassNames()),this.wtTable.THEAD.childNodes.length&&this.wtTable.THEAD.childNodes[0].childNodes.length){for(var o=0,n=this.wtTable.THEAD.childNodes[0].childNodes.length;n>o;o++)t.push(this.wtTable.THEAD.childNodes[0].childNodes[o].innerHTML);this.getSetting("columnHeaders").length||this.update("columnHeaders",[function(e,o){b(o,t[e])}])}this.drawn=!1,this.drawInterrupted=!1});$traceurRuntime.createClass(P,{draw:function(){var e=void 0!==arguments[0]?arguments[0]:!1;return this.drawInterrupted=!1,e||C(this.wtTable.TABLE)?this.wtTable.draw(e):this.drawInterrupted=!0,this},getCell:function(e){var t=void 0!==arguments[1]?arguments[1]:!1;if(!t)return this.wtTable.getCell(e);var o=this.wtSettings.getSetting("totalRows"),n=this.wtSettings.getSetting("fixedRowsTop"),i=this.wtSettings.getSetting("fixedRowsBottom"),r=this.wtSettings.getSetting("fixedColumnsLeft");if(e.row=o-i){if(this.wtOverlays.bottomLeftCornerOverlay.clone)return this.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.getCell(e)}else{if(e.colo-i&&this.wtOverlays.bottomOverlay.clone)return this.wtOverlays.bottomOverlay.clone.wtTable.getCell(e)}return this.wtTable.getCell(e)},update:function(e,t){return this.wtSettings.update(e,t)},scrollVertical:function(e){return this.wtOverlays.topOverlay.scrollTo(e),this.getSetting("onScrollVertically"),this},scrollHorizontal:function(e){return this.wtOverlays.leftOverlay.scrollTo(e),this.getSetting("onScrollHorizontally"),this},scrollViewport:function(e){return this.wtScroll.scrollViewport(e),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(e){return this.cloneOverlay?this.cloneOverlay.type===e:!1},exportSettingsAsClassNames:function(){var e=this,t={rowHeaders:["array"],columnHeaders:["array"]},o=[],n=[];R(t,function(t,i){t.indexOf("array")>-1&&e.getSetting(i).length&&n.push("ht"+S(i)),o.push("ht"+S(i))}),y(this.wtTable.wtRootElement.parentNode,o),v(this.wtTable.wtRootElement.parentNode,n)},getSetting:function(e,t,o,n,i){return this.wtSettings.getSetting(e,t,o,n,i)},hasSetting:function(e){return this.wtSettings.has(e)},destroy:function(){this.wtOverlays.destroy(),this.wtEvent.destroy()}},{}),window.Walkontable=P},{event:8,"helpers/dom/element":45,"helpers/object":51,"helpers/string":53,"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(e,t,o){"use strict";function n(e){var t=this,o=c(e);this.instance=e;var n=[null,null];this.dblClickTimeout=[null,null];var i,r=function(e){var o=t.parentCell(e.realTarget);a(e.realTarget,"corner")?t.instance.getSetting("onCellCornerMouseDown",e,e.realTarget):o.TD&&t.instance.hasSetting("onCellMouseDown")&&t.instance.getSetting("onCellMouseDown",e,o.coords,o.TD,t.instance),2!==e.button&&o.TD&&(n[0]=o.TD,clearTimeout(t.dblClickTimeout[0]),t.dblClickTimeout[0]=setTimeout(function(){n[0]=null},1e3))},s=function(e){t.instance.touchMoving=!0},h=function(e){o.addEventListener(this,"touchmove",s),t.checkIfTouchMove=setTimeout(function(){return t.instance.touchMoving===!0?(t.instance.touchMoving=void 0,void o.removeEventListener("touchmove",s,!1)):void r(e)},30)},d=function(e){var o,n,i;t.instance.hasSetting("onCellMouseOver")&&(o=t.instance.wtTable.TABLE,n=l(e.realTarget,["TD","TH"],o),i=t.instance.cloneSource||t.instance,n&&n!==i.lastMouseOver&&u(n,o)&&(i.lastMouseOver=n,t.instance.getSetting("onCellMouseOver",e,t.instance.wtTable.getCoords(n),n,t.instance)))},f=function(e){if(2!==e.button){var o=t.parentCell(e.realTarget);o.TD===n[0]&&o.TD===n[1]?(a(e.realTarget,"corner")?t.instance.getSetting("onCellCornerDblClick",e,o.coords,o.TD,t.instance):t.instance.getSetting("onCellDblClick",e,o.coords,o.TD,t.instance),n[0]=null,n[1]=null):o.TD===n[0]&&(n[1]=o.TD,clearTimeout(t.dblClickTimeout[1]),t.dblClickTimeout[1]=setTimeout(function(){n[1]=null},500))}},g=function(e){clearTimeout(i),e.preventDefault(),f(e)};if(o.addEventListener(this.instance.wtTable.holder,"mousedown",r),o.addEventListener(this.instance.wtTable.TABLE,"mouseover",d),o.addEventListener(this.instance.wtTable.holder,"mouseup",f),this.instance.wtTable.holder.parentNode.parentNode&&Handsontable.mobileBrowser&&!t.instance.wtTable.isWorkingOnClone()){var p="."+this.instance.wtTable.holder.parentNode.className.split(" ").join(".");o.addEventListener(this.instance.wtTable.holder,"touchstart",function(e){t.instance.touchApplied=!0,u(e.target,p)&&h.call(e.target,e)}),o.addEventListener(this.instance.wtTable.holder,"touchend",function(e){t.instance.touchApplied=!1,u(e.target,p)&&g.call(e.target,e)}),t.instance.momentumScrolling||(t.instance.momentumScrolling={}),o.addEventListener(this.instance.wtTable.holder,"scroll",function(e){clearTimeout(t.instance.momentumScrolling._timeout),t.instance.momentumScrolling.ongoing||t.instance.getSetting("onBeforeTouchScroll"),t.instance.momentumScrolling.ongoing=!0,t.instance.momentumScrolling._timeout=setTimeout(function(){t.instance.touchApplied||(t.instance.momentumScrolling.ongoing=!1,t.instance.getSetting("onAfterMomentumScroll"))},200)})}o.addEventListener(window,"resize",function(){"none"!==t.instance.getSetting("stretchH")&&t.instance.draw()}),this.destroy=function(){clearTimeout(this.dblClickTimeout[0]),clearTimeout(this.dblClickTimeout[1]),o.destroy()}}Object.defineProperties(o,{WalkontableEvent:{get:function(){return n}},__esModule:{value:!0}});var i,r,s=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),l=s.closest,a=s.hasClass,u=s.isChildOf,c=(r=e("eventManager"),r&&r.__esModule&&r||{"default":r}).eventManager;n.prototype.parentCell=function(e){var t={},o=this.instance.wtTable.TABLE,n=l(e,["TD","TH"],o),i=l(n,["TABLE"]);return n&&u(n,o)&&i==o?(t.coords=this.instance.wtTable.getCoords(n),t.TD=n):a(e,"wtBorder")&&a(e,"current")?(t.coords=this.instance.selections.current.cellRange.highlight,t.TD=this.instance.wtTable.getCell(t.coords)):a(e,"wtBorder")&&a(e,"area")&&this.instance.selections.area.cellRange&&(t.coords=this.instance.selections.area.cellRange.to,t.TD=this.instance.wtTable.getCell(t.coords)),t},window.WalkontableEvent=n},{eventManager:41,"helpers/dom/element":45}],9:[function(e,t,o){"use strict";Object.defineProperties(o,{WalkontableColumnFilter:{get:function(){return n}},__esModule:{value:!0}});var n=function(e,t,o){this.offset=e,this.total=t,this.countTH=o};$traceurRuntime.createClass(n,{offsetted:function(e){return e+this.offset},unOffsetted:function(e){return e-this.offset},renderedToSource:function(e){return this.offsetted(e)},sourceToRendered:function(e){return this.unOffsetted(e)},offsettedTH:function(e){return e-this.countTH},unOffsettedTH:function(e){return e+this.countTH},visibleRowHeadedColumnToSourceColumn:function(e){return this.renderedToSource(this.offsettedTH(e)); +},sourceColumnToVisibleRowHeadedColumn:function(e){return this.unOffsettedTH(this.sourceToRendered(e))}},{}),window.WalkontableColumnFilter=n},{}],10:[function(e,t,o){"use strict";Object.defineProperties(o,{WalkontableRowFilter:{get:function(){return n}},__esModule:{value:!0}});var n=function(e,t,o){this.offset=e,this.total=t,this.countTH=o};$traceurRuntime.createClass(n,{offsetted:function(e){return e+this.offset},unOffsetted:function(e){return e-this.offset},renderedToSource:function(e){return this.offsetted(e)},sourceToRendered:function(e){return this.unOffsetted(e)},offsettedTH:function(e){return e-this.countTH},unOffsettedTH:function(e){return e+this.countTH},visibleColHeadedRowToSourceRow:function(e){return this.renderedToSource(this.offsettedTH(e))},sourceRowToVisibleColHeadedRow:function(e){return this.unOffsettedTH(this.sourceToRendered(e))}},{}),window.WalkontableRowFilter=n},{}],11:[function(e,t,o){"use strict";Object.defineProperties(o,{WalkontableOverlay:{get:function(){return d}},__esModule:{value:!0}});var n,i,r,s=(n=e("helpers/dom/element"),n&&n.__esModule&&n||{"default":n}),l=s.getScrollableElement,a=s.getTrimmingContainer,u=(i=e("helpers/object"),i&&i.__esModule&&i||{"default":i}).defineGetter,c=(r=e("eventManager"),r&&r.__esModule&&r||{"default":r}).eventManager,h={},d=function(e){u(this,"wot",e,{writable:!1}),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=a(this.hider.parentNode.parentNode),this.needFullRender=this.shouldBeRendered(),this.areElementSizesAdjusted=!1},f=d;$traceurRuntime.createClass(d,{shouldBeRendered:function(){return!0},updateTrimmingContainer:function(){this.trimmingContainer=a(this.hider.parentNode.parentNode)},updateMainScrollableElement:function(){this.mainTableScrollableElement=l(this.wot.wtTable.TABLE)},makeClone:function(e){if(-1===f.CLONE_TYPES.indexOf(e))throw new Error('Clone type "'+e+'" is not supported.');var t=document.createElement("DIV"),o=document.createElement("TABLE");t.className="ht_clone_"+e+" handsontable",t.style.position="absolute",t.style.top=0,t.style.left=0,t.style.overflow="hidden",o.className=this.wot.wtTable.TABLE.className,t.appendChild(o),this.type=e,this.wot.wtTable.wtRootElement.parentNode.appendChild(t);var n=this.wot.getSetting("preventOverflow");return n===!0||"horizontal"===n&&this.type===f.CLONE_TOP||"vertical"===n&&this.type===f.CLONE_LEFT?this.mainTableScrollableElement=window:this.mainTableScrollableElement=l(this.wot.wtTable.TABLE),new Walkontable({cloneSource:this.wot,cloneOverlay:this,table:o})},refresh:function(){var e=void 0!==arguments[0]?arguments[0]:!1,t=this.shouldBeRendered();this.clone&&(this.needFullRender||t)&&this.clone.draw(e),this.needFullRender=t},destroy:function(){c(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[f.CLONE_TOP,f.CLONE_BOTTOM,f.CLONE_LEFT,f.CLONE_TOP_LEFT_CORNER,f.CLONE_BOTTOM_LEFT_CORNER,f.CLONE_DEBUG]},registerOverlay:function(e,t){if(-1===f.CLONE_TYPES.indexOf(e))throw new Error("Unsupported overlay ("+e+").");h[e]=t},createOverlay:function(e,t){return new h[e](t)},isOverlayTypeOf:function(e,t){return e&&h[t]?e instanceof h[t]:!1}}),window.WalkontableOverlay=d},{eventManager:41,"helpers/dom/element":45,"helpers/object":51}],12:[function(e,t,o){"use strict";Object.defineProperties(o,{WalkontableDebugOverlay:{get:function(){return l}},__esModule:{value:!0}});var n,i,r=(n=e("helpers/dom/element"),n&&n.__esModule&&n||{"default":n}).addClass,s=(i=e("_base"),i&&i.__esModule&&i||{"default":i}).WalkontableOverlay,l=function(e){$traceurRuntime.superConstructor(a).call(this,e),this.clone=this.makeClone(s.CLONE_DEBUG),this.clone.wtTable.holder.style.opacity=.4,this.clone.wtTable.holder.style.textShadow="0 0 2px #ff0000",r(this.clone.wtTable.holder.parentNode,"wtDebugVisible")},a=l;$traceurRuntime.createClass(l,{},{},s),window.WalkontableDebugOverlay=l,s.registerOverlay(s.CLONE_DEBUG,l)},{_base:11,"helpers/dom/element":45}],13:[function(e,t,o){"use strict";Object.defineProperties(o,{WalkontableLeftOverlay:{get:function(){return w}},__esModule:{value:!0}});var n,i,r=(n=e("helpers/dom/element"),n&&n.__esModule&&n||{"default":n}),s=r.addClass,l=r.getScrollbarWidth,a=r.getScrollLeft,u=r.getWindowScrollTop,c=r.hasClass,h=r.outerWidth,d=r.innerHeight,f=r.removeClass,g=r.setOverlayPosition,p=r.resetCssTransform,m=(i=e("_base"),i&&i.__esModule&&i||{"default":i}).WalkontableOverlay,w=function(e){$traceurRuntime.superConstructor(v).call(this,e),this.clone=this.makeClone(m.CLONE_LEFT)},v=w;$traceurRuntime.createClass(w,{shouldBeRendered:function(){return!(!this.wot.getSetting("fixedColumnsLeft")&&!this.wot.getSetting("rowHeaders").length)},resetFixedPosition:function(){if(this.needFullRender&&this.wot.wtTable.holder.parentNode){var e=this.clone.wtTable.holder.parentNode,t=0,o=this.wot.getSetting("preventOverflow");if(this.trimmingContainer!==window||o&&"horizontal"===o)t=this.getScrollPosition(),p(e);else{var n,i,r=this.wot.wtTable.hider.getBoundingClientRect(),s=Math.ceil(r.left),l=Math.ceil(r.right);i=this.wot.wtTable.hider.style.top,i=""===i?0:i,n=0>s&&l-e.offsetWidth>0?-s:0,t=n,n+="px",g(e,n,i)}this.adjustHeaderBordersPosition(t),this.adjustElementsSize()}},setScrollPosition:function(e){this.mainTableScrollableElement===window?window.scrollTo(e,u()):this.mainTableScrollableElement.scrollLeft=e},onScroll:function(){this.wot.getSetting("onScrollVertically")},sumCellSizes:function(e,t){for(var o=0,n=this.wot.wtSettings.defaultColumnWidth;t>e;)o+=this.wot.wtTable.getStretchedColumnWidth(e)||n,e++;return o},adjustElementsSize:function(){var e=void 0!==arguments[0]?arguments[0]:!1;this.updateTrimmingContainer(),(this.needFullRender||e)&&(this.adjustRootElementSize(),this.adjustRootChildrenSize(),e||(this.areElementSizesAdjusted=!0))},adjustRootElementSize:function(){var e,t=this.wot.wtTable.holder,o=t.clientHeight===t.offsetHeight?0:l(),n=this.clone.wtTable.holder.parentNode,i=n.style,r=this.wot.getSetting("preventOverflow");if(this.trimmingContainer!==window||"vertical"===r){var s=this.wot.wtViewport.getWorkspaceHeight()-o;s=Math.min(s,d(this.wot.wtTable.wtRootElement)),i.height=s+"px"}else i.height="";this.clone.wtTable.holder.style.height=i.height,e=h(this.clone.wtTable.TABLE),i.width=(0===e?e:e+4)+"px"},adjustRootChildrenSize:function(){var e=l();this.clone.wtTable.hider.style.height=this.hider.style.height,this.clone.wtTable.holder.style.height=this.clone.wtTable.holder.parentNode.style.height,0===e&&(e=30),this.clone.wtTable.holder.style.width=parseInt(this.clone.wtTable.holder.parentNode.style.width,10)+e+"px"},applyToDOM:function(){var e=this.wot.getSetting("totalColumns");if(this.areElementSizesAdjusted||this.adjustElementsSize(),"number"==typeof this.wot.wtViewport.columnsRenderCalculator.startPosition)this.spreader.style.left=this.wot.wtViewport.columnsRenderCalculator.startPosition+"px";else{if(0!==e)throw new Error("Incorrect value of the columnsRenderCalculator");this.spreader.style.left="0"}this.spreader.style.right="",this.needFullRender&&this.syncOverlayOffset()},syncOverlayOffset:function(){"number"==typeof this.wot.wtViewport.rowsRenderCalculator.startPosition?this.clone.wtTable.spreader.style.top=this.wot.wtViewport.rowsRenderCalculator.startPosition+"px":this.clone.wtTable.spreader.style.top=""},scrollTo:function(e,t){var o=this.getTableParentOffset(),n=this.wot.cloneSource?this.wot.cloneSource:this.wot,i=n.wtTable.holder,r=0;t&&i.offsetWidth!==i.clientWidth&&(r=l()),t?(o+=this.sumCellSizes(0,e+1),o-=this.wot.wtViewport.getViewportWidth()):o+=this.sumCellSizes(this.wot.getSetting("fixedColumnsLeft"),e),o+=r,this.setScrollPosition(o)},getTableParentOffset:function(){var e=this.wot.getSetting("preventOverflow"),t=0;return e||this.trimmingContainer!==window||(t=this.wot.wtTable.holderOffset.left),t},getScrollPosition:function(){return a(this.mainTableScrollableElement)},adjustHeaderBordersPosition:function(e){var t=this.wot.wtTable.holder.parentNode,o=this.wot.getSetting("rowHeaders"),n=this.wot.getSetting("fixedColumnsLeft");if(n&&!o.length)s(t,"innerBorderLeft");else if(!n&&o.length){var i=c(t,"innerBorderLeft");e?s(t,"innerBorderLeft"):f(t,"innerBorderLeft"),(!i&&e||i&&!e)&&this.wot.wtOverlays.adjustElementsSize()}}},{},m),window.WalkontableLeftOverlay=w,m.registerOverlay(m.CLONE_LEFT,w)},{_base:11,"helpers/dom/element":45}],14:[function(e,t,o){"use strict";Object.defineProperties(o,{WalkontableTopOverlay:{get:function(){return w}},__esModule:{value:!0}});var n,i,r=(n=e("helpers/dom/element"),n&&n.__esModule&&n||{"default":n}),s=r.addClass,l=r.getScrollbarWidth,a=r.getScrollTop,u=r.getWindowScrollLeft,c=r.hasClass,h=r.outerHeight,d=r.innerWidth,f=r.removeClass,g=r.setOverlayPosition,p=r.resetCssTransform,m=(i=e("_base"),i&&i.__esModule&&i||{"default":i}).WalkontableOverlay,w=function(e){$traceurRuntime.superConstructor(v).call(this,e),this.clone=this.makeClone(m.CLONE_TOP)},v=w;$traceurRuntime.createClass(w,{shouldBeRendered:function(){return!(!this.wot.getSetting("fixedRowsTop")&&!this.wot.getSetting("columnHeaders").length)},resetFixedPosition:function(){if(this.needFullRender&&this.wot.wtTable.holder.parentNode){var e=this.clone.wtTable.holder.parentNode,t=0,o=this.wot.getSetting("preventOverflow");if(this.trimmingContainer!==window||o&&"vertical"===o)t=this.getScrollPosition(),p(e);else{var n,i,r=this.wot.wtTable.hider.getBoundingClientRect(),s=Math.ceil(r.top),l=Math.ceil(r.bottom);n=this.wot.wtTable.hider.style.left,n=""===n?0:n,i=0>s&&l-e.offsetHeight>0?-s:0,t=i,i+="px",g(e,n,i)}this.adjustHeaderBordersPosition(t),this.adjustElementsSize()}},setScrollPosition:function(e){this.mainTableScrollableElement===window?window.scrollTo(u(),e):this.mainTableScrollableElement.scrollTop=e},onScroll:function(){this.wot.getSetting("onScrollHorizontally")},sumCellSizes:function(e,t){for(var o=0,n=this.wot.wtSettings.settings.defaultRowHeight;t>e;){var i=this.wot.wtTable.getRowHeight(e);o+=void 0===i?n:i,e++}return o},adjustElementsSize:function(){var e=void 0!==arguments[0]?arguments[0]:!1;this.updateTrimmingContainer(),(this.needFullRender||e)&&(this.adjustRootElementSize(),this.adjustRootChildrenSize(),e||(this.areElementSizesAdjusted=!0))},adjustRootElementSize:function(){var e,t=this.wot.wtTable.holder,o=t.clientWidth===t.offsetWidth?0:l(),n=this.clone.wtTable.holder.parentNode,i=n.style,r=this.wot.getSetting("preventOverflow");if(this.trimmingContainer!==window||"horizontal"===r){var s=this.wot.wtViewport.getWorkspaceWidth()-o;s=Math.min(s,d(this.wot.wtTable.wtRootElement)),i.width=s+"px"}else i.width="";this.clone.wtTable.holder.style.width=i.width,e=h(this.clone.wtTable.TABLE),i.height=(0===e?e:e+4)+"px"},adjustRootChildrenSize:function(){var e=l();this.clone.wtTable.hider.style.width=this.hider.style.width,this.clone.wtTable.holder.style.width=this.clone.wtTable.holder.parentNode.style.width,0===e&&(e=30),this.clone.wtTable.holder.style.height=parseInt(this.clone.wtTable.holder.parentNode.style.height,10)+e+"px"},applyToDOM:function(){var e=this.wot.getSetting("totalRows");if(this.areElementSizesAdjusted||this.adjustElementsSize(),"number"==typeof this.wot.wtViewport.rowsRenderCalculator.startPosition)this.spreader.style.top=this.wot.wtViewport.rowsRenderCalculator.startPosition+"px";else{if(0!==e)throw new Error("Incorrect value of the rowsRenderCalculator");this.spreader.style.top="0"}this.spreader.style.bottom="",this.needFullRender&&this.syncOverlayOffset()},syncOverlayOffset:function(){"number"==typeof this.wot.wtViewport.columnsRenderCalculator.startPosition?this.clone.wtTable.spreader.style.left=this.wot.wtViewport.columnsRenderCalculator.startPosition+"px":this.clone.wtTable.spreader.style.left=""},scrollTo:function(e,t){var o=this.getTableParentOffset(),n=this.wot.cloneSource?this.wot.cloneSource:this.wot,i=n.wtTable.holder,r=0;if(t&&i.offsetHeight!==i.clientHeight&&(r=l()),t){var s=this.wot.getSetting("fixedRowsBottom"),a=(this.wot.getSetting("fixedRowsTop"),this.wot.getSetting("totalRows"));o+=this.sumCellSizes(0,e+1),o-=this.wot.wtViewport.getViewportHeight()-this.sumCellSizes(a-s,a),o+=1}else o+=this.sumCellSizes(this.wot.getSetting("fixedRowsTop"),e);o+=r,this.setScrollPosition(o)},getTableParentOffset:function(){return this.mainTableScrollableElement===window?this.wot.wtTable.holderOffset.top:0},getScrollPosition:function(){return a(this.mainTableScrollableElement)},adjustHeaderBordersPosition:function(e){if(0===this.wot.getSetting("fixedRowsTop")&&this.wot.getSetting("columnHeaders").length>0){var t=this.wot.wtTable.holder.parentNode,o=c(t,"innerBorderTop");e||0===this.wot.getSetting("totalRows")?s(t,"innerBorderTop"):f(t,"innerBorderTop"),(!o&&e||o&&!e)&&this.wot.wtOverlays.adjustElementsSize()}if(0===this.wot.getSetting("rowHeaders").length){var n=this.clone.wtTable.THEAD.querySelectorAll("th:nth-of-type(2)");if(n)for(var i=0;ic&&d-e.offsetWidth>0&&(f=-c+"px"),n&&"horizontal"!==n||0>r&&h-e.offsetHeight>0&&(g=-r+"px"),a(e,f,g)}else u(e);e.style.height=(0===t?t:t+4)+"px",e.style.width=(0===o?o:o+4)+"px"}}},{},c),window.WalkontableTopLeftCornerOverlay=h,c.registerOverlay(c.CLONE_TOP_LEFT_CORNER,h)},{_base:11,"helpers/dom/element":45}],16:[function(e,t,o){"use strict";Object.defineProperties(o,{WalkontableOverlays:{get:function(){return f}},__esModule:{value:!0}});var n,i,r,s=(n=e("helpers/dom/element"),n&&n.__esModule&&n||{"default":n}),l=s.getScrollableElement,a=s.getScrollbarWidth,u=s.getScrollLeft,c=s.getScrollTop,h=(i=e("helpers/unicode"),i&&i.__esModule&&i||{"default":i}).isKey,d=(r=e("eventManager"),r&&r.__esModule&&r||{"default":r}).EventManager,f=function(e){this.wot=e,this.instance=this.wot,this.eventManager=new d(this.wot),this.wot.update("scrollbarWidth",a()),this.wot.update("scrollbarHeight",a()),this.scrollableElement=l(this.wot.wtTable.TABLE),this.topOverlay=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_TOP,this.wot),"undefined"==typeof WalkontableBottomOverlay?this.bottomOverlay={needFullRender:!1}:this.bottomOverlay=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_BOTTOM,this.wot),this.leftOverlay=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_LEFT,this.wot),this.topOverlay.needFullRender&&this.leftOverlay.needFullRender&&(this.topLeftCornerOverlay=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_TOP_LEFT_CORNER,this.wot)),this.bottomOverlay.needFullRender&&this.leftOverlay.needFullRender&&"undefined"!=typeof WalkontableBottomLeftCornerOverlay?this.bottomLeftCornerOverlay=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER,this.wot):this.bottomLeftCornerOverlay={needFullRender:!1},this.wot.getSetting("debug")&&(this.debug=WalkontableOverlay.createOverlay(WalkontableOverlay.CLONE_DEBUG,this.wot)),this.destroyed=!1,this.keyPressed=!1,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.pendingScrollCallbacks={master:{top:0,left:0},top:{left:0},bottom:{left:0},left:{top:0}},this.verticalScrolling=!1,this.horizontalScrolling=!1,this.delegatedScrollCallback=!1,this.registeredListeners=[],this.registerListeners()};$traceurRuntime.createClass(f,{refreshAll:function(){if(this.wot.drawn){if(!this.wot.wtTable.holder.parentNode)return void this.destroy();this.wot.draw(!0),this.verticalScrolling&&this.leftOverlay.onScroll(),this.horizontalScrolling&&this.topOverlay.onScroll(),this.verticalScrolling=!1,this.horizontalScrolling=!1}},registerListeners:function(){var e=this,t=this.topOverlay.mainTableScrollableElement,o=this.leftOverlay.mainTableScrollableElement,n=[];for(n.push([document.documentElement,"keydown",function(t){return e.onKeyDown(t)}]),n.push([document.documentElement,"keyup",function(){return e.onKeyUp()}]),n.push([document,"visibilitychange",function(){return e.onKeyUp()}]),n.push([t,"scroll",function(t){return e.onTableScroll(t)}]),t!==o&&n.push([o,"scroll",function(t){return e.onTableScroll(t)}]),this.topOverlay.needFullRender&&(n.push([this.topOverlay.clone.wtTable.holder,"scroll",function(t){return e.onTableScroll(t)}]),n.push([this.topOverlay.clone.wtTable.holder,"wheel",function(t){return e.onTableScroll(t)}])),this.bottomOverlay.needFullRender&&(n.push([this.bottomOverlay.clone.wtTable.holder,"scroll",function(t){return e.onTableScroll(t)}]),n.push([this.bottomOverlay.clone.wtTable.holder,"wheel",function(t){return e.onTableScroll(t)}])),this.leftOverlay.needFullRender&&(n.push([this.leftOverlay.clone.wtTable.holder,"scroll",function(t){return e.onTableScroll(t)}]),n.push([this.leftOverlay.clone.wtTable.holder,"wheel",function(t){return e.onTableScroll(t)}])),this.topOverlay.trimmingContainer!==window&&this.leftOverlay.trimmingContainer!==window&&n.push([window,"wheel",function(t){var o,n=t.wheelDeltaY||t.deltaY,i=t.wheelDeltaX||t.deltaX;e.topOverlay.clone.wtTable.holder.contains(t.realTarget)?o="top":e.bottomOverlay.clone&&e.bottomOverlay.clone.wtTable.holder.contains(t.realTarget)?o="bottom":e.leftOverlay.clone.wtTable.holder.contains(t.realTarget)&&(o="left"),"top"==o&&0!==n?t.preventDefault():"left"==o&&0!==i?t.preventDefault():"bottom"==o&&0!==n&&t.preventDefault()}]);n.length;){var i=n.pop();this.eventManager.addEventListener(i[0],i[1],i[2]),this.registeredListeners.push(i)}},deregisterListeners:function(){for(;this.registeredListeners.length;){var e=this.registeredListeners.pop();this.eventManager.removeEventListener(e[0],e[1],e[2])}},onTableScroll:function(e){if(!Handsontable.mobileBrowser){var t=this.leftOverlay.mainTableScrollableElement,o=this.topOverlay.mainTableScrollableElement,n=e.target;this.keyPressed&&(o!==window&&n!==window&&!e.target.contains(o)||t!==window&&n!==window&&!e.target.contains(t))||("scroll"===e.type?this.syncScrollPositions(e):this.translateMouseWheelToScroll(e))}},onKeyDown:function(e){this.keyPressed=h(e.keyCode,"ARROW_UP|ARROW_RIGHT|ARROW_DOWN|ARROW_LEFT")},onKeyUp:function(){this.keyPressed=!1},translateMouseWheelToScroll:function(e){var t,o=this.topOverlay.clone.wtTable.holder,n=this.bottomOverlay.clone?this.bottomOverlay.clone.wtTable.holder:null,i=this.leftOverlay.clone.wtTable.holder,r={type:"wheel"},s=e.target,l=e.wheelDeltaY||-1*e.deltaY,a=e.wheelDeltaX||-1*e.deltaX;for(1===e.deltaMode&&(l=120*l,a=120*a);s!=document&&null!=s;){if(s.className.indexOf("wtHolder")>-1){t=s;break}s=s.parentNode}return r.target=t,t==o?this.syncScrollPositions(r,-.2*l):t==n?this.syncScrollPositions(r,-.2*l):t==i&&this.syncScrollPositions(r,-.2*a),!1},syncScrollPositions:function(e){var t=void 0!==arguments[1]?arguments[1]:null;if(!this.destroyed){if(0===arguments.length)return void this.syncScrollWithMaster();var o,n,i,r=this.leftOverlay.mainTableScrollableElement,s=this.topOverlay.mainTableScrollableElement,l=e.target,a=0,h=!1,d=!1,f=this.wot.getSetting("preventOverflow");this.topOverlay.needFullRender&&(o=this.topOverlay.clone.wtTable.holder),this.bottomOverlay.needFullRender&&(i=this.bottomOverlay.clone.wtTable.holder),this.leftOverlay.needFullRender&&(n=this.leftOverlay.clone.wtTable.holder),l===document&&(l=window),l===r||l===s?(a=u(f?this.scrollableElement:l),this.horizontalScrolling=!0,this.overlayScrollPositions.master.left=a,h=!0,this.pendingScrollCallbacks.master.left>0?this.pendingScrollCallbacks.master.left--:(o&&o.scrollLeft!==a&&(null==t&&this.pendingScrollCallbacks.top.left++,o.scrollLeft=a,d=r!==window),i&&i.scrollLeft!==a&&(null==t&&this.pendingScrollCallbacks.bottom.left++,i.scrollLeft=a,d=r!==window)),a=c(l),this.verticalScrolling=!0,this.overlayScrollPositions.master.top=a,h=!0,this.pendingScrollCallbacks.master.top>0?this.pendingScrollCallbacks.master.top--:n&&n.scrollTop!==a&&(null==t&&this.pendingScrollCallbacks.left.top++,n.scrollTop=a,d=s!==window)):l===i?(a=u(l),this.horizontalScrolling=!0,this.overlayScrollPositions.bottom.left=a,h=!0,this.pendingScrollCallbacks.bottom.left>0?this.pendingScrollCallbacks.bottom.left--:(null==t&&this.pendingScrollCallbacks.master.left++,r.scrollLeft=a,o&&o.scrollLeft!==a&&(null==t&&this.pendingScrollCallbacks.top.left++,o.scrollLeft=a,d=s!==window)),null!==t&&(h=!0,s.scrollTop+=t)):l===o?(a=u(l),this.horizontalScrolling=!0,this.overlayScrollPositions.top.left=a,h=!0,this.pendingScrollCallbacks.top.left>0?this.pendingScrollCallbacks.top.left--:(null==t&&this.pendingScrollCallbacks.master.left++,r.scrollLeft=a),null!==t&&(h=!0,s.scrollTop+=t),i&&i.scrollLeft!==a&&(null==t&&this.pendingScrollCallbacks.bottom.left++,i.scrollLeft=a,d=s!==window)):l===n&&(a=c(l),this.overlayScrollPositions.left.top!==a&&(this.verticalScrolling=!0,this.overlayScrollPositions.left.top=a,h=!0,this.pendingScrollCallbacks.left.top>0?this.pendingScrollCallbacks.left.top--:(null==t&&this.pendingScrollCallbacks.master.top++,s.scrollTop=a)),null!==t&&(h=!0,s.scrollLeft+=t)),!this.keyPressed&&h&&"scroll"===e.type&&(this.delegatedScrollCallback?this.delegatedScrollCallback=!1:this.refreshAll(),d&&(this.delegatedScrollCallback=!0))}},syncScrollWithMaster:function(){var e=this.topOverlay.mainTableScrollableElement;this.topOverlay.needFullRender&&(this.topOverlay.clone.wtTable.holder.scrollLeft=e.scrollLeft),this.leftOverlay.needFullRender&&(this.leftOverlay.clone.wtTable.holder.scrollTop=e.scrollTop)},updateMainScrollableElements:function(){this.deregisterListeners(),this.leftOverlay.updateMainScrollableElement(),this.topOverlay.updateMainScrollableElement(),this.bottomOverlay.needFullRender&&this.bottomOverlay.updateMainScrollableElement(),this.scrollableElement=l(this.wot.wtTable.TABLE),this.registerListeners()},destroy:function(){this.eventManager.destroy(),this.topOverlay.destroy(),this.bottomOverlay.clone&&this.bottomOverlay.destroy(),this.leftOverlay.destroy(),this.topLeftCornerOverlay&&this.topLeftCornerOverlay.destroy(),this.bottomLeftCornerOverlay&&this.bottomLeftCornerOverlay.clone&&this.bottomLeftCornerOverlay.destroy(),this.debug&&this.debug.destroy(),this.destroyed=!0},refresh:function(){var e=void 0!==arguments[0]?arguments[0]:!1;if(this.topOverlay.areElementSizesAdjusted&&this.leftOverlay.areElementSizesAdjusted){var t=this.wot.wtTable.wtRootElement.parentNode||this.wot.wtTable.wtRootElement,o=t.clientWidth,n=t.clientHeight;o===this.spreaderLastSize.width&&n===this.spreaderLastSize.height||(this.spreaderLastSize.width=o,this.spreaderLastSize.height=n,this.adjustElementsSize())}this.bottomOverlay.clone&&this.bottomOverlay.refresh(e),this.leftOverlay.refresh(e),this.topOverlay.refresh(e),this.topLeftCornerOverlay&&this.topLeftCornerOverlay.refresh(e),this.bottomLeftCornerOverlay&&this.bottomLeftCornerOverlay.clone&&this.bottomLeftCornerOverlay.refresh(e),this.debug&&this.debug.refresh(e)},adjustElementsSize:function(){var e=void 0!==arguments[0]?arguments[0]:!1,t=this.wot.getSetting("totalColumns"),o=this.wot.getSetting("totalRows"),n=this.wot.wtViewport.getRowHeaderWidth(),i=this.wot.wtViewport.getColumnHeaderHeight(),r=this.wot.wtTable.hider.style;r.width=n+this.leftOverlay.sumCellSizes(0,t)+"px",r.height=i+this.topOverlay.sumCellSizes(0,o)+1+"px",this.topOverlay.adjustElementsSize(e),this.leftOverlay.adjustElementsSize(e),this.bottomOverlay.clone&&this.bottomOverlay.adjustElementsSize(e)},applyToDOM:function(){this.topOverlay.areElementSizesAdjusted&&this.leftOverlay.areElementSizesAdjusted||this.adjustElementsSize(),this.topOverlay.applyToDOM(),this.bottomOverlay.clone&&this.bottomOverlay.applyToDOM(),this.leftOverlay.applyToDOM()}},{}),window.WalkontableOverlays=f},{eventManager:41,"helpers/dom/element":45,"helpers/unicode":54}],17:[function(e,t,o){"use strict";Object.defineProperties(o,{WalkontableScroll:{get:function(){return g}},__esModule:{value:!0}});var n,i,r=(n=e("helpers/dom/element"),n&&n.__esModule&&n||{"default":n}),s=r.innerHeight,l=r.innerWidth,a=r.getScrollLeft,u=r.getScrollTop,c=r.offset,h=(i=e("helpers/number"),i&&i.__esModule&&i||{"default":i}),d=h.rangeEach,f=h.rangeEachReverse,g=function(e){this.wot=e,this.instance=e};$traceurRuntime.createClass(g,{scrollViewport:function(e){if(this.wot.drawn){var t=this._getVariables(),o=t.topOverlay,n=t.leftOverlay,i=t.totalRows,r=t.totalColumns,s=t.fixedRowsTop,l=t.fixedRowsBottom,a=t.fixedColumnsLeft;if(e.row<0||e.row>i-1)throw new Error("row "+e.row+" does not exist");if(e.col<0||e.col>r-1)throw new Error("column "+e.col+" does not exist");e.row>=s&&e.rowthis.getLastVisibleRow()&&e.row=a&&e.colthis.getLastVisibleColumn()&&n.scrollTo(e.col,!0)}},getFirstVisibleRow:function(){var e=this._getVariables(),t=e.topOverlay,o=e.wtTable,n=e.wtViewport,i=e.totalRows,r=e.fixedRowsTop,l=o.getFirstVisibleRow();if(t.mainTableScrollableElement===window){var a=c(o.wtRootElement),h=s(o.hider),d=s(window),g=u(window);if(a.top+h-d<=g){var p=n.getColumnHeaderHeight();p+=t.sumCellSizes(0,r),f(i,1,function(e){return p+=t.sumCellSizes(e-1,e),a.top+h-p<=g?(l=e,!1):void 0})}}return l},getLastVisibleRow:function(){var e=this._getVariables(),t=e.topOverlay,o=e.wtTable,n=e.wtViewport,i=e.totalRows,r=o.getLastVisibleRow();if(t.mainTableScrollableElement===window){var l=c(o.wtRootElement),a=s(window),h=u(window);if(l.top>h){var f=n.getColumnHeaderHeight();d(1,i,function(e){return f+=t.sumCellSizes(e-1,e),l.top+f-h>=a?(r=e-2,!1):void 0})}}return r},getFirstVisibleColumn:function(){var e=this._getVariables(),t=e.leftOverlay,o=e.wtTable,n=e.wtViewport,i=e.totalColumns,r=(e.fixedColumnsLeft,o.getFirstVisibleColumn());if(t.mainTableScrollableElement===window){var s=c(o.wtRootElement),u=l(o.hider),h=l(window),d=a(window);if(s.left+u-h<=d){var g=n.getRowHeaderWidth();f(i,1,function(e){return g+=t.sumCellSizes(e-1,e),s.left+u-g<=d?(r=e,!1):void 0})}}return r},getLastVisibleColumn:function(){var e=this._getVariables(),t=e.leftOverlay,o=e.wtTable,n=e.wtViewport,i=e.totalColumns,r=o.getLastVisibleColumn();if(t.mainTableScrollableElement===window){var s=c(o.wtRootElement),u=l(window),h=a(window);if(s.left>h){var f=n.getRowHeaderWidth();d(1,i,function(e){return f+=t.sumCellSizes(e-1,e),s.left+f-h>=u?(r=e-2,!1):void 0})}}return r},_getVariables:function(){var e=this.wot,t=e.wtOverlays.topOverlay,o=e.wtOverlays.leftOverlay,n=e.wtTable,i=e.wtViewport,r=e.getSetting("totalRows"),s=e.getSetting("totalColumns"),l=e.getSetting("fixedRowsTop"),a=e.getSetting("fixedRowsBottom"),u=e.getSetting("fixedColumnsLeft");return{topOverlay:t,leftOverlay:o,wtTable:n,wtViewport:i,totalRows:r,totalColumns:s,fixedRowsTop:l,fixedRowsBottom:a,fixedColumnsLeft:u}}},{}),window.WalkontableScroll=g},{"helpers/dom/element":45,"helpers/number":50}],18:[function(e,t,o){"use strict";Object.defineProperties(o,{WalkontableSelection:{get:function(){return h}},__esModule:{value:!0}});var n,i,r,s,l=(n=e("helpers/dom/element"),n&&n.__esModule&&n||{"default":n}).addClass,a=(i=e("border"),i&&i.__esModule&&i||{"default":i}).WalkontableBorder,u=(r=e("cell/coords"),r&&r.__esModule&&r||{"default":r}).WalkontableCellCoords,c=(s=e("cell/range"),s&&s.__esModule&&s||{"default":s}).WalkontableCellRange,h=function(e,t){this.settings=e,this.cellRange=t||null,this.instanceBorders={}};$traceurRuntime.createClass(h,{getBorder:function(e){return this.instanceBorders[e.guid]?this.instanceBorders[e.guid]:void(this.instanceBorders[e.guid]=new a(e,this.settings))},isEmpty:function(){return null===this.cellRange},add:function(e){this.isEmpty()?this.cellRange=new c(e,e,e):this.cellRange.expand(e)},replace:function(e,t){if(!this.isEmpty()){if(this.cellRange.from.isEqual(e))return this.cellRange.from=t,!0;if(this.cellRange.to.isEqual(e))return this.cellRange.to=t,!0}return!1},clear:function(){this.cellRange=null},getCorners:function(){var e=this.cellRange.getTopLeftCorner(),t=this.cellRange.getBottomRightCorner();return[e.row,e.col,t.row,t.col]},addClassAtCoords:function(e,t,o,n){var i=e.wtTable.getCell(new u(t,o));"object"==typeof i&&l(i,n)},draw:function(e){if(this.isEmpty()){if(this.settings.border){var t=this.getBorder(e);t&&t.disappear()}}else{for(var o,n,i,r=e.wtTable.getRenderedRowsCount(),s=e.wtTable.getRenderedColumnsCount(),a=this.getCorners(),u=0;s>u;u++)n=e.wtTable.columnFilter.renderedToSource(u),n>=a[1]&&n<=a[3]&&(i=e.wtTable.getColumnHeader(n),i&&this.settings.highlightColumnClassName&&l(i,this.settings.highlightColumnClassName));for(var c=0;r>c;c++){o=e.wtTable.rowFilter.renderedToSource(c),o>=a[0]&&o<=a[2]&&(i=e.wtTable.getRowHeader(o),i&&this.settings.highlightRowClassName&&l(i,this.settings.highlightRowClassName));for(var h=0;s>h;h++)n=e.wtTable.columnFilter.renderedToSource(h),o>=a[0]&&o<=a[2]&&n>=a[1]&&n<=a[3]?this.settings.className&&this.addClassAtCoords(e,o,n,this.settings.className):o>=a[0]&&o<=a[2]?this.settings.highlightRowClassName&&this.addClassAtCoords(e,o,n,this.settings.highlightRowClassName):n>=a[1]&&n<=a[3]&&this.settings.highlightColumnClassName&&this.addClassAtCoords(e,o,n,this.settings.highlightColumnClassName)}if(e.getSetting("onBeforeDrawBorders",a,this.settings.className),this.settings.border){var d=this.getBorder(e);d&&d.appear(a)}}}},{}),window.WalkontableSelection=h},{border:2,"cell/coords":5,"cell/range":6,"helpers/dom/element":45}],19:[function(e,t,o){"use strict";Object.defineProperties(o,{WalkontableSettings:{get:function(){return r}},__esModule:{value:!0}});var n,i=(n=e("helpers/dom/element"),n&&n.__esModule&&n||{"default":n}).fastInnerText,r=function(e,t){var o=this;this.wot=e,this.instance=e,this.defaults={table:void 0,debug:!1,externalRowCalculator:!1,stretchH:"none",currentRowClassName:null,currentColumnClassName:null,preventOverflow:function(){return!1},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(e,t,n){var r=o.getSetting("data",e,t);i(n,void 0===r||null===r?"":r)},columnWidth:function(e){},rowHeight:function(e){},defaultRowHeight:23,defaultColumnWidth:50,selections:null,hideBorderOnMouseDownOver:!1,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(e){return e},scrollbarWidth:10,scrollbarHeight:10,renderAllRows:!1,groups:!1,rowHeaderWidth:null,columnHeaderHeight:null},this.settings={};for(var n in this.defaults)if(this.defaults.hasOwnProperty(n))if(void 0!==t[n])this.settings[n]=t[n];else{if(void 0===this.defaults[n])throw new Error('A required setting "'+n+'" was not provided');this.settings[n]=this.defaults[n]}};$traceurRuntime.createClass(r,{update:function(e,t){if(void 0===t)for(var o in e)e.hasOwnProperty(o)&&(this.settings[o]=e[o]);else this.settings[e]=t;return this.wot},getSetting:function(e,t,o,n,i){return"function"==typeof this.settings[e]?this.settings[e](t,o,n,i):void 0!==t&&Array.isArray(this.settings[e])?this.settings[e][t]:this.settings[e]},has:function(e){return!!this.settings[e]}},{}),window.WalkontableSettings=r},{"helpers/dom/element":45}],20:[function(e,t,o){"use strict";Object.defineProperties(o,{WalkontableTable:{get:function(){return E}},__esModule:{value:!0}});var n,i,r,s,l,a,u=(n=e("helpers/dom/element"),n&&n.__esModule&&n||{"default":n}),c=u.getStyle,h=u.getTrimmingContainer,d=u.hasClass,f=u.index,g=u.offset,p=u.removeClass,m=u.removeTextNodes,w=u.overlayContainsElement,v=u.closest,b=(i=e("cell/coords"),i&&i.__esModule&&i||{"default":i}).WalkontableCellCoords,C=((r=e("cell/range"),r&&r.__esModule&&r||{"default":r}).WalkontableCellRange,(s=e("filter/column"),s&&s.__esModule&&s||{"default":s}).WalkontableColumnFilter),y=(l=e("filter/row"),l&&l.__esModule&&l||{"default":l}).WalkontableRowFilter,R=(a=e("tableRenderer"),a&&a.__esModule&&a||{"default":a}).WalkontableTableRenderer,E=function(e,t){this.wot=e,this.instance=this.wot,this.TABLE=t,this.TBODY=null,this.THEAD=null,this.COLGROUP=null,this.tableOffset=0,this.holderOffset=0,m(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(E,{fixTableDomTree:function(){this.TBODY=this.TABLE.querySelector("tbody"),this.TBODY||(this.TBODY=document.createElement("tbody"),this.TABLE.appendChild(this.TBODY)),this.THEAD=this.TABLE.querySelector("thead"),this.THEAD||(this.THEAD=document.createElement("thead"),this.TABLE.insertBefore(this.THEAD,this.TBODY)),this.COLGROUP=this.TABLE.querySelector("colgroup"),this.COLGROUP||(this.COLGROUP=document.createElement("colgroup"),this.TABLE.insertBefore(this.COLGROUP,this.THEAD)),this.wot.getSetting("columnHeaders").length&&!this.THEAD.childNodes.length&&this.THEAD.appendChild(document.createElement("TR"))},createSpreader:function(e){var t,o=e.parentNode;return o&&1===o.nodeType&&d(o,"wtHolder")||(t=document.createElement("div"),t.className="wtSpreader",o&&o.insertBefore(t,e),t.appendChild(e)),t.style.position="relative",t},createHider:function(e){var t,o=e.parentNode;return o&&1===o.nodeType&&d(o,"wtHolder")||(t=document.createElement("div"),t.className="wtHider",o&&o.insertBefore(t,e),t.appendChild(e)),t},createHolder:function(e){var t,o=e.parentNode;return o&&1===o.nodeType&&d(o,"wtHolder")||(t=document.createElement("div"),t.style.position="relative",t.className="wtHolder",o&&o.insertBefore(t,e),this.isWorkingOnClone()||(t.parentNode.className+="ht_master handsontable"),t.appendChild(e)),t},alignOverlaysWithTrimmingContainer:function(){var e=h(this.wtRootElement);if(!this.isWorkingOnClone())if(this.holder.parentNode.style.position="relative",e===window){var t=this.wot.getSetting("preventOverflow");t||(this.holder.style.overflow="visible",this.wtRootElement.style.overflow="visible")}else this.holder.style.width=c(e,"width"),this.holder.style.height=c(e,"height"),this.holder.style.overflow=""},isWorkingOnClone:function(){return!!this.wot.cloneSource},draw:function(e){var t=this.instance.getSetting("totalRows");if(this.isWorkingOnClone()||(this.holderOffset=g(this.holder),e=this.wot.wtViewport.createRenderCalculators(e)),e)this.isWorkingOnClone()||this.wot.wtViewport.createVisibleCalculators(),this.wot.wtOverlays&&this.wot.wtOverlays.refresh(!0);else{this.isWorkingOnClone()?this.tableOffset=this.wot.cloneSource.wtTable.tableOffset:this.tableOffset=g(this.TABLE);var o;o=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)?0:WalkontableOverlay.isOverlayTypeOf(this.instance.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM)||WalkontableOverlay.isOverlayTypeOf(this.instance.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER)?Math.max(t-this.wot.getSetting("fixedRowsBottom"),0):this.wot.wtViewport.rowsRenderCalculator.startRow;var n;n=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)?0:this.wot.wtViewport.columnsRenderCalculator.startColumn,this.rowFilter=new y(o,t,this.wot.getSetting("columnHeaders").length),this.columnFilter=new C(n,this.wot.getSetting("totalColumns"),this.wot.getSetting("rowHeaders").length),this._doDraw(),this.alignOverlaysWithTrimmingContainer()}return this.refreshSelections(e),this.isWorkingOnClone()||(this.wot.wtOverlays.topOverlay.resetFixedPosition(),this.wot.wtOverlays.bottomOverlay.clone&&this.wot.wtOverlays.bottomOverlay.resetFixedPosition(),this.wot.wtOverlays.leftOverlay.resetFixedPosition(),this.wot.wtOverlays.topLeftCornerOverlay&&this.wot.wtOverlays.topLeftCornerOverlay.resetFixedPosition(),this.instance.wtOverlays.bottomLeftCornerOverlay&&this.instance.wtOverlays.bottomLeftCornerOverlay.clone&&this.wot.wtOverlays.bottomLeftCornerOverlay.resetFixedPosition()),this.wot.drawn=!0,this},_doDraw:function(){var e=new R(this);e.render()},removeClassFromCells:function(e){for(var t=this.TABLE.querySelectorAll("."+e),o=0,n=t.length;n>o;o++)p(t[o],e)},refreshSelections:function(e){if(this.wot.selections){var t=this.wot.selections.length;if(e)for(var o=0;t>o;o++)this.wot.selections[o].settings.className&&this.removeClassFromCells(this.wot.selections[o].settings.className),this.wot.selections[o].settings.highlightRowClassName&&this.removeClassFromCells(this.wot.selections[o].settings.highlightRowClassName),this.wot.selections[o].settings.highlightColumnClassName&&this.removeClassFromCells(this.wot.selections[o].settings.highlightColumnClassName);for(var n=0;t>n;n++)this.wot.selections[n].draw(this.wot,e)}},getCell:function(e){if(this.isRowBeforeRenderedRows(e.row))return-1;if(this.isRowAfterRenderedRows(e.row))return-2;var t=this.TBODY.childNodes[this.rowFilter.sourceToRendered(e.row)];return t?t.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(e.col)]:void 0},getColumnHeader:function(e){var t=void 0!==arguments[1]?arguments[1]:0,o=this.THEAD.childNodes[t];return o?o.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(e)]:void 0},getRowHeader:function(e){if(0===this.columnFilter.sourceColumnToVisibleRowHeadedColumn(0))return null;var t=this.TBODY.childNodes[this.rowFilter.sourceToRendered(e)];return t?t.childNodes[0]:void 0},getCoords:function(e){"TD"!==e.nodeName&&"TH"!==e.nodeName&&(e=v(e,["TD","TH"]));var t=e.parentNode,o=t.parentNode,n=f(t),i=e.cellIndex;return w(WalkontableOverlay.CLONE_TOP_LEFT_CORNER,e)||w(WalkontableOverlay.CLONE_TOP,e)?"THEAD"===o.nodeName&&(n-=o.childNodes.length):n=o===this.THEAD?this.rowFilter.visibleColHeadedRowToSourceRow(n):this.rowFilter.renderedToSource(n),i=w(WalkontableOverlay.CLONE_TOP_LEFT_CORNER,e)||w(WalkontableOverlay.CLONE_LEFT,e)?this.columnFilter.offsettedTH(i):this.columnFilter.visibleRowHeadedColumnToSourceColumn(i),new b(n,i)},getTrForRow:function(e){return this.TBODY.childNodes[this.rowFilter.sourceToRendered(e)]},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(e){return this.rowFilter.sourceToRendered(e)<0&&e>=0},isRowAfterViewport:function(e){return this.rowFilter.sourceToRendered(e)>this.getLastVisibleRow()},isRowAfterRenderedRows:function(e){return this.rowFilter.sourceToRendered(e)>this.getLastRenderedRow()},isColumnBeforeViewport:function(e){return this.columnFilter.sourceToRendered(e)<0&&e>=0},isColumnAfterViewport:function(e){return this.columnFilter.sourceToRendered(e)>this.getLastVisibleColumn()},isLastRowFullyVisible:function(){return this.getLastVisibleRow()===this.getLastRenderedRow()},isLastColumnFullyVisible:function(){return this.getLastVisibleColumn()===this.getLastRenderedColumn()},getRenderedColumnsCount:function(){var e=this.wot.wtViewport.columnsRenderCalculator.count,t=this.wot.getSetting("totalColumns");if(this.wot.isOverlayName(WalkontableOverlay.CLONE_DEBUG))e=t;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"),t);return e},getRenderedRowsCount:function(){var e=this.wot.wtViewport.rowsRenderCalculator.count,t=this.wot.getSetting("totalRows");return this.wot.isOverlayName(WalkontableOverlay.CLONE_DEBUG)?e=t:this.wot.isOverlayName(WalkontableOverlay.CLONE_TOP)||this.wot.isOverlayName(WalkontableOverlay.CLONE_TOP_LEFT_CORNER)?e=Math.min(this.wot.getSetting("fixedRowsTop"),t):(this.wot.isOverlayName(WalkontableOverlay.CLONE_BOTTOM)||this.wot.isOverlayName(WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER))&&(e=Math.min(this.wot.getSetting("fixedRowsBottom"),t)),e},getVisibleRowsCount:function(){return this.wot.wtViewport.rowsVisibleCalculator.count},allRowsInViewport:function(){return this.wot.getSetting("totalRows")==this.getVisibleRowsCount()},getRowHeight:function(e){var t=this.wot.wtSettings.settings.rowHeight(e),o=this.wot.wtViewport.oversizedRows[e];return void 0!==o&&(t=void 0===t?o:Math.max(t,o)),t},getColumnHeaderHeight:function(e){var t=this.wot.wtSettings.settings.defaultRowHeight,o=this.wot.wtViewport.oversizedColumnHeaders[e];return void 0!==o&&(t=t?Math.max(t,o):o),t},getVisibleColumnsCount:function(){return this.wot.wtViewport.columnsVisibleCalculator.count},allColumnsInViewport:function(){return this.wot.getSetting("totalColumns")==this.getVisibleColumnsCount()},getColumnWidth:function(e){var t=this.wot.wtSettings.settings.columnWidth;return"function"==typeof t?t=t(e):"object"==typeof t&&(t=t[e]),t||this.wot.wtSettings.settings.defaultColumnWidth},getStretchedColumnWidth:function(e){var t=this.getColumnWidth(e),o=null==t?this.instance.wtSettings.settings.defaultColumnWidth:t,n=this.wot.wtViewport.columnsRenderCalculator;if(n){var i=n.getStretchedColumnWidth(e,o);i&&(o=i)}return o}},{}),window.WalkontableTable=E},{"cell/coords":5,"cell/range":6,"filter/column":9,"filter/row":10,"helpers/dom/element":45,tableRenderer:21}],21:[function(e,t,o){"use strict";function n(e,t){var o=document.createElement("TH");return t.insertBefore(o,e),t.removeChild(e),o}function i(e,t){var o=document.createElement("TD");return t.insertBefore(o,e),t.removeChild(e),o}Object.defineProperties(o,{WalkontableTableRenderer:{get:function(){return f}},__esModule:{value:!0}});var r,s=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),l=s.addClass,a=s.empty,u=s.getScrollbarWidth,c=s.hasClass,h=s.innerHeight,d=s.outerWidth,f=function(e){this.wtTable=e,this.wot=e.instance,this.instance=e.instance,this.rowFilter=e.rowFilter,this.columnFilter=e.columnFilter,this.TABLE=e.TABLE,this.THEAD=e.THEAD,this.TBODY=e.TBODY,this.COLGROUP=e.COLGROUP,this.rowHeaders=[],this.rowHeaderCount=0,this.columnHeaders=[],this.columnHeaderCount=0,this.fixedRowsTop=0,this.fixedRowsBottom=0};$traceurRuntime.createClass(f,{render:function(){this.wtTable.isWorkingOnClone()||this.wot.getSetting("beforeDraw",!0),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 e,t=this.wtTable.getRenderedColumnsCount(),o=this.wtTable.getRenderedRowsCount(),n=this.wot.getSetting("totalColumns"),i=this.wot.getSetting("totalRows"),r=!1;if((WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM)||WalkontableOverlay.isOverlayTypeOf(this.wot.cloneOverlay,WalkontableOverlay.CLONE_BOTTOM_LEFT_CORNER))&&(this.columnHeaders=[],this.columnHeaderCount=0),n>0&&(this.adjustAvailableNodes(),r=!0,this.renderColumnHeaders(),this.renderRows(i,o,t),this.wtTable.isWorkingOnClone()||(e=this.wot.wtViewport.getWorkspaceWidth(),this.wot.wtViewport.containerWidth=null),this.adjustColumnHeaderHeights(),this.adjustColumnWidths(t),this.markOversizedColumns()),r||this.adjustAvailableNodes(),this.removeRedundantRows(o),this.wtTable.isWorkingOnClone()&&!this.wot.isOverlayName(WalkontableOverlay.CLONE_BOTTOM)||this.markOversizedRows(),this.wtTable.isWorkingOnClone())this.wot.isOverlayName(WalkontableOverlay.CLONE_BOTTOM)&&this.wot.cloneSource.wtOverlays.adjustElementsSize();else{this.wot.wtViewport.createVisibleCalculators(),this.wot.wtOverlays.refresh(!1);var s=d(this.wtTable.hider),l=d(this.wtTable.TABLE);if(0!==s&&l!==s&&this.adjustColumnWidths(t),this.wot.wtOverlays.applyToDOM(),e!==this.wot.wtViewport.getWorkspaceWidth()){this.wot.wtViewport.containerWidth=null;var a=this.wtTable.getFirstRenderedColumn(),u=this.wtTable.getLastRenderedColumn(),c=this.wot.getSetting("rowHeaderWidth");if(null!=c)for(var h=0;hf;f++){var g=this.wtTable.getStretchedColumnWidth(f),p=this.columnFilter.sourceToRendered(f);this.COLGROUP.childNodes[p+this.rowHeaderCount].style.width=g+"px"}}this.wot.getSetting("onDraw",!0)}},removeRedundantRows:function(e){for(;this.wtTable.tbodyChildrenLength>e;)this.TBODY.removeChild(this.TBODY.lastChild),this.wtTable.tbodyChildrenLength--},renderRows:function(e,t,o){for(var n,i,r=0,s=this.rowFilter.renderedToSource(r),l=this.wtTable.isWorkingOnClone();e>s&&s>=0&&(r>1e3&&console.error("Security brake: Too much TRs. Please define height for your table, which will enforce scrollbars."),void 0===t||r!==t);){if(i=this.getOrCreateTrForRow(r,i),this.renderRowHeaders(s,i),this.adjustColumns(i,o+this.rowHeaderCount),n=this.renderCells(s,i,o),l&&!this.wot.isOverlayName(WalkontableOverlay.CLONE_BOTTOM)||this.resetOversizedRow(s),i.firstChild){var a=this.wot.wtTable.getRowHeight(s);a?(a--,i.firstChild.style.height=a+"px"):i.firstChild.style.height=""}r++,s=this.rowFilter.renderedToSource(r)}},resetOversizedRow:function(e){this.wot.getSetting("externalRowCalculator")||this.wot.wtViewport.oversizedRows&&this.wot.wtViewport.oversizedRows[e]&&(this.wot.wtViewport.oversizedRows[e]=void 0)},markOversizedRows:function(){if(!this.wot.getSetting("externalRowCalculator")){var e,t,o,n,i,r=this.instance.wtTable.TBODY.childNodes.length,s=r*this.instance.wtSettings.settings.defaultRowHeight,l=h(this.instance.wtTable.TBODY)-1;this.instance.getSetting("totalRows");if(s!==l||this.instance.getSetting("fixedRowsBottom"))for(;r;)r--,o=this.instance.wtTable.rowFilter.renderedToSource(r),e=this.instance.wtTable.getRowHeight(o),n=this.instance.wtTable.getTrForRow(o),i=n.querySelector("th"),t=i?h(i):h(n)-1,(!e&&this.instance.wtSettings.settings.defaultRowHeighte)&&(this.instance.wtViewport.oversizedRows[o]=++t)}},markOversizedColumns:function(){var e=this.wot.getOverlayName();if(this.columnHeaderCount&&!this.wot.wtViewport.isMarkedOversizedColumn[e]&&!this.wtTable.isWorkingOnClone()){for(var t=this.wtTable.getRenderedColumnsCount(),o=0;on;n++)this.markIfOversizedColumnHeader(n);this.wot.wtViewport.isMarkedOversizedColumn[e]=!0}},adjustColumnHeaderHeights:function(){for(var e=this.wot.getSetting("columnHeaders"),t=this.wot.wtTable.THEAD.childNodes,o=this.wot.wtViewport.oversizedColumnHeaders,n=0,i=e.length;i>n;n++)if(o[n]){if(0===t[n].childNodes.length)return;t[n].childNodes[0].style.height=o[n]+"px"}},markIfOversizedColumnHeader:function(e){for(var t,o,n,i=this.wot.wtTable.columnFilter.renderedToSource(e),r=this.columnHeaderCount,s=this.wot.wtSettings.settings.defaultRowHeight,l=this.wot.getSetting("columnHeaderHeight")||[];r;)r--,t=this.wot.wtTable.getColumnHeaderHeight(r),o=this.wot.wtTable.getColumnHeader(i,r),o&&(n=h(o),(!t&&n>s||n>t)&&(this.wot.wtViewport.oversizedColumnHeaders[r]=n),this.wot.wtViewport.oversizedColumnHeaders[r]<(l[r]||l)&&(this.wot.wtViewport.oversizedColumnHeaders[r]=l[r]||l))},renderCells:function(e,t,o){for(var n,r,s=0;o>s;s++)r=this.columnFilter.renderedToSource(s),n=0===s?t.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(r)]:n.nextSibling,"TH"==n.nodeName&&(n=i(n,t)),c(n,"hide")||(n.className=""),n.removeAttribute("style"),this.wot.wtSettings.settings.cellRenderer(e,r,n);return n},adjustColumnWidths:function(e){var t=0,o=this.wot.cloneSource?this.wot.cloneSource:this.wot,n=o.wtTable.holder;n.offsetHeights;s++){var l=this.wtTable.getStretchedColumnWidth(this.columnFilter.renderedToSource(s));this.COLGROUP.childNodes[s+this.rowHeaderCount].style.width=l+"px"}},appendToTbody:function(e){this.TBODY.appendChild(e),this.wtTable.tbodyChildrenLength++},getOrCreateTrForRow:function(e,t){var o;return e>=this.wtTable.tbodyChildrenLength?(o=this.createRow(),this.appendToTbody(o)):o=0===e?this.TBODY.firstChild:t.nextSibling,o.className&&o.removeAttribute("class"),o},createRow:function(){for(var e=document.createElement("TR"),t=0;tn;n++){var i=this.columnFilter.renderedToSource(n);this.renderColumnHeader(t,i,o.childNodes[n+this.rowHeaderCount])}},adjustColGroups:function(){for(var e=this.wtTable.getRenderedColumnsCount();this.wtTable.colgroupChildrenLengthe+this.rowHeaderCount;)this.COLGROUP.removeChild(this.COLGROUP.lastChild),this.wtTable.colgroupChildrenLength--;this.rowHeaderCount&&l(this.COLGROUP.childNodes[0],"rowHeader")},adjustThead:function(){var e=this.wtTable.getRenderedColumnsCount(),t=this.THEAD.firstChild;if(this.columnHeaders.length){for(var o=0,n=this.columnHeaders.length;n>o;o++){for(t=this.THEAD.childNodes[o],t||(t=document.createElement("TR"),this.THEAD.appendChild(t)),this.theadChildrenLength=t.childNodes.length;this.theadChildrenLengthe+this.rowHeaderCount;)t.removeChild(t.lastChild),this.theadChildrenLength--}var i=this.THEAD.childNodes.length;if(i>this.columnHeaders.length)for(var r=this.columnHeaders.length;i>r;r++)this.THEAD.removeChild(this.THEAD.lastChild)}else t&&a(t)},getTrForColumnHeaders:function(e){return this.THEAD.childNodes[e]},renderColumnHeader:function(e,t,o){return o.className="",o.removeAttribute("style"),this.columnHeaders[e](t,o,e)},adjustColumns:function(e,t){for(var o=e.childNodes.length;t>o;){var n=document.createElement("TD");e.appendChild(n),o++}for(;o>t;)e.removeChild(e.lastChild),o--},removeRedundantColumns:function(e){for(;this.wtTable.tbodyChildrenLength>e;)this.TBODY.removeChild(this.TBODY.lastChild),this.wtTable.tbodyChildrenLength--}},{}),window.WalkontableTableRenderer=f},{"helpers/dom/element":45}],22:[function(e,t,o){"use strict";Object.defineProperties(o,{WalkontableViewport:{get:function(){return m}},__esModule:{value:!0}});var n,i,r,s,l=(n=e("helpers/dom/element"),n&&n.__esModule&&n||{"default":n}),a=l.getScrollbarWidth,u=(l.getScrollTop,l.getStyle),c=l.offset,h=l.outerHeight,d=l.outerWidth,f=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).EventManager,g=(r=e("calculator/viewportColumns"),r&&r.__esModule&&r||{"default":r}).WalkontableViewportColumnsCalculator,p=(s=e("calculator/viewportRows"),s&&s.__esModule&&s||{"default":s}).WalkontableViewportRowsCalculator,m=function(e){var t=this;this.wot=e,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 f(this.wot),this.eventManager.addEventListener(window,"resize",function(){t.clientHeight=t.getWorkspaceHeight()})};$traceurRuntime.createClass(m,{getWorkspaceHeight:function(){var e,t=this.instance.wtOverlays.topOverlay.trimmingContainer,o=0;return t===window?o=document.documentElement.clientHeight:(e=h(t),o=e>0&&t.clientHeight>0?t.clientHeight:1/0),o},getWorkspaceWidth:function(){var e,t,o=this.wot.getSetting("totalColumns"),n=this.instance.wtOverlays.leftOverlay.trimmingContainer,i=this.wot.getSetting("stretchH"),r=document.documentElement.offsetWidth,s=this.wot.getSetting("preventOverflow");return s?d(this.instance.wtTable.wtRootElement):(e=Handsontable.freezeOverlays?Math.min(r-this.getWorkspaceOffset().left,r):Math.min(this.getContainerFillWidth(),r-this.getWorkspaceOffset().left,r),n===window&&o>0&&this.sumColumnWidths(0,o-1)>e?document.documentElement.clientWidth:n!==window&&(t=u(this.instance.wtOverlays.leftOverlay.trimmingContainer,"overflow"),"scroll"==t||"hidden"==t||"auto"==t)?Math.max(e,n.clientWidth):"none"!==i&&i?e:Math.max(e,d(this.instance.wtTable.TABLE)))},hasVerticalScroll:function(){return this.getWorkspaceActualHeight()>this.getWorkspaceHeight()},hasHorizontalScroll:function(){return this.getWorkspaceActualWidth()>this.getWorkspaceWidth()},sumColumnWidths:function(e,t){for(var o=0;t>e;)o+=this.wot.wtTable.getColumnWidth(e),e++;return o},getContainerFillWidth:function(){if(this.containerWidth)return this.containerWidth;var e,t,o=this.instance.wtTable.holder;return t=document.createElement("div"),t.style.width="100%",t.style.height="1px",o.appendChild(t),e=t.offsetWidth,this.containerWidth=e,o.removeChild(t),e},getWorkspaceOffset:function(){return c(this.wot.wtTable.TABLE)},getWorkspaceActualHeight:function(){return h(this.wot.wtTable.TABLE)},getWorkspaceActualWidth:function(){return d(this.wot.wtTable.TABLE)||d(this.wot.wtTable.TBODY)||d(this.wot.wtTable.THEAD)},getColumnHeaderHeight:function(){return isNaN(this.columnHeaderHeight)&&(this.columnHeaderHeight=h(this.wot.wtTable.THEAD)),this.columnHeaderHeight},getViewportHeight:function(){var e,t=this.getWorkspaceHeight();return t===1/0?t:(e=this.getColumnHeaderHeight(),e>0&&(t-=e),t)},getRowHeaderWidth:function(){var e=this.instance.getSetting("rowHeaderWidth"),t=this.instance.getSetting("rowHeaders");if(e){this.rowHeaderWidth=0;for(var o=0,n=t.length;n>o;o++)this.rowHeaderWidth+=e[o]||e}if(this.wot.cloneSource)return this.wot.cloneSource.wtViewport.getRowHeaderWidth();if(isNaN(this.rowHeaderWidth))if(t.length){var i=this.instance.wtTable.TABLE.querySelector("TH");this.rowHeaderWidth=0;for(var r=0,s=t.length;s>r;r++)i?(this.rowHeaderWidth+=d(i),i=i.nextSibling):this.rowHeaderWidth+=50}else this.rowHeaderWidth=0;return this.rowHeaderWidth},getViewportWidth:function(){var e,t=this.getWorkspaceWidth();return t===1/0?t:(e=this.getRowHeaderWidth(),e>0?t-e:t)},createRowsCalculator:function(){var e,t,o,n,i,r,s,l=void 0!==arguments[0]?arguments[0]:!1,u=this;return this.rowHeaderWidth=NaN,e=this.wot.wtSettings.settings.renderAllRows?1/0:this.getViewportHeight(),t=this.wot.wtOverlays.topOverlay.getScrollPosition()-this.wot.wtOverlays.topOverlay.getTableParentOffset(),0>t&&(t=0),o=this.wot.getSetting("fixedRowsTop"),i=this.wot.getSetting("fixedRowsBottom"),s=this.wot.getSetting("totalRows"),o&&(r=this.wot.wtOverlays.topOverlay.sumCellSizes(0,o),t+=r,e-=r),i&&this.wot.wtOverlays.bottomOverlay.clone&&(r=this.wot.wtOverlays.bottomOverlay.sumCellSizes(s-i,s),e-=r),n=this.wot.wtTable.holder.clientHeight===this.wot.wtTable.holder.offsetHeight?0:a(),new p(e,t,this.wot.getSetting("totalRows"),function(e){return u.wot.wtTable.getRowHeight(e)},l?null:this.wot.wtSettings.settings.viewportRowCalculatorOverride,l,n)},createColumnsCalculator:function(){var e,t,o=void 0!==arguments[0]?arguments[0]:!1,n=this,i=this.getViewportWidth();if(this.columnHeaderHeight=NaN,e=this.wot.wtOverlays.leftOverlay.getScrollPosition()-this.wot.wtOverlays.leftOverlay.getTableParentOffset(),0>e&&(e=0),t=this.wot.getSetting("fixedColumnsLeft")){var r=this.wot.wtOverlays.leftOverlay.sumCellSizes(0,t);e+=r,i-=r}return this.wot.wtTable.holder.clientWidth!==this.wot.wtTable.holder.offsetWidth&&(i-=a()),new g(i,e,this.wot.getSetting("totalColumns"),function(e){return n.wot.wtTable.getColumnWidth(e)},o?null:this.wot.wtSettings.settings.viewportColumnCalculatorOverride,o,this.wot.getSetting("stretchH"),function(e,t){return n.wot.getSetting("onBeforeStretchingColumnWidth",e,t)})},createRenderCalculators:function(){var e=void 0!==arguments[0]?arguments[0]:!1;if(e){var t=this.createRowsCalculator(!0),o=this.createColumnsCalculator(!0);this.areAllProposedVisibleRowsAlreadyRendered(t)&&this.areAllProposedVisibleColumnsAlreadyRendered(o)||(e=!1)}return e||(this.rowsRenderCalculator=this.createRowsCalculator(),this.columnsRenderCalculator=this.createColumnsCalculator()),this.rowsVisibleCalculator=null,this.columnsVisibleCalculator=null,e},createVisibleCalculators:function(){this.rowsVisibleCalculator=this.createRowsCalculator(!0),this.columnsVisibleCalculator=this.createColumnsCalculator(!0)},areAllProposedVisibleRowsAlreadyRendered:function(e){return this.rowsVisibleCalculator?e.startRow0?!1:!(e.endRow>this.rowsRenderCalculator.endRow||e.endRow===this.rowsRenderCalculator.endRow&&e.endRow0?!1:!(e.endColumn>this.columnsRenderCalculator.endColumn||e.endColumn===this.columnsRenderCalculator.endColumn&&e.endColumn=0;s--)if(null===e[s])e.splice(s,1);else{var l=e[s][0],a=h.propToCol(e[s][1]),u=m.getCellMeta(l,a);if("numeric"===u.type&&"string"==typeof e[s][3]&&e[s][3].length>0&&(/^-?[\d\s]*(\.|\,)?\d*$/.test(e[s][3])||u.format)){var c=e[s][3].length;"undefined"==typeof u.language?R.language("en"):e[s][3].indexOf(".")===c-3&&-1===e[s][3].indexOf(",")?R.language("en"):R.language(u.language),R.validate(e[s][3])&&(e[s][3]=R().unformat(e[s][3]))}m.getCellValidator(u)&&(r.addValidatorToQueue(),m.validateCell(e[s][3],u,function(t,o){return function(n){if("boolean"!=typeof n)throw new Error("Validation error: result is not boolean");n===!1&&o.allowInvalid===!1&&(e.splice(t,1),o.valid=!0,--t),r.removeValidatorFormQueue()}}(s,u),t))}r.checkIfQueueIsEmpty()}function i(e,t){var o=e.length-1;if(!(0>o)){for(;o>=0;o--)if(null!==e[o]){if(null!=e[o][2]||null!=e[o][3]){if(c.settings.allowInsertRow)for(;e[o][0]>m.countRows()-1;)h.createRow();if("array"===m.dataType&&c.settings.allowInsertColumn)for(;h.propToCol(e[o][1])>m.countCols()-1;)h.createCol();h.set(e[o][0],e[o][1],e[o][3])}}else e.splice(o,1);m.forceFullRender=!0,f.adjustRowsAndCols(),Handsontable.hooks.run(m,"beforeChangeRender",e,t),g.refreshBorders(null,!0),m.view.wt.wtOverlays.adjustElementsSize(),Handsontable.hooks.run(m,"afterChange",e,t||"edit")}}function r(e,t,o){return"object"==typeof e?e:[[e,t,o]]}function s(e){if(e.hasOwnProperty("type")){var t,o={};if("object"==typeof e.type)t=e.type;else if("string"==typeof e.type&&(t=Handsontable.cellTypes[e.type],void 0===t))throw new Error('You declared cell type "'+e.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 n in t)t.hasOwnProperty(n)&&!e.hasOwnProperty(n)&&(o[n]=t[n]);return o}}function l(e){return Handsontable.hooks.run(m,"modifyRow",e)}function a(e){return Handsontable.hooks.run(m,"modifyCol",e)}function u(){throw new Error("This method cannot be called because this Handsontable instance has been destroyed")}var c,h,d,f,g,p,m=this,w=function(){},v=A(m);x(w.prototype,Z.prototype),x(w.prototype,t),x(w.prototype,s(t)),this.rootElement=e,this.isHotTableEnv=O(this.rootElement),Handsontable.eventManager.isHotTableEnv=this.isHotTableEnv,this.container=document.createElement("DIV"),this.renderCall=!1,e.insertBefore(this.container,e.firstChild),this.guid="ht_"+F(),d=new U(m),this.rootElement.id&&"ht_"!==this.rootElement.id.substring(0,3)||(this.rootElement.id=this.guid),c={cellSettings:[],columnSettings:[],columnsSettingConflicts:["data","width"],settings:new w,selRange:null,isPopulated:null,scrollable:null,firstRun:!0},f={alter:function(e,t,o,n,i){function r(e,t,o,n){var i=function(){var e;return"array"===n?e=[]:"object"===n&&(e={}),e},r=j(new Array(o),function(){return i()});r.unshift(t,0),e.splice.apply(e,r)}var s;switch(o=o||1,e){case"insert_row":if(m.getSettings().maxRows===m.countSourceRows())return;s=h.createRow(t,o),r(c.cellSettings,t,o,"array"),s&&(g.isSelected()&&c.selRange.from.row>=t?(c.selRange.from.row=c.selRange.from.row+s,g.transformEnd(s,0)):g.refreshBorders());break;case"insert_col":s=h.createCol(t,o);for(var l=0,u=m.countSourceRows();u>l;l++)c.cellSettings[l]&&r(c.cellSettings[l],t,o);if(s){if(Array.isArray(m.getSettings().colHeaders)){var d=[t,0];d.length+=s,Array.prototype.splice.apply(m.getSettings().colHeaders,d)}g.isSelected()&&c.selRange.from.col>=t?(c.selRange.from.col=c.selRange.from.col+s,g.transformEnd(0,s)):g.refreshBorders()}break;case"remove_row":h.removeRow(t,o),c.cellSettings.splice(t,o);var p=m.countRows(),w=m.getSettings().fixedRowsTop;w>=t+1&&(m.getSettings().fixedRowsTop-=Math.min(o,w-t));var v=m.getSettings().fixedRowsBottom;v&&t>=p-v&&(m.getSettings().fixedRowsBottom-=Math.min(o,v)),f.adjustRowsAndCols(),g.refreshBorders();break;case"remove_col":var b=a(t);h.removeCol(t,o);for(var C=0,y=m.countSourceRows();y>C;C++)c.cellSettings[C]&&c.cellSettings[C].splice(b,o);var R=m.getSettings().fixedColumnsLeft;R>=t+1&&(m.getSettings().fixedColumnsLeft-=Math.min(o,R-t)),Array.isArray(m.getSettings().colHeaders)&&("undefined"==typeof b&&(b=-1),m.getSettings().colHeaders.splice(b,o)),f.adjustRowsAndCols(),g.refreshBorders();break;default:throw new Error('There is no such action "'+e+'"')}i||f.adjustRowsAndCols()},adjustRowsAndCols:function(){if(c.settings.minRows){var e=m.countRows();if(et;t++)h.createRow(m.countRows(),1,!0)}if(c.settings.minSpareRows){var n=m.countEmptyRows(!0);if(nr-1?(a=r-1,l=!0,d>a&&(d=a)):d>r-1&&(d=r-1,l=!0,a>d&&(a=d)),u>s-1?(u=s-1,l=!0,f>u&&(f=u)):f>s-1&&(f=s-1,l=!0,u>f&&(u=f)),l&&m.selectCell(a,u,d,f)}m.view&&m.view.wt.wtOverlays.adjustElementsSize()},populateFromArray:function(e,t,o,n,i,r,s){var l,a,u,h,d=[],f={};if(a=t.length,0===a)return!1;var g,p,w,v;({row:null===o?null:o.row,col:null===o?null:o.col});switch(i){case"shift_down":for(g=o?o.col-e.col+1:0,p=o?o.row-e.row+1:0,t=K(t),u=0,h=t.length,w=Math.max(h,g);w>u;u++)if(h>u){for(l=0,a=t[u].length;p-a>l;l++)t[u].push(t[u][l%a]);t[u].unshift(e.col+u,e.row,0),m.spliceCol.apply(m,t[u])}else t[u%h][0]=e.col+u,m.spliceCol.apply(m,t[u%h]);break;case"shift_right":for(g=o?o.col-e.col+1:0,p=o?o.row-e.row+1:0,l=0,a=t.length,v=Math.max(a,p);v>l;l++)if(a>l){for(u=0,h=t[l].length;g-h>u;u++)t[l].push(t[l][u%h]);t[l].unshift(e.row+l,e.col,0),m.spliceRow.apply(m,t[l])}else t[l%a][0]=e.row+l,m.spliceRow.apply(m,t[l%a]);break;case"overwrite":default:f.row=e.row,f.col=e.col;var b,C={row:o&&e?o.row-e.row+1:1,col:o&&e?o.col-e.col+1:1},y=0,R=0,E=!0,S=function(e){var o=void 0!==arguments[1]?arguments[1]:null,n=t[e%t.length];return null!==o?n[o%n.length]:n},T=t.length,O=o?o.row-e.row+1:0;for(a=o?O:Math.max(T,O),l=0;a>l&&!(o&&f.row>o.row&&O>T||!c.settings.allowInsertRow&&f.row>m.countRows()-1||f.row>=c.settings.maxRows);l++){var _=l-y,M=S(_).length,H=o?o.col-e.col+1:0;if(h=o?H:Math.max(M,H),f.col=e.col,b=m.getCellMeta(f.row,f.col),"paste"!==n&&"autofill"!==n||!b.skipRowOnPaste){for(R=0,u=0;h>u&&!(o&&f.col>o.col&&H>M||!c.settings.allowInsertColumn&&f.col>m.countCols()-1||f.col>=c.settings.maxCols);u++)if(b=m.getCellMeta(f.row,f.col),"paste"!==n&&"autofill"!==n||!b.skipColumnOnPaste)if(b.readOnly)f.col++;else{var k=u-R,A=S(_,k),P=m.getDataAtCell(f.row,f.col),x={row:_,col:k};if("autofill"===n){var W=m.runHooks("beforeAutofillInsidePopulate",x,r,t,s,{},C);W&&(A="undefined"==typeof W.value?A:W.value)}if(null!==A&&"object"==typeof A)if(null===P||"object"!=typeof P)E=!1;else{var I=D(P[0]||P),j=D(A[0]||A);N(I,j)?A=L(A):E=!1}else null!==P&&"object"==typeof P&&(E=!1);E&&d.push([f.row,f.col,A]),E=!0,f.col++}else R++,f.col++,h++;f.row++}else y++,f.row++,a++}m.setDataAtCell(d,null,null,n||"populateFromArray")}}},this.selection=g={inProgress:!1,selectedHeader:{cols:!1,rows:!1},setSelectedHeaders:function(e,t){m.selection.selectedHeader.rows=e,m.selection.selectedHeader.cols=t},begin:function(){m.selection.inProgress=!0},finish:function(){var e=m.getSelected();Handsontable.hooks.run(m,"afterSelectionEnd",e[0],e[1],e[2],e[3]),Handsontable.hooks.run(m,"afterSelectionEndByProp",e[0],m.colToProp(e[1]),e[2],m.colToProp(e[3])),m.selection.inProgress=!1},isInProgress:function(){return m.selection.inProgress},setRangeStart:function(e,t){Handsontable.hooks.run(m,"beforeSetRangeStart",e),c.selRange=new Q(e,e,e),g.setRangeEnd(e,null,t)},setRangeEnd:function(e,t,o){if(null!==c.selRange){var n,i=!1,r=!0,s=m.view.wt.wtTable.getFirstVisibleRow(),l=m.view.wt.wtTable.getFirstVisibleColumn(),a={row:null,col:null};Handsontable.hooks.run(m,"beforeSetRangeEnd",e),m.selection.begin(),a.row=e.row<0?s:e.row,a.col=e.col<0?l:e.col,c.selRange.to=new q(a.row,a.col),c.settings.multiSelect||(c.selRange.from=e),m.view.wt.selections.current.clear(),n=m.getCellMeta(c.selRange.highlight.row,c.selRange.highlight.col).disableVisualSelection,"string"==typeof n&&(n=[n]),(n===!1||Array.isArray(n)&&-1===n.indexOf("current"))&&m.view.wt.selections.current.add(c.selRange.highlight),m.view.wt.selections.area.clear(),(n===!1||Array.isArray(n)&&-1===n.indexOf("area"))&&g.isMultiple()&&(m.view.wt.selections.area.add(c.selRange.from),m.view.wt.selections.area.add(c.selRange.to)),(c.settings.currentRowClassName||c.settings.currentColClassName)&&(m.view.wt.selections.highlight.clear(),m.view.wt.selections.highlight.add(c.selRange.from),m.view.wt.selections.highlight.add(c.selRange.to)),Handsontable.hooks.run(m,"afterSelection",c.selRange.from.row,c.selRange.from.col,c.selRange.to.row,c.selRange.to.col),Handsontable.hooks.run(m,"afterSelectionByProp",c.selRange.from.row,h.colToProp(c.selRange.from.col),c.selRange.to.row,h.colToProp(c.selRange.to.col)),(0===c.selRange.from.row&&c.selRange.to.row===m.countRows()-1&&m.countRows()>1||0===c.selRange.from.col&&c.selRange.to.col===m.countCols()-1&&m.countCols()>1)&&(i=!0),(e.row<0||e.col<0)&&(r=!1),t!==!1&&!i&&r&&(c.selRange.from&&!g.isMultiple()?m.view.scrollViewport(c.selRange.from):m.view.scrollViewport(e)),g.refreshBorders(null,o)}},refreshBorders:function(e,t){t||p.destroyEditor(e),m.view.render(),g.isSelected()&&!t&&p.prepareEditor()},isMultiple:function(){var e=!(c.selRange.to.col===c.selRange.from.col&&c.selRange.to.row===c.selRange.from.row),t=Handsontable.hooks.run(m,"afterIsMultipleSelection",e);return e?t:void 0},transformStart:function(e,t,o,n){var i,r,s,l,a=new q(e,t),u=0,h=0;m.runHooks("modifyTransformStart",a),i=m.countRows(),r=m.countCols(),l=m.getSettings().fixedRowsBottom,c.selRange.highlight.row+e>i-1?o&&c.settings.minSpareRows>0&&!(l&&c.selRange.highlight.row>=i-l-1)?(m.alter("insert_row",i),i=m.countRows()):c.settings.autoWrapCol&&(a.row=1-i,a.col=c.selRange.highlight.col+a.col==r-1?1-r:1):c.settings.autoWrapCol&&c.selRange.highlight.row+a.row<0&&c.selRange.highlight.col+a.col>=0&&(a.row=i-1,a.col=c.selRange.highlight.col+a.col==0?r-1:-1),c.selRange.highlight.col+a.col>r-1?o&&c.settings.minSpareCols>0?(m.alter("insert_col",r),r=m.countCols()):c.settings.autoWrapRow&&(a.row=c.selRange.highlight.row+a.row==i-1?1-i:1,a.col=1-r):c.settings.autoWrapRow&&c.selRange.highlight.col+a.col<0&&c.selRange.highlight.row+a.row>=0&&(a.row=c.selRange.highlight.row+a.row==0?i-1:-1,a.col=r-1),s=new q(c.selRange.highlight.row+a.row,c.selRange.highlight.col+a.col),s.row<0?(u=-1,s.row=0):s.row>0&&s.row>=i&&(u=1,s.row=i-1),s.col<0?(h=-1,s.col=0):s.col>0&&s.col>=r&&(h=1,s.col=r-1),m.runHooks("afterModifyTransformStart",s,u,h),g.setRangeStart(s,n)},transformEnd:function(e,t){var o,n,i,r=new q(e,t),s=0,l=0;m.runHooks("modifyTransformEnd",r),o=m.countRows(),n=m.countCols(),i=new q(c.selRange.to.row+r.row,c.selRange.to.col+r.col),i.row<0?(s=-1,i.row=0):i.row>0&&i.row>=o&&(s=1,i.row=o-1),i.col<0?(l=-1,i.col=0):i.col>0&&i.col>=n&&(l=1,i.col=n-1),m.runHooks("afterModifyTransformEnd",i,s,l),g.setRangeEnd(i,!0)},isSelected:function(){return null!==c.selRange},inInSelection:function(e){return g.isSelected()?c.selRange.includes(e):!1},deselect:function(){g.isSelected()&&(m.selection.inProgress=!1,c.selRange=null,m.view.wt.selections.current.clear(),m.view.wt.selections.area.clear(),(c.settings.currentRowClassName||c.settings.currentColClassName)&&m.view.wt.selections.highlight.clear(),p.destroyEditor(),g.refreshBorders(),Handsontable.hooks.run(m,"afterDeselect"))},selectAll:function(){c.settings.multiSelect&&(g.setRangeStart(new q(0,0)),g.setRangeEnd(new q(m.countRows()-1,m.countCols()-1),!1))},empty:function(){if(g.isSelected()){var e,t,o=c.selRange.getTopLeftCorner(),n=c.selRange.getBottomRightCorner(),i=[];for(e=o.row;e<=n.row;e++)for(t=o.col;t<=n.col;t++)m.getCellMeta(e,t).readOnly||i.push([e,t,""]);m.setDataAtCell(i)}}},this.init=function(){d.setData(c.settings.data),Handsontable.hooks.run(m,"beforeInit"),Handsontable.mobileBrowser&&S(m.rootElement,"mobile"),this.updateSettings(c.settings,!0),this.view=new G(this),p=new k(m,c,g,h),this.forceFullRender=!0,Handsontable.hooks.run(m,"init"),this.view.render(),"object"==typeof c.firstRun&&(Handsontable.hooks.run(m,"afterChange",c.firstRun[0],c.firstRun[1]),c.firstRun=!1),Handsontable.hooks.run(m,"afterInit")},this.validateCell=function(e,t,o,n){function i(e){var n=t.visualCol,i=t.visualRow,r=m.getCell(i,n,!0);r&&m.view.wt.wtSettings.settings.cellRenderer(i,n,r),o(e)}var r=m.getCellValidator(t);"[object RegExp]"===Object.prototype.toString.call(r)&&(r=function(e){return function(t,o){o(e.test(t))}}(r)),"function"==typeof r?(e=Handsontable.hooks.run(m,"beforeValidate",e,t.visualRow,t.prop,n),m._registerTimeout(setTimeout(function(){r.call(t,e,function(o){o=Handsontable.hooks.run(m,"afterValidate",o,e,t.visualRow,t.prop,n),t.valid=o,i(o),Handsontable.hooks.run(m,"postAfterValidate",o,e,t.visualRow,t.prop,n)})},0))):m._registerTimeout(setTimeout(function(){t.valid=!0,i(t.valid)},0))},this.setDataAtCell=function(e,t,o,s){var l,a,u,c=r(e,t,o),d=[];for(l=0,a=c.length;a>l;l++){if("object"!=typeof c[l])throw new Error("Method `setDataAtCell` accepts row number or changes array of arrays as its first parameter");if("number"!=typeof c[l][1])throw new Error("Method `setDataAtCell` accepts row and column number as its parameters. If you want to use object property name, use method `setDataAtRowProp`");u=h.colToProp(c[l][1]),d.push([c[l][0],u,h.get(c[l][0],u),c[l][2]])}s||"object"!=typeof e||(s=t),n(d,s,function(){i(d,s)})},this.setDataAtRowProp=function(e,t,o,s){var l,a,u=r(e,t,o),c=[];for(l=0,a=u.length;a>l;l++)c.push([u[l][0],u[l][1],h.get(u[l][0],u[l][1]),u[l][2]]);s||"object"!=typeof e||(s=t),n(c,s,function(){i(c,s)})},this.listen=function(){Handsontable.activeGuid=m.guid},this.unlisten=function(){Handsontable.activeGuid=null},this.isListening=function(){return Handsontable.activeGuid===m.guid},this.destroyEditor=function(e){g.refreshBorders(e)},this.populateFromArray=function(e,t,o,n,i,r,s,l,a){var u;if("object"!=typeof o||"object"!=typeof o[0])throw new Error("populateFromArray parameter `input` must be an array of arrays");return u="number"==typeof n?new q(n,i):null,f.populateFromArray(new q(e,t),o,u,r,s,l,a)},this.spliceCol=function(e,t,o){return h.spliceCol.apply(h,arguments)},this.spliceRow=function(e,t,o){return h.spliceRow.apply(h,arguments)},this.getSelected=function(){return g.isSelected()?[c.selRange.from.row,c.selRange.from.col,c.selRange.to.row,c.selRange.to.col]:void 0},this.getSelectedRange=function(){return g.isSelected()?c.selRange:void 0},this.render=function(){m.view&&(m.renderCall=!0,m.forceFullRender=!0,g.refreshBorders(null,!0))},this.loadData=function(e){function t(){c.cellSettings.length=0}if("object"==typeof e&&null!==e)e.push&&e.splice||(e=[e]);else{if(null!==e)throw new Error("loadData only accepts array of objects or array of arrays ("+typeof e+" given)");e=[];for(var o,n=0,i=c.settings.startRows;i>n;n++){o=[];for(var r=0,s=c.settings.startCols;s>r;r++)o.push(null);e.push(o)}}c.isPopulated=!1,w.prototype.data=e,Array.isArray(c.settings.dataSchema)||Array.isArray(e[0])?m.dataType="array":"function"==typeof c.settings.dataSchema?m.dataType="function":m.dataType="object",h&&h.destroy(),h=new H(m,c,w),d.data=e,d.dataType=m.dataType,d.colToProp=h.colToProp.bind(h),d.propToCol=h.propToCol.bind(h),t(),f.adjustRowsAndCols(),Handsontable.hooks.run(m,"afterLoadData",c.firstRun),c.firstRun?c.firstRun=[null,"loadData"]:(Handsontable.hooks.run(m,"afterChange",null,"loadData"),m.render()),c.isPopulated=!0},this.getData=function(e,t,o,n){return"undefined"==typeof e?h.getAll():h.getRange(new q(e,t),new q(o,n),h.DESTINATION_RENDERER)},this.getCopyableText=function(e,t,o,n){return h.getCopyableText(new q(e,t),new q(o,n))},this.getCopyableData=function(e,t){return h.getCopyable(e,h.colToProp(t))},this.getSchema=function(){return h.getSchema()},this.updateSettings=function(e,t){var o,n;if("undefined"!=typeof e.rows)throw new Error('"rows" setting is no longer supported. do you mean startRows, minRows or maxRows?');if("undefined"!=typeof e.cols)throw new Error('"cols" setting is no longer supported. do you mean startCols, minCols or maxCols?');for(o in e)"data"!==o&&(Handsontable.hooks.getRegistered().indexOf(o)>-1?("function"==typeof e[o]||Array.isArray(e[o]))&&m.addHook(o,e[o]):!t&&e.hasOwnProperty(o)&&(w.prototype[o]=e[o]));if(void 0===e.data&&void 0===c.settings.data?m.loadData(null):void 0!==e.data?m.loadData(e.data):void 0!==e.columns&&h.createMap(),n=m.countCols(),void 0===e.cell&&void 0===e.cells&&void 0===e.columns||(c.cellSettings.length=0),n>0){var i,r;for(o=0;n>o;o++)c.columnSettings[o]=M(w,c.columnsSettingConflicts),i=c.columnSettings[o].prototype,w.prototype.columns&&(r=w.prototype.columns[o],r&&(x(i,r),x(i,s(r))))}if("undefined"!=typeof e.cell)for(o in e.cell)if(e.cell.hasOwnProperty(o)){var l=e.cell[o];m.setCellMetaObject(l.row,l.col,l)}Handsontable.hooks.run(m,"afterCellMetaReset"),"undefined"!=typeof e.className&&(w.prototype.className&&_(m.rootElement,w.prototype.className),e.className&&S(m.rootElement,e.className));var a=m.rootElement.style.height;""!==a&&(a=parseInt(m.rootElement.style.height,10));var u=e.height;if("function"==typeof u&&(u=u()),t){var d=m.rootElement.getAttribute("style");d&&m.rootElement.setAttribute("data-initialstyle",m.rootElement.getAttribute("style"))}if(null===u){var p=m.rootElement.getAttribute("data-initialstyle");p&&(p.indexOf("height")>-1||p.indexOf("overflow")>-1)?m.rootElement.setAttribute("style",p):(m.rootElement.style.height="",m.rootElement.style.overflow="")}else void 0!==u&&(m.rootElement.style.height=u+"px",m.rootElement.style.overflow="hidden");if("undefined"!=typeof e.width){var v=e.width;"function"==typeof v&&(v=v()),m.rootElement.style.width=v+"px"}t||Handsontable.hooks.run(m,"afterUpdateSettings"),f.adjustRowsAndCols(),m.view&&!c.firstRun&&(m.forceFullRender=!0,g.refreshBorders(null,!0)),t||!m.view||""!==a&&""!==u&&void 0!==u||a===u||m.view.wt.wtOverlays.updateMainScrollableElements()},this.getValue=function(){var e=m.getSelected();if(w.prototype.getValue){if("function"==typeof w.prototype.getValue)return w.prototype.getValue.call(m);if(e)return m.getData()[e[0]][w.prototype.getValue]}else if(e)return m.getDataAtCell(e[0],e[1])},this.getSettings=function(){return c.settings},this.clear=function(){g.selectAll(),g.empty()},this.alter=function(e,t,o,n,i){f.alter(e,t,o,n,i)},this.getCell=function(e,t,o){return m.view.getCellAtCoords(new q(e,t),o)},this.getCoords=function(e){return this.view.wt.wtTable.getCoords.call(this.view.wt.wtTable,e)},this.colToProp=function(e){return h.colToProp(e)},this.propToCol=function(e){return h.propToCol(e)},this.getDataAtCell=function(e,t){return h.get(e,h.colToProp(t))},this.getDataAtRowProp=function(e,t){return h.get(e,t)},this.getDataAtCol=function(e){var t=[];return t.concat.apply(t,h.getRange(new q(0,e),new q(c.settings.data.length-1,e),h.DESTINATION_RENDERER))},this.getDataAtProp=function(e){var t,o=[];return t=h.getRange(new q(0,h.propToCol(e)),new q(c.settings.data.length-1,h.propToCol(e)),h.DESTINATION_RENDERER),o.concat.apply(o,t)},this.getSourceData=function(e,t,o,n){var i;return i=void 0===e?d.getData():d.getByRange(new q(e,t),new q(o,n))},this.getSourceDataAtCol=function(e){return d.getAtColumn(e)},this.getSourceDataAtRow=function(e){return d.getAtRow(e)},this.getSourceDataAtCell=function(e,t){return d.getAtCell(e,t)},this.getDataAtRow=function(e){var t=h.getRange(new q(e,0),new q(e,this.countCols()-1),h.DESTINATION_RENDERER);return t[0]},this.getDataType=function(e,t,o,n){var i=this,r=null,s=null;void 0===e&&(e=0,o=this.countRows(),t=0,n=this.countCols()),void 0===o&&(o=e),void 0===n&&(n=t);var l="mixed";return z(Math.min(e,o),Math.max(e,o),function(e){var o=!0;return z(Math.min(t,n),Math.max(t,n),function(t){var n=i.getCellMeta(e,t);return s=n.type,r?o=r===s:r=s,o}),l=o?s:"mixed",o}),l},this.removeCellMeta=function(e,t,o){var n=m.getCellMeta(e,t);void 0!=n[o]&&delete c.cellSettings[e][t][o]},this.setCellMetaObject=function(e,t,o){if("object"==typeof o)for(var n in o)if(o.hasOwnProperty(n)){var i=o[n];this.setCellMeta(e,t,n,i)}},this.setCellMeta=function(e,t,o,n){c.cellSettings[e]||(c.cellSettings[e]=[]),c.cellSettings[e][t]||(c.cellSettings[e][t]=new c.columnSettings[t]),c.cellSettings[e][t][o]=n,Handsontable.hooks.run(m,"afterSetCellMeta",e,t,o,n)},this.getCellsMeta=function(){return I(c.cellSettings)},this.getCellMeta=function(e,t){var o,n=h.colToProp(t),i=e,r=t;if(e=l(e),t=a(t),c.columnSettings[t]||(c.columnSettings[t]=M(w,c.columnsSettingConflicts)),c.cellSettings[e]||(c.cellSettings[e]=[]),c.cellSettings[e][t]||(c.cellSettings[e][t]=new c.columnSettings[t]),o=c.cellSettings[e][t],o.row=e,o.col=t,o.visualRow=i,o.visualCol=r,o.prop=n,o.instance=m,Handsontable.hooks.run(m,"beforeGetCellMeta",e,t,o),x(o,s(o)),o.cells){var u=o.cells.call(o,e,t,n);u&&(x(o,u),x(o,s(u)))}return Handsontable.hooks.run(m,"afterGetCellMeta",e,t,o),o},this.isColumnModificationAllowed=function(){return!("object"===m.dataType||m.getSettings().columns)};var b=X("renderer");this.getCellRenderer=function(e,t){var o=b.call(this,e,t);return V(o)},this.getCellEditor=X("editor"),this.getCellValidator=X("validator"),this.validateCells=function(e){var t=new o;e&&(t.onQueueEmpty=e);for(var n=m.countRows()-1;n>=0;){for(var i=m.countCols()-1;i>=0;)t.addValidatorToQueue(),m.validateCell(m.getDataAtCell(n,i),m.getCellMeta(n,i),function(e){if("boolean"!=typeof e)throw new Error("Validation error: result is not boolean");e===!1&&(t.valid=!1),t.removeValidatorFormQueue()},"validateCells"),i--;n--}t.checkIfQueueIsEmpty()},this.getRowHeader=function(e){var t=c.settings.rowHeaders;return void 0!==e&&(e=Handsontable.hooks.run(m,"modifyRowHeader",e)),void 0===e?(t=[],z(m.countRows()-1,function(e){t.push(m.getRowHeader(e))})):Array.isArray(t)&&void 0!==t[e]?t=t[e]:"function"==typeof t?t=t(e):t&&"string"!=typeof t&&"number"!=typeof t&&(t=e+1),t},this.hasRowHeaders=function(){return!!c.settings.rowHeaders},this.hasColHeaders=function(){if(void 0!==c.settings.colHeaders&&null!==c.settings.colHeaders)return!!c.settings.colHeaders;for(var e=0,t=m.countCols();t>e;e++)if(m.getColHeader(e))return!0;return!1},this.getColHeader=function(e){if(e=Handsontable.hooks.run(m,"modifyColHeader",e),void 0===e){for(var t=[],o=0,n=m.countCols();n>o;o++)t.push(m.getColHeader(o));return t}var i=e;return e=Handsontable.hooks.run(m,"modifyCol",e),c.settings.columns&&c.settings.columns[e]&&c.settings.columns[e].title?c.settings.columns[e].title:Array.isArray(c.settings.colHeaders)&&void 0!==c.settings.colHeaders[e]?c.settings.colHeaders[e]:"function"==typeof c.settings.colHeaders?c.settings.colHeaders(e):c.settings.colHeaders&&"string"!=typeof c.settings.colHeaders&&"number"!=typeof c.settings.colHeaders?Y(i):c.settings.colHeaders},this._getColWidthFromSettings=function(e){var t=m.getCellMeta(0,e),o=t.width;if(void 0!==o&&o!==c.settings.width||(o=t.colWidths),void 0!==o&&null!==o){switch(typeof o){case"object":o=o[e];break;case"function":o=o(e)}"string"==typeof o&&(o=parseInt(o,10))}return o},this.getColWidth=function(e){var t=m._getColWidthFromSettings(e);return t=Handsontable.hooks.run(m,"modifyColWidth",t,e),void 0===t&&(t=J.DEFAULT_WIDTH),t},this._getRowHeightFromSettings=function(e){var t=c.settings.rowHeights;if(void 0!==t&&null!==t){switch(typeof t){case"object":t=t[e];break;case"function":t=t(e)}"string"==typeof t&&(t=parseInt(t,10))}return t},this.getRowHeight=function(e){var t=m._getRowHeightFromSettings(e);return t=Handsontable.hooks.run(m,"modifyRowHeight",t,e)},this.countSourceRows=function(){return m.getSourceData()?m.getSourceData().length:0},this.countRows=function(){return h.getLength()},this.countCols=function(){return"object"===m.dataType||"function"===m.dataType?c.settings.columns&&c.settings.columns.length?c.settings.columns.length:h.colToPropCache.length:"array"===m.dataType?c.settings.columns&&c.settings.columns.length?c.settings.columns.length:c.settings.data&&c.settings.data[0]&&c.settings.data[0].length?c.settings.data[0].length:0:void 0},this.getColspanOffset=function(e,t){var o=0;if(m.colspanArray){for(var n=0;e>n;n++)o+=m.colspanArray[t][n]-1||0;return o}for(var o=0,i=m.view.wt.wtTable.THEAD.childNodes.length-t-1,r=m.view.wt.wtTable.THEAD.querySelector("tr:nth-child("+parseInt(i+1,10)+")"),s=m.view.wt.wtSettings.settings.rowHeaders().length,n=s;s+e>n;n++)r.childNodes[n].hasAttribute("colspan")&&(o+=parseInt(r.childNodes[n].getAttribute("colspan"),10)-1);return o},this.getHeaderColspan=function(e,t){var o=m.view.wt.wtTable.THEAD.childNodes.length-t-1,n=m.view.wt.wtSettings.settings.rowHeaders().length,i=m.view.wt.wtTable.THEAD.querySelector("tr:nth-child("+parseInt(o+1,10)+")"),r=n+e-m.view.wt.wtViewport.columnsRenderCalculator.startColumn;return i.childNodes[r].hasAttribute("colspan")?parseInt(i.childNodes[r].getAttribute("colspan"),10):0},this.rowOffset=function(){return m.view.wt.wtTable.getFirstRenderedRow()},this.colOffset=function(){return m.view.wt.wtTable.getFirstRenderedColumn()},this.countRenderedRows=function(){return m.view.wt.drawn?m.view.wt.wtTable.getRenderedRowsCount():-1},this.countVisibleRows=function(){return m.view.wt.drawn?m.view.wt.wtTable.getVisibleRowsCount():-1},this.countRenderedCols=function(){return m.view.wt.drawn?m.view.wt.wtTable.getRenderedColumnsCount():-1},this.countVisibleCols=function(){return m.view.wt.drawn?m.view.wt.wtTable.getVisibleColumnsCount():-1},this.countEmptyRows=function(e){for(var t,o=m.countRows()-1,n=0;o>=0;){if(t=Handsontable.hooks.run(this,"modifyRow",o),m.isEmptyRow(t))n++;else if(e)break;o--}return n},this.countEmptyCols=function(e){ +if(m.countRows()<1)return 0;for(var t=m.countCols()-1,o=0;t>=0;){if(m.isEmptyCol(t))o++;else if(e)break;t--}return o},this.isEmptyRow=function(e){return c.settings.isEmptyRow.call(m,e)},this.isEmptyCol=function(e){return c.settings.isEmptyCol.call(m,e)},this.selectCell=function(e,t,o,n,i,r){var s;if(r="undefined"==typeof r||r===!0,"number"!=typeof e||0>e||e>=m.countRows())return!1;if("number"!=typeof t||0>t||t>=m.countCols())return!1;if("undefined"!=typeof o){if("number"!=typeof o||0>o||o>=m.countRows())return!1;if("number"!=typeof n||0>n||n>=m.countCols())return!1}return s=new q(e,t),c.selRange=new Q(s,s,s),r&&m.listen(),"undefined"==typeof o?g.setRangeEnd(c.selRange.from,i):g.setRangeEnd(new q(o,n),i),m.selection.finish(),!0},this.selectCellByProp=function(e,t,o,n,i){return arguments[1]=h.propToCol(arguments[1]),"undefined"!=typeof arguments[3]&&(arguments[3]=h.propToCol(arguments[3])),m.selectCell.apply(m,arguments)},this.deselectCell=function(){g.deselect()},this.destroy=function(){m._clearTimeouts(),m.view&&m.view.destroy(),d&&d.destroy(),d=null,T(m.rootElement),v.destroy(),Handsontable.hooks.run(m,"afterDestroy"),Handsontable.hooks.destroy(m);for(var e in m)m.hasOwnProperty(e)&&("function"==typeof m[e]?m[e]=u:"guid"!==e&&(m[e]=null));h&&h.destroy(),h=null,c=null,f=null,g=null,p=null,m=null,w=null},this.getActiveEditor=function(){return p.getActiveEditor()},this.getPlugin=function(e){return B(this,e)},this.getInstance=function(){return m},this.addHook=function(e,t){Handsontable.hooks.add(e,t,m)},this.hasHook=function(e){return Handsontable.hooks.has(e,m)},this.addHookOnce=function(e,t){Handsontable.hooks.once(e,t,m)},this.removeHook=function(e,t){Handsontable.hooks.remove(e,t,m)},this.runHooks=function(e,t,o,n,i,r,s){return Handsontable.hooks.run(m,e,t,o,n,i,r,s)},this.timeouts=[],this._registerTimeout=function(e){this.timeouts.push(e)},this._clearTimeouts=function(){for(var e=0,t=this.timeouts.length;t>e;e++)clearTimeout(this.timeouts[e])},this.version=Handsontable.version,Handsontable.hooks.run(m,"construct")};var Z=function(){};Z.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:!1,customBorders:!1,minRows:0,minCols:0,maxRows:1/0,maxCols:1/0,minSpareRows:0,minSpareCols:0,allowInsertRow:!0,allowInsertColumn:!0,allowRemoveRow:!0,allowRemoveColumn:!0,multiSelect:!0,fillHandle:!0,fixedRowsTop:0,fixedRowsBottom:0,fixedColumnsLeft:0,outsideClickDeselects:!0,enterBeginsEditing:!0,enterMoves:{row:1,col:0},tabMoves:{row:0,col:1},autoWrapRow:!1,autoWrapCol:!1,copyRowsLimit:1e3,copyColsLimit:1e3,pasteMode:"overwrite",persistentState:void 0,currentRowClassName:void 0,currentColClassName:void 0,className:void 0,tableClassName:void 0,stretchH:"none",isEmptyRow:function(e){var t,o,n,i;for(t=0,o=this.countCols();o>t;t++)if(n=this.getDataAtCell(e,t),""!==n&&null!==n&&"undefined"!=typeof n)return"object"==typeof n?(i=this.getCellMeta(e,t),N(this.getSchema()[i.prop],n)):!1;return!0},isEmptyCol:function(e){var t,o,n;for(t=0,o=this.countRows();o>t;t++)if(n=this.getDataAtCell(t,e),""!==n&&null!==n&&"undefined"!=typeof n)return!1;return!0},observeDOMVisibility:!0,allowInvalid:!0,allowEmpty:!0,invalidCellClassName:"htInvalid",placeholder:!1,placeholderCellClassName:"htPlaceholder",readOnlyCellClassName:"htDimmed",renderer:void 0,commentedCellClassName:"htCommentCell",fragmentSelection:!1,readOnly:!1,skipColumnOnPaste:!1,search:!1,type:"text",copyable:!0,editor:void 0,autoComplete:void 0,visibleRows:10,trimDropdown:!0,debug:!1,wordWrap:!0,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:!1,viewportRowRenderingOffset:"auto",viewportColumnRenderingOffset:"auto",validator:void 0,disableVisualSelection:!1,sortIndicator:void 0,manualColumnFreeze:void 0,trimWhitespace:!0,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:!1,defaultDate:void 0,strict:void 0,renderAllRows:void 0,preventOverflow:!1,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,observeChanges:void 0,sortFunction:void 0},Handsontable.DefaultSettings=Z},{"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":50,"helpers/object":51,"helpers/setting":52,"helpers/string":53,numeral:"numeral",plugins:58,renderers:91,tableView:100}],26:[function(e,t,o){"use strict";function n(e,t,o){var n=this;this.instance=e,this.priv=t,this.GridSettings=o,this.dataSource=this.instance.getSettings().data,this.cachedLength=null,this.latestSourceRowsCount=0,this.dataSource[0]?this.duckSchema=this.recursiveDuckSchema(this.dataSource[0]):this.duckSchema={},this.createMap(),this.interval=y.create(function(){return n.clearLengthCache()},"15fps")}Object.defineProperties(o,{DataMap:{get:function(){return n}},__esModule:{value:!0}});var i,r,s,l,a,u,c,h,d=(i=e("SheetClip"),i&&i.__esModule&&i||{"default":i})["default"],f=(r=e("helpers/data"),r&&r.__esModule&&r||{"default":r}).cellMethodLookupFactory,g=(s=e("helpers/setting"),s&&s.__esModule&&s||{"default":s}).columnFactory,p=(l=e("helpers/object"),l&&l.__esModule&&l||{"default":l}),m=p.duckSchema,w=p.deepExtend,v=(a=e("helpers/array"),a&&a.__esModule&&a||{"default":a}),b=v.extendArray,C=v.to2dArray,y=(u=e("utils/interval"),u&&u.__esModule&&u||{"default":u}).Interval,R=(c=e("helpers/number"),c&&c.__esModule&&c||{"default":c}).rangeEach,E=(h=e("multiMap"),h&&h.__esModule&&h||{"default":h}).MultiMap;n.prototype.DESTINATION_RENDERER=1,n.prototype.DESTINATION_CLIPBOARD_GENERATOR=2,n.prototype.recursiveDuckSchema=function(e){return m(e)},n.prototype.recursiveDuckColumns=function(e,t,o){var n,i;if("undefined"==typeof t&&(t=0,o=""),"object"==typeof e&&!Array.isArray(e))for(i in e)e.hasOwnProperty(i)&&(null===e[i]?(n=o+i,this.colToPropCache.push(n),this.propToColCache.set(n,t),t++):t=this.recursiveDuckColumns(e[i],t,i+"."));return t},n.prototype.createMap=function(){var e,t,o=this.getSchema();if("undefined"==typeof o)throw new Error("trying to create `columns` definition but you didnt' provide `schema` nor `data`");this.colToPropCache=[],this.propToColCache=new E;var n=this.instance.getSettings().columns;if(n)for(e=0,t=n.length;t>e;e++)"undefined"!=typeof n[e].data&&(this.colToPropCache[e]=n[e].data,this.propToColCache.set(n[e].data,e));else this.recursiveDuckColumns(o)},n.prototype.colToProp=function(e){return e=Handsontable.hooks.run(this.instance,"modifyCol",e),this.colToPropCache&&"undefined"!=typeof this.colToPropCache[e]?this.colToPropCache[e]:e},n.prototype.propToCol=function(e){var t;return t="undefined"==typeof this.propToColCache.get(e)?e:this.propToColCache.get(e),t=Handsontable.hooks.run(this.instance,"unmodifyCol",t)},n.prototype.getSchema=function(){var e=this.instance.getSettings().dataSchema;return e?"function"==typeof e?e():e:this.duckSchema},n.prototype.createRow=function(e,t,o){var n,i,r=this.instance.countCols(),s=0;t||(t=1),("number"!=typeof e||e>=this.instance.countSourceRows())&&(e=this.instance.countSourceRows()),i=e;for(var l=this.instance.getSettings().maxRows;t>s&&this.instance.countSourceRows()a;a++)n.push(null)}else"function"===this.instance.dataType?n=this.instance.getSettings().dataSchema(e):(n={},w(n,this.getSchema()));e===this.instance.countSourceRows()?this.dataSource.push(n):this.dataSource.splice(e,0,n),s++,i++}return Handsontable.hooks.run(this.instance,"afterCreateRow",e,s,o),this.instance.forceFullRender=!0,s},n.prototype.createCol=function(e,t,o){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 n,i,r=this.instance.countSourceRows(),s=this.dataSource,l=0;t||(t=1),i=e;for(var a=this.instance.getSettings().maxCols;t>l&&this.instance.countCols()=this.instance.countCols()){for(var u=0;r>u;u++)"undefined"==typeof s[u]&&(s[u]=[]),s[u].push(null);this.priv.columnSettings.push(n)}else{for(var u=0;r>u;u++)s[u].splice(i,0,null);this.priv.columnSettings.splice(i,0,n)}l++,i++}return Handsontable.hooks.run(this.instance,"afterCreateCol",e,l,o),this.instance.forceFullRender=!0,l},n.prototype.removeRow=function(e,t){t||(t=1),"number"!=typeof e&&(e=-t),e=(this.instance.countSourceRows()+e)%this.instance.countSourceRows();var o=this.physicalRowsToLogical(e,t),n=(o.slice(0).sort(function(e,t){return t-e}),Handsontable.hooks.run(this.instance,"beforeRemoveRow",e,t,o));if(n!==!1){var i,r=this.dataSource;i=r.filter(function(e,t){return-1==o.indexOf(t)}),r.length=0,Array.prototype.push.apply(r,i),Handsontable.hooks.run(this.instance,"afterRemoveRow",e,t,o),this.instance.forceFullRender=!0}},n.prototype.removeCol=function(e,t){if("object"===this.instance.dataType||this.instance.getSettings().columns)throw new Error("cannot remove column with object data source or columns option specified");t||(t=1),"number"!=typeof e&&(e=-t),e=(this.instance.countCols()+e)%this.instance.countCols();var o=this.physicalColumnsToLogical(e,t),n=o.slice(0).sort(function(e,t){return t-e}),i=Handsontable.hooks.run(this.instance,"beforeRemoveCol",e,t,o);if(i!==!1){for(var r=!0,s=n.length,l=this.dataSource,a=0;s>a;a++)r&&o[0]!==o[a]-a&&(r=!1);if(r)for(var u=0,c=this.instance.countSourceRows();c>u;u++)l[u].splice(o[0],t);else{for(var h=0,d=this.instance.countSourceRows();d>h;h++)for(var f=0;s>f;f++)l[h].splice(n[f],1);for(var g=0;s>g;g++)this.priv.columnSettings.splice(o[g],1)}Handsontable.hooks.run(this.instance,"afterRemoveCol",e,t),this.instance.forceFullRender=!0}},n.prototype.spliceCol=function(e,t,o){var n=4<=arguments.length?[].slice.call(arguments,3):[],i=this.instance.getDataAtCol(e),r=i.slice(t,t+o),s=i.slice(t+o);b(n,s);for(var l=0;o>l;)n.push(null),l++;return C(n),this.instance.populateFromArray(t,e,n,null,null,"spliceCol"),r},n.prototype.spliceRow=function(e,t,o){var n=4<=arguments.length?[].slice.call(arguments,3):[],i=this.instance.getSourceDataAtRow(e),r=i.slice(t,t+o),s=i.slice(t+o);b(n,s);for(var l=0;o>l;)n.push(null),l++;return this.instance.populateFromArray(e,t,[n],null,null,"spliceRow"),r},n.prototype.get=function(e,t){e=Handsontable.hooks.run(this.instance,"modifyRow",e);var o=this.dataSource[e];if(o&&o.hasOwnProperty&&o.hasOwnProperty(t))return o[t];if("string"==typeof t&&t.indexOf(".")>-1){var n=t.split("."),i=o;if(!i)return null;for(var r=0,s=n.length;s>r;r++)if(i=i[n[r]],"undefined"==typeof i)return null;return i}return"function"==typeof t?t(this.dataSource.slice(e,e+1)[0]):null};var S=f("copyable",!1);n.prototype.getCopyable=function(e,t){return S.call(this.instance,e,this.propToCol(t))?this.get(e,t):""},n.prototype.set=function(e,t,o,n){e=Handsontable.hooks.run(this.instance,"modifyRow",e,n||"datamapGet");var i=this.dataSource[e];if(i&&i.hasOwnProperty&&i.hasOwnProperty(t))i[t]=o;else if("string"==typeof t&&t.indexOf(".")>-1){for(var r=t.split("."),s=i,l=0,a=r.length-1;a>l;l++)"undefined"==typeof s[r[l]]&&(s[r[l]]={}),s=s[r[l]];s[r[l]]=o}else"function"==typeof t?t(this.dataSource.slice(e,e+1)[0],o):i[t]=o},n.prototype.physicalRowsToLogical=function(e,t){for(var o,n=this.instance.countSourceRows(),i=(n+e)%n,r=[],s=t;n>i&&s;)o=Handsontable.hooks.run(this.instance,"modifyRow",i),r.push(o),s--,i++;return r},n.prototype.physicalColumnsToLogical=function(e,t){for(var o=this.instance.countCols(),n=(o+e)%o,i=[],r=t;o>n&&r;){var s=Handsontable.hooks.run(this.instance,"modifyCol",n);i.push(s),r--,n++}return i},n.prototype.clear=function(){for(var e=0;e=n;n++){l=[];var c=Handsontable.hooks.run(this.instance,"modifyRow",n);for(r=Math.min(e.col,t.col);s>=r;r++){if(null===c)break;l.push(u.call(this,n,this.colToProp(r)))}null!==c&&a.push(l)}return a},n.prototype.getText=function(e,t){return d.stringify(this.getRange(e,t,this.DESTINATION_RENDERER))},n.prototype.getCopyableText=function(e,t){return d.stringify(this.getRange(e,t,this.DESTINATION_CLIPBOARD_GENERATOR))},n.prototype.destroy=function(){this.interval.stop(),this.interval=null,this.instance=null,this.priv=null,this.GridSettings=null,this.dataSource=null,this.cachedLength=null,this.duckSchema=null},Handsontable.DataMap=n},{SheetClip:"SheetClip","helpers/array":42,"helpers/data":44,"helpers/number":50,"helpers/object":51,"helpers/setting":52,multiMap:56,"utils/interval":102}],27:[function(e,t,o){"use strict";Object.defineProperties(o,{DataSource:{get:function(){return f}},__esModule:{value:!0}});var n,i,r,s,l,a=((n=e("helpers/data"),n&&n.__esModule&&n||{"default":n}).cellMethodLookupFactory,(i=e("helpers/setting"),i&&i.__esModule&&i||{"default":i}).columnFactory,r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}),u=(a.duckSchema,a.deepExtend,a.getProperty),c=(s=e("helpers/array"),s&&s.__esModule&&s||{"default":s}),h=(c.extendArray,c.arrayEach),d=(l=e("helpers/number"),l&&l.__esModule&&l||{"default":l}).rangeEach,f=function(e){var t=void 0!==arguments[1]?arguments[1]:[];this.hot=e,this.data=t,this.dataType="array",this.colToProp=function(){},this.propToCol=function(){}};$traceurRuntime.createClass(f,{getData:function(){return this.data},setData:function(e){this.data=e},getAtColumn:function(e){var t=this,o=[];return h(this.data,function(n){var i=t.colToProp(e);n="string"==typeof i?u(n,i):n[i],o.push(n)}),o},getAtRow:function(e){return this.data[e]},getAtCell:function(e,t){return this.data[e][this.colToProp(t)]},getByRange:function(e,t){var o=this,n=Math.min(e.row,t.row),i=Math.min(e.col,t.col),r=Math.max(e.row,t.row),s=Math.max(e.col,t.col),l=[];return d(n,r,function(e){var t,n=o.getAtRow(e);"array"===o.dataType?t=n.slice(i,s):"object"===o.dataType&&(t={},d(i,s,function(e){var i=o.colToProp(e);t[i]=n[i]})),l.push(t)}),l},destroy:function(){this.data=null,this.hot=null}},{})},{"helpers/array":42,"helpers/data":44,"helpers/number":50,"helpers/object":51,"helpers/setting":52}],28:[function(e,t,o){"use strict";function n(e,t,o){function n(e){var n="function"==typeof t.settings.enterMoves?t.settings.enterMoves(event):t.settings.enterMoves;e?o.transformStart(-n.row,-n.col):o.transformStart(n.row,n.col,!0)}function i(e){e?o.transformEnd(-1,0):o.transformStart(-1,0)}function r(e){e?o.transformEnd(1,0):o.transformStart(1,0)}function s(e){e?o.transformEnd(0,1):o.transformStart(0,1)}function l(e){e?o.transformEnd(0,-1):o.transformStart(0,-1)}function a(a){var c,g;if(e.isListening()&&(Handsontable.hooks.run(e,"beforeKeyDown",a),!y&&!w(a)&&(t.lastKeyCode=a.keyCode,o.isSelected()))){if(c=(a.ctrlKey||a.metaKey)&&!a.altKey,b&&!b.isWaiting()&&!(d(a.keyCode)||f(a.keyCode)||c||C.isEditorOpened()))return void C.openEditor("",a);switch(g=a.shiftKey?o.setRangeEnd:o.setRangeStart,a.keyCode){case h.A:!C.isEditorOpened()&&c&&(o.selectAll(),a.preventDefault(),p(a));break;case h.ARROW_UP:C.isEditorOpened()&&!b.isWaiting()&&C.closeEditorAndSaveChanges(c),i(a.shiftKey),a.preventDefault(),p(a);break;case h.ARROW_DOWN:C.isEditorOpened()&&!b.isWaiting()&&C.closeEditorAndSaveChanges(c),r(a.shiftKey),a.preventDefault(),p(a);break;case h.ARROW_RIGHT:C.isEditorOpened()&&!b.isWaiting()&&C.closeEditorAndSaveChanges(c),s(a.shiftKey),a.preventDefault(),p(a);break;case h.ARROW_LEFT:C.isEditorOpened()&&!b.isWaiting()&&C.closeEditorAndSaveChanges(c),l(a.shiftKey),a.preventDefault(),p(a);break;case h.TAB:var v="function"==typeof t.settings.tabMoves?t.settings.tabMoves(a):t.settings.tabMoves;a.shiftKey?o.transformStart(-v.row,-v.col):o.transformStart(v.row,v.col,!0),a.preventDefault(),p(a);break;case h.BACKSPACE:case h.DELETE:o.empty(a),C.prepareEditor(),a.preventDefault();break;case h.F2:C.openEditor(null,a),b&&b.enableFullEditMode(),a.preventDefault();break;case h.ENTER:C.isEditorOpened()?(b&&b.state!==Handsontable.EditorState.WAITING&&C.closeEditorAndSaveChanges(c),n(a.shiftKey)):e.getSettings().enterBeginsEditing?(C.openEditor(null,a),b&&b.enableFullEditMode()):n(a.shiftKey),a.preventDefault(),m(a);break;case h.ESCAPE:C.isEditorOpened()&&C.closeEditorAndRestoreOriginalValue(c),a.preventDefault();break;case h.HOME:g(a.ctrlKey||a.metaKey?new u(0,t.selRange.from.col):new u(t.selRange.from.row,0)),a.preventDefault(),p(a);break;case h.END:g(a.ctrlKey||a.metaKey?new u(e.countRows()-1,t.selRange.from.col):new u(t.selRange.from.row,e.countCols()-1)),a.preventDefault(),p(a);break;case h.PAGE_UP:o.transformStart(-e.countVisibleRows(),0),a.preventDefault(),p(a);break;case h.PAGE_DOWN:o.transformStart(e.countVisibleRows(),0),a.preventDefault(),p(a)}}}function c(){function t(e,t,o){"TD"==o.nodeName&&(C.openEditor(),b&&b.enableFullEditMode())}e.addHook("afterDocumentKeyDown",a),g.addEventListener(document.documentElement,"keydown",function(t){e.runHooks("afterDocumentKeyDown",t)}),e.view.wt.update("onCellDblClick",t),e.addHook("afterDestroy",function(){y=!0})}var g,b,C=this,y=!1;g=v(e),this.destroyEditor=function(e){this.closeEditor(e)},this.getActiveEditor=function(){return b},this.prepareEditor=function(){var o,n,i,r,s,l,a;return b&&b.isWaiting()?void this.closeEditor(!1,!1,function(e){e&&C.prepareEditor()}):(o=t.selRange.highlight.row,n=t.selRange.highlight.col,i=e.colToProp(n),r=e.getCell(o,n),s=e.getDataAtCell(o,n),l=e.getCellMeta(o,n),a=e.getCellEditor(l),void(a?(b=Handsontable.editors.getEditor(a,e),b.prepare(o,n,i,r,s,l)):b=void 0))},this.isEditorOpened=function(){return b&&b.isOpened()},this.openEditor=function(e,t){b&&!b.cellProperties.readOnly?b.beginEditing(e,t):b&&b.cellProperties.readOnly&&t&&t.keyCode===h.ENTER&&n()},this.closeEditor=function(e,t,o){b?b.finishEditing(e,t,o):o&&o(!1)},this.closeEditorAndSaveChanges=function(e){return this.closeEditor(!1,e)},this.closeEditorAndRestoreOriginalValue=function(e){return this.closeEditor(!0,e)},c()}Object.defineProperties(o,{EditorManager:{get:function(){return n}},__esModule:{value:!0}});var i,r,s,l,a,u=(i=e("3rdparty/walkontable/src/cell/coords"),i&&i.__esModule&&i||{"default":i}).WalkontableCellCoords,c=(r=e("helpers/unicode"),r&&r.__esModule&&r||{"default":r}),h=c.KEY_CODES,d=c.isMetaKey,f=c.isCtrlKey,g=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),p=g.stopPropagation,m=g.stopImmediatePropagation,w=g.isImmediatePropagationStopped,v=((l=e("editors"),l&&l.__esModule&&l||{"default":l}).getEditor,(a=e("eventManager"),a&&a.__esModule&&a||{"default":a}).eventManager);Handsontable.EditorManager=n},{"3rdparty/walkontable/src/cell/coords":5,editors:29,eventManager:41,"helpers/dom/event":46,"helpers/unicode":54}],29:[function(e,t,o){"use strict";function n(e){var t,o;o={},t=e,this.getConstructor=function(){return e},this.getInstance=function(e){return e.guid in o||(o[e.guid]=new t(e)),o[e.guid]}}function i(e,t){var o=new n(t);"string"==typeof e&&(c[e]=o,Handsontable.editors[u(e)+"Editor"]=t),h.set(t,o)}function r(e,t){var o;if("function"==typeof e)h.get(e)||i(null,e),o=h.get(e);else{if("string"!=typeof e)throw Error('Only strings and functions can be passed as "editor" parameter ');o=c[e]}if(!o)throw Error('No editor registered under name "'+e+'"');return o.getInstance(t)}function s(e){var t;if("string"!=typeof e)throw Error('Only strings and functions can be passed as "editor" parameter ');if(t=c[e],!t)throw Error('No editor registered under name "'+e+'"');return t.getConstructor()}function l(e){return!!c[e]}Object.defineProperties(o,{registerEditor:{get:function(){return i}},getEditor:{get:function(){return r}},hasEditor:{get:function(){return l}},getEditorConstructor:{get:function(){return s}},__esModule:{value:!0}});var a,u=(a=e("helpers/string"),a&&a.__esModule&&a||{"default":a}).toUpperCaseFirst,c={},h=new WeakMap;Handsontable.editors=Handsontable.editors||{},Handsontable.editors.registerEditor=i,Handsontable.editors.getEditor=r},{"helpers/string":53}],30:[function(e,t,o){"use strict";function n(e){this.instance=e,this.state=Handsontable.EditorState.VIRGIN,this._opened=!1,this._fullEditMode=!1,this._closeCallback=null,this.init()}Object.defineProperties(o,{BaseEditor:{get:function(){return n}},__esModule:{value:!0}});var i,r,s=(i=e("helpers/mixed"),i&&i.__esModule&&i||{"default":i}).stringify,l=(r=e("3rdparty/walkontable/src/cell/coords"),r&&r.__esModule&&r||{"default":r}).WalkontableCellCoords;Handsontable.editors=Handsontable.editors||{},Handsontable.editors.BaseEditor=n,Handsontable.EditorState={VIRGIN:"STATE_VIRGIN",EDITING:"STATE_EDITING",WAITING:"STATE_WAITING",FINISHED:"STATE_FINISHED"},n.prototype._fireCallbacks=function(e){this._closeCallback&&(this._closeCallback(e),this._closeCallback=null)},n.prototype.init=function(){},n.prototype.getValue=function(){throw Error("Editor getValue() method unimplemented")},n.prototype.setValue=function(e){throw Error("Editor setValue() method unimplemented")},n.prototype.open=function(){throw Error("Editor open() method unimplemented")},n.prototype.close=function(){throw Error("Editor close() method unimplemented")},n.prototype.prepare=function(e,t,o,n,i,r){this.TD=n,this.row=e,this.col=t,this.prop=o,this.originalValue=i,this.cellProperties=r,this.instance.view.isMouseDown()&&document.activeElement&&document.activeElement!==document.body?document.activeElement.blur():document.activeElement||document.body.focus(),this.state=Handsontable.EditorState.VIRGIN},n.prototype.extend=function(){function e(){o.apply(this,arguments)}function t(e,t){function o(){}return o.prototype=t.prototype,e.prototype=new o,e.prototype.constructor=e,e}var o=this.constructor;return t(e,o)},n.prototype.saveValue=function(e,t){var o,n;t?(o=this.instance.getSelected(),o[0]>o[2]&&(n=o[0],o[0]=o[2],o[2]=n),o[1]>o[3]&&(n=o[1],o[1]=o[3],o[3]=n),this.instance.populateFromArray(o[0],o[1],e,o[2],o[3],"edit")):this.instance.populateFromArray(this.row,this.col,e,null,null,"edit")},n.prototype.beginEditing=function(e,t){this.state==Handsontable.EditorState.VIRGIN&&(this.instance.view.scrollViewport(new l(this.row,this.col)),this.instance.view.render(),this.state=Handsontable.EditorState.EDITING,e="string"==typeof e?e:this.originalValue,this.setValue(s(e)),this.open(t),this._opened=!0,this.focus(),this.instance.view.render())},n.prototype.finishEditing=function(e,t,o){var n,i=this;if(o){var r=this._closeCallback;this._closeCallback=function(e){r&&r(e),o(e)}}if(!this.isWaiting()){if(this.state==Handsontable.EditorState.VIRGIN)return void this.instance._registerTimeout(setTimeout(function(){i._fireCallbacks(!0)},0));if(this.state==Handsontable.EditorState.EDITING){if(e)return this.cancelChanges(),void this.instance.view.render();var s=this.getValue();n=this.instance.getSettings().trimWhitespace?[["string"==typeof s?String.prototype.trim.call(s||""):s]]:[[s]],this.state=Handsontable.EditorState.WAITING,this.saveValue(n,t),this.instance.getCellValidator(this.cellProperties)?this.instance.addHookOnce("postAfterValidate",function(e){i.state=Handsontable.EditorState.FINISHED,i.discardEditor(e)}):(this.state=Handsontable.EditorState.FINISHED,this.discardEditor(!0))}}},n.prototype.cancelChanges=function(){this.state=Handsontable.EditorState.FINISHED,this.discardEditor()},n.prototype.discardEditor=function(e){this.state===Handsontable.EditorState.FINISHED&&(e===!1&&this.cellProperties.allowInvalid!==!0?(this.instance.selectCell(this.row,this.col),this.focus(),this.state=Handsontable.EditorState.EDITING,this._fireCallbacks(!1)):(this.close(),this._opened=!1,this._fullEditMode=!1,this.state=Handsontable.EditorState.VIRGIN,this._fireCallbacks(!0)))},n.prototype.enableFullEditMode=function(){this._fullEditMode=!0},n.prototype.isInFullEditMode=function(){return this._fullEditMode},n.prototype.isOpened=function(){return this._opened},n.prototype.isWaiting=function(){return this.state===Handsontable.EditorState.WAITING},n.prototype.checkEditorSection=function(){var e=this.instance.countRows(),t="";return this.row=e-this.instance.getSettings().fixedRowsBottom?t=this.col"+l+"")))},autoColumnSize:!0,modifyColWidth:function(e,t){var n=this.getPlugin("autoColumnSize").widths;return n[t]&&(e=n[t]),o?e:e+15}}),this.htEditor.view.wt.wtTable.holder.parentNode.style["padding-right"]=v()+2+"px",O&&(O=!1),t.instance._registerTimeout(setTimeout(function(){t.queryChoices(t.TEXTAREA.value)},0))},T.prototype.close=function(){S.prototype.close.apply(this,arguments)},T.prototype.queryChoices=function(e){if(this.query=e,"function"==typeof this.cellProperties.source){var t=this;this.cellProperties.source(e,function(e){t.updateChoicesList(e)})}else if(Array.isArray(this.cellProperties.source)){var o;if(e&&this.cellProperties.filter!==!1){var n=this.cellProperties.filteringCaseSensitive===!0,i=e.toLowerCase();o=this.cellProperties.source.filter(function(t){return n?-1!=t.indexOf(e):-1!=t.toLowerCase().indexOf(i)})}else o=this.cellProperties.source;this.updateChoicesList(o)}else this.updateChoicesList([])},T.prototype.updateChoicesList=function(e){var t,o=w(this.TEXTAREA),n=b(this.TEXTAREA),i=T.sortByRelevance(this.getValue(),e,this.cellProperties.filteringCaseSensitive);if(0==this.cellProperties.filter)t=i[0];else{for(var r=[],s=0,l=i.length;l>s;s++)r.push(e[i[s]]);t=0,e=r}this.choices=e,this.htEditor.loadData(g([e])),this.updateDropdownHeight(),this.cellProperties.strict===!0&&this.highlightBestMatchingChoice(t),this.instance.listen(),this.TEXTAREA.focus(),y(this.TEXTAREA,o,o==n?void 0:n)},T.prototype.updateDropdownHeight=function(){var e=this.htEditor.getColWidth(0)+v()+2,t=void 0===this.cellProperties.trimDropdown?!0:this.cellProperties.trimDropdown;this.htEditor.updateSettings({height:this.getDropdownHeight(),width:t?void 0:e}),this.htEditor.view.wt.wtTable.alignOverlaysWithTrimmingContainer()},T.prototype.finishEditing=function(e){e||this.instance.removeHook("beforeKeyDown",n),S.prototype.finishEditing.apply(this,arguments)},T.prototype.highlightBestMatchingChoice=function(e){"number"==typeof e?this.htEditor.selectCell(e,0):this.htEditor.deselectCell()},T.sortByRelevance=function(e,t,o){var n,i,r,s,l,a=[],u=e.length,c=[];if(0===u){for(s=0,l=t.length;l>s;s++)c.push(s);return c}for(s=0,l=t.length;l>s;s++)n=f(t[s]),i=o?n.indexOf(e):n.toLowerCase().indexOf(e.toLowerCase()),-1!=i&&(r=n.length-i-u,a.push({baseIndex:s,index:i,charsLeft:r,value:n}));for(a.sort(function(e,t){return-1===t.index?-1:-1===e.index?1:e.indext.charsLeft?1:0:void 0}),s=0,l=a.length;l>s;s++)c.push(a[s].baseIndex);return c},T.prototype.getDropdownHeight=function(){var e=this.htEditor.getInstance().getRowHeight(0)||23,t=this.cellProperties.visibleRows;return this.choices.length>=t?t*e:this.choices.length*e+8},T.prototype.allowKeyEventPropagation=function(e){var t={row:this.htEditor.getSelectedRange()?this.htEditor.getSelectedRange().from.row:-1},o=!1;return e===h.ARROW_DOWN&&t.row-1&&(o=!0),o},E("autocomplete",T)},{editors:29,handsontableEditor:35,"helpers/array":42,"helpers/dom/element":45,"helpers/mixed":49,"helpers/unicode":54}],32:[function(e,t,o){"use strict";Object.defineProperties(o,{CheckboxEditor:{get:function(){return u}},__esModule:{value:!0}});var n,i,r,s=(n=e("editors"),n&&n.__esModule&&n||{"default":n}).registerEditor,l=(i=e("_baseEditor"),i&&i.__esModule&&i||{"default":i}).BaseEditor,a=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}).hasClass,u=function(){$traceurRuntime.superConstructor(c).apply(this,arguments)},c=u;$traceurRuntime.createClass(u,{beginEditing:function(){var e=this.TD.querySelector('input[type="checkbox"]'); +a(e,"htBadValue")||e.click()},finishEditing:function(){},init:function(){},open:function(){},close:function(){},getValue:function(){},setValue:function(){},focus:function(){}},{},l),s("checkbox",u)},{_baseEditor:30,editors:29,"helpers/dom/element":45}],33:[function(e,t,o){"use strict";Object.defineProperties(o,{DateEditor:{get:function(){return S}},__esModule:{value:!0}});var n,i,r,s,l,a,u,c,h,d=(n=e("helpers/dom/element"),n&&n.__esModule&&n||{"default":n}),f=d.addClass,g=d.outerHeight,p=(i=e("helpers/object"),i&&i.__esModule&&i||{"default":i}).deepExtend,m=(r=e("eventManager"),r&&r.__esModule&&r||{"default":r}).EventManager,w=(s=e("editors"),s&&s.__esModule&&s||{"default":s}),v=(w.getEditor,w.registerEditor),b=(l=e("helpers/unicode"),l&&l.__esModule&&l||{"default":l}).isMetaKey,C=(a=e("helpers/dom/event"),a&&a.__esModule&&a||{"default":a}).stopPropagation,y=(u=e("textEditor"),u&&u.__esModule&&u||{"default":u}).TextEditor,R=(c=e("moment"),c&&c.__esModule&&c||{"default":c})["default"],E=(h=e("pikaday"),h&&h.__esModule&&h||{"default":h})["default"];Handsontable.editors=Handsontable.editors||{},Handsontable.editors.DateEditor=S;var S=function(e){this.$datePicker=null,this.datePicker=null,this.datePickerStyle=null,this.defaultDateFormat="DD/MM/YYYY",this.isCellEdited=!1,this.parentDestroyed=!1,$traceurRuntime.superConstructor(T).call(this,e)},T=S;$traceurRuntime.createClass(S,{init:function(){var e=this;if("function"!=typeof R)throw new Error("You need to include moment.js to your project.");if("function"!=typeof E)throw new Error("You need to include Pikaday to your project.");$traceurRuntime.superGet(this,T.prototype,"init").call(this),this.instance.addHook("afterDestroy",function(){e.parentDestroyed=!0,e.destroyElements()})},createElements:function(){$traceurRuntime.superGet(this,T.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,f(this.datePicker,"htDatepickerHolder"),document.body.appendChild(this.datePicker),this.$datePicker=new E(this.getDatePickerConfig());var e=new m(this);e.addEventListener(this.datePicker,"mousedown",function(e){return C(e)}),this.hideDatepicker()},destroyElements:function(){this.$datePicker.destroy()},prepare:function(e,t,o,n,i,r){this._opened=!1,$traceurRuntime.superGet(this,T.prototype,"prepare").call(this,e,t,o,n,i,r)},open:function(){var e=void 0!==arguments[0]?arguments[0]:null;$traceurRuntime.superGet(this,T.prototype,"open").call(this),this.showDatepicker(e)},close:function(){var e=this;this._opened=!1,this.instance._registerTimeout(setTimeout(function(){e.instance.selection.refreshBorders()},0)),$traceurRuntime.superGet(this,T.prototype,"close").call(this)},finishEditing:function(){var e=void 0!==arguments[0]?arguments[0]:!1,t=void 0!==arguments[1]?arguments[1]:!1;if(e){var o=this.originalValue;void 0!==o&&this.setValue(o)}this.hideDatepicker(),$traceurRuntime.superGet(this,T.prototype,"finishEditing").call(this,e,t)},showDatepicker:function(e){this.$datePicker.config(this.getDatePickerConfig());var t,o=this.TD.getBoundingClientRect(),n=this.cellProperties.dateFormat||this.defaultDateFormat,i=this.$datePicker.config(),r=this.instance.view.isMouseDown(),s=e?b(e.keyCode):!1;this.datePickerStyle.top=window.pageYOffset+o.top+g(this.TD)+"px",this.datePickerStyle.left=window.pageXOffset+o.left+"px",this.$datePicker._onInputFocus=function(){},i.format=n,this.originalValue?(t=this.originalValue,R(t,n,!0).isValid()&&this.$datePicker.setMoment(R(t,n),!0),s||r||this.setValue("")):this.cellProperties.defaultDate?(t=this.cellProperties.defaultDate,i.defaultDate=t,R(t,n,!0).isValid()&&this.$datePicker.setMoment(R(t,n),!0),s||r||this.setValue("")):this.$datePicker.gotoToday(),this.datePickerStyle.display="block",this.$datePicker.show()},hideDatepicker:function(){this.datePickerStyle.display="none",this.$datePicker.hide()},getDatePickerConfig:function(){var e=this,t=this.TEXTAREA,o={};this.cellProperties&&this.cellProperties.datePickerConfig&&p(o,this.cellProperties.datePickerConfig);var n=o.onSelect,i=o.onClose;return o.field=t,o.trigger=t,o.container=this.datePicker,o.bound=!1,o.format=o.format||this.defaultDateFormat,o.reposition=o.reposition||!1,o.onSelect=function(t){isNaN(t.getTime())||(t=R(t).format(e.cellProperties.dateFormat||e.defaultDateFormat)),e.setValue(t),e.hideDatepicker(),n&&n()},o.onClose=function(){e.parentDestroyed||e.finishEditing(!1),i&&i()},o}},{},y),v("date",S)},{editors:29,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/object":51,"helpers/unicode":54,moment:void 0,pikaday:void 0,textEditor:40}],34:[function(e,t,o){"use strict";Object.defineProperties(o,{DropdownEditor:{get:function(){return a}},__esModule:{value:!0}});var n,i,r=(n=e("editors"),n&&n.__esModule&&n||{"default":n}),s=(r.getEditor,r.registerEditor),l=(i=e("autocompleteEditor"),i&&i.__esModule&&i||{"default":i}).AutocompleteEditor,a=function(){$traceurRuntime.superConstructor(u).apply(this,arguments)},u=a;$traceurRuntime.createClass(a,{prepare:function(e,t,o,n,i,r){$traceurRuntime.superGet(this,u.prototype,"prepare").call(this,e,t,o,n,i,r),this.cellProperties.filter=!1,this.cellProperties.strict=!0}},{},l),Handsontable.hooks.add("beforeValidate",function(e,t,o,n){var i=this.getCellMeta(t,o);i.editor===Handsontable.editors.DropdownEditor&&void 0===i.strict&&(i.filter=!1,i.strict=!0)}),s("dropdown",a)},{autocompleteEditor:31,editors:29}],35:[function(e,t,o){"use strict";Object.defineProperties(o,{HandsontableEditor:{get:function(){return v}},__esModule:{value:!0}});var n,i,r,s,l,a,u=(n=e("helpers/unicode"),n&&n.__esModule&&n||{"default":n}).KEY_CODES,c=(i=e("helpers/object"),i&&i.__esModule&&i||{"default":i}).extend,h=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}).setCaretPosition,d=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),f=d.stopImmediatePropagation,g=d.isImmediatePropagationStopped,p=(l=e("editors"),l&&l.__esModule&&l||{"default":l}),m=(p.getEditor,p.registerEditor),w=(a=e("textEditor"),a&&a.__esModule&&a||{"default":a}).TextEditor,v=w.prototype.extend();v.prototype.createElements=function(){w.prototype.createElements.apply(this,arguments);var e=document.createElement("DIV");e.className="handsontableEditor",this.TEXTAREA_PARENT.appendChild(e),this.htContainer=e,this.assignHooks()},v.prototype.prepare=function(e,t,o,n,i,r){w.prototype.prepare.apply(this,arguments);var s=this,l={startRows:0,startCols:0,minRows:0,minCols:0,className:"listbox",copyPaste:!1,autoColumnSize:!1,autoRowSize:!1,readOnly:!0,fillHandle:!1,afterOnCellMouseDown:function(){var e=this.getValue();void 0!==e&&s.setValue(e),s.instance.destroyEditor()}};this.cellProperties.handsontable&&c(l,r.handsontable),this.htOptions=l};var b=function(e){if(!g(e)){var t,o=this.getActiveEditor(),n=o.htEditor.getInstance();if(e.keyCode==u.ARROW_DOWN)if(n.getSelected()){var i=n.getSelected()[0],r=n.countRows()-1;t=Math.min(r,i+1)}else t=0;else if(e.keyCode==u.ARROW_UP&&n.getSelected()){var i=n.getSelected()[0];t=i-1}void 0!==t&&(0>t?n.deselectCell():n.selectCell(t,0),n.getData().length&&(e.preventDefault(),f(e),o.instance.listen(),o.TEXTAREA.focus()))}};v.prototype.open=function(){this.instance.addHook("beforeKeyDown",b),w.prototype.open.apply(this,arguments),this.htEditor&&this.htEditor.destroy(),this.htEditor=new Handsontable(this.htContainer,this.htOptions),this.cellProperties.strict?(this.htEditor.selectCell(0,0),this.TEXTAREA.style.visibility="hidden"):(this.htEditor.deselectCell(),this.TEXTAREA.style.visibility="visible"),h(this.TEXTAREA,0,this.TEXTAREA.value.length)},v.prototype.close=function(){this.instance.removeHook("beforeKeyDown",b),this.instance.listen(),w.prototype.close.apply(this,arguments)},v.prototype.focus=function(){this.instance.listen(),w.prototype.focus.apply(this,arguments)},v.prototype.beginEditing=function(e){var t=this.instance.getSettings().onBeginEditing;t&&t()===!1||w.prototype.beginEditing.apply(this,arguments)},v.prototype.finishEditing=function(e,t){if(this.htEditor&&this.htEditor.isListening()&&this.instance.listen(),this.htEditor&&this.htEditor.getSelected()){var o=this.htEditor.getInstance().getValue();void 0!==o&&this.setValue(o)}return w.prototype.finishEditing.apply(this,arguments)},v.prototype.assignHooks=function(){var e=this;this.instance.addHook("afterDestroy",function(){e.htEditor&&e.htEditor.destroy()})},m("handsontable",v)},{editors:29,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/object":51,"helpers/unicode":54,textEditor:40}],36:[function(e,t,o){"use strict";Object.defineProperties(o,{MobileTextEditor:{get:function(){return M}},__esModule:{value:!0}});var n,i,r,s,l,a,u=(n=e("helpers/unicode"),n&&n.__esModule&&n||{"default":n}).KEY_CODES,c=(i=e("helpers/dom/event"),i&&i.__esModule&&i||{"default":i}),h=c.stopImmediatePropagation,d=c.isImmediatePropagationStopped,f=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),g=f.addClass,p=f.getScrollLeft,m=f.getScrollTop,w=f.hasClass,v=f.isChildOf,b=f.offset,C=f.outerHeight,y=f.outerWidth,R=f.removeClass,E=f.setCaretPosition,S=(s=e("editors"),s&&s.__esModule&&s||{"default":s}),T=(S.getEditor,S.registerEditor),O=(l=e("_baseEditor"),l&&l.__esModule&&l||{"default":l}).BaseEditor,_=(a=e("eventManager"),a&&a.__esModule&&a||{"default":a}).eventManager,M=O.prototype.extend(),H={},k=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 e in this.controls)this.controls.hasOwnProperty(e)&&this.positionControls.appendChild(this.controls[e])};M.prototype.valueChanged=function(){return this.initValue!=this.getValue()},M.prototype.init=function(){var e=this;this.eventManager=_(this.instance),this.createElements(),this.bindEvents(),this.instance.addHook("afterDestroy",function(){e.destroy()})},M.prototype.getValue=function(){return this.TEXTAREA.value},M.prototype.setValue=function(e){this.initValue=e,this.TEXTAREA.value=e},M.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"),g(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),k.call(this),document.body.appendChild(this.editorContainer)},M.prototype.onBeforeKeyDown=function(e){var t=this,o=t.getActiveEditor();if(e.target===o.TEXTAREA&&!d(e))switch(e.keyCode){case u.ENTER:o.close(),e.preventDefault();break;case u.BACKSPACE:h(e)}},M.prototype.open=function(){this.instance.addHook("beforeKeyDown",this.onBeforeKeyDown),g(this.editorContainer,"active"),R(this.cellPointer,"hidden"),this.updateEditorPosition()},M.prototype.focus=function(){this.TEXTAREA.focus(),E(this.TEXTAREA,this.TEXTAREA.value.length)},M.prototype.close=function(){this.TEXTAREA.blur(),this.instance.removeHook("beforeKeyDown",this.onBeforeKeyDown),R(this.editorContainer,"active")},M.prototype.scrollToView=function(){var e=this.instance.getSelectedRange().highlight;this.instance.view.scrollViewport(e)},M.prototype.hideCellPointer=function(){w(this.cellPointer,"hidden")||g(this.cellPointer,"hidden")},M.prototype.updateEditorPosition=function(e,t){if(e&&t)e=parseInt(e,10),t=parseInt(t,10),this.editorContainer.style.top=t+"px",this.editorContainer.style.left=e+"px";else{var o=this.instance.getSelected(),n=this.instance.getCell(o[0],o[1]);if(H.cellPointer||(H.cellPointer={height:C(this.cellPointer),width:y(this.cellPointer)}),H.editorContainer||(H.editorContainer={width:y(this.editorContainer)}),void 0!==n){var i=this.instance.view.wt.wtOverlays.leftOverlay.trimmingContainer==window?0:p(this.instance.view.wt.wtOverlays.leftOverlay.holder),r=this.instance.view.wt.wtOverlays.topOverlay.trimmingContainer==window?0:m(this.instance.view.wt.wtOverlays.topOverlay.holder),s=b(n),l=y(n),a={x:i,y:r};this.editorContainer.style.top=parseInt(s.top+C(n)-a.y+H.cellPointer.height,10)+"px",this.editorContainer.style.left=parseInt(window.innerWidth/2-H.editorContainer.width/2,10)+"px",s.left+l/2>parseInt(this.editorContainer.style.left,10)+H.editorContainer.width?this.editorContainer.style.left=window.innerWidth-H.editorContainer.width+"px":s.left+l/2o;o++)t[e[o]]=e[o];else"object"==typeof e&&(t=e);return t},S.prototype.getValue=function(){return this.select.value},S.prototype.setValue=function(e){this.select.value=e};var T=function(e){var t=this,o=t.getActiveEditor();switch(e.keyCode){case C.ARROW_UP:var n=o.select.selectedIndex-1;n>=0&&(o.select[n].selected=!0),b(e),e.preventDefault();break;case C.ARROW_DOWN:var i=o.select.selectedIndex+1;i<=o.select.length-1&&(o.select[i].selected=!0),b(e),e.preventDefault()}};S.prototype.open=function(){this._opened=!0,this.refreshDimensions(),this.select.style.display="",this.instance.addHook("beforeKeyDown",T)},S.prototype.close=function(){this._opened=!1,this.select.style.display="none",this.instance.removeHook("beforeKeyDown",T)},S.prototype.focus=function(){this.select.focus()},S.prototype.refreshDimensions=function(){if(this.state===Handsontable.EditorState.EDITING){if(this.TD=this.getEditedCell(),!this.TD)return void this.close();var e,t=w(this.TD)+1,o=m(this.TD)+1,n=p(this.TD),i=p(this.instance.rootElement),r=g(this.TD),s=n.top-i.top-1-(r.scrollTop||0),l=n.left-i.left-1-(r.scrollLeft||0),a=this.checkEditorSection(),u=this.instance.getSettings();u.rowHeaders?1:0,u.colHeaders?1:0;switch(a){case"top":e=f(this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.holder.parentNode);break;case"left":e=f(this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.holder.parentNode);break;case"top-left-corner":e=f(this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.holder.parentNode);break;case"bottom-left-corner":e=f(this.instance.view.wt.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.holder.parentNode);break;case"bottom":e=f(this.instance.view.wt.wtOverlays.bottomOverlay.clone.wtTable.holder.parentNode)}0===this.instance.getSelected()[0]&&(s+=1),0===this.instance.getSelected()[1]&&(l+=1);var c=this.select.style;e&&-1!=e?c[e[0]]=e[1]:v(this.select);var h=d(this.TD);parseInt(h.borderTopWidth,10)>0&&(o-=1),parseInt(h.borderLeftWidth,10)>0&&(t-=1),c.height=o+"px",c.minWidth=t+"px",c.top=s+"px",c.left=l+"px",c.margin="0px"}},S.prototype.getEditedCell=function(){var e,t=this.checkEditorSection();switch(t){case"top":e=this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.select.style.zIndex=101;break;case"corner":e=this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.select.style.zIndex=103;break;case"left":e=this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.select.style.zIndex=102;break;default:e=this.instance.getCell(this.row,this.col),this.select.style.zIndex=""}return-1!=e&&-2!=e?e:void 0},R("select",S)},{_baseEditor:30,editors:29,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/unicode":54}],40:[function(e,t,o){"use strict";Object.defineProperties(o,{TextEditor:{get:function(){return x}},__esModule:{value:!0}});var n,i,r,s,l,a,u,c=(n=e("helpers/dom/element"),n&&n.__esModule&&n||{"default":n}),h=c.addClass,d=c.getCaretPosition,f=c.getComputedStyle,g=c.getCssTransform,p=c.getScrollableElement,m=c.getScrollbarWidth,w=c.innerWidth,v=c.offset,b=c.resetCssTransform,C=c.setCaretPosition,y=c.hasVerticalScrollbar,R=c.hasHorizontalScrollbar,E=(i=e("autoResize"),i&&i.__esModule&&i||{"default":i})["default"],S=(r=e("_baseEditor"),r&&r.__esModule&&r||{"default":r}).BaseEditor,T=(s=e("eventManager"),s&&s.__esModule&&s||{"default":s}).eventManager,O=(l=e("editors"),l&&l.__esModule&&l||{"default":l}),_=(O.getEditor,O.registerEditor),M=(a=e("helpers/unicode"),a&&a.__esModule&&a||{"default":a}).KEY_CODES,H=(u=e("helpers/dom/event"),u&&u.__esModule&&u||{"default":u}),k=H.stopPropagation,A=H.stopImmediatePropagation,P=H.isImmediatePropagationStopped,x=S.prototype.extend();x.prototype.init=function(){var e=this;this.createElements(),this.eventManager=T(this),this.bindEvents(),this.autoResize=E(),this.instance.addHook("afterDestroy",function(){e.destroy()})},x.prototype.getValue=function(){return this.TEXTAREA.value},x.prototype.setValue=function(e){this.TEXTAREA.value=e};var D=function(e){var t,o=this,n=o.getActiveEditor();if(t=(e.ctrlKey||e.metaKey)&&!e.altKey,e.target===n.TEXTAREA&&!P(e)){if(17===e.keyCode||224===e.keyCode||91===e.keyCode||93===e.keyCode)return void A(e);switch(e.keyCode){case M.ARROW_RIGHT:n.isInFullEditMode()&&(!n.isWaiting()&&!n.allowKeyEventPropagation||!n.isWaiting()&&n.allowKeyEventPropagation&&!n.allowKeyEventPropagation(e.keyCode))&&A(e);break;case M.ARROW_LEFT:n.isInFullEditMode()&&(!n.isWaiting()&&!n.allowKeyEventPropagation||!n.isWaiting()&&n.allowKeyEventPropagation&&!n.allowKeyEventPropagation(e.keyCode))&&A(e);break;case M.ARROW_UP:case M.ARROW_DOWN:n.isInFullEditMode()&&(!n.isWaiting()&&!n.allowKeyEventPropagation||!n.isWaiting()&&n.allowKeyEventPropagation&&!n.allowKeyEventPropagation(e.keyCode))&&A(e);break;case M.ENTER:var i=n.instance.getSelected(),r=!(i[0]===i[2]&&i[1]===i[3]);if(t&&!r||e.altKey){if(n.isOpened()){var s=d(n.TEXTAREA),l=n.getValue(),a=l.slice(0,s)+"\n"+l.slice(s);n.setValue(a),C(n.TEXTAREA,s+1)}else n.beginEditing(n.originalValue+"\n");A(e)}e.preventDefault();break;case M.A:case M.X:case M.C:case M.V:t&&A(e);break;case M.BACKSPACE:case M.DELETE:case M.HOME:case M.END:A(e)}-1===[M.ARROW_UP,M.ARROW_RIGHT,M.ARROW_DOWN,M.ARROW_LEFT].indexOf(e.keyCode)&&n.autoResize.resize(String.fromCharCode(e.keyCode))}};x.prototype.open=function(){this.refreshDimensions(),this.instance.addHook("beforeKeyDown",D)},x.prototype.close=function(e){this.textareaParentStyle.display="none",this.autoResize.unObserve(),document.activeElement===this.TEXTAREA&&this.instance.listen(),this.instance.removeHook("beforeKeyDown",D)},x.prototype.focus=function(){this.TEXTAREA.focus(),C(this.TEXTAREA,this.TEXTAREA.value.length)},x.prototype.createElements=function(){this.TEXTAREA=document.createElement("TEXTAREA"),h(this.TEXTAREA,"handsontableInput"),this.textareaStyle=this.TEXTAREA.style,this.textareaStyle.width=0,this.textareaStyle.height=0,this.TEXTAREA_PARENT=document.createElement("DIV"),h(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 e=this;this.instance._registerTimeout(setTimeout(function(){e.refreshDimensions()},0))},x.prototype.getEditedCell=function(){var e,t=this.checkEditorSection();switch(t){case"top":e=this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.textareaParentStyle.zIndex=101;break;case"top-left-corner":e=this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.textareaParentStyle.zIndex=103;break;case"bottom-left-corner":e=this.instance.view.wt.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.textareaParentStyle.zIndex=103;break;case"left":e=this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.textareaParentStyle.zIndex=102;break;case"bottom":e=this.instance.view.wt.wtOverlays.bottomOverlay.clone.wtTable.getCell({row:this.row,col:this.col}),this.textareaParentStyle.zIndex=102;break;default:e=this.instance.getCell(this.row,this.col),this.textareaParentStyle.zIndex=""}return-1!=e&&-2!=e?e:void 0},x.prototype.refreshDimensions=function(){if(this.state===Handsontable.EditorState.EDITING){if(this.TD=this.getEditedCell(),!this.TD)return void this.close(!0);var e,t=v(this.TD),o=v(this.instance.rootElement),n=p(this.TD),i=this.instance.countRows(),r=t.top-o.top-1-(n.scrollTop||0),s=t.left-o.left-1-(n.scrollLeft||0),l=this.instance.getSettings(),a=(this.instance.hasRowHeaders(),this.instance.hasColHeaders()),u=this.checkEditorSection(),c=this.TD.style.backgroundColor;switch(u){case"top":e=g(this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.holder.parentNode);break;case"left":e=g(this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.holder.parentNode);break;case"top-left-corner":e=g(this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.holder.parentNode);break;case"bottom-left-corner":e=g(this.instance.view.wt.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.holder.parentNode);break;case"bottom":e=g(this.instance.view.wt.wtOverlays.bottomOverlay.clone.wtTable.holder.parentNode)}(a&&0===this.instance.getSelected()[0]||l.fixedRowsBottom&&this.instance.getSelected()[0]===i-l.fixedRowsBottom)&&(r+=1),0===this.instance.getSelected()[1]&&(s+=1),e&&-1!=e?this.textareaParentStyle[e[0]]=e[1]:b(this.TEXTAREA_PARENT),this.textareaParentStyle.top=r+"px",this.textareaParentStyle.left=s+"px";var h=this.instance.view.wt.wtViewport.rowsRenderCalculator.startPosition,d=this.instance.view.wt.wtViewport.columnsRenderCalculator.startPosition,C=this.instance.view.wt.wtOverlays.leftOverlay.getScrollPosition(),E=this.instance.view.wt.wtOverlays.topOverlay.getScrollPosition(),S=m(),T=this.TD.offsetTop+h-E,O=this.TD.offsetLeft+d-C,_=w(this.TD)-8,M=y(n)?S:0,H=R(n)?S:0,k=this.instance.view.maximumVisibleElementWidth(O)-9-M,A=this.TD.scrollHeight+1,P=Math.max(this.instance.view.maximumVisibleElementHeight(T)-H,23),x=f(this.TD);this.TEXTAREA.style.fontSize=x.fontSize,this.TEXTAREA.style.fontFamily=x.fontFamily,this.TEXTAREA.style.backgroundColor="",this.TEXTAREA.style.backgroundColor=c?c:f(this.TEXTAREA).backgroundColor,this.autoResize.init(this.TEXTAREA,{minHeight:Math.min(A,P),maxHeight:P,minWidth:Math.min(_,k),maxWidth:k},!0),this.textareaParentStyle.display="block"}},x.prototype.bindEvents=function(){var e=this;this.eventManager.addEventListener(this.TEXTAREA,"cut",function(e){k(e)}),this.eventManager.addEventListener(this.TEXTAREA,"paste",function(e){k(e)}),this.instance.addHook("afterScrollHorizontally",function(){e.refreshDimensions()}),this.instance.addHook("afterScrollVertically",function(){e.refreshDimensions()}),this.instance.addHook("afterColumnResize",function(){e.refreshDimensions(),e.focus()}),this.instance.addHook("afterRowResize",function(){e.refreshDimensions(),e.focus()}),this.instance.addHook("afterDestroy",function(){e.eventManager.destroy()})},x.prototype.destroy=function(){this.eventManager.destroy()},_("text",x)},{_baseEditor:30,autoResize:"autoResize",editors:29,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/unicode":54}],41:[function(e,t,o){"use strict";function n(e,t){var o,n,i,r,s,l,a="HOT-TABLE";if(t.isTargetWebComponent=!1,t.realTarget=t.target,l=t.stopImmediatePropagation,t.stopImmediatePropagation=function(){l.apply(this),d(this)},!Handsontable.eventManager.isHotTableEnv)return t;for(t=u(t),s=t.path?t.path.length:0;s--;){if(t.path[s].nodeName===a)o=!0;else if(o&&t.path[s].shadowRoot){r=t.path[s];break}0!==s||r||(r=t.path[s])}return r||(r=t.target),t.isTargetWebComponent=!0,h()?t.realTarget=t.srcElement||t.toElement:(e instanceof Handsontable.Core||e instanceof Walkontable)&&(e instanceof Handsontable.Core?n=e.view?e.view.wt.wtTable.TABLE:null:e instanceof Walkontable&&(n=e.wtTable.TABLE.parentNode.parentNode),i=c(t.target,[a],n),i?t.realTarget=n.querySelector(a)||t.target:t.realTarget=t.target),Object.defineProperty(t,"target",{get:function(){return u(r)},enumerable:!0,configurable:!0}),t}function i(e){return new f(e)}Object.defineProperties(o,{EventManager:{get:function(){return f}},eventManager:{get:function(){return i}},__esModule:{value:!0}});var r,s,l,a=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}),u=a.polymerWrap,c=a.closest,h=(s=e("helpers/feature"),s&&s.__esModule&&s||{"default":s}).isWebComponentSupportedNatively,d=(l=e("helpers/dom/event"),l&&l.__esModule&&l||{"default":l}).stopImmediatePropagation,f=function(){var e=void 0!==arguments[0]?arguments[0]:null;this.context=e||this,this.context.eventListeners||(this.context.eventListeners=[])};$traceurRuntime.createClass(f,{addEventListener:function(e,t,o){function i(e){void 0==e.target&&void 0!=e.srcElement&&(e.definePoperty?e.definePoperty("target",{value:e.srcElement}):e.target=e.srcElement),void 0==e.preventDefault&&(e.definePoperty?e.definePoperty("preventDefault",{value:function(){this.returnValue=!1}}):e.preventDefault=function(){this.returnValue=!1}),e=n(s,e),o.call(this,e)}var r=this,s=this.context;return this.context.eventListeners.push({element:e,event:t,callback:o,callbackProxy:i}),window.addEventListener?e.addEventListener(t,i,!1):e.attachEvent("on"+t,i),Handsontable.countEventManagerListeners++,function(){r.removeEventListener(e,t,o); +}},removeEventListener:function(e,t,o){for(var n,i=this.context.eventListeners.length;i--;)if(n=this.context.eventListeners[i],n.event==t&&n.element==e){if(o&&o!=n.callback)continue;this.context.eventListeners.splice(i,1),n.element.removeEventListener?n.element.removeEventListener(n.event,n.callbackProxy,!1):n.element.detachEvent("on"+n.event,n.callbackProxy),Handsontable.countEventManagerListeners--}},clearEvents:function(){if(this.context)for(var e=this.context.eventListeners.length;e--;){var t=this.context.eventListeners[e];t&&this.removeEventListener(t.element,t.event,t.callback)}},clear:function(){this.clearEvents()},destroy:function(){this.clearEvents(),this.context=null},fireEvent:function(e,t){var o,n={bubbles:!0,cancelable:"mousemove"!==t,view:window,detail:0,screenX:0,screenY:0,clientX:1,clientY:1,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:void 0};document.createEvent?(o=document.createEvent("MouseEvents"),o.initMouseEvent(t,n.bubbles,n.cancelable,n.view,n.detail,n.screenX,n.screenY,n.clientX,n.clientY,n.ctrlKey,n.altKey,n.shiftKey,n.metaKey,n.button,n.relatedTarget||document.body.parentNode)):o=document.createEventObject(),e.dispatchEvent?e.dispatchEvent(o):e.fireEvent("on"+t,o)}},{}),window.Handsontable=window.Handsontable||{},Handsontable.countEventManagerListeners=0,Handsontable.eventManager=i},{"helpers/dom/element":45,"helpers/dom/event":46,"helpers/feature":47}],42:[function(e,t,o){"use strict";function n(e){for(var t=0,o=e.length;o>t;)e[t]=[e[t]],t++}function i(e,t){for(var o=0,n=t.length;n>o;)e.push(t[o]),o++}function r(e){var t=[];if(!e||0===e.length||!e[0]||0===e[0].length)return t;for(var o=e.length,n=e[0].length,i=0;o>i;i++)for(var r=0;n>r;r++)t[r]||(t[r]=[]),t[r][i]=e[i][r];return t}function s(e,t,o,n){var i=-1,r=e.length;for(n&&r&&(o=e[++i]);++it?e:t},Array.isArray(e)?e[0]:void 0)}function d(e){return s(e,function(e,t){return t>e?e:t},Array.isArray(e)?e[0]:void 0)}function f(e){return e.length?c(e)/e.length:0}function g(e){return s(e,function(e,t){return e.concat(Array.isArray(t)?g(t):t)},[])}function p(e){var t=[];return u(e,function(e){-1===t.indexOf(e)&&t.push(e)}),t}Object.defineProperties(o,{to2dArray:{get:function(){return n}},extendArray:{get:function(){return i}},pivot:{get:function(){return r}},arrayReduce:{get:function(){return s}},arrayFilter:{get:function(){return l}},arrayMap:{get:function(){return a}},arrayEach:{get:function(){return u}},arraySum:{get:function(){return c}},arrayMax:{get:function(){return h}},arrayMin:{get:function(){return d}},arrayAvg:{get:function(){return f}},arrayFlatten:{get:function(){return g}},arrayUnique:{get:function(){return p}},__esModule:{value:!0}})},{}],43:[function(e,t,o){"use strict";function n(){return a}function i(){return u}function r(){return c}function s(){return h}function l(e){return e||(e=navigator.userAgent),/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(e)}Object.defineProperties(o,{isIE8:{get:function(){return n}},isIE9:{get:function(){return i}},isSafari:{get:function(){return r}},isChrome:{get:function(){return s}},isMobileBrowser:{get:function(){return l}},__esModule:{value:!0}});var a=!document.createTextNode("test").textContent,u=!!document.documentMode,c=/Safari/.test(navigator.userAgent)&&/Apple Computer/.test(navigator.vendor),h=/Chrome/.test(navigator.userAgent)&&/Google/.test(navigator.vendor)},{}],44:[function(e,t,o){"use strict";function n(e){for(var t,o=e+1,n="";o>0;)t=(o-1)%26,n=String.fromCharCode(65+t)+n,o=parseInt((o-t)/26,10);return n}function i(e,t){e="number"==typeof e?e:100,t="number"==typeof t?t:4;var o,i,r=[];for(o=0;e>o;o++){var s=[];for(i=0;t>i;i++)s.push(n(i)+(o+1));r.push(s)}return r}function r(e,t){e="number"==typeof e?e:100,t="number"==typeof t?t:4;var o,i,r=[];for(o=0;e>o;o++){var s={};for(i=0;t>i;i++)s["prop"+i]=n(i)+(o+1);r.push(s)}return r}function s(e,t){for(var o,n=[],i=0;e>i;i++){o=[];for(var r=0;t>r;r++)o.push("");n.push(o)}return n}function l(e){var t,o,n,i,r=[],s=0;for(t=0,o=e.length;o>t;t++)for(n=0,i=e[t].length;i>n;n++)n==s&&(r.push([]),s++),r[n].push(e[t][n]);return r}function a(e,t){function o(e){var t=Handsontable.cellTypes[e];if("undefined"==typeof t)throw new Error('You declared cell type "'+e+'" 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 t}return t="undefined"==typeof t?!0:t,function(n,i){return function r(n){if(n){if(n.hasOwnProperty(e)&&void 0!==n[e])return n[e];if(n.hasOwnProperty("type")&&n.type){var i;if("string"!=typeof n.type)throw new Error("Cell type must be a string ");if(i=o(n.type),i.hasOwnProperty(e))return i[e];if(t)return}return r(c(n))}}("number"==typeof n?this.getCellMeta(n,i):n)}}Object.defineProperties(o,{spreadsheetColumnLabel:{get:function(){return n}},createSpreadsheetData:{get:function(){return i}},createSpreadsheetObjectData:{get:function(){return r}},createEmptySpreadsheetData:{get:function(){return s}},translateRowsToColumns:{get:function(){return l}},cellMethodLookupFactory:{get:function(){return a}},__esModule:{value:!0}});var u,c=(u=e("object"),u&&u.__esModule&&u||{"default":u}).getPrototypeOf},{object:51}],45:[function(e,t,o){"use strict";function n(e,t,o){for(;null!=e&&e!==o;){if(e.nodeType===Node.ELEMENT_NODE&&(t.indexOf(e.nodeName)>-1||t.indexOf(e)>-1))return e;e=e.host&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE?e.host:e.parentNode}return null}function i(e,t){var o=e.parentNode,n=[];for("string"==typeof t?n=Array.prototype.slice.call(document.querySelectorAll(t),0):n.push(t);null!=o;){if(n.indexOf(o)>-1)return!0;o=o.parentNode}return!1}function r(e){function t(e){return e.nodeType===Node.ELEMENT_NODE&&e.nodeName===n.toUpperCase()}var o,n="hot-table",i=!1;for(o=s(e);null!=o;){if(t(o)){i=!0;break}if(o.host&&o.nodeType===Node.DOCUMENT_FRAGMENT_NODE){if(i=t(o.host))break;o=o.host}o=o.parentNode}return i}function s(e){return"undefined"!=typeof Polymer&&"function"==typeof wrap?wrap(e):e}function l(e){return"undefined"!=typeof Polymer&&"function"==typeof unwrap?unwrap(e):e}function a(e){var t=0;if(e.previousSibling)for(;e=e.previousSibling;)++t;return t}function u(e,t){var o=document.querySelector(".ht_clone_"+e);return o?o.contains(t):null}function c(e){var t=0,o=[];if(!e||!e.length)return o;for(;e[t];)o.push(e[t]),t++;return o}function h(e,t){return Y(e,t)}function d(e,t){return q(e,t)}function f(e,t){return Q(e,t)}function g(e,t){if(3===e.nodeType)t.removeChild(e);else if(["TABLE","THEAD","TBODY","TFOOT","TR"].indexOf(e.nodeName)>-1)for(var o=e.childNodes,n=o.length-1;n>=0;n--)g(o[n],e)}function p(e){for(var t;t=e.lastChild;)e.removeChild(t)}function m(e,t){le.test(t)?e.innerHTML=t:w(e,t)}function w(e,t){var o=e.firstChild;o&&3===o.nodeType&&null===o.nextSibling?ae?o.textContent=t:o.data=t:(p(e),e.appendChild(document.createTextNode(t)))}function v(e){for(var t=e;l(t)!==document.documentElement;){if(null===t)return!1;if(t.nodeType===Node.DOCUMENT_FRAGMENT_NODE){if(t.host){if(t.host.impl)return v(t.host.impl);if(t.host)return v(t.host);throw new Error("Lost in Web Components world")}return!1}if("none"===t.style.display)return!1;t=t.parentNode}return!0}function b(e){var t,o,n,i,r;if(i=document.documentElement,oe()&&e.firstChild&&"CAPTION"===e.firstChild.nodeName)return r=e.getBoundingClientRect(),{top:r.top+(window.pageYOffset||i.scrollTop)-(i.clientTop||0),left:r.left+(window.pageXOffset||i.scrollLeft)-(i.clientLeft||0)};for(t=e.offsetLeft,o=e.offsetTop,n=e;(e=e.offsetParent)&&e!==document.body;)t+=e.offsetLeft,o+=e.offsetTop,n=e;return n&&"fixed"===n.style.position&&(t+=window.pageXOffset||i.scrollLeft,o+=window.pageYOffset||i.scrollTop),{left:t,top:o}}function C(){var e=window.scrollY;return void 0===e&&(e=document.documentElement.scrollTop),e}function y(){var e=window.scrollX;return void 0===e&&(e=document.documentElement.scrollLeft),e}function R(e){return e===window?C():e.scrollTop}function E(e){return e===window?y():e.scrollLeft}function S(e){for(var t,o,n,i=e.parentNode,r=["auto","scroll"],s="",l="",a="",u="";i&&i.style&&document.body!==i;){if(t=i.style.overflow,o=i.style.overflowX,n=i.style.overflowY,"scroll"==t||"scroll"==o||"scroll"==n)return i;if(window.getComputedStyle&&(s=window.getComputedStyle(i),l=s.getPropertyValue("overflow"),a=s.getPropertyValue("overflow-y"),u=s.getPropertyValue("overflow-x"),"scroll"===l||"scroll"===u||"scroll"===a))return i;if(i.clientHeight<=i.scrollHeight&&(-1!==r.indexOf(n)||-1!==r.indexOf(t)||-1!==r.indexOf(l)||-1!==r.indexOf(a)))return i;if(i.clientWidth<=i.scrollWidth&&(-1!==r.indexOf(o)||-1!==r.indexOf(t)||-1!==r.indexOf(l)||-1!==r.indexOf(u)))return i;i=i.parentNode}return window}function T(e){for(var t=e.parentNode;t&&t.style&&document.body!==t;){if("visible"!==t.style.overflow&&""!==t.style.overflow)return t;if(window.getComputedStyle){var o=window.getComputedStyle(t);if("visible"!==o.getPropertyValue("overflow")&&""!==o.getPropertyValue("overflow"))return t}t=t.parentNode}return window}function O(e,t){if(e){if(e!==window){var o,n=e.style[t];return""!==n&&void 0!==n?n:(o=_(e),""!==o[t]&&void 0!==o[t]?o[t]:void 0)}if("width"===t)return window.innerWidth+"px";if("height"===t)return window.innerHeight+"px"}}function _(e){return e.currentStyle||document.defaultView.getComputedStyle(e)}function M(e){return e.offsetWidth}function H(e){return oe()&&e.firstChild&&"CAPTION"===e.firstChild.nodeName?e.offsetHeight+e.firstChild.offsetHeight:e.offsetHeight}function k(e){return e.clientHeight||e.innerHeight}function A(e){return e.clientWidth||e.innerWidth}function P(e,t,o){window.addEventListener?e.addEventListener(t,o,!1):e.attachEvent("on"+t,o)}function x(e,t,o){window.removeEventListener?e.removeEventListener(t,o,!1):e.detachEvent("on"+t,o)}function D(e){if(e.selectionStart)return e.selectionStart;if(document.selection){e.focus();var t=document.selection.createRange();if(null==t)return 0;var o=e.createTextRange(),n=o.duplicate();return o.moveToBookmark(t.getBookmark()),n.setEndPoint("EndToStart",o),n.text.length}return 0}function N(e){if(e.selectionEnd)return e.selectionEnd;if(document.selection){var t=document.selection.createRange();if(null==t)return 0;var o=e.createTextRange();return o.text.indexOf(t.text)+t.text.length}}function L(){var e="";return window.getSelection?e=window.getSelection().toString():document.selection&&"Control"!==document.selection.type&&(e=document.selection.createRange().text),e}function W(e,t,o){if(void 0===o&&(o=t),e.setSelectionRange){e.focus();try{e.setSelectionRange(t,o)}catch(n){var i=e.parentNode,r=i.style.display;i.style.display="block",e.setSelectionRange(t,o),i.style.display=r}}else if(e.createTextRange){var s=e.createTextRange();s.collapse(!0),s.moveEnd("character",o),s.moveStart("character",t),s.select()}}function I(){var e=document.createElement("p");e.style.width="100%",e.style.height="200px";var t=document.createElement("div");t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.visibility="hidden",t.style.width="200px",t.style.height="150px",t.style.overflow="hidden",t.appendChild(e),(document.body||document.documentElement).appendChild(t);var o=e.offsetWidth;t.style.overflow="scroll";var n=e.offsetWidth;return o==n&&(n=t.clientWidth),(document.body||document.documentElement).removeChild(t),o-n}function j(){return void 0===se&&(se=I()),se}function B(e){return e.offsetWidth!==e.clientWidth}function V(e){return e.offsetHeight!==e.clientHeight}function F(e,t,o){Z()||ee()?(e.style.top=o,e.style.left=t):te()?e.style["-webkit-transform"]="translate3d("+t+","+o+",0)":e.style.transform="translate3d("+t+","+o+",0)"}function z(e){var t;return e.style.transform&&""!==(t=e.style.transform)?["transform",t]:e.style["-webkit-transform"]&&""!==(t=e.style["-webkit-transform"])?["-webkit-transform",t]:-1}function G(e){e.style.transform&&""!==e.style.transform?e.style.transform="":e.style["-webkit-transform"]&&""!==e.style["-webkit-transform"]&&(e.style["-webkit-transform"]="")}function U(e){var t=["INPUT","SELECT","TEXTAREA"];return e&&(t.indexOf(e.nodeName)>-1||"true"===e.contentEditable)}function $(e){return U(e)&&-1==e.className.indexOf("handsontableInput")&&-1==e.className.indexOf("copyPaste")}Object.defineProperties(o,{closest:{get:function(){return n}},isChildOf:{get:function(){return i}},isChildOfWebComponentTable:{get:function(){return r}},polymerWrap:{get:function(){return s}},polymerUnwrap:{get:function(){return l}},index:{get:function(){return a}},overlayContainsElement:{get:function(){return u}},hasClass:{get:function(){return h}},addClass:{get:function(){return d}},removeClass:{get:function(){return f}},removeTextNodes:{get:function(){return g}},empty:{get:function(){return p}},HTML_CHARACTERS:{get:function(){return le}},fastInnerHTML:{get:function(){return m}},fastInnerText:{get:function(){return w}},isVisible:{get:function(){return v}},offset:{get:function(){return b}},getWindowScrollTop:{get:function(){return C}},getWindowScrollLeft:{get:function(){return y}},getScrollTop:{get:function(){return R}},getScrollLeft:{get:function(){return E}},getScrollableElement:{get:function(){return S}},getTrimmingContainer:{get:function(){return T}},getStyle:{get:function(){return O}},getComputedStyle:{get:function(){return _}},outerWidth:{get:function(){return M}},outerHeight:{get:function(){return H}},innerHeight:{get:function(){return k}},innerWidth:{get:function(){return A}},addEvent:{get:function(){return P}},removeEvent:{get:function(){return x}},getCaretPosition:{get:function(){return D}},getSelectionEndPosition:{get:function(){return N}},getSelectionText:{get:function(){return L}},setCaretPosition:{get:function(){return W}},getScrollbarWidth:{get:function(){return j}},hasVerticalScrollbar:{get:function(){return B}},hasHorizontalScrollbar:{get:function(){return V}},setOverlayPosition:{get:function(){return F}},getCssTransform:{get:function(){return z}},resetCssTransform:{get:function(){return G}},isInput:{get:function(){return U}},isOutsideInput:{get:function(){return $}},__esModule:{value:!0}});var K,X,Y,q,Q,J=(K=e("../browser"),K&&K.__esModule&&K||{"default":K}),Z=J.isIE8,ee=J.isIE9,te=J.isSafari,oe=(X=e("../feature"),X&&X.__esModule&&X||{"default":X}).hasCaptionProblem,ne=!!document.documentElement.classList;if(ne){var ie=function(){var e=document.createElement("div");return e.classList.add("test","test2"),e.classList.contains("test2")}();Y=function(e,t){return""===t?!1:e.classList.contains(t)},q=function(e,t){var o=0;if("string"==typeof t&&(t=t.split(" ")),t=c(t),ie)e.classList.add.apply(e.classList,t);else for(;t&&t[o];)e.classList.add(t[o]),o++},Q=function(e,t){var o=0;if("string"==typeof t&&(t=t.split(" ")),t=c(t),ie)e.classList.remove.apply(e.classList,t);else for(;t&&t[o];)e.classList.remove(t[o]),o++}}else{var re=function(e){return new RegExp("(\\s|^)"+e+"(\\s|$)")};Y=function(e,t){return!!e.className.match(re(t))},q=function(e,t){var o=0,n=e.className;if("string"==typeof t&&(t=t.split(" ")),""===n)n=t.join(" ");else for(;t&&t[o];)re(t[o]).test(n)||(n+=" "+t[o]),o++;e.className=n},Q=function(e,t){var o=0,n=e.className;for("string"==typeof t&&(t=t.split(" "));t&&t[o];)n=n.replace(re(t[o])," ").trim(),o++;e.className!==n&&(e.className=n)}}var se,le=/(<(.*)>|&(.*);)/,ae=!!document.createTextNode("test").textContent},{"../browser":43,"../feature":47}],46:[function(e,t,o){"use strict";function n(e){e.isImmediatePropagationEnabled=!1,e.cancelBubble=!0}function i(e){return e.isImmediatePropagationEnabled===!1}function r(e){"function"==typeof e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function s(e){return e.pageX?e.pageX:e.clientX+h()}function l(e){return e.pageY?e.pageY:e.clientY+c()}Object.defineProperties(o,{stopImmediatePropagation:{get:function(){return n}},isImmediatePropagationStopped:{get:function(){return i}},stopPropagation:{get:function(){return r}},pageX:{get:function(){return s}},pageY:{get:function(){return l}},__esModule:{value:!0}});var a,u=(a=e("element"),a&&a.__esModule&&a||{"default":a}),c=u.getWindowScrollTop,h=u.getWindowScrollLeft},{element:45}],47:[function(e,t,o){"use strict";function n(e){return d.call(window,e)}function i(e){f.call(window,e)}function r(){return"ontouchstart"in window}function s(){var e=document.createElement("div");return!(!e.createShadowRoot||!e.createShadowRoot.toString().match(/\[native code\]/))}function l(){var e=document.createElement("TABLE");e.style.borderSpacing=0,e.style.borderWidth=0,e.style.padding=0;var t=document.createElement("TBODY");e.appendChild(t),t.appendChild(document.createElement("TR")),t.firstChild.appendChild(document.createElement("TD")),t.firstChild.firstChild.innerHTML="t
t";var o=document.createElement("CAPTION");o.innerHTML="c
c
c
c",o.style.padding=0,o.style.margin=0,e.insertBefore(o,t),document.body.appendChild(e),p=e.offsetHeight<2*e.lastChild.offsetHeight,document.body.removeChild(e)}function a(){return void 0===p&&l(),p}function u(e){var t=void 0!==arguments[1]?arguments[1]:{};return m?m:m="object"==typeof Intl?new Intl.Collator(e,t).compare:"function"==typeof String.prototype.localeCompare?function(e,t){return(e+"").localeCompare(t)}:function(e,t){return e===t?0:e>t?-1:1}}Object.defineProperties(o,{requestAnimationFrame:{get:function(){return n}},cancelAnimationFrame:{get:function(){return i}},isTouchSupported:{get:function(){return r}},isWebComponentSupportedNatively:{get:function(){return s}},hasCaptionProblem:{get:function(){return a}},getComparisonFunction:{get:function(){return u}},__esModule:{value:!0}});for(var c=0,h=["ms","moz","webkit","o"],d=window.requestAnimationFrame,f=window.cancelAnimationFrame,g=0;g=o?e.apply(this,l):t(l)}}var o=e.length;return t([])}function c(e){function t(n){return function(){for(var i=[],r=0;r=o?e.apply(this,l):t(l)}}var o=e.length;return t([])}Object.defineProperties(o,{proxy:{get:function(){return n}},throttle:{get:function(){return i}},throttleAfterHits:{get:function(){return r}},debounce:{get:function(){return s}},pipe:{get:function(){return l}},partial:{get:function(){return a}},curry:{get:function(){return u}},curryRight:{get:function(){return c}},__esModule:{value:!0}});var h,d=(h=e("array"),h&&h.__esModule&&h||{"default":h}).arrayReduce},{array:42}],49:[function(e,t,o){"use strict";function n(e){switch(typeof e){case"string":case"number":return e+"";case"object":return null===e?"":e.toString();case"undefined":return"";default:return e.toString()}}Object.defineProperties(o,{stringify:{get:function(){return n}},__esModule:{value:!0}})},{}],50:[function(e,t,o){"use strict";function n(e){var t=typeof e;return"number"==t?!isNaN(e)&&isFinite(e):"string"==t?e.length?1==e.length?/\d/.test(e):/^\s*[+-]?\s*(?:(?:\d+(?:\.\d+)?(?:e[+-]?\d+)?)|(?:0x[a-f\d]+))\s*$/i.test(e):!1:"object"==t?!(!e||"number"!=typeof e.valueOf()||e instanceof Date):!1}function i(e,t,o){var n=-1;for("function"==typeof t?(o=t,t=e):n=e-1;++n<=t&&o(n)!==!1;);}function r(e,t,o){var n=e+1;for("function"==typeof t&&(o=t,t=0);--n>=t&&o(n)!==!1;);}function s(e,t){return t=parseInt(t.toString().replace("%",""),10),t=parseInt(e*t/100)}Object.defineProperties(o,{isNumeric:{get:function(){return n}},rangeEach:{get:function(){return i}},rangeEachReverse:{get:function(){return r}},valueAccordingPercent:{get:function(){return s}},__esModule:{value:!0}})},{}],51:[function(e,t,o){"use strict";function n(e){var t;return Array.isArray(e)?t=[]:(t={},g(e,function(e,o){e&&"object"==typeof e&&!Array.isArray(e)?t[o]=n(e):Array.isArray(e)?e.length&&"object"==typeof e[0]&&!Array.isArray(e[0])?t[o]=[n(e[0])]:t[o]=[]:t[o]=null})),t}function i(e,t){return t.prototype.constructor=t,e.prototype=new t,e.prototype.constructor=e,e}function r(e,t){return g(t,function(t,o){e[o]=t}),e}function s(e,t){g(t,function(o,n){t[n]&&"object"==typeof t[n]?(e[n]||(Array.isArray(t[n])?e[n]=[]:"[object Date]"===Object.prototype.toString.call(t[n])?e[n]=t[n]:e[n]={}),s(e[n],t[n])):e[n]=t[n]})}function l(e){return"object"==typeof e?JSON.parse(JSON.stringify(e)):e}function a(e){var t={};return g(e,function(e,o){t[o]=e}),t}function u(e){for(var t=[],o=1;on;n++)o.prototype[t[n]]=void 0;return o}Object.defineProperties(o,{columnFactory:{get:function(){return n}},__esModule:{value:!0}});var i,r=(i=e("object"),i&&i.__esModule&&i||{"default":i}).inherit},{object:51}],53:[function(e,t,o){"use strict";function n(e){return e[0].toUpperCase()+e.substr(1)}function i(e,t){var o=!0;return g(t.length-1,function(n){return e.charAt(n)!==t.charAt(n)?(o=!1,!1):void 0}),o}function r(e,t){var o=!0,n=t.length-1,i=e.length-1;return g(n,function(r){var s=i-r,l=n-r;return e.charAt(s)!==t.charAt(l)?(o=!1,!1):void 0}),o}function s(){for(var e=[],t=0;t=t)return e;o=String(o);var n=o.length;n||(o=" ");var i=t-e.length,r=Math.ceil(i/o.length),s="";return g(r,function(e){s+=o}),s=s.slice(0,i),s+e}Object.defineProperties(o,{toUpperCaseFirst:{get:function(){return n}},startsWith:{get:function(){return i}},endsWith:{get:function(){return r}},equalsIgnoreCase:{get:function(){return s}},randomString:{get:function(){return l}},isPercentValue:{get:function(){return a}},substitute:{get:function(){return u}},padStart:{get:function(){return c}},__esModule:{value:!0}});var h,d,f=(h=e("mixed"),h&&h.__esModule&&h||{"default":h}).stringify,g=(d=e("number"),d&&d.__esModule&&d||{"default":d}).rangeEach},{mixed:49,number:50}],54:[function(e,t,o){"use strict";function n(e){return 32==e||e>=48&&57>=e||e>=96&&111>=e||e>=186&&192>=e||e>=219&&222>=e||e>=226||e>=65&&90>=e}function i(e){var t=[u.ARROW_DOWN,u.ARROW_UP,u.ARROW_LEFT,u.ARROW_RIGHT,u.HOME,u.END,u.DELETE,u.BACKSPACE,u.F1,u.F2,u.F3,u.F4,u.F5,u.F6,u.F7,u.F8,u.F9,u.F10,u.F11,u.F12,u.TAB,u.PAGE_DOWN,u.PAGE_UP,u.ENTER,u.ESCAPE,u.SHIFT,u.CAPS_LOCK,u.ALT];return-1!==t.indexOf(e)}function r(e){return-1!==[u.CONTROL_LEFT,224,u.COMMAND_LEFT,u.COMMAND_RIGHT].indexOf(e)}function s(e,t){var o=t.split("|"),n=!1;return a(o,function(t){return e===u[t]?(n=!0,!1):void 0}),n}Object.defineProperties(o,{KEY_CODES:{get:function(){return u}},isPrintableChar:{get:function(){return n}},isMetaKey:{get:function(){return i}},isCtrlKey:{get:function(){return r}},isKey:{get:function(){return s}},__esModule:{value:!0}});var l,a=(l=e("array"),l&&l.__esModule&&l||{"default":l}).arrayEach,u={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}},{array:42}],55:[function(e,t,o){"use strict";Object.defineProperties(o,{localHooks:{get:function(){return a}},__esModule:{value:!0}});var n,i,r=(n=e("helpers/array"),n&&n.__esModule&&n||{"default":n}).arrayEach,s=(i=e("helpers/object"),i&&i.__esModule&&i||{"default":i}).defineGetter,l="localHooks",a={_localHooks:Object.create(null),addLocalHook:function(e,t){this._localHooks[e]||(this._localHooks[e]=[]),this._localHooks[e].push(t)},runLocalHooks:function(e){for(var t=[],o=1;o=0?(t.skip=!0,!0):!1},has:function(e){var t=void 0!==arguments[1]?arguments[1]:null,o=this.getBucket(t);return!(void 0===o[e]||!o[e].length)},run:function(e,t,o,n,i,r,s,l){var a=this.globalBucket[t],u=-1,c=a?a.length:0;if(c)for(;++u=0},getRegistered:function(){return r}},{}),Handsontable.utils=Handsontable.utils||{},Handsontable.utils.Hooks=a},{"helpers/array":42,"helpers/object":51}],58:[function(e,t,o){"use strict";function n(e,t){e=c(e),Handsontable.plugins[e]=t,Handsontable.hooks.add("construct",function(){var o;h.has(this)||h.set(this,{}),o=h.get(this),o[e]||(o[e]=new t(this))}),Handsontable.hooks.add("afterDestroy",function(){if(h.has(this)){var e=h.get(this);u(e,function(e){return e.destroy()}),h["delete"](this)}})}function i(e,t){if("string"!=typeof t)throw Error('Only strings can be passed as "plugin" parameter');var o=c(t);if(h.has(e)&&h.get(e)[o])return h.get(e)[o]}function r(e){return h.has(e)?Object.keys(h.get(e)):[]}function s(e,t){var o=null;return h.has(e)&&u(h.get(e),function(e,n){e===t&&(o=n)}),o}Object.defineProperties(o,{registerPlugin:{get:function(){return n}},getPlugin:{get:function(){return i}},getRegistredPluginNames:{get:function(){return r}},getPluginName:{get:function(){return s}},__esModule:{value:!0}});var l,a,u=(l=e("helpers/object"),l&&l.__esModule&&l||{"default":l}).objectEach,c=(a=e("helpers/string"),a&&a.__esModule&&a||{"default":a}).toUpperCaseFirst,h=new WeakMap},{"helpers/object":51,"helpers/string":53}],59:[function(e,t,o){"use strict";Object.defineProperties(o,{"default":{get:function(){return m}},__esModule:{value:!0}});var n,i,r,s=(n=e("helpers/object"),n&&n.__esModule&&n||{"default":n}),l=s.defineGetter,a=s.objectEach,u=(i=e("helpers/array"),i&&i.__esModule&&i||{"default":i}).arrayEach,c=(r=e("plugins"),r&&r.__esModule&&r||{"default":r}),h=c.getRegistredPluginNames,d=c.getPluginName,f=new WeakMap,g=null,p=function(e){var t=this;l(this,"hot",e,{writable:!1}),f.set(this,{hooks:{}}),g=null,this.pluginName=null,this.pluginsInitializedCallbacks=[],this.isPluginsReady=!1,this.enabled=!1,this.initialized=!1,this.hot.addHook("afterPluginsInitialized",function(){return t.onAfterPluginsInitialized()}),this.hot.addHook("afterUpdateSettings",function(){return t.onUpdateSettings()}),this.hot.addHook("beforeInit",function(){return t.init()})};$traceurRuntime.createClass(p,{init:function(){this.pluginName=d(this.hot,this),this.isEnabled&&this.isEnabled()&&this.enablePlugin(),g||(g=h(this.hot)),g.indexOf(this.pluginName)>=0&&g.splice(g.indexOf(this.pluginName),1),g.length||this.hot.runHooks("afterPluginsInitialized"),this.initialized=!0},enablePlugin:function(){this.enabled=!0},disablePlugin:function(){this.eventManager&&this.eventManager.clear(),this.clearHooks(),this.enabled=!1},addHook:function(e,t){var o=f.get(this).hooks[e]=f.get(this).hooks[e]||[];this.hot.addHook(e,t),o.push(t),f.get(this).hooks[e]=o},removeHooks:function(e){var t=this;u(f.get(this).hooks[e]||[],function(o){t.hot.removeHook(e,o)})},clearHooks:function(){var e=this,t=f.get(this).hooks;a(t,function(t,o){return e.removeHooks(o)}),t.length=0},callOnPluginsReady:function(e){this.isPluginsReady?e():this.pluginsInitializedCallbacks.push(e)},onAfterPluginsInitialized:function(){u(this.pluginsInitializedCallbacks,function(e){return e()}),this.pluginsInitializedCallbacks.length=0,this.isPluginsReady=!0},onUpdateSettings:function(){this.isEnabled&&(this.enabled&&!this.isEnabled()&&this.disablePlugin(),!this.enabled&&this.isEnabled()&&this.enablePlugin(),this.enabled&&this.isEnabled()&&this.updatePlugin())},updatePlugin:function(){},destroy:function(){var e=this;this.eventManager&&this.eventManager.destroy(),this.clearHooks(),a(this,function(t,o){"hot"!==o&&(e[o]=null)}),delete this.hot}},{});var m=p;Handsontable.plugins.BasePlugin=p},{"helpers/array":42,"helpers/object":51,plugins:58}],60:[function(e,t,o){"use strict";Object.defineProperties(o,{AutoColumnSize:{get:function(){return P}},__esModule:{value:!0}});var n,i,r,s,l,a,u,c,h,d,f,g=(n=e("_base"),n&&n.__esModule&&n||{"default":n})["default"],p=(i=e("helpers/array"),i&&i.__esModule&&i||{"default":i}),m=p.arrayEach,w=p.arrayFilter,v=(r=e("helpers/feature"),r&&r.__esModule&&r||{"default":r}),b=v.cancelAnimationFrame,C=v.requestAnimationFrame,y=(s=e("helpers/dom/element"),s&&s.__esModule&&s||{"default":s}).isVisible,R=(l=e("utils/ghostTable"),l&&l.__esModule&&l||{"default":l}).GhostTable,E=(a=e("helpers/object"),a&&a.__esModule&&a||{"default":a}),S=E.isObject,T=(E.objectEach,u=e("helpers/number"),u&&u.__esModule&&u||{"default":u}),O=T.valueAccordingPercent,_=T.rangeEach,M=(c=e("plugins"),c&&c.__esModule&&c||{"default":c}).registerPlugin,H=(h=e("utils/samplesGenerator"),h&&h.__esModule&&h||{"default":h}).SamplesGenerator,k=(d=e("helpers/string"),d&&d.__esModule&&d||{"default":d}).isPercentValue,A=(f=e("3rdparty/walkontable/src/calculator/viewportColumns"),f&&f.__esModule&&f||{"default":f}).WalkontableViewportColumnsCalculator,P=function(e){var t=this;$traceurRuntime.superConstructor(x).call(this,e),this.widths=[],this.ghostTable=new R(this.hot),this.samplesGenerator=new H(function(e,o){return t.hot.getDataAtCell(e,o)}),this.firstCalculation=!0,this.inProgress=!1,this.addHook("beforeColumnResize",function(e,o,n){return t.onBeforeColumnResize(e,o,n)})},x=P;$traceurRuntime.createClass(P,{isEnabled:function(){return this.hot.getSettings().autoColumnSize!==!1&&!this.hot.getSettings().colWidths},enablePlugin:function(){var e=this;if(!this.enabled){var t=this.hot.getSettings().autoColumnSize,o=t&&t.hasOwnProperty("samplingRatio")?this.hot.getSettings().autoColumnSize.samplingRatio:void 0;o&&!isNaN(o)&&(this.samplesGenerator.customSampleCount=parseInt(o,10)),this.addHook("afterLoadData",function(){return e.onAfterLoadData()}),this.addHook("beforeChange",function(t){return e.onBeforeChange(t)}),this.addHook("beforeRender",function(t){return e.onBeforeRender(t)}),this.addHook("modifyColWidth",function(t,o){return e.getColumnWidth(o,t)}),$traceurRuntime.superGet(this,x.prototype,"enablePlugin").call(this)}},disablePlugin:function(){$traceurRuntime.superGet(this,x.prototype,"disablePlugin").call(this)},calculateColumnsWidth:function(){var e=void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countCols()-1},t=void 0!==arguments[1]?arguments[1]:{from:0,to:this.hot.countRows()-1},o=void 0!==arguments[2]?arguments[2]:!1,n=this;"number"==typeof e&&(e={from:e,to:e}),"number"==typeof t&&(t={from:t,to:t}),_(e.from,e.to,function(e){if(o||void 0===n.widths[e]&&!n.hot._getColWidthFromSettings(e)){var i=n.samplesGenerator.generateColumnSamples(e,t);i.forEach(function(e,t){return n.ghostTable.addColumn(t,e)})}}),this.ghostTable.columns.length&&(this.ghostTable.getWidths(function(e,t){return n.widths[e]=t}),this.ghostTable.clean())},calculateAllColumnsWidth:function(){var e=void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countRows()-1},t=this,o=0,n=this.hot.countCols()-1,i=null;this.inProgress=!0;var r=function(){return t.hot?(t.calculateColumnsWidth({from:o,to:Math.min(o+x.CALCULATION_STEP,n)},e),o=o+x.CALCULATION_STEP+1,void(n>o?i=C(r):(b(i),t.inProgress=!1,t.hot.view.wt.wtOverlays.adjustElementsSize(!0),t.hot.view.wt.wtOverlays.leftOverlay.needFullRender&&t.hot.view.wt.wtOverlays.leftOverlay.clone.draw()))):(b(i),void(t.inProgress=!1))};this.firstCalculation&&this.getSyncCalculationLimit()&&(this.calculateColumnsWidth({from:0,to:this.getSyncCalculationLimit()},e),this.firstCalculation=!1,o=this.getSyncCalculationLimit()+1),n>o?r():this.inProgress=!1},recalculateAllColumnsWidth:function(){this.hot.view&&y(this.hot.view.wt.wtTable.TABLE)&&(this.clearCache(),this.calculateAllColumnsWidth())},getSyncCalculationLimit:function(){var e=x.SYNC_CALCULATION_LIMIT,t=this.hot.countCols()-1;return S(this.hot.getSettings().autoColumnSize)&&(e=this.hot.getSettings().autoColumnSize.syncLimit,k(e)?e=O(t,e):e>>=0),Math.min(e,t)},getColumnWidth:function(e){var t=arguments[1],o=void 0!==arguments[2]?arguments[2]:!0,n=t;return void 0===n&&(n=this.widths[e],o&&"number"==typeof n&&(n=Math.max(n,A.DEFAULT_WIDTH))),n},getFirstVisibleColumn:function(){var e=this.hot.view.wt;return e.wtViewport.columnsVisibleCalculator?e.wtTable.getFirstVisibleColumn():e.wtViewport.columnsRenderCalculator?e.wtTable.getFirstRenderedColumn():-1},getLastVisibleColumn:function(){var e=this.hot.view.wt;return e.wtViewport.columnsVisibleCalculator?e.wtTable.getLastVisibleColumn():e.wtViewport.columnsRenderCalculator?e.wtTable.getLastRenderedColumn():-1},clearCache:function(){this.widths.length=0},isNeedRecalculate:function(){return!!w(this.widths,function(e){return void 0===e}).length},onBeforeRender:function(){var e=this.hot.renderCall,t=this.hot.countRows();t&&(this.calculateColumnsWidth({from:this.getFirstVisibleColumn(),to:this.getLastVisibleColumn()},void 0,e),this.isNeedRecalculate()&&!this.inProgress&&this.calculateAllColumnsWidth())},onAfterLoadData:function(){var e=this;this.hot.view?this.recalculateAllColumnsWidth():setTimeout(function(){e.hot&&e.recalculateAllColumnsWidth()},0)},onBeforeChange:function(e){var t=this;m(e,function(e){return t.widths[t.hot.propToCol(e[1])]=void 0})},onBeforeColumnResize:function(e,t,o){return o&&(this.calculateColumnsWidth(e,void 0,!0),t=this.getColumnWidth(e,void 0,!1)),t},destroy:function(){this.ghostTable.clean(),$traceurRuntime.superGet(this,x.prototype,"destroy").call(this)}},{get CALCULATION_STEP(){return 50},get SYNC_CALCULATION_LIMIT(){return 50}},g),M("autoColumnSize",P)},{"3rdparty/walkontable/src/calculator/viewportColumns":3,_base:59,"helpers/array":42,"helpers/dom/element":45,"helpers/feature":47,"helpers/number":50,"helpers/object":51,"helpers/string":53,plugins:58,"utils/ghostTable":101,"utils/samplesGenerator":103}],61:[function(e,t,o){"use strict";Object.defineProperties(o,{AutoRowSize:{get:function(){return H}},__esModule:{value:!0}});var n,i,r,s,l,a,u,c,h,d,f=(n=e("_base"),n&&n.__esModule&&n||{"default":n})["default"],g=(i=e("helpers/array"),i&&i.__esModule&&i||{"default":i}),p=(g.arrayEach,g.arrayFilter),m=(r=e("helpers/feature"),r&&r.__esModule&&r||{"default":r}),w=m.cancelAnimationFrame,v=m.requestAnimationFrame,b=(s=e("helpers/dom/element"),s&&s.__esModule&&s||{"default":s}).isVisible,C=(l=e("utils/ghostTable"),l&&l.__esModule&&l||{"default":l}).GhostTable,y=(a=e("helpers/object"),a&&a.__esModule&&a||{"default":a}),R=y.isObject,E=(y.objectEach,u=e("helpers/number"),u&&u.__esModule&&u||{"default":u}),S=E.valueAccordingPercent,T=E.rangeEach,O=(c=e("plugins"),c&&c.__esModule&&c||{"default":c}).registerPlugin,_=(h=e("utils/samplesGenerator"),h&&h.__esModule&&h||{"default":h}).SamplesGenerator,M=(d=e("helpers/string"),d&&d.__esModule&&d||{"default":d}).isPercentValue,H=function(e){var t=this;$traceurRuntime.superConstructor(k).call(this,e),this.heights=[],this.ghostTable=new C(this.hot),this.samplesGenerator=new _(function(e,o){return t.hot.getDataAtCell(e,o)}),this.firstCalculation=!0,this.inProgress=!1,this.addHook("beforeRowResize",function(e,o,n){return t.onBeforeRowResize(e,o,n)})},k=H;$traceurRuntime.createClass(H,{isEnabled:function(){return this.hot.getSettings().autoRowSize===!0||R(this.hot.getSettings().autoRowSize)},enablePlugin:function(){var e=this;if(!this.enabled){var t=this.hot.getSettings().autoRowSize,o=t&&t.hasOwnProperty("samplingRatio")?this.hot.getSettings().autoRowSize.samplingRatio:void 0;o&&!isNaN(o)&&(this.samplesGenerator.customSampleCount=parseInt(o,10)),this.addHook("afterLoadData",function(){return e.onAfterLoadData()}),this.addHook("beforeChange",function(t){return e.onBeforeChange(t)}),this.addHook("beforeColumnMove",function(){return e.recalculateAllRowsHeight()}),this.addHook("beforeColumnResize",function(){return e.recalculateAllRowsHeight()}),this.addHook("beforeColumnSort",function(){return e.clearCache()}),this.addHook("beforeRender",function(t){return e.onBeforeRender(t)}),this.addHook("beforeRowMove",function(t,o){return e.onBeforeRowMove(t,o)}),this.addHook("modifyRowHeight",function(t,o){return e.getRowHeight(o,t)}),$traceurRuntime.superGet(this,k.prototype,"enablePlugin").call(this)}},disablePlugin:function(){$traceurRuntime.superGet(this,k.prototype,"disablePlugin").call(this)},calculateRowsHeight:function(){var e=void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countRows()-1},t=void 0!==arguments[1]?arguments[1]:{from:0,to:this.hot.countCols()-1},o=void 0!==arguments[2]?arguments[2]:!1,n=this;"number"==typeof e&&(e={from:e,to:e}),"number"==typeof t&&(t={from:t,to:t}),T(e.from,e.to,function(e){if(o||void 0===n.heights[e]){var i=n.samplesGenerator.generateRowSamples(e,t);i.forEach(function(e,t){return n.ghostTable.addRow(t,e)})}}),this.ghostTable.rows.length&&(this.ghostTable.getHeights(function(e,t){return n.heights[e]=t}),this.ghostTable.clean())},calculateAllRowsHeight:function(){var e=void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countCols()-1},t=this,o=0,n=this.hot.countRows()-1,i=null;this.inProgress=!0;var r=function(){return t.hot?(t.calculateRowsHeight({from:o,to:Math.min(o+k.CALCULATION_STEP,n)},e),o=o+k.CALCULATION_STEP+1,void(n>o?i=v(r):(w(i),t.inProgress=!1,t.hot.view.wt.wtOverlays.adjustElementsSize(!0),t.hot.view.wt.wtOverlays.leftOverlay.needFullRender&&t.hot.view.wt.wtOverlays.leftOverlay.clone.draw()))):(w(i),void(t.inProgress=!1))};this.firstCalculation&&this.getSyncCalculationLimit()&&(this.calculateRowsHeight({from:0,to:this.getSyncCalculationLimit()},e),this.firstCalculation=!1,o=this.getSyncCalculationLimit()+1),n>o?r():this.inProgress=!1},recalculateAllRowsHeight:function(){b(this.hot.view.wt.wtTable.TABLE)&&(this.clearCache(),this.calculateAllRowsHeight())},getSyncCalculationLimit:function(){var e=k.SYNC_CALCULATION_LIMIT,t=this.hot.countRows()-1;return R(this.hot.getSettings().autoRowSize)&&(e=this.hot.getSettings().autoRowSize.syncLimit,M(e)?e=S(t,e):e>>=0),Math.min(e,t)},getRowHeight:function(e){var t=arguments[1],o=t;return void 0!==this.heights[e]&&this.heights[e]>(t||0)&&(o=this.heights[e]),o},getFirstVisibleRow:function(){var e=this.hot.view.wt;return e.wtViewport.rowsVisibleCalculator?e.wtTable.getFirstVisibleRow():e.wtViewport.rowsRenderCalculator?e.wtTable.getFirstRenderedRow():-1},getLastVisibleRow:function(){var e=this.hot.view.wt;return e.wtViewport.rowsVisibleCalculator?e.wtTable.getLastVisibleRow():e.wtViewport.rowsRenderCalculator?e.wtTable.getLastRenderedRow():-1},clearCache:function(){this.heights.length=0},clearCacheByRange:function(e){var t=this;"number"==typeof e&&(e={from:e,to:e}),T(Math.min(e.from,e.to),Math.max(e.from,e.to),function(e){return t.heights[e]=void 0})},isNeedRecalculate:function(){return!!p(this.heights,function(e){return void 0===e}).length},onBeforeRender:function(){var e=this.hot.renderCall;this.calculateRowsHeight({from:this.getFirstVisibleRow(),to:this.getLastVisibleRow()},void 0,e);var t=this.hot.getSettings().fixedRowsBottom;if(t){var o=this.hot.countRows()-1;this.calculateRowsHeight({from:o-t,to:o})}this.isNeedRecalculate()&&!this.inProgress&&this.calculateAllRowsHeight()},onBeforeRowMove:function(e,t){this.clearCacheByRange({from:e,to:t}),this.calculateAllRowsHeight()},onBeforeRowResize:function(e,t,o){return o&&(this.calculateRowsHeight(e,void 0,!0),t=this.getRowHeight(e)),t},onAfterLoadData:function(){var e=this;this.hot.view?this.recalculateAllRowsHeight():setTimeout(function(){e.hot&&e.recalculateAllRowsHeight()},0)},onBeforeChange:function(e){var t=null;1===e.length?t=e[0][0]:e.length>1&&(t={from:e[0][0],to:e[e.length-1][0]}),null!==t&&this.clearCacheByRange(t)},destroy:function(){this.ghostTable.clean(),$traceurRuntime.superGet(this,k.prototype,"destroy").call(this)}},{get CALCULATION_STEP(){return 50},get SYNC_CALCULATION_LIMIT(){return 500}},f),O("autoRowSize",H)},{_base:59,"helpers/array":42,"helpers/dom/element":45,"helpers/feature":47,"helpers/number":50,"helpers/object":51,"helpers/string":53,plugins:58,"utils/ghostTable":101,"utils/samplesGenerator":103}],62:[function(e,t,o){"use strict";function n(e,t,o,n){var i,r,s,l,a,u=o.length,c=o?o[0].length:0,h=[],d=[];if(i=t.row-e.row,r=t.col-e.col,-1!==["down","up"].indexOf(n)){for(var f=0;r>=f;f++)s=parseInt(o[0][f],10),l=parseInt(o[u-1][f],10),a=("down"===n?l-s:s-l)/(u-1)||0,d.push(a);h.push(d)}if(-1!==["right","left"].indexOf(n))for(var g=0;i>=g;g++)s=parseInt(o[g][0],10),l=parseInt(o[g][c-1],10),a=("right"===n?l-s:s-l)/(c-1)||0,d=[],d.push(a),h.push(d);return h}function i(e){function t(t){return e.autofill?void(e.autofill.handle&&e.autofill.handle.isDragged&&(e.autofill.handle.isDragged>1&&e.autofill.apply(),e.autofill.handle.isDragged=0,l=!1)):!0}function o(e){var t,o;return s.instance.autofill?(t=h(s.instance.table).top-(window.pageYOffset||document.documentElement.scrollTop)+d(s.instance.table),o=h(s.instance.table).left-(window.pageXOffset||document.documentElement.scrollLeft)+f(s.instance.table),s.addingStarted===!1&&s.instance.autofill.handle.isDragged>0&&e.clientY>t&&e.clientX<=o?(s.instance.mouseDragOutside=!0,s.addingStarted=!0):s.instance.mouseDragOutside=!1,void(s.instance.mouseDragOutside&&m("autoInsertRow")&&setTimeout(function(){s.addingStarted=!1,s.instance.alter("insert_row")},200))):!1}var n,i,r,s=this,l=!1;this.instance=e,this.addingStarted=!1,r=g(e),r.addEventListener(document,"mouseup",t),r.addEventListener(document,"mousemove",o),n=this.instance.view.wt.wtSettings.settings.onCellCornerMouseDown,this.instance.view.wt.wtSettings.settings.onCellCornerMouseDown=function(t){e.autofill.handle.isDragged=1,l=!0,n(t)},i=this.instance.view.wt.wtSettings.settings.onCellMouseOver,this.instance.view.wt.wtSettings.settings.onCellMouseOver=function(t,o,n,r){e.autofill&&l&&!e.view.isMouseDown()&&e.autofill.handle&&e.autofill.handle.isDragged&&(e.autofill.handle.isDragged++,e.autofill.showBorder(o),e.autofill.checkIfNewRowNeeded()),i(t,o,n,r)},this.instance.view.wt.wtSettings.settings.onCellCornerDblClick=function(){e.autofill.selectAdjacent()}}function r(e){return function(t){var o;return"direction"===t?o="string"==typeof e?e:"object"==typeof e&&void 0!==e[t]?e[t]:!0:"autoInsertRow"===t?o="object"==typeof e&&void 0!==e[t]?e[t]:!0:"fillHandle"===t&&(o=!!e),o}}Object.defineProperties(o,{Autofill:{get:function(){return i}},__esModule:{value:!0}});var s,l,a,u,c=(s=e("helpers/dom/element"),s&&s.__esModule&&s||{"default":s}),h=c.offset,d=c.outerHeight,f=c.outerWidth,g=(l=e("eventManager"),l&&l.__esModule&&l||{"default":l}).eventManager,p=((a=e("plugins"),a&&a.__esModule&&a||{"default":a}).registerPlugin,(u=e("3rdparty/walkontable/src/cell/coords"),u&&u.__esModule&&u||{"default":u}).WalkontableCellCoords);i.prototype.init=function(){this.handle={}},i.prototype.disable=function(){this.handle.disabled=!0},i.prototype.selectAdjacent=function(){var e,t,o,n,i;e=this.instance.selection.isMultiple()?this.instance.view.wt.selections.area.getCorners():this.instance.view.wt.selections.current.getCorners(),t=this.instance.getData();e:for(o=e[2]+1;ot[3]?(s="right",o=new p(e[0],t[3]+1),i=new p(e[2],e[3])):e[0]t[2]&&e[1]===t[1]&&(s="down",o=new p(t[2]+1,e[1]),i=new p(e[2],e[3])),o&&o.row>-1&&o.col>-1?(a={from:this.instance.getSelectedRange().from,to:this.instance.getSelectedRange().to},r=this.instance.getData(a.from.row,a.from.col,a.to.row,a.to.col),l=n(o,i,r,s),Handsontable.hooks.run(this.instance,"beforeAutofill",o,i,r),this.instance.populateFromArray(o.row,o.col,r,i.row,i.col,"autofill",null,s,l),this.instance.selection.setRangeStart(new p(e[0],e[1])),this.instance.selection.setRangeEnd(new p(e[2],e[3]))):this.instance.selection.refreshBorders())},i.prototype.showBorder=function(e){var t=this.instance.getSelectedRange().getTopLeftCorner(),o=this.instance.getSelectedRange().getBottomRightCorner();if("horizontal"!==m("direction")&&(o.rowe.row))e=new p(e.row,o.col);else{if("vertical"===m("direction"))return;e=new p(o.row,e.col)}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(e),this.instance.view.render()},i.prototype.checkIfNewRowNeeded=function(){var e,t,o=this.instance.countRows(),n=this;this.instance.view.wt.selections.fill.cellRange&&this.addingStarted===!1&&m("autoInsertRow")&&(t=this.instance.getSelected(),e=this.instance.view.wt.selections.fill.getCorners(),t[2]o[1]?e?1:-1:0}},dateSort:function(e){return function(t,o){if(t[1]===o[1])return 0;if(null===t[1]||""===t[1])return 1;if(null===o[1]||""===o[1])return-1;var n=new Date(t[1]),i=new Date(o[1]);return i>n?e?-1:1:n>i?e?1:-1:0}},numericSort:function(e){return function(t,o){var n=parseFloat(t[1]),i=parseFloat(o[1]);return n===i||isNaN(n)&&isNaN(i)?0:isNaN(n)?1:isNaN(i)?-1:i>n?e?-1:1:n>i?e?1:-1:0}},sort:function(){if("undefined"==typeof this.hot.sortOrder)return void(this.hot.sortIndex.length=0);var e,t;this.hot.sortingEnabled=!1,this.hot.sortIndex.length=0;for(var o=0,n=this.hot.countRows()-this.hot.getSettings().minSpareRows;n>o;o++)this.hot.sortIndex.push([o,this.hot.getDataAtCell(o,this.hot.sortColumn)]);if(e=this.hot.getCellMeta(0,this.hot.sortColumn),e.sortFunction)t=e.sortFunction;else switch(e.type){case"date":t=this.dateSort;break;case"numeric":t=this.numericSort;break;default:t=this.defaultSort}this.hot.sortIndex.sort(t(this.hot.sortOrder));for(var i=this.hot.sortIndex.length;i=0&&-1===i&&u(o,"columnSorting"),f(o,"descending"),f(o,"ascending"),this.sortIndicators[e]&&e===this.hot.sortColumn&&("ascending"===this.sortOrderClass?u(o,"ascending"):"descending"===this.sortOrderClass&&u(o,"descending")))},isSorted:function(){return"undefined"!=typeof this.hot.sortColumn},afterCreateRow:function(e,t){if(this.isSorted()){for(var o=0;o=e&&(this.hot.sortIndex[o][0]+=t);for(var o=0;t>o;o++)this.hot.sortIndex.splice(e+o,0,[e+o,this.hot.getSourceData()[e+o][this.hot.sortColumn+this.hot.colOffset()]]);this.saveSortingState()}},afterRemoveRow:function(e,t){function o(e){return m(n,function(t,o){return e>o&&t++,t},0)}if(this.isSorted()){var n=this.hot.sortIndex.splice(e,t);n=p(n,function(e){return e[0]}),this.hot.sortIndex=p(this.hot.sortIndex,function(e,t){var n=o(e[0]);return n&&(e[0]-=n),e}),this.saveSortingState()}}},{},v),b("columnSorting",C)},{_base:59,eventManager:41,"helpers/array":42,"helpers/dom/element":45,plugins:58}],64:[function(e,t,o){"use strict";Object.defineProperties(o,{CommentEditor:{get:function(){return r}},__esModule:{value:!0}});var n,i=(n=e("helpers/dom/element"),n&&n.__esModule&&n||{"default":n}).addClass,r=function(){this.editor=this.createEditor(),this.editorStyle=this.editor.style,this.editorStyle.position="absolute",this.editorStyle.zIndex=100,this.hide()},s=r;$traceurRuntime.createClass(r,{setPosition:function(e,t){this.editorStyle.left=e+"px",this.editorStyle.top=t+"px"},show:function(){this.editorStyle.display="block"},hide:function(){this.editorStyle.display="none"},isVisible:function(){return"block"===this.editorStyle.display},setValue:function(){var e=void 0!==arguments[0]?arguments[0]:"";e=e||"",this.getInputElement().value=e},getValue:function(){return this.getInputElement().value},isFocused:function(){return document.activeElement===this.getInputElement()},focus:function(){this.getInputElement().focus()},createEditor:function(){var e,t,o=document.querySelector("."+s.CLASS_EDITOR_CONTAINER);return o||(o=document.createElement("div"),i(o,s.CLASS_EDITOR_CONTAINER),document.body.appendChild(o)),e=document.createElement("div"),i(e,s.CLASS_EDITOR),t=document.createElement("textarea"),i(t,s.CLASS_INPUT),e.appendChild(t),o.appendChild(e),e},getInputElement:function(){return this.editor.querySelector("."+s.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}],65:[function(e,t,o){"use strict";Object.defineProperties(o,{Comments:{get:function(){return R}},__esModule:{value:!0}});var n,i,r,s,l,a,u=(n=e("helpers/dom/element"),n&&n.__esModule&&n||{"default":n}),c=u.addClass,h=u.closest,d=u.getWindowScrollLeft,f=u.getWindowScrollTop,g=u.hasClass,p=u.offset,m=(i=e("eventManager"),i&&i.__esModule&&i||{"default":i}).EventManager,w=(r=e("3rdparty/walkontable/src/cell/coords"),r&&r.__esModule&&r||{"default":r}).WalkontableCellCoords,v=(s=e("plugins"),s&&s.__esModule&&s||{"default":s}),b=v.registerPlugin,C=(v.getPlugin,(l=e("_base"),l&&l.__esModule&&l||{"default":l})["default"]),y=(a=e("commentEditor"),a&&a.__esModule&&a||{"default":a}).CommentEditor,R=function(e){ +$traceurRuntime.superConstructor(E).call(this,e),this.editor=null,this.eventManager=null,this.range={},this.mouseDown=!1,this.contextMenuEvent=!1,this.timer=null},E=R;$traceurRuntime.createClass(R,{isEnabled:function(){return this.hot.getSettings().comments},enablePlugin:function(){var e=this;this.enabled||(this.editor||(this.editor=new y),this.eventManager||(this.eventManager=new m(this)),this.addHook("afterContextMenuDefaultOptions",function(t){return e.addToContextMenu(t)}),this.addHook("afterRenderer",function(t,o,n,i,r,s){return e.onAfterRenderer(t,s)}),this.addHook("afterScrollHorizontally",function(){return e.refreshEditorPosition()}),this.addHook("afterScrollVertically",function(){return e.refreshEditorPosition()}),this.addHook("afterColumnResize",function(){return e.refreshEditorPosition()}),this.addHook("afterRowResize",function(){return e.refreshEditorPosition()}),this.registerListeners(),$traceurRuntime.superGet(this,E.prototype,"enablePlugin").call(this))},disablePlugin:function(){$traceurRuntime.superGet(this,E.prototype,"disablePlugin").call(this)},registerListeners:function(){var e=this;this.eventManager.addEventListener(document,"mouseover",function(t){return e.onMouseOver(t)}),this.eventManager.addEventListener(document,"mousedown",function(t){return e.onMouseDown(t)}),this.eventManager.addEventListener(document,"mousemove",function(t){return e.onMouseMove(t)}),this.eventManager.addEventListener(document,"mouseup",function(t){return e.onMouseUp(t)}),this.eventManager.addEventListener(this.editor.getInputElement(),"blur",function(t){return e.onEditorBlur(t)})},setRange:function(e){this.range=e},clearRange:function(){this.range={}},targetIsCellWithComment:function(e){return!(!g(e.target,"htCommentCell")||!h(e.target,[this.hot.rootElement]))},targetIsCommentTextArea:function(e){return this.editor.getInputElement()===e.target},saveComment:function(){if(!this.range.from)throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');var e=this.editor.getValue(),t=this.range.from.row,o=this.range.from.col;this.hot.setCellMeta(t,o,"comment",e),this.hot.render()},saveCommentAtCell:function(e,t){this.setRange({from:new w(e,t)}),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(e,t){this.setRange({from:new w(e,t)}),this.removeComment()},show:function(){if(!this.range.from)throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');var e=this.hot.getCellMeta(this.range.from.row,this.range.from.col);return this.refreshEditorPosition(!0),this.editor.setValue(e.comment||""),this.editor.show(),!0},showAtCell:function(e,t){return this.setRange({from:new w(e,t)}),this.show()},hide:function(){this.editor.hide()},refreshEditorPosition:function(){var e=void 0!==arguments[0]?arguments[0]:!1;if(e||this.range.from&&this.editor.isVisible()){var t=this.hot.view.wt.wtTable.getCell(this.range.from),o=p(t),n=this.hot.getColWidth(this.range.from.col),i=o.top,r=o.left,s=0,l=0;this.hot.view.wt.wtViewport.hasVerticalScroll()&&(i-=this.hot.view.wt.wtOverlays.topOverlay.getScrollPosition(),s=20),this.hot.view.wt.wtViewport.hasHorizontalScroll()&&(r-=this.hot.view.wt.wtOverlays.leftOverlay.getScrollPosition(),l=20);var a=r+n,u=i,c=this.hot.view.wt.wtTable.holder.getBoundingClientRect(),h={left:c.left+d()+l,right:c.right+d()-15,top:c.top+f()+s,bottom:c.bottom+f()};a<=h.left||a>h.right||u<=h.top||u>h.bottom?this.hide():this.editor.setPosition(a,u)}},onMouseDown:function(e){this.mouseDown=!0,this.hot.view&&this.hot.view.wt&&(this.contextMenuEvent||this.targetIsCommentTextArea(e)||this.targetIsCellWithComment(e)||this.hide(),this.contextMenuEvent=!1)},onMouseOver:function(e){if(!this.mouseDown&&!this.editor.isFocused())if(this.targetIsCellWithComment(e)){var t=this.hot.view.wt.wtTable.getCoords(e.target),o={from:new w(t.row,t.col)};this.setRange(o),this.show()}else this.targetIsCommentTextArea(e)||this.editor.isFocused()||this.hide()},onMouseMove:function(e){var t=this;this.targetIsCommentTextArea(e)&&(this.mouseDown=!0,clearTimeout(this.timer),this.timer=setTimeout(function(){t.mouseDown=!1},200))},onMouseUp:function(e){this.mouseDown=!1},onAfterRenderer:function(e,t){t.comment&&c(e,t.commentedCellClassName)},onEditorBlur:function(e){this.saveComment()},checkSelectionCommentsConsistency:function(){var e=this.hot.getSelectedRange();if(!e)return!1;var t=!1,o=e.from;return this.hot.getCellMeta(o.row,o.col).comment&&(t=!0),t},onContextMenuAddComment:function(){var e=this,t=this.hot.getSelectedRange();this.contextMenuEvent=!0,this.setRange({from:t.from}),this.show(),setTimeout(function(){e.hot&&(e.hot.deselectCell(),e.editor.focus())},10)},onContextMenuRemoveComment:function(e,t){this.contextMenuEvent=!0,this.removeCommentAtCell(t.start.row,t.start.col)},addToContextMenu:function(e){var t=this;e.items.push(Handsontable.plugins.ContextMenu.SEPARATOR,{key:"commentsAddEdit",name:function(){return t.checkSelectionCommentsConsistency()?"Edit Comment":"Add Comment"},callback:function(){return t.onContextMenuAddComment()},disabled:function(){return!this.getSelected()}},{key:"commentsRemove",name:function(){return"Delete Comment"},callback:function(e,o){return t.onContextMenuRemoveComment(e,o)},disabled:function(){return!t.checkSelectionCommentsConsistency()}})},destroy:function(){this.editor&&this.editor.destroy(),$traceurRuntime.superGet(this,E.prototype,"destroy").call(this)}},{},C),b("comments",R)},{"3rdparty/walkontable/src/cell/coords":5,_base:59,commentEditor:64,eventManager:41,"helpers/dom/element":45,plugins:58}],66:[function(e,t,o){"use strict";function n(e,t){var o;return r(t,function(t){var n=t.key?t.key.split(":"):null;return Array.isArray(n)&&n[1]===e?(o=t,!1):void 0}),o}Object.defineProperties(o,{CommandExecutor:{get:function(){return s}},__esModule:{value:!0}});var i,r=(i=e("helpers/array"),i&&i.__esModule&&i||{"default":i}).arrayEach,s=function(e){this.hot=e,this.commands={},this.commonCallback=null};$traceurRuntime.createClass(s,{registerCommand:function(e,t){this.commands[e]=t},setCommonCallback:function(e){this.commonCallback=e},execute:function(e){for(var t=[],o=1;o0;if(s)return}}else if(!(t(r)||v(r,"current")&&v(r,"wtBorder")))return;this.open(e)},onMenuAfterOpen:function(){this.hot.runHooks("afterContextMenuShow",this)},onMenuAfterClose:function(){this.hot.listen(),this.hot.runHooks("afterContextMenuHide",this)},destroy:function(){this.close(),this.menu&&this.menu.destroy(),$traceurRuntime.superGet(this,z.prototype,"destroy").call(this)}},{get DEFAULT_ITEMS(){return[A,P,V,x,D,V,N,L,V,W,I,V,j,V,B]}},g),F.SEPARATOR={name:V},Handsontable.hooks.register("afterContextMenuDefaultOptions"),Handsontable.hooks.register("afterContextMenuShow"),Handsontable.hooks.register("afterContextMenuHide"),Handsontable.hooks.register("afterContextMenuExecute"),R("contextMenu",F)},{_base:59,commandExecutor:66,eventManager:41,"helpers/array":42,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/object":51,itemsFactory:69,menu:70,plugins:58,predefinedItems:71}],68:[function(e,t,o){"use strict";Object.defineProperties(o,{Cursor:{get:function(){return h}},__esModule:{value:!0}});var n,i,r=(n=e("helpers/dom/element"),n&&n.__esModule&&n||{"default":n}),s=r.getWindowScrollLeft,l=r.getWindowScrollTop,a=(i=e("helpers/dom/event"),i&&i.__esModule&&i||{"default":i}),u=a.pageX,c=a.pageY,h=function(e){var t,o,n,i,r,a,h=l(),d=s();this.type=this.getSourceType(e),"literal"===this.type?(t=parseInt(e.top,10),n=parseInt(e.left,10),r=e.height||0,a=e.width||0,o=t,i=n,t+=h,n+=d):"event"===this.type&&(t=parseInt(c(e),10),n=parseInt(u(e),10),r=e.target.clientHeight,a=e.target.clientWidth,o=t-h,i=n-d),this.top=t,this.topRelative=o,this.left=n,this.leftRelative=i,this.scrollTop=h,this.scrollLeft=d,this.cellHeight=r,this.cellWidth=a};$traceurRuntime.createClass(h,{getSourceType:function(e){var t="literal";return e instanceof Event&&(t="event"),t},fitsAbove:function(e){return this.topRelative>=e.offsetHeight},fitsBelow:function(e){var t=void 0!==arguments[1]?arguments[1]:window.innerHeight;return this.topRelative+e.offsetHeight<=t},fitsOnRight:function(e){var t=void 0!==arguments[1]?arguments[1]:window.innerWidth;return this.leftRelative+this.cellWidth+e.offsetWidth<=t},fitsOnLeft:function(e){return this.leftRelative>=e.offsetWidth}},{}),Handsontable.plugins.utils=Handsontable.plugins.utils||{},Handsontable.plugins.utils.Cursor=h},{"helpers/dom/element":45,"helpers/dom/event":46}],69:[function(e,t,o){"use strict";function n(){var e=void 0!==arguments[0]?arguments[0]:null,t=void 0!==arguments[1]?arguments[1]:[],o=void 0!==arguments[2]?arguments[2]:{},n=[];return e&&e.items?e=e.items:Array.isArray(e)||(e=t),u(e)?a(e,function(e,t){var i=o["string"==typeof e?e:t];i||(i=e),u(e)?c(i,e):"string"==typeof i&&(i={name:i}),void 0===i.key&&(i.key=t),n.push(i)}):h(e,function(e,t){var i=o[e];!i&&g.indexOf(e)>=0||(i||(i={name:e,key:t+""}),u(e)&&c(i,e),void 0===i.key&&(i.key=t),n.push(i))}),n[0].name===f&&n.shift(),n}Object.defineProperties(o,{ItemsFactory:{get:function(){return m}},__esModule:{value:!0}});var i,r,s,l=(i=e("helpers/object"),i&&i.__esModule&&i||{"default":i}),a=l.objectEach,u=l.isObject,c=l.extend,h=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}).arrayEach,d=(s=e("predefinedItems"),s&&s.__esModule&&s||{"default":s}),f=d.SEPARATOR,g=d.ITEMS,p=d.predefinedItems,m=function(e){var t=void 0!==arguments[1]?arguments[1]:null;this.hot=e,this.predefinedItems=p(),this.defaultOrderPattern=t};$traceurRuntime.createClass(m,{setPredefinedItems:function(e){var t=this,o={};this.defaultOrderPattern.length=0,a(e,function(e,n){var i="";e.name===f?(o[f]=e,i=f):isNaN(parseInt(n,10))?(e.key=void 0===e.key?n:e.key,o[n]=e,i=e.key):(o[e.key]=e,i=e.key),t.defaultOrderPattern.push(i)}),this.predefinedItems=o},getVisibleItems:function(){var e=void 0!==arguments[0]?arguments[0]:null,t=this,o={};return a(this.predefinedItems,function(e,n){(!e.hidden||e.hidden&&!e.hidden.apply(t.hot))&&(o[n]=e)}),n(e,this.defaultOrderPattern,o)},getItems:function(){var e=void 0!==arguments[0]?arguments[0]:null;return n(e,this.defaultOrderPattern,this.predefinedItems)}},{})},{"helpers/array":42,"helpers/object":51,predefinedItems:71}],70:[function(e,t,o){"use strict";Object.defineProperties(o,{Menu:{get:function(){return V}},__esModule:{value:!0}});var n,i,r,s,l,a,u,c,h,d,f,g=(n=e("helpers/dom/element"),n&&n.__esModule&&n||{"default":n}),p=g.addClass,m=g.empty,w=g.fastInnerHTML,v=(g.getComputedStyle,g.getScrollbarWidth),b=(g.getWindowScrollLeft,g.getWindowScrollTop,g.hasClass,g.isChildOf),C=g.removeClass,y=(i=e("helpers/array"),i&&i.__esModule&&i||{"default":i}),R=y.arrayEach,E=y.arrayReduce,S=(r=e("cursor"),r&&r.__esModule&&r||{"default":r}).Cursor,T=(s=e("eventManager"),s&&s.__esModule&&s||{"default":s}).EventManager,O=(l=e("helpers/object"),l&&l.__esModule&&l||{"default":l}),_=(O.extend,O.isObject,O.objectEach,O.mixin),M=(a=e("helpers/function"),a&&a.__esModule&&a||{"default":a}).debounce,H=(u=e("utils"),u&&u.__esModule&&u||{"default":u}),k=H.isSeparator,A=H.isDisabled,P=H.isSelectionDisabled,x=H.hasSubMenu,D=H.normalizeSelection,N=(c=e("helpers/unicode"),c&&c.__esModule&&c||{"default":c}).KEY_CODES,L=(h=e("mixins/localHooks"),h&&h.__esModule&&h||{"default":h}).localHooks,W=(d=e("predefinedItems"),d&&d.__esModule&&d||{"default":d}),I=W.SEPARATOR,j=(W.predefinedItems,f=e("helpers/dom/event"),f&&f.__esModule&&f||{"default":f}),B=(j.stopPropagation,j.stopImmediatePropagation),V=(j.pageX,j.pageY,function(e,t){this.hot=e,this.options=t||{parent:null,name:null,className:"",keepInViewport:!0,standalone:!1},this.eventManager=new T(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()}),F=V;$traceurRuntime.createClass(V,{registerEvents:function(){var e=this;this.eventManager.addEventListener(document.documentElement,"mousedown",function(t){return e.onDocumentMouseDown(t)})},setMenuItems:function(e){this.menuItems=e},setOffset:function(e){var t=void 0!==arguments[1]?arguments[1]:0;this.offset[e]=t},isSubMenu:function(){return null!==this.parentMenu},open:function(){var e=this;this.container.removeAttribute("style"),this.container.style.display="block";var t=M(function(t){return e.openSubMenu(t)},300),o={data:this.menuItems,colHeaders:!1,colWidths:[200],autoRowSize:!1,readOnly:!0,copyPaste:!1,columns:[{data:"name",renderer:function(t,o,n,i,r,s){return e.menuItemRenderer(t,o,n,i,r,s)}}],renderAllRows:!0,fragmentSelection:"cell",disableVisualSelection:"area",beforeKeyDown:function(t){return e.onBeforeKeyDown(t)},afterOnCellMouseOver:function(o,n,i){e.isAllSubMenusClosed()?t(n.row):e.openSubMenu(n.row)}};this.origOutsideClickDeselects=this.hot.getSettings().outsideClickDeselects,this.hot.getSettings().outsideClickDeselects=!1,this.hotMenu=new Handsontable.Core(this.container,o),this.hotMenu.addHook("afterInit",function(){return e.onAfterInit()}),this.hotMenu.init(),this.hotMenu.listen(),this.blockMainTableCallbacks(),this.runLocalHooks("afterOpen")},close:function(){var e=void 0!==arguments[0]?arguments[0]:!1;this.isOpened()&&(e&&this.parentMenu?this.parentMenu.close():(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(e){if(!this.hotMenu)return!1;var t=this.hotMenu.getCell(e,0);if(this.closeAllSubMenus(),!t||!x(t))return!1;var o=this.hotMenu.getSourceDataAtRow(e),n=new F(this.hot,{parent:this,name:o.name,className:this.options.className,keepInViewport:!0});return n.setMenuItems(o.submenu.items),n.open(),n.setPosition(t.getBoundingClientRect()),this.hotSubMenus[o.key]=n,n},closeSubMenu:function(e){var t=this.hotMenu.getSourceDataAtRow(e),o=this.hotSubMenus[t.key];o&&(o.destroy(),delete this.hotSubMenus[t.key])},closeAllSubMenus:function(){var e=this;R(this.hotMenu.getData(),function(t,o){return e.closeSubMenu(o)})},isAllSubMenusClosed:function(){return 0===Object.keys(this.hotSubMenus).length},destroy:function(){this.clearLocalHooks(),this.close(),this.parentMenu=null,this.eventManager.destroy()},isOpened:function(){return null!==this.hotMenu},executeCommand:function(e){if(this.isOpened()&&this.hotMenu.getSelected()){var t=this.hotMenu.getSourceDataAtRow(this.hotMenu.getSelected()[0]);if(this.runLocalHooks("select",t,e),t.isCommand!==!1&&t.name!==I){var o=this.hot.getSelectedRange(),n=o?D(o):{};this.runLocalHooks("executeCommand",t.key,n,e),this.isSubMenu()&&this.parentMenu.runLocalHooks("executeCommand",t.key,n,e),t.disabled===!0||"function"==typeof t.disabled&&t.disabled.call(this.hot)===!0||t.submenu||this.close(!0)}}},setPosition:function(e){var t=new S(e);this.options.keepInViewport?(t.fitsBelow(this.container)?this.setPositionBelowCursor(t):t.fitsAbove(this.container)?this.setPositionAboveCursor(t):this.setPositionBelowCursor(t),t.fitsOnRight(this.container)?this.setPositionOnRightOfCursor(t):this.setPositionOnLeftOfCursor(t)):(this.setPositionBelowCursor(t),this.setPositionOnRightOfCursor(t))},setPositionAboveCursor:function(e){var t=this.offset.above+e.top-this.container.offsetHeight;this.isSubMenu()&&(t=e.top+e.cellHeight-this.container.offsetHeight+3),this.container.style.top=t+"px"},setPositionBelowCursor:function(e){var t=this.offset.below+e.top;this.isSubMenu()&&(t=e.top-1),this.container.style.top=t+"px"},setPositionOnRightOfCursor:function(e){var t;t=this.isSubMenu()?1+e.left+e.cellWidth:this.offset.right+1+e.left,this.container.style.left=t+"px"},setPositionOnLeftOfCursor:function(e){var t=this.offset.left+e.left-this.container.offsetWidth+v()+4;this.container.style.left=t+"px"},selectFirstCell:function(){var e=this.hotMenu.getCell(0,0);k(e)||A(e)||P(e)?this.selectNextCell(0,0):this.hotMenu.selectCell(0,0)},selectLastCell:function(){var e=this.hotMenu.countRows()-1,t=this.hotMenu.getCell(e,0);k(t)||A(t)||P(t)?this.selectPrevCell(e,0):this.hotMenu.selectCell(e,0)},selectNextCell:function(e,t){var o=e+1,n=o=0?this.hotMenu.getCell(o,t):null;n&&(k(n)||A(n)||P(n)?this.selectPrevCell(o,t):this.hotMenu.selectCell(o,t))},menuItemRenderer:function(e,t,o,n,i,r){var s=this,l=e.getSourceDataAtRow(o),a=document.createElement("div"),u=function(e){return e.hasOwnProperty("submenu")},c=function(e){return new RegExp(I,"i").test(e.name)},h=function(e){return e.disabled===!0||"function"==typeof e.disabled&&e.disabled.call(s.hot)===!0},d=function(e){return"function"==typeof e.hidden&&e.hidden.call(s.hot)===!0},f=function(e){return e.disableSelection},g=d(l);"function"==typeof r&&(r=r.call(this.hot)),m(t),p(a,"htItemWrapper"),t.appendChild(a),c(l)?p(t,"htSeparator"):g||"function"!=typeof l.renderer?w(a,r):(p(t,"htCustomMenuRenderer"),t.appendChild(l.renderer(e,a,o,n,i,r))),g?t.parentNode&&p(t.parentNode,"htHidden"):h(l)?(p(t,"htDisabled"),this.eventManager.addEventListener(t,"mouseenter",function(){return e.deselectCell()})):f(l)?(p(t,"htSelectionDisabled"),this.eventManager.addEventListener(t,"mouseenter",function(){return e.deselectCell()})):u(l)?(p(t,"htSubmenu"),f(l)?this.eventManager.addEventListener(t,"mouseenter",function(){return e.deselectCell()}):this.eventManager.addEventListener(t,"mouseenter",function(){return e.selectCell(o,n,void 0,void 0,void 0,!1)})):(C(t,"htSubmenu"),C(t,"htDisabled"),f(l)?this.eventManager.addEventListener(t,"mouseenter",function(){return e.deselectCell()}):this.eventManager.addEventListener(t,"mouseenter",function(){return e.selectCell(o,n,void 0,void 0,void 0,!1)}))},createContainer:function(){var e=void 0!==arguments[0]?arguments[0]:null;e&&(e=e.replace(/ /g,"_"),e=this.options.className+"Sub_"+e);var t;return t=e?document.querySelector("."+this.options.className+"."+e):document.querySelector("."+this.options.className),t||(t=document.createElement("div"),p(t,"htMenu "+this.options.className),e&&p(t,e),document.getElementsByTagName("body")[0].appendChild(t)),t},blockMainTableCallbacks:function(){this._afterScrollCallback=function(){},this.hot.addHook("afterScrollVertically",this._afterScrollCallback),this.hot.addHook("afterScrollHorizontally",this._afterScrollCallback)},releaseMainTableCallbacks:function(){this._afterScrollCallback&&(this.hot.removeHook("afterScrollVertically",this._afterScrollCallback),this.hot.removeHook("afterScrollHorizontally",this._afterScrollCallback),this._afterScrollCallback=null)},onBeforeKeyDown:function(e){var t=this.hotMenu.getSelected(),o=!1;switch(e.keyCode){case N.ESCAPE:this.close(),o=!0;break;case N.ENTER:t&&(this.hotMenu.getSourceDataAtRow(t[0]).submenu?o=!0:(this.executeCommand(e),this.close(!0)));break;case N.ARROW_DOWN:t?this.selectNextCell(t[0],t[1]):this.selectFirstCell(),o=!0;break;case N.ARROW_UP:t?this.selectPrevCell(t[0],t[1]):this.selectLastCell(),o=!0;break;case N.ARROW_RIGHT:if(t){var n=this.openSubMenu(t[0]);n&&n.selectFirstCell()}o=!0;break;case N.ARROW_LEFT:t&&this.isSubMenu()&&(this.close(),this.parentMenu&&this.parentMenu.hotMenu.listen(),o=!0)}o&&(e.preventDefault(),B(e))},onAfterInit:function(){var e=this.hotMenu.getSettings().data,t=this.hotMenu.view.wt.wtTable.hider.style,o=this.hotMenu.view.wt.wtTable.holder.style,n=parseInt(t.width,10),i=E(e,function(e,t){return e+(t.name===I?1:26)},0);o.width=n+22+"px",o.height=i+4+"px"},onDocumentMouseDown:function(e){this.isOpened()&&(this.container&&b(e.target,this.container)&&this.executeCommand(e),this.options.standalone&&this.hotMenu&&!b(e.target,this.hotMenu.rootElement)?this.close(!0):(this.isAllSubMenusClosed()||this.isSubMenu())&&!b(e.target,".htMenu")&&b(e.target,document)&&this.close(!0))}},{}),_(V,L)},{cursor:68,eventManager:41,"helpers/array":42,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/function":48,"helpers/object":51,"helpers/unicode":54,"mixins/localHooks":55,predefinedItems:71,utils:72}],71:[function(e,t,o){"use strict";function n(){var e={};return c(A,function(t,o){return e[o]=h(t)}),e}function i(e,t){-1===k.indexOf(e)&&(A[e]=t)}var r;Object.defineProperties(o,{ROW_ABOVE:{get:function(){return v}},ROW_BELOW:{get:function(){return b}},COLUMN_LEFT:{get:function(){return C}},COLUMN_RIGHT:{get:function(){return y}},CLEAR_COLUMN:{get:function(){return R}},REMOVE_ROW:{get:function(){return E}},REMOVE_COLUMN:{get:function(){return S}},UNDO:{get:function(){return T}},REDO:{get:function(){return O}},READ_ONLY:{get:function(){return _}},ALIGNMENT:{get:function(){return M}},SEPARATOR:{get:function(){return H}},ITEMS:{get:function(){return k}},predefinedItems:{get:function(){return n}},addItem:{get:function(){return i}},__esModule:{value:!0}});var s,l,a,u=(s=e("helpers/object"),s&&s.__esModule&&s||{"default":s}),c=u.objectEach,h=u.clone,d=((l=e("helpers/number"),l&&l.__esModule&&l||{"default":l}).rangeEach,a=e("utils"),a&&a.__esModule&&a||{"default":a}),f=d.align,g=d.getAlignmentClasses,p=d.getValidSelection,m=d.checkSelectionConsistency,w=d.markLabelAsSelected,v="row_above",b="row_below",C="col_left",y="col_right",R="clear_column",E="remove_row",S="remove_col",T="undo",O="redo",_="make_read_only",M="alignment",H="---------",k=[v,b,C,y,R,E,S,T,O,_,M,H],A=(r={},Object.defineProperty(r,H,{value:{name:H},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(r,v,{value:{key:v,name:"Insert row above",callback:function(e,t){this.alter("insert_row",t.start.row)},disabled:function(){var e=p(this);if(!e||this.countRows()>=this.getSettings().maxRows)return!0;var t=this.countRows(),o=[0,e[1],t-1,e[1]];return o.join(",")===e.join(",")&&t>1},hidden:function(){return!this.getSettings().allowInsertRow}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(r,b,{value:{key:b,name:"Insert row below",callback:function(e,t){this.alter("insert_row",t.end.row+1)},disabled:function(){var e=p(this);if(!e||this.countRows()>=this.getSettings().maxRows)return!0;var t=this.countRows(),o=[0,e[1],t-1,e[1]];return o.join(",")===e.join(",")&&t>1},hidden:function(){return!this.getSettings().allowInsertRow}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(r,C,{value:{key:C,name:"Insert column on the left",callback:function(e,t){this.alter("insert_col",t.start.col)},disabled:function(){var e=p(this);if(!e)return!0;if(!this.isColumnModificationAllowed())return!0;var t=[e[0],0,e[0],this.countCols()-1],o=t.join(",")==e.join(","),n=1==this.countCols();return e[1]<0||this.countCols()>=this.getSettings().maxCols||!n&&o},hidden:function(){return!this.getSettings().allowInsertColumn}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(r,y,{value:{key:y,name:"Insert column on the right",callback:function(e,t){this.alter("insert_col",t.end.col+1)},disabled:function(){var e=p(this);if(!e)return!0;if(!this.isColumnModificationAllowed())return!0;var t=[e[0],0,e[0],this.countCols()-1],o=t.join(",")==e.join(","),n=1==this.countCols();return e[1]<0||this.countCols()>=this.getSettings().maxCols||!n&&o},hidden:function(){return!this.getSettings().allowInsertColumn}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(r,R,{value:{key:R,name:"Clear column",callback:function(e,t){var o=t.start.col;this.countRows()&&this.populateFromArray(0,o,[[null]],Math.max(t.start.row,t.end.row),o)},disabled:function(){var e=p(this);if(!e)return!0;var t=[e[0],0,e[0],this.countCols()-1],o=t.join(",")==e.join(",");return e[1]<0||this.countCols()>=this.getSettings().maxCols||o}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(r,E,{value:{key:E,name:"Remove row",callback:function(e,t){var o=t.end.row-t.start.row+1;this.alter("remove_row",t.start.row,o)},disabled:function(){var e=p(this);if(!e)return!0;var t=[0,e[1],this.countRows()-1,e[1]];return t.join(",")===e.join(",")},hidden:function(){return!this.getSettings().allowRemoveRow}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(r,S,{value:{key:S,name:"Remove column",callback:function(e,t){var o=t.end.col-t.start.col+1;this.alter("remove_col",t.start.col,o)},disabled:function(){var e=p(this);if(!e)return!0;if(!this.isColumnModificationAllowed())return!0;var t=[e[0],0,e[0],this.countCols()-1],o=t.join(",")==e.join(",");return e[1]<0||o},hidden:function(){return!this.getSettings().allowRemoveColumn}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(r,T,{value:{key:T,name:"Undo",callback:function(){this.undo()},disabled:function(){return this.undoRedo&&!this.undoRedo.isUndoAvailable()}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(r,O,{value:{key:O,name:"Redo",callback:function(){this.redo()},disabled:function(){return this.undoRedo&&!this.undoRedo.isRedoAvailable()}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(r,_,{value:{key:_,name:function(){var e=this,t="Read only",o=m(this.getSelectedRange(),function(t,o){return e.getCellMeta(t,o).readOnly});return o&&(t=w(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),o=m(t,function(t,o){return e.getCellMeta(t,o).readOnly});t.forAll(function(t,n){e.getCellMeta(t,n).readOnly=!o}),this.render()},disabled:function(){return!this.getSelectedRange()}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(r,M,{value:{key:M,name:"Alignment",disabled:function(){return!this.getSelectedRange()},submenu:{items:[{key:M+":left",name:function(){var e=this,t="Left",o=m(this.getSelectedRange(),function(t,o){var n=e.getCellMeta(t,o).className;return n&&-1!==n.indexOf("htLeft")?!0:void 0});return o&&(t=w(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),o=g(t,function(t,o){return e.getCellMeta(t,o).className}),n="horizontal",i="htLeft";this.runHooks("beforeCellAlignment",o,t,n,i),f(t,n,i,function(t,o){return e.getCellMeta(t,o)}),this.render()},disabled:!1},{key:M+":center",name:function(){var e=this,t="Center",o=m(this.getSelectedRange(),function(t,o){var n=e.getCellMeta(t,o).className;return n&&-1!==n.indexOf("htCenter")?!0:void 0});return o&&(t=w(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),o=g(t,function(t,o){return e.getCellMeta(t,o).className}),n="horizontal",i="htCenter";this.runHooks("beforeCellAlignment",o,t,n,i),f(t,n,i,function(t,o){return e.getCellMeta(t,o)}),this.render()},disabled:!1},{key:M+":right",name:function(){var e=this,t="Right",o=m(this.getSelectedRange(),function(t,o){var n=e.getCellMeta(t,o).className;return n&&-1!==n.indexOf("htRight")?!0:void 0});return o&&(t=w(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),o=g(t,function(t,o){return e.getCellMeta(t,o).className}),n="horizontal",i="htRight";this.runHooks("beforeCellAlignment",o,t,n,i),f(t,n,i,function(t,o){return e.getCellMeta(t,o)}),this.render()},disabled:!1},{key:M+":justify",name:function(){var e=this,t="Justify",o=m(this.getSelectedRange(),function(t,o){var n=e.getCellMeta(t,o).className;return n&&-1!==n.indexOf("htJustify")?!0:void 0});return o&&(t=w(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),o=g(t,function(t,o){return e.getCellMeta(t,o).className}),n="horizontal",i="htJustify";this.runHooks("beforeCellAlignment",o,t,n,i),f(t,n,i,function(t,o){return e.getCellMeta(t,o)}),this.render()},disabled:!1},{name:H},{key:M+":top",name:function(){ +var e=this,t="Top",o=m(this.getSelectedRange(),function(t,o){var n=e.getCellMeta(t,o).className;return n&&-1!==n.indexOf("htTop")?!0:void 0});return o&&(t=w(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),o=g(t,function(t,o){return e.getCellMeta(t,o).className}),n="vertical",i="htTop";this.runHooks("beforeCellAlignment",o,t,n,i),f(t,n,i,function(t,o){return e.getCellMeta(t,o)}),this.render()},disabled:!1},{key:M+":middle",name:function(){var e=this,t="Middle",o=m(this.getSelectedRange(),function(t,o){var n=e.getCellMeta(t,o).className;return n&&-1!==n.indexOf("htMiddle")?!0:void 0});return o&&(t=w(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),o=g(t,function(t,o){return e.getCellMeta(t,o).className}),n="vertical",i="htMiddle";this.runHooks("beforeCellAlignment",o,t,n,i),f(t,n,i,function(t,o){return e.getCellMeta(t,o)}),this.render()},disabled:!1},{key:M+":bottom",name:function(){var e=this,t="Bottom",o=m(this.getSelectedRange(),function(t,o){var n=e.getCellMeta(t,o).className;return n&&-1!==n.indexOf("htBottom")?!0:void 0});return o&&(t=w(t)),t},callback:function(){var e=this,t=this.getSelectedRange(),o=g(t,function(t,o){return e.getCellMeta(t,o).className}),n="vertical",i="htBottom";this.runHooks("beforeCellAlignment",o,t,n,i),f(t,n,i,function(t,o){return e.getCellMeta(t,o)}),this.render()},disabled:!1}]}},configurable:!0,enumerable:!0,writable:!0}),r)},{"helpers/number":50,"helpers/object":51,utils:72}],72:[function(e,t,o){"use strict";function n(e){return{start:e.getTopLeftCorner(),end:e.getBottomRightCorner()}}function i(e){return w(e,"htSeparator")}function r(e){return w(e,"htSubmenu")}function s(e){return w(e,"htDisabled")}function l(e){return w(e,"htSelectionDisabled")}function a(e){var t=e.getSelected();return t?t[0]<0?null:t:null}function u(e,t){return-1!=e.indexOf(t)?e:(e=e.replace("htTop","").replace("htMiddle","").replace("htBottom","").replace(" ",""),e+=" "+t)}function c(e,t){return-1!=e.indexOf(t)?e:(e=e.replace("htLeft","").replace("htCenter","").replace("htRight","").replace("htJustify","").replace(" ",""),e+=" "+t)}function h(e,t){for(var o={},n=e.from.row;n<=e.to.row;n++)for(var i=e.from.col;i<=e.to.col;i++)o[n]||(o[n]=[]),o[n][i]=t(n,i);return o}function d(e,t,o,n){if(e.from.row==e.to.row&&e.from.col==e.to.col)f(e.from.row,e.from.col,t,o,n);else for(var i=e.from.row;i<=e.to.row;i++)for(var r=e.from.col;r<=e.to.col;r++)f(i,r,t,o,n)}function f(e,t,o,n,i){var r=i(e,t),s=n;r.className&&(s="vertical"===o?u(r.className,n):c(r.className,n)),r.className=s}function g(e,t){var o=!1;return e&&e.forAll(function(e,n){return t(e,n)?(o=!0,!1):void 0}),o}function p(e){return''+String.fromCharCode(10003)+""+e}Object.defineProperties(o,{normalizeSelection:{get:function(){return n}},isSeparator:{get:function(){return i}},hasSubMenu:{get:function(){return r}},isDisabled:{get:function(){return s}},isSelectionDisabled:{get:function(){return l}},getValidSelection:{get:function(){return a}},prepareVerticalAlignClass:{get:function(){return u}},prepareHorizontalAlignClass:{get:function(){return c}},getAlignmentClasses:{get:function(){return h}},align:{get:function(){return d}},checkSelectionConsistency:{get:function(){return g}},markLabelAsSelected:{get:function(){return p}},__esModule:{value:!0}});var m,w=(m=e("helpers/dom/element"),m&&m.__esModule&&m||{"default":m}).hasClass},{"helpers/dom/element":45}],73:[function(e,t,o){"use strict";Object.defineProperties(o,{ContextMenuCopyPaste:{get:function(){return p}},__esModule:{value:!0}});var n,i,r,s,l,a,u=(n=e("helpers/dom/element"),n&&n.__esModule&&n||{"default":n}).removeClass,c=(i=e("helpers/array"),i&&i.__esModule&&i||{"default":i}).arrayEach,h=(r=e("eventManager"),r&&r.__esModule&&r||{"default":r}).EventManager,d=(s=e("plugins"),s&&s.__esModule&&s||{"default":s}).registerPlugin,f=(l=e("_base"),l&&l.__esModule&&l||{"default":l})["default"],g=(a=e("zeroclipboard"),a&&a.__esModule&&a||{"default":a})["default"],p=function(e){$traceurRuntime.superConstructor(m).call(this,e),this.eventManager=new h(this),this.swfPath=null,this.outsideClickDeselectsCache=null},m=p;$traceurRuntime.createClass(p,{isEnabled:function(){return this.hot.getSettings().contextMenuCopyPaste},enablePlugin:function(){var e=this;if(!this.enabled){"object"==typeof this.hot.getSettings().contextMenuCopyPaste&&(this.swfPath=this.hot.getSettings().contextMenuCopyPaste.swfPath),"undefined"==typeof g&&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(t){"undefined"==typeof navigator.mimeTypes["application/x-shockwave-flash"]&&console.error("To be able to use the Copy/Paste feature from the context menu, your browser needs to have Flash Plugin installed.")}this.swfPath&&g.config({swfPath:this.swfPath}),this.hot.addHook("afterContextMenuShow",function(){return e.onAfterContextMenuShow()}),this.hot.addHook("afterContextMenuDefaultOptions",function(t){return e.onAfterContextMenuDefaultOptions(t)}),this.registerEvents(),$traceurRuntime.superGet(this,m.prototype,"enablePlugin").call(this)}},disablePlugin:function(){$traceurRuntime.superGet(this,m.prototype,"disablePlugin").call(this)},registerEvents:function(){var e=this;this.eventManager.addEventListener(document,"mouseenter",function(){return e.removeCurrentClass()}),this.eventManager.addEventListener(document,"mouseleave",function(){return e.removeZeroClipboardClass()})},getCopyValue:function(){return this.hot.copyPaste.setCopyableText(),this.hot.copyPaste.copyPasteInstance.elTextarea.value},onAfterContextMenuDefaultOptions:function(e){e.items.unshift({key:"copy",name:"Copy"},{key:"paste",name:"Paste",callback:function(){this.copyPaste.triggerPaste()}},Handsontable.plugins.ContextMenu.SEPARATOR)},onAfterContextMenuShow:function(){var e=this,t=this.hot.getPlugin("contextMenu"),o=t.menu.hotMenu.getSourceData();c(o,function(o,n){if("copy"===o.key){var i=new g(t.menu.hotMenu.getCell(n,0));return i.off(),i.on("copy",function(t){var o=t.clipboardData;o.setData("text/plain",e.getCopyValue()),e.hot.getSettings().outsideClickDeselects=e.outsideClickDeselectsCache}),!1}})},removeCurrentClass:function(){var e=this.hot.getPlugin("contextMenu");if(e.menu.isOpened()){var t=e.menu.hotMenu.rootElement.querySelector("td.current");t&&u(t,"current")}this.outsideClickDeselectsCache=this.hot.getSettings().outsideClickDeselects,this.hot.getSettings().outsideClickDeselects=!1},removeZeroClipboardClass:function(){var e=this.hot.getPlugin("contextMenu");if(e.menu.isOpened()){var t=e.menu.hotMenu.rootElement.querySelector("td.zeroclipboard-is-hover");t&&u(t,"zeroclipboard-is-hover")}this.hot.getSettings().outsideClickDeselects=this.outsideClickDeselectsCache}},{},f),d("contextMenuCopyPaste",p)},{_base:59,eventManager:41,"helpers/array":42,"helpers/dom/element":45,plugins:58,zeroclipboard:void 0}],74:[function(e,t,o){"use strict";function n(e){function t(){e.isListening()&&e.selection.empty()}function o(t){var o,n,i,r,s,l,a,u,c,h;if(e.isListening()&&e.selection.isSelected()){o=t,n=w.parse(o),i=e.getSelected(),r=new M(i[0],i[1]),s=new M(i[2],i[3]),l=new H(r,r,s),a=l.getTopLeftCorner(),u=l.getBottomRightCorner(),c=a,h=new M(Math.max(u.row,n.length-1+a.row),Math.max(u.col,n[0].length-1+a.col));var d=s.row-r.row>=n.length-1,f=s.col-r.col>=n[0].length-1;e.addHookOnce("afterChange",function(t,o){var n=t?t.length:0;if(n){var i={row:0,col:0},r=-1;y(t,function(e,o){var s=n>o+1?t[o+1]:null;s&&(d||(i.row=i.row+Math.max(s[0]-e[0]-1,0)),!f&&e[1]>r&&(r=e[1],i.col=i.col+Math.max(s[1]-e[1]-1,0)))}),e.selectCell(c.row,c.col,h.row+i.row,h.col+i.col)}}),e.populateFromArray(c.row,c.col,n,h.row,h.col,"paste",e.getSettings().pasteMode)}}function n(t){if(e.getSelected()&&!(e.getActiveEditor()&&e.getActiveEditor().isOpened()||T(t))){if(C(t.keyCode)){if(e.getSettings().fragmentSelection&&O())return;return i.setCopyableText(),void S(t)}var o=(t.ctrlKey||t.metaKey)&&!t.altKey;t.keyCode==b.A&&o&&e._registerTimeout(setTimeout(_(i.setCopyableText,i),0))}}var i=this;this.copyPasteInstance=m(),this.copyPasteInstance.onCut(t),this.copyPasteInstance.onPaste(o),this.onPaste=o,e.addHook("beforeKeyDown",n),this.destroy=function(){this.copyPasteInstance&&(this.copyPasteInstance.removeCallback(t),this.copyPasteInstance.removeCallback(o),this.copyPasteInstance.destroy(),this.copyPasteInstance=null),e.removeHook("beforeKeyDown",n)},e.addHook("afterDestroy",_(this.destroy,this)),this.triggerPaste=_(this.copyPasteInstance.triggerPaste,this.copyPasteInstance),this.triggerCut=_(this.copyPasteInstance.triggerCut,this.copyPasteInstance),this.setCopyableText=function(){var t=e.getSettings(),o=t.copyRowsLimit,n=t.copyColsLimit,i=e.getSelectedRange(),r=i.getTopLeftCorner(),s=i.getBottomRightCorner(),l=r.row,a=r.col,u=s.row,c=s.col,h=Math.min(u,l+o-1),d=Math.min(c,a+n-1),f=[];f.push({startRow:l,startCol:a,endRow:h,endCol:d}),f=Handsontable.hooks.run(e,"modifyCopyableRange",f);var g=this.getRangedCopyableData(f);e.copyPaste.copyPasteInstance.copyable(g),u===h&&c===d||Handsontable.hooks.run(e,"afterCopyLimit",u-l+1,c-a+1,o,n)},this.getRangedCopyableData=function(t){var o=[],n=[],i=[];return y(t,function(e){R(e.startRow,e.endRow,function(e){-1===n.indexOf(e)&&n.push(e)}),R(e.startCol,e.endCol,function(e){-1===i.indexOf(e)&&i.push(e)})}),y(n,function(t){var n=[];y(i,function(o){n.push(e.getCopyableData(t,o))}),o.push(n)}),w.stringify(o)}}function i(){var e=this,t=e.getSettings().copyPaste!==!1;t&&!e.copyPaste?e.copyPaste=new n(e):!t&&e.copyPaste&&(e.copyPaste.destroy(),e.copyPaste=null)}Object.defineProperties(o,{CopyPastePlugin:{get:function(){return n}},__esModule:{value:!0}});var r,s,l,a,u,c,h,d,f,g,p,m=(r=e("copyPaste"),r&&r.__esModule&&r||{"default":r})["default"],w=(s=e("SheetClip"),s&&s.__esModule&&s||{"default":s})["default"],v=(l=e("helpers/unicode"),l&&l.__esModule&&l||{"default":l}),b=v.KEY_CODES,C=v.isCtrlKey,y=(a=e("helpers/array"),a&&a.__esModule&&a||{"default":a}).arrayEach,R=(u=e("helpers/number"),u&&u.__esModule&&u||{"default":u}).rangeEach,E=(c=e("helpers/dom/event"),c&&c.__esModule&&c||{"default":c}),S=E.stopImmediatePropagation,T=E.isImmediatePropagationStopped,O=(h=e("helpers/dom/element"),h&&h.__esModule&&h||{"default":h}).getSelectionText,_=(d=e("helpers/function"),d&&d.__esModule&&d||{"default":d}).proxy,M=((f=e("plugins"),f&&f.__esModule&&f||{"default":f}).registerPlugin,(g=e("3rdparty/walkontable/src/cell/coords"),g&&g.__esModule&&g||{"default":g}).WalkontableCellCoords),H=(p=e("3rdparty/walkontable/src/cell/range"),p&&p.__esModule&&p||{"default":p}).WalkontableCellRange;Handsontable.hooks.add("afterInit",i),Handsontable.hooks.add("afterUpdateSettings",i),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":48,"helpers/number":50,"helpers/unicode":54,plugins:58}],75:[function(e,t,o){"use strict";function n(){}var i,r,s,l,a=((i=e("plugins"),i&&i.__esModule&&i||{"default":i}).registerPlugin,(r=e("3rdparty/walkontable/src/cell/range"),r&&r.__esModule&&r||{"default":r}).WalkontableCellRange),u=(s=e("3rdparty/walkontable/src/selection"),s&&s.__esModule&&s||{"default":s}).WalkontableSelection,c=function(e){return"boolean"==typeof e&&e===!0?!0:"object"==typeof e&&e.length>0},h=function(){c(this.getSettings().customBorders)&&(this.customBorders||(l=this,this.customBorders=new n))},d=function(e){for(var t=0;t=0?l.view.wt.selections[n]=o:l.view.wt.selections.push(o)},g=function(e,t,o){var n=C(e,t);n=y(n,o),this.setCellMeta(e,t,"borders",n),f(n)},p=function(e){for(var t=e.range,o=t.from.row;o<=t.to.row;o++)for(var n=t.from.col;n<=t.to.col;n++){var i=C(o,n),r=0;o==t.from.row&&(r++,e.hasOwnProperty("top")&&(i.top=e.top)),o==t.to.row&&(r++,e.hasOwnProperty("bottom")&&(i.bottom=e.bottom)),n==t.from.col&&(r++,e.hasOwnProperty("left")&&(i.left=e.left)),n==t.to.col&&(r++,e.hasOwnProperty("right")&&(i.right=e.right)),r>0&&(this.setCellMeta(o,n,"borders",i),f(i))}},m=function(e,t){return"border_row"+e+"col"+t},w=function(){return{width:1,color:"#000"}},v=function(){return{hide:!0}},b=function(){return{width:1,color:"#000",cornerVisible:!1}},C=function(e,t){return{className:m(e,t),border:b(),row:e,col:t,top:v(),right:v(),bottom:v(),left:v()}},y=function(e,t){return t.hasOwnProperty("border")&&(e.border=t.border),t.hasOwnProperty("top")&&(e.top=t.top),t.hasOwnProperty("right")&&(e.right=t.right),t.hasOwnProperty("bottom")&&(e.bottom=t.bottom),t.hasOwnProperty("left")&&(e.left=t.left),e},R=function(e){for(var t=document.querySelectorAll("."+e),o=0;o'+String.fromCharCode(10003)+""+e},M=function(e){this.getSettings().customBorders&&(e.items.push(Handsontable.plugins.ContextMenu.SEPARATOR),e.items.push({key:"borders",name:"Borders",submenu:{items:[{key:"borders:top",name:function(){var e="Top",t=O(this,"top");return t&&(e=_(e)),e},callback:function(){var e=O(this,"top");T.call(this,this.getSelectedRange(),"top",e)},disabled:!1},{key:"borders:right",name:function(){var e="Right",t=O(this,"right");return t&&(e=_(e)),e},callback:function(){var e=O(this,"right");T.call(this,this.getSelectedRange(),"right",e)},disabled:!1},{key:"borders:bottom",name:function(){var e="Bottom",t=O(this,"bottom");return t&&(e=_(e)),e},callback:function(){var e=O(this,"bottom");T.call(this,this.getSelectedRange(),"bottom",e)},disabled:!1},{key:"borders:left",name:function(){var e="Left",t=O(this,"left");return t&&(e=_(e)),e},callback:function(){var e=O(this,"left");T.call(this,this.getSelectedRange(),"left",e)},disabled:!1},{key:"borders:no_borders",name:"Remove border(s)",callback:function(){T.call(this,this.getSelectedRange(),"noBorders")},disabled:function(){return!O(this)}}]}}))};Handsontable.hooks.add("beforeInit",h),Handsontable.hooks.add("afterContextMenuDefaultOptions",M),Handsontable.hooks.add("afterInit",function(){var e=this.getSettings().customBorders;if(e){for(var t=0;tthis.boundaries.bottom&&(n=t-this.boundaries.bottom),ethis.boundaries.right&&(o=e-this.boundaries.right),this.callback(o,n)};var l,a=function(e){e.dragToScrollListening=!1;var t=e.view.wt.wtTable.holder;l=new n,t!==window&&(l.setBoundaries(t.getBoundingClientRect()),l.setCallback(function(e,o){0>e?t.scrollLeft-=50:e>0&&(t.scrollLeft+=50),0>o?t.scrollTop-=20:o>0&&(t.scrollTop+=20)}),e.dragToScrollListening=!0)};Handsontable.hooks.add("afterInit",function(){var e=this,t=s(this);t.addEventListener(document,"mouseup",function(){e.dragToScrollListening=!1}),t.addEventListener(document,"mousemove",function(t){e.dragToScrollListening&&l.check(t.clientX,t.clientY)})}),Handsontable.hooks.add("afterDestroy",function(){s(this).clear()}),Handsontable.hooks.add("afterOnCellMouseDown",function(){a(this)}),Handsontable.hooks.add("afterOnCellCornerMouseDown",function(){a(this)}),Handsontable.plugins.DragToScroll=n},{eventManager:41,plugins:58}],77:[function(e,t,o){"use strict";Object.defineProperties(o,{ManualColumnFreeze:{get:function(){return l}},__esModule:{value:!0}});var n,i,r=(n=e("_base"),n&&n.__esModule&&n||{"default":n})["default"],s=(i=e("plugins"),i&&i.__esModule&&i||{"default":i}).registerPlugin,l=function(e){$traceurRuntime.superConstructor(a).call(this,e),this.manualColumnMovePlugin=null,this.frozenColumnsBasePositions=[]},a=l;$traceurRuntime.createClass(l,{isEnabled:function(){return!!this.hot.getSettings().manualColumnFreeze},enablePlugin:function(){var e=this;this.enabled||(this.addHook("modifyCol",function(t){return e.onModifyCol(t)}),this.addHook("afterContextMenuDefaultOptions",function(t){return e.addContextMenuEntry(t)}),$traceurRuntime.superGet(this,a.prototype,"enablePlugin").call(this))},init:function(){$traceurRuntime.superGet(this,a.prototype,"init").call(this),this.fixedColumnsCount=this.hot.getSettings().fixedColumnsLeft},getManualColumnMovePlugin:function(){return this.manualColumnMovePlugin||(this.manualColumnMovePlugin=this.hot.getPlugin("manualColumnMove")),this.manualColumnMovePlugin},onModifyCol:function(e){return this.getManualColumnMovePlugin().isEnabled()?e:this.getLogicalColumnIndex(e)},addContextMenuEntry:function(e){var t=this;e.items.push(Handsontable.plugins.ContextMenu.SEPARATOR,{key:"freeze_column",name:function(){var e=t.hot.getSelected()[1];return e>t.fixedColumnsCount-1?"Freeze this column":"Unfreeze this column"},disabled:function(){var e=t.hot.getSelected();return e[1]!==e[3]},callback:function(){var e=t.hot.getSelected()[1];e>t.fixedColumnsCount-1?t.freezeColumn(e):t.unfreezeColumn(e)}})},freezeColumn:function(e){e<=this.fixedColumnsCount-1||(e!==this.getLogicalColumnIndex(e)&&(this.frozenColumnsBasePositions[this.fixedColumnsCount]=e),this.changeColumnPositions(e,this.fixedColumnsCount),this.addFixedColumn(),this.hot.view.wt.wtOverlays.leftOverlay.refresh(),this.hot.view.wt.wtOverlays.adjustElementsSize())},unfreezeColumn:function(e){if(!(e>this.fixedColumnsCount-1)){var t=this.getBestColumnReturnPosition(e);this.changeColumnPositions(e,t),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--},getBestColumnReturnPosition:function(e){var t,o=this.fixedColumnsCount,n=this.getLogicalColumnIndex(o);if(null==this.frozenColumnsBasePositions[e])for(t=this.getLogicalColumnIndex(e);t>n;)o++,n=this.getLogicalColumnIndex(o);else{for(t=this.frozenColumnsBasePositions[e],this.frozenColumnsBasePositions[e]=void 0;t>=n;)o++,n=this.getLogicalColumnIndex(o);o=n}return o-1},getVisibleColumnIndex:function(e){return this.getManualColumnMovePlugin().getVisibleColumnIndex(e)},getLogicalColumnIndex:function(e){return this.getManualColumnMovePlugin().getLogicalColumnIndex(e)},changeColumnPositions:function(e,t){this.getManualColumnMovePlugin().changeColumnPositions(e,t)}},{},r),s("manualColumnFreeze",l)},{_base:59,plugins:58}],78:[function(e,t,o){"use strict";Object.defineProperties(o,{ManualColumnMove:{get:function(){return S}},__esModule:{value:!0}});var n,i,r,s,l,a,u,c=(n=e("_base.js"),n&&n.__esModule&&n||{"default":n})["default"],h=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),d=h.addClass,f=h.hasClass,g=h.removeClass,p=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}),m=p.arrayEach,w=p.arrayMap,v=(s=e("helpers/number"),s&&s.__esModule&&s||{"default":s}).rangeEach,b=(l=e("eventManager"),l&&l.__esModule&&l||{"default":l}).eventManager,C=(a=e("helpers/dom/event"),a&&a.__esModule&&a||{"default":a}),y=C.pageX,R=(C.pageY,(u=e("plugins"),u&&u.__esModule&&u||{"default":u}).registerPlugin),E=new WeakMap,S=function(e){var t=this;$traceurRuntime.superConstructor(T).call(this,e),E.set(this,{guideClassName:"manualColumnMoverGuide",handleClassName:"manualColumnMover",startOffset:null,pressed:null,startCol:null,endCol:null,currentCol:null,startX:null,startY:null}),this.guideElement=null,this.handleElement=null,this.currentTH=null,this.columnPositions=[],this.eventManager=b(this),this.addHook("init",function(){return t.onInit()})},T=S;$traceurRuntime.createClass(S,{isEnabled:function(){return!!this.hot.getSettings().manualColumnMove},enablePlugin:function(){var e=this,t=E.get(this),o=this.hot.getSettings().manualColumnMove,n=this.loadManualColumnPositions();this.handleElement=document.createElement("DIV"),this.handleElement.className=t.handleClassName,this.guideElement=document.createElement("DIV"),this.guideElement.className=t.guideClassName,this.addHook("modifyCol",function(t){return e.onModifyCol(t)}),this.addHook("unmodifyCol",function(t){return e.onUnmodifyCol(t)}),this.addHook("afterRemoveCol",function(t,o){return e.onAfterRemoveCol(t,o)}),this.addHook("afterCreateCol",function(t,o){return e.onAfterCreateCol(t,o)}),this.registerEvents(),"undefined"!=typeof n?this.columnPositions=n:Array.isArray(o)?this.columnPositions=o:o&&void 0!==this.columnPositions||(this.columnPositions=[]),$traceurRuntime.superGet(this,T.prototype,"enablePlugin").call(this)},updatePlugin:function(){this.disablePlugin(),this.enablePlugin(),$traceurRuntime.superGet(this,T.prototype,"updatePlugin").call(this)},disablePlugin:function(){var e=this.hot.getSettings().manualColumnMove;Array.isArray(e)&&(this.unregisterEvents(),this.columnPositions=[]),$traceurRuntime.superGet(this,T.prototype,"disablePlugin").call(this)},registerEvents:function(){var e=this;this.eventManager.addEventListener(this.hot.rootElement,"mouseover",function(t){return e.onMouseOver(t)}),this.eventManager.addEventListener(this.hot.rootElement,"mousedown",function(t){return e.onMouseDown(t)}),this.eventManager.addEventListener(window,"mousemove",function(t){return e.onMouseMove(t)}),this.eventManager.addEventListener(window,"mouseup",function(t){return e.onMouseUp(t)})},unregisterEvents:function(){this.eventManager.clear()},saveManualColumnPositions:function(){Handsontable.hooks.run(this.hot,"persistentStateSave","manualColumnPositions",this.columnPositions)},loadManualColumnPositions:function(){var e={};return Handsontable.hooks.run(this.hot,"persistentStateLoad","manualColumnPositions",e),e.value},completeSettingsArray:function(){var e=this,t=this.hot.countCols();this.columnPositions.length!==t&&v(0,t-1,function(t){-1===e.columnPositions.indexOf(t)&&e.columnPositions.push(t)})},setupHandlePosition:function(e){var t=E.get(this),o=this.hot.view.wt.wtTable.getCoords(e).col;if(this.currentTH=e,o>=0){var n=this.currentTH.getBoundingClientRect();t.currentCol=o,t.startOffset=n.left,this.handleElement.style.top=n.top+"px",this.handleElement.style.left=t.startOffset+"px",this.hot.rootElement.appendChild(this.handleElement)}},refreshHandlePosition:function(e,t){var o=e.getBoundingClientRect(),n=6;t>0?this.handleElement.style.left=o.left+o.width-n+"px":this.handleElement.style.left=o.left+"px"},setupGuidePosition:function(){var e=this.currentTH.getBoundingClientRect(),t=E.get(this);d(this.handleElement,"active"),d(this.guideElement,"active"),this.guideElement.style.width=e.width+"px",this.guideElement.style.height=this.hot.view.maximumVisibleElementHeight(0)+"px",this.guideElement.style.top=this.handleElement.style.top,this.guideElement.style.left=t.startOffset+"px",this.hot.rootElement.appendChild(this.guideElement)},refreshGuidePosition:function(e){var t=E.get(this);this.guideElement.style.left=t.startOffset+e+"px"},hideHandleAndGuide:function(){g(this.handleElement,"active"),g(this.guideElement,"active")},checkColumnHeader:function(e){if(e!=this.hot.rootElement){var t=e.parentNode;return"THEAD"===t.tagName?!0:this.checkColumnHeader(t)}return!1},createPositionData:function(e){var t=this.columnPositions;t.lengththis.columnPositions.length-1&&this.createPositionData(o+1),this.columnPositions.splice(t,0,this.columnPositions.splice(e,1)[0])},getVisibleColumnIndex:function(e){return e>this.columnPositions.length-1&&this.createPositionData(e),this.columnPositions.indexOf(e)},getLogicalColumnIndex:function(e){return this.columnPositions[e]},onMouseOver:function(e){var t=E.get(this);if(this.checkColumnHeader(e.target)){var o=this.getTHFromTargetElement(e.target);if(o)if(t.pressed){var n=this.hot.view.wt.wtTable.getCoords(o).col;n>=0&&(t.endCol=n,this.refreshHandlePosition(o,t.endCol-t.startCol))}else this.setupHandlePosition(o)}},onMouseDown:function(e){var t=E.get(this);f(e.target,t.handleClassName)&&(t.startX=y(e),this.setupGuidePosition(),t.pressed=this.hot,t.startCol=t.currentCol,t.endCol=t.currentCol)},onMouseMove:function(e){var t=E.get(this);t.pressed&&this.refreshGuidePosition(y(e)-t.startX)},onMouseUp:function(e){var t=E.get(this);t.pressed&&(this.hideHandleAndGuide(),t.pressed=!1,this.createPositionData(this.hot.countCols()),this.changeColumnPositions(t.startCol,t.endCol),Handsontable.hooks.run(this.hot,"beforeColumnMove",t.startCol,t.endCol),this.hot.forceFullRender=!0,this.hot.view.render(),this.saveManualColumnPositions(),Handsontable.hooks.run(this.hot,"afterColumnMove",t.startCol,t.endCol),this.setupHandlePosition(this.currentTH))},onModifyCol:function(e){return-1==typeof this.getVisibleColumnIndex(e)&&this.createPositionData(e+1),this.getLogicalColumnIndex(e)},onUnmodifyCol:function(e){return-1==typeof this.getVisibleColumnIndex(e)&&this.createPositionData(e+1),this.getVisibleColumnIndex(e)},onAfterRemoveCol:function(e,t){if(this.isEnabled()){var o,n=this.columnPositions;o=n.splice(e,t),n=w(n,function(e,t){var n=e;return m(o,function(t,o){e>t&&n--}),n}),this.columnPositions=n}},onAfterCreateCol:function(e,t){if(this.isEnabled()){var o=this.columnPositions;if(o.length){var n=[];v(0,t-1,function(t){n.push(e+t)}),e>=o.length?o.concat(n):(o=w(o,function(o,n){return o>=e?o+t:o}),o.splice.apply(o,[e,0].concat(n))),this.columnPositions=o}}},onInit:function(){this.completeSettingsArray()}},{},c),R("manualColumnMove",S),Handsontable.hooks.register("beforeColumnMove"),Handsontable.hooks.register("afterColumnMove"),Handsontable.hooks.register("unmodifyCol")},{"_base.js":59,eventManager:41,"helpers/array":42,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/number":50,plugins:58}],79:[function(e,t,o){"use strict";Object.defineProperties(o,{ManualColumnResize:{get:function(){return w}},__esModule:{value:!0}});var n,i,r,s,l,a=(n=e("_base.js"),n&&n.__esModule&&n||{"default":n})["default"],u=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),c=u.addClass,h=u.hasClass,d=u.removeClass,f=(r=e("eventManager"),r&&r.__esModule&&r||{"default":r}).eventManager,g=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),p=g.pageX,m=(g.pageY,(l=e("plugins"),l&&l.__esModule&&l||{"default":l}).registerPlugin),w=function(e){$traceurRuntime.superConstructor(v).call(this,e),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=f(this),this.pressed=null,this.dblclick=0,this.autoresizeTimeout=null,this.manualColumnWidths=[],c(this.handle,"manualColumnResizer"),c(this.guide,"manualColumnResizerGuide")},v=w;$traceurRuntime.createClass(w,{isEnabled:function(){return this.hot.getSettings().manualColumnResize},enablePlugin:function(){var e=this;if(!this.enabled){this.manualColumnWidths=[];var t=this.hot.getSettings().manualColumnResize,o=this.loadManualColumnWidths();this.addHook("modifyColWidth",function(t,o){return e.onModifyColWidth(t,o)}),this.addHook("beforeStretchingColumnWidth",function(t,o){return e.onBeforeStretchingColumnWidth(t,o)}),"undefined"!=typeof o?this.manualColumnWidths=o:Array.isArray(t)?this.manualColumnWidths=t:this.manualColumnWidths=[],Handsontable.hooks.register("beforeColumnResize"),Handsontable.hooks.register("afterColumnResize"),this.bindEvents(),$traceurRuntime.superGet(this,v.prototype,"enablePlugin").call(this)}},updatePlugin:function(){var e=this.hot.getSettings().manualColumnResize;Array.isArray(e)?this.manualColumnWidths=e:e||(this.manualColumnWidths=[])},disablePlugin:function(){$traceurRuntime.superGet(this,v.prototype,"disablePlugin").call(this)},saveManualColumnWidths:function(){this.hot.runHooks("persistentStateSave","manualColumnWidths",this.manualColumnWidths)},loadManualColumnWidths:function(){var e={};return this.hot.runHooks("persistentStateLoad","manualColumnWidths",e),e.value},setupHandlePosition:function(e){this.currentTH=e;var t=this.hot.view.wt.wtTable.getCoords(e).col;if(t>=0){var o=this.currentTH.getBoundingClientRect();this.currentCol=t,this.startOffset=o.left-6,this.startWidth=parseInt(o.width,10),this.handle.style.top=o.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(){c(this.handle,"active"),c(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(){d(this.handle,"active"),d(this.guide,"active")},checkIfColumnHeader:function(e){if(e!=this.hot.rootElement){var t=e.parentNode;return"THEAD"===t.tagName?!0:this.checkIfColumnHeader(t)}return!1},getTHFromTargetElement:function(e){return"TABLE"!=e.tagName?"TH"==e.tagName?e:this.getTHFromTargetElement(e.parentNode):null},onMouseOver:function(e){if(this.checkIfColumnHeader(e.target)){var t=this.getTHFromTargetElement(e.target);if(!t)return;var o=t.getAttribute("colspan");!t||null!==o&&1!==o||this.pressed||this.setupHandlePosition(t)}},afterMouseDownTimeout:function(){if(this.dblclick>=2){var e=this.hot.runHooks("beforeColumnResize",this.currentCol,this.newSize,!0);void 0!==e&&(this.newSize=e),"all"===this.hot.getSettings().stretchH?this.clearManualSize(this.currentCol):this.setManualSize(this.currentCol,this.newSize),this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.wt.wtOverlays.adjustElementsSize(!0),this.hot.runHooks("afterColumnResize",this.currentCol,this.newSize,!0); +}this.dblclick=0,this.autoresizeTimeout=null},onMouseDown:function(e){var t=this;h(e.target,"manualColumnResizer")&&(this.setupGuidePosition(),this.pressed=this.hot,null===this.autoresizeTimeout&&(this.autoresizeTimeout=setTimeout(function(){return t.afterMouseDownTimeout()},500),this.hot._registerTimeout(this.autoresizeTimeout)),this.dblclick++,this.startX=p(e),this.newSize=this.startWidth)},onMouseMove:function(e){this.pressed&&(this.currentWidth=this.startWidth+(p(e)-this.startX),this.newSize=this.setManualSize(this.currentCol,this.currentWidth),this.refreshHandlePosition(),this.refreshGuidePosition())},onMouseUp:function(e){this.pressed&&(this.hideHandleAndGuide(),this.pressed=!1,this.newSize!=this.startWidth&&(this.hot.runHooks("beforeColumnResize",this.currentCol,this.newSize),this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.wt.wtOverlays.adjustElementsSize(!0),this.saveManualColumnWidths(),this.hot.runHooks("afterColumnResize",this.currentCol,this.newSize)),this.setupHandlePosition(this.currentTH))},bindEvents:function(){var e=this;this.eventManager.addEventListener(this.hot.rootElement,"mouseover",function(t){return e.onMouseOver(t)}),this.eventManager.addEventListener(this.hot.rootElement,"mousedown",function(t){return e.onMouseDown(t)}),this.eventManager.addEventListener(window,"mousemove",function(t){return e.onMouseMove(t)}),this.eventManager.addEventListener(window,"mouseup",function(t){return e.onMouseUp(t)})},setManualSize:function(e,t){return t=Math.max(t,20),e=this.hot.runHooks("modifyCol",e),this.manualColumnWidths[e]=t,t},clearManualSize:function(e){e=this.hot.runHooks("modifyCol",e),this.manualColumnWidths[e]=void 0},onModifyColWidth:function(e,t){return this.enabled&&(t=this.hot.runHooks("modifyCol",t),this.hot.getSettings().manualColumnResize&&this.manualColumnWidths[t])?this.manualColumnWidths[t]:e},onBeforeStretchingColumnWidth:function(e,t){var o=this.manualColumnWidths[t];return void 0===o&&(o=e),o}},{},a),m("manualColumnResize",w)},{"_base.js":59,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,plugins:58}],80:[function(e,t,o){"use strict";Object.defineProperties(o,{ManualRowMove:{get:function(){return S}},__esModule:{value:!0}});var n,i,r,s,l,a,u,c=(n=e("_base.js"),n&&n.__esModule&&n||{"default":n})["default"],h=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),d=h.addClass,f=h.hasClass,g=h.removeClass,p=(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}),m=p.arrayEach,w=p.arrayMap,v=(s=e("helpers/number"),s&&s.__esModule&&s||{"default":s}).rangeEach,b=(l=e("eventManager"),l&&l.__esModule&&l||{"default":l}).eventManager,C=(a=e("helpers/dom/event"),a&&a.__esModule&&a||{"default":a}),y=(C.pageX,C.pageY),R=(u=e("plugins"),u&&u.__esModule&&u||{"default":u}).registerPlugin,E=new WeakMap,S=function(e){$traceurRuntime.superConstructor(T).call(this,e),E.set(this,{guideClassName:"manualRowMoverGuide",handleClassName:"manualRowMover",startOffset:null,pressed:null,startRow:null,endRow:null,currentRow:null,startX:null,startY:null}),this.guideElement=null,this.handleElement=null,this.currentTH=null,this.rowPositions=[],this.eventManager=b(this)},T=S;$traceurRuntime.createClass(S,{isEnabled:function(){return!!this.hot.getSettings().manualRowMove},enablePlugin:function(){var e=this,t=E.get(this),o=this.hot.getSettings().manualRowMove,n=this.loadManualRowPositions();this.handleElement=document.createElement("DIV"),this.handleElement.className=t.handleClassName,this.guideElement=document.createElement("DIV"),this.guideElement.className=t.guideClassName,this.addHook("modifyRow",function(t){return e.onModifyRow(t)}),this.addHook("afterRemoveRow",function(t,o){return e.onAfterRemoveRow(t,o)}),this.addHook("afterCreateRow",function(t,o){return e.onAfterCreateRow(t,o)}),this.addHook("init",function(){return e.onInit()}),this.registerEvents(),"undefined"!=typeof n?this.rowPositions=n:Array.isArray(o)?this.rowPositions=o:o&&void 0!==this.rowPositions||(this.rowPositions=[]),$traceurRuntime.superGet(this,T.prototype,"enablePlugin").call(this)},updatePlugin:function(){this.disablePlugin(),this.enablePlugin(),$traceurRuntime.superGet(this,T.prototype,"updatePlugin").call(this)},disablePlugin:function(){var e=this.hot.getSettings().manualRowMove;Array.isArray(e)&&(this.unregisterEvents(),this.rowPositions=[]),$traceurRuntime.superGet(this,T.prototype,"disablePlugin").call(this)},registerEvents:function(){var e=this;this.eventManager.addEventListener(this.hot.rootElement,"mouseover",function(t){return e.onMouseOver(t)}),this.eventManager.addEventListener(this.hot.rootElement,"mousedown",function(t){return e.onMouseDown(t)}),this.eventManager.addEventListener(window,"mousemove",function(t){return e.onMouseMove(t)}),this.eventManager.addEventListener(window,"mouseup",function(t){return e.onMouseUp(t)})},unregisterEvents:function(){this.eventManager.clear()},saveManualRowPositions:function(){Handsontable.hooks.run(this.hot,"persistentStateSave","manualRowPositions",this.rowPositions)},loadManualRowPositions:function(){var e={};return Handsontable.hooks.run(this.hot,"persistentStateLoad","manualRowPositions",e),e.value},completeSettingsArray:function(){var e=this,t=this.hot.countRows();this.rowPositions.length!==t&&v(0,t-1,function(t){-1===e.rowPositions.indexOf(t)&&e.rowPositions.push(t)})},setupHandlePosition:function(e){var t=E.get(this),o=this.hot.view.wt.wtTable.getCoords(e).row;if(this.currentTH=e,o>=0){var n=this.currentTH.getBoundingClientRect();t.currentRow=o,t.startOffset=n.top,this.handleElement.style.top=t.startOffset+"px",this.handleElement.style.left=n.left+"px",this.hot.rootElement.appendChild(this.handleElement)}},refreshHandlePosition:function(e,t){var o=e.getBoundingClientRect(),n=6;t>0?this.handleElement.style.top=o.top+o.height-n+"px":this.handleElement.style.top=o.top+"px"},setupGuidePosition:function(){var e=this.currentTH.getBoundingClientRect(),t=E.get(this);d(this.handleElement,"active"),d(this.guideElement,"active"),this.guideElement.style.height=e.height+"px",this.guideElement.style.width=this.hot.view.maximumVisibleElementWidth(0)+"px",this.guideElement.style.top=t.startOffset+"px",this.guideElement.style.left=this.handleElement.style.left,this.hot.rootElement.appendChild(this.guideElement)},refreshGuidePosition:function(e){var t=E.get(this);this.guideElement.style.top=t.startOffset+e+"px"},hideHandleAndGuide:function(){g(this.handleElement,"active"),g(this.guideElement,"active")},checkRowHeader:function(e){if(e!=this.hot.rootElement){var t=e.parentNode;return"TBODY"===t.tagName?!0:this.checkRowHeader(t)}return!1},createPositionData:function(e){var t=this.rowPositions;t.lengththis.rowPositions.length-1&&this.createPositionData(o+1),this.rowPositions.splice(t,0,this.rowPositions.splice(e,1)[0])},getVisibleRowIndex:function(e){return e>this.rowPositions.length-1&&this.createPositionData(e),this.rowPositions.indexOf(e)},getLogicalRowIndex:function(e){return this.rowPositions[e]},onMouseOver:function(e){var t=E.get(this);if(this.checkRowHeader(e.target)){var o=this.getTHFromTargetElement(e.target);o&&(t.pressed?(t.endRow=this.hot.view.wt.wtTable.getCoords(o).row,this.refreshHandlePosition(o,t.endRow-t.startRow)):this.setupHandlePosition(o))}},onMouseDown:function(e){var t=E.get(this);f(e.target,t.handleClassName)&&(t.startY=y(e),this.setupGuidePosition(),t.pressed=this.hot,t.startRow=t.currentRow,t.endRow=t.currentRow)},onMouseMove:function(e){var t=E.get(this);t.pressed&&this.refreshGuidePosition(y(e)-t.startY)},onMouseUp:function(e){var t=E.get(this);t.pressed&&(this.hideHandleAndGuide(),t.pressed=!1,this.createPositionData(this.hot.countRows()),this.changeRowPositions(t.startRow,t.endRow),Handsontable.hooks.run(this.hot,"beforeRowMove",t.startRow,t.endRow),this.hot.forceFullRender=!0,this.hot.view.render(),this.saveManualRowPositions(),Handsontable.hooks.run(this.hot,"afterRowMove",t.startRow,t.endRow),this.setupHandlePosition(this.currentTH))},onModifyRow:function(e){return"undefined"==typeof this.getVisibleRowIndex(e)&&this.createPositionData(e+1),this.getLogicalRowIndex(e)},onAfterRemoveRow:function(e,t){if(this.isEnabled()){var o,n=this.rowPositions;o=n.splice(e,t),n=w(n,function(e,t){var n=e;return m(o,function(t,o){e>t&&n--}),n}),this.rowPositions=n}},onAfterCreateRow:function(e,t){if(this.isEnabled()){var o=this.rowPositions;if(o.length){for(var n=[],i=0;t>i;i++)n.push(e+i);e>=o.length?o.concat(n):(o=w(o,function(o,n){return o>=e?o+t:o}),o.splice.apply(o,[e,0].concat(n))),this.rowPositions=o}}},onInit:function(){this.completeSettingsArray()}},{},c),R("ManualRowMove",S),Handsontable.hooks.register("beforeRowMove"),Handsontable.hooks.register("afterRowMove")},{"_base.js":59,eventManager:41,"helpers/array":42,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/number":50,plugins:58}],81:[function(e,t,o){"use strict";Object.defineProperties(o,{ManualRowResize:{get:function(){return w}},__esModule:{value:!0}});var n,i,r,s,l,a=(n=e("_base.js"),n&&n.__esModule&&n||{"default":n})["default"],u=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),c=u.addClass,h=u.hasClass,d=u.removeClass,f=(r=e("eventManager"),r&&r.__esModule&&r||{"default":r}).eventManager,g=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),p=(g.pageX,g.pageY),m=(l=e("plugins"),l&&l.__esModule&&l||{"default":l}).registerPlugin,w=function(e){$traceurRuntime.superConstructor(v).call(this,e),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=f(this),this.pressed=null,this.dblclick=0,this.autoresizeTimeout=null,this.manualRowHeights=[],c(this.handle,"manualRowResizer"),c(this.guide,"manualRowResizerGuide")},v=w;$traceurRuntime.createClass(w,{isEnabled:function(){return this.hot.getSettings().manualRowResize},enablePlugin:function(){var e=this;if(!this.enabled){this.manualRowHeights=[];var t=this.hot.getSettings().manualRowResize,o=this.loadManualRowHeights();"undefined"!=typeof o?this.manualRowHeights=o:Array.isArray(t)?this.manualRowHeights=t:this.manualRowHeights=[],this.addHook("modifyRowHeight",function(t,o){return e.onModifyRowHeight(t,o)}),Handsontable.hooks.register("beforeRowResize"),Handsontable.hooks.register("afterRowResize"),this.bindEvents(),$traceurRuntime.superGet(this,v.prototype,"enablePlugin").call(this)}},updatePlugin:function(){var e=this.hot.getSettings().manualRowResize;Array.isArray(e)?this.manualRowHeights=e:e||(this.manualRowHeights=[])},disablePlugin:function(){$traceurRuntime.superGet(this,v.prototype,"disablePlugin").call(this)},saveManualRowHeights:function(){this.hot.runHooks("persistentStateSave","manualRowHeights",this.manualRowHeights)},loadManualRowHeights:function(){var e={};return this.hot.runHooks("persistentStateLoad","manualRowHeights",e),e.value},setupHandlePosition:function(e){this.currentTH=e;var t=this.hot.view.wt.wtTable.getCoords(e).row;if(t>=0){var o=this.currentTH.getBoundingClientRect();this.currentRow=t,this.startOffset=o.top-6,this.startHeight=parseInt(o.height,10),this.handle.style.left=o.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(){c(this.handle,"active"),c(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(){d(this.handle,"active"),d(this.guide,"active")},checkIfRowHeader:function(e){if(e!=this.hot.rootElement){var t=e.parentNode;return"TBODY"===t.tagName?!0:this.checkIfRowHeader(t)}return!1},getTHFromTargetElement:function(e){return"TABLE"!=e.tagName?"TH"==e.tagName?e:this.getTHFromTargetElement(e.parentNode):null},onMouseOver:function(e){if(this.checkIfRowHeader(e.target)){var t=this.getTHFromTargetElement(e.target);t&&(this.pressed||this.setupHandlePosition(t))}},afterMouseDownTimeout:function(){if(this.dblclick>=2){var e=this.hot.runHooks("beforeRowResize",this.currentRow,this.newSize,!0);void 0!==e&&(this.newSize=e),this.setManualSize(this.currentRow,this.newSize),this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.wt.wtOverlays.adjustElementsSize(!0),this.hot.runHooks("afterRowResize",this.currentRow,this.newSize,!0)}this.dblclick=0,this.autoresizeTimeout=null},onMouseDown:function(e){var t=this;h(e.target,"manualRowResizer")&&(this.setupGuidePosition(),this.pressed=this.hot,null==this.autoresizeTimeout&&(this.autoresizeTimeout=setTimeout(function(){return t.afterMouseDownTimeout()},500),this.hot._registerTimeout(this.autoresizeTimeout)),this.dblclick++,this.startY=p(e),this.newSize=this.startHeight)},onMouseMove:function(e){this.pressed&&(this.currentHeight=this.startHeight+(p(e)-this.startY),this.newSize=this.setManualSize(this.currentRow,this.currentHeight),this.refreshHandlePosition(),this.refreshGuidePosition())},onMouseUp:function(e){this.pressed&&(this.hideHandleAndGuide(),this.pressed=!1,this.newSize!=this.startHeight&&(this.hot.runHooks("beforeRowResize",this.currentRow,this.newSize),this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.wt.wtOverlays.adjustElementsSize(!0),this.saveManualRowHeights(),this.hot.runHooks("afterRowResize",this.currentRow,this.newSize)),this.setupHandlePosition(this.currentTH))},bindEvents:function(){var e=this;this.eventManager.addEventListener(this.hot.rootElement,"mouseover",function(t){return e.onMouseOver(t)}),this.eventManager.addEventListener(this.hot.rootElement,"mousedown",function(t){return e.onMouseDown(t)}),this.eventManager.addEventListener(window,"mousemove",function(t){return e.onMouseMove(t)}),this.eventManager.addEventListener(window,"mouseup",function(t){return e.onMouseUp(t)})},setManualSize:function(e,t){return e=this.hot.runHooks("modifyRow",e),this.manualRowHeights[e]=t,t},onModifyRowHeight:function(e,t){if(this.enabled){var o=this.hot.getPlugin("autoRowSize"),n=o?o.heights[t]:null;t=this.hot.runHooks("modifyRow",t);var i=this.manualRowHeights[t];if(void 0!==i&&(i===n||i>(e||0)))return i}return e}},{},a),m("manualRowResize",w)},{"_base.js":59,eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,plugins:58}],82:[function(e,t,o){"use strict";function n(){var e=[];return e.getInfo=function(e,t){for(var o=0,n=this.length;n>o;o++)if(this[o].row<=e&&this[o].row+this[o].rowspan-1>=e&&this[o].col<=t&&this[o].col+this[o].colspan-1>=t)return this[o]},e.setInfo=function(e){for(var t=0,o=this.length;o>t;t++)if(this[t].row===e.row&&this[t].col===e.col)return void(this[t]=e);this.push(e)},e.removeInfo=function(e,t){for(var o=0,n=this.length;n>o;o++)if(this[o].row===e&&this[o].col===t){this.splice(o,1);break}},e}function i(e){if(this.mergedCellInfoCollection=new n,Array.isArray(e))for(var t=0,o=e.length;o>t;t++)this.mergedCellInfoCollection.setInfo(e[t])}function r(e,t){var o=this.getSettings().mergeCells;if(o&&!this.selection.isMultiple()){var n=this.mergeCells.mergedCellInfoCollection.getInfo(e[0],e[1]);n&&(e[0]=n.row,e[1]=n.col,e[2]=n.row+n.rowspan-1,e[3]=n.col+n.colspan-1)}}function s(e,t){this.mergeCells&&this.mergeCells.shiftCollection("right",e,t)}function l(e,t){this.mergeCells&&this.mergeCells.shiftCollection("left",e,t)}function a(e,t){this.mergeCells&&this.mergeCells.shiftCollection("down",e,t)}function u(e,t){this.mergeCells&&this.mergeCells.shiftCollection("up",e,t)}Object.defineProperties(o,{MergeCells:{get:function(){return i}},__esModule:{value:!0}});var c,h,d,f,g,p=((c=e("plugins"),c&&c.__esModule&&c||{"default":c}).registerPlugin,(h=e("helpers/dom/event"),h&&h.__esModule&&h||{"default":h}).stopImmediatePropagation),m=(d=e("3rdparty/walkontable/src/cell/coords"),d&&d.__esModule&&d||{"default":d}).WalkontableCellCoords,w=(f=e("3rdparty/walkontable/src/cell/range"),f&&f.__esModule&&f||{"default":f}).WalkontableCellRange,v=(g=e("3rdparty/walkontable/src/table"),g&&g.__esModule&&g||{"default":g}).WalkontableTable;i.prototype.canMergeRange=function(e){return!e.isSingle()},i.prototype.mergeRange=function(e){if(this.canMergeRange(e)){var t=e.getTopLeftCorner(),o=e.getBottomRightCorner(),n={};n.row=t.row,n.col=t.col,n.rowspan=o.row-t.row+1,n.colspan=o.col-t.col+1,this.mergedCellInfoCollection.setInfo(n)}},i.prototype.mergeOrUnmergeSelection=function(e){var t=this.mergedCellInfoCollection.getInfo(e.from.row,e.from.col);t?this.unmergeSelection(e.from):this.mergeSelection(e)},i.prototype.mergeSelection=function(e){this.mergeRange(e)},i.prototype.unmergeSelection=function(e){var t=this.mergedCellInfoCollection.getInfo(e.row,e.col);this.mergedCellInfoCollection.removeInfo(t.row,t.col)},i.prototype.applySpanProperties=function(e,t,o){var n=this.mergedCellInfoCollection.getInfo(t,o);n?n.row===t&&n.col===o?(e.setAttribute("rowspan",n.rowspan),e.setAttribute("colspan",n.colspan)):(e.removeAttribute("rowspan"),e.removeAttribute("colspan"),e.style.display="none"):(e.removeAttribute("rowspan"),e.removeAttribute("colspan"))},i.prototype.modifyTransform=function(e,t,o){var n=function(e,t){return t.row>=e.row&&t.row<=e.row+e.rowspan-1},i=function(e,t){return t.col>=e.col&&t.col<=e.col+e.colspan-1},r=function(e){return new m(t.to.row+e.row,t.to.col+e.col)},s={row:o.row,col:o.col};if("modifyTransformStart"==e){this.lastDesiredCoords||(this.lastDesiredCoords=new m(null,null));for(var l,a=new m(t.highlight.row,t.highlight.col),u=this.mergedCellInfoCollection.getInfo(a.row,a.col),c=0,h=this.mergedCellInfoCollection.length;h>c;c++){var d=this.mergedCellInfoCollection[c];if(d=new m(d.row+d.rowspan-1,d.col+d.colspan-1),t.includes(d)){l=!0;break}}if(u){var f=new m(u.row,u.col),g=new m(u.row+u.rowspan-1,u.col+u.colspan-1),p=new w(f,f,g);p.includes(this.lastDesiredCoords)||(this.lastDesiredCoords=new m(null,null)),s.row=this.lastDesiredCoords.row?this.lastDesiredCoords.row-a.row:s.row,s.col=this.lastDesiredCoords.col?this.lastDesiredCoords.col-a.col:s.col,o.row>0?s.row=u.row+u.rowspan-1-a.row+o.row:o.row<0&&(s.row=a.row-u.row+o.row),o.col>0?s.col=u.col+u.colspan-1-a.col+o.col:o.col<0&&(s.col=a.col-u.col+o.col)}var v=new m(t.highlight.row+s.row,t.highlight.col+s.col),b=this.mergedCellInfoCollection.getInfo(v.row,v.col);b&&(this.lastDesiredCoords=v,s={row:b.row-a.row,col:b.col-a.col})}else if("modifyTransformEnd"==e)for(var c=0,h=this.mergedCellInfoCollection.length;h>c;c++){var C=this.mergedCellInfoCollection[c],f=new m(C.row,C.col),g=new m(C.row+C.rowspan-1,C.col+C.colspan-1),y=new w(f,f,g),R=t.getBordersSharedWith(y);if(y.isEqual(t))t.setDirection("NW-SE");else if(R.length>0){var E=t.highlight.isEqual(y.from);R.indexOf("top")>-1?t.to.isSouthEastOf(y.from)&&E?t.setDirection("NW-SE"):t.to.isSouthWestOf(y.from)&&E&&t.setDirection("NE-SW"):R.indexOf("bottom")>-1&&(t.to.isNorthEastOf(y.from)&&E?t.setDirection("SW-NE"):t.to.isNorthWestOf(y.from)&&E&&t.setDirection("SE-NW"))}var v=r(s),S=n(C,v),T=i(C,v);t.includesRange(y)&&(y.includes(v)||S||T)&&(S&&(s.row<0?s.row-=C.rowspan-1:s.row>0&&(s.row+=C.rowspan-1)),T&&(s.col<0?s.col-=C.colspan-1:s.col>0&&(s.col+=C.colspan-1)))}0!==s.row&&(o.row=s.row),0!==s.col&&(o.col=s.col)},i.prototype.shiftCollection=function(e,t,o){var n=[0,0];switch(e){case"right":n[0]+=1;break;case"left":n[0]-=1;break;case"down":n[1]+=1;break;case"up":n[1]-=1}for(var i=0;io;o++)e.mergeCells.mergedCellInfoCollection.setInfo(t[o])}else e.mergeCells=new i(t);else e.mergeCells&&(e.mergeCells.mergedCellInfoCollection=new n)},R=function(e){if(this.mergeCells){var t=(e.ctrlKey||e.metaKey)&&!e.altKey;t&&77===e.keyCode&&(this.mergeCells.mergeOrUnmergeSelection(this.getSelectedRange()),this.render(),p(e))}},E=function(e){this.getSettings().mergeCells&&(e.items.push(Handsontable.plugins.ContextMenu.SEPARATOR),e.items.push({key:"mergeCells",name:function(){var e=this.getSelected(),t=this.mergeCells.mergedCellInfoCollection.getInfo(e[0],e[1]);return t?"Unmerge cells":"Merge cells"},callback:function(){this.mergeCells.mergeOrUnmergeSelection(this.getSelectedRange()),this.render()},disabled:function(){return!1}}))},S=function(e,t,o,n,i,r){this.mergeCells&&this.mergeCells.applySpanProperties(e,t,o)},T=function(e){return function(t){var o=this.getSettings().mergeCells;if(o){var n=this.getSelectedRange();if(this.mergeCells.modifyTransform(e,n,t),"modifyTransformEnd"===e){var i=this.countRows(),r=this.countCols();n.from.row<0?n.from.row=0:n.from.row>0&&n.from.row>=i&&(n.from.row=n.from-1),n.from.col<0?n.from.col=0:n.from.col>0&&n.from.col>=r&&(n.from.col=r-1)}}}},O=function(e){this.lastDesiredCoords=null;var t=this.getSettings().mergeCells;if(t){var o=this.getSelectedRange();o.highlight=new m(o.highlight.row,o.highlight.col),o.to=e;var n=!1;do{n=!1;for(var i=0,r=this.mergeCells.mergedCellInfoCollection.length;r>i;i++){var s=this.mergeCells.mergedCellInfoCollection[i],l=new m(s.row,s.col),a=new m(s.row+s.rowspan-1,s.col+s.colspan-1),u=new w(l,l,a);o.expandByRange(u)&&(e.row=o.to.row,e.col=o.to.col,n=!0)}}while(n)}},_=function(e,t){if(t&&"area"==t){var o=this.getSettings().mergeCells;if(o)for(var n=this.getSelectedRange(),i=new w(n.from,n.from,n.from),r=new w(n.to,n.to,n.to),s=0,l=this.mergeCells.mergedCellInfoCollection.length;l>s;s++){var a=this.mergeCells.mergedCellInfoCollection[s],u=new m(a.row,a.col),c=new m(a.row+a.rowspan-1,a.col+a.colspan-1),h=new w(u,u,c);i.expandByRange(h)&&(e[0]=i.from.row,e[1]=i.from.col),r.expandByRange(h)&&(e[2]=r.from.row,e[3]=r.from.col)}}},M=function(e,t,o){var n=this.getSettings().mergeCells;if(n){var i=this.mergeCells.mergedCellInfoCollection.getInfo(e,t);!i||i.row==e&&i.col==t||(o.copyable=!1)}},H=function(e){var t=this.getSettings().mergeCells;if(t)for(var o,n=this.countCols(),i=0;n>i;i++){if(o=this.mergeCells.mergedCellInfoCollection.getInfo(e.startRow,i),o&&o.rowe.endRow)return e.endRow=r,H.call(this,e)}}},k=function(e){var t=this.getSettings().mergeCells;if(t)for(var o,n=this.countRows(),i=0;n>i;i++){if(o=this.mergeCells.mergedCellInfoCollection.getInfo(i,e.startColumn),o&&o.cole.endColumn)return e.endColumn=r,k.call(this,e)}}},A=function(e){if(e&&this.mergeCells){var t=this.mergeCells.mergedCellInfoCollection,o=this.getSelectedRange();for(var n in t)if(o.highlight.row==t[n].row&&o.highlight.col==t[n].col&&o.to.row==t[n].row+t[n].rowspan-1&&o.to.col==t[n].col+t[n].colspan-1)return!1}return e};Handsontable.hooks.add("beforeInit",b),Handsontable.hooks.add("afterInit",C),Handsontable.hooks.add("afterUpdateSettings",y),Handsontable.hooks.add("beforeKeyDown",R),Handsontable.hooks.add("modifyTransformStart",T("modifyTransformStart")),Handsontable.hooks.add("modifyTransformEnd",T("modifyTransformEnd")),Handsontable.hooks.add("beforeSetRangeEnd",O),Handsontable.hooks.add("beforeDrawBorders",_),Handsontable.hooks.add("afterIsMultipleSelection",A),Handsontable.hooks.add("afterRenderer",S),Handsontable.hooks.add("afterContextMenuDefaultOptions",E),Handsontable.hooks.add("afterGetCellMeta",M),Handsontable.hooks.add("afterViewportRowCalculatorOverride",H),Handsontable.hooks.add("afterViewportColumnCalculatorOverride",k),Handsontable.hooks.add("afterAutofillApplyValues",r),Handsontable.hooks.add("afterCreateCol",s),Handsontable.hooks.add("afterRemoveCol",l),Handsontable.hooks.add("afterCreateRow",a),Handsontable.hooks.add("afterRemoveRow",u),Handsontable.MergeCells=i},{"3rdparty/walkontable/src/cell/coords":5,"3rdparty/walkontable/src/cell/range":6,"3rdparty/walkontable/src/table":20,"helpers/dom/event":46,plugins:58}],83:[function(e,t,o){"use strict";Object.defineProperties(o,{MultipleSelectionHandles:{get:function(){return g}},__esModule:{value:!0}});var n,i,r,s,l=(n=e("helpers/dom/element"),n&&n.__esModule&&n||{"default":n}),a=l.getWindowScrollTop,u=l.hasClass,c=l.getWindowScrollLeft,h=(i=e("_base"),i&&i.__esModule&&i||{"default":i})["default"],d=(r=e("eventManager"),r&&r.__esModule&&r||{"default":r}).EventManager,f=(s=e("plugins"),s&&s.__esModule&&s||{"default":s}).registerPlugin,g=function(e){$traceurRuntime.superConstructor(p).call(this,e),this.dragged=[],this.eventManager=null,this.lastSetCell=null},p=g;$traceurRuntime.createClass(g,{isEnabled:function(){return Handsontable.mobileBrowser},enablePlugin:function(){this.enabled||(this.eventManager||(this.eventManager=new d(this)),this.registerListeners(),$traceurRuntime.superGet(this,p.prototype,"enablePlugin").call(this))},registerListeners:function(){function e(e){if(1===t.dragged.length)return t.dragged.splice(0,t.dragged.length),!0;var o=t.dragged.indexOf(e);return-1==o?!1:void(0===o?t.dragged=t.dragged.slice(0,1):1==o&&(t.dragged=t.dragged.slice(-1)))}var t=this;this.eventManager.addEventListener(this.hot.rootElement,"touchstart",function(e){var o;return u(e.target,"topLeftSelectionHandle-HitArea")?(o=t.hot.getSelectedRange(),t.dragged.push("topLeft"),t.touchStartRange={width:o.getWidth(),height:o.getHeight(),direction:o.getDirection()},e.preventDefault(),!1):u(e.target,"bottomRightSelectionHandle-HitArea")?(o=t.hot.getSelectedRange(),t.dragged.push("bottomRight"),t.touchStartRange={width:o.getWidth(),height:o.getHeight(),direction:o.getDirection()},e.preventDefault(),!1):void 0}),this.eventManager.addEventListener(this.hot.rootElement,"touchend",function(o){return u(o.target,"topLeftSelectionHandle-HitArea")?(e.call(t,"topLeft"),t.touchStartRange=void 0,o.preventDefault(),!1):u(o.target,"bottomRightSelectionHandle-HitArea")?(e.call(t,"bottomRight"),t.touchStartRange=void 0,o.preventDefault(),!1):void 0}),this.eventManager.addEventListener(this.hot.rootElement,"touchmove",function(e){var o,n,i,r,s,l,u,h=a(),d=c();0!==t.dragged.length&&(o=document.elementFromPoint(e.touches[0].screenX-d,e.touches[0].screenY-h),o&&o!==t.lastSetCell&&("TD"!=o.nodeName&&"TH"!=o.nodeName||(n=t.hot.getCoords(o),-1==n.col&&(n.col=0),i=t.hot.getSelectedRange(),r=i.getWidth(),s=i.getHeight(),l=i.getDirection(),1==r&&1==s&&t.hot.selection.setRangeEnd(n),u=t.getCurrentRangeCoords(i,n,t.touchStartRange.direction,l,t.dragged[0]),null!==u.start&&t.hot.selection.setRangeStart(u.start),t.hot.selection.setRangeEnd(u.end),t.lastSetCell=o),e.preventDefault()))})},getCurrentRangeCoords:function(e,t,o,n,i){var r=e.getTopLeftCorner(),s=e.getBottomRightCorner(),l=e.getBottomLeftCorner(),a=e.getTopRightCorner(),u={start:null,end:null};switch(o){case"NE-SW":switch(n){case"NE-SW":case"NW-SE":u="topLeft"==i?{start:new WalkontableCellCoords(t.row,e.highlight.col),end:new WalkontableCellCoords(l.row,t.col)}:{start:new WalkontableCellCoords(e.highlight.row,t.col),end:new WalkontableCellCoords(t.row,r.col)};break;case"SE-NW":"bottomRight"==i&&(u={start:new WalkontableCellCoords(s.row,t.col),end:new WalkontableCellCoords(t.row,r.col)})}break;case"NW-SE":switch(n){case"NE-SW":"topLeft"==i?u={start:t,end:l}:u.end=t;break;case"NW-SE":"topLeft"==i?u={start:t,end:s}:u.end=t;break;case"SE-NW":"topLeft"==i?u={start:t,end:r}:u.end=t;break;case"SW-NE":"topLeft"==i?u={start:t,end:a}:u.end=t}break;case"SW-NE":switch(n){case"NW-SE":u="bottomRight"==i?{start:new WalkontableCellCoords(t.row,r.col),end:new WalkontableCellCoords(l.row,t.col)}:{start:new WalkontableCellCoords(r.row,t.col),end:new WalkontableCellCoords(t.row,s.col)};break;case"SW-NE":u="topLeft"==i?{start:new WalkontableCellCoords(e.highlight.row,t.col),end:new WalkontableCellCoords(t.row,s.col)}:{start:new WalkontableCellCoords(t.row,r.col),end:new WalkontableCellCoords(r.row,t.col)};break;case"SE-NW":"bottomRight"==i?u={start:new WalkontableCellCoords(t.row,a.col),end:new WalkontableCellCoords(r.row,t.col)}:"topLeft"==i&&(u={start:l,end:t})}break;case"SE-NW":switch(n){case"NW-SE":case"NE-SW":case"SW-NE":"topLeft"==i&&(u.end=t);break;case"SE-NW":"topLeft"==i?u.end=t:u={start:t,end:r}}}return u},isDragged:function(){return this.dragged.length>0}},{},h),f("multipleSelectionHandles",g)},{_base:59,eventManager:41,"helpers/dom/element":45,plugins:58}],84:[function(e,t,o){"use strict";Object.defineProperties(o,{DataObserver:{get:function(){return h}},__esModule:{value:!0}});var n,i,r,s,l=(n=e("jsonpatch"),n&&n.__esModule&&n||{"default":n})["default"],a=(i=e("../../mixins/localHooks"),i&&i.__esModule&&i||{"default":i}).localHooks,u=(r=e("../../helpers/object"),r&&r.__esModule&&r||{"default":r}).mixin,c=(s=e("utils"),s&&s.__esModule&&s||{"default":s}).cleanPatches,h=function(e){this.observedData=null,this.observer=null,this.paused=!1,this.setObservedData(e)};$traceurRuntime.createClass(h,{setObservedData:function(e){var t=this;this.observer&&l.unobserve(this.observedData,this.observer),this.observedData=e,this.observer=l.observe(this.observedData,function(e){return t.onChange(e)})},isPaused:function(){return this.paused},pause:function(){this.paused=!0},resume:function(){this.paused=!1},onChange:function(e){this.runLocalHooks("change",c(e))},destroy:function(){l.unobserve(this.observedData,this.observer),this.observedData=null,this.observer=null}},{}),u(h,a)},{"../../helpers/object":51,"../../mixins/localHooks":55,jsonpatch:"jsonpatch",utils:86}],85:[function(e,t,o){"use strict";Object.defineProperties(o,{ObserveChanges:{get:function(){return d}},__esModule:{value:!0}});var n,i,r,s,l,a=(n=e("_base"),n&&n.__esModule&&n||{"default":n})["default"],u=((i=e("jsonpatch"),i&&i.__esModule&&i||{"default":i})["default"],(r=e("dataObserver"),r&&r.__esModule&&r||{"default":r}).DataObserver),c=(s=e("helpers/array"),s&&s.__esModule&&s||{"default":s}).arrayEach,h=(l=e("plugins"),l&&l.__esModule&&l||{"default":l}).registerPlugin;Handsontable.hooks.register("afterChangesObserved");var d=function(e){$traceurRuntime.superConstructor(f).call(this,e),this.observer=null},f=d;$traceurRuntime.createClass(d,{isEnabled:function(){return this.hot.getSettings().observeChanges},enablePlugin:function(){var e=this;this.enabled||(this.observer||(this.observer=new u(this.hot.getSourceData()),this._exposePublicApi()),this.observer.addLocalHook("change",function(t){return e.onDataChange(t)}),this.addHook("afterCreateRow",function(){return e.onAfterTableAlter()}),this.addHook("afterRemoveRow",function(){return e.onAfterTableAlter()}),this.addHook("afterCreateCol",function(){return e.onAfterTableAlter()}),this.addHook("afterRemoveCol",function(){return e.onAfterTableAlter()}),this.addHook("afterChange",function(t,o){return e.onAfterTableAlter(o)}),this.addHook("afterLoadData",function(t){return e.onAfterLoadData(t)}),$traceurRuntime.superGet(this,f.prototype,"enablePlugin").call(this))},disablePlugin:function(){this.observer&&(this.observer.destroy(),this.observer=null,this._deletePublicApi()),$traceurRuntime.superGet(this,f.prototype,"disablePlugin").call(this); +},onDataChange:function(e){var t=this;if(!this.observer.isPaused()){var o={add:function(e){isNaN(e.col)?t.hot.runHooks("afterCreateRow",e.row):t.hot.runHooks("afterCreateCol",e.col)},remove:function(e){isNaN(e.col)?t.hot.runHooks("afterRemoveRow",e.row,1):t.hot.runHooks("afterRemoveCol",e.col,1)},replace:function(e){t.hot.runHooks("afterChange",[e.row,e.col,null,e.value],"external")}};c(e,function(e){o[e.op]&&o[e.op](e)}),this.hot.render()}this.hot.runHooks("afterChangesObserved")},onAfterTableAlter:function(e){var t=this;"loadData"!==e&&(this.observer.pause(),this.hot.addHookOnce("afterChangesObserved",function(){return t.observer.resume()}))},onAfterLoadData:function(e){e||this.observer.setObservedData(this.hot.getSourceData())},destroy:function(){this.observer&&(this.observer.destroy(),this._deletePublicApi()),$traceurRuntime.superGet(this,f.prototype,"destroy").call(this)},_exposePublicApi:function(){var e=this,t=this.hot;t.pauseObservingChanges=function(){return e.observer.pause()},t.resumeObservingChanges=function(){return e.observer.resume()},t.isPausedObservingChanges=function(){return e.observer.isPaused()}},_deletePublicApi:function(){var e=this.hot;delete e.pauseObservingChanges,delete e.resumeObservingChanges,delete e.isPausedObservingChanges}},{},a),h("observeChanges",d)},{_base:59,dataObserver:84,"helpers/array":42,jsonpatch:"jsonpatch",plugins:58}],86:[function(e,t,o){"use strict";function n(e){var t=[];return e=l(e,function(e){return/[\/]length/gi.test(e.path)?!1:!!i(e.path)}),e=a(e,function(e){var t=i(e.path);return e.row=t.row,e.col=t.col,e}),e=l(e,function(e){if(-1!==["add","remove"].indexOf(e.op)&&!isNaN(e.col)){if(-1!==t.indexOf(e.col))return!1;t.push(e.col)}return!0}),t.length=0,e}function i(e){var t=e.match(/^\/(\d+)\/?(.*)?$/);if(!t)return null;var o=t,n=o[1],i=o[2];return{row:parseInt(n,10),col:/^\d*$/.test(i)?parseInt(i,10):i}}Object.defineProperties(o,{cleanPatches:{get:function(){return n}},parsePath:{get:function(){return i}},__esModule:{value:!0}});var r,s=(r=e("../../helpers/array"),r&&r.__esModule&&r||{"default":r}),l=s.arrayFilter,a=s.arrayMap},{"../../helpers/array":42}],87:[function(e,t,o){"use strict";function n(e){var t,o=function(){window.localStorage[e+"__persistentStateKeys"]=JSON.stringify(t)},n=function(){var o=window.localStorage[e+"__persistentStateKeys"],n="string"==typeof o?JSON.parse(o):void 0;t=n?n:[]},i=function(){t=[],o()};n(),this.saveValue=function(n,i){window.localStorage[e+"_"+n]=JSON.stringify(i),-1==t.indexOf(n)&&(t.push(n),o())},this.loadValue=function(t,o){t="undefined"==typeof t?o:t;var n=window.localStorage[e+"_"+t];return"undefined"==typeof n?void 0:JSON.parse(n)},this.reset=function(t){window.localStorage.removeItem(e+"_"+t)},this.resetAll=function(){for(var o=0;ol;l++)for(var a=0;r>a;a++){var u=e.getDataAtCell(l,a),c=e.getCellMeta(l,a),h=c.search.callback||o,d=c.search.queryMethod||n,f=d(t,u);if(f){var g={row:l,col:a,data:u};s.push(g)}h&&h(e,l,a,u,f)}return s}},Handsontable.Search.DEFAULT_CALLBACK=function(e,t,o,n,i){e.getCellMeta(t,o).isSearchResult=i},Handsontable.Search.DEFAULT_QUERY_METHOD=function(e,t){return"undefined"!=typeof e&&null!=e&&e.toLowerCase&&0!==e.length?"undefined"==typeof t||null==t?!1:-1!=t.toString().toLowerCase().indexOf(e.toLowerCase()):!1},Handsontable.Search.DEFAULT_SEARCH_RESULT_CLASS="htSearchResult",Handsontable.Search.global=function(){var e=Handsontable.Search.DEFAULT_CALLBACK,t=Handsontable.Search.DEFAULT_QUERY_METHOD,o=Handsontable.Search.DEFAULT_SEARCH_RESULT_CLASS;return{getDefaultCallback:function(){return e},setDefaultCallback:function(t){e=t},getDefaultQueryMethod:function(){return t},setDefaultQueryMethod:function(e){t=e},getDefaultSearchResultClass:function(){return o},setDefaultSearchResultClass:function(e){o=e}}}(),Handsontable.SearchCellDecorator=function(e,t,o,n,i,r,s){var u=null!==s.search&&"object"==typeof s.search&&s.search.searchResultClass||Handsontable.Search.global.getDefaultSearchResultClass();s.isSearchResult?l(t,u):a(t,u)};var d=h("base");c("base",function(e,t,o,n,i,r,s){d.apply(this,arguments),Handsontable.SearchCellDecorator.apply(this,arguments)}),Handsontable.hooks.add("afterInit",n),Handsontable.hooks.add("afterUpdateSettings",n)},{"helpers/dom/element":45,renderers:91}],89:[function(e,t,o){"use strict";Object.defineProperties(o,{TouchScroll:{get:function(){return h}},__esModule:{value:!0}});var n,i,r,s=(n=e("helpers/dom/element"),n&&n.__esModule&&n||{"default":n}),l=s.addClass,a=s.removeClass,u=(i=e("_base"),i&&i.__esModule&&i||{"default":i})["default"],c=(r=e("plugins"),r&&r.__esModule&&r||{"default":r}).registerPlugin,h=function(e){var t=this;$traceurRuntime.superConstructor(d).call(this,e),this.hot.addHook("afterInit",function(){return t.afterInit()}),this.hot.addHook("afterUpdateSettings",function(){return t.onAfterUpdateSettings()}),this.scrollbars=[],this.clones=[]},d=h;$traceurRuntime.createClass(h,{afterInit:function(){this.registerEvents(),this.onAfterUpdateSettings()},onAfterUpdateSettings:function(){var e=this;this.hot.addHookOnce("afterRender",function(){var t=e.hot.view.wt.wtOverlays;e.scrollbars=[],e.scrollbars.push(t.topOverlay),t.bottomOverlay.clone&&e.scrollbars.push(t.bottomOverlay),e.scrollbars.push(t.leftOverlay),t.topLeftCornerOverlay&&e.scrollbars.push(t.topLeftCornerOverlay),t.bottomLeftCornerOverlay&&t.bottomLeftCornerOverlay.clone&&e.scrollbars.push(t.bottomLeftCornerOverlay),e.clones=[],t.topOverlay.needFullRender&&e.clones.push(t.topOverlay.clone.wtTable.holder.parentNode),t.bottomOverlay.needFullRender&&e.clones.push(t.bottomOverlay.clone.wtTable.holder.parentNode),t.leftOverlay.needFullRender&&e.clones.push(t.leftOverlay.clone.wtTable.holder.parentNode),t.topLeftCornerOverlay&&e.clones.push(t.topLeftCornerOverlay.clone.wtTable.holder.parentNode),t.bottomLeftCornerOverlay&&t.bottomLeftCornerOverlay.clone&&e.clones.push(t.bottomLeftCornerOverlay.clone.wtTable.holder.parentNode)})},registerEvents:function(){var e=this;this.hot.addHook("beforeTouchScroll",function(){return e.onBeforeTouchScroll()}),this.hot.addHook("afterMomentumScroll",function(){return e.onAfterMomentumScroll()})},onBeforeTouchScroll:function(){Handsontable.freezeOverlays=!0;for(var e=0,t=this.clones.length;t>e;e++)l(this.clones[e],"hide-tween")},onAfterMomentumScroll:function(){Handsontable.freezeOverlays=!1;for(var e=this,t=0,o=this.clones.length;o>t;t++)a(this.clones[t],"hide-tween");for(var n=0,i=this.clones.length;i>n;n++)l(this.clones[n],"show-tween");setTimeout(function(){for(var t=0,o=e.clones.length;o>t;t++)a(e.clones[t],"show-tween")},400);for(var r=0,s=this.scrollbars.length;s>r;r++)this.scrollbars[r].refresh(),this.scrollbars[r].resetFixedPosition();this.hot.view.wt.wtOverlays.syncScrollWithMaster()}},{},u),c("touchScroll",h)},{_base:59,"helpers/dom/element":45,plugins:58}],90:[function(e,t,o){"use strict";function n(){var e=this,t="undefined"==typeof e.getSettings().undo||e.getSettings().undo;t?e.undoRedo||(e.undoRedo=new Handsontable.UndoRedo(e),s(e),e.addHook("beforeKeyDown",i),e.addHook("afterChange",r)):e.undoRedo&&(delete e.undoRedo,l(e),e.removeHook("beforeKeyDown",i),e.removeHook("afterChange",r))}function i(e){var t=this,o=(e.ctrlKey||e.metaKey)&&!e.altKey;o&&(89===e.keyCode||e.shiftKey&&90===e.keyCode?(t.undoRedo.redo(),v(e)):90===e.keyCode&&(t.undoRedo.undo(),v(e)))}function r(e,t){var o=this;return"loadData"==t?o.undoRedo.clear():void 0}function s(e){e.undo=function(){return e.undoRedo.undo()},e.redo=function(){return e.undoRedo.redo()},e.isUndoAvailable=function(){return e.undoRedo.isUndoAvailable()},e.isRedoAvailable=function(){return e.undoRedo.isRedoAvailable()},e.clearUndo=function(){return e.undoRedo.clear()}}function l(e){delete e.undo,delete e.redo,delete e.isUndoAvailable,delete e.isRedoAvailable,delete e.clearUndo}var a,u,c,h,d=(a=e("helpers/array"),a&&a.__esModule&&a||{"default":a}).arrayMap,f=(u=e("helpers/number"),u&&u.__esModule&&u||{"default":u}),g=f.rangeEach,p=(f.rangeEachReverse,c=e("helpers/object"),c&&c.__esModule&&c||{"default":c}),m=p.inherit,w=p.deepClone,v=(h=e("helpers/dom/event"),h&&h.__esModule&&h||{"default":h}).stopImmediatePropagation;Handsontable.UndoRedo=function(e){var t=this;this.instance=e,this.doneActions=[],this.undoneActions=[],this.ignoreNewActions=!1,e.addHook("afterChange",function(e,o){if(e){var n=new Handsontable.UndoRedo.ChangeAction(e);t.done(n)}}),e.addHook("afterCreateRow",function(e,o,n){if(!n){var i=new Handsontable.UndoRedo.CreateRowAction(e,o);t.done(i)}}),e.addHook("beforeRemoveRow",function(e,o){var n=t.instance.getSourceData();e=(n.length+e)%n.length;var i=n.slice(e,e+o),r=new Handsontable.UndoRedo.RemoveRowAction(e,i);t.done(r)}),e.addHook("afterCreateCol",function(e,o,n){if(!n){var i=new Handsontable.UndoRedo.CreateColumnAction(e,o);t.done(i)}}),e.addHook("beforeRemoveCol",function(o,n){var i=t.instance.getData();o=(t.instance.countCols()+o)%t.instance.countCols();var r=[],s=[],l=[];g(0,i.length-1,function(e){r[e]=i[e].slice(o,o+n)}),g(0,n-1,function(t){l.push(e.runHooks("modifyCol",o+t))}),Array.isArray(e.getSettings().colHeaders)&&g(0,n-1,function(t){s.push(e.getSettings().colHeaders[e.runHooks("modifyCol",o+t)]||null)});var a=t.instance.getPlugin("manualColumnMove"),u=new Handsontable.UndoRedo.RemoveColumnAction(l,r,s,a?a.columnPositions:[]);t.done(u)}),e.addHook("beforeCellAlignment",function(e,o,n,i){var r=new Handsontable.UndoRedo.CellAlignmentAction(e,o,n,i);t.done(r)}),e.addHook("beforeFilter",function(e){t.done(new Handsontable.UndoRedo.FiltersAction(e))})},Handsontable.UndoRedo.prototype.done=function(e){this.ignoreNewActions||(this.doneActions.push(e),this.undoneActions.length=0)},Handsontable.UndoRedo.prototype.undo=function(){if(this.isUndoAvailable()){var e=this.doneActions.pop();this.ignoreNewActions=!0;var t=this;e.undo(this.instance,function(){t.ignoreNewActions=!1,t.undoneActions.push(e)})}},Handsontable.UndoRedo.prototype.redo=function(){if(this.isRedoAvailable()){var e=this.undoneActions.pop();this.ignoreNewActions=!0;var t=this;e.redo(this.instance,function(){t.ignoreNewActions=!1,t.doneActions.push(e)})}},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(e){this.changes=e},m(Handsontable.UndoRedo.ChangeAction,Handsontable.UndoRedo.Action),Handsontable.UndoRedo.ChangeAction.prototype.undo=function(e,t){for(var o=w(this.changes),n=e.countEmptyRows(!0),i=e.countEmptyCols(!0),r=0,s=o.length;s>r;r++)o[r].splice(3,1);e.addHookOnce("afterChange",t),e.setDataAtRowProp(o,null,null,"undo");for(var r=0,s=o.length;s>r;r++)e.getSettings().minSpareRows&&o[r][0]+1+e.getSettings().minSpareRows===e.countRows()&&n==e.getSettings().minSpareRows&&(e.alter("remove_row",parseInt(o[r][0]+1,10),e.getSettings().minSpareRows),e.undoRedo.doneActions.pop()),e.getSettings().minSpareCols&&o[r][1]+1+e.getSettings().minSpareCols===e.countCols()&&i==e.getSettings().minSpareCols&&(e.alter("remove_col",parseInt(o[r][1]+1,10),e.getSettings().minSpareCols),e.undoRedo.doneActions.pop())},Handsontable.UndoRedo.ChangeAction.prototype.redo=function(e,t){for(var o=w(this.changes),n=0,i=o.length;i>n;n++)o[n].splice(2,1);e.addHookOnce("afterChange",t),e.setDataAtRowProp(o,null,null,"redo")},Handsontable.UndoRedo.CreateRowAction=function(e,t){this.index=e,this.amount=t},m(Handsontable.UndoRedo.CreateRowAction,Handsontable.UndoRedo.Action),Handsontable.UndoRedo.CreateRowAction.prototype.undo=function(e,t){var o=e.countRows(),n=e.getSettings().minSpareRows;this.index>=o&&this.index-no;o++){if(m(t[o],O)&&null===e)return;d(t[o],e)}})}function d(e){var t=void 0!==arguments[1]?arguments[1]:null;null===t?e.checked=!e.checked:e.checked=t,b.fireEvent(e,"change")}function f(t){for(var o=e.getSelectedRange(),n=o.getTopLeftCorner(),i=o.getBottomRightCorner(),r=n.row;r<=i.row;r++)for(var s=n.col;s<=i.col;s++){var l=e.getCell(r,s),a=e.getCellMeta(r,s),u=l.querySelectorAll("input[type=checkbox]");u.length>0&&!a.readOnly&&t(u)}}var b=new v(e),C=i(),R=u.label,_=!1;if("undefined"==typeof u.checkedTemplate&&(u.checkedTemplate=!0),"undefined"==typeof u.uncheckedTemplate&&(u.uncheckedTemplate=!1),g(t),a===u.checkedTemplate||w(a,u.checkedTemplate)?C.checked=!0:a===u.uncheckedTemplate||w(a,u.uncheckedTemplate)?C.checked=!1:null===a?p(C,"noValue"):(C.style.display="none",p(C,O),_=!0),!_&&R){var M="";R.value?M="function"==typeof R.value?R.value.call(this,o,n,l,a):R.value:R.property&&(M=e.getDataAtRowProp(o,R.property));var H=r(M);"before"===R.position?H.appendChild(C):H.insertBefore(C,H.firstChild),C=H}t.appendChild(C),_&&t.appendChild(document.createTextNode("#bad-value#")),u.readOnly?b.addEventListener(C,"click",s):(b.addEventListener(C,"mouseup",function(){return setTimeout(e.listen,10)}),b.addEventListener(C,"change",function(t){e.setDataAtRowProp(o,l,t.target.checked?u.checkedTemplate:u.uncheckedTemplate)})),T.has(e)||(T.set(e,!0),e.addHook("beforeKeyDown",c))}function i(){var e=document.createElement("input");return e.className="htCheckboxRendererInput",e.type="checkbox",e.setAttribute("autocomplete","off"),e.setAttribute("tabindex","-1"),e.cloneNode(!1)}function r(e){var t=document.createElement("label");return t.className="htCheckboxRendererLabel",t.appendChild(document.createTextNode(e)),t.cloneNode(!0)}function s(e){e.preventDefault()}Object.defineProperties(o,{checkboxRenderer:{get:function(){return n}},__esModule:{value:!0}});var l,a,u,c,h,d,f=(l=e("helpers/dom/element"),l&&l.__esModule&&l||{"default":l}),g=f.empty,p=f.addClass,m=f.hasClass,w=(a=e("helpers/string"),a&&a.__esModule&&a||{"default":a}).equalsIgnoreCase,v=(u=e("eventManager"),u&&u.__esModule&&u||{"default":u}).EventManager,b=(c=e("renderers"),c&&c.__esModule&&c||{"default":c}),C=(b.getRenderer,b.registerRenderer),y=(h=e("helpers/unicode"),h&&h.__esModule&&h||{"default":h}).KEY_CODES,R=(d=e("helpers/dom/event"),d&&d.__esModule&&d||{"default":d}),E=(R.stopPropagation,R.stopImmediatePropagation),S=R.isImmediatePropagationStopped,T=new WeakMap,O="htBadValue";C("checkbox",n)},{eventManager:41,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/string":53,"helpers/unicode":54,renderers:91}],95:[function(e,t,o){"use strict";function n(e,t,o,n,i,r,l){a("base").apply(this,arguments),null!==r&&void 0!==r||(r=""),s(t,r)}Object.defineProperties(o,{htmlRenderer:{get:function(){return n}},__esModule:{value:!0}});var i,r,s=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}).fastInnerHTML,l=(r=e("renderers"),r&&r.__esModule&&r||{"default":r}),a=l.getRenderer,u=l.registerRenderer;u("html",n)},{"helpers/dom/element":45,renderers:91}],96:[function(e,t,o){"use strict";function n(e,t,o,n,i,r,s){f(r)&&("undefined"!=typeof s.language&&a.language(s.language),r=a(r).format(s.format||"0"),u(t,"htNumeric")),h("text")(e,t,o,n,i,r,s)}Object.defineProperties(o,{numericRenderer:{get:function(){return n}},__esModule:{value:!0}});var i,r,s,l,a=(i=e("numeral"),i&&i.__esModule&&i||{"default":i})["default"],u=(r=e("helpers/dom/element"),r&&r.__esModule&&r||{"default":r}).addClass,c=(s=e("renderers"),s&&s.__esModule&&s||{"default":s}),h=c.getRenderer,d=c.registerRenderer,f=(l=e("helpers/number"),l&&l.__esModule&&l||{"default":l}).isNumeric;d("numeric",n)},{"helpers/dom/element":45,"helpers/number":50,numeral:"numeral",renderers:91}],97:[function(e,t,o){"use strict";function n(e,t,o,n,i,r,l){a("text").apply(this,arguments),r=t.innerHTML;var u,c=l.hashLength||r.length,h=l.hashSymbol||"*";for(u="";u.split(h).length-1o&&(n.done=!1,n.value=e[o],++o),n}}});for(var s=r[t(Symbol.iterator)]();!(e=s.next()).done;)o[n++]=e.value}return o}var t=$traceurRuntime.toProperty;$traceurRuntime.spread=e}(),function(){function e(e,t){var o=p(e);do{var n=g(o,t);if(n)return n;o=p(o)}while(o)}function t(e){return e.__proto__}function o(e,t,o,i){return n(e,t,o).apply(e,i)}function n(t,o,n){var i=e(o,n);return i?i.get?i.get.call(t):i.value:void 0}function i(t,o,n,i){var r=e(o,n);if(r&&r.set)return r.set.call(t,i),i;throw c("super has no setter '"+n+"'.")}function r(e){for(var t={},o=v(e),n=0;n3?("function"==typeof n&&(e.__proto__=n),e.prototype=h(l(n),r(t))):e.prototype=t,f(e,"prototype",{configurable:!1,writable:!1}),d(e,r(o))}function l(e){if("function"==typeof e){var t=e.prototype;if(u(t)===t||null===t)return e.prototype;throw new c("super prototype must be an Object or null")}if(null===e)return null;throw new c("Super expression must either be null or a function, not "+typeof e+".")}function a(e,t,n){null!==p(t)&&o(e,t,"constructor",n)}var u=Object,c=TypeError,h=u.create,d=$traceurRuntime.defineProperties,f=$traceurRuntime.defineProperty,g=$traceurRuntime.getOwnPropertyDescriptor,p=Object.getPrototypeOf,m=$traceurRuntime.toProperty,w=Object,v=w.getOwnPropertyNames,b=w.getOwnPropertySymbols;$traceurRuntime.createClass=s,$traceurRuntime.defaultSuperCall=a,$traceurRuntime.superCall=o,$traceurRuntime.superConstructor=t,$traceurRuntime.superGet=n,$traceurRuntime.superSet=i}()},{}],100:[function(e,t,o){"use strict";function n(e){var t=this,o=this;this.eventManager=C(e),this.instance=e,this.settings=e.getSettings(),this.selectionMouseDown=!1;var n=e.rootElement.getAttribute("style");n&&e.rootElement.setAttribute("data-originalstyle",n),h(e.rootElement,"handsontable");var i=document.createElement("TABLE");h(i,"htCore"),e.getSettings().tableClassName&&h(i,e.getSettings().tableClassName),this.THEAD=document.createElement("THEAD"),i.appendChild(this.THEAD),this.TBODY=document.createElement("TBODY"),i.appendChild(this.TBODY),e.table=i,e.container.insertBefore(i,e.container.firstChild),this.eventManager.addEventListener(e.rootElement,"mousedown",function(e){this.selectionMouseDown=!0, +o.isTextSelectionAllowed(e.target)||(s(),e.preventDefault(),window.focus())}),this.eventManager.addEventListener(e.rootElement,"mouseup",function(e){this.selectionMouseDown=!1}),this.eventManager.addEventListener(e.rootElement,"mousemove",function(e){this.selectionMouseDown&&!o.isTextSelectionAllowed(e.target)&&(s(),e.preventDefault())}),this.eventManager.addEventListener(document.documentElement,"keyup",function(t){e.selection.isInProgress()&&!t.shiftKey&&e.selection.finish()});var r;this.isMouseDown=function(){return r},this.eventManager.addEventListener(document.documentElement,"mouseup",function(t){e.selection.isInProgress()&&1===t.which&&e.selection.finish(),r=!1,b(document.activeElement)&&e.unlisten()}),this.eventManager.addEventListener(document.documentElement,"mousedown",function(t){var n=t.target,i=t.x||t.clientX,s=t.y||t.clientY;if(!r&&e.rootElement){if(n===e.view.wt.wtTable.holder){var l=p();if(document.elementFromPoint(i+l,s)!==e.view.wt.wtTable.holder||document.elementFromPoint(i,s+l)!==e.view.wt.wtTable.holder)return}else for(;n!==document.documentElement;){if(null===n){if(t.isTargetWebComponent)break;return}if(n===e.rootElement)return;n=n.parentNode}o.settings.outsideClickDeselects?e.deselectCell():e.destroyEditor()}}),this.eventManager.addEventListener(i,"selectstart",function(e){o.settings.fragmentSelection||v(e.target)||e.preventDefault()});var s=function(){window.getSelection?window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges():document.selection&&document.selection.empty()},l=[new T({className:"current",border:{width:2,color:"#5292F7",cornerVisible:function(){return o.settings.fillHandle&&!o.isCellEdited()&&!e.selection.isMultiple()},multipleSelectionHandlesVisible:function(){return!o.isCellEdited()&&!e.selection.isMultiple()}}}),new T({className:"area",border:{width:1,color:"#89AFF9",cornerVisible:function(){return o.settings.fillHandle&&!o.isCellEdited()&&e.selection.isMultiple()},multipleSelectionHandlesVisible:function(){return!o.isCellEdited()&&e.selection.isMultiple()}}}),new T({className:"highlight",highlightRowClassName:o.settings.currentRowClassName,highlightColumnClassName:o.settings.currentColClassName}),new T({className:"fill",border:{width:1,color:"red"}})];l.current=l[0],l.area=l[1],l.highlight=l[2],l.fill=l[3];var a={debug:function(){return o.settings.debug},externalRowCalculator:this.instance.getPlugin("autoRowSize")&&this.instance.getPlugin("autoRowSize").isEnabled(),table:i,preventOverflow:function(){return t.settings.preventOverflow},stretchH:function(){return o.settings.stretchH},data:e.getDataAtCell,totalRows:function(){return e.countRows()},totalColumns:function(){return e.countCols()},fixedColumnsLeft:function(){return o.settings.fixedColumnsLeft},fixedRowsTop:function(){return o.settings.fixedRowsTop},fixedRowsBottom:function(){return o.settings.fixedRowsBottom},minSpareRows:function(){return o.settings.minSpareRows},renderAllRows:o.settings.renderAllRows,rowHeaders:function(){var t=[];return e.hasRowHeaders()&&t.push(function(e,t){o.appendRowHeader(e,t)}),Handsontable.hooks.run(e,"afterGetRowHeaderRenderers",t),t},columnHeaders:function(){var t=[];return e.hasColHeaders()&&t.push(function(e,t){o.appendColHeader(e,t)}),Handsontable.hooks.run(e,"afterGetColumnHeaderRenderers",t),t},columnWidth:e.getColWidth,rowHeight:e.getRowHeight,cellRenderer:function(e,t,n){var i=o.instance.colToProp(t),r=o.instance.getCellMeta(e,t),s=o.instance.getCellRenderer(r),l=o.instance.getDataAtRowProp(e,i);s(o.instance,n,e,t,i,l,r),Handsontable.hooks.run(o.instance,"afterRenderer",n,e,t,i,l,r)},selections:l,hideBorderOnMouseDownOver:function(){return o.settings.fragmentSelection},onCellMouseDown:function(t,n,i,s){var l,a,u=i.parentNode,c=u.parentNode;if(e.listen(),o.activeWt=s,r=!0,Handsontable.hooks.run(e,"beforeOnCellMouseDown",t,n,i),e.selection.setSelectedHeaders(!1,!1),!E(t)){if(2===t.button&&e.selection.inInSelection(n));else t.shiftKey?n.row>=0&&n.col>=0&&e.selection.setRangeEnd(n):(n.row<0||n.col<0)&&(n.row>=0||n.col>=0)?(n.row<0&&(l=c.childNodes.length-Array.prototype.indexOf.call(c.childNodes,u)-1,a=e.getHeaderColspan(n.col,l),e.selection.setSelectedHeaders(!1,!0),e.selectCell(0,n.col,e.countRows()-1,n.col+Math.max(0,a-1))),n.col<0&&(e.selection.setSelectedHeaders(!0,!1),e.selectCell(n.row,0,n.row,e.countCols()-1))):(n.row=n.row<0?0:n.row,n.col=n.col<0?0:n.col,e.selection.setRangeStart(n));Handsontable.hooks.run(e,"afterOnCellMouseDown",t,n,i),o.activeWt=o.wt}},onCellMouseOver:function(t,n,i,s){o.activeWt=s,n.row>=0&&n.col>=0?r&&e.selection.setRangeEnd(n):r&&(n.row<0&&(e.selection.selectedHeader.cols?(e.selection.setRangeEnd(new S(e.countRows()-1,n.col)),e.selection.setSelectedHeaders(!1,!0)):e.selection.setRangeEnd(new S(n.row,n.col))),n.col<0&&(e.selection.selectedHeader.rows?(e.selection.setRangeEnd(new S(n.row,e.countCols()-1)),e.selection.setSelectedHeaders(!0,!1)):e.selection.setRangeEnd(new S(n.row,n.col)))),Handsontable.hooks.run(e,"afterOnCellMouseOver",t,n,i),o.activeWt=o.wt},onCellCornerMouseDown:function(t){t.preventDefault(),Handsontable.hooks.run(e,"afterOnCellCornerMouseDown",t)},beforeDraw:function(e){o.beforeRender(e)},onDraw:function(e){o.onDraw(e)},onScrollVertically:function(){e.runHooks("afterScrollVertically")},onScrollHorizontally:function(){e.runHooks("afterScrollHorizontally")},onBeforeDrawBorders:function(t,o){e.runHooks("beforeDrawBorders",t,o)},onBeforeTouchScroll:function(){e.runHooks("beforeTouchScroll")},onAfterMomentumScroll:function(){e.runHooks("afterMomentumScroll")},onBeforeStretchingColumnWidth:function(t,o){return e.runHooks("beforeStretchingColumnWidth",t,o)},viewportRowCalculatorOverride:function(t){var n=e.countRows(),i=o.settings.viewportRowRenderingOffset;if("auto"===i&&o.settings.fixedRowsTop&&(i=10),"number"==typeof i&&(t.startRow=Math.max(t.startRow-i,0),t.endRow=Math.min(t.endRow+i,n-1)),"auto"===i){var r=t.startRow+t.endRow-t.startRow,s=Math.ceil(r/n*12);t.startRow=Math.max(t.startRow-s,0),t.endRow=Math.min(t.endRow+s,n-1)}e.runHooks("afterViewportRowCalculatorOverride",t)},viewportColumnCalculatorOverride:function(t){var n=e.countCols(),i=o.settings.viewportColumnRenderingOffset;if("auto"===i&&o.settings.fixedColumnsLeft&&(i=10),"number"==typeof i&&(t.startColumn=Math.max(t.startColumn-i,0),t.endColumn=Math.min(t.endColumn+i,n-1)),"auto"===i){var r=t.startColumn+t.endColumn-t.startColumn,s=Math.ceil(r/n*12);t.startRow=Math.max(t.startColumn-s,0),t.endColumn=Math.min(t.endColumn+s,n-1)}e.runHooks("afterViewportColumnCalculatorOverride",t)},rowHeaderWidth:function(){return o.settings.rowHeaderWidth},columnHeaderHeight:function(){return o.settings.columnHeaderHeight}};Handsontable.hooks.run(e,"beforeInitWalkontable",a),this.wt=new O(a),this.activeWt=this.wt,this.eventManager.addEventListener(o.wt.wtTable.spreader,"mousedown",function(e){e.target===o.wt.wtTable.spreader&&3===e.which&&R(e)}),this.eventManager.addEventListener(o.wt.wtTable.spreader,"contextmenu",function(e){e.target===o.wt.wtTable.spreader&&3===e.which&&R(e)}),this.eventManager.addEventListener(document.documentElement,"click",function(){o.settings.observeDOMVisibility&&o.wt.drawInterrupted&&(o.instance.forceFullRender=!0,o.render())})}Object.defineProperties(o,{TableView:{get:function(){return n}},__esModule:{value:!0}});var i,r,s,l,a,u,c=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),h=c.addClass,d=c.empty,f=c.fastInnerHTML,g=c.fastInnerText,p=c.getScrollbarWidth,m=c.hasClass,w=c.isChildOf,v=c.isInput,b=c.isOutsideInput,C=(r=e("eventManager"),r&&r.__esModule&&r||{"default":r}).eventManager,y=(s=e("helpers/dom/event"),s&&s.__esModule&&s||{"default":s}),R=y.stopPropagation,E=y.isImmediatePropagationStopped,S=(l=e("3rdparty/walkontable/src/cell/coords"),l&&l.__esModule&&l||{"default":l}).WalkontableCellCoords,T=(a=e("3rdparty/walkontable/src/selection"),a&&a.__esModule&&a||{"default":a}).WalkontableSelection,O=(u=e("3rdparty/walkontable/src/core"),u&&u.__esModule&&u||{"default":u}).Walkontable;Handsontable.TableView=n,n.prototype.isTextSelectionAllowed=function(e){if(v(e))return!0;var t=w(e,this.instance.view.wt.wtTable.spreader);return this.settings.fragmentSelection===!0&&t?!0:!("cell"!==this.settings.fragmentSelection||!this.isSelectedOnlyCell()||!t)},n.prototype.isSelectedOnlyCell=function(){var e=this.instance.getSelected()||[],t=e[0],o=e[1],n=e[2],i=e[3];return void 0!==t&&t===n&&o===i},n.prototype.isCellEdited=function(){var e=this.instance.getActiveEditor();return e&&e.isOpened()},n.prototype.beforeRender=function(e){e&&Handsontable.hooks.run(this.instance,"beforeRender",this.instance.forceFullRender)},n.prototype.onDraw=function(e){e&&Handsontable.hooks.run(this.instance,"afterRender",this.instance.forceFullRender)},n.prototype.render=function(){this.wt.draw(!this.instance.forceFullRender),this.instance.forceFullRender=!1,this.instance.renderCall=!1},n.prototype.getCellAtCoords=function(e,t){var o=this.wt.getCell(e,t);return 0>o?null:o},n.prototype.scrollViewport=function(e){this.wt.scrollViewport(e)},n.prototype.appendRowHeader=function(e,t){if(t.firstChild){var o=t.firstChild;if(!m(o,"relative"))return d(t),void this.appendRowHeader(e,t);this.updateCellHeader(o.querySelector(".rowHeader"),e,this.instance.getRowHeader)}else{var n=document.createElement("div"),i=document.createElement("span");n.className="relative",i.className="rowHeader",this.updateCellHeader(i,e,this.instance.getRowHeader),n.appendChild(i),t.appendChild(n)}Handsontable.hooks.run(this.instance,"afterGetRowHeader",e,t)},n.prototype.appendColHeader=function(e,t){if(t.firstChild){var o=t.firstChild;m(o,"relative")?this.updateCellHeader(o.querySelector(".colHeader"),e,this.instance.getColHeader):(d(t),this.appendColHeader(e,t))}else{var n=document.createElement("div"),i=document.createElement("span");n.className="relative",i.className="colHeader",this.updateCellHeader(i,e,this.instance.getColHeader),n.appendChild(i),t.appendChild(n)}Handsontable.hooks.run(this.instance,"afterGetColHeader",e,t)},n.prototype.updateCellHeader=function(e,t,o){t>-1?f(e,o(t)):(g(e,String.fromCharCode(160)),h(e,"cornerHeader"))},n.prototype.maximumVisibleElementWidth=function(e){var t=this.wt.wtViewport.getWorkspaceWidth(),o=t-e;return o>0?o:0},n.prototype.maximumVisibleElementHeight=function(e){var t=this.wt.wtViewport.getWorkspaceHeight(),o=t-e;return o>0?o:0},n.prototype.mainViewIsActive=function(){return this.wt===this.activeWt},n.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}],101:[function(e,t,o){"use strict";Object.defineProperties(o,{GhostTable:{get:function(){return f}},__esModule:{value:!0}});var n,i,r,s,l,a=(n=e("helpers/dom/element"),n&&n.__esModule&&n||{"default":n}),u=a.addClass,c=a.outerHeight,h=a.outerWidth,d=(i=e("helpers/array"),i&&i.__esModule&&i||{"default":i}).arrayEach,f=((r=e("helpers/object"),r&&r.__esModule&&r||{"default":r}).objectEach,(s=e("helpers/number"),s&&s.__esModule&&s||{"default":s}).rangeEach,(l=e("helpers/mixed"),l&&l.__esModule&&l||{"default":l}).stringify,function(e){this.hot=e,this.container=null,this.injected=!1,this.rows=[],this.columns=[],this.samples=null});$traceurRuntime.createClass(f,{addRow:function(e,t){if(this.columns.length)throw new Error("Doesn't support multi-dimensional table");this.rows.length||(this.container=this.createContainer(this.hot.rootElement.className));var o={row:e};this.rows.push(o),this.samples=t,this.table=this.createTable(this.hot.table.className),this.table.colGroup.appendChild(this.createColGroupsCol()),this.table.tr.appendChild(this.createRow(e)),this.container.container.appendChild(this.table.fragment),o.table=this.table.table},addColumn:function(e,t){if(this.rows.length)throw new Error("Doesn't support multi-dimensional table");this.columns.length||(this.container=this.createContainer(this.hot.rootElement.className));var o={col:e};this.columns.push(o),this.samples=t,this.table=this.createTable(this.hot.table.className),null!==this.hot.getColHeader(e)&&this.hot.view.appendColHeader(e,this.table.th),this.table.tBody.appendChild(this.createCol(e)),this.container.container.appendChild(this.table.fragment),o.table=this.table.table},getHeights:function(e){this.injected||this.injectTable(),d(this.rows,function(t){e(t.row,c(t.table)-1)})},getWidths:function(e){this.injected||this.injectTable(),d(this.columns,function(t){e(t.col,h(t.table))})},createColGroupsCol:function(){var e=this,t=document,o=t.createDocumentFragment();return o.appendChild(this.createColElement(-1)),this.samples.forEach(function(t){d(t.strings,function(t){o.appendChild(e.createColElement(t.col))})}),o},createRow:function(e){var t=this,o=document,n=o.createDocumentFragment(),i=o.createElement("th");return null!==this.hot.getRowHeader(e)&&this.hot.view.appendRowHeader(e,i),n.appendChild(i),this.samples.forEach(function(i){d(i.strings,function(i){var r=i.col,s=t.hot.getCellMeta(e,r);s.col=r,s.row=e;var l=t.hot.getCellRenderer(s),a=o.createElement("td");l(t.hot,a,e,r,t.hot.colToProp(r),i.value,s),n.appendChild(a)})}),n},createCol:function(e){var t=this,o=document,n=o.createDocumentFragment();return this.samples.forEach(function(i){d(i.strings,function(i){var r=i.row,s=t.hot.getCellMeta(r,e);s.col=e,s.row=r;var l=t.hot.getCellRenderer(s),a=o.createElement("td"),u=o.createElement("tr");l(t.hot,a,r,e,t.hot.colToProp(e),i.value,s),u.appendChild(a),n.appendChild(u)})}),n},clean:function(){this.rows.length=0,this.columns.length=0,this.samples&&this.samples.clear(),this.samples=null,this.removeTable()},injectTable:function(){var e=void 0!==arguments[0]?arguments[0]:null;this.injected||((e||this.hot.rootElement).appendChild(this.container.fragment),this.injected=!0)},removeTable:function(){this.injected&&this.container.container.parentNode&&(this.container.container.parentNode.removeChild(this.container.container),this.container=null,this.injected=!1)},createColElement:function(e){var t=document,o=t.createElement("col");return o.style.width=this.hot.view.wt.wtTable.getStretchedColumnWidth(e)+"px",o},createTable:function(){var e=void 0!==arguments[0]?arguments[0]:"",t=document,o=t.createDocumentFragment(),n=t.createElement("table"),i=t.createElement("thead"),r=t.createElement("tbody"),s=t.createElement("colgroup"),l=t.createElement("tr"),a=t.createElement("th");return this.isVertical()&&n.appendChild(s),this.isHorizontal()&&(l.appendChild(a),i.appendChild(l),n.style.tableLayout="auto",n.style.width="auto"),n.appendChild(i),this.isVertical()&&r.appendChild(l),n.appendChild(r),u(n,e),o.appendChild(n),{fragment:o,table:n,tHead:i,tBody:r,colGroup:s,tr:l,th:a}},createContainer:function(){var e=void 0!==arguments[0]?arguments[0]:"",t=document,o=t.createDocumentFragment(),n=t.createElement("div");return e="htGhostTable htAutoSize "+e.trim(),u(n,e),o.appendChild(n),{fragment:o,container:n}},isVertical:function(){return!(!this.rows.length||this.columns.length)},isHorizontal:function(){return!(!this.columns.length||this.rows.length)}},{}),Handsontable.utils=Handsontable.utils||{},Handsontable.utils.GhostTable=f},{"helpers/array":42,"helpers/dom/element":45,"helpers/mixed":49,"helpers/number":50,"helpers/object":51}],102:[function(e,t,o){"use strict";function n(e){return"string"==typeof e&&/fps$/.test(e)&&(e=1e3/parseInt(e.replace("fps","")||0,10)),e}Object.defineProperties(o,{Interval:{get:function(){return d}},__esModule:{value:!0}});var i,r,s,l,a,u=(i=e("helpers/feature"),i&&i.__esModule&&i||{"default":i}),c=u.requestAnimationFrame,h=u.cancelAnimationFrame,d=((r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}).arrayEach,(s=e("helpers/object"),s&&s.__esModule&&s||{"default":s}).objectEach,(l=e("helpers/number"),l&&l.__esModule&&l||{"default":l}).rangeEach,(a=e("helpers/mixed"),a&&a.__esModule&&a||{"default":a}).stringify,function(e,t){var o=this;this.timer=null,this.func=e,this.delay=n(t),this.stopped=!0,this._then=null,this._callback=function(){return o.__callback()}}),f=d;$traceurRuntime.createClass(d,{start:function(){return this.stopped&&(this._then=Date.now(),this.stopped=!1,this.timer=c(this._callback)),this},stop:function(){return this.stopped||(this.stopped=!0,h(this.timer),this.timer=null),this},__callback:function(){if(this.timer=c(this._callback),this.delay){var e=Date.now(),t=e-this._then;t>this.delay&&(this._then=e-t%this.delay,this.func())}else this.func()}},{create:function(e,t){return new f(e,t)}}),Handsontable.utils=Handsontable.utils||{},Handsontable.utils.Interval=d},{"helpers/array":42,"helpers/feature":47,"helpers/mixed":49,"helpers/number":50,"helpers/object":51}],103:[function(e,t,o){"use strict";var n;Object.defineProperties(o,{SamplesGenerator:{get:function(){return g}},__esModule:{value:!0}});var i,r,s,l,a,u=(i=e("helpers/dom/element"),i&&i.__esModule&&i||{"default":i}),c=(u.addClass,u.outerHeight,u.outerWidth,(r=e("helpers/array"),r&&r.__esModule&&r||{"default":r}).arrayEach,s=e("helpers/object"),s&&s.__esModule&&s||{"default":s}),h=(c.objectEach,c.isObject),d=(l=e("helpers/number"),l&&l.__esModule&&l||{"default":l}).rangeEach,f=(a=e("helpers/mixed"),a&&a.__esModule&&a||{"default":a}).stringify,g=function(e){this.samples=null,this.dataFactory=e,this.customSampleCount=null},p=g;$traceurRuntime.createClass(g,(n={},Object.defineProperty(n,"getSampleCount",{value:function(){return this.customSampleCount?this.customSampleCount:p.SAMPLE_COUNT},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(n,"generateRowSamples",{value:function(e,t){return this.generateSamples("row",t,e)},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(n,"generateColumnSamples",{value:function(e,t){return this.generateSamples("col",t,e)},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(n,"generateSamples",{value:function(e,t,o){var n=this,i=new Map;return"number"==typeof o&&(o={from:o,to:o}),d(o.from,o.to,function(o){var r=n.generateSample(e,t,o);i.set(o,r)}),i},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(n,"generateSample",{value:function(e,t,o){var n,i=this,r=new Map,s=[];return d(t.from,t.to,function(t){var l,a;if("row"===e)a=i.dataFactory(o,t);else{if("col"!==e)throw new Error("Unsupported sample type");a=i.dataFactory(t,o)}n=h(a)?Object.keys(a).length:Array.isArray(a)?a.length:f(a).length,r.has(n)||r.set(n,{needed:i.getSampleCount(),strings:[]});var u=r.get(n);if(u.needed){var c=s.indexOf(a)>-1;if(!c){var d="row"===e?"col":"row";u.strings.push((l={},Object.defineProperty(l,"value",{value:a,configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(l,d,{value:t,configurable:!0,enumerable:!0,writable:!0}),l)),s.push(a),u.needed--}}}),r},configurable:!0,enumerable:!0,writable:!0}),n),{get SAMPLE_COUNT(){return 3}}),Handsontable.utils=Handsontable.utils||{},Handsontable.utils.SamplesGenerator=g},{"helpers/array":42,"helpers/dom/element":45,"helpers/mixed":49,"helpers/number":50,"helpers/object":51}],104:[function(e,t,o){"use strict";function n(e,t){var o=e,n="string"==typeof o?o.toLowerCase():null;return function(e){for(var i=!1,s=0,l=e.length;l>s;s++){if(o===e[s]){i=!0;break}if(n===r(e[s]).toLowerCase()){i=!0;break}}t(i)}}var i,r=(i=e("helpers/mixed"),i&&i.__esModule&&i||{"default":i}).stringify;Handsontable.AutocompleteValidator=function(e,t){this.strict&&this.source?"function"==typeof this.source?this.source(e,n(e,t)):n(e,t)(this.source):t(!0)}},{"helpers/mixed":49}],105:[function(e,t,o){"use strict";var n,i,r=(n=e("moment"),n&&n.__esModule&&n||{"default":n})["default"],s=(i=e("editors"),i&&i.__esModule&&i||{"default":i}).getEditor;Handsontable.DateValidator=function(e,t){var o=!0,n=s("date",this.instance);null==e&&(e="");var i=r(new Date(e)).isValid(),a=r(e,this.dateFormat||n.defaultDateFormat,!0).isValid();if(this.allowEmpty&&""===e&&(i=!0,a=!0),i||(o=!1),!i&&a&&(o=!0),i&&!a)if(this.correctFormat===!0){var u=l(e,this.dateFormat);this.instance.setDataAtCell(this.row,this.col,u,"dateValidator"),o=!0}else o=!1;t(o)};var l=function(e,t){var o=r(new Date(e)),n=o.format("YYYY"),i=r().format("YYYY");return n.substr(0,2)!==i.substr(0,2)?e.match(new RegExp(n))||o.year(n.replace(n.substr(0,2),i.substr(0,2))):n.length>4&&o.year((o.year()+"").substr(0,4)),o.format(t)}},{editors:29,moment:void 0}],106:[function(e,t,o){"use strict";Handsontable.NumericValidator=function(e,t){null==e&&(e=""),t(this.allowEmpty&&""===e?!0:""===e?!1:/^-?\d*(\.|\,)?\d*$/.test(e))}},{}],107:[function(e,t,o){"use strict";var n,i,r=(n=e("moment"),n&&n.__esModule&&n||{"default":n})["default"],s=((i=e("editors"),i&&i.__esModule&&i||{"default":i}).getEditor,["YYYY-MM-DDTHH:mm:ss.SSSZ"]);Handsontable.TimeValidator=function(e,t){var o=!0,n=this.timeFormat||"h:mm:ss a";null===e&&(e=""),"number"==typeof e&&(e=""+e),/^\d{9,10}$/.test(e)?e=new Date(parseInt(e+"000",10)):/^\d{13}$/.test(e)&&(e=new Date(parseInt(e,10)));var i=r(e,s,!0).isValid()?r(new Date(e)):r(e,n),l=i.isValid(),a=r(e,n,!0).isValid();if(this.allowEmpty&&""===e&&(l=!0,a=!0),l||(o=!1),!l&&a&&(o=!0),l&&!a)if(this.correctFormat===!0){var u=i.format(n);this.instance.setDataAtCell(this.row,this.col,u,"timeValidator"),o=!0}else o=!1;t(o)}},{editors:29,moment:void 0}],SheetClip:[function(e,t,o){"use strict";!function(e){function t(e){return e.split('"').length-1}var n={parse:function(e){var o,n,i,r,s,l,a,u=[],c=0;for(i=e.split("\n"),i.length>1&&""===i[i.length-1]&&i.pop(),o=0,n=i.length;n>o;o+=1){for(i[o]=i[o].split(" "),r=0,s=i[o].length;s>r;r+=1)u[c]||(u[c]=[]),l&&0===r?(a=u[c].length-1,u[c][a]=u[c][a]+"\n"+i[o][0],l&&1&t(i[o][0])&&(l=!1,u[c][a]=u[c][a].substring(0,u[c][a].length-1).replace(/""/g,'"'))):r===s-1&&0===i[o][r].indexOf('"')&&1&t(i[o][r])?(u[c].push(i[o][r].substring(1).replace(/""/g,'"')),l=!0):(u[c].push(i[o][r].replace(/""/g,'"')),l=!1);l||(c+=1)}return u},stringify:function(e){var t,o,n,i,r,s="";for(t=0,o=e.length;o>t;t+=1){for(i=e[t].length,n=0;i>n;n+=1)n>0&&(s+=" "),r=e[t][n],s+="string"==typeof r?r.indexOf("\n")>-1?'"'+r.replace(/"/g,'""')+'"':r:null===r||void 0===r?"":r;s+="\n"}return s}};"undefined"!=typeof o?(o.parse=n.parse,o.stringify=n.stringify):e.SheetClip=n}(window)},{}],autoResize:[function(e,t,o){"use strict";function n(){var e,t={minHeight:200,maxHeight:300,minWidth:100,maxWidth:300},o=document.body,n=document.createTextNode(""),i=document.createElement("SPAN"),r=function(e,t,o){window.attachEvent?e.attachEvent("on"+t,o):e.addEventListener(t,o,!1)},s=function(e,t,o){window.removeEventListener?e.removeEventListener(t,o,!1):e.detachEvent("on"+t,o)},l=function(r){var s,l;r?/^[a-zA-Z \.,\\\/\|0-9]$/.test(r)||(r="."):r="",void 0!==n.textContent?n.textContent=e.value+r:n.data=e.value+r,i.style.fontSize=Handsontable.Dom.getComputedStyle(e).fontSize,i.style.fontFamily=Handsontable.Dom.getComputedStyle(e).fontFamily,i.style.whiteSpace="pre",o.appendChild(i),s=i.clientWidth+2,o.removeChild(i),e.style.height=t.minHeight+"px",t.minWidth>s?e.style.width=t.minWidth+"px":s>t.maxWidth?e.style.width=t.maxWidth+"px":e.style.width=s+"px",l=e.scrollHeight?e.scrollHeight-1:0,t.minHeight>l?e.style.height=t.minHeight+"px":t.maxHeight-1||"true"===e.contentEditable}var o=this,n=!1;if(e.metaKey?n=!0:e.ctrlKey&&-1===navigator.userAgent.indexOf("Mac")&&(n=!0),n){if(document.activeElement!==this.elTextarea&&(""!==this.getSelectionText()||t()))return;this.selectNodeText(this.elTextarea),setTimeout(function(){document.activeElement!==o.elTextarea&&o.selectNodeText(o.elTextarea)},0)}!n||67!==e.keyCode&&86!==e.keyCode&&88!==e.keyCode||(88===e.keyCode?setTimeout(function(){o.triggerCut(e)},0):86===e.keyCode&&setTimeout(function(){o.triggerPaste(e)},0))},i.prototype.selectNodeText=function(e){e&&e.select()},i.prototype.getSelectionText=function(){var e="";return window.getSelection?e=window.getSelection().toString():document.selection&&"Control"!==document.selection.type&&(e=document.selection.createRange().text),e},i.prototype.copyable=function(e){if("string"!=typeof e&&void 0===e.toString)throw new Error("copyable requires string parameter");this.elTextarea.value=e,this.selectNodeText(this.elTextarea)},i.prototype.onCut=function(e){this.cutCallbacks.push(e)},i.prototype.onPaste=function(e){this.pasteCallbacks.push(e)},i.prototype.removeCallback=function(e){var t,o;for(t=0,o=this.copyCallbacks.length;o>t;t++)if(this.copyCallbacks[t]===e)return this.copyCallbacks.splice(t,1),!0;for(t=0,o=this.cutCallbacks.length;o>t;t++)if(this.cutCallbacks[t]===e)return this.cutCallbacks.splice(t,1),!0;for(t=0,o=this.pasteCallbacks.length;o>t;t++)if(this.pasteCallbacks[t]===e)return this.pasteCallbacks.splice(t,1),!0;return!1},i.prototype.triggerCut=function(e){var t=this;t.cutCallbacks&&setTimeout(function(){for(var o=0,n=t.cutCallbacks.length;n>o;o++)t.cutCallbacks[o](e)},50)},i.prototype.triggerPaste=function(e,t){var o=this;o.pasteCallbacks&&setTimeout(function(){for(var n=t||o.elTextarea.value,i=0,r=o.pasteCallbacks.length;r>i;i++)o.pasteCallbacks[i](n,e)},50)},i.prototype.destroy=function(){this.hasBeenDestroyed()||0!==--this.refCounter||(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)},i.prototype.hasBeenDestroyed=function(){return!this.refCounter}},{}],es6collections:[function(e,t,o){"use strict";!function(e){function t(e,t){function n(e){return this&&this.constructor===n?(this._keys=[],this._values=[],this._itp=[],this.objectOnly=t,void(e&&o.call(this,e))):new n(e)}return t||b(e,"size",{get:m}),e.constructor=n,n.prototype=e,n}function o(e){this.add?e.forEach(this.add,this):e.forEach(function(e){this.set(e[0],e[1])},this)}function n(e){return this.has(e)&&(this._keys.splice(v,1),this._values.splice(v,1),this._itp.forEach(function(e){v-1}function i(e){return this.has(e)?this._values[v]:void 0}function r(e,t){if(this.objectOnly&&t!==Object(t))throw new TypeError("Invalid value used as weak collection key");if(t!=t||0===t)for(v=e.length;v--&&!C(e[v],t););else v=e.indexOf(t);return v>-1}function s(e){return r.call(this,this._values,e)}function l(e){return r.call(this,this._keys,e)}function a(e,t){return this.has(e)?this._values[v]=t:this._values[this._keys.push(e)-1]=t,this}function u(e){return this.has(e)||this._values.push(e),this}function c(){this._values.length=0}function h(){return p(this._itp,this._keys)}function d(){return p(this._itp,this._values)}function f(){return p(this._itp,this._keys,this._values)}function g(){return p(this._itp,this._values,this._values)}function p(e,t,o){var n=[0],i=!1;return e.push(n),{next:function(){var r,s=n[0];return!i&&st;t++)if(v[t].obj===e)return v[t]}function r(e){for(var t=0,o=v.length;o>t;t++)v[t]===e&&v.splice(t,1)}function s(e,t){for(var o=0,n=e.observers.length;n>o;o++)if(e.observers[o].callback===t)return e.observers[o].observer}function l(e,t){for(var o=0,n=e.observers.length;n>o;o++)if(e.observers[o].observer===t)return e.observers.splice(o,1),void(e.observers.length||r(e))}function a(e,t){d(t),Object.observe?h(t,e):clearTimeout(t.next);var o=i(e);l(o,t)}function u(e,t){var o,r=[],l=e,a=i(e);if(a?o=s(a,t):(a=new b(e),v.push(a)),o)return o;if(Object.observe)o=function(i){h(o,e),c(o,e);for(var s=0,a=i.length;a>s;){if(("length"!==i[s].name||!R(i[s].object))&&"__Jasmine_been_here_before__"!==i[s].name){var u=i[s].type;switch(u){case"new":u="add";break;case"deleted":u="delete";break;case"updated":u="update"}w[u].call(i[s],r,n(l,i[s].object))}s++}r&&t&&t(r),o.patches=r,r=[]};else if(o={},a.value=JSON.parse(JSON.stringify(e)),t){o.callback=t,o.next=null;var u=this.intervals||[100,1e3,1e4,6e4],f=0,g=function(){d(o)},p=function(){clearTimeout(o.next),o.next=setTimeout(function(){g(),f=0,o.next=setTimeout(m,u[f++])},0)},m=function(){g(),f==u.length&&(f=u.length-1), +o.next=setTimeout(m,u[f++])};"undefined"!=typeof window&&(window.addEventListener?(window.addEventListener("mousedown",p),window.addEventListener("mouseup",p),window.addEventListener("keydown",p)):(window.attachEvent("onmousedown",p),window.attachEvent("onmouseup",p),window.attachEvent("onkeydown",p))),o.next=setTimeout(m,u[f++])}return o.patches=r,o.object=e,a.observers.push(new C(t,o)),c(o,e)}function c(e,t){if(Object.observe){Object.observe(t,e);for(var o in t)if(t.hasOwnProperty(o)){var n=t[o];n&&"object"==typeof n&&c(e,n)}}return e}function h(e,t){if(Object.observe){Object.unobserve(t,e);for(var o in t)if(t.hasOwnProperty(o)){var n=t[o];n&&"object"==typeof n&&h(e,n)}}return e}function d(e){if(Object.observe)Object.deliverChangeRecords(e);else{for(var t,o=0,n=v.length;n>o;o++)if(v[o].obj===e.object){t=v[o];break}t&&f(t.value,e.object,e.patches,"")}var i=e.patches;return i.length>0&&(e.patches=[],e.callback&&e.callback(i)),i}function f(e,o,n,i){for(var r=y(o),s=y(e),l=!1,a=!1,u=s.length-1;u>=0;u--){var c=s[u],h=e[c];if(o.hasOwnProperty(c)){var d=o[c];h instanceof Object?f(h,d,n,i+"/"+t(c)):h!=d&&(l=!0,n.push({op:"replace",path:i+"/"+t(c),value:d}),e[c]=d)}else n.push({op:"remove",path:i+"/"+t(c)}),delete e[c],a=!0}if(a||r.length!=s.length)for(var u=0;ui;){o=t[i];for(var s=o.path.split("/"),l=e,a=1,u=s.length;;)if(R(l)){var c=parseInt(s[a],10);if(a++,a>=u){n=m[o.op].call(o,l,c,e);break}l=l[c]}else{var h=s[a];if(-1!=h.indexOf("~")&&(h=h.replace(/~1/g,"/").replace(/~0/g,"~")),a++,a>=u){n=p[o.op].call(o,l,h,e);break}l=l[h]}i++}return n}var p={add:function(e,t){return e[t]=this.value,!0},remove:function(e,t){return delete e[t],!0},replace:function(e,t){return e[t]=this.value,!0},move:function(e,t,o){var n={op:"_get",path:this.from};return g(o,[n]),g(o,[{op:"remove",path:this.from}]),g(o,[{op:"add",path:this.path,value:n.value}]),!0},copy:function(e,t,o){var n={op:"_get",path:this.from};return g(o,[n]),g(o,[{op:"add",path:this.path,value:n.value}]),!0},test:function(e,t){return JSON.stringify(e[t])===JSON.stringify(this.value)},_get:function(e,t){this.value=e[t]}},m={add:function(e,t){return e.splice(t,0,this.value),!0},remove:function(e,t){return e.splice(t,1),!0},replace:function(e,t){return e[t]=this.value,!0},move:p.move,copy:p.copy,test:p.test,_get:p._get},w={add:function(e,o){var n={op:"add",path:o+t(this.name),value:this.object[this.name]};e.push(n)},"delete":function(e,o){var n={op:"remove",path:o+t(this.name)};e.push(n)},update:function(e,o){var n={op:"replace",path:o+t(this.name),value:this.object[this.name]};e.push(n)}},v=[];e.intervals;var b=function(){function e(e){this.observers=[],this.obj=e}return e}(),C=function(){function e(e,t){this.callback=e,this.observer=t}return e}();e.unobserve=a,e.observe=u,e.generate=d;var y;y=Object.keys?Object.keys:function(e){var t=[];for(var o in e)e.hasOwnProperty(o)&&t.push(o);return t};var R;R=Array.isArray?Array.isArray:function(e){return e.push&&"number"==typeof e.length},e.apply=g}(n||(n={})),"undefined"!=typeof o&&(o.apply=n.apply,o.observe=n.observe,o.unobserve=n.unobserve,o.generate=n.generate)},{}],numeral:[function(t,o,n){"use strict";(function(){function t(e){this._value=e}function n(e,t,o,n){var i,r,s=Math.pow(10,t);return r=(o(e*s)/s).toFixed(t),n&&(i=new RegExp("0{1,"+n+"}$"),r=r.replace(i,"")),r}function i(e,t,o){var n;return n=t.indexOf("$")>-1?s(e,t,o):t.indexOf("%")>-1?l(e,t,o):t.indexOf(":")>-1?a(e,t):c(e._value,t,o)}function r(e,t){var o,n,i,r,s,l=t,a=["KB","MB","GB","TB","PB","EB","ZB","YB"],c=!1;if(t.indexOf(":")>-1)e._value=u(t);else if(t===v)e._value=0;else{for("."!==m[w].delimiters.decimal&&(t=t.replace(/\./g,"").replace(m[w].delimiters.decimal,".")),o=new RegExp("[^a-zA-Z]"+m[w].abbreviations.thousand+"(?:\\)|(\\"+m[w].currency.symbol+")?(?:\\))?)?$"),n=new RegExp("[^a-zA-Z]"+m[w].abbreviations.million+"(?:\\)|(\\"+m[w].currency.symbol+")?(?:\\))?)?$"),i=new RegExp("[^a-zA-Z]"+m[w].abbreviations.billion+"(?:\\)|(\\"+m[w].currency.symbol+")?(?:\\))?)?$"),r=new RegExp("[^a-zA-Z]"+m[w].abbreviations.trillion+"(?:\\)|(\\"+m[w].currency.symbol+")?(?:\\))?)?$"),s=0;s<=a.length&&!(c=t.indexOf(a[s])>-1?Math.pow(1024,s+1):!1);s++);e._value=(c?c:1)*(l.match(o)?Math.pow(10,3):1)*(l.match(n)?Math.pow(10,6):1)*(l.match(i)?Math.pow(10,9):1)*(l.match(r)?Math.pow(10,12):1)*(t.indexOf("%")>-1?.01:1)*((t.split("-").length+Math.min(t.split("(").length-1,t.split(")").length-1))%2?1:-1)*Number(t.replace(/[^0-9\.]+/g,"")),e._value=c?Math.ceil(e._value):e._value}return e._value}function s(e,t,o){var n,i,r=t.indexOf("$"),s=t.indexOf("("),l=t.indexOf("-"),a="";return t.indexOf(" $")>-1?(a=" ",t=t.replace(" $","")):t.indexOf("$ ")>-1?(a=" ",t=t.replace("$ ","")):t=t.replace("$",""),i=c(e._value,t,o),1>=r?i.indexOf("(")>-1||i.indexOf("-")>-1?(i=i.split(""),n=1,(s>r||l>r)&&(n=0),i.splice(n,0,m[w].currency.symbol+a),i=i.join("")):i=m[w].currency.symbol+a+i:i.indexOf(")")>-1?(i=i.split(""),i.splice(-1,0,a+m[w].currency.symbol),i=i.join("")):i=i+a+m[w].currency.symbol,i}function l(e,t,o){var n,i="",r=100*e._value;return t.indexOf(" %")>-1?(i=" ",t=t.replace(" %","")):t=t.replace("%",""),n=c(r,t,o),n.indexOf(")")>-1?(n=n.split(""),n.splice(-1,0,i+"%"),n=n.join("")):n=n+i+"%",n}function a(e){var t=Math.floor(e._value/60/60),o=Math.floor((e._value-60*t*60)/60),n=Math.round(e._value-60*t*60-60*o);return t+":"+(10>o?"0"+o:o)+":"+(10>n?"0"+n:n)}function u(e){var t=e.split(":"),o=0;return 3===t.length?(o+=60*Number(t[0])*60,o+=60*Number(t[1]),o+=Number(t[2])):2===t.length&&(o+=60*Number(t[0]),o+=Number(t[1])),Number(o)}function c(e,t,o){var i,r,s,l,a,u,c=!1,h=!1,d=!1,f="",g=!1,p=!1,b=!1,C=!1,y=!1,R="",E="",S=Math.abs(e),T=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],O="",_=!1;if(0===e&&null!==v)return v;if(t.indexOf("(")>-1?(c=!0,t=t.slice(1,-1)):t.indexOf("+")>-1&&(h=!0,t=t.replace(/\+/g,"")),t.indexOf("a")>-1&&(g=t.indexOf("aK")>=0,p=t.indexOf("aM")>=0,b=t.indexOf("aB")>=0,C=t.indexOf("aT")>=0,y=g||p||b||C,t.indexOf(" a")>-1?(f=" ",t=t.replace(" a","")):t=t.replace("a",""),S>=Math.pow(10,12)&&!y||C?(f+=m[w].abbreviations.trillion,e/=Math.pow(10,12)):S=Math.pow(10,9)&&!y||b?(f+=m[w].abbreviations.billion,e/=Math.pow(10,9)):S=Math.pow(10,6)&&!y||p?(f+=m[w].abbreviations.million,e/=Math.pow(10,6)):(S=Math.pow(10,3)&&!y||g)&&(f+=m[w].abbreviations.thousand,e/=Math.pow(10,3))),t.indexOf("b")>-1)for(t.indexOf(" b")>-1?(R=" ",t=t.replace(" b","")):t=t.replace("b",""),s=0;s<=T.length;s++)if(i=Math.pow(1024,s),r=Math.pow(1024,s+1),e>=i&&r>e){R+=T[s],i>0&&(e/=i);break}return t.indexOf("o")>-1&&(t.indexOf(" o")>-1?(E=" ",t=t.replace(" o","")):t=t.replace("o",""),E+=m[w].ordinal(e)),t.indexOf("[.]")>-1&&(d=!0,t=t.replace("[.]",".")),l=e.toString().split(".")[0],a=t.split(".")[1],u=t.indexOf(","),a?(a.indexOf("[")>-1?(a=a.replace("]",""),a=a.split("["),O=n(e,a[0].length+a[1].length,o,a[1].length)):O=n(e,a.length,o),l=O.split(".")[0],O=O.split(".")[1].length?m[w].delimiters.decimal+O.split(".")[1]:"",d&&0===Number(O.slice(1))&&(O="")):l=n(e,null,o),l.indexOf("-")>-1&&(l=l.slice(1),_=!0),u>-1&&(l=l.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+m[w].delimiters.thousands)),0===t.indexOf(".")&&(l=""),(c&&_?"(":"")+(!c&&_?"-":"")+(!_&&h?"+":"")+l+O+(E?E:"")+(f?f:"")+(R?R:"")+(c&&_?")":"")}function h(e,t){m[e]=t}function d(e){var t=e.toString().split(".");return t.length<2?1:Math.pow(10,t[1].length)}function f(){var e=Array.prototype.slice.call(arguments);return e.reduce(function(e,t){var o=d(e),n=d(t);return o>n?o:n},-(1/0))}var g,p="1.5.3",m={},w="en",v=null,b="0,0",C="undefined"!=typeof o&&o.exports;g=function(e){return g.isNumeral(e)?e=e.value():0===e||"undefined"==typeof e?e=0:Number(e)||(e=g.fn.unformat(e)),new t(Number(e))},g.version=p,g.isNumeral=function(e){return e instanceof t},g.language=function(e,t){if(!e)return w;if(e&&!t){if(!m[e])throw new Error("Unknown language : "+e);w=e}return!t&&m[e]||h(e,t),g},g.languageData=function(e){if(!e)return m[w];if(!m[e])throw new Error("Unknown language : "+e);return m[e]},g.language("en",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(e){var t=e%10;return 1===~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th"},currency:{symbol:"$"}}),g.zeroFormat=function(e){v="string"==typeof e?e:null},g.defaultFormat=function(e){b="string"==typeof e?e:"0.0"},g.validate=function(e,t){var o,n,i,r,s,l,a,u;if("string"!=typeof e&&(e+="",console.warn&&console.warn("Numeral.js: Value is not string. It has been co-erced to: ",e)),e=e.trim(),""===e)return!1;e=e.replace(/^[+-]?/,"");try{a=g.languageData(t)}catch(c){a=g.languageData(g.language())}return i=a.currency.symbol,s=a.abbreviations,o=a.delimiters.decimal,n="."===a.delimiters.thousands?"\\.":a.delimiters.thousands,u=e.match(/^[^\d\.\,]+/),null!==u&&(e=e.substr(1),u[0]!==i)?!1:(u=e.match(/[^\d]+$/),null!==u&&(e=e.slice(0,-1),u[0]!==s.thousand&&u[0]!==s.million&&u[0]!==s.billion&&u[0]!==s.trillion)?!1:e.match(/^\d+$/)?!0:(l=new RegExp(n+"{2}"),e.match(/[^\d.,]/g)?!1:(r=e.split(o),r.length>2?!1:r.length<2?!!r[0].match(/^\d+.*\d$/)&&!r[0].match(l):""===r[0]?!r[0].match(l)&&!!r[1].match(/^\d+$/):1===r[0].length?!!r[0].match(/^\d+$/)&&!r[0].match(l)&&!!r[1].match(/^\d+$/):!!r[0].match(/^\d+.*\d$/)&&!r[0].match(l)&&!!r[1].match(/^\d+$/))))},"function"!=typeof Array.prototype.reduce&&(Array.prototype.reduce=function(e,t){if(null===this||"undefined"==typeof this)throw new TypeError("Array.prototype.reduce called on null or undefined");if("function"!=typeof e)throw new TypeError(e+" is not a function");var o,n,i=this.length>>>0,r=!1;for(1o;++o)this.hasOwnProperty(o)&&(r?n=e(n,this[o],o,this):(n=this[o],r=!0));if(!r)throw new TypeError("Reduce of empty array with no initial value");return n}),g.fn=t.prototype={clone:function(){return g(this)},format:function(e,t){return i(this,e?e:b,void 0!==t?t:Math.round)},unformat:function(e){return"[object Number]"===Object.prototype.toString.call(e)?e:r(this,e?e:b)},value:function(){return this._value},valueOf:function(){return this._value},set:function(e){return this._value=Number(e),this},add:function(e){function t(e,t,n,i){return e+o*t}var o=f.call(null,this._value,e);return this._value=[this._value,e].reduce(t,0)/o,this},subtract:function(e){function t(e,t,n,i){return e-o*t}var o=f.call(null,this._value,e);return this._value=[e].reduce(t,this._value*o)/o,this},multiply:function(e){function t(e,t,o,n){var i=f(e,t);return e*i*(t*i)/(i*i)}return this._value=[this._value,e].reduce(t,1),this},divide:function(e){function t(e,t,o,n){var i=f(e,t);return e*i/(t*i)}return this._value=[this._value,e].reduce(t),this},difference:function(e){return Math.abs(g(this._value).subtract(e).value())}},C&&(o.exports=g),"undefined"==typeof ender&&(this.numeral=g),"function"==typeof e&&e.amd&&e([],function(){return g})}).call(window)},{}]},{},[23,60,62,61,63,84,85,86,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,87,88,89,90,104,105,106,107,93,94,95,96,97,98,31,35,32,33,40,34,36,37,38,39])("numeral")}); \ No newline at end of file diff --git a/bower_components/handsontable/dist/moment/moment.js b/bower_components/handsontable/dist/moment/moment.js index c003e95..7299fa4 100644 --- a/bower_components/handsontable/dist/moment/moment.js +++ b/bower_components/handsontable/dist/moment/moment.js @@ -1,5 +1,5 @@ //! moment.js -//! version : 2.11.1 +//! version : 2.11.2 //! authors : Tim Wood, Iskren Chernev, Moment.js contributors //! license : MIT //! momentjs.com @@ -1816,7 +1816,7 @@ } // ASP.NET json date format regex - var aspNetRegex = /(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/; + var aspNetRegex = /^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?\d*)?$/; // 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 @@ -3571,7 +3571,7 @@ // Side effect imports - utils_hooks__hooks.version = '2.11.1'; + utils_hooks__hooks.version = '2.11.2'; setHookCallback(local__createLocal); diff --git a/bower_components/handsontable/handsontable.jquery.json b/bower_components/handsontable/handsontable.jquery.json index 5aeb5b9..45a5488 100644 --- a/bower_components/handsontable/handsontable.jquery.json +++ b/bower_components/handsontable/handsontable.jquery.json @@ -1,7 +1,7 @@ { "name": "handsontable", "title": "Handsontable", - "version": "0.23.0", + "version": "0.24.1", "author": { "name": "Marcin Warpechowski", "email": "hello@handsontable.com", diff --git a/bower_components/handsontable/index.html b/bower_components/handsontable/index.html index 15f4025..d2d0777 100644 --- a/bower_components/handsontable/index.html +++ b/bower_components/handsontable/index.html @@ -137,6 +137,9 @@

Cell types

  • Date UPDATED
  • +
  • + Time NEW +
  • Checkbox
  • diff --git a/bower_components/handsontable/package.json b/bower_components/handsontable/package.json index 7e6a26f..7575803 100644 --- a/bower_components/handsontable/package.json +++ b/bower_components/handsontable/package.json @@ -10,7 +10,7 @@ "url": "https://github.com/handsontable/handsontable/issues" }, "author": "Handsoncode ", - "version": "0.23.0", + "version": "0.24.1", "keywords": [ "data", "grid", diff --git a/bower_components/moment/.bower.json b/bower_components/moment/.bower.json index d49f6b1..0bf1212 100644 --- a/bower_components/moment/.bower.json +++ b/bower_components/moment/.bower.json @@ -20,12 +20,12 @@ "package.json" ], "homepage": "https://github.com/moment/moment", - "version": "2.11.2", - "_release": "2.11.2", + "version": "2.12.0", + "_release": "2.12.0", "_resolution": { "type": "version", - "tag": "2.11.2", - "commit": "c9afcbd8c4e0177d03b220a89ab19f62c6cc7bcf" + "tag": "2.12.0", + "commit": "d3d7488b4d60632854181cb0a9af325d57fb3d51" }, "_source": "git://github.com/moment/moment.git", "_target": "^2.9.0", diff --git a/bower_components/moment/CHANGELOG.md b/bower_components/moment/CHANGELOG.md index d98994b..cc0e7f5 100644 --- a/bower_components/moment/CHANGELOG.md +++ b/bower_components/moment/CHANGELOG.md @@ -1,6 +1,24 @@ Changelog ========= +### 2.12.0 [See full changelog](https://gist.github.com/ichernev/6e5bfdf8d6522fc4ac73) + +## Enhancements: +* [#2932](https://github.com/moment/moment/pull/2932) List loaded locales +* [#2818](https://github.com/moment/moment/pull/2818) Parse ISO-8061 duration containing both day and week values +* [#2774](https://github.com/moment/moment/pull/2774) Implement locale inheritance and locale updating + +## Bugfixes: +* [#2970](https://github.com/moment/moment/pull/2970) change add subtract to handle decimal values by rounding +* [#2887](https://github.com/moment/moment/pull/2887) Fix toJSON casting of invalid moment +* [#2897](https://github.com/moment/moment/pull/2897) parse string arguments for month() correctly, closes #2884 +* [#2946](https://github.com/moment/moment/pull/2946) Fix usage suggestions for min and max + +## New locales: +* [#2917](https://github.com/moment/moment/pull/2917) Locale Punjabi(Gurmukhi) India format conversion + +And more + ### 2.11.2 (Fix ReDoS attack vector) * [#2939](https://github.com/moment/moment/pull/2939) use full-string match to speed up aspnet regex match diff --git a/bower_components/moment/locale/bn.js b/bower_components/moment/locale/bn.js index 4eca5ee..f6ae260 100644 --- a/bower_components/moment/locale/bn.js +++ b/bower_components/moment/locale/bn.js @@ -83,12 +83,18 @@ }); }, meridiemParse: /রাত|সকাল|দুপুর|বিকাল|রাত/, - isPM: function (input) { - return /^(দুপুর|বিকাল|রাত)$/.test(input); + meridiemHour : function (hour, meridiem) { + if (hour === 12) { + hour = 0; + } + if ((meridiem === 'রাত' && hour >= 4) || + (meridiem === 'দুপুর' && hour < 5) || + meridiem === 'বিকাল') { + return hour + 12; + } else { + return hour; + } }, - //Bengali is a vast language its spoken - //in different forms in various parts of the world. - //I have just generalized with most common one used meridiem : function (hour, minute, isLower) { if (hour < 4) { return 'রাত'; diff --git a/bower_components/moment/locale/bo.js b/bower_components/moment/locale/bo.js index 3ab3389..77ea1bd 100644 --- a/bower_components/moment/locale/bo.js +++ b/bower_components/moment/locale/bo.js @@ -83,8 +83,17 @@ }); }, meridiemParse: /མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/, - isPM: function (input) { - return /^(ཉིན་གུང|དགོང་དག|མཚན་མོ)$/.test(input); + meridiemHour : function (hour, meridiem) { + if (hour === 12) { + hour = 0; + } + if ((meridiem === 'མཚན་མོ' && hour >= 4) || + (meridiem === 'ཉིན་གུང' && hour < 5) || + meridiem === 'དགོང་དག') { + return hour + 12; + } else { + return hour; + } }, meridiem : function (hour, minute, isLower) { if (hour < 4) { diff --git a/bower_components/moment/locale/dv.js b/bower_components/moment/locale/dv.js index 5fc59b6..d29d662 100644 --- a/bower_components/moment/locale/dv.js +++ b/bower_components/moment/locale/dv.js @@ -50,7 +50,7 @@ }, meridiemParse: /މކ|މފ/, isPM : function (input) { - return '' === input; + return 'މފ' === input; }, meridiem : function (hour, minute, isLower) { if (hour < 12) { diff --git a/bower_components/moment/locale/en-ca.js b/bower_components/moment/locale/en-ca.js index f0ee032..3e3bc4f 100644 --- a/bower_components/moment/locale/en-ca.js +++ b/bower_components/moment/locale/en-ca.js @@ -20,9 +20,9 @@ LT : 'h:mm A', LTS : 'h:mm:ss A', L : 'YYYY-MM-DD', - LL : 'D MMMM, YYYY', - LLL : 'D MMMM, YYYY h:mm A', - LLLL : 'dddd, D MMMM, YYYY h:mm A' + LL : 'MMMM D, YYYY', + LLL : 'MMMM D, YYYY h:mm A', + LLLL : 'dddd, MMMM D, YYYY h:mm A' }, calendar : { sameDay : '[Today at] LT', diff --git a/bower_components/moment/locale/he.js b/bower_components/moment/locale/he.js index 6a259be..ffc3e1f 100644 --- a/bower_components/moment/locale/he.js +++ b/bower_components/moment/locale/he.js @@ -74,6 +74,23 @@ } return number + ' שנים'; } + }, + meridiemParse: /אחה"צ|לפנה"צ|אחרי הצהריים|לפני הצהריים|לפנות בוקר|בבוקר|בערב/i, + isPM : function (input) { + return /^(אחה"צ|אחרי הצהריים|בערב)$/.test(input); + }, + meridiem : function (hour, minute, isLower) { + if (hour < 5) { + return 'לפנות בוקר'; + } else if (hour < 10) { + return 'בבוקר'; + } else if (hour < 12) { + return isLower ? 'לפנה"צ' : 'לפני הצהריים'; + } else if (hour < 18) { + return isLower ? 'אחה"צ' : 'אחרי הצהריים'; + } else { + return 'בערב'; + } } }); diff --git a/bower_components/moment/locale/is.js b/bower_components/moment/locale/is.js index f1ed257..b6f63ca 100644 --- a/bower_components/moment/locale/is.js +++ b/bower_components/moment/locale/is.js @@ -86,7 +86,7 @@ longDateFormat : { LT : 'H:mm', LTS : 'H:mm:ss', - L : 'DD/MM/YYYY', + L : 'DD.MM.YYYY', LL : 'D. MMMM YYYY', LLL : 'D. MMMM YYYY [kl.] H:mm', LLLL : 'dddd, D. MMMM YYYY [kl.] H:mm' diff --git a/bower_components/moment/locale/ja.js b/bower_components/moment/locale/ja.js index 6c6e859..1475439 100644 --- a/bower_components/moment/locale/ja.js +++ b/bower_components/moment/locale/ja.js @@ -43,6 +43,17 @@ lastWeek : '[前週]dddd LT', sameElse : 'L' }, + ordinalParse : /\d{1,2}日/, + ordinal : function (number, period) { + switch (period) { + case 'd': + case 'D': + case 'DDD': + return number + '日'; + default: + return number; + } + }, relativeTime : { future : '%s後', past : '%s前', diff --git a/bower_components/moment/locale/ml.js b/bower_components/moment/locale/ml.js index 9e241f2..f63c70b 100644 --- a/bower_components/moment/locale/ml.js +++ b/bower_components/moment/locale/ml.js @@ -48,8 +48,17 @@ yy : '%d വർഷം' }, meridiemParse: /രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i, - isPM : function (input) { - return /^(ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി)$/.test(input); + meridiemHour : function (hour, meridiem) { + if (hour === 12) { + hour = 0; + } + if ((meridiem === 'രാത്രി' && hour >= 4) || + meridiem === 'ഉച്ച കഴിഞ്ഞ്' || + meridiem === 'വൈകുന്നേരം') { + return hour + 12; + } else { + return hour; + } }, meridiem : function (hour, minute, isLower) { if (hour < 4) { diff --git a/bower_components/moment/locale/pa-in.js b/bower_components/moment/locale/pa-in.js new file mode 100644 index 0000000..1d4e366 --- /dev/null +++ b/bower_components/moment/locale/pa-in.js @@ -0,0 +1,124 @@ +//! moment.js locale configuration +//! locale : punjabi india (pa-in) +//! author : Harpreet Singh : https://github.com/harpreetkhalsagtbit + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../moment')) : + typeof define === 'function' && define.amd ? define(['moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + + var symbolMap = { + '1': '੧', + '2': '੨', + '3': '੩', + '4': '੪', + '5': '੫', + '6': '੬', + '7': '੭', + '8': '੮', + '9': '੯', + '0': '੦' + }, + numberMap = { + '੧': '1', + '੨': '2', + '੩': '3', + '੪': '4', + '੫': '5', + '੬': '6', + '੭': '7', + '੮': '8', + '੯': '9', + '੦': '0' + }; + + var pa_in = moment.defineLocale('pa-in', { + // There are months name as per Nanakshahi Calender but they are not used as rigidly in modern Punjabi. + months : 'ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ'.split('_'), + monthsShort : 'ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ'.split('_'), + weekdays : 'ਐਤਵਾਰ_ਸੋਮਵਾਰ_ਮੰਗਲਵਾਰ_ਬੁਧਵਾਰ_ਵੀਰਵਾਰ_ਸ਼ੁੱਕਰਵਾਰ_ਸ਼ਨੀਚਰਵਾਰ'.split('_'), + weekdaysShort : 'ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ'.split('_'), + weekdaysMin : 'ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ'.split('_'), + longDateFormat : { + LT : 'A h:mm ਵਜੇ', + LTS : 'A h:mm:ss ਵਜੇ', + L : 'DD/MM/YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY, A h:mm ਵਜੇ', + LLLL : 'dddd, D MMMM YYYY, A h:mm ਵਜੇ' + }, + calendar : { + sameDay : '[ਅਜ] LT', + nextDay : '[ਕਲ] LT', + nextWeek : 'dddd, LT', + lastDay : '[ਕਲ] LT', + lastWeek : '[ਪਿਛਲੇ] dddd, LT', + sameElse : 'L' + }, + relativeTime : { + future : '%s ਵਿੱਚ', + past : '%s ਪਿਛਲੇ', + s : 'ਕੁਝ ਸਕਿੰਟ', + m : 'ਇਕ ਮਿੰਟ', + mm : '%d ਮਿੰਟ', + h : 'ਇੱਕ ਘੰਟਾ', + hh : '%d ਘੰਟੇ', + d : 'ਇੱਕ ਦਿਨ', + dd : '%d ਦਿਨ', + M : 'ਇੱਕ ਮਹੀਨਾ', + MM : '%d ਮਹੀਨੇ', + y : 'ਇੱਕ ਸਾਲ', + yy : '%d ਸਾਲ' + }, + preparse: function (string) { + return string.replace(/[੧੨੩੪੫੬੭੮੯੦]/g, function (match) { + return numberMap[match]; + }); + }, + postformat: function (string) { + return string.replace(/\d/g, function (match) { + return symbolMap[match]; + }); + }, + // Punjabi notation for meridiems are quite fuzzy in practice. While there exists + // a rigid notion of a 'Pahar' it is not used as rigidly in modern Punjabi. + meridiemParse: /ਰਾਤ|ਸਵੇਰ|ਦੁਪਹਿਰ|ਸ਼ਾਮ/, + meridiemHour : function (hour, meridiem) { + if (hour === 12) { + hour = 0; + } + if (meridiem === 'ਰਾਤ') { + return hour < 4 ? hour : hour + 12; + } else if (meridiem === 'ਸਵੇਰ') { + return hour; + } else if (meridiem === 'ਦੁਪਹਿਰ') { + return hour >= 10 ? hour : hour + 12; + } else if (meridiem === 'ਸ਼ਾਮ') { + return hour + 12; + } + }, + meridiem : function (hour, minute, isLower) { + if (hour < 4) { + return 'ਰਾਤ'; + } else if (hour < 10) { + return 'ਸਵੇਰ'; + } else if (hour < 17) { + return 'ਦੁਪਹਿਰ'; + } else if (hour < 20) { + return 'ਸ਼ਾਮ'; + } else { + return 'ਰਾਤ'; + } + }, + week : { + 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. + } + }); + + return pa_in; + +})); \ No newline at end of file diff --git a/bower_components/moment/locale/pt-br.js b/bower_components/moment/locale/pt-br.js index 06747f6..5b6996a 100644 --- a/bower_components/moment/locale/pt-br.js +++ b/bower_components/moment/locale/pt-br.js @@ -13,7 +13,7 @@ var pt_br = moment.defineLocale('pt-br', { months : 'Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro'.split('_'), monthsShort : 'Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez'.split('_'), - weekdays : 'Domingo_Segunda-Feira_Terça-Feira_Quarta-Feira_Quinta-Feira_Sexta-Feira_Sábado'.split('_'), + weekdays : 'Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado'.split('_'), weekdaysShort : 'Dom_Seg_Ter_Qua_Qui_Sex_Sáb'.split('_'), weekdaysMin : 'Dom_2ª_3ª_4ª_5ª_6ª_Sáb'.split('_'), longDateFormat : { diff --git a/bower_components/moment/locale/ru.js b/bower_components/moment/locale/ru.js index 442ddf8..f9fb337 100644 --- a/bower_components/moment/locale/ru.js +++ b/bower_components/moment/locale/ru.js @@ -2,6 +2,7 @@ //! locale : russian (ru) //! author : Viktorminator : https://github.com/Viktorminator //! Author : Menelion Elensúle : https://github.com/Oire +//! author : Коренберг Марк : https://github.com/socketpair ;(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' @@ -32,22 +33,23 @@ } var monthsParse = [/^янв/i, /^фев/i, /^мар/i, /^апр/i, /^ма[й|я]/i, /^июн/i, /^июл/i, /^авг/i, /^сен/i, /^окт/i, /^ноя/i, /^дек/i]; + // http://new.gramota.ru/spravka/rules/139-prop : § 103 var ru = moment.defineLocale('ru', { months : { - format: 'Января_Февраля_Марта_Апреля_Мая_Июня_Июля_Августа_Сентября_Октября_Ноября_Декабря'.split('_'), - standalone: 'Январь_Февраль_Март_Апрель_Май_Июнь_Июль_Август_Сентябрь_Октябрь_Ноябрь_Декабрь'.split('_') + format: 'января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря'.split('_'), + standalone: 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_') }, monthsShort : { format: 'янв_фев_мар_апр_мая_июня_июля_авг_сен_окт_ноя_дек'.split('_'), standalone: 'янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек'.split('_') }, weekdays : { - standalone: 'Воскресенье_Понедельник_Вторник_Среда_Четверг_Пятница_Суббота'.split('_'), - format: 'Воскресенье_Понедельник_Вторник_Среду_Четверг_Пятницу_Субботу'.split('_'), + standalone: 'воскресенье_понедельник_вторник_среда_четверг_пятница_суббота'.split('_'), + format: 'воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу'.split('_'), isFormat: /\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?\] ?dddd/ }, - weekdaysShort : 'Вс_Пн_Вт_Ср_Чт_Пт_Сб'.split('_'), - weekdaysMin : 'Вс_Пн_Вт_Ср_Чт_Пт_Сб'.split('_'), + weekdaysShort : 'вс_пн_вт_ср_чт_пт_сб'.split('_'), + weekdaysMin : 'вс_пн_вт_ср_чт_пт_сб'.split('_'), monthsParse : monthsParse, longMonthsParse : monthsParse, shortMonthsParse : monthsParse, diff --git a/bower_components/moment/locale/si.js b/bower_components/moment/locale/si.js index d86c9e3..db150fd 100644 --- a/bower_components/moment/locale/si.js +++ b/bower_components/moment/locale/si.js @@ -52,6 +52,10 @@ ordinal : function (number) { return number + ' වැනි'; }, + meridiemParse : /පෙර වරු|පස් වරු|පෙ.ව|ප.ව./, + isPM : function (input) { + return input === 'ප.ව.' || input === 'පස් වරු'; + }, meridiem : function (hours, minutes, isLower) { if (hours > 11) { return isLower ? 'ප.ව.' : 'පස් වරු'; diff --git a/bower_components/moment/locale/tzl.js b/bower_components/moment/locale/tzl.js index 498f7c0..ddbbf01 100644 --- a/bower_components/moment/locale/tzl.js +++ b/bower_components/moment/locale/tzl.js @@ -27,6 +27,10 @@ LLL : 'D. MMMM [dallas] YYYY HH.mm', LLLL : 'dddd, [li] D. MMMM [dallas] YYYY HH.mm' }, + meridiemParse: /d\'o|d\'a/i, + isPM : function (input) { + return 'd\'o' === input.toLowerCase(); + }, meridiem : function (hours, minutes, isLower) { if (hours > 11) { return isLower ? 'd\'o' : 'D\'O'; diff --git a/bower_components/moment/locale/vi.js b/bower_components/moment/locale/vi.js index 0e7ba8c..cf5ff37 100644 --- a/bower_components/moment/locale/vi.js +++ b/bower_components/moment/locale/vi.js @@ -16,6 +16,17 @@ weekdays : 'chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy'.split('_'), weekdaysShort : 'CN_T2_T3_T4_T5_T6_T7'.split('_'), weekdaysMin : 'CN_T2_T3_T4_T5_T6_T7'.split('_'), + meridiemParse: /sa|ch/i, + isPM : function (input) { + return /^ch$/i.test(input); + }, + meridiem : function (hours, minutes, isLower) { + if (hours < 12) { + return isLower ? 'sa' : 'SA'; + } else { + return isLower ? 'ch' : 'CH'; + } + }, longDateFormat : { LT : 'HH:mm', LTS : 'HH:mm:ss', diff --git a/bower_components/moment/min/locales.js b/bower_components/moment/min/locales.js index 94ae713..04c67b4 100644 --- a/bower_components/moment/min/locales.js +++ b/bower_components/moment/min/locales.js @@ -750,12 +750,18 @@ }); }, meridiemParse: /রাত|সকাল|দুপুর|বিকাল|রাত/, - isPM: function (input) { - return /^(দুপুর|বিকাল|রাত)$/.test(input); + meridiemHour : function (hour, meridiem) { + if (hour === 12) { + hour = 0; + } + if ((meridiem === 'রাত' && hour >= 4) || + (meridiem === 'দুপুর' && hour < 5) || + meridiem === 'বিকাল') { + return hour + 12; + } else { + return hour; + } }, - //Bengali is a vast language its spoken - //in different forms in various parts of the world. - //I have just generalized with most common one used meridiem : function (hour, minute, isLower) { if (hour < 4) { return 'রাত'; @@ -852,8 +858,17 @@ }); }, meridiemParse: /མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/, - isPM: function (input) { - return /^(ཉིན་གུང|དགོང་དག|མཚན་མོ)$/.test(input); + meridiemHour : function (hour, meridiem) { + if (hour === 12) { + hour = 0; + } + if ((meridiem === 'མཚན་མོ' && hour >= 4) || + (meridiem === 'ཉིན་གུང' && hour < 5) || + meridiem === 'དགོང་དག') { + return hour + 12; + } else { + return hour; + } }, meridiem : function (hour, minute, isLower) { if (hour < 4) { @@ -1672,7 +1687,7 @@ }, meridiemParse: /މކ|މފ/, isPM : function (input) { - return '' === input; + return 'މފ' === input; }, meridiem : function (hour, minute, isLower) { if (hour < 12) { @@ -1872,9 +1887,9 @@ LT : 'h:mm A', LTS : 'h:mm:ss A', L : 'YYYY-MM-DD', - LL : 'D MMMM, YYYY', - LLL : 'D MMMM, YYYY h:mm A', - LLLL : 'dddd, D MMMM, YYYY h:mm A' + LL : 'MMMM D, YYYY', + LLL : 'MMMM D, YYYY h:mm A', + LLLL : 'dddd, MMMM D, YYYY h:mm A' }, calendar : { sameDay : '[Today at] LT', @@ -2974,6 +2989,23 @@ } return number + ' שנים'; } + }, + meridiemParse: /אחה"צ|לפנה"צ|אחרי הצהריים|לפני הצהריים|לפנות בוקר|בבוקר|בערב/i, + isPM : function (input) { + return /^(אחה"צ|אחרי הצהריים|בערב)$/.test(input); + }, + meridiem : function (hour, minute, isLower) { + if (hour < 5) { + return 'לפנות בוקר'; + } else if (hour < 10) { + return 'בבוקר'; + } else if (hour < 12) { + return isLower ? 'לפנה"צ' : 'לפני הצהריים'; + } else if (hour < 18) { + return isLower ? 'אחה"צ' : 'אחרי הצהריים'; + } else { + return 'בערב'; + } } }); @@ -3555,7 +3587,7 @@ longDateFormat : { LT : 'H:mm', LTS : 'H:mm:ss', - L : 'DD/MM/YYYY', + L : 'DD.MM.YYYY', LL : 'D. MMMM YYYY', LLL : 'D. MMMM YYYY [kl.] H:mm', LLLL : 'dddd, D. MMMM YYYY [kl.] H:mm' @@ -3687,6 +3719,17 @@ lastWeek : '[前週]dddd LT', sameElse : 'L' }, + ordinalParse : /\d{1,2}日/, + ordinal : function (number, period) { + switch (period) { + case 'd': + case 'D': + case 'DDD': + return number + '日'; + default: + return number; + } + }, relativeTime : { future : '%s後', past : '%s前', @@ -4623,8 +4666,17 @@ yy : '%d വർഷം' }, meridiemParse: /രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i, - isPM : function (input) { - return /^(ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി)$/.test(input); + meridiemHour : function (hour, meridiem) { + if (hour === 12) { + hour = 0; + } + if ((meridiem === 'രാത്രി' && hour >= 4) || + meridiem === 'ഉച്ച കഴിഞ്ഞ്' || + meridiem === 'വൈകുന്നേരം') { + return hour + 12; + } else { + return hour; + } }, meridiem : function (hour, minute, isLower) { if (hour < 4) { @@ -5281,6 +5333,119 @@ } }); + //! moment.js locale configuration + //! locale : punjabi india (pa-in) + //! author : Harpreet Singh : https://github.com/harpreetkhalsagtbit + + var pa_in__symbolMap = { + '1': '੧', + '2': '੨', + '3': '੩', + '4': '੪', + '5': '੫', + '6': '੬', + '7': '੭', + '8': '੮', + '9': '੯', + '0': '੦' + }, + pa_in__numberMap = { + '੧': '1', + '੨': '2', + '੩': '3', + '੪': '4', + '੫': '5', + '੬': '6', + '੭': '7', + '੮': '8', + '੯': '9', + '੦': '0' + }; + + var pa_in = moment.defineLocale('pa-in', { + // There are months name as per Nanakshahi Calender but they are not used as rigidly in modern Punjabi. + months : 'ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ'.split('_'), + monthsShort : 'ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ'.split('_'), + weekdays : 'ਐਤਵਾਰ_ਸੋਮਵਾਰ_ਮੰਗਲਵਾਰ_ਬੁਧਵਾਰ_ਵੀਰਵਾਰ_ਸ਼ੁੱਕਰਵਾਰ_ਸ਼ਨੀਚਰਵਾਰ'.split('_'), + weekdaysShort : 'ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ'.split('_'), + weekdaysMin : 'ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ'.split('_'), + longDateFormat : { + LT : 'A h:mm ਵਜੇ', + LTS : 'A h:mm:ss ਵਜੇ', + L : 'DD/MM/YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY, A h:mm ਵਜੇ', + LLLL : 'dddd, D MMMM YYYY, A h:mm ਵਜੇ' + }, + calendar : { + sameDay : '[ਅਜ] LT', + nextDay : '[ਕਲ] LT', + nextWeek : 'dddd, LT', + lastDay : '[ਕਲ] LT', + lastWeek : '[ਪਿਛਲੇ] dddd, LT', + sameElse : 'L' + }, + relativeTime : { + future : '%s ਵਿੱਚ', + past : '%s ਪਿਛਲੇ', + s : 'ਕੁਝ ਸਕਿੰਟ', + m : 'ਇਕ ਮਿੰਟ', + mm : '%d ਮਿੰਟ', + h : 'ਇੱਕ ਘੰਟਾ', + hh : '%d ਘੰਟੇ', + d : 'ਇੱਕ ਦਿਨ', + dd : '%d ਦਿਨ', + M : 'ਇੱਕ ਮਹੀਨਾ', + MM : '%d ਮਹੀਨੇ', + y : 'ਇੱਕ ਸਾਲ', + yy : '%d ਸਾਲ' + }, + preparse: function (string) { + return string.replace(/[੧੨੩੪੫੬੭੮੯੦]/g, function (match) { + return pa_in__numberMap[match]; + }); + }, + postformat: function (string) { + return string.replace(/\d/g, function (match) { + return pa_in__symbolMap[match]; + }); + }, + // Punjabi notation for meridiems are quite fuzzy in practice. While there exists + // a rigid notion of a 'Pahar' it is not used as rigidly in modern Punjabi. + meridiemParse: /ਰਾਤ|ਸਵੇਰ|ਦੁਪਹਿਰ|ਸ਼ਾਮ/, + meridiemHour : function (hour, meridiem) { + if (hour === 12) { + hour = 0; + } + if (meridiem === 'ਰਾਤ') { + return hour < 4 ? hour : hour + 12; + } else if (meridiem === 'ਸਵੇਰ') { + return hour; + } else if (meridiem === 'ਦੁਪਹਿਰ') { + return hour >= 10 ? hour : hour + 12; + } else if (meridiem === 'ਸ਼ਾਮ') { + return hour + 12; + } + }, + meridiem : function (hour, minute, isLower) { + if (hour < 4) { + return 'ਰਾਤ'; + } else if (hour < 10) { + return 'ਸਵੇਰ'; + } else if (hour < 17) { + return 'ਦੁਪਹਿਰ'; + } else if (hour < 20) { + return 'ਸ਼ਾਮ'; + } else { + return 'ਰਾਤ'; + } + }, + week : { + 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. + } + }); + //! moment.js locale configuration //! locale : polish (pl) //! author : Rafal Hirsz : https://github.com/evoL @@ -5382,7 +5547,7 @@ var pt_br = moment.defineLocale('pt-br', { months : 'Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro'.split('_'), monthsShort : 'Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez'.split('_'), - weekdays : 'Domingo_Segunda-Feira_Terça-Feira_Quarta-Feira_Quinta-Feira_Sexta-Feira_Sábado'.split('_'), + weekdays : 'Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado'.split('_'), weekdaysShort : 'Dom_Seg_Ter_Qua_Qui_Sex_Sáb'.split('_'), weekdaysMin : 'Dom_2ª_3ª_4ª_5ª_6ª_Sáb'.split('_'), longDateFormat : { @@ -5544,6 +5709,7 @@ //! locale : russian (ru) //! author : Viktorminator : https://github.com/Viktorminator //! Author : Menelion Elensúle : https://github.com/Oire + //! author : Коренберг Марк : https://github.com/socketpair function ru__plural(word, num) { var forms = word.split('_'); @@ -5566,22 +5732,23 @@ } var monthsParse = [/^янв/i, /^фев/i, /^мар/i, /^апр/i, /^ма[й|я]/i, /^июн/i, /^июл/i, /^авг/i, /^сен/i, /^окт/i, /^ноя/i, /^дек/i]; + // http://new.gramota.ru/spravka/rules/139-prop : § 103 var ru = moment.defineLocale('ru', { months : { - format: 'Января_Февраля_Марта_Апреля_Мая_Июня_Июля_Августа_Сентября_Октября_Ноября_Декабря'.split('_'), - standalone: 'Январь_Февраль_Март_Апрель_Май_Июнь_Июль_Август_Сентябрь_Октябрь_Ноябрь_Декабрь'.split('_') + format: 'января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря'.split('_'), + standalone: 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_') }, monthsShort : { format: 'янв_фев_мар_апр_мая_июня_июля_авг_сен_окт_ноя_дек'.split('_'), standalone: 'янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек'.split('_') }, weekdays : { - standalone: 'Воскресенье_Понедельник_Вторник_Среда_Четверг_Пятница_Суббота'.split('_'), - format: 'Воскресенье_Понедельник_Вторник_Среду_Четверг_Пятницу_Субботу'.split('_'), + standalone: 'воскресенье_понедельник_вторник_среда_четверг_пятница_суббота'.split('_'), + format: 'воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу'.split('_'), isFormat: /\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?\] ?dddd/ }, - weekdaysShort : 'Вс_Пн_Вт_Ср_Чт_Пт_Сб'.split('_'), - weekdaysMin : 'Вс_Пн_Вт_Ср_Чт_Пт_Сб'.split('_'), + weekdaysShort : 'вс_пн_вт_ср_чт_пт_сб'.split('_'), + weekdaysMin : 'вс_пн_вт_ср_чт_пт_сб'.split('_'), monthsParse : monthsParse, longMonthsParse : monthsParse, shortMonthsParse : monthsParse, @@ -5791,6 +5958,10 @@ ordinal : function (number) { return number + ' වැනි'; }, + meridiemParse : /පෙර වරු|පස් වරු|පෙ.ව|ප.ව./, + isPM : function (input) { + return input === 'ප.ව.' || input === 'පස් වරු'; + }, meridiem : function (hours, minutes, isLower) { if (hours > 11) { return isLower ? 'ප.ව.' : 'පස් වරු'; @@ -6951,6 +7122,10 @@ LLL : 'D. MMMM [dallas] YYYY HH.mm', LLLL : 'dddd, [li] D. MMMM [dallas] YYYY HH.mm' }, + meridiemParse: /d\'o|d\'a/i, + isPM : function (input) { + return 'd\'o' === input.toLowerCase(); + }, meridiem : function (hours, minutes, isLower) { if (hours > 11) { return isLower ? 'd\'o' : 'D\'O'; @@ -7292,6 +7467,17 @@ weekdays : 'chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy'.split('_'), weekdaysShort : 'CN_T2_T3_T4_T5_T6_T7'.split('_'), weekdaysMin : 'CN_T2_T3_T4_T5_T6_T7'.split('_'), + meridiemParse: /sa|ch/i, + isPM : function (input) { + return /^ch$/i.test(input); + }, + meridiem : function (hours, minutes, isLower) { + if (hours < 12) { + return isLower ? 'sa' : 'SA'; + } else { + return isLower ? 'ch' : 'CH'; + } + }, longDateFormat : { LT : 'HH:mm', LTS : 'HH:mm:ss', diff --git a/bower_components/moment/min/locales.min.js b/bower_components/moment/min/locales.min.js index 3ccc1e3..71259f8 100644 --- a/bower_components/moment/min/locales.min.js +++ b/bower_components/moment/min/locales.min.js @@ -53,11 +53,12 @@ function M(a,b,c){var d={mm:"minute",hh:"ore",dd:"zile",MM:"luni",yy:"ani"},e=" //! locale : russian (ru) //! author : Viktorminator : https://github.com/Viktorminator //! Author : Menelion Elensúle : https://github.com/Oire +//! author : Коренберг Марк : https://github.com/socketpair function N(a,b){var c=a.split("_");return b%10===1&&b%100!==11?c[0]:b%10>=2&&4>=b%10&&(10>b%100||b%100>=20)?c[1]:c[2]}function O(a,b,c){var d={mm:b?"минута_минуты_минут":"минуту_минуты_минут",hh:"час_часа_часов",dd:"день_дня_дней",MM:"месяц_месяца_месяцев",yy:"год_года_лет"};return"m"===c?b?"минута":"минуту":a+" "+N(d[c],+a)}function P(a){return a>1&&5>a}function Q(a,b,c,d){var e=a+" ";switch(c){case"s":return b||d?"pár sekúnd":"pár sekundami";case"m":return b?"minúta":d?"minútu":"minútou";case"mm":return b||d?e+(P(a)?"minúty":"minút"):e+"minútami";break;case"h":return b?"hodina":d?"hodinu":"hodinou";case"hh":return b||d?e+(P(a)?"hodiny":"hodín"):e+"hodinami";break;case"d":return b||d?"deň":"dňom";case"dd":return b||d?e+(P(a)?"dni":"dní"):e+"dňami";break;case"M":return b||d?"mesiac":"mesiacom";case"MM":return b||d?e+(P(a)?"mesiace":"mesiacov"):e+"mesiacmi";break;case"y":return b||d?"rok":"rokom";case"yy":return b||d?e+(P(a)?"roky":"rokov"):e+"rokmi"}} //! moment.js locale configuration //! locale : slovenian (sl) //! author : Robert Sedovšek : https://github.com/sedovsek -function R(a,b,c,d){var e=a+" ";switch(c){case"s":return b||d?"nekaj sekund":"nekaj sekundami";case"m":return b?"ena minuta":"eno minuto";case"mm":return e+=1===a?b?"minuta":"minuto":2===a?b||d?"minuti":"minutama":5>a?b||d?"minute":"minutami":b||d?"minut":"minutami";case"h":return b?"ena ura":"eno uro";case"hh":return e+=1===a?b?"ura":"uro":2===a?b||d?"uri":"urama":5>a?b||d?"ure":"urami":b||d?"ur":"urami";case"d":return b||d?"en dan":"enim dnem";case"dd":return e+=1===a?b||d?"dan":"dnem":2===a?b||d?"dni":"dnevoma":b||d?"dni":"dnevi";case"M":return b||d?"en mesec":"enim mesecem";case"MM":return e+=1===a?b||d?"mesec":"mesecem":2===a?b||d?"meseca":"mesecema":5>a?b||d?"mesece":"meseci":b||d?"mesecev":"meseci";case"y":return b||d?"eno leto":"enim letom";case"yy":return e+=1===a?b||d?"leto":"letom":2===a?b||d?"leti":"letoma":5>a?b||d?"leta":"leti":b||d?"let":"leti"}}function S(a){var b=a;return b=-1!==a.indexOf("jaj")?b.slice(0,-3)+"leS":-1!==a.indexOf("jar")?b.slice(0,-3)+"waQ":-1!==a.indexOf("DIS")?b.slice(0,-3)+"nem":b+" pIq"}function T(a){var b=a;return b=-1!==a.indexOf("jaj")?b.slice(0,-3)+"Hu’":-1!==a.indexOf("jar")?b.slice(0,-3)+"wen":-1!==a.indexOf("DIS")?b.slice(0,-3)+"ben":b+" ret"}function U(a,b,c,d){var e=V(a);switch(c){case"mm":return e+" tup";case"hh":return e+" rep";case"dd":return e+" jaj";case"MM":return e+" jar";case"yy":return e+" DIS"}}function V(a){var b=Math.floor(a%1e3/100),c=Math.floor(a%100/10),d=a%10,e="";return b>0&&(e+=_a[b]+"vatlh"),c>0&&(e+=(""!==e?" ":"")+_a[c]+"maH"),d>0&&(e+=(""!==e?" ":"")+_a[d]),""===e?"pagh":e}function W(a,b,c,d){var e={s:["viensas secunds","'iensas secunds"],m:["'n míut","'iens míut"],mm:[a+" míuts",""+a+" míuts"],h:["'n þora","'iensa þora"],hh:[a+" þoras",""+a+" þoras"],d:["'n ziua","'iensa ziua"],dd:[a+" ziuas",""+a+" ziuas"],M:["'n mes","'iens mes"],MM:[a+" mesen",""+a+" mesen"],y:["'n ar","'iens ar"],yy:[a+" ars",""+a+" ars"]};return d?e[c][0]:b?e[c][0]:e[c][1]} +function R(a,b,c,d){var e=a+" ";switch(c){case"s":return b||d?"nekaj sekund":"nekaj sekundami";case"m":return b?"ena minuta":"eno minuto";case"mm":return e+=1===a?b?"minuta":"minuto":2===a?b||d?"minuti":"minutama":5>a?b||d?"minute":"minutami":b||d?"minut":"minutami";case"h":return b?"ena ura":"eno uro";case"hh":return e+=1===a?b?"ura":"uro":2===a?b||d?"uri":"urama":5>a?b||d?"ure":"urami":b||d?"ur":"urami";case"d":return b||d?"en dan":"enim dnem";case"dd":return e+=1===a?b||d?"dan":"dnem":2===a?b||d?"dni":"dnevoma":b||d?"dni":"dnevi";case"M":return b||d?"en mesec":"enim mesecem";case"MM":return e+=1===a?b||d?"mesec":"mesecem":2===a?b||d?"meseca":"mesecema":5>a?b||d?"mesece":"meseci":b||d?"mesecev":"meseci";case"y":return b||d?"eno leto":"enim letom";case"yy":return e+=1===a?b||d?"leto":"letom":2===a?b||d?"leti":"letoma":5>a?b||d?"leta":"leti":b||d?"let":"leti"}}function S(a){var b=a;return b=-1!==a.indexOf("jaj")?b.slice(0,-3)+"leS":-1!==a.indexOf("jar")?b.slice(0,-3)+"waQ":-1!==a.indexOf("DIS")?b.slice(0,-3)+"nem":b+" pIq"}function T(a){var b=a;return b=-1!==a.indexOf("jaj")?b.slice(0,-3)+"Hu’":-1!==a.indexOf("jar")?b.slice(0,-3)+"wen":-1!==a.indexOf("DIS")?b.slice(0,-3)+"ben":b+" ret"}function U(a,b,c,d){var e=V(a);switch(c){case"mm":return e+" tup";case"hh":return e+" rep";case"dd":return e+" jaj";case"MM":return e+" jar";case"yy":return e+" DIS"}}function V(a){var b=Math.floor(a%1e3/100),c=Math.floor(a%100/10),d=a%10,e="";return b>0&&(e+=bb[b]+"vatlh"),c>0&&(e+=(""!==e?" ":"")+bb[c]+"maH"),d>0&&(e+=(""!==e?" ":"")+bb[d]),""===e?"pagh":e}function W(a,b,c,d){var e={s:["viensas secunds","'iensas secunds"],m:["'n míut","'iens míut"],mm:[a+" míuts",""+a+" míuts"],h:["'n þora","'iensa þora"],hh:[a+" þoras",""+a+" þoras"],d:["'n ziua","'iensa ziua"],dd:[a+" ziuas",""+a+" ziuas"],M:["'n mes","'iens mes"],MM:[a+" mesen",""+a+" mesen"],y:["'n ar","'iens ar"],yy:[a+" ars",""+a+" ars"]};return d?e[c][0]:b?e[c][0]:e[c][1]} //! moment.js locale configuration //! locale : ukrainian (uk) //! author : zemlanin : https://github.com/zemlanin @@ -66,7 +67,7 @@ function X(a,b){var c=a.split("_");return b%10===1&&b%100!==11?c[0]:b%10>=2&&4>= //! moment.js locale configuration //! locale : afrikaans (af) //! author : Werner Mollentze : https://github.com/wernerm -var _=(a.defineLocale("af",{months:"Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des".split("_"),weekdays:"Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag".split("_"),weekdaysShort:"Son_Maa_Din_Woe_Don_Vry_Sat".split("_"),weekdaysMin:"So_Ma_Di_Wo_Do_Vr_Sa".split("_"),meridiemParse:/vm|nm/i,isPM:function(a){return/^nm$/i.test(a)},meridiem:function(a,b,c){return 12>a?c?"vm":"VM":c?"nm":"NM"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Vandag om] LT",nextDay:"[Môre om] LT",nextWeek:"dddd [om] LT",lastDay:"[Gister om] LT",lastWeek:"[Laas] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oor %s",past:"%s gelede",s:"'n paar sekondes",m:"'n minuut",mm:"%d minute",h:"'n uur",hh:"%d ure",d:"'n dag",dd:"%d dae",M:"'n maand",MM:"%d maande",y:"'n jaar",yy:"%d jaar"},ordinalParse:/\d{1,2}(ste|de)/,ordinal:function(a){return a+(1===a||8===a||a>=20?"ste":"de")},week:{dow:1,doy:4}}),a.defineLocale("ar-ma",{months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdays:"الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:6,doy:12}}),{1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"}),aa={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},ba=(a.defineLocale("ar-sa",{months:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(a){return"م"===a},meridiem:function(a,b,c){return 12>a?"ص":"م"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},preparse:function(a){return a.replace(/[١٢٣٤٥٦٧٨٩٠]/g,function(a){return aa[a]}).replace(/،/g,",")},postformat:function(a){return a.replace(/\d/g,function(a){return _[a]}).replace(/,/g,"،")},week:{dow:6,doy:12}}),a.defineLocale("ar-tn",{months:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:1,doy:4}}),{1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"}),ca={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},da=function(a){return 0===a?0:1===a?1:2===a?2:a%100>=3&&10>=a%100?3:a%100>=11?4:5},ea={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},fa=function(a){return function(b,c,d,e){var f=da(b),g=ea[a][da(b)];return 2===f&&(g=g[c?0:1]),g.replace(/%d/i,b)}},ga=["كانون الثاني يناير","شباط فبراير","آذار مارس","نيسان أبريل","أيار مايو","حزيران يونيو","تموز يوليو","آب أغسطس","أيلول سبتمبر","تشرين الأول أكتوبر","تشرين الثاني نوفمبر","كانون الأول ديسمبر"],ha=(a.defineLocale("ar",{months:ga,monthsShort:ga,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(a){return"م"===a},meridiem:function(a,b,c){return 12>a?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:fa("s"),m:fa("m"),mm:fa("m"),h:fa("h"),hh:fa("h"),d:fa("d"),dd:fa("d"),M:fa("M"),MM:fa("M"),y:fa("y"),yy:fa("y")},preparse:function(a){return a.replace(/\u200f/g,"").replace(/[١٢٣٤٥٦٧٨٩٠]/g,function(a){return ca[a]}).replace(/،/g,",")},postformat:function(a){return a.replace(/\d/g,function(a){return ba[a]}).replace(/,/g,"،")},week:{dow:6,doy:12}}),{1:"-inci",5:"-inci",8:"-inci",70:"-inci",80:"-inci",2:"-nci",7:"-nci",20:"-nci",50:"-nci",3:"-üncü",4:"-üncü",100:"-üncü",6:"-ncı",9:"-uncu",10:"-uncu",30:"-uncu",60:"-ıncı",90:"-ıncı"}),ia=(a.defineLocale("az",{months:"yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr".split("_"),monthsShort:"yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek".split("_"),weekdays:"Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə".split("_"),weekdaysShort:"Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən".split("_"),weekdaysMin:"Bz_BE_ÇA_Çə_CA_Cü_Şə".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[sabah saat] LT",nextWeek:"[gələn həftə] dddd [saat] LT",lastDay:"[dünən] LT",lastWeek:"[keçən həftə] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s əvvəl",s:"birneçə saniyyə",m:"bir dəqiqə",mm:"%d dəqiqə",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir il",yy:"%d il"},meridiemParse:/gecə|səhər|gündüz|axşam/,isPM:function(a){return/^(gündüz|axşam)$/.test(a)},meridiem:function(a,b,c){return 4>a?"gecə":12>a?"səhər":17>a?"gündüz":"axşam"},ordinalParse:/\d{1,2}-(ıncı|inci|nci|üncü|ncı|uncu)/,ordinal:function(a){if(0===a)return a+"-ıncı";var b=a%10,c=a%100-b,d=a>=100?100:null;return a+(ha[b]||ha[c]||ha[d])},week:{dow:1,doy:7}}),a.defineLocale("be",{months:{format:"студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня".split("_"),standalone:"студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань".split("_")},monthsShort:"студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж".split("_"),weekdays:{format:"нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу".split("_"),standalone:"нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота".split("_"),isFormat:/\[ ?[Вв] ?(?:мінулую|наступную)? ?\] ?dddd/},weekdaysShort:"нд_пн_ат_ср_чц_пт_сб".split("_"),weekdaysMin:"нд_пн_ат_ср_чц_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., HH:mm",LLLL:"dddd, D MMMM YYYY г., HH:mm"},calendar:{sameDay:"[Сёння ў] LT",nextDay:"[Заўтра ў] LT",lastDay:"[Учора ў] LT",nextWeek:function(){return"[У] dddd [ў] LT"},lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return"[У мінулую] dddd [ў] LT";case 1:case 2:case 4:return"[У мінулы] dddd [ў] LT"}},sameElse:"L"},relativeTime:{future:"праз %s",past:"%s таму",s:"некалькі секунд",m:c,mm:c,h:c,hh:c,d:"дзень",dd:c,M:"месяц",MM:c,y:"год",yy:c},meridiemParse:/ночы|раніцы|дня|вечара/,isPM:function(a){return/^(дня|вечара)$/.test(a)},meridiem:function(a,b,c){return 4>a?"ночы":12>a?"раніцы":17>a?"дня":"вечара"},ordinalParse:/\d{1,2}-(і|ы|га)/,ordinal:function(a,b){switch(b){case"M":case"d":case"DDD":case"w":case"W":return a%10!==2&&a%10!==3||a%100===12||a%100===13?a+"-ы":a+"-і";case"D":return a+"-га";default:return a}},week:{dow:1,doy:7}}),a.defineLocale("bg",{months:"януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември".split("_"),monthsShort:"янр_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек".split("_"),weekdays:"неделя_понеделник_вторник_сряда_четвъртък_петък_събота".split("_"),weekdaysShort:"нед_пон_вто_сря_чет_пет_съб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Днес в] LT",nextDay:"[Утре в] LT",nextWeek:"dddd [в] LT",lastDay:"[Вчера в] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[В изминалата] dddd [в] LT";case 1:case 2:case 4:case 5:return"[В изминалия] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"след %s",past:"преди %s",s:"няколко секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дни",M:"месец",MM:"%d месеца",y:"година",yy:"%d години"},ordinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(a){var b=a%10,c=a%100;return 0===a?a+"-ев":0===c?a+"-ен":c>10&&20>c?a+"-ти":1===b?a+"-ви":2===b?a+"-ри":7===b||8===b?a+"-ми":a+"-ти"},week:{dow:1,doy:7}}),{1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"}),ja={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"},ka=(a.defineLocale("bn",{months:"জানুয়ারী_ফেবুয়ারী_মার্চ_এপ্রিল_মে_জুন_জুলাই_অগাস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),monthsShort:"জানু_ফেব_মার্চ_এপর_মে_জুন_জুল_অগ_সেপ্ট_অক্টো_নভ_ডিসেম্".split("_"),weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পত্তিবার_শুক্রবার_শনিবার".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পত্তি_শুক্র_শনি".split("_"),weekdaysMin:"রব_সম_মঙ্গ_বু_ব্রিহ_শু_শনি".split("_"),longDateFormat:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm সময়",LLLL:"dddd, D MMMM YYYY, A h:mm সময়"},calendar:{sameDay:"[আজ] LT",nextDay:"[আগামীকাল] LT",nextWeek:"dddd, LT",lastDay:"[গতকাল] LT",lastWeek:"[গত] dddd, LT",sameElse:"L"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"},preparse:function(a){return a.replace(/[১২৩৪৫৬৭৮৯০]/g,function(a){return ja[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return ia[a]})},meridiemParse:/রাত|সকাল|দুপুর|বিকাল|রাত/,isPM:function(a){return/^(দুপুর|বিকাল|রাত)$/.test(a)},meridiem:function(a,b,c){return 4>a?"রাত":10>a?"সকাল":17>a?"দুপুর":20>a?"বিকাল":"রাত"},week:{dow:0,doy:6}}),{1:"༡",2:"༢",3:"༣",4:"༤",5:"༥",6:"༦",7:"༧",8:"༨",9:"༩",0:"༠"}),la={"༡":"1","༢":"2","༣":"3","༤":"4","༥":"5","༦":"6","༧":"7","༨":"8","༩":"9","༠":"0"},ma=(a.defineLocale("bo",{months:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),monthsShort:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),weekdays:"གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་".split("_"),weekdaysShort:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),weekdaysMin:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[དི་རིང] LT",nextDay:"[སང་ཉིན] LT",nextWeek:"[བདུན་ཕྲག་རྗེས་མ], LT",lastDay:"[ཁ་སང] LT",lastWeek:"[བདུན་ཕྲག་མཐའ་མ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ལ་",past:"%s སྔན་ལ",s:"ལམ་སང",m:"སྐར་མ་གཅིག",mm:"%d སྐར་མ",h:"ཆུ་ཚོད་གཅིག",hh:"%d ཆུ་ཚོད",d:"ཉིན་གཅིག",dd:"%d ཉིན་",M:"ཟླ་བ་གཅིག",MM:"%d ཟླ་བ",y:"ལོ་གཅིག",yy:"%d ལོ"},preparse:function(a){return a.replace(/[༡༢༣༤༥༦༧༨༩༠]/g,function(a){return la[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return ka[a]})},meridiemParse:/མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/,isPM:function(a){return/^(ཉིན་གུང|དགོང་དག|མཚན་མོ)$/.test(a)},meridiem:function(a,b,c){return 4>a?"མཚན་མོ":10>a?"ཞོགས་ཀས":17>a?"ཉིན་གུང":20>a?"དགོང་དག":"མཚན་མོ"},week:{dow:0,doy:6}}),a.defineLocale("br",{months:"Genver_C'hwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu".split("_"),monthsShort:"Gen_C'hwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker".split("_"),weekdays:"Sul_Lun_Meurzh_Merc'her_Yaou_Gwener_Sadorn".split("_"),weekdaysShort:"Sul_Lun_Meu_Mer_Yao_Gwe_Sad".split("_"),weekdaysMin:"Su_Lu_Me_Mer_Ya_Gw_Sa".split("_"),longDateFormat:{LT:"h[e]mm A",LTS:"h[e]mm:ss A",L:"DD/MM/YYYY",LL:"D [a viz] MMMM YYYY",LLL:"D [a viz] MMMM YYYY h[e]mm A",LLLL:"dddd, D [a viz] MMMM YYYY h[e]mm A"},calendar:{sameDay:"[Hiziv da] LT",nextDay:"[Warc'hoazh da] LT",nextWeek:"dddd [da] LT",lastDay:"[Dec'h da] LT",lastWeek:"dddd [paset da] LT",sameElse:"L"},relativeTime:{future:"a-benn %s",past:"%s 'zo",s:"un nebeud segondennoù",m:"ur vunutenn",mm:d,h:"un eur",hh:"%d eur",d:"un devezh",dd:d,M:"ur miz",MM:d,y:"ur bloaz",yy:e},ordinalParse:/\d{1,2}(añ|vet)/,ordinal:function(a){var b=1===a?"añ":"vet";return a+b},week:{dow:1,doy:4}}),a.defineLocale("bs",{months:"januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.".split("_"),weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:case 3:return"[prošlu] dddd [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",m:i,mm:i,h:i,hh:i,d:"dan",dd:i,M:"mjesec",MM:i,y:"godinu",yy:i},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),a.defineLocale("ca",{months:"gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre".split("_"),monthsShort:"gen._febr._mar._abr._mai._jun._jul._ag._set._oct._nov._des.".split("_"),weekdays:"diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dt._dc._dj._dv._ds.".split("_"),weekdaysMin:"Dg_Dl_Dt_Dc_Dj_Dv_Ds".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd D MMMM YYYY H:mm"},calendar:{sameDay:function(){return"[avui a "+(1!==this.hours()?"les":"la")+"] LT"},nextDay:function(){return"[demà a "+(1!==this.hours()?"les":"la")+"] LT"},nextWeek:function(){return"dddd [a "+(1!==this.hours()?"les":"la")+"] LT"},lastDay:function(){return"[ahir a "+(1!==this.hours()?"les":"la")+"] LT"},lastWeek:function(){return"[el] dddd [passat a "+(1!==this.hours()?"les":"la")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"fa %s",s:"uns segons",m:"un minut",mm:"%d minuts",h:"una hora",hh:"%d hores",d:"un dia",dd:"%d dies",M:"un mes",MM:"%d mesos",y:"un any",yy:"%d anys"},ordinalParse:/\d{1,2}(r|n|t|è|a)/,ordinal:function(a,b){var c=1===a?"r":2===a?"n":3===a?"r":4===a?"t":"è";return("w"===b||"W"===b)&&(c="a"),a+c},week:{dow:1,doy:4}}),"leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec".split("_")),na="led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro".split("_"),oa=(a.defineLocale("cs",{months:ma,monthsShort:na,monthsParse:function(a,b){var c,d=[];for(c=0;12>c;c++)d[c]=new RegExp("^"+a[c]+"$|^"+b[c]+"$","i");return d}(ma,na),shortMonthsParse:function(a){var b,c=[];for(b=0;12>b;b++)c[b]=new RegExp("^"+a[b]+"$","i");return c}(na),longMonthsParse:function(a){var b,c=[];for(b=0;12>b;b++)c[b]=new RegExp("^"+a[b]+"$","i");return c}(ma),weekdays:"neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota".split("_"),weekdaysShort:"ne_po_út_st_čt_pá_so".split("_"),weekdaysMin:"ne_po_út_st_čt_pá_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm"},calendar:{sameDay:"[dnes v] LT",nextDay:"[zítra v] LT",nextWeek:function(){switch(this.day()){case 0:return"[v neděli v] LT";case 1:case 2:return"[v] dddd [v] LT";case 3:return"[ve středu v] LT";case 4:return"[ve čtvrtek v] LT";case 5:return"[v pátek v] LT";case 6:return"[v sobotu v] LT"}},lastDay:"[včera v] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulou neděli v] LT";case 1:case 2:return"[minulé] dddd [v] LT";case 3:return"[minulou středu v] LT";case 4:case 5:return"[minulý] dddd [v] LT";case 6:return"[minulou sobotu v] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"před %s",s:k,m:k,mm:k,h:k,hh:k,d:k,dd:k,M:k,MM:k,y:k,yy:k},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),a.defineLocale("cv",{months:"кӑрлач_нарӑс_пуш_ака_май_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав".split("_"),monthsShort:"кӑр_нар_пуш_ака_май_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш".split("_"),weekdays:"вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун".split("_"),weekdaysShort:"выр_тун_ытл_юн_кӗҫ_эрн_шӑм".split("_"),weekdaysMin:"вр_тн_ыт_юн_кҫ_эр_шм".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]",LLL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm",LLLL:"dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm"},calendar:{sameDay:"[Паян] LT [сехетре]",nextDay:"[Ыран] LT [сехетре]",lastDay:"[Ӗнер] LT [сехетре]",nextWeek:"[Ҫитес] dddd LT [сехетре]",lastWeek:"[Иртнӗ] dddd LT [сехетре]",sameElse:"L"},relativeTime:{future:function(a){var b=/сехет$/i.exec(a)?"рен":/ҫул$/i.exec(a)?"тан":"ран";return a+b},past:"%s каялла",s:"пӗр-ик ҫеккунт",m:"пӗр минут",mm:"%d минут",h:"пӗр сехет",hh:"%d сехет",d:"пӗр кун",dd:"%d кун",M:"пӗр уйӑх",MM:"%d уйӑх",y:"пӗр ҫул",yy:"%d ҫул"},ordinalParse:/\d{1,2}-мӗш/,ordinal:"%d-мӗш",week:{dow:1,doy:7}}),a.defineLocale("cy",{months:"Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr".split("_"),monthsShort:"Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag".split("_"),weekdays:"Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn".split("_"),weekdaysShort:"Sul_Llun_Maw_Mer_Iau_Gwe_Sad".split("_"),weekdaysMin:"Su_Ll_Ma_Me_Ia_Gw_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Heddiw am] LT",nextDay:"[Yfory am] LT",nextWeek:"dddd [am] LT",lastDay:"[Ddoe am] LT",lastWeek:"dddd [diwethaf am] LT",sameElse:"L"},relativeTime:{future:"mewn %s",past:"%s yn ôl",s:"ychydig eiliadau",m:"munud",mm:"%d munud",h:"awr",hh:"%d awr",d:"diwrnod",dd:"%d diwrnod",M:"mis",MM:"%d mis",y:"blwyddyn",yy:"%d flynedd"},ordinalParse:/\d{1,2}(fed|ain|af|il|ydd|ed|eg)/,ordinal:function(a){var b=a,c="",d=["","af","il","ydd","ydd","ed","ed","ed","fed","fed","fed","eg","fed","eg","eg","fed","eg","eg","fed","eg","fed"];return b>20?c=40===b||50===b||60===b||80===b||100===b?"fed":"ain":b>0&&(c=d[b]),a+c},week:{dow:1,doy:4}}),a.defineLocale("da",{months:"januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"søn_man_tir_ons_tor_fre_lør".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd [d.] D. MMMM YYYY HH:mm"},calendar:{sameDay:"[I dag kl.] LT",nextDay:"[I morgen kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[I går kl.] LT",lastWeek:"[sidste] dddd [kl] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"få sekunder",m:"et minut",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dage",M:"en måned",MM:"%d måneder",y:"et år",yy:"%d år"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),a.defineLocale("de-at",{months:"Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jän._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",m:l,mm:"%d Minuten",h:l,hh:"%d Stunden",d:l,dd:l,M:l,MM:l,y:l,yy:l},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),a.defineLocale("de",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",m:m,mm:"%d Minuten",h:m,hh:"%d Stunden",d:m,dd:m,M:m,MM:m,y:m,yy:m},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),["ޖެނުއަރީ","ފެބްރުއަރީ","މާރިޗު","އޭޕްރީލު","މޭ","ޖޫން","ޖުލައި","އޯގަސްޓު","ސެޕްޓެމްބަރު","އޮކްޓޯބަރު","ނޮވެމްބަރު","ޑިސެމްބަރު"]),pa=["އާދިއްތަ","ހޯމަ","އަންގާރަ","ބުދަ","ބުރާސްފަތި","ހުކުރު","ހޮނިހިރު"],qa=(a.defineLocale("dv",{months:oa,monthsShort:oa,weekdays:pa,weekdaysShort:pa,weekdaysMin:"އާދި_ހޯމަ_އަން_ބުދަ_ބުރާ_ހުކު_ހޮނި".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/M/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/މކ|މފ/,isPM:function(a){return""===a},meridiem:function(a,b,c){return 12>a?"މކ":"މފ"},calendar:{sameDay:"[މިއަދު] LT",nextDay:"[މާދަމާ] LT",nextWeek:"dddd LT",lastDay:"[އިއްޔެ] LT",lastWeek:"[ފާއިތުވި] dddd LT",sameElse:"L"},relativeTime:{future:"ތެރޭގައި %s",past:"ކުރިން %s",s:"ސިކުންތުކޮޅެއް",m:"މިނިޓެއް",mm:"މިނިޓު %d",h:"ގަޑިއިރެއް",hh:"ގަޑިއިރު %d",d:"ދުވަހެއް",dd:"ދުވަސް %d",M:"މަހެއް",MM:"މަސް %d",y:"އަހަރެއް",yy:"އަހަރު %d"},preparse:function(a){return a.replace(/،/g,",")},postformat:function(a){return a.replace(/,/g,"،")},week:{dow:7,doy:12}}),a.defineLocale("el",{monthsNominativeEl:"Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος".split("_"),monthsGenitiveEl:"Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου".split("_"),months:function(a,b){return/D/.test(b.substring(0,b.indexOf("MMMM")))?this._monthsGenitiveEl[a.month()]:this._monthsNominativeEl[a.month()]},monthsShort:"Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ".split("_"),weekdays:"Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο".split("_"),weekdaysShort:"Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ".split("_"),weekdaysMin:"Κυ_Δε_Τρ_Τε_Πε_Πα_Σα".split("_"),meridiem:function(a,b,c){return a>11?c?"μμ":"ΜΜ":c?"πμ":"ΠΜ"},isPM:function(a){return"μ"===(a+"").toLowerCase()[0]},meridiemParse:/[ΠΜ]\.?Μ?\.?/i,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendarEl:{sameDay:"[Σήμερα {}] LT",nextDay:"[Αύριο {}] LT",nextWeek:"dddd [{}] LT",lastDay:"[Χθες {}] LT",lastWeek:function(){switch(this.day()){case 6:return"[το προηγούμενο] dddd [{}] LT";default:return"[την προηγούμενη] dddd [{}] LT"}},sameElse:"L"},calendar:function(a,b){var c=this._calendarEl[a],d=b&&b.hours();return n(c)&&(c=c.apply(b)),c.replace("{}",d%12===1?"στη":"στις")},relativeTime:{future:"σε %s",past:"%s πριν",s:"λίγα δευτερόλεπτα",m:"ένα λεπτό",mm:"%d λεπτά",h:"μία ώρα",hh:"%d ώρες",d:"μία μέρα",dd:"%d μέρες",M:"ένας μήνας",MM:"%d μήνες",y:"ένας χρόνος",yy:"%d χρόνια"},ordinalParse:/\d{1,2}η/,ordinal:"%dη",week:{dow:1,doy:4}}),a.defineLocale("en-au",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{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"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(a){var b=a%10,c=1===~~(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c},week:{dow:1,doy:4}}),a.defineLocale("en-ca",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"YYYY-MM-DD",LL:"D MMMM, YYYY",LLL:"D MMMM, YYYY h:mm A",LLLL:"dddd, D MMMM, YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{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"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(a){var b=a%10,c=1===~~(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c}}),a.defineLocale("en-gb",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{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"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(a){var b=a%10,c=1===~~(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c},week:{dow:1,doy:4}}),a.defineLocale("en-ie",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{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"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(a){var b=a%10,c=1===~~(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c},week:{dow:1,doy:4}}),a.defineLocale("en-nz",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{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"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(a){var b=a%10,c=1===~~(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c},week:{dow:1,doy:4}}),a.defineLocale("eo",{months:"januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aŭg_sep_okt_nov_dec".split("_"),weekdays:"Dimanĉo_Lundo_Mardo_Merkredo_Ĵaŭdo_Vendredo_Sabato".split("_"),weekdaysShort:"Dim_Lun_Mard_Merk_Ĵaŭ_Ven_Sab".split("_"),weekdaysMin:"Di_Lu_Ma_Me_Ĵa_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D[-an de] MMMM, YYYY",LLL:"D[-an de] MMMM, YYYY HH:mm",LLLL:"dddd, [la] D[-an de] MMMM, YYYY HH:mm"},meridiemParse:/[ap]\.t\.m/i,isPM:function(a){return"p"===a.charAt(0).toLowerCase()},meridiem:function(a,b,c){return a>11?c?"p.t.m.":"P.T.M.":c?"a.t.m.":"A.T.M."; -},calendar:{sameDay:"[Hodiaŭ je] LT",nextDay:"[Morgaŭ je] LT",nextWeek:"dddd [je] LT",lastDay:"[Hieraŭ je] LT",lastWeek:"[pasinta] dddd [je] LT",sameElse:"L"},relativeTime:{future:"je %s",past:"antaŭ %s",s:"sekundoj",m:"minuto",mm:"%d minutoj",h:"horo",hh:"%d horoj",d:"tago",dd:"%d tagoj",M:"monato",MM:"%d monatoj",y:"jaro",yy:"%d jaroj"},ordinalParse:/\d{1,2}a/,ordinal:"%da",week:{dow:1,doy:7}}),"ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_")),ra="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),sa=(a.defineLocale("es",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(a,b){return/-MMM-/.test(b)?ra[a.month()]:qa[a.month()]},weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}}),a.defineLocale("et",{months:"jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember".split("_"),monthsShort:"jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets".split("_"),weekdays:"pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev".split("_"),weekdaysShort:"P_E_T_K_N_R_L".split("_"),weekdaysMin:"P_E_T_K_N_R_L".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[Täna,] LT",nextDay:"[Homme,] LT",nextWeek:"[Järgmine] dddd LT",lastDay:"[Eile,] LT",lastWeek:"[Eelmine] dddd LT",sameElse:"L"},relativeTime:{future:"%s pärast",past:"%s tagasi",s:o,m:o,mm:o,h:o,hh:o,d:o,dd:"%d päeva",M:o,MM:o,y:o,yy:o},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),a.defineLocale("eu",{months:"urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua".split("_"),monthsShort:"urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.".split("_"),weekdays:"igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata".split("_"),weekdaysShort:"ig._al._ar._az._og._ol._lr.".split("_"),weekdaysMin:"ig_al_ar_az_og_ol_lr".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY[ko] MMMM[ren] D[a]",LLL:"YYYY[ko] MMMM[ren] D[a] HH:mm",LLLL:"dddd, YYYY[ko] MMMM[ren] D[a] HH:mm",l:"YYYY-M-D",ll:"YYYY[ko] MMM D[a]",lll:"YYYY[ko] MMM D[a] HH:mm",llll:"ddd, YYYY[ko] MMM D[a] HH:mm"},calendar:{sameDay:"[gaur] LT[etan]",nextDay:"[bihar] LT[etan]",nextWeek:"dddd LT[etan]",lastDay:"[atzo] LT[etan]",lastWeek:"[aurreko] dddd LT[etan]",sameElse:"L"},relativeTime:{future:"%s barru",past:"duela %s",s:"segundo batzuk",m:"minutu bat",mm:"%d minutu",h:"ordu bat",hh:"%d ordu",d:"egun bat",dd:"%d egun",M:"hilabete bat",MM:"%d hilabete",y:"urte bat",yy:"%d urte"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),{1:"۱",2:"۲",3:"۳",4:"۴",5:"۵",6:"۶",7:"۷",8:"۸",9:"۹",0:"۰"}),ta={"۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","۰":"0"},ua=(a.defineLocale("fa",{months:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),monthsShort:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),weekdays:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysShort:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysMin:"ی_د_س_چ_پ_ج_ش".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/قبل از ظهر|بعد از ظهر/,isPM:function(a){return/بعد از ظهر/.test(a)},meridiem:function(a,b,c){return 12>a?"قبل از ظهر":"بعد از ظهر"},calendar:{sameDay:"[امروز ساعت] LT",nextDay:"[فردا ساعت] LT",nextWeek:"dddd [ساعت] LT",lastDay:"[دیروز ساعت] LT",lastWeek:"dddd [پیش] [ساعت] LT",sameElse:"L"},relativeTime:{future:"در %s",past:"%s پیش",s:"چندین ثانیه",m:"یک دقیقه",mm:"%d دقیقه",h:"یک ساعت",hh:"%d ساعت",d:"یک روز",dd:"%d روز",M:"یک ماه",MM:"%d ماه",y:"یک سال",yy:"%d سال"},preparse:function(a){return a.replace(/[۰-۹]/g,function(a){return ta[a]}).replace(/،/g,",")},postformat:function(a){return a.replace(/\d/g,function(a){return sa[a]}).replace(/,/g,"،")},ordinalParse:/\d{1,2}م/,ordinal:"%dم",week:{dow:6,doy:12}}),"nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän".split(" ")),va=["nolla","yhden","kahden","kolmen","neljän","viiden","kuuden",ua[7],ua[8],ua[9]],wa=(a.defineLocale("fi",{months:"tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu".split("_"),monthsShort:"tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu".split("_"),weekdays:"sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai".split("_"),weekdaysShort:"su_ma_ti_ke_to_pe_la".split("_"),weekdaysMin:"su_ma_ti_ke_to_pe_la".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"Do MMMM[ta] YYYY",LLL:"Do MMMM[ta] YYYY, [klo] HH.mm",LLLL:"dddd, Do MMMM[ta] YYYY, [klo] HH.mm",l:"D.M.YYYY",ll:"Do MMM YYYY",lll:"Do MMM YYYY, [klo] HH.mm",llll:"ddd, Do MMM YYYY, [klo] HH.mm"},calendar:{sameDay:"[tänään] [klo] LT",nextDay:"[huomenna] [klo] LT",nextWeek:"dddd [klo] LT",lastDay:"[eilen] [klo] LT",lastWeek:"[viime] dddd[na] [klo] LT",sameElse:"L"},relativeTime:{future:"%s päästä",past:"%s sitten",s:p,m:p,mm:p,h:p,hh:p,d:p,dd:p,M:p,MM:p,y:p,yy:p},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),a.defineLocale("fo",{months:"januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur".split("_"),weekdaysShort:"sun_mán_týs_mik_hós_frí_ley".split("_"),weekdaysMin:"su_má_tý_mi_hó_fr_le".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D. MMMM, YYYY HH:mm"},calendar:{sameDay:"[Í dag kl.] LT",nextDay:"[Í morgin kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[Í gjár kl.] LT",lastWeek:"[síðstu] dddd [kl] LT",sameElse:"L"},relativeTime:{future:"um %s",past:"%s síðani",s:"fá sekund",m:"ein minutt",mm:"%d minuttir",h:"ein tími",hh:"%d tímar",d:"ein dagur",dd:"%d dagar",M:"ein mánaði",MM:"%d mánaðir",y:"eitt ár",yy:"%d ár"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),a.defineLocale("fr-ca",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"Di_Lu_Ma_Me_Je_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd'hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},ordinalParse:/\d{1,2}(er|e)/,ordinal:function(a){return a+(1===a?"er":"e")}}),a.defineLocale("fr-ch",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"Di_Lu_Ma_Me_Je_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd'hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},ordinalParse:/\d{1,2}(er|e)/,ordinal:function(a){return a+(1===a?"er":"e")},week:{dow:1,doy:4}}),a.defineLocale("fr",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"Di_Lu_Ma_Me_Je_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd'hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},ordinalParse:/\d{1,2}(er|)/,ordinal:function(a){return a+(1===a?"er":"")},week:{dow:1,doy:4}}),"jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.".split("_")),xa="jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),ya=(a.defineLocale("fy",{months:"jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber".split("_"),monthsShort:function(a,b){return/-MMM-/.test(b)?xa[a.month()]:wa[a.month()]},weekdays:"snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon".split("_"),weekdaysShort:"si._mo._ti._wo._to._fr._so.".split("_"),weekdaysMin:"Si_Mo_Ti_Wo_To_Fr_So".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[hjoed om] LT",nextDay:"[moarn om] LT",nextWeek:"dddd [om] LT",lastDay:"[juster om] LT",lastWeek:"[ôfrûne] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oer %s",past:"%s lyn",s:"in pear sekonden",m:"ien minút",mm:"%d minuten",h:"ien oere",hh:"%d oeren",d:"ien dei",dd:"%d dagen",M:"ien moanne",MM:"%d moannen",y:"ien jier",yy:"%d jierren"},ordinalParse:/\d{1,2}(ste|de)/,ordinal:function(a){return a+(1===a||8===a||a>=20?"ste":"de")},week:{dow:1,doy:4}}),["Am Faoilleach","An Gearran","Am Màrt","An Giblean","An Cèitean","An t-Ògmhios","An t-Iuchar","An Lùnastal","An t-Sultain","An Dàmhair","An t-Samhain","An Dùbhlachd"]),za=["Faoi","Gear","Màrt","Gibl","Cèit","Ògmh","Iuch","Lùn","Sult","Dàmh","Samh","Dùbh"],Aa=["Didòmhnaich","Diluain","Dimàirt","Diciadain","Diardaoin","Dihaoine","Disathairne"],Ba=["Did","Dil","Dim","Dic","Dia","Dih","Dis"],Ca=["Dò","Lu","Mà","Ci","Ar","Ha","Sa"],Da=(a.defineLocale("gd",{months:ya,monthsShort:za,monthsParseExact:!0,weekdays:Aa,weekdaysShort:Ba,weekdaysMin:Ca,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[An-diugh aig] LT",nextDay:"[A-màireach aig] LT",nextWeek:"dddd [aig] LT",lastDay:"[An-dè aig] LT",lastWeek:"dddd [seo chaidh] [aig] LT",sameElse:"L"},relativeTime:{future:"ann an %s",past:"bho chionn %s",s:"beagan diogan",m:"mionaid",mm:"%d mionaidean",h:"uair",hh:"%d uairean",d:"latha",dd:"%d latha",M:"mìos",MM:"%d mìosan",y:"bliadhna",yy:"%d bliadhna"},ordinalParse:/\d{1,2}(d|na|mh)/,ordinal:function(a){var b=1===a?"d":a%10===2?"na":"mh";return a+b},week:{dow:1,doy:4}}),a.defineLocale("gl",{months:"Xaneiro_Febreiro_Marzo_Abril_Maio_Xuño_Xullo_Agosto_Setembro_Outubro_Novembro_Decembro".split("_"),monthsShort:"Xan._Feb._Mar._Abr._Mai._Xuñ._Xul._Ago._Set._Out._Nov._Dec.".split("_"),weekdays:"Domingo_Luns_Martes_Mércores_Xoves_Venres_Sábado".split("_"),weekdaysShort:"Dom._Lun._Mar._Mér._Xov._Ven._Sáb.".split("_"),weekdaysMin:"Do_Lu_Ma_Mé_Xo_Ve_Sá".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd D MMMM YYYY H:mm"},calendar:{sameDay:function(){return"[hoxe "+(1!==this.hours()?"ás":"á")+"] LT"},nextDay:function(){return"[mañá "+(1!==this.hours()?"ás":"á")+"] LT"},nextWeek:function(){return"dddd ["+(1!==this.hours()?"ás":"a")+"] LT"},lastDay:function(){return"[onte "+(1!==this.hours()?"á":"a")+"] LT"},lastWeek:function(){return"[o] dddd [pasado "+(1!==this.hours()?"ás":"a")+"] LT"},sameElse:"L"},relativeTime:{future:function(a){return"uns segundos"===a?"nuns segundos":"en "+a},past:"hai %s",s:"uns segundos",m:"un minuto",mm:"%d minutos",h:"unha hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un ano",yy:"%d anos"},ordinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:7}}),a.defineLocale("he",{months:"ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר".split("_"),monthsShort:"ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳".split("_"),weekdays:"ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת".split("_"),weekdaysShort:"א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳".split("_"),weekdaysMin:"א_ב_ג_ד_ה_ו_ש".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [ב]MMMM YYYY",LLL:"D [ב]MMMM YYYY HH:mm",LLLL:"dddd, D [ב]MMMM YYYY HH:mm",l:"D/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[היום ב־]LT",nextDay:"[מחר ב־]LT",nextWeek:"dddd [בשעה] LT",lastDay:"[אתמול ב־]LT",lastWeek:"[ביום] dddd [האחרון בשעה] LT",sameElse:"L"},relativeTime:{future:"בעוד %s",past:"לפני %s",s:"מספר שניות",m:"דקה",mm:"%d דקות",h:"שעה",hh:function(a){return 2===a?"שעתיים":a+" שעות"},d:"יום",dd:function(a){return 2===a?"יומיים":a+" ימים"},M:"חודש",MM:function(a){return 2===a?"חודשיים":a+" חודשים"},y:"שנה",yy:function(a){return 2===a?"שנתיים":a%10===0&&10!==a?a+" שנה":a+" שנים"}}}),{1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"}),Ea={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"},Fa=(a.defineLocale("hi",{months:"जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर".split("_"),monthsShort:"जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.".split("_"),weekdays:"रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm बजे",LTS:"A h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm बजे",LLLL:"dddd, D MMMM YYYY, A h:mm बजे"},calendar:{sameDay:"[आज] LT",nextDay:"[कल] LT",nextWeek:"dddd, LT",lastDay:"[कल] LT",lastWeek:"[पिछले] dddd, LT",sameElse:"L"},relativeTime:{future:"%s में",past:"%s पहले",s:"कुछ ही क्षण",m:"एक मिनट",mm:"%d मिनट",h:"एक घंटा",hh:"%d घंटे",d:"एक दिन",dd:"%d दिन",M:"एक महीने",MM:"%d महीने",y:"एक वर्ष",yy:"%d वर्ष"},preparse:function(a){return a.replace(/[१२३४५६७८९०]/g,function(a){return Ea[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return Da[a]})},meridiemParse:/रात|सुबह|दोपहर|शाम/,meridiemHour:function(a,b){return 12===a&&(a=0),"रात"===b?4>a?a:a+12:"सुबह"===b?a:"दोपहर"===b?a>=10?a:a+12:"शाम"===b?a+12:void 0},meridiem:function(a,b,c){return 4>a?"रात":10>a?"सुबह":17>a?"दोपहर":20>a?"शाम":"रात"},week:{dow:0,doy:6}}),a.defineLocale("hr",{months:{format:"siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca".split("_"),standalone:"siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac".split("_")},monthsShort:"sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.".split("_"),weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:case 3:return"[prošlu] dddd [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",m:r,mm:r,h:r,hh:r,d:"dan",dd:r,M:"mjesec",MM:r,y:"godinu",yy:r},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),"vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton".split(" ")),Ga=(a.defineLocale("hu",{months:"január_február_március_április_május_június_július_augusztus_szeptember_október_november_december".split("_"),monthsShort:"jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec".split("_"),weekdays:"vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat".split("_"),weekdaysShort:"vas_hét_kedd_sze_csüt_pén_szo".split("_"),weekdaysMin:"v_h_k_sze_cs_p_szo".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY. MMMM D.",LLL:"YYYY. MMMM D. H:mm",LLLL:"YYYY. MMMM D., dddd H:mm"},meridiemParse:/de|du/i,isPM:function(a){return"u"===a.charAt(1).toLowerCase()},meridiem:function(a,b,c){return 12>a?c===!0?"de":"DE":c===!0?"du":"DU"},calendar:{sameDay:"[ma] LT[-kor]",nextDay:"[holnap] LT[-kor]",nextWeek:function(){return t.call(this,!0)},lastDay:"[tegnap] LT[-kor]",lastWeek:function(){return t.call(this,!1)},sameElse:"L"},relativeTime:{future:"%s múlva",past:"%s",s:s,m:s,mm:s,h:s,hh:s,d:s,dd:s,M:s,MM:s,y:s,yy:s},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),a.defineLocale("hy-am",{months:{format:"հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի".split("_"),standalone:"հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր".split("_")},monthsShort:"հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ".split("_"),weekdays:"կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ".split("_"),weekdaysShort:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),weekdaysMin:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY թ.",LLL:"D MMMM YYYY թ., HH:mm",LLLL:"dddd, D MMMM YYYY թ., HH:mm"},calendar:{sameDay:"[այսօր] LT",nextDay:"[վաղը] LT",lastDay:"[երեկ] LT",nextWeek:function(){return"dddd [օրը ժամը] LT"},lastWeek:function(){return"[անցած] dddd [օրը ժամը] LT"},sameElse:"L"},relativeTime:{future:"%s հետո",past:"%s առաջ",s:"մի քանի վայրկյան",m:"րոպե",mm:"%d րոպե",h:"ժամ",hh:"%d ժամ",d:"օր",dd:"%d օր",M:"ամիս",MM:"%d ամիս",y:"տարի",yy:"%d տարի"},meridiemParse:/գիշերվա|առավոտվա|ցերեկվա|երեկոյան/,isPM:function(a){return/^(ցերեկվա|երեկոյան)$/.test(a)},meridiem:function(a){return 4>a?"գիշերվա":12>a?"առավոտվա":17>a?"ցերեկվա":"երեկոյան"},ordinalParse:/\d{1,2}|\d{1,2}-(ին|րդ)/,ordinal:function(a,b){switch(b){case"DDD":case"w":case"W":case"DDDo":return 1===a?a+"-ին":a+"-րդ";default:return a}},week:{dow:1,doy:7}}),a.defineLocale("id",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nov_Des".split("_"),weekdays:"Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu".split("_"),weekdaysShort:"Min_Sen_Sel_Rab_Kam_Jum_Sab".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|siang|sore|malam/,meridiemHour:function(a,b){return 12===a&&(a=0),"pagi"===b?a:"siang"===b?a>=11?a:a+12:"sore"===b||"malam"===b?a+12:void 0},meridiem:function(a,b,c){return 11>a?"pagi":15>a?"siang":19>a?"sore":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Besok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kemarin pukul] LT",lastWeek:"dddd [lalu pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lalu",s:"beberapa detik",m:"semenit",mm:"%d menit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}}),a.defineLocale("is",{months:"janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember".split("_"),monthsShort:"jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des".split("_"),weekdays:"sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur".split("_"),weekdaysShort:"sun_mán_þri_mið_fim_fös_lau".split("_"),weekdaysMin:"Su_Má_Þr_Mi_Fi_Fö_La".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd, D. MMMM YYYY [kl.] H:mm"},calendar:{sameDay:"[í dag kl.] LT",nextDay:"[á morgun kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[í gær kl.] LT",lastWeek:"[síðasta] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"eftir %s",past:"fyrir %s síðan",s:v,m:v,mm:v,h:"klukkustund",hh:v,d:v,dd:v,M:v,MM:v,y:v,yy:v},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),a.defineLocale("it",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"Domenica_Lunedì_Martedì_Mercoledì_Giovedì_Venerdì_Sabato".split("_"),weekdaysShort:"Dom_Lun_Mar_Mer_Gio_Ven_Sab".split("_"),weekdaysMin:"Do_Lu_Ma_Me_Gi_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Oggi alle] LT",nextDay:"[Domani alle] LT",nextWeek:"dddd [alle] LT",lastDay:"[Ieri alle] LT",lastWeek:function(){switch(this.day()){case 0:return"[la scorsa] dddd [alle] LT";default:return"[lo scorso] dddd [alle] LT"}},sameElse:"L"},relativeTime:{future:function(a){return(/^[0-9].+$/.test(a)?"tra":"in")+" "+a},past:"%s fa",s:"alcuni secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},ordinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}}),a.defineLocale("ja",{months:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"),weekdaysShort:"日_月_火_水_木_金_土".split("_"),weekdaysMin:"日_月_火_水_木_金_土".split("_"),longDateFormat:{LT:"Ah時m分",LTS:"Ah時m分s秒",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah時m分",LLLL:"YYYY年M月D日Ah時m分 dddd"},meridiemParse:/午前|午後/i,isPM:function(a){return"午後"===a},meridiem:function(a,b,c){return 12>a?"午前":"午後"},calendar:{sameDay:"[今日] LT",nextDay:"[明日] LT",nextWeek:"[来週]dddd LT",lastDay:"[昨日] LT",lastWeek:"[前週]dddd LT",sameElse:"L"},relativeTime:{future:"%s後",past:"%s前",s:"数秒",m:"1分",mm:"%d分",h:"1時間",hh:"%d時間",d:"1日",dd:"%d日",M:"1ヶ月",MM:"%dヶ月",y:"1年",yy:"%d年"}}),a.defineLocale("jv",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des".split("_"),weekdays:"Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu".split("_"),weekdaysShort:"Min_Sen_Sel_Reb_Kem_Jem_Sep".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sp".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/enjing|siyang|sonten|ndalu/,meridiemHour:function(a,b){return 12===a&&(a=0),"enjing"===b?a:"siyang"===b?a>=11?a:a+12:"sonten"===b||"ndalu"===b?a+12:void 0},meridiem:function(a,b,c){return 11>a?"enjing":15>a?"siyang":19>a?"sonten":"ndalu"},calendar:{sameDay:"[Dinten puniko pukul] LT",nextDay:"[Mbenjang pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kala wingi pukul] LT",lastWeek:"dddd [kepengker pukul] LT",sameElse:"L"},relativeTime:{future:"wonten ing %s",past:"%s ingkang kepengker",s:"sawetawis detik",m:"setunggal menit",mm:"%d menit",h:"setunggal jam",hh:"%d jam",d:"sedinten",dd:"%d dinten",M:"sewulan",MM:"%d wulan",y:"setaun",yy:"%d taun"},week:{dow:1,doy:7}}),a.defineLocale("ka",{months:{standalone:"იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი".split("_"),format:"იანვარს_თებერვალს_მარტს_აპრილის_მაისს_ივნისს_ივლისს_აგვისტს_სექტემბერს_ოქტომბერს_ნოემბერს_დეკემბერს".split("_")},monthsShort:"იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ".split("_"),weekdays:{standalone:"კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი".split("_"),format:"კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს".split("_"),isFormat:/(წინა|შემდეგ)/},weekdaysShort:"კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ".split("_"),weekdaysMin:"კვ_ორ_სა_ოთ_ხუ_პა_შა".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[დღეს] LT[-ზე]",nextDay:"[ხვალ] LT[-ზე]",lastDay:"[გუშინ] LT[-ზე]",nextWeek:"[შემდეგ] dddd LT[-ზე]",lastWeek:"[წინა] dddd LT-ზე",sameElse:"L"},relativeTime:{future:function(a){return/(წამი|წუთი|საათი|წელი)/.test(a)?a.replace(/ი$/,"ში"):a+"ში"},past:function(a){return/(წამი|წუთი|საათი|დღე|თვე)/.test(a)?a.replace(/(ი|ე)$/,"ის წინ"):/წელი/.test(a)?a.replace(/წელი$/,"წლის წინ"):void 0},s:"რამდენიმე წამი",m:"წუთი",mm:"%d წუთი",h:"საათი",hh:"%d საათი",d:"დღე",dd:"%d დღე",M:"თვე",MM:"%d თვე",y:"წელი",yy:"%d წელი"},ordinalParse:/0|1-ლი|მე-\d{1,2}|\d{1,2}-ე/,ordinal:function(a){return 0===a?a:1===a?a+"-ლი":20>a||100>=a&&a%20===0||a%100===0?"მე-"+a:a+"-ე"},week:{dow:1,doy:7}}),{0:"-ші",1:"-ші",2:"-ші",3:"-ші",4:"-ші",5:"-ші",6:"-шы",7:"-ші",8:"-ші",9:"-шы",10:"-шы",20:"-шы",30:"-шы",40:"-шы",50:"-ші",60:"-шы",70:"-ші",80:"-ші",90:"-шы",100:"-ші"}),Ha=(a.defineLocale("kk",{months:"Қаңтар_Ақпан_Наурыз_Сәуір_Мамыр_Маусым_Шілде_Тамыз_Қыркүйек_Қазан_Қараша_Желтоқсан".split("_"),monthsShort:"Қаң_Ақп_Нау_Сәу_Мам_Мау_Шіл_Там_Қыр_Қаз_Қар_Жел".split("_"),weekdays:"Жексенбі_Дүйсенбі_Сейсенбі_Сәрсенбі_Бейсенбі_Жұма_Сенбі".split("_"),weekdaysShort:"Жек_Дүй_Сей_Сәр_Бей_Жұм_Сен".split("_"),weekdaysMin:"Жк_Дй_Сй_Ср_Бй_Жм_Сн".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Бүгін сағат] LT",nextDay:"[Ертең сағат] LT",nextWeek:"dddd [сағат] LT",lastDay:"[Кеше сағат] LT",lastWeek:"[Өткен аптаның] dddd [сағат] LT",sameElse:"L"},relativeTime:{future:"%s ішінде",past:"%s бұрын",s:"бірнеше секунд",m:"бір минут",mm:"%d минут",h:"бір сағат",hh:"%d сағат",d:"бір күн",dd:"%d күн",M:"бір ай",MM:"%d ай",y:"бір жыл",yy:"%d жыл"},ordinalParse:/\d{1,2}-(ші|шы)/,ordinal:function(a){var b=a%10,c=a>=100?100:null;return a+(Ga[a]||Ga[b]||Ga[c])},week:{dow:1,doy:7}}),a.defineLocale("km",{months:"មករា_កុម្ភៈ_មិនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),monthsShort:"មករា_កុម្ភៈ_មិនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),weekdays:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),weekdaysShort:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),weekdaysMin:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[ថ្ងៃនេះ ម៉ោង] LT",nextDay:"[ស្អែក ម៉ោង] LT",nextWeek:"dddd [ម៉ោង] LT",lastDay:"[ម្សិលមិញ ម៉ោង] LT",lastWeek:"dddd [សប្តាហ៍មុន] [ម៉ោង] LT",sameElse:"L"},relativeTime:{future:"%sទៀត",past:"%sមុន",s:"ប៉ុន្មានវិនាទី",m:"មួយនាទី",mm:"%d នាទី",h:"មួយម៉ោង",hh:"%d ម៉ោង",d:"មួយថ្ងៃ",dd:"%d ថ្ងៃ",M:"មួយខែ",MM:"%d ខែ",y:"មួយឆ្នាំ",yy:"%d ឆ្នាំ"},week:{dow:1,doy:4}}),a.defineLocale("ko",{months:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),monthsShort:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),weekdays:"일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"),weekdaysShort:"일_월_화_수_목_금_토".split("_"),weekdaysMin:"일_월_화_수_목_금_토".split("_"),longDateFormat:{LT:"A h시 m분",LTS:"A h시 m분 s초",L:"YYYY.MM.DD",LL:"YYYY년 MMMM D일",LLL:"YYYY년 MMMM D일 A h시 m분",LLLL:"YYYY년 MMMM D일 dddd A h시 m분"},calendar:{sameDay:"오늘 LT",nextDay:"내일 LT",nextWeek:"dddd LT",lastDay:"어제 LT",lastWeek:"지난주 dddd LT",sameElse:"L"},relativeTime:{future:"%s 후",past:"%s 전",s:"몇초",ss:"%d초",m:"일분",mm:"%d분",h:"한시간",hh:"%d시간",d:"하루",dd:"%d일",M:"한달",MM:"%d달",y:"일년",yy:"%d년"},ordinalParse:/\d{1,2}일/,ordinal:"%d일",meridiemParse:/오전|오후/,isPM:function(a){return"오후"===a},meridiem:function(a,b,c){return 12>a?"오전":"오후"}}),a.defineLocale("lb",{months:"Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),weekdays:"Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg".split("_"),weekdaysShort:"So._Mé._Dë._Më._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mé_Dë_Më_Do_Fr_Sa".split("_"),longDateFormat:{LT:"H:mm [Auer]",LTS:"H:mm:ss [Auer]",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm [Auer]",LLLL:"dddd, D. MMMM YYYY H:mm [Auer]"},calendar:{sameDay:"[Haut um] LT",sameElse:"L",nextDay:"[Muer um] LT",nextWeek:"dddd [um] LT",lastDay:"[Gëschter um] LT",lastWeek:function(){switch(this.day()){case 2:case 4:return"[Leschten] dddd [um] LT";default:return"[Leschte] dddd [um] LT"}}},relativeTime:{future:x,past:y,s:"e puer Sekonnen",m:w,mm:"%d Minutten",h:w,hh:"%d Stonnen",d:w,dd:"%d Deeg",M:w,MM:"%d Méint",y:w,yy:"%d Joer"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),a.defineLocale("lo",{months:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),monthsShort:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),weekdays:"ອາທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),weekdaysShort:"ທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),weekdaysMin:"ທ_ຈ_ອຄ_ພ_ພຫ_ສກ_ສ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"ວັນdddd D MMMM YYYY HH:mm"},meridiemParse:/ຕອນເຊົ້າ|ຕອນແລງ/,isPM:function(a){return"ຕອນແລງ"===a},meridiem:function(a,b,c){return 12>a?"ຕອນເຊົ້າ":"ຕອນແລງ"},calendar:{sameDay:"[ມື້ນີ້ເວລາ] LT",nextDay:"[ມື້ອື່ນເວລາ] LT",nextWeek:"[ວັນ]dddd[ໜ້າເວລາ] LT",lastDay:"[ມື້ວານນີ້ເວລາ] LT",lastWeek:"[ວັນ]dddd[ແລ້ວນີ້ເວລາ] LT",sameElse:"L"},relativeTime:{future:"ອີກ %s",past:"%sຜ່ານມາ",s:"ບໍ່ເທົ່າໃດວິນາທີ",m:"1 ນາທີ",mm:"%d ນາທີ",h:"1 ຊົ່ວໂມງ",hh:"%d ຊົ່ວໂມງ",d:"1 ມື້",dd:"%d ມື້",M:"1 ເດືອນ",MM:"%d ເດືອນ",y:"1 ປີ",yy:"%d ປີ"},ordinalParse:/(ທີ່)\d{1,2}/,ordinal:function(a){return"ທີ່"+a}}),{m:"minutė_minutės_minutę",mm:"minutės_minučių_minutes",h:"valanda_valandos_valandą",hh:"valandos_valandų_valandas",d:"diena_dienos_dieną",dd:"dienos_dienų_dienas",M:"mėnuo_mėnesio_mėnesį",MM:"mėnesiai_mėnesių_mėnesius",y:"metai_metų_metus",yy:"metai_metų_metus"}),Ia=(a.defineLocale("lt",{months:{format:"sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio".split("_"),standalone:"sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis".split("_") -},monthsShort:"sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd".split("_"),weekdays:{format:"sekmadienį_pirmadienį_antradienį_trečiadienį_ketvirtadienį_penktadienį_šeštadienį".split("_"),standalone:"sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis".split("_"),isFormat:/dddd HH:mm/},weekdaysShort:"Sek_Pir_Ant_Tre_Ket_Pen_Šeš".split("_"),weekdaysMin:"S_P_A_T_K_Pn_Š".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY [m.] MMMM D [d.]",LLL:"YYYY [m.] MMMM D [d.], HH:mm [val.]",LLLL:"YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]",l:"YYYY-MM-DD",ll:"YYYY [m.] MMMM D [d.]",lll:"YYYY [m.] MMMM D [d.], HH:mm [val.]",llll:"YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]"},calendar:{sameDay:"[Šiandien] LT",nextDay:"[Rytoj] LT",nextWeek:"dddd LT",lastDay:"[Vakar] LT",lastWeek:"[Praėjusį] dddd LT",sameElse:"L"},relativeTime:{future:"po %s",past:"prieš %s",s:A,m:B,mm:E,h:B,hh:E,d:B,dd:E,M:B,MM:E,y:B,yy:E},ordinalParse:/\d{1,2}-oji/,ordinal:function(a){return a+"-oji"},week:{dow:1,doy:4}}),{m:"minūtes_minūtēm_minūte_minūtes".split("_"),mm:"minūtes_minūtēm_minūte_minūtes".split("_"),h:"stundas_stundām_stunda_stundas".split("_"),hh:"stundas_stundām_stunda_stundas".split("_"),d:"dienas_dienām_diena_dienas".split("_"),dd:"dienas_dienām_diena_dienas".split("_"),M:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),MM:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),y:"gada_gadiem_gads_gadi".split("_"),yy:"gada_gadiem_gads_gadi".split("_")}),Ja=(a.defineLocale("lv",{months:"janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris".split("_"),monthsShort:"jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec".split("_"),weekdays:"svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena".split("_"),weekdaysShort:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysMin:"Sv_P_O_T_C_Pk_S".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY.",LL:"YYYY. [gada] D. MMMM",LLL:"YYYY. [gada] D. MMMM, HH:mm",LLLL:"YYYY. [gada] D. MMMM, dddd, HH:mm"},calendar:{sameDay:"[Šodien pulksten] LT",nextDay:"[Rīt pulksten] LT",nextWeek:"dddd [pulksten] LT",lastDay:"[Vakar pulksten] LT",lastWeek:"[Pagājušā] dddd [pulksten] LT",sameElse:"L"},relativeTime:{future:"pēc %s",past:"pirms %s",s:I,m:H,mm:G,h:H,hh:G,d:H,dd:G,M:H,MM:G,y:H,yy:G},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),{words:{m:["jedan minut","jednog minuta"],mm:["minut","minuta","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mjesec","mjeseca","mjeseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(a,b){return 1===a?b[0]:a>=2&&4>=a?b[1]:b[2]},translate:function(a,b,c){var d=Ja.words[c];return 1===c.length?b?d[0]:d[1]:a+" "+Ja.correctGrammaticalCase(a,d)}}),Ka=(a.defineLocale("me",{months:["januar","februar","mart","april","maj","jun","jul","avgust","septembar","oktobar","novembar","decembar"],monthsShort:["jan.","feb.","mar.","apr.","maj","jun","jul","avg.","sep.","okt.","nov.","dec."],weekdays:["nedjelja","ponedjeljak","utorak","srijeda","četvrtak","petak","subota"],weekdaysShort:["ned.","pon.","uto.","sri.","čet.","pet.","sub."],weekdaysMin:["ne","po","ut","sr","če","pe","su"],longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sjutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){var a=["[prošle] [nedjelje] [u] LT","[prošlog] [ponedjeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srijede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"];return a[this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"nekoliko sekundi",m:Ja.translate,mm:Ja.translate,h:Ja.translate,hh:Ja.translate,d:"dan",dd:Ja.translate,M:"mjesec",MM:Ja.translate,y:"godinu",yy:Ja.translate},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),a.defineLocale("mk",{months:"јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември".split("_"),monthsShort:"јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек".split("_"),weekdays:"недела_понеделник_вторник_среда_четврток_петок_сабота".split("_"),weekdaysShort:"нед_пон_вто_сре_чет_пет_саб".split("_"),weekdaysMin:"нe_пo_вт_ср_че_пе_сa".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Денес во] LT",nextDay:"[Утре во] LT",nextWeek:"[Во] dddd [во] LT",lastDay:"[Вчера во] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[Изминатата] dddd [во] LT";case 1:case 2:case 4:case 5:return"[Изминатиот] dddd [во] LT"}},sameElse:"L"},relativeTime:{future:"после %s",past:"пред %s",s:"неколку секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дена",M:"месец",MM:"%d месеци",y:"година",yy:"%d години"},ordinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(a){var b=a%10,c=a%100;return 0===a?a+"-ев":0===c?a+"-ен":c>10&&20>c?a+"-ти":1===b?a+"-ви":2===b?a+"-ри":7===b||8===b?a+"-ми":a+"-ти"},week:{dow:1,doy:7}}),a.defineLocale("ml",{months:"ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ".split("_"),monthsShort:"ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.".split("_"),weekdays:"ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച".split("_"),weekdaysShort:"ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി".split("_"),weekdaysMin:"ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ".split("_"),longDateFormat:{LT:"A h:mm -നു",LTS:"A h:mm:ss -നു",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm -നു",LLLL:"dddd, D MMMM YYYY, A h:mm -നു"},calendar:{sameDay:"[ഇന്ന്] LT",nextDay:"[നാളെ] LT",nextWeek:"dddd, LT",lastDay:"[ഇന്നലെ] LT",lastWeek:"[കഴിഞ്ഞ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s കഴിഞ്ഞ്",past:"%s മുൻപ്",s:"അൽപ നിമിഷങ്ങൾ",m:"ഒരു മിനിറ്റ്",mm:"%d മിനിറ്റ്",h:"ഒരു മണിക്കൂർ",hh:"%d മണിക്കൂർ",d:"ഒരു ദിവസം",dd:"%d ദിവസം",M:"ഒരു മാസം",MM:"%d മാസം",y:"ഒരു വർഷം",yy:"%d വർഷം"},meridiemParse:/രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i,isPM:function(a){return/^(ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി)$/.test(a)},meridiem:function(a,b,c){return 4>a?"രാത്രി":12>a?"രാവിലെ":17>a?"ഉച്ച കഴിഞ്ഞ്":20>a?"വൈകുന്നേരം":"രാത്രി"}}),{1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"}),La={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"},Ma=(a.defineLocale("mr",{months:"जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),monthsShort:"जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),weekdays:"रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm वाजता",LTS:"A h:mm:ss वाजता",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm वाजता",LLLL:"dddd, D MMMM YYYY, A h:mm वाजता"},calendar:{sameDay:"[आज] LT",nextDay:"[उद्या] LT",nextWeek:"dddd, LT",lastDay:"[काल] LT",lastWeek:"[मागील] dddd, LT",sameElse:"L"},relativeTime:{future:"%sमध्ये",past:"%sपूर्वी",s:J,m:J,mm:J,h:J,hh:J,d:J,dd:J,M:J,MM:J,y:J,yy:J},preparse:function(a){return a.replace(/[१२३४५६७८९०]/g,function(a){return La[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return Ka[a]})},meridiemParse:/रात्री|सकाळी|दुपारी|सायंकाळी/,meridiemHour:function(a,b){return 12===a&&(a=0),"रात्री"===b?4>a?a:a+12:"सकाळी"===b?a:"दुपारी"===b?a>=10?a:a+12:"सायंकाळी"===b?a+12:void 0},meridiem:function(a,b,c){return 4>a?"रात्री":10>a?"सकाळी":17>a?"दुपारी":20>a?"सायंकाळी":"रात्री"},week:{dow:0,doy:6}}),a.defineLocale("ms-my",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(a,b){return 12===a&&(a=0),"pagi"===b?a:"tengahari"===b?a>=11?a:a+12:"petang"===b||"malam"===b?a+12:void 0},meridiem:function(a,b,c){return 11>a?"pagi":15>a?"tengahari":19>a?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}}),a.defineLocale("ms",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(a,b){return 12===a&&(a=0),"pagi"===b?a:"tengahari"===b?a>=11?a:a+12:"petang"===b||"malam"===b?a+12:void 0},meridiem:function(a,b,c){return 11>a?"pagi":15>a?"tengahari":19>a?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}}),{1:"၁",2:"၂",3:"၃",4:"၄",5:"၅",6:"၆",7:"၇",8:"၈",9:"၉",0:"၀"}),Na={"၁":"1","၂":"2","၃":"3","၄":"4","၅":"5","၆":"6","၇":"7","၈":"8","၉":"9","၀":"0"},Oa=(a.defineLocale("my",{months:"ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ".split("_"),monthsShort:"ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ".split("_"),weekdays:"တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ".split("_"),weekdaysShort:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),weekdaysMin:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ယနေ.] LT [မှာ]",nextDay:"[မနက်ဖြန်] LT [မှာ]",nextWeek:"dddd LT [မှာ]",lastDay:"[မနေ.က] LT [မှာ]",lastWeek:"[ပြီးခဲ့သော] dddd LT [မှာ]",sameElse:"L"},relativeTime:{future:"လာမည့် %s မှာ",past:"လွန်ခဲ့သော %s က",s:"စက္ကန်.အနည်းငယ်",m:"တစ်မိနစ်",mm:"%d မိနစ်",h:"တစ်နာရီ",hh:"%d နာရီ",d:"တစ်ရက်",dd:"%d ရက်",M:"တစ်လ",MM:"%d လ",y:"တစ်နှစ်",yy:"%d နှစ်"},preparse:function(a){return a.replace(/[၁၂၃၄၅၆၇၈၉၀]/g,function(a){return Na[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return Ma[a]})},week:{dow:1,doy:4}}),a.defineLocale("nb",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan._feb._mars_april_mai_juni_juli_aug._sep._okt._nov._des.".split("_"),weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"sø._ma._ti._on._to._fr._lø.".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] HH:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[i går kl.] LT",lastWeek:"[forrige] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"for %s siden",s:"noen sekunder",m:"ett minutt",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dager",M:"en måned",MM:"%d måneder",y:"ett år",yy:"%d år"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),{1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"}),Pa={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"},Qa=(a.defineLocale("ne",{months:"जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर".split("_"),monthsShort:"जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.".split("_"),weekdays:"आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार".split("_"),weekdaysShort:"आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.".split("_"),weekdaysMin:"आ._सो._मं._बु._बि._शु._श.".split("_"),longDateFormat:{LT:"Aको h:mm बजे",LTS:"Aको h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, Aको h:mm बजे",LLLL:"dddd, D MMMM YYYY, Aको h:mm बजे"},preparse:function(a){return a.replace(/[१२३४५६७८९०]/g,function(a){return Pa[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return Oa[a]})},meridiemParse:/राति|बिहान|दिउँसो|साँझ/,meridiemHour:function(a,b){return 12===a&&(a=0),"राति"===b?4>a?a:a+12:"बिहान"===b?a:"दिउँसो"===b?a>=10?a:a+12:"साँझ"===b?a+12:void 0},meridiem:function(a,b,c){return 3>a?"राति":12>a?"बिहान":16>a?"दिउँसो":20>a?"साँझ":"राति"},calendar:{sameDay:"[आज] LT",nextDay:"[भोलि] LT",nextWeek:"[आउँदो] dddd[,] LT",lastDay:"[हिजो] LT",lastWeek:"[गएको] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%sमा",past:"%s अगाडि",s:"केही क्षण",m:"एक मिनेट",mm:"%d मिनेट",h:"एक घण्टा",hh:"%d घण्टा",d:"एक दिन",dd:"%d दिन",M:"एक महिना",MM:"%d महिना",y:"एक बर्ष",yy:"%d बर्ष"},week:{dow:0,doy:6}}),"jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_")),Ra="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),Sa=(a.defineLocale("nl",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(a,b){return/-MMM-/.test(b)?Ra[a.month()]:Qa[a.month()]},weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"Zo_Ma_Di_Wo_Do_Vr_Za".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},ordinalParse:/\d{1,2}(ste|de)/,ordinal:function(a){return a+(1===a||8===a||a>=20?"ste":"de")},week:{dow:1,doy:4}}),a.defineLocale("nn",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag".split("_"),weekdaysShort:"sun_mån_tys_ons_tor_fre_lau".split("_"),weekdaysMin:"su_må_ty_on_to_fr_lø".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[I dag klokka] LT",nextDay:"[I morgon klokka] LT",nextWeek:"dddd [klokka] LT",lastDay:"[I går klokka] LT",lastWeek:"[Føregåande] dddd [klokka] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"for %s sidan",s:"nokre sekund",m:"eit minutt",mm:"%d minutt",h:"ein time",hh:"%d timar",d:"ein dag",dd:"%d dagar",M:"ein månad",MM:"%d månader",y:"eit år",yy:"%d år"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),"styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_")),Ta="stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia".split("_"),Ua=(a.defineLocale("pl",{months:function(a,b){return""===b?"("+Ta[a.month()]+"|"+Sa[a.month()]+")":/D MMMM/.test(b)?Ta[a.month()]:Sa[a.month()]},monthsShort:"sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"),weekdays:"niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"),weekdaysShort:"nie_pon_wt_śr_czw_pt_sb".split("_"),weekdaysMin:"Nd_Pn_Wt_Śr_Cz_Pt_So".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Dziś o] LT",nextDay:"[Jutro o] LT",nextWeek:"[W] dddd [o] LT",lastDay:"[Wczoraj o] LT",lastWeek:function(){switch(this.day()){case 0:return"[W zeszłą niedzielę o] LT";case 3:return"[W zeszłą środę o] LT";case 6:return"[W zeszłą sobotę o] LT";default:return"[W zeszły] dddd [o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"%s temu",s:"kilka sekund",m:L,mm:L,h:L,hh:L,d:"1 dzień",dd:"%d dni",M:"miesiąc",MM:L,y:"rok",yy:L},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),a.defineLocale("pt-br",{months:"Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingo_Segunda-Feira_Terça-Feira_Quarta-Feira_Quinta-Feira_Sexta-Feira_Sábado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),weekdaysMin:"Dom_2ª_3ª_4ª_5ª_6ª_Sáb".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [às] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [às] HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"%s atrás",s:"poucos segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},ordinalParse:/\d{1,2}º/,ordinal:"%dº"}),a.defineLocale("pt",{months:"Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingo_Segunda-Feira_Terça-Feira_Quarta-Feira_Quinta-Feira_Sexta-Feira_Sábado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),weekdaysMin:"Dom_2ª_3ª_4ª_5ª_6ª_Sáb".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"há %s",s:"segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},ordinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}}),a.defineLocale("ro",{months:"ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie".split("_"),monthsShort:"ian._febr._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.".split("_"),weekdays:"duminică_luni_marți_miercuri_joi_vineri_sâmbătă".split("_"),weekdaysShort:"Dum_Lun_Mar_Mie_Joi_Vin_Sâm".split("_"),weekdaysMin:"Du_Lu_Ma_Mi_Jo_Vi_Sâ".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[azi la] LT",nextDay:"[mâine la] LT",nextWeek:"dddd [la] LT",lastDay:"[ieri la] LT",lastWeek:"[fosta] dddd [la] LT",sameElse:"L"},relativeTime:{future:"peste %s",past:"%s în urmă",s:"câteva secunde",m:"un minut",mm:M,h:"o oră",hh:M,d:"o zi",dd:M,M:"o lună",MM:M,y:"un an",yy:M},week:{dow:1,doy:7}}),[/^янв/i,/^фев/i,/^мар/i,/^апр/i,/^ма[й|я]/i,/^июн/i,/^июл/i,/^авг/i,/^сен/i,/^окт/i,/^ноя/i,/^дек/i]),Va=(a.defineLocale("ru",{months:{format:"Января_Февраля_Марта_Апреля_Мая_Июня_Июля_Августа_Сентября_Октября_Ноября_Декабря".split("_"),standalone:"Январь_Февраль_Март_Апрель_Май_Июнь_Июль_Август_Сентябрь_Октябрь_Ноябрь_Декабрь".split("_")},monthsShort:{format:"янв_фев_мар_апр_мая_июня_июля_авг_сен_окт_ноя_дек".split("_"),standalone:"янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек".split("_")},weekdays:{standalone:"Воскресенье_Понедельник_Вторник_Среда_Четверг_Пятница_Суббота".split("_"),format:"Воскресенье_Понедельник_Вторник_Среду_Четверг_Пятницу_Субботу".split("_"),isFormat:/\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?\] ?dddd/},weekdaysShort:"Вс_Пн_Вт_Ср_Чт_Пт_Сб".split("_"),weekdaysMin:"Вс_Пн_Вт_Ср_Чт_Пт_Сб".split("_"),monthsParse:Ua,longMonthsParse:Ua,shortMonthsParse:Ua,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., HH:mm",LLLL:"dddd, D MMMM YYYY г., HH:mm"},calendar:{sameDay:"[Сегодня в] LT",nextDay:"[Завтра в] LT",lastDay:"[Вчера в] LT",nextWeek:function(a){if(a.week()===this.week())return 2===this.day()?"[Во] dddd [в] LT":"[В] dddd [в] LT";switch(this.day()){case 0:return"[В следующее] dddd [в] LT";case 1:case 2:case 4:return"[В следующий] dddd [в] LT";case 3:case 5:case 6:return"[В следующую] dddd [в] LT"}},lastWeek:function(a){if(a.week()===this.week())return 2===this.day()?"[Во] dddd [в] LT":"[В] dddd [в] LT";switch(this.day()){case 0:return"[В прошлое] dddd [в] LT";case 1:case 2:case 4:return"[В прошлый] dddd [в] LT";case 3:case 5:case 6:return"[В прошлую] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",m:O,mm:O,h:"час",hh:O,d:"день",dd:O,M:"месяц",MM:O,y:"год",yy:O},meridiemParse:/ночи|утра|дня|вечера/i,isPM:function(a){return/^(дня|вечера)$/.test(a)},meridiem:function(a,b,c){return 4>a?"ночи":12>a?"утра":17>a?"дня":"вечера"},ordinalParse:/\d{1,2}-(й|го|я)/,ordinal:function(a,b){switch(b){case"M":case"d":case"DDD":return a+"-й";case"D":return a+"-го";case"w":case"W":return a+"-я";default:return a}},week:{dow:1,doy:7}}),a.defineLocale("se",{months:"ođđajagemánnu_guovvamánnu_njukčamánnu_cuoŋománnu_miessemánnu_geassemánnu_suoidnemánnu_borgemánnu_čakčamánnu_golggotmánnu_skábmamánnu_juovlamánnu".split("_"),monthsShort:"ođđj_guov_njuk_cuo_mies_geas_suoi_borg_čakč_golg_skáb_juov".split("_"),weekdays:"sotnabeaivi_vuossárga_maŋŋebárga_gaskavahkku_duorastat_bearjadat_lávvardat".split("_"),weekdaysShort:"sotn_vuos_maŋ_gask_duor_bear_láv".split("_"),weekdaysMin:"s_v_m_g_d_b_L".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"MMMM D. [b.] YYYY",LLL:"MMMM D. [b.] YYYY [ti.] HH:mm",LLLL:"dddd, MMMM D. [b.] YYYY [ti.] HH:mm"},calendar:{sameDay:"[otne ti] LT",nextDay:"[ihttin ti] LT",nextWeek:"dddd [ti] LT",lastDay:"[ikte ti] LT",lastWeek:"[ovddit] dddd [ti] LT",sameElse:"L"},relativeTime:{future:"%s geažes",past:"maŋit %s",s:"moadde sekunddat",m:"okta minuhta",mm:"%d minuhtat",h:"okta diimmu",hh:"%d diimmut",d:"okta beaivi",dd:"%d beaivvit",M:"okta mánnu",MM:"%d mánut",y:"okta jahki",yy:"%d jagit"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),a.defineLocale("si",{months:"ජනවාරි_පෙබරවාරි_මාර්තු_අප්‍රේල්_මැයි_ජූනි_ජූලි_අගෝස්තු_සැප්තැම්බර්_ඔක්තෝබර්_නොවැම්බර්_දෙසැම්බර්".split("_"),monthsShort:"ජන_පෙබ_මාර්_අප්_මැයි_ජූනි_ජූලි_අගෝ_සැප්_ඔක්_නොවැ_දෙසැ".split("_"),weekdays:"ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්‍රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා".split("_"),weekdaysShort:"ඉරි_සඳු_අඟ_බදා_බ්‍රහ_සිකු_සෙන".split("_"),weekdaysMin:"ඉ_ස_අ_බ_බ්‍ර_සි_සෙ".split("_"),longDateFormat:{LT:"a h:mm",LTS:"a h:mm:ss",L:"YYYY/MM/DD",LL:"YYYY MMMM D",LLL:"YYYY MMMM D, a h:mm",LLLL:"YYYY MMMM D [වැනි] dddd, a h:mm:ss"},calendar:{sameDay:"[අද] LT[ට]",nextDay:"[හෙට] LT[ට]",nextWeek:"dddd LT[ට]",lastDay:"[ඊයේ] LT[ට]",lastWeek:"[පසුගිය] dddd LT[ට]",sameElse:"L"},relativeTime:{future:"%sකින්",past:"%sකට පෙර",s:"තත්පර කිහිපය",m:"මිනිත්තුව",mm:"මිනිත්තු %d",h:"පැය",hh:"පැය %d",d:"දිනය",dd:"දින %d",M:"මාසය",MM:"මාස %d",y:"වසර",yy:"වසර %d"},ordinalParse:/\d{1,2} වැනි/,ordinal:function(a){return a+" වැනි"},meridiem:function(a,b,c){return a>11?c?"ප.ව.":"පස් වරු":c?"පෙ.ව.":"පෙර වරු"}}),"január_február_marec_apríl_máj_jún_júl_august_september_október_november_december".split("_")),Wa="jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec".split("_"),Xa=(a.defineLocale("sk",{months:Va,monthsShort:Wa,weekdays:"nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota".split("_"),weekdaysShort:"ne_po_ut_st_št_pi_so".split("_"),weekdaysMin:"ne_po_ut_st_št_pi_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm"},calendar:{sameDay:"[dnes o] LT",nextDay:"[zajtra o] LT",nextWeek:function(){switch(this.day()){case 0:return"[v nedeľu o] LT";case 1:case 2:return"[v] dddd [o] LT";case 3:return"[v stredu o] LT";case 4:return"[vo štvrtok o] LT";case 5:return"[v piatok o] LT";case 6:return"[v sobotu o] LT"}},lastDay:"[včera o] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulú nedeľu o] LT";case 1:case 2:return"[minulý] dddd [o] LT";case 3:return"[minulú stredu o] LT";case 4:case 5:return"[minulý] dddd [o] LT";case 6:return"[minulú sobotu o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"pred %s",s:Q,m:Q,mm:Q,h:Q,hh:Q,d:Q,dd:Q,M:Q,MM:Q,y:Q,yy:Q},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),a.defineLocale("sl",{months:"januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.".split("_"),weekdays:"nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota".split("_"),weekdaysShort:"ned._pon._tor._sre._čet._pet._sob.".split("_"),weekdaysMin:"ne_po_to_sr_če_pe_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danes ob] LT",nextDay:"[jutri ob] LT",nextWeek:function(){switch(this.day()){case 0:return"[v] [nedeljo] [ob] LT";case 3:return"[v] [sredo] [ob] LT";case 6:return"[v] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[v] dddd [ob] LT"}},lastDay:"[včeraj ob] LT",lastWeek:function(){switch(this.day()){case 0:return"[prejšnjo] [nedeljo] [ob] LT";case 3:return"[prejšnjo] [sredo] [ob] LT";case 6:return"[prejšnjo] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[prejšnji] dddd [ob] LT"}},sameElse:"L"},relativeTime:{future:"čez %s",past:"pred %s",s:R,m:R,mm:R,h:R,hh:R,d:R,dd:R,M:R,MM:R,y:R,yy:R},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),a.defineLocale("sq",{months:"Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor".split("_"),monthsShort:"Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj".split("_"),weekdays:"E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë".split("_"),weekdaysShort:"Die_Hën_Mar_Mër_Enj_Pre_Sht".split("_"),weekdaysMin:"D_H_Ma_Më_E_P_Sh".split("_"),meridiemParse:/PD|MD/,isPM:function(a){return"M"===a.charAt(0)},meridiem:function(a,b,c){return 12>a?"PD":"MD"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Sot në] LT",nextDay:"[Nesër në] LT",nextWeek:"dddd [në] LT",lastDay:"[Dje në] LT",lastWeek:"dddd [e kaluar në] LT",sameElse:"L"},relativeTime:{future:"në %s",past:"%s më parë",s:"disa sekonda",m:"një minutë",mm:"%d minuta",h:"një orë",hh:"%d orë",d:"një ditë",dd:"%d ditë",M:"një muaj",MM:"%d muaj",y:"një vit",yy:"%d vite"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),{words:{m:["један минут","једне минуте"],mm:["минут","минуте","минута"],h:["један сат","једног сата"],hh:["сат","сата","сати"],dd:["дан","дана","дана"],MM:["месец","месеца","месеци"],yy:["година","године","година"]},correctGrammaticalCase:function(a,b){return 1===a?b[0]:a>=2&&4>=a?b[1]:b[2]},translate:function(a,b,c){var d=Xa.words[c];return 1===c.length?b?d[0]:d[1]:a+" "+Xa.correctGrammaticalCase(a,d)}}),Ya=(a.defineLocale("sr-cyrl",{months:["јануар","фебруар","март","април","мај","јун","јул","август","септембар","октобар","новембар","децембар"],monthsShort:["јан.","феб.","мар.","апр.","мај","јун","јул","авг.","сеп.","окт.","нов.","дец."],weekdays:["недеља","понедељак","уторак","среда","четвртак","петак","субота"],weekdaysShort:["нед.","пон.","уто.","сре.","чет.","пет.","суб."],weekdaysMin:["не","по","ут","ср","че","пе","су"],longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[данас у] LT",nextDay:"[сутра у] LT",nextWeek:function(){switch(this.day()){case 0:return"[у] [недељу] [у] LT";case 3:return"[у] [среду] [у] LT";case 6:return"[у] [суботу] [у] LT";case 1:case 2:case 4:case 5:return"[у] dddd [у] LT"}},lastDay:"[јуче у] LT",lastWeek:function(){var a=["[прошле] [недеље] [у] LT","[прошлог] [понедељка] [у] LT","[прошлог] [уторка] [у] LT","[прошле] [среде] [у] LT","[прошлог] [четвртка] [у] LT","[прошлог] [петка] [у] LT","[прошле] [суботе] [у] LT"];return a[this.day()]},sameElse:"L"},relativeTime:{future:"за %s",past:"пре %s",s:"неколико секунди",m:Xa.translate,mm:Xa.translate,h:Xa.translate,hh:Xa.translate,d:"дан",dd:Xa.translate,M:"месец",MM:Xa.translate,y:"годину",yy:Xa.translate},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),{words:{m:["jedan minut","jedne minute"],mm:["minut","minute","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mesec","meseca","meseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(a,b){return 1===a?b[0]:a>=2&&4>=a?b[1]:b[2]},translate:function(a,b,c){var d=Ya.words[c];return 1===c.length?b?d[0]:d[1]:a+" "+Ya.correctGrammaticalCase(a,d)}}),Za=(a.defineLocale("sr",{months:["januar","februar","mart","april","maj","jun","jul","avgust","septembar","oktobar","novembar","decembar"],monthsShort:["jan.","feb.","mar.","apr.","maj","jun","jul","avg.","sep.","okt.","nov.","dec."],weekdays:["nedelja","ponedeljak","utorak","sreda","četvrtak","petak","subota"],weekdaysShort:["ned.","pon.","uto.","sre.","čet.","pet.","sub."],weekdaysMin:["ne","po","ut","sr","če","pe","su"],longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedelju] [u] LT";case 3:return"[u] [sredu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){var a=["[prošle] [nedelje] [u] LT","[prošlog] [ponedeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"];return a[this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"pre %s",s:"nekoliko sekundi",m:Ya.translate,mm:Ya.translate,h:Ya.translate,hh:Ya.translate,d:"dan",dd:Ya.translate,M:"mesec",MM:Ya.translate,y:"godinu",yy:Ya.translate},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),a.defineLocale("sv",{months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"),weekdaysShort:"sön_mån_tis_ons_tor_fre_lör".split("_"),weekdaysMin:"sö_må_ti_on_to_fr_lö".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Idag] LT",nextDay:"[Imorgon] LT",lastDay:"[Igår] LT",nextWeek:"[På] dddd LT", -lastWeek:"[I] dddd[s] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"för %s sedan",s:"några sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en månad",MM:"%d månader",y:"ett år",yy:"%d år"},ordinalParse:/\d{1,2}(e|a)/,ordinal:function(a){var b=a%10,c=1===~~(a%100/10)?"e":1===b?"a":2===b?"a":"e";return a+c},week:{dow:1,doy:4}}),a.defineLocale("sw",{months:"Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des".split("_"),weekdays:"Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi".split("_"),weekdaysShort:"Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos".split("_"),weekdaysMin:"J2_J3_J4_J5_Al_Ij_J1".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[leo saa] LT",nextDay:"[kesho saa] LT",nextWeek:"[wiki ijayo] dddd [saat] LT",lastDay:"[jana] LT",lastWeek:"[wiki iliyopita] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s baadaye",past:"tokea %s",s:"hivi punde",m:"dakika moja",mm:"dakika %d",h:"saa limoja",hh:"masaa %d",d:"siku moja",dd:"masiku %d",M:"mwezi mmoja",MM:"miezi %d",y:"mwaka mmoja",yy:"miaka %d"},week:{dow:1,doy:7}}),{1:"௧",2:"௨",3:"௩",4:"௪",5:"௫",6:"௬",7:"௭",8:"௮",9:"௯",0:"௦"}),$a={"௧":"1","௨":"2","௩":"3","௪":"4","௫":"5","௬":"6","௭":"7","௮":"8","௯":"9","௦":"0"},_a=(a.defineLocale("ta",{months:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),monthsShort:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),weekdays:"ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை".split("_"),weekdaysShort:"ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி".split("_"),weekdaysMin:"ஞா_தி_செ_பு_வி_வெ_ச".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, HH:mm",LLLL:"dddd, D MMMM YYYY, HH:mm"},calendar:{sameDay:"[இன்று] LT",nextDay:"[நாளை] LT",nextWeek:"dddd, LT",lastDay:"[நேற்று] LT",lastWeek:"[கடந்த வாரம்] dddd, LT",sameElse:"L"},relativeTime:{future:"%s இல்",past:"%s முன்",s:"ஒரு சில விநாடிகள்",m:"ஒரு நிமிடம்",mm:"%d நிமிடங்கள்",h:"ஒரு மணி நேரம்",hh:"%d மணி நேரம்",d:"ஒரு நாள்",dd:"%d நாட்கள்",M:"ஒரு மாதம்",MM:"%d மாதங்கள்",y:"ஒரு வருடம்",yy:"%d ஆண்டுகள்"},ordinalParse:/\d{1,2}வது/,ordinal:function(a){return a+"வது"},preparse:function(a){return a.replace(/[௧௨௩௪௫௬௭௮௯௦]/g,function(a){return $a[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return Za[a]})},meridiemParse:/யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/,meridiem:function(a,b,c){return 2>a?" யாமம்":6>a?" வைகறை":10>a?" காலை":14>a?" நண்பகல்":18>a?" எற்பாடு":22>a?" மாலை":" யாமம்"},meridiemHour:function(a,b){return 12===a&&(a=0),"யாமம்"===b?2>a?a:a+12:"வைகறை"===b||"காலை"===b?a:"நண்பகல்"===b&&a>=10?a:a+12},week:{dow:0,doy:6}}),a.defineLocale("te",{months:"జనవరి_ఫిబ్రవరి_మార్చి_ఏప్రిల్_మే_జూన్_జూలై_ఆగస్టు_సెప్టెంబర్_అక్టోబర్_నవంబర్_డిసెంబర్".split("_"),monthsShort:"జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జూలై_ఆగ._సెప్._అక్టో._నవ._డిసె.".split("_"),weekdays:"ఆదివారం_సోమవారం_మంగళవారం_బుధవారం_గురువారం_శుక్రవారం_శనివారం".split("_"),weekdaysShort:"ఆది_సోమ_మంగళ_బుధ_గురు_శుక్ర_శని".split("_"),weekdaysMin:"ఆ_సో_మం_బు_గు_శు_శ".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[నేడు] LT",nextDay:"[రేపు] LT",nextWeek:"dddd, LT",lastDay:"[నిన్న] LT",lastWeek:"[గత] dddd, LT",sameElse:"L"},relativeTime:{future:"%s లో",past:"%s క్రితం",s:"కొన్ని క్షణాలు",m:"ఒక నిమిషం",mm:"%d నిమిషాలు",h:"ఒక గంట",hh:"%d గంటలు",d:"ఒక రోజు",dd:"%d రోజులు",M:"ఒక నెల",MM:"%d నెలలు",y:"ఒక సంవత్సరం",yy:"%d సంవత్సరాలు"},ordinalParse:/\d{1,2}వ/,ordinal:"%dవ",meridiemParse:/రాత్రి|ఉదయం|మధ్యాహ్నం|సాయంత్రం/,meridiemHour:function(a,b){return 12===a&&(a=0),"రాత్రి"===b?4>a?a:a+12:"ఉదయం"===b?a:"మధ్యాహ్నం"===b?a>=10?a:a+12:"సాయంత్రం"===b?a+12:void 0},meridiem:function(a,b,c){return 4>a?"రాత్రి":10>a?"ఉదయం":17>a?"మధ్యాహ్నం":20>a?"సాయంత్రం":"రాత్రి"},week:{dow:0,doy:6}}),a.defineLocale("th",{months:"มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม".split("_"),monthsShort:"มกรา_กุมภา_มีนา_เมษา_พฤษภา_มิถุนา_กรกฎา_สิงหา_กันยา_ตุลา_พฤศจิกา_ธันวา".split("_"),weekdays:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์".split("_"),weekdaysShort:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์".split("_"),weekdaysMin:"อา._จ._อ._พ._พฤ._ศ._ส.".split("_"),longDateFormat:{LT:"H นาฬิกา m นาที",LTS:"H นาฬิกา m นาที s วินาที",L:"YYYY/MM/DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY เวลา H นาฬิกา m นาที",LLLL:"วันddddที่ D MMMM YYYY เวลา H นาฬิกา m นาที"},meridiemParse:/ก่อนเที่ยง|หลังเที่ยง/,isPM:function(a){return"หลังเที่ยง"===a},meridiem:function(a,b,c){return 12>a?"ก่อนเที่ยง":"หลังเที่ยง"},calendar:{sameDay:"[วันนี้ เวลา] LT",nextDay:"[พรุ่งนี้ เวลา] LT",nextWeek:"dddd[หน้า เวลา] LT",lastDay:"[เมื่อวานนี้ เวลา] LT",lastWeek:"[วัน]dddd[ที่แล้ว เวลา] LT",sameElse:"L"},relativeTime:{future:"อีก %s",past:"%sที่แล้ว",s:"ไม่กี่วินาที",m:"1 นาที",mm:"%d นาที",h:"1 ชั่วโมง",hh:"%d ชั่วโมง",d:"1 วัน",dd:"%d วัน",M:"1 เดือน",MM:"%d เดือน",y:"1 ปี",yy:"%d ปี"}}),a.defineLocale("tl-ph",{months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},calendar:{sameDay:"[Ngayon sa] LT",nextDay:"[Bukas sa] LT",nextWeek:"dddd [sa] LT",lastDay:"[Kahapon sa] LT",lastWeek:"dddd [huling linggo] LT",sameElse:"L"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"},ordinalParse:/\d{1,2}/,ordinal:function(a){return a},week:{dow:1,doy:4}}),"pagh_wa’_cha’_wej_loS_vagh_jav_Soch_chorgh_Hut".split("_")),ab=(a.defineLocale("tlh",{months:"tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’".split("_"),monthsShort:"jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’".split("_"),weekdays:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysShort:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysMin:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[DaHjaj] LT",nextDay:"[wa’leS] LT",nextWeek:"LLL",lastDay:"[wa’Hu’] LT",lastWeek:"LLL",sameElse:"L"},relativeTime:{future:S,past:T,s:"puS lup",m:"wa’ tup",mm:U,h:"wa’ rep",hh:U,d:"wa’ jaj",dd:U,M:"wa’ jar",MM:U,y:"wa’ DIS",yy:U},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),{1:"'inci",5:"'inci",8:"'inci",70:"'inci",80:"'inci",2:"'nci",7:"'nci",20:"'nci",50:"'nci",3:"'üncü",4:"'üncü",100:"'üncü",6:"'ncı",9:"'uncu",10:"'uncu",30:"'uncu",60:"'ıncı",90:"'ıncı"});a.defineLocale("tr",{months:"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),monthsShort:"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),weekdays:"Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"),weekdaysMin:"Pz_Pt_Sa_Ça_Pe_Cu_Ct".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[yarın saat] LT",nextWeek:"[haftaya] dddd [saat] LT",lastDay:"[dün] LT",lastWeek:"[geçen hafta] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s önce",s:"birkaç saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ordinalParse:/\d{1,2}'(inci|nci|üncü|ncı|uncu|ıncı)/,ordinal:function(a){if(0===a)return a+"'ıncı";var b=a%10,c=a%100-b,d=a>=100?100:null;return a+(ab[b]||ab[c]||ab[d])},week:{dow:1,doy:7}}),a.defineLocale("tzl",{months:"Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar".split("_"),monthsShort:"Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec".split("_"),weekdays:"Súladi_Lúneçi_Maitzi_Márcuri_Xhúadi_Viénerçi_Sáturi".split("_"),weekdaysShort:"Súl_Lún_Mai_Már_Xhú_Vié_Sát".split("_"),weekdaysMin:"Sú_Lú_Ma_Má_Xh_Vi_Sá".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"D. MMMM [dallas] YYYY",LLL:"D. MMMM [dallas] YYYY HH.mm",LLLL:"dddd, [li] D. MMMM [dallas] YYYY HH.mm"},meridiem:function(a,b,c){return a>11?c?"d'o":"D'O":c?"d'a":"D'A"},calendar:{sameDay:"[oxhi à] LT",nextDay:"[demà à] LT",nextWeek:"dddd [à] LT",lastDay:"[ieiri à] LT",lastWeek:"[sür el] dddd [lasteu à] LT",sameElse:"L"},relativeTime:{future:"osprei %s",past:"ja%s",s:W,m:W,mm:W,h:W,hh:W,d:W,dd:W,M:W,MM:W,y:W,yy:W},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),a.defineLocale("tzm-latn",{months:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),monthsShort:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),weekdays:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysShort:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysMin:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[asdkh g] LT",nextDay:"[aska g] LT",nextWeek:"dddd [g] LT",lastDay:"[assant g] LT",lastWeek:"dddd [g] LT",sameElse:"L"},relativeTime:{future:"dadkh s yan %s",past:"yan %s",s:"imik",m:"minuḍ",mm:"%d minuḍ",h:"saɛa",hh:"%d tassaɛin",d:"ass",dd:"%d ossan",M:"ayowr",MM:"%d iyyirn",y:"asgas",yy:"%d isgasn"},week:{dow:6,doy:12}}),a.defineLocale("tzm",{months:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),monthsShort:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),weekdays:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysShort:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysMin:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ⴰⵙⴷⵅ ⴴ] LT",nextDay:"[ⴰⵙⴽⴰ ⴴ] LT",nextWeek:"dddd [ⴴ] LT",lastDay:"[ⴰⵚⴰⵏⵜ ⴴ] LT",lastWeek:"dddd [ⴴ] LT",sameElse:"L"},relativeTime:{future:"ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s",past:"ⵢⴰⵏ %s",s:"ⵉⵎⵉⴽ",m:"ⵎⵉⵏⵓⴺ",mm:"%d ⵎⵉⵏⵓⴺ",h:"ⵙⴰⵄⴰ",hh:"%d ⵜⴰⵙⵙⴰⵄⵉⵏ",d:"ⴰⵙⵙ",dd:"%d oⵙⵙⴰⵏ",M:"ⴰⵢoⵓⵔ",MM:"%d ⵉⵢⵢⵉⵔⵏ",y:"ⴰⵙⴳⴰⵙ",yy:"%d ⵉⵙⴳⴰⵙⵏ"},week:{dow:6,doy:12}}),a.defineLocale("uk",{months:{format:"січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня".split("_"),standalone:"січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень".split("_")},monthsShort:"січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд".split("_"),weekdays:Z,weekdaysShort:"нд_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY р.",LLL:"D MMMM YYYY р., HH:mm",LLLL:"dddd, D MMMM YYYY р., HH:mm"},calendar:{sameDay:$("[Сьогодні "),nextDay:$("[Завтра "),lastDay:$("[Вчора "),nextWeek:$("[У] dddd ["),lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return $("[Минулої] dddd [").call(this);case 1:case 2:case 4:return $("[Минулого] dddd [").call(this)}},sameElse:"L"},relativeTime:{future:"за %s",past:"%s тому",s:"декілька секунд",m:Y,mm:Y,h:"годину",hh:Y,d:"день",dd:Y,M:"місяць",MM:Y,y:"рік",yy:Y},meridiemParse:/ночі|ранку|дня|вечора/,isPM:function(a){return/^(дня|вечора)$/.test(a)},meridiem:function(a,b,c){return 4>a?"ночі":12>a?"ранку":17>a?"дня":"вечора"},ordinalParse:/\d{1,2}-(й|го)/,ordinal:function(a,b){switch(b){case"M":case"d":case"DDD":case"w":case"W":return a+"-й";case"D":return a+"-го";default:return a}},week:{dow:1,doy:7}}),a.defineLocale("uz",{months:"январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр".split("_"),monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба".split("_"),weekdaysShort:"Якш_Душ_Сеш_Чор_Пай_Жум_Шан".split("_"),weekdaysMin:"Як_Ду_Се_Чо_Па_Жу_Ша".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},calendar:{sameDay:"[Бугун соат] LT [да]",nextDay:"[Эртага] LT [да]",nextWeek:"dddd [куни соат] LT [да]",lastDay:"[Кеча соат] LT [да]",lastWeek:"[Утган] dddd [куни соат] LT [да]",sameElse:"L"},relativeTime:{future:"Якин %s ичида",past:"Бир неча %s олдин",s:"фурсат",m:"бир дакика",mm:"%d дакика",h:"бир соат",hh:"%d соат",d:"бир кун",dd:"%d кун",M:"бир ой",MM:"%d ой",y:"бир йил",yy:"%d йил"},week:{dow:1,doy:7}}),a.defineLocale("vi",{months:"tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12".split("_"),monthsShort:"Th01_Th02_Th03_Th04_Th05_Th06_Th07_Th08_Th09_Th10_Th11_Th12".split("_"),weekdays:"chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy".split("_"),weekdaysShort:"CN_T2_T3_T4_T5_T6_T7".split("_"),weekdaysMin:"CN_T2_T3_T4_T5_T6_T7".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [năm] YYYY",LLL:"D MMMM [năm] YYYY HH:mm",LLLL:"dddd, D MMMM [năm] YYYY HH:mm",l:"DD/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[Hôm nay lúc] LT",nextDay:"[Ngày mai lúc] LT",nextWeek:"dddd [tuần tới lúc] LT",lastDay:"[Hôm qua lúc] LT",lastWeek:"dddd [tuần rồi lúc] LT",sameElse:"L"},relativeTime:{future:"%s tới",past:"%s trước",s:"vài giây",m:"một phút",mm:"%d phút",h:"một giờ",hh:"%d giờ",d:"một ngày",dd:"%d ngày",M:"một tháng",MM:"%d tháng",y:"một năm",yy:"%d năm"},ordinalParse:/\d{1,2}/,ordinal:function(a){return a},week:{dow:1,doy:4}}),a.defineLocale("zh-cn",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"Ah点mm分",LTS:"Ah点m分s秒",L:"YYYY-MM-DD",LL:"YYYY年MMMD日",LLL:"YYYY年MMMD日Ah点mm分",LLLL:"YYYY年MMMD日ddddAh点mm分",l:"YYYY-MM-DD",ll:"YYYY年MMMD日",lll:"YYYY年MMMD日Ah点mm分",llll:"YYYY年MMMD日ddddAh点mm分"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(a,b){return 12===a&&(a=0),"凌晨"===b||"早上"===b||"上午"===b?a:"下午"===b||"晚上"===b?a+12:a>=11?a:a+12},meridiem:function(a,b,c){var d=100*a+b;return 600>d?"凌晨":900>d?"早上":1130>d?"上午":1230>d?"中午":1800>d?"下午":"晚上"},calendar:{sameDay:function(){return 0===this.minutes()?"[今天]Ah[点整]":"[今天]LT"},nextDay:function(){return 0===this.minutes()?"[明天]Ah[点整]":"[明天]LT"},lastDay:function(){return 0===this.minutes()?"[昨天]Ah[点整]":"[昨天]LT"},nextWeek:function(){var b,c;return b=a().startOf("week"),c=this.unix()-b.unix()>=604800?"[下]":"[本]",0===this.minutes()?c+"dddAh点整":c+"dddAh点mm"},lastWeek:function(){var b,c;return b=a().startOf("week"),c=this.unix()=11?a:a+12:"下午"===b||"晚上"===b?a+12:void 0},meridiem:function(a,b,c){var d=100*a+b;return 900>d?"早上":1130>d?"上午":1230>d?"中午":1800>d?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:"[下]ddddLT",lastDay:"[昨天]LT",lastWeek:"[上]ddddLT",sameElse:"L"},ordinalParse:/\d{1,2}(日|月|週)/,ordinal:function(a,b){switch(b){case"d":case"D":case"DDD":return a+"日";case"M":return a+"月";case"w":case"W":return a+"週";default:return a}},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",m:"一分鐘",mm:"%d分鐘",h:"一小時",hh:"%d小時",d:"一天",dd:"%d天",M:"一個月",MM:"%d個月",y:"一年",yy:"%d年"}});a.locale("en")}); \ No newline at end of file +var _=(a.defineLocale("af",{months:"Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des".split("_"),weekdays:"Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag".split("_"),weekdaysShort:"Son_Maa_Din_Woe_Don_Vry_Sat".split("_"),weekdaysMin:"So_Ma_Di_Wo_Do_Vr_Sa".split("_"),meridiemParse:/vm|nm/i,isPM:function(a){return/^nm$/i.test(a)},meridiem:function(a,b,c){return 12>a?c?"vm":"VM":c?"nm":"NM"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Vandag om] LT",nextDay:"[Môre om] LT",nextWeek:"dddd [om] LT",lastDay:"[Gister om] LT",lastWeek:"[Laas] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oor %s",past:"%s gelede",s:"'n paar sekondes",m:"'n minuut",mm:"%d minute",h:"'n uur",hh:"%d ure",d:"'n dag",dd:"%d dae",M:"'n maand",MM:"%d maande",y:"'n jaar",yy:"%d jaar"},ordinalParse:/\d{1,2}(ste|de)/,ordinal:function(a){return a+(1===a||8===a||a>=20?"ste":"de")},week:{dow:1,doy:4}}),a.defineLocale("ar-ma",{months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdays:"الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:6,doy:12}}),{1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"}),aa={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},ba=(a.defineLocale("ar-sa",{months:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(a){return"م"===a},meridiem:function(a,b,c){return 12>a?"ص":"م"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},preparse:function(a){return a.replace(/[١٢٣٤٥٦٧٨٩٠]/g,function(a){return aa[a]}).replace(/،/g,",")},postformat:function(a){return a.replace(/\d/g,function(a){return _[a]}).replace(/,/g,"،")},week:{dow:6,doy:12}}),a.defineLocale("ar-tn",{months:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:1,doy:4}}),{1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"}),ca={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},da=function(a){return 0===a?0:1===a?1:2===a?2:a%100>=3&&10>=a%100?3:a%100>=11?4:5},ea={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},fa=function(a){return function(b,c,d,e){var f=da(b),g=ea[a][da(b)];return 2===f&&(g=g[c?0:1]),g.replace(/%d/i,b)}},ga=["كانون الثاني يناير","شباط فبراير","آذار مارس","نيسان أبريل","أيار مايو","حزيران يونيو","تموز يوليو","آب أغسطس","أيلول سبتمبر","تشرين الأول أكتوبر","تشرين الثاني نوفمبر","كانون الأول ديسمبر"],ha=(a.defineLocale("ar",{months:ga,monthsShort:ga,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(a){return"م"===a},meridiem:function(a,b,c){return 12>a?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:fa("s"),m:fa("m"),mm:fa("m"),h:fa("h"),hh:fa("h"),d:fa("d"),dd:fa("d"),M:fa("M"),MM:fa("M"),y:fa("y"),yy:fa("y")},preparse:function(a){return a.replace(/\u200f/g,"").replace(/[١٢٣٤٥٦٧٨٩٠]/g,function(a){return ca[a]}).replace(/،/g,",")},postformat:function(a){return a.replace(/\d/g,function(a){return ba[a]}).replace(/,/g,"،")},week:{dow:6,doy:12}}),{1:"-inci",5:"-inci",8:"-inci",70:"-inci",80:"-inci",2:"-nci",7:"-nci",20:"-nci",50:"-nci",3:"-üncü",4:"-üncü",100:"-üncü",6:"-ncı",9:"-uncu",10:"-uncu",30:"-uncu",60:"-ıncı",90:"-ıncı"}),ia=(a.defineLocale("az",{months:"yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr".split("_"),monthsShort:"yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek".split("_"),weekdays:"Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə".split("_"),weekdaysShort:"Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən".split("_"),weekdaysMin:"Bz_BE_ÇA_Çə_CA_Cü_Şə".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[sabah saat] LT",nextWeek:"[gələn həftə] dddd [saat] LT",lastDay:"[dünən] LT",lastWeek:"[keçən həftə] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s əvvəl",s:"birneçə saniyyə",m:"bir dəqiqə",mm:"%d dəqiqə",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir il",yy:"%d il"},meridiemParse:/gecə|səhər|gündüz|axşam/,isPM:function(a){return/^(gündüz|axşam)$/.test(a)},meridiem:function(a,b,c){return 4>a?"gecə":12>a?"səhər":17>a?"gündüz":"axşam"},ordinalParse:/\d{1,2}-(ıncı|inci|nci|üncü|ncı|uncu)/,ordinal:function(a){if(0===a)return a+"-ıncı";var b=a%10,c=a%100-b,d=a>=100?100:null;return a+(ha[b]||ha[c]||ha[d])},week:{dow:1,doy:7}}),a.defineLocale("be",{months:{format:"студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня".split("_"),standalone:"студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань".split("_")},monthsShort:"студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж".split("_"),weekdays:{format:"нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу".split("_"),standalone:"нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота".split("_"),isFormat:/\[ ?[Вв] ?(?:мінулую|наступную)? ?\] ?dddd/},weekdaysShort:"нд_пн_ат_ср_чц_пт_сб".split("_"),weekdaysMin:"нд_пн_ат_ср_чц_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., HH:mm",LLLL:"dddd, D MMMM YYYY г., HH:mm"},calendar:{sameDay:"[Сёння ў] LT",nextDay:"[Заўтра ў] LT",lastDay:"[Учора ў] LT",nextWeek:function(){return"[У] dddd [ў] LT"},lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return"[У мінулую] dddd [ў] LT";case 1:case 2:case 4:return"[У мінулы] dddd [ў] LT"}},sameElse:"L"},relativeTime:{future:"праз %s",past:"%s таму",s:"некалькі секунд",m:c,mm:c,h:c,hh:c,d:"дзень",dd:c,M:"месяц",MM:c,y:"год",yy:c},meridiemParse:/ночы|раніцы|дня|вечара/,isPM:function(a){return/^(дня|вечара)$/.test(a)},meridiem:function(a,b,c){return 4>a?"ночы":12>a?"раніцы":17>a?"дня":"вечара"},ordinalParse:/\d{1,2}-(і|ы|га)/,ordinal:function(a,b){switch(b){case"M":case"d":case"DDD":case"w":case"W":return a%10!==2&&a%10!==3||a%100===12||a%100===13?a+"-ы":a+"-і";case"D":return a+"-га";default:return a}},week:{dow:1,doy:7}}),a.defineLocale("bg",{months:"януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември".split("_"),monthsShort:"янр_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек".split("_"),weekdays:"неделя_понеделник_вторник_сряда_четвъртък_петък_събота".split("_"),weekdaysShort:"нед_пон_вто_сря_чет_пет_съб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Днес в] LT",nextDay:"[Утре в] LT",nextWeek:"dddd [в] LT",lastDay:"[Вчера в] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[В изминалата] dddd [в] LT";case 1:case 2:case 4:case 5:return"[В изминалия] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"след %s",past:"преди %s",s:"няколко секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дни",M:"месец",MM:"%d месеца",y:"година",yy:"%d години"},ordinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(a){var b=a%10,c=a%100;return 0===a?a+"-ев":0===c?a+"-ен":c>10&&20>c?a+"-ти":1===b?a+"-ви":2===b?a+"-ри":7===b||8===b?a+"-ми":a+"-ти"},week:{dow:1,doy:7}}),{1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"}),ja={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"},ka=(a.defineLocale("bn",{months:"জানুয়ারী_ফেবুয়ারী_মার্চ_এপ্রিল_মে_জুন_জুলাই_অগাস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),monthsShort:"জানু_ফেব_মার্চ_এপর_মে_জুন_জুল_অগ_সেপ্ট_অক্টো_নভ_ডিসেম্".split("_"),weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পত্তিবার_শুক্রবার_শনিবার".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পত্তি_শুক্র_শনি".split("_"),weekdaysMin:"রব_সম_মঙ্গ_বু_ব্রিহ_শু_শনি".split("_"),longDateFormat:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm সময়",LLLL:"dddd, D MMMM YYYY, A h:mm সময়"},calendar:{sameDay:"[আজ] LT",nextDay:"[আগামীকাল] LT",nextWeek:"dddd, LT",lastDay:"[গতকাল] LT",lastWeek:"[গত] dddd, LT",sameElse:"L"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"},preparse:function(a){return a.replace(/[১২৩৪৫৬৭৮৯০]/g,function(a){return ja[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return ia[a]})},meridiemParse:/রাত|সকাল|দুপুর|বিকাল|রাত/,meridiemHour:function(a,b){return 12===a&&(a=0),"রাত"===b&&a>=4||"দুপুর"===b&&5>a||"বিকাল"===b?a+12:a},meridiem:function(a,b,c){return 4>a?"রাত":10>a?"সকাল":17>a?"দুপুর":20>a?"বিকাল":"রাত"},week:{dow:0,doy:6}}),{1:"༡",2:"༢",3:"༣",4:"༤",5:"༥",6:"༦",7:"༧",8:"༨",9:"༩",0:"༠"}),la={"༡":"1","༢":"2","༣":"3","༤":"4","༥":"5","༦":"6","༧":"7","༨":"8","༩":"9","༠":"0"},ma=(a.defineLocale("bo",{months:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),monthsShort:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),weekdays:"གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་".split("_"),weekdaysShort:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),weekdaysMin:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[དི་རིང] LT",nextDay:"[སང་ཉིན] LT",nextWeek:"[བདུན་ཕྲག་རྗེས་མ], LT",lastDay:"[ཁ་སང] LT",lastWeek:"[བདུན་ཕྲག་མཐའ་མ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ལ་",past:"%s སྔན་ལ",s:"ལམ་སང",m:"སྐར་མ་གཅིག",mm:"%d སྐར་མ",h:"ཆུ་ཚོད་གཅིག",hh:"%d ཆུ་ཚོད",d:"ཉིན་གཅིག",dd:"%d ཉིན་",M:"ཟླ་བ་གཅིག",MM:"%d ཟླ་བ",y:"ལོ་གཅིག",yy:"%d ལོ"},preparse:function(a){return a.replace(/[༡༢༣༤༥༦༧༨༩༠]/g,function(a){return la[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return ka[a]})},meridiemParse:/མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/,meridiemHour:function(a,b){return 12===a&&(a=0),"མཚན་མོ"===b&&a>=4||"ཉིན་གུང"===b&&5>a||"དགོང་དག"===b?a+12:a},meridiem:function(a,b,c){return 4>a?"མཚན་མོ":10>a?"ཞོགས་ཀས":17>a?"ཉིན་གུང":20>a?"དགོང་དག":"མཚན་མོ"},week:{dow:0,doy:6}}),a.defineLocale("br",{months:"Genver_C'hwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu".split("_"),monthsShort:"Gen_C'hwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker".split("_"),weekdays:"Sul_Lun_Meurzh_Merc'her_Yaou_Gwener_Sadorn".split("_"),weekdaysShort:"Sul_Lun_Meu_Mer_Yao_Gwe_Sad".split("_"),weekdaysMin:"Su_Lu_Me_Mer_Ya_Gw_Sa".split("_"),longDateFormat:{LT:"h[e]mm A",LTS:"h[e]mm:ss A",L:"DD/MM/YYYY",LL:"D [a viz] MMMM YYYY",LLL:"D [a viz] MMMM YYYY h[e]mm A",LLLL:"dddd, D [a viz] MMMM YYYY h[e]mm A"},calendar:{sameDay:"[Hiziv da] LT",nextDay:"[Warc'hoazh da] LT",nextWeek:"dddd [da] LT",lastDay:"[Dec'h da] LT",lastWeek:"dddd [paset da] LT",sameElse:"L"},relativeTime:{future:"a-benn %s",past:"%s 'zo",s:"un nebeud segondennoù",m:"ur vunutenn",mm:d,h:"un eur",hh:"%d eur",d:"un devezh",dd:d,M:"ur miz",MM:d,y:"ur bloaz",yy:e},ordinalParse:/\d{1,2}(añ|vet)/,ordinal:function(a){var b=1===a?"añ":"vet";return a+b},week:{dow:1,doy:4}}),a.defineLocale("bs",{months:"januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.".split("_"),weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:case 3:return"[prošlu] dddd [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",m:i,mm:i,h:i,hh:i,d:"dan",dd:i,M:"mjesec",MM:i,y:"godinu",yy:i},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),a.defineLocale("ca",{months:"gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre".split("_"),monthsShort:"gen._febr._mar._abr._mai._jun._jul._ag._set._oct._nov._des.".split("_"),weekdays:"diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dt._dc._dj._dv._ds.".split("_"),weekdaysMin:"Dg_Dl_Dt_Dc_Dj_Dv_Ds".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd D MMMM YYYY H:mm"},calendar:{sameDay:function(){return"[avui a "+(1!==this.hours()?"les":"la")+"] LT"},nextDay:function(){return"[demà a "+(1!==this.hours()?"les":"la")+"] LT"},nextWeek:function(){return"dddd [a "+(1!==this.hours()?"les":"la")+"] LT"},lastDay:function(){return"[ahir a "+(1!==this.hours()?"les":"la")+"] LT"},lastWeek:function(){return"[el] dddd [passat a "+(1!==this.hours()?"les":"la")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"fa %s",s:"uns segons",m:"un minut",mm:"%d minuts",h:"una hora",hh:"%d hores",d:"un dia",dd:"%d dies",M:"un mes",MM:"%d mesos",y:"un any",yy:"%d anys"},ordinalParse:/\d{1,2}(r|n|t|è|a)/,ordinal:function(a,b){var c=1===a?"r":2===a?"n":3===a?"r":4===a?"t":"è";return("w"===b||"W"===b)&&(c="a"),a+c},week:{dow:1,doy:4}}),"leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec".split("_")),na="led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro".split("_"),oa=(a.defineLocale("cs",{months:ma,monthsShort:na,monthsParse:function(a,b){var c,d=[];for(c=0;12>c;c++)d[c]=new RegExp("^"+a[c]+"$|^"+b[c]+"$","i");return d}(ma,na),shortMonthsParse:function(a){var b,c=[];for(b=0;12>b;b++)c[b]=new RegExp("^"+a[b]+"$","i");return c}(na),longMonthsParse:function(a){var b,c=[];for(b=0;12>b;b++)c[b]=new RegExp("^"+a[b]+"$","i");return c}(ma),weekdays:"neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota".split("_"),weekdaysShort:"ne_po_út_st_čt_pá_so".split("_"),weekdaysMin:"ne_po_út_st_čt_pá_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm"},calendar:{sameDay:"[dnes v] LT",nextDay:"[zítra v] LT",nextWeek:function(){switch(this.day()){case 0:return"[v neděli v] LT";case 1:case 2:return"[v] dddd [v] LT";case 3:return"[ve středu v] LT";case 4:return"[ve čtvrtek v] LT";case 5:return"[v pátek v] LT";case 6:return"[v sobotu v] LT"}},lastDay:"[včera v] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulou neděli v] LT";case 1:case 2:return"[minulé] dddd [v] LT";case 3:return"[minulou středu v] LT";case 4:case 5:return"[minulý] dddd [v] LT";case 6:return"[minulou sobotu v] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"před %s",s:k,m:k,mm:k,h:k,hh:k,d:k,dd:k,M:k,MM:k,y:k,yy:k},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),a.defineLocale("cv",{months:"кӑрлач_нарӑс_пуш_ака_май_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав".split("_"),monthsShort:"кӑр_нар_пуш_ака_май_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш".split("_"),weekdays:"вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун".split("_"),weekdaysShort:"выр_тун_ытл_юн_кӗҫ_эрн_шӑм".split("_"),weekdaysMin:"вр_тн_ыт_юн_кҫ_эр_шм".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]",LLL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm",LLLL:"dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm"},calendar:{sameDay:"[Паян] LT [сехетре]",nextDay:"[Ыран] LT [сехетре]",lastDay:"[Ӗнер] LT [сехетре]",nextWeek:"[Ҫитес] dddd LT [сехетре]",lastWeek:"[Иртнӗ] dddd LT [сехетре]",sameElse:"L"},relativeTime:{future:function(a){var b=/сехет$/i.exec(a)?"рен":/ҫул$/i.exec(a)?"тан":"ран";return a+b},past:"%s каялла",s:"пӗр-ик ҫеккунт",m:"пӗр минут",mm:"%d минут",h:"пӗр сехет",hh:"%d сехет",d:"пӗр кун",dd:"%d кун",M:"пӗр уйӑх",MM:"%d уйӑх",y:"пӗр ҫул",yy:"%d ҫул"},ordinalParse:/\d{1,2}-мӗш/,ordinal:"%d-мӗш",week:{dow:1,doy:7}}),a.defineLocale("cy",{months:"Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr".split("_"),monthsShort:"Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag".split("_"),weekdays:"Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn".split("_"),weekdaysShort:"Sul_Llun_Maw_Mer_Iau_Gwe_Sad".split("_"),weekdaysMin:"Su_Ll_Ma_Me_Ia_Gw_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Heddiw am] LT",nextDay:"[Yfory am] LT",nextWeek:"dddd [am] LT",lastDay:"[Ddoe am] LT",lastWeek:"dddd [diwethaf am] LT",sameElse:"L"},relativeTime:{future:"mewn %s",past:"%s yn ôl",s:"ychydig eiliadau",m:"munud",mm:"%d munud",h:"awr",hh:"%d awr",d:"diwrnod",dd:"%d diwrnod",M:"mis",MM:"%d mis",y:"blwyddyn",yy:"%d flynedd"},ordinalParse:/\d{1,2}(fed|ain|af|il|ydd|ed|eg)/,ordinal:function(a){var b=a,c="",d=["","af","il","ydd","ydd","ed","ed","ed","fed","fed","fed","eg","fed","eg","eg","fed","eg","eg","fed","eg","fed"];return b>20?c=40===b||50===b||60===b||80===b||100===b?"fed":"ain":b>0&&(c=d[b]),a+c},week:{dow:1,doy:4}}),a.defineLocale("da",{months:"januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"søn_man_tir_ons_tor_fre_lør".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd [d.] D. MMMM YYYY HH:mm"},calendar:{sameDay:"[I dag kl.] LT",nextDay:"[I morgen kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[I går kl.] LT",lastWeek:"[sidste] dddd [kl] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"få sekunder",m:"et minut",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dage",M:"en måned",MM:"%d måneder",y:"et år",yy:"%d år"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),a.defineLocale("de-at",{months:"Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jän._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",m:l,mm:"%d Minuten",h:l,hh:"%d Stunden",d:l,dd:l,M:l,MM:l,y:l,yy:l},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),a.defineLocale("de",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",m:m,mm:"%d Minuten",h:m,hh:"%d Stunden",d:m,dd:m,M:m,MM:m,y:m,yy:m},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),["ޖެނުއަރީ","ފެބްރުއަރީ","މާރިޗު","އޭޕްރީލު","މޭ","ޖޫން","ޖުލައި","އޯގަސްޓު","ސެޕްޓެމްބަރު","އޮކްޓޯބަރު","ނޮވެމްބަރު","ޑިސެމްބަރު"]),pa=["އާދިއްތަ","ހޯމަ","އަންގާރަ","ބުދަ","ބުރާސްފަތި","ހުކުރު","ހޮނިހިރު"],qa=(a.defineLocale("dv",{months:oa,monthsShort:oa,weekdays:pa,weekdaysShort:pa,weekdaysMin:"އާދި_ހޯމަ_އަން_ބުދަ_ބުރާ_ހުކު_ހޮނި".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/M/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/މކ|މފ/,isPM:function(a){return"މފ"===a},meridiem:function(a,b,c){return 12>a?"މކ":"މފ"},calendar:{sameDay:"[މިއަދު] LT",nextDay:"[މާދަމާ] LT",nextWeek:"dddd LT",lastDay:"[އިއްޔެ] LT",lastWeek:"[ފާއިތުވި] dddd LT",sameElse:"L"},relativeTime:{future:"ތެރޭގައި %s",past:"ކުރިން %s",s:"ސިކުންތުކޮޅެއް",m:"މިނިޓެއް",mm:"މިނިޓު %d",h:"ގަޑިއިރެއް",hh:"ގަޑިއިރު %d",d:"ދުވަހެއް",dd:"ދުވަސް %d",M:"މަހެއް",MM:"މަސް %d",y:"އަހަރެއް",yy:"އަހަރު %d"},preparse:function(a){return a.replace(/،/g,",")},postformat:function(a){return a.replace(/,/g,"،")},week:{dow:7,doy:12}}),a.defineLocale("el",{monthsNominativeEl:"Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος".split("_"),monthsGenitiveEl:"Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου".split("_"),months:function(a,b){return/D/.test(b.substring(0,b.indexOf("MMMM")))?this._monthsGenitiveEl[a.month()]:this._monthsNominativeEl[a.month()]},monthsShort:"Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ".split("_"),weekdays:"Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο".split("_"),weekdaysShort:"Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ".split("_"),weekdaysMin:"Κυ_Δε_Τρ_Τε_Πε_Πα_Σα".split("_"),meridiem:function(a,b,c){return a>11?c?"μμ":"ΜΜ":c?"πμ":"ΠΜ"},isPM:function(a){return"μ"===(a+"").toLowerCase()[0]},meridiemParse:/[ΠΜ]\.?Μ?\.?/i,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendarEl:{sameDay:"[Σήμερα {}] LT",nextDay:"[Αύριο {}] LT",nextWeek:"dddd [{}] LT",lastDay:"[Χθες {}] LT",lastWeek:function(){switch(this.day()){case 6:return"[το προηγούμενο] dddd [{}] LT";default:return"[την προηγούμενη] dddd [{}] LT"}},sameElse:"L"},calendar:function(a,b){var c=this._calendarEl[a],d=b&&b.hours();return n(c)&&(c=c.apply(b)),c.replace("{}",d%12===1?"στη":"στις")},relativeTime:{future:"σε %s",past:"%s πριν",s:"λίγα δευτερόλεπτα",m:"ένα λεπτό",mm:"%d λεπτά",h:"μία ώρα",hh:"%d ώρες",d:"μία μέρα",dd:"%d μέρες",M:"ένας μήνας",MM:"%d μήνες",y:"ένας χρόνος",yy:"%d χρόνια"},ordinalParse:/\d{1,2}η/,ordinal:"%dη",week:{dow:1,doy:4}}),a.defineLocale("en-au",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{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"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(a){var b=a%10,c=1===~~(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c},week:{dow:1,doy:4}}),a.defineLocale("en-ca",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"YYYY-MM-DD",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{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"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(a){var b=a%10,c=1===~~(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c}}),a.defineLocale("en-gb",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{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"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(a){var b=a%10,c=1===~~(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c},week:{dow:1,doy:4}}),a.defineLocale("en-ie",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{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"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(a){var b=a%10,c=1===~~(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c},week:{dow:1,doy:4}}),a.defineLocale("en-nz",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{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"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(a){var b=a%10,c=1===~~(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c},week:{dow:1,doy:4}}),a.defineLocale("eo",{months:"januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aŭg_sep_okt_nov_dec".split("_"),weekdays:"Dimanĉo_Lundo_Mardo_Merkredo_Ĵaŭdo_Vendredo_Sabato".split("_"),weekdaysShort:"Dim_Lun_Mard_Merk_Ĵaŭ_Ven_Sab".split("_"),weekdaysMin:"Di_Lu_Ma_Me_Ĵa_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D[-an de] MMMM, YYYY",LLL:"D[-an de] MMMM, YYYY HH:mm",LLLL:"dddd, [la] D[-an de] MMMM, YYYY HH:mm"},meridiemParse:/[ap]\.t\.m/i,isPM:function(a){ +return"p"===a.charAt(0).toLowerCase()},meridiem:function(a,b,c){return a>11?c?"p.t.m.":"P.T.M.":c?"a.t.m.":"A.T.M."},calendar:{sameDay:"[Hodiaŭ je] LT",nextDay:"[Morgaŭ je] LT",nextWeek:"dddd [je] LT",lastDay:"[Hieraŭ je] LT",lastWeek:"[pasinta] dddd [je] LT",sameElse:"L"},relativeTime:{future:"je %s",past:"antaŭ %s",s:"sekundoj",m:"minuto",mm:"%d minutoj",h:"horo",hh:"%d horoj",d:"tago",dd:"%d tagoj",M:"monato",MM:"%d monatoj",y:"jaro",yy:"%d jaroj"},ordinalParse:/\d{1,2}a/,ordinal:"%da",week:{dow:1,doy:7}}),"ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_")),ra="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),sa=(a.defineLocale("es",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(a,b){return/-MMM-/.test(b)?ra[a.month()]:qa[a.month()]},weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}}),a.defineLocale("et",{months:"jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember".split("_"),monthsShort:"jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets".split("_"),weekdays:"pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev".split("_"),weekdaysShort:"P_E_T_K_N_R_L".split("_"),weekdaysMin:"P_E_T_K_N_R_L".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[Täna,] LT",nextDay:"[Homme,] LT",nextWeek:"[Järgmine] dddd LT",lastDay:"[Eile,] LT",lastWeek:"[Eelmine] dddd LT",sameElse:"L"},relativeTime:{future:"%s pärast",past:"%s tagasi",s:o,m:o,mm:o,h:o,hh:o,d:o,dd:"%d päeva",M:o,MM:o,y:o,yy:o},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),a.defineLocale("eu",{months:"urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua".split("_"),monthsShort:"urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.".split("_"),weekdays:"igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata".split("_"),weekdaysShort:"ig._al._ar._az._og._ol._lr.".split("_"),weekdaysMin:"ig_al_ar_az_og_ol_lr".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY[ko] MMMM[ren] D[a]",LLL:"YYYY[ko] MMMM[ren] D[a] HH:mm",LLLL:"dddd, YYYY[ko] MMMM[ren] D[a] HH:mm",l:"YYYY-M-D",ll:"YYYY[ko] MMM D[a]",lll:"YYYY[ko] MMM D[a] HH:mm",llll:"ddd, YYYY[ko] MMM D[a] HH:mm"},calendar:{sameDay:"[gaur] LT[etan]",nextDay:"[bihar] LT[etan]",nextWeek:"dddd LT[etan]",lastDay:"[atzo] LT[etan]",lastWeek:"[aurreko] dddd LT[etan]",sameElse:"L"},relativeTime:{future:"%s barru",past:"duela %s",s:"segundo batzuk",m:"minutu bat",mm:"%d minutu",h:"ordu bat",hh:"%d ordu",d:"egun bat",dd:"%d egun",M:"hilabete bat",MM:"%d hilabete",y:"urte bat",yy:"%d urte"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),{1:"۱",2:"۲",3:"۳",4:"۴",5:"۵",6:"۶",7:"۷",8:"۸",9:"۹",0:"۰"}),ta={"۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","۰":"0"},ua=(a.defineLocale("fa",{months:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),monthsShort:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),weekdays:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysShort:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysMin:"ی_د_س_چ_پ_ج_ش".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/قبل از ظهر|بعد از ظهر/,isPM:function(a){return/بعد از ظهر/.test(a)},meridiem:function(a,b,c){return 12>a?"قبل از ظهر":"بعد از ظهر"},calendar:{sameDay:"[امروز ساعت] LT",nextDay:"[فردا ساعت] LT",nextWeek:"dddd [ساعت] LT",lastDay:"[دیروز ساعت] LT",lastWeek:"dddd [پیش] [ساعت] LT",sameElse:"L"},relativeTime:{future:"در %s",past:"%s پیش",s:"چندین ثانیه",m:"یک دقیقه",mm:"%d دقیقه",h:"یک ساعت",hh:"%d ساعت",d:"یک روز",dd:"%d روز",M:"یک ماه",MM:"%d ماه",y:"یک سال",yy:"%d سال"},preparse:function(a){return a.replace(/[۰-۹]/g,function(a){return ta[a]}).replace(/،/g,",")},postformat:function(a){return a.replace(/\d/g,function(a){return sa[a]}).replace(/,/g,"،")},ordinalParse:/\d{1,2}م/,ordinal:"%dم",week:{dow:6,doy:12}}),"nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän".split(" ")),va=["nolla","yhden","kahden","kolmen","neljän","viiden","kuuden",ua[7],ua[8],ua[9]],wa=(a.defineLocale("fi",{months:"tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu".split("_"),monthsShort:"tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu".split("_"),weekdays:"sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai".split("_"),weekdaysShort:"su_ma_ti_ke_to_pe_la".split("_"),weekdaysMin:"su_ma_ti_ke_to_pe_la".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"Do MMMM[ta] YYYY",LLL:"Do MMMM[ta] YYYY, [klo] HH.mm",LLLL:"dddd, Do MMMM[ta] YYYY, [klo] HH.mm",l:"D.M.YYYY",ll:"Do MMM YYYY",lll:"Do MMM YYYY, [klo] HH.mm",llll:"ddd, Do MMM YYYY, [klo] HH.mm"},calendar:{sameDay:"[tänään] [klo] LT",nextDay:"[huomenna] [klo] LT",nextWeek:"dddd [klo] LT",lastDay:"[eilen] [klo] LT",lastWeek:"[viime] dddd[na] [klo] LT",sameElse:"L"},relativeTime:{future:"%s päästä",past:"%s sitten",s:p,m:p,mm:p,h:p,hh:p,d:p,dd:p,M:p,MM:p,y:p,yy:p},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),a.defineLocale("fo",{months:"januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur".split("_"),weekdaysShort:"sun_mán_týs_mik_hós_frí_ley".split("_"),weekdaysMin:"su_má_tý_mi_hó_fr_le".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D. MMMM, YYYY HH:mm"},calendar:{sameDay:"[Í dag kl.] LT",nextDay:"[Í morgin kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[Í gjár kl.] LT",lastWeek:"[síðstu] dddd [kl] LT",sameElse:"L"},relativeTime:{future:"um %s",past:"%s síðani",s:"fá sekund",m:"ein minutt",mm:"%d minuttir",h:"ein tími",hh:"%d tímar",d:"ein dagur",dd:"%d dagar",M:"ein mánaði",MM:"%d mánaðir",y:"eitt ár",yy:"%d ár"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),a.defineLocale("fr-ca",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"Di_Lu_Ma_Me_Je_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd'hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},ordinalParse:/\d{1,2}(er|e)/,ordinal:function(a){return a+(1===a?"er":"e")}}),a.defineLocale("fr-ch",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"Di_Lu_Ma_Me_Je_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd'hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},ordinalParse:/\d{1,2}(er|e)/,ordinal:function(a){return a+(1===a?"er":"e")},week:{dow:1,doy:4}}),a.defineLocale("fr",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"Di_Lu_Ma_Me_Je_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd'hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},ordinalParse:/\d{1,2}(er|)/,ordinal:function(a){return a+(1===a?"er":"")},week:{dow:1,doy:4}}),"jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.".split("_")),xa="jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),ya=(a.defineLocale("fy",{months:"jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber".split("_"),monthsShort:function(a,b){return/-MMM-/.test(b)?xa[a.month()]:wa[a.month()]},weekdays:"snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon".split("_"),weekdaysShort:"si._mo._ti._wo._to._fr._so.".split("_"),weekdaysMin:"Si_Mo_Ti_Wo_To_Fr_So".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[hjoed om] LT",nextDay:"[moarn om] LT",nextWeek:"dddd [om] LT",lastDay:"[juster om] LT",lastWeek:"[ôfrûne] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oer %s",past:"%s lyn",s:"in pear sekonden",m:"ien minút",mm:"%d minuten",h:"ien oere",hh:"%d oeren",d:"ien dei",dd:"%d dagen",M:"ien moanne",MM:"%d moannen",y:"ien jier",yy:"%d jierren"},ordinalParse:/\d{1,2}(ste|de)/,ordinal:function(a){return a+(1===a||8===a||a>=20?"ste":"de")},week:{dow:1,doy:4}}),["Am Faoilleach","An Gearran","Am Màrt","An Giblean","An Cèitean","An t-Ògmhios","An t-Iuchar","An Lùnastal","An t-Sultain","An Dàmhair","An t-Samhain","An Dùbhlachd"]),za=["Faoi","Gear","Màrt","Gibl","Cèit","Ògmh","Iuch","Lùn","Sult","Dàmh","Samh","Dùbh"],Aa=["Didòmhnaich","Diluain","Dimàirt","Diciadain","Diardaoin","Dihaoine","Disathairne"],Ba=["Did","Dil","Dim","Dic","Dia","Dih","Dis"],Ca=["Dò","Lu","Mà","Ci","Ar","Ha","Sa"],Da=(a.defineLocale("gd",{months:ya,monthsShort:za,monthsParseExact:!0,weekdays:Aa,weekdaysShort:Ba,weekdaysMin:Ca,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[An-diugh aig] LT",nextDay:"[A-màireach aig] LT",nextWeek:"dddd [aig] LT",lastDay:"[An-dè aig] LT",lastWeek:"dddd [seo chaidh] [aig] LT",sameElse:"L"},relativeTime:{future:"ann an %s",past:"bho chionn %s",s:"beagan diogan",m:"mionaid",mm:"%d mionaidean",h:"uair",hh:"%d uairean",d:"latha",dd:"%d latha",M:"mìos",MM:"%d mìosan",y:"bliadhna",yy:"%d bliadhna"},ordinalParse:/\d{1,2}(d|na|mh)/,ordinal:function(a){var b=1===a?"d":a%10===2?"na":"mh";return a+b},week:{dow:1,doy:4}}),a.defineLocale("gl",{months:"Xaneiro_Febreiro_Marzo_Abril_Maio_Xuño_Xullo_Agosto_Setembro_Outubro_Novembro_Decembro".split("_"),monthsShort:"Xan._Feb._Mar._Abr._Mai._Xuñ._Xul._Ago._Set._Out._Nov._Dec.".split("_"),weekdays:"Domingo_Luns_Martes_Mércores_Xoves_Venres_Sábado".split("_"),weekdaysShort:"Dom._Lun._Mar._Mér._Xov._Ven._Sáb.".split("_"),weekdaysMin:"Do_Lu_Ma_Mé_Xo_Ve_Sá".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd D MMMM YYYY H:mm"},calendar:{sameDay:function(){return"[hoxe "+(1!==this.hours()?"ás":"á")+"] LT"},nextDay:function(){return"[mañá "+(1!==this.hours()?"ás":"á")+"] LT"},nextWeek:function(){return"dddd ["+(1!==this.hours()?"ás":"a")+"] LT"},lastDay:function(){return"[onte "+(1!==this.hours()?"á":"a")+"] LT"},lastWeek:function(){return"[o] dddd [pasado "+(1!==this.hours()?"ás":"a")+"] LT"},sameElse:"L"},relativeTime:{future:function(a){return"uns segundos"===a?"nuns segundos":"en "+a},past:"hai %s",s:"uns segundos",m:"un minuto",mm:"%d minutos",h:"unha hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un ano",yy:"%d anos"},ordinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:7}}),a.defineLocale("he",{months:"ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר".split("_"),monthsShort:"ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳".split("_"),weekdays:"ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת".split("_"),weekdaysShort:"א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳".split("_"),weekdaysMin:"א_ב_ג_ד_ה_ו_ש".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [ב]MMMM YYYY",LLL:"D [ב]MMMM YYYY HH:mm",LLLL:"dddd, D [ב]MMMM YYYY HH:mm",l:"D/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[היום ב־]LT",nextDay:"[מחר ב־]LT",nextWeek:"dddd [בשעה] LT",lastDay:"[אתמול ב־]LT",lastWeek:"[ביום] dddd [האחרון בשעה] LT",sameElse:"L"},relativeTime:{future:"בעוד %s",past:"לפני %s",s:"מספר שניות",m:"דקה",mm:"%d דקות",h:"שעה",hh:function(a){return 2===a?"שעתיים":a+" שעות"},d:"יום",dd:function(a){return 2===a?"יומיים":a+" ימים"},M:"חודש",MM:function(a){return 2===a?"חודשיים":a+" חודשים"},y:"שנה",yy:function(a){return 2===a?"שנתיים":a%10===0&&10!==a?a+" שנה":a+" שנים"}},meridiemParse:/אחה"צ|לפנה"צ|אחרי הצהריים|לפני הצהריים|לפנות בוקר|בבוקר|בערב/i,isPM:function(a){return/^(אחה"צ|אחרי הצהריים|בערב)$/.test(a)},meridiem:function(a,b,c){return 5>a?"לפנות בוקר":10>a?"בבוקר":12>a?c?'לפנה"צ':"לפני הצהריים":18>a?c?'אחה"צ':"אחרי הצהריים":"בערב"}}),{1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"}),Ea={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"},Fa=(a.defineLocale("hi",{months:"जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर".split("_"),monthsShort:"जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.".split("_"),weekdays:"रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm बजे",LTS:"A h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm बजे",LLLL:"dddd, D MMMM YYYY, A h:mm बजे"},calendar:{sameDay:"[आज] LT",nextDay:"[कल] LT",nextWeek:"dddd, LT",lastDay:"[कल] LT",lastWeek:"[पिछले] dddd, LT",sameElse:"L"},relativeTime:{future:"%s में",past:"%s पहले",s:"कुछ ही क्षण",m:"एक मिनट",mm:"%d मिनट",h:"एक घंटा",hh:"%d घंटे",d:"एक दिन",dd:"%d दिन",M:"एक महीने",MM:"%d महीने",y:"एक वर्ष",yy:"%d वर्ष"},preparse:function(a){return a.replace(/[१२३४५६७८९०]/g,function(a){return Ea[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return Da[a]})},meridiemParse:/रात|सुबह|दोपहर|शाम/,meridiemHour:function(a,b){return 12===a&&(a=0),"रात"===b?4>a?a:a+12:"सुबह"===b?a:"दोपहर"===b?a>=10?a:a+12:"शाम"===b?a+12:void 0},meridiem:function(a,b,c){return 4>a?"रात":10>a?"सुबह":17>a?"दोपहर":20>a?"शाम":"रात"},week:{dow:0,doy:6}}),a.defineLocale("hr",{months:{format:"siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca".split("_"),standalone:"siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac".split("_")},monthsShort:"sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.".split("_"),weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:case 3:return"[prošlu] dddd [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",m:r,mm:r,h:r,hh:r,d:"dan",dd:r,M:"mjesec",MM:r,y:"godinu",yy:r},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),"vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton".split(" ")),Ga=(a.defineLocale("hu",{months:"január_február_március_április_május_június_július_augusztus_szeptember_október_november_december".split("_"),monthsShort:"jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec".split("_"),weekdays:"vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat".split("_"),weekdaysShort:"vas_hét_kedd_sze_csüt_pén_szo".split("_"),weekdaysMin:"v_h_k_sze_cs_p_szo".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY. MMMM D.",LLL:"YYYY. MMMM D. H:mm",LLLL:"YYYY. MMMM D., dddd H:mm"},meridiemParse:/de|du/i,isPM:function(a){return"u"===a.charAt(1).toLowerCase()},meridiem:function(a,b,c){return 12>a?c===!0?"de":"DE":c===!0?"du":"DU"},calendar:{sameDay:"[ma] LT[-kor]",nextDay:"[holnap] LT[-kor]",nextWeek:function(){return t.call(this,!0)},lastDay:"[tegnap] LT[-kor]",lastWeek:function(){return t.call(this,!1)},sameElse:"L"},relativeTime:{future:"%s múlva",past:"%s",s:s,m:s,mm:s,h:s,hh:s,d:s,dd:s,M:s,MM:s,y:s,yy:s},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),a.defineLocale("hy-am",{months:{format:"հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի".split("_"),standalone:"հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր".split("_")},monthsShort:"հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ".split("_"),weekdays:"կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ".split("_"),weekdaysShort:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),weekdaysMin:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY թ.",LLL:"D MMMM YYYY թ., HH:mm",LLLL:"dddd, D MMMM YYYY թ., HH:mm"},calendar:{sameDay:"[այսօր] LT",nextDay:"[վաղը] LT",lastDay:"[երեկ] LT",nextWeek:function(){return"dddd [օրը ժամը] LT"},lastWeek:function(){return"[անցած] dddd [օրը ժամը] LT"},sameElse:"L"},relativeTime:{future:"%s հետո",past:"%s առաջ",s:"մի քանի վայրկյան",m:"րոպե",mm:"%d րոպե",h:"ժամ",hh:"%d ժամ",d:"օր",dd:"%d օր",M:"ամիս",MM:"%d ամիս",y:"տարի",yy:"%d տարի"},meridiemParse:/գիշերվա|առավոտվա|ցերեկվա|երեկոյան/,isPM:function(a){return/^(ցերեկվա|երեկոյան)$/.test(a)},meridiem:function(a){return 4>a?"գիշերվա":12>a?"առավոտվա":17>a?"ցերեկվա":"երեկոյան"},ordinalParse:/\d{1,2}|\d{1,2}-(ին|րդ)/,ordinal:function(a,b){switch(b){case"DDD":case"w":case"W":case"DDDo":return 1===a?a+"-ին":a+"-րդ";default:return a}},week:{dow:1,doy:7}}),a.defineLocale("id",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nov_Des".split("_"),weekdays:"Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu".split("_"),weekdaysShort:"Min_Sen_Sel_Rab_Kam_Jum_Sab".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|siang|sore|malam/,meridiemHour:function(a,b){return 12===a&&(a=0),"pagi"===b?a:"siang"===b?a>=11?a:a+12:"sore"===b||"malam"===b?a+12:void 0},meridiem:function(a,b,c){return 11>a?"pagi":15>a?"siang":19>a?"sore":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Besok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kemarin pukul] LT",lastWeek:"dddd [lalu pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lalu",s:"beberapa detik",m:"semenit",mm:"%d menit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}}),a.defineLocale("is",{months:"janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember".split("_"),monthsShort:"jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des".split("_"),weekdays:"sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur".split("_"),weekdaysShort:"sun_mán_þri_mið_fim_fös_lau".split("_"),weekdaysMin:"Su_Má_Þr_Mi_Fi_Fö_La".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd, D. MMMM YYYY [kl.] H:mm"},calendar:{sameDay:"[í dag kl.] LT",nextDay:"[á morgun kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[í gær kl.] LT",lastWeek:"[síðasta] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"eftir %s",past:"fyrir %s síðan",s:v,m:v,mm:v,h:"klukkustund",hh:v,d:v,dd:v,M:v,MM:v,y:v,yy:v},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),a.defineLocale("it",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"Domenica_Lunedì_Martedì_Mercoledì_Giovedì_Venerdì_Sabato".split("_"),weekdaysShort:"Dom_Lun_Mar_Mer_Gio_Ven_Sab".split("_"),weekdaysMin:"Do_Lu_Ma_Me_Gi_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Oggi alle] LT",nextDay:"[Domani alle] LT",nextWeek:"dddd [alle] LT",lastDay:"[Ieri alle] LT",lastWeek:function(){switch(this.day()){case 0:return"[la scorsa] dddd [alle] LT";default:return"[lo scorso] dddd [alle] LT"}},sameElse:"L"},relativeTime:{future:function(a){return(/^[0-9].+$/.test(a)?"tra":"in")+" "+a},past:"%s fa",s:"alcuni secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},ordinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}}),a.defineLocale("ja",{months:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"),weekdaysShort:"日_月_火_水_木_金_土".split("_"),weekdaysMin:"日_月_火_水_木_金_土".split("_"),longDateFormat:{LT:"Ah時m分",LTS:"Ah時m分s秒",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah時m分",LLLL:"YYYY年M月D日Ah時m分 dddd"},meridiemParse:/午前|午後/i,isPM:function(a){return"午後"===a},meridiem:function(a,b,c){return 12>a?"午前":"午後"},calendar:{sameDay:"[今日] LT",nextDay:"[明日] LT",nextWeek:"[来週]dddd LT",lastDay:"[昨日] LT",lastWeek:"[前週]dddd LT",sameElse:"L"},ordinalParse:/\d{1,2}日/,ordinal:function(a,b){switch(b){case"d":case"D":case"DDD":return a+"日";default:return a}},relativeTime:{future:"%s後",past:"%s前",s:"数秒",m:"1分",mm:"%d分",h:"1時間",hh:"%d時間",d:"1日",dd:"%d日",M:"1ヶ月",MM:"%dヶ月",y:"1年",yy:"%d年"}}),a.defineLocale("jv",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des".split("_"),weekdays:"Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu".split("_"),weekdaysShort:"Min_Sen_Sel_Reb_Kem_Jem_Sep".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sp".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/enjing|siyang|sonten|ndalu/,meridiemHour:function(a,b){return 12===a&&(a=0),"enjing"===b?a:"siyang"===b?a>=11?a:a+12:"sonten"===b||"ndalu"===b?a+12:void 0},meridiem:function(a,b,c){return 11>a?"enjing":15>a?"siyang":19>a?"sonten":"ndalu"},calendar:{sameDay:"[Dinten puniko pukul] LT",nextDay:"[Mbenjang pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kala wingi pukul] LT",lastWeek:"dddd [kepengker pukul] LT",sameElse:"L"},relativeTime:{future:"wonten ing %s",past:"%s ingkang kepengker",s:"sawetawis detik",m:"setunggal menit",mm:"%d menit",h:"setunggal jam",hh:"%d jam",d:"sedinten",dd:"%d dinten",M:"sewulan",MM:"%d wulan",y:"setaun",yy:"%d taun"},week:{dow:1,doy:7}}),a.defineLocale("ka",{months:{standalone:"იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი".split("_"),format:"იანვარს_თებერვალს_მარტს_აპრილის_მაისს_ივნისს_ივლისს_აგვისტს_სექტემბერს_ოქტომბერს_ნოემბერს_დეკემბერს".split("_")},monthsShort:"იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ".split("_"),weekdays:{standalone:"კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი".split("_"),format:"კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს".split("_"),isFormat:/(წინა|შემდეგ)/},weekdaysShort:"კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ".split("_"),weekdaysMin:"კვ_ორ_სა_ოთ_ხუ_პა_შა".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[დღეს] LT[-ზე]",nextDay:"[ხვალ] LT[-ზე]",lastDay:"[გუშინ] LT[-ზე]",nextWeek:"[შემდეგ] dddd LT[-ზე]",lastWeek:"[წინა] dddd LT-ზე",sameElse:"L"},relativeTime:{future:function(a){return/(წამი|წუთი|საათი|წელი)/.test(a)?a.replace(/ი$/,"ში"):a+"ში"},past:function(a){return/(წამი|წუთი|საათი|დღე|თვე)/.test(a)?a.replace(/(ი|ე)$/,"ის წინ"):/წელი/.test(a)?a.replace(/წელი$/,"წლის წინ"):void 0},s:"რამდენიმე წამი",m:"წუთი",mm:"%d წუთი",h:"საათი",hh:"%d საათი",d:"დღე",dd:"%d დღე",M:"თვე",MM:"%d თვე",y:"წელი",yy:"%d წელი"},ordinalParse:/0|1-ლი|მე-\d{1,2}|\d{1,2}-ე/,ordinal:function(a){return 0===a?a:1===a?a+"-ლი":20>a||100>=a&&a%20===0||a%100===0?"მე-"+a:a+"-ე"},week:{dow:1,doy:7}}),{0:"-ші",1:"-ші",2:"-ші",3:"-ші",4:"-ші",5:"-ші",6:"-шы",7:"-ші",8:"-ші",9:"-шы",10:"-шы",20:"-шы",30:"-шы",40:"-шы",50:"-ші",60:"-шы",70:"-ші",80:"-ші",90:"-шы",100:"-ші"}),Ha=(a.defineLocale("kk",{months:"Қаңтар_Ақпан_Наурыз_Сәуір_Мамыр_Маусым_Шілде_Тамыз_Қыркүйек_Қазан_Қараша_Желтоқсан".split("_"),monthsShort:"Қаң_Ақп_Нау_Сәу_Мам_Мау_Шіл_Там_Қыр_Қаз_Қар_Жел".split("_"),weekdays:"Жексенбі_Дүйсенбі_Сейсенбі_Сәрсенбі_Бейсенбі_Жұма_Сенбі".split("_"),weekdaysShort:"Жек_Дүй_Сей_Сәр_Бей_Жұм_Сен".split("_"),weekdaysMin:"Жк_Дй_Сй_Ср_Бй_Жм_Сн".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Бүгін сағат] LT",nextDay:"[Ертең сағат] LT",nextWeek:"dddd [сағат] LT",lastDay:"[Кеше сағат] LT",lastWeek:"[Өткен аптаның] dddd [сағат] LT",sameElse:"L"},relativeTime:{future:"%s ішінде",past:"%s бұрын",s:"бірнеше секунд",m:"бір минут",mm:"%d минут",h:"бір сағат",hh:"%d сағат",d:"бір күн",dd:"%d күн",M:"бір ай",MM:"%d ай",y:"бір жыл",yy:"%d жыл"},ordinalParse:/\d{1,2}-(ші|шы)/,ordinal:function(a){var b=a%10,c=a>=100?100:null;return a+(Ga[a]||Ga[b]||Ga[c])},week:{dow:1,doy:7}}),a.defineLocale("km",{months:"មករា_កុម្ភៈ_មិនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),monthsShort:"មករា_កុម្ភៈ_មិនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),weekdays:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),weekdaysShort:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),weekdaysMin:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[ថ្ងៃនេះ ម៉ោង] LT",nextDay:"[ស្អែក ម៉ោង] LT",nextWeek:"dddd [ម៉ោង] LT",lastDay:"[ម្សិលមិញ ម៉ោង] LT",lastWeek:"dddd [សប្តាហ៍មុន] [ម៉ោង] LT",sameElse:"L"},relativeTime:{future:"%sទៀត",past:"%sមុន",s:"ប៉ុន្មានវិនាទី",m:"មួយនាទី",mm:"%d នាទី",h:"មួយម៉ោង",hh:"%d ម៉ោង",d:"មួយថ្ងៃ",dd:"%d ថ្ងៃ",M:"មួយខែ",MM:"%d ខែ",y:"មួយឆ្នាំ",yy:"%d ឆ្នាំ"},week:{dow:1,doy:4}}),a.defineLocale("ko",{months:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),monthsShort:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),weekdays:"일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"),weekdaysShort:"일_월_화_수_목_금_토".split("_"),weekdaysMin:"일_월_화_수_목_금_토".split("_"),longDateFormat:{LT:"A h시 m분",LTS:"A h시 m분 s초",L:"YYYY.MM.DD",LL:"YYYY년 MMMM D일",LLL:"YYYY년 MMMM D일 A h시 m분",LLLL:"YYYY년 MMMM D일 dddd A h시 m분"},calendar:{sameDay:"오늘 LT",nextDay:"내일 LT",nextWeek:"dddd LT",lastDay:"어제 LT",lastWeek:"지난주 dddd LT",sameElse:"L"},relativeTime:{future:"%s 후",past:"%s 전",s:"몇초",ss:"%d초",m:"일분",mm:"%d분",h:"한시간",hh:"%d시간",d:"하루",dd:"%d일",M:"한달",MM:"%d달",y:"일년",yy:"%d년"},ordinalParse:/\d{1,2}일/,ordinal:"%d일",meridiemParse:/오전|오후/,isPM:function(a){return"오후"===a},meridiem:function(a,b,c){return 12>a?"오전":"오후"}}),a.defineLocale("lb",{months:"Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),weekdays:"Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg".split("_"),weekdaysShort:"So._Mé._Dë._Më._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mé_Dë_Më_Do_Fr_Sa".split("_"),longDateFormat:{LT:"H:mm [Auer]",LTS:"H:mm:ss [Auer]",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm [Auer]",LLLL:"dddd, D. MMMM YYYY H:mm [Auer]"},calendar:{sameDay:"[Haut um] LT",sameElse:"L",nextDay:"[Muer um] LT",nextWeek:"dddd [um] LT",lastDay:"[Gëschter um] LT",lastWeek:function(){switch(this.day()){case 2:case 4:return"[Leschten] dddd [um] LT";default:return"[Leschte] dddd [um] LT"}}},relativeTime:{future:x,past:y,s:"e puer Sekonnen",m:w,mm:"%d Minutten",h:w,hh:"%d Stonnen",d:w,dd:"%d Deeg",M:w,MM:"%d Méint",y:w,yy:"%d Joer"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),a.defineLocale("lo",{months:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),monthsShort:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),weekdays:"ອາທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),weekdaysShort:"ທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),weekdaysMin:"ທ_ຈ_ອຄ_ພ_ພຫ_ສກ_ສ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"ວັນdddd D MMMM YYYY HH:mm"},meridiemParse:/ຕອນເຊົ້າ|ຕອນແລງ/,isPM:function(a){return"ຕອນແລງ"===a},meridiem:function(a,b,c){return 12>a?"ຕອນເຊົ້າ":"ຕອນແລງ"},calendar:{sameDay:"[ມື້ນີ້ເວລາ] LT",nextDay:"[ມື້ອື່ນເວລາ] LT",nextWeek:"[ວັນ]dddd[ໜ້າເວລາ] LT",lastDay:"[ມື້ວານນີ້ເວລາ] LT",lastWeek:"[ວັນ]dddd[ແລ້ວນີ້ເວລາ] LT",sameElse:"L"},relativeTime:{future:"ອີກ %s",past:"%sຜ່ານມາ",s:"ບໍ່ເທົ່າໃດວິນາທີ",m:"1 ນາທີ",mm:"%d ນາທີ",h:"1 ຊົ່ວໂມງ",hh:"%d ຊົ່ວໂມງ",d:"1 ມື້",dd:"%d ມື້",M:"1 ເດືອນ",MM:"%d ເດືອນ",y:"1 ປີ",yy:"%d ປີ"},ordinalParse:/(ທີ່)\d{1,2}/,ordinal:function(a){return"ທີ່"+a; +}}),{m:"minutė_minutės_minutę",mm:"minutės_minučių_minutes",h:"valanda_valandos_valandą",hh:"valandos_valandų_valandas",d:"diena_dienos_dieną",dd:"dienos_dienų_dienas",M:"mėnuo_mėnesio_mėnesį",MM:"mėnesiai_mėnesių_mėnesius",y:"metai_metų_metus",yy:"metai_metų_metus"}),Ia=(a.defineLocale("lt",{months:{format:"sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio".split("_"),standalone:"sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis".split("_")},monthsShort:"sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd".split("_"),weekdays:{format:"sekmadienį_pirmadienį_antradienį_trečiadienį_ketvirtadienį_penktadienį_šeštadienį".split("_"),standalone:"sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis".split("_"),isFormat:/dddd HH:mm/},weekdaysShort:"Sek_Pir_Ant_Tre_Ket_Pen_Šeš".split("_"),weekdaysMin:"S_P_A_T_K_Pn_Š".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY [m.] MMMM D [d.]",LLL:"YYYY [m.] MMMM D [d.], HH:mm [val.]",LLLL:"YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]",l:"YYYY-MM-DD",ll:"YYYY [m.] MMMM D [d.]",lll:"YYYY [m.] MMMM D [d.], HH:mm [val.]",llll:"YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]"},calendar:{sameDay:"[Šiandien] LT",nextDay:"[Rytoj] LT",nextWeek:"dddd LT",lastDay:"[Vakar] LT",lastWeek:"[Praėjusį] dddd LT",sameElse:"L"},relativeTime:{future:"po %s",past:"prieš %s",s:A,m:B,mm:E,h:B,hh:E,d:B,dd:E,M:B,MM:E,y:B,yy:E},ordinalParse:/\d{1,2}-oji/,ordinal:function(a){return a+"-oji"},week:{dow:1,doy:4}}),{m:"minūtes_minūtēm_minūte_minūtes".split("_"),mm:"minūtes_minūtēm_minūte_minūtes".split("_"),h:"stundas_stundām_stunda_stundas".split("_"),hh:"stundas_stundām_stunda_stundas".split("_"),d:"dienas_dienām_diena_dienas".split("_"),dd:"dienas_dienām_diena_dienas".split("_"),M:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),MM:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),y:"gada_gadiem_gads_gadi".split("_"),yy:"gada_gadiem_gads_gadi".split("_")}),Ja=(a.defineLocale("lv",{months:"janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris".split("_"),monthsShort:"jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec".split("_"),weekdays:"svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena".split("_"),weekdaysShort:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysMin:"Sv_P_O_T_C_Pk_S".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY.",LL:"YYYY. [gada] D. MMMM",LLL:"YYYY. [gada] D. MMMM, HH:mm",LLLL:"YYYY. [gada] D. MMMM, dddd, HH:mm"},calendar:{sameDay:"[Šodien pulksten] LT",nextDay:"[Rīt pulksten] LT",nextWeek:"dddd [pulksten] LT",lastDay:"[Vakar pulksten] LT",lastWeek:"[Pagājušā] dddd [pulksten] LT",sameElse:"L"},relativeTime:{future:"pēc %s",past:"pirms %s",s:I,m:H,mm:G,h:H,hh:G,d:H,dd:G,M:H,MM:G,y:H,yy:G},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),{words:{m:["jedan minut","jednog minuta"],mm:["minut","minuta","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mjesec","mjeseca","mjeseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(a,b){return 1===a?b[0]:a>=2&&4>=a?b[1]:b[2]},translate:function(a,b,c){var d=Ja.words[c];return 1===c.length?b?d[0]:d[1]:a+" "+Ja.correctGrammaticalCase(a,d)}}),Ka=(a.defineLocale("me",{months:["januar","februar","mart","april","maj","jun","jul","avgust","septembar","oktobar","novembar","decembar"],monthsShort:["jan.","feb.","mar.","apr.","maj","jun","jul","avg.","sep.","okt.","nov.","dec."],weekdays:["nedjelja","ponedjeljak","utorak","srijeda","četvrtak","petak","subota"],weekdaysShort:["ned.","pon.","uto.","sri.","čet.","pet.","sub."],weekdaysMin:["ne","po","ut","sr","če","pe","su"],longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sjutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){var a=["[prošle] [nedjelje] [u] LT","[prošlog] [ponedjeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srijede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"];return a[this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"nekoliko sekundi",m:Ja.translate,mm:Ja.translate,h:Ja.translate,hh:Ja.translate,d:"dan",dd:Ja.translate,M:"mjesec",MM:Ja.translate,y:"godinu",yy:Ja.translate},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),a.defineLocale("mk",{months:"јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември".split("_"),monthsShort:"јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек".split("_"),weekdays:"недела_понеделник_вторник_среда_четврток_петок_сабота".split("_"),weekdaysShort:"нед_пон_вто_сре_чет_пет_саб".split("_"),weekdaysMin:"нe_пo_вт_ср_че_пе_сa".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Денес во] LT",nextDay:"[Утре во] LT",nextWeek:"[Во] dddd [во] LT",lastDay:"[Вчера во] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[Изминатата] dddd [во] LT";case 1:case 2:case 4:case 5:return"[Изминатиот] dddd [во] LT"}},sameElse:"L"},relativeTime:{future:"после %s",past:"пред %s",s:"неколку секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дена",M:"месец",MM:"%d месеци",y:"година",yy:"%d години"},ordinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(a){var b=a%10,c=a%100;return 0===a?a+"-ев":0===c?a+"-ен":c>10&&20>c?a+"-ти":1===b?a+"-ви":2===b?a+"-ри":7===b||8===b?a+"-ми":a+"-ти"},week:{dow:1,doy:7}}),a.defineLocale("ml",{months:"ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ".split("_"),monthsShort:"ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.".split("_"),weekdays:"ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച".split("_"),weekdaysShort:"ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി".split("_"),weekdaysMin:"ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ".split("_"),longDateFormat:{LT:"A h:mm -നു",LTS:"A h:mm:ss -നു",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm -നു",LLLL:"dddd, D MMMM YYYY, A h:mm -നു"},calendar:{sameDay:"[ഇന്ന്] LT",nextDay:"[നാളെ] LT",nextWeek:"dddd, LT",lastDay:"[ഇന്നലെ] LT",lastWeek:"[കഴിഞ്ഞ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s കഴിഞ്ഞ്",past:"%s മുൻപ്",s:"അൽപ നിമിഷങ്ങൾ",m:"ഒരു മിനിറ്റ്",mm:"%d മിനിറ്റ്",h:"ഒരു മണിക്കൂർ",hh:"%d മണിക്കൂർ",d:"ഒരു ദിവസം",dd:"%d ദിവസം",M:"ഒരു മാസം",MM:"%d മാസം",y:"ഒരു വർഷം",yy:"%d വർഷം"},meridiemParse:/രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i,meridiemHour:function(a,b){return 12===a&&(a=0),"രാത്രി"===b&&a>=4||"ഉച്ച കഴിഞ്ഞ്"===b||"വൈകുന്നേരം"===b?a+12:a},meridiem:function(a,b,c){return 4>a?"രാത്രി":12>a?"രാവിലെ":17>a?"ഉച്ച കഴിഞ്ഞ്":20>a?"വൈകുന്നേരം":"രാത്രി"}}),{1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"}),La={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"},Ma=(a.defineLocale("mr",{months:"जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),monthsShort:"जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),weekdays:"रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm वाजता",LTS:"A h:mm:ss वाजता",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm वाजता",LLLL:"dddd, D MMMM YYYY, A h:mm वाजता"},calendar:{sameDay:"[आज] LT",nextDay:"[उद्या] LT",nextWeek:"dddd, LT",lastDay:"[काल] LT",lastWeek:"[मागील] dddd, LT",sameElse:"L"},relativeTime:{future:"%sमध्ये",past:"%sपूर्वी",s:J,m:J,mm:J,h:J,hh:J,d:J,dd:J,M:J,MM:J,y:J,yy:J},preparse:function(a){return a.replace(/[१२३४५६७८९०]/g,function(a){return La[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return Ka[a]})},meridiemParse:/रात्री|सकाळी|दुपारी|सायंकाळी/,meridiemHour:function(a,b){return 12===a&&(a=0),"रात्री"===b?4>a?a:a+12:"सकाळी"===b?a:"दुपारी"===b?a>=10?a:a+12:"सायंकाळी"===b?a+12:void 0},meridiem:function(a,b,c){return 4>a?"रात्री":10>a?"सकाळी":17>a?"दुपारी":20>a?"सायंकाळी":"रात्री"},week:{dow:0,doy:6}}),a.defineLocale("ms-my",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(a,b){return 12===a&&(a=0),"pagi"===b?a:"tengahari"===b?a>=11?a:a+12:"petang"===b||"malam"===b?a+12:void 0},meridiem:function(a,b,c){return 11>a?"pagi":15>a?"tengahari":19>a?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}}),a.defineLocale("ms",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(a,b){return 12===a&&(a=0),"pagi"===b?a:"tengahari"===b?a>=11?a:a+12:"petang"===b||"malam"===b?a+12:void 0},meridiem:function(a,b,c){return 11>a?"pagi":15>a?"tengahari":19>a?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}}),{1:"၁",2:"၂",3:"၃",4:"၄",5:"၅",6:"၆",7:"၇",8:"၈",9:"၉",0:"၀"}),Na={"၁":"1","၂":"2","၃":"3","၄":"4","၅":"5","၆":"6","၇":"7","၈":"8","၉":"9","၀":"0"},Oa=(a.defineLocale("my",{months:"ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ".split("_"),monthsShort:"ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ".split("_"),weekdays:"တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ".split("_"),weekdaysShort:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),weekdaysMin:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ယနေ.] LT [မှာ]",nextDay:"[မနက်ဖြန်] LT [မှာ]",nextWeek:"dddd LT [မှာ]",lastDay:"[မနေ.က] LT [မှာ]",lastWeek:"[ပြီးခဲ့သော] dddd LT [မှာ]",sameElse:"L"},relativeTime:{future:"လာမည့် %s မှာ",past:"လွန်ခဲ့သော %s က",s:"စက္ကန်.အနည်းငယ်",m:"တစ်မိနစ်",mm:"%d မိနစ်",h:"တစ်နာရီ",hh:"%d နာရီ",d:"တစ်ရက်",dd:"%d ရက်",M:"တစ်လ",MM:"%d လ",y:"တစ်နှစ်",yy:"%d နှစ်"},preparse:function(a){return a.replace(/[၁၂၃၄၅၆၇၈၉၀]/g,function(a){return Na[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return Ma[a]})},week:{dow:1,doy:4}}),a.defineLocale("nb",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan._feb._mars_april_mai_juni_juli_aug._sep._okt._nov._des.".split("_"),weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"sø._ma._ti._on._to._fr._lø.".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] HH:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[i går kl.] LT",lastWeek:"[forrige] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"for %s siden",s:"noen sekunder",m:"ett minutt",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dager",M:"en måned",MM:"%d måneder",y:"ett år",yy:"%d år"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),{1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"}),Pa={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"},Qa=(a.defineLocale("ne",{months:"जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर".split("_"),monthsShort:"जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.".split("_"),weekdays:"आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार".split("_"),weekdaysShort:"आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.".split("_"),weekdaysMin:"आ._सो._मं._बु._बि._शु._श.".split("_"),longDateFormat:{LT:"Aको h:mm बजे",LTS:"Aको h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, Aको h:mm बजे",LLLL:"dddd, D MMMM YYYY, Aको h:mm बजे"},preparse:function(a){return a.replace(/[१२३४५६७८९०]/g,function(a){return Pa[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return Oa[a]})},meridiemParse:/राति|बिहान|दिउँसो|साँझ/,meridiemHour:function(a,b){return 12===a&&(a=0),"राति"===b?4>a?a:a+12:"बिहान"===b?a:"दिउँसो"===b?a>=10?a:a+12:"साँझ"===b?a+12:void 0},meridiem:function(a,b,c){return 3>a?"राति":12>a?"बिहान":16>a?"दिउँसो":20>a?"साँझ":"राति"},calendar:{sameDay:"[आज] LT",nextDay:"[भोलि] LT",nextWeek:"[आउँदो] dddd[,] LT",lastDay:"[हिजो] LT",lastWeek:"[गएको] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%sमा",past:"%s अगाडि",s:"केही क्षण",m:"एक मिनेट",mm:"%d मिनेट",h:"एक घण्टा",hh:"%d घण्टा",d:"एक दिन",dd:"%d दिन",M:"एक महिना",MM:"%d महिना",y:"एक बर्ष",yy:"%d बर्ष"},week:{dow:0,doy:6}}),"jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_")),Ra="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),Sa=(a.defineLocale("nl",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(a,b){return/-MMM-/.test(b)?Ra[a.month()]:Qa[a.month()]},weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"Zo_Ma_Di_Wo_Do_Vr_Za".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},ordinalParse:/\d{1,2}(ste|de)/,ordinal:function(a){return a+(1===a||8===a||a>=20?"ste":"de")},week:{dow:1,doy:4}}),a.defineLocale("nn",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag".split("_"),weekdaysShort:"sun_mån_tys_ons_tor_fre_lau".split("_"),weekdaysMin:"su_må_ty_on_to_fr_lø".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[I dag klokka] LT",nextDay:"[I morgon klokka] LT",nextWeek:"dddd [klokka] LT",lastDay:"[I går klokka] LT",lastWeek:"[Føregåande] dddd [klokka] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"for %s sidan",s:"nokre sekund",m:"eit minutt",mm:"%d minutt",h:"ein time",hh:"%d timar",d:"ein dag",dd:"%d dagar",M:"ein månad",MM:"%d månader",y:"eit år",yy:"%d år"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),{1:"੧",2:"੨",3:"੩",4:"੪",5:"੫",6:"੬",7:"੭",8:"੮",9:"੯",0:"੦"}),Ta={"੧":"1","੨":"2","੩":"3","੪":"4","੫":"5","੬":"6","੭":"7","੮":"8","੯":"9","੦":"0"},Ua=(a.defineLocale("pa-in",{months:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),monthsShort:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),weekdays:"ਐਤਵਾਰ_ਸੋਮਵਾਰ_ਮੰਗਲਵਾਰ_ਬੁਧਵਾਰ_ਵੀਰਵਾਰ_ਸ਼ੁੱਕਰਵਾਰ_ਸ਼ਨੀਚਰਵਾਰ".split("_"),weekdaysShort:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),weekdaysMin:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),longDateFormat:{LT:"A h:mm ਵਜੇ",LTS:"A h:mm:ss ਵਜੇ",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm ਵਜੇ",LLLL:"dddd, D MMMM YYYY, A h:mm ਵਜੇ"},calendar:{sameDay:"[ਅਜ] LT",nextDay:"[ਕਲ] LT",nextWeek:"dddd, LT",lastDay:"[ਕਲ] LT",lastWeek:"[ਪਿਛਲੇ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ਵਿੱਚ",past:"%s ਪਿਛਲੇ",s:"ਕੁਝ ਸਕਿੰਟ",m:"ਇਕ ਮਿੰਟ",mm:"%d ਮਿੰਟ",h:"ਇੱਕ ਘੰਟਾ",hh:"%d ਘੰਟੇ",d:"ਇੱਕ ਦਿਨ",dd:"%d ਦਿਨ",M:"ਇੱਕ ਮਹੀਨਾ",MM:"%d ਮਹੀਨੇ",y:"ਇੱਕ ਸਾਲ",yy:"%d ਸਾਲ"},preparse:function(a){return a.replace(/[੧੨੩੪੫੬੭੮੯੦]/g,function(a){return Ta[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return Sa[a]})},meridiemParse:/ਰਾਤ|ਸਵੇਰ|ਦੁਪਹਿਰ|ਸ਼ਾਮ/,meridiemHour:function(a,b){return 12===a&&(a=0),"ਰਾਤ"===b?4>a?a:a+12:"ਸਵੇਰ"===b?a:"ਦੁਪਹਿਰ"===b?a>=10?a:a+12:"ਸ਼ਾਮ"===b?a+12:void 0},meridiem:function(a,b,c){return 4>a?"ਰਾਤ":10>a?"ਸਵੇਰ":17>a?"ਦੁਪਹਿਰ":20>a?"ਸ਼ਾਮ":"ਰਾਤ"},week:{dow:0,doy:6}}),"styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_")),Va="stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia".split("_"),Wa=(a.defineLocale("pl",{months:function(a,b){return""===b?"("+Va[a.month()]+"|"+Ua[a.month()]+")":/D MMMM/.test(b)?Va[a.month()]:Ua[a.month()]},monthsShort:"sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"),weekdays:"niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"),weekdaysShort:"nie_pon_wt_śr_czw_pt_sb".split("_"),weekdaysMin:"Nd_Pn_Wt_Śr_Cz_Pt_So".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Dziś o] LT",nextDay:"[Jutro o] LT",nextWeek:"[W] dddd [o] LT",lastDay:"[Wczoraj o] LT",lastWeek:function(){switch(this.day()){case 0:return"[W zeszłą niedzielę o] LT";case 3:return"[W zeszłą środę o] LT";case 6:return"[W zeszłą sobotę o] LT";default:return"[W zeszły] dddd [o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"%s temu",s:"kilka sekund",m:L,mm:L,h:L,hh:L,d:"1 dzień",dd:"%d dni",M:"miesiąc",MM:L,y:"rok",yy:L},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),a.defineLocale("pt-br",{months:"Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),weekdaysMin:"Dom_2ª_3ª_4ª_5ª_6ª_Sáb".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [às] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [às] HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"%s atrás",s:"poucos segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},ordinalParse:/\d{1,2}º/,ordinal:"%dº"}),a.defineLocale("pt",{months:"Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingo_Segunda-Feira_Terça-Feira_Quarta-Feira_Quinta-Feira_Sexta-Feira_Sábado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),weekdaysMin:"Dom_2ª_3ª_4ª_5ª_6ª_Sáb".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"há %s",s:"segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},ordinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}}),a.defineLocale("ro",{months:"ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie".split("_"),monthsShort:"ian._febr._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.".split("_"),weekdays:"duminică_luni_marți_miercuri_joi_vineri_sâmbătă".split("_"),weekdaysShort:"Dum_Lun_Mar_Mie_Joi_Vin_Sâm".split("_"),weekdaysMin:"Du_Lu_Ma_Mi_Jo_Vi_Sâ".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[azi la] LT",nextDay:"[mâine la] LT",nextWeek:"dddd [la] LT",lastDay:"[ieri la] LT",lastWeek:"[fosta] dddd [la] LT",sameElse:"L"},relativeTime:{future:"peste %s",past:"%s în urmă",s:"câteva secunde",m:"un minut",mm:M,h:"o oră",hh:M,d:"o zi",dd:M,M:"o lună",MM:M,y:"un an",yy:M},week:{dow:1,doy:7}}),[/^янв/i,/^фев/i,/^мар/i,/^апр/i,/^ма[й|я]/i,/^июн/i,/^июл/i,/^авг/i,/^сен/i,/^окт/i,/^ноя/i,/^дек/i]),Xa=(a.defineLocale("ru",{months:{format:"января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря".split("_"),standalone:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_")},monthsShort:{format:"янв_фев_мар_апр_мая_июня_июля_авг_сен_окт_ноя_дек".split("_"),standalone:"янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек".split("_")},weekdays:{standalone:"воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"),format:"воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу".split("_"),isFormat:/\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?\] ?dddd/},weekdaysShort:"вс_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"вс_пн_вт_ср_чт_пт_сб".split("_"),monthsParse:Wa,longMonthsParse:Wa,shortMonthsParse:Wa,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., HH:mm",LLLL:"dddd, D MMMM YYYY г., HH:mm"},calendar:{sameDay:"[Сегодня в] LT",nextDay:"[Завтра в] LT",lastDay:"[Вчера в] LT",nextWeek:function(a){if(a.week()===this.week())return 2===this.day()?"[Во] dddd [в] LT":"[В] dddd [в] LT";switch(this.day()){case 0:return"[В следующее] dddd [в] LT";case 1:case 2:case 4:return"[В следующий] dddd [в] LT";case 3:case 5:case 6:return"[В следующую] dddd [в] LT"}},lastWeek:function(a){if(a.week()===this.week())return 2===this.day()?"[Во] dddd [в] LT":"[В] dddd [в] LT";switch(this.day()){case 0:return"[В прошлое] dddd [в] LT";case 1:case 2:case 4:return"[В прошлый] dddd [в] LT";case 3:case 5:case 6:return"[В прошлую] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",m:O,mm:O,h:"час",hh:O,d:"день",dd:O,M:"месяц",MM:O,y:"год",yy:O},meridiemParse:/ночи|утра|дня|вечера/i,isPM:function(a){return/^(дня|вечера)$/.test(a)},meridiem:function(a,b,c){return 4>a?"ночи":12>a?"утра":17>a?"дня":"вечера"},ordinalParse:/\d{1,2}-(й|го|я)/,ordinal:function(a,b){switch(b){case"M":case"d":case"DDD":return a+"-й";case"D":return a+"-го";case"w":case"W":return a+"-я";default:return a}},week:{dow:1,doy:7}}),a.defineLocale("se",{months:"ođđajagemánnu_guovvamánnu_njukčamánnu_cuoŋománnu_miessemánnu_geassemánnu_suoidnemánnu_borgemánnu_čakčamánnu_golggotmánnu_skábmamánnu_juovlamánnu".split("_"),monthsShort:"ođđj_guov_njuk_cuo_mies_geas_suoi_borg_čakč_golg_skáb_juov".split("_"),weekdays:"sotnabeaivi_vuossárga_maŋŋebárga_gaskavahkku_duorastat_bearjadat_lávvardat".split("_"),weekdaysShort:"sotn_vuos_maŋ_gask_duor_bear_láv".split("_"),weekdaysMin:"s_v_m_g_d_b_L".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"MMMM D. [b.] YYYY",LLL:"MMMM D. [b.] YYYY [ti.] HH:mm",LLLL:"dddd, MMMM D. [b.] YYYY [ti.] HH:mm"},calendar:{sameDay:"[otne ti] LT",nextDay:"[ihttin ti] LT",nextWeek:"dddd [ti] LT",lastDay:"[ikte ti] LT",lastWeek:"[ovddit] dddd [ti] LT",sameElse:"L"},relativeTime:{future:"%s geažes",past:"maŋit %s",s:"moadde sekunddat",m:"okta minuhta",mm:"%d minuhtat",h:"okta diimmu",hh:"%d diimmut",d:"okta beaivi",dd:"%d beaivvit",M:"okta mánnu",MM:"%d mánut",y:"okta jahki",yy:"%d jagit"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),a.defineLocale("si",{months:"ජනවාරි_පෙබරවාරි_මාර්තු_අප්‍රේල්_මැයි_ජූනි_ජූලි_අගෝස්තු_සැප්තැම්බර්_ඔක්තෝබර්_නොවැම්බර්_දෙසැම්බර්".split("_"),monthsShort:"ජන_පෙබ_මාර්_අප්_මැයි_ජූනි_ජූලි_අගෝ_සැප්_ඔක්_නොවැ_දෙසැ".split("_"),weekdays:"ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්‍රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා".split("_"),weekdaysShort:"ඉරි_සඳු_අඟ_බදා_බ්‍රහ_සිකු_සෙන".split("_"),weekdaysMin:"ඉ_ස_අ_බ_බ්‍ර_සි_සෙ".split("_"),longDateFormat:{LT:"a h:mm",LTS:"a h:mm:ss",L:"YYYY/MM/DD",LL:"YYYY MMMM D",LLL:"YYYY MMMM D, a h:mm",LLLL:"YYYY MMMM D [වැනි] dddd, a h:mm:ss"},calendar:{sameDay:"[අද] LT[ට]",nextDay:"[හෙට] LT[ට]",nextWeek:"dddd LT[ට]",lastDay:"[ඊයේ] LT[ට]",lastWeek:"[පසුගිය] dddd LT[ට]",sameElse:"L"},relativeTime:{future:"%sකින්",past:"%sකට පෙර",s:"තත්පර කිහිපය",m:"මිනිත්තුව",mm:"මිනිත්තු %d",h:"පැය",hh:"පැය %d",d:"දිනය",dd:"දින %d",M:"මාසය",MM:"මාස %d",y:"වසර",yy:"වසර %d"},ordinalParse:/\d{1,2} වැනි/,ordinal:function(a){return a+" වැනි"},meridiemParse:/පෙර වරු|පස් වරු|පෙ.ව|ප.ව./,isPM:function(a){return"ප.ව."===a||"පස් වරු"===a},meridiem:function(a,b,c){return a>11?c?"ප.ව.":"පස් වරු":c?"පෙ.ව.":"පෙර වරු"}}),"január_február_marec_apríl_máj_jún_júl_august_september_október_november_december".split("_")),Ya="jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec".split("_"),Za=(a.defineLocale("sk",{months:Xa,monthsShort:Ya,weekdays:"nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota".split("_"),weekdaysShort:"ne_po_ut_st_št_pi_so".split("_"),weekdaysMin:"ne_po_ut_st_št_pi_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm"},calendar:{sameDay:"[dnes o] LT",nextDay:"[zajtra o] LT",nextWeek:function(){switch(this.day()){case 0:return"[v nedeľu o] LT";case 1:case 2:return"[v] dddd [o] LT";case 3:return"[v stredu o] LT";case 4:return"[vo štvrtok o] LT";case 5:return"[v piatok o] LT";case 6:return"[v sobotu o] LT"}},lastDay:"[včera o] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulú nedeľu o] LT";case 1:case 2:return"[minulý] dddd [o] LT";case 3:return"[minulú stredu o] LT";case 4:case 5:return"[minulý] dddd [o] LT";case 6:return"[minulú sobotu o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"pred %s",s:Q,m:Q,mm:Q,h:Q,hh:Q,d:Q,dd:Q,M:Q,MM:Q,y:Q,yy:Q},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),a.defineLocale("sl",{months:"januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.".split("_"),weekdays:"nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota".split("_"),weekdaysShort:"ned._pon._tor._sre._čet._pet._sob.".split("_"),weekdaysMin:"ne_po_to_sr_če_pe_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danes ob] LT",nextDay:"[jutri ob] LT",nextWeek:function(){switch(this.day()){case 0:return"[v] [nedeljo] [ob] LT";case 3:return"[v] [sredo] [ob] LT";case 6:return"[v] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[v] dddd [ob] LT"}},lastDay:"[včeraj ob] LT",lastWeek:function(){switch(this.day()){case 0:return"[prejšnjo] [nedeljo] [ob] LT";case 3:return"[prejšnjo] [sredo] [ob] LT";case 6:return"[prejšnjo] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[prejšnji] dddd [ob] LT"}},sameElse:"L"},relativeTime:{future:"čez %s",past:"pred %s",s:R,m:R,mm:R,h:R,hh:R,d:R,dd:R,M:R,MM:R,y:R,yy:R},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),a.defineLocale("sq",{months:"Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor".split("_"),monthsShort:"Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj".split("_"),weekdays:"E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë".split("_"),weekdaysShort:"Die_Hën_Mar_Mër_Enj_Pre_Sht".split("_"),weekdaysMin:"D_H_Ma_Më_E_P_Sh".split("_"),meridiemParse:/PD|MD/,isPM:function(a){return"M"===a.charAt(0)},meridiem:function(a,b,c){return 12>a?"PD":"MD"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Sot në] LT",nextDay:"[Nesër në] LT",nextWeek:"dddd [në] LT",lastDay:"[Dje në] LT",lastWeek:"dddd [e kaluar në] LT",sameElse:"L"},relativeTime:{future:"në %s",past:"%s më parë",s:"disa sekonda",m:"një minutë",mm:"%d minuta",h:"një orë",hh:"%d orë",d:"një ditë",dd:"%d ditë",M:"një muaj",MM:"%d muaj",y:"një vit",yy:"%d vite"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),{words:{m:["један минут","једне минуте"],mm:["минут","минуте","минута"],h:["један сат","једног сата"],hh:["сат","сата","сати"],dd:["дан","дана","дана"],MM:["месец","месеца","месеци"],yy:["година","године","година"]},correctGrammaticalCase:function(a,b){return 1===a?b[0]:a>=2&&4>=a?b[1]:b[2]},translate:function(a,b,c){var d=Za.words[c];return 1===c.length?b?d[0]:d[1]:a+" "+Za.correctGrammaticalCase(a,d)}}),$a=(a.defineLocale("sr-cyrl",{months:["јануар","фебруар","март","април","мај","јун","јул","август","септембар","октобар","новембар","децембар"],monthsShort:["јан.","феб.","мар.","апр.","мај","јун","јул","авг.","сеп.","окт.","нов.","дец."],weekdays:["недеља","понедељак","уторак","среда","четвртак","петак","субота"],weekdaysShort:["нед.","пон.","уто.","сре.","чет.","пет.","суб."],weekdaysMin:["не","по","ут","ср","че","пе","су"],longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[данас у] LT",nextDay:"[сутра у] LT",nextWeek:function(){switch(this.day()){case 0:return"[у] [недељу] [у] LT";case 3:return"[у] [среду] [у] LT";case 6:return"[у] [суботу] [у] LT";case 1:case 2:case 4:case 5:return"[у] dddd [у] LT"}},lastDay:"[јуче у] LT",lastWeek:function(){var a=["[прошле] [недеље] [у] LT","[прошлог] [понедељка] [у] LT","[прошлог] [уторка] [у] LT","[прошле] [среде] [у] LT","[прошлог] [четвртка] [у] LT","[прошлог] [петка] [у] LT","[прошле] [суботе] [у] LT"];return a[this.day()]},sameElse:"L"},relativeTime:{future:"за %s",past:"пре %s",s:"неколико секунди",m:Za.translate,mm:Za.translate,h:Za.translate,hh:Za.translate,d:"дан",dd:Za.translate,M:"месец",MM:Za.translate,y:"годину",yy:Za.translate},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),{words:{m:["jedan minut","jedne minute"],mm:["minut","minute","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mesec","meseca","meseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(a,b){ +return 1===a?b[0]:a>=2&&4>=a?b[1]:b[2]},translate:function(a,b,c){var d=$a.words[c];return 1===c.length?b?d[0]:d[1]:a+" "+$a.correctGrammaticalCase(a,d)}}),_a=(a.defineLocale("sr",{months:["januar","februar","mart","april","maj","jun","jul","avgust","septembar","oktobar","novembar","decembar"],monthsShort:["jan.","feb.","mar.","apr.","maj","jun","jul","avg.","sep.","okt.","nov.","dec."],weekdays:["nedelja","ponedeljak","utorak","sreda","četvrtak","petak","subota"],weekdaysShort:["ned.","pon.","uto.","sre.","čet.","pet.","sub."],weekdaysMin:["ne","po","ut","sr","če","pe","su"],longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedelju] [u] LT";case 3:return"[u] [sredu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){var a=["[prošle] [nedelje] [u] LT","[prošlog] [ponedeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"];return a[this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"pre %s",s:"nekoliko sekundi",m:$a.translate,mm:$a.translate,h:$a.translate,hh:$a.translate,d:"dan",dd:$a.translate,M:"mesec",MM:$a.translate,y:"godinu",yy:$a.translate},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),a.defineLocale("sv",{months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"),weekdaysShort:"sön_mån_tis_ons_tor_fre_lör".split("_"),weekdaysMin:"sö_må_ti_on_to_fr_lö".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Idag] LT",nextDay:"[Imorgon] LT",lastDay:"[Igår] LT",nextWeek:"[På] dddd LT",lastWeek:"[I] dddd[s] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"för %s sedan",s:"några sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en månad",MM:"%d månader",y:"ett år",yy:"%d år"},ordinalParse:/\d{1,2}(e|a)/,ordinal:function(a){var b=a%10,c=1===~~(a%100/10)?"e":1===b?"a":2===b?"a":"e";return a+c},week:{dow:1,doy:4}}),a.defineLocale("sw",{months:"Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des".split("_"),weekdays:"Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi".split("_"),weekdaysShort:"Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos".split("_"),weekdaysMin:"J2_J3_J4_J5_Al_Ij_J1".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[leo saa] LT",nextDay:"[kesho saa] LT",nextWeek:"[wiki ijayo] dddd [saat] LT",lastDay:"[jana] LT",lastWeek:"[wiki iliyopita] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s baadaye",past:"tokea %s",s:"hivi punde",m:"dakika moja",mm:"dakika %d",h:"saa limoja",hh:"masaa %d",d:"siku moja",dd:"masiku %d",M:"mwezi mmoja",MM:"miezi %d",y:"mwaka mmoja",yy:"miaka %d"},week:{dow:1,doy:7}}),{1:"௧",2:"௨",3:"௩",4:"௪",5:"௫",6:"௬",7:"௭",8:"௮",9:"௯",0:"௦"}),ab={"௧":"1","௨":"2","௩":"3","௪":"4","௫":"5","௬":"6","௭":"7","௮":"8","௯":"9","௦":"0"},bb=(a.defineLocale("ta",{months:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),monthsShort:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),weekdays:"ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை".split("_"),weekdaysShort:"ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி".split("_"),weekdaysMin:"ஞா_தி_செ_பு_வி_வெ_ச".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, HH:mm",LLLL:"dddd, D MMMM YYYY, HH:mm"},calendar:{sameDay:"[இன்று] LT",nextDay:"[நாளை] LT",nextWeek:"dddd, LT",lastDay:"[நேற்று] LT",lastWeek:"[கடந்த வாரம்] dddd, LT",sameElse:"L"},relativeTime:{future:"%s இல்",past:"%s முன்",s:"ஒரு சில விநாடிகள்",m:"ஒரு நிமிடம்",mm:"%d நிமிடங்கள்",h:"ஒரு மணி நேரம்",hh:"%d மணி நேரம்",d:"ஒரு நாள்",dd:"%d நாட்கள்",M:"ஒரு மாதம்",MM:"%d மாதங்கள்",y:"ஒரு வருடம்",yy:"%d ஆண்டுகள்"},ordinalParse:/\d{1,2}வது/,ordinal:function(a){return a+"வது"},preparse:function(a){return a.replace(/[௧௨௩௪௫௬௭௮௯௦]/g,function(a){return ab[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return _a[a]})},meridiemParse:/யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/,meridiem:function(a,b,c){return 2>a?" யாமம்":6>a?" வைகறை":10>a?" காலை":14>a?" நண்பகல்":18>a?" எற்பாடு":22>a?" மாலை":" யாமம்"},meridiemHour:function(a,b){return 12===a&&(a=0),"யாமம்"===b?2>a?a:a+12:"வைகறை"===b||"காலை"===b?a:"நண்பகல்"===b&&a>=10?a:a+12},week:{dow:0,doy:6}}),a.defineLocale("te",{months:"జనవరి_ఫిబ్రవరి_మార్చి_ఏప్రిల్_మే_జూన్_జూలై_ఆగస్టు_సెప్టెంబర్_అక్టోబర్_నవంబర్_డిసెంబర్".split("_"),monthsShort:"జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జూలై_ఆగ._సెప్._అక్టో._నవ._డిసె.".split("_"),weekdays:"ఆదివారం_సోమవారం_మంగళవారం_బుధవారం_గురువారం_శుక్రవారం_శనివారం".split("_"),weekdaysShort:"ఆది_సోమ_మంగళ_బుధ_గురు_శుక్ర_శని".split("_"),weekdaysMin:"ఆ_సో_మం_బు_గు_శు_శ".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[నేడు] LT",nextDay:"[రేపు] LT",nextWeek:"dddd, LT",lastDay:"[నిన్న] LT",lastWeek:"[గత] dddd, LT",sameElse:"L"},relativeTime:{future:"%s లో",past:"%s క్రితం",s:"కొన్ని క్షణాలు",m:"ఒక నిమిషం",mm:"%d నిమిషాలు",h:"ఒక గంట",hh:"%d గంటలు",d:"ఒక రోజు",dd:"%d రోజులు",M:"ఒక నెల",MM:"%d నెలలు",y:"ఒక సంవత్సరం",yy:"%d సంవత్సరాలు"},ordinalParse:/\d{1,2}వ/,ordinal:"%dవ",meridiemParse:/రాత్రి|ఉదయం|మధ్యాహ్నం|సాయంత్రం/,meridiemHour:function(a,b){return 12===a&&(a=0),"రాత్రి"===b?4>a?a:a+12:"ఉదయం"===b?a:"మధ్యాహ్నం"===b?a>=10?a:a+12:"సాయంత్రం"===b?a+12:void 0},meridiem:function(a,b,c){return 4>a?"రాత్రి":10>a?"ఉదయం":17>a?"మధ్యాహ్నం":20>a?"సాయంత్రం":"రాత్రి"},week:{dow:0,doy:6}}),a.defineLocale("th",{months:"มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม".split("_"),monthsShort:"มกรา_กุมภา_มีนา_เมษา_พฤษภา_มิถุนา_กรกฎา_สิงหา_กันยา_ตุลา_พฤศจิกา_ธันวา".split("_"),weekdays:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์".split("_"),weekdaysShort:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์".split("_"),weekdaysMin:"อา._จ._อ._พ._พฤ._ศ._ส.".split("_"),longDateFormat:{LT:"H นาฬิกา m นาที",LTS:"H นาฬิกา m นาที s วินาที",L:"YYYY/MM/DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY เวลา H นาฬิกา m นาที",LLLL:"วันddddที่ D MMMM YYYY เวลา H นาฬิกา m นาที"},meridiemParse:/ก่อนเที่ยง|หลังเที่ยง/,isPM:function(a){return"หลังเที่ยง"===a},meridiem:function(a,b,c){return 12>a?"ก่อนเที่ยง":"หลังเที่ยง"},calendar:{sameDay:"[วันนี้ เวลา] LT",nextDay:"[พรุ่งนี้ เวลา] LT",nextWeek:"dddd[หน้า เวลา] LT",lastDay:"[เมื่อวานนี้ เวลา] LT",lastWeek:"[วัน]dddd[ที่แล้ว เวลา] LT",sameElse:"L"},relativeTime:{future:"อีก %s",past:"%sที่แล้ว",s:"ไม่กี่วินาที",m:"1 นาที",mm:"%d นาที",h:"1 ชั่วโมง",hh:"%d ชั่วโมง",d:"1 วัน",dd:"%d วัน",M:"1 เดือน",MM:"%d เดือน",y:"1 ปี",yy:"%d ปี"}}),a.defineLocale("tl-ph",{months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},calendar:{sameDay:"[Ngayon sa] LT",nextDay:"[Bukas sa] LT",nextWeek:"dddd [sa] LT",lastDay:"[Kahapon sa] LT",lastWeek:"dddd [huling linggo] LT",sameElse:"L"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"},ordinalParse:/\d{1,2}/,ordinal:function(a){return a},week:{dow:1,doy:4}}),"pagh_wa’_cha’_wej_loS_vagh_jav_Soch_chorgh_Hut".split("_")),cb=(a.defineLocale("tlh",{months:"tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’".split("_"),monthsShort:"jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’".split("_"),weekdays:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysShort:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysMin:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[DaHjaj] LT",nextDay:"[wa’leS] LT",nextWeek:"LLL",lastDay:"[wa’Hu’] LT",lastWeek:"LLL",sameElse:"L"},relativeTime:{future:S,past:T,s:"puS lup",m:"wa’ tup",mm:U,h:"wa’ rep",hh:U,d:"wa’ jaj",dd:U,M:"wa’ jar",MM:U,y:"wa’ DIS",yy:U},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),{1:"'inci",5:"'inci",8:"'inci",70:"'inci",80:"'inci",2:"'nci",7:"'nci",20:"'nci",50:"'nci",3:"'üncü",4:"'üncü",100:"'üncü",6:"'ncı",9:"'uncu",10:"'uncu",30:"'uncu",60:"'ıncı",90:"'ıncı"});a.defineLocale("tr",{months:"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),monthsShort:"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),weekdays:"Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"),weekdaysMin:"Pz_Pt_Sa_Ça_Pe_Cu_Ct".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[yarın saat] LT",nextWeek:"[haftaya] dddd [saat] LT",lastDay:"[dün] LT",lastWeek:"[geçen hafta] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s önce",s:"birkaç saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ordinalParse:/\d{1,2}'(inci|nci|üncü|ncı|uncu|ıncı)/,ordinal:function(a){if(0===a)return a+"'ıncı";var b=a%10,c=a%100-b,d=a>=100?100:null;return a+(cb[b]||cb[c]||cb[d])},week:{dow:1,doy:7}}),a.defineLocale("tzl",{months:"Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar".split("_"),monthsShort:"Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec".split("_"),weekdays:"Súladi_Lúneçi_Maitzi_Márcuri_Xhúadi_Viénerçi_Sáturi".split("_"),weekdaysShort:"Súl_Lún_Mai_Már_Xhú_Vié_Sát".split("_"),weekdaysMin:"Sú_Lú_Ma_Má_Xh_Vi_Sá".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"D. MMMM [dallas] YYYY",LLL:"D. MMMM [dallas] YYYY HH.mm",LLLL:"dddd, [li] D. MMMM [dallas] YYYY HH.mm"},meridiemParse:/d\'o|d\'a/i,isPM:function(a){return"d'o"===a.toLowerCase()},meridiem:function(a,b,c){return a>11?c?"d'o":"D'O":c?"d'a":"D'A"},calendar:{sameDay:"[oxhi à] LT",nextDay:"[demà à] LT",nextWeek:"dddd [à] LT",lastDay:"[ieiri à] LT",lastWeek:"[sür el] dddd [lasteu à] LT",sameElse:"L"},relativeTime:{future:"osprei %s",past:"ja%s",s:W,m:W,mm:W,h:W,hh:W,d:W,dd:W,M:W,MM:W,y:W,yy:W},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),a.defineLocale("tzm-latn",{months:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),monthsShort:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),weekdays:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysShort:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysMin:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[asdkh g] LT",nextDay:"[aska g] LT",nextWeek:"dddd [g] LT",lastDay:"[assant g] LT",lastWeek:"dddd [g] LT",sameElse:"L"},relativeTime:{future:"dadkh s yan %s",past:"yan %s",s:"imik",m:"minuḍ",mm:"%d minuḍ",h:"saɛa",hh:"%d tassaɛin",d:"ass",dd:"%d ossan",M:"ayowr",MM:"%d iyyirn",y:"asgas",yy:"%d isgasn"},week:{dow:6,doy:12}}),a.defineLocale("tzm",{months:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),monthsShort:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),weekdays:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysShort:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysMin:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ⴰⵙⴷⵅ ⴴ] LT",nextDay:"[ⴰⵙⴽⴰ ⴴ] LT",nextWeek:"dddd [ⴴ] LT",lastDay:"[ⴰⵚⴰⵏⵜ ⴴ] LT",lastWeek:"dddd [ⴴ] LT",sameElse:"L"},relativeTime:{future:"ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s",past:"ⵢⴰⵏ %s",s:"ⵉⵎⵉⴽ",m:"ⵎⵉⵏⵓⴺ",mm:"%d ⵎⵉⵏⵓⴺ",h:"ⵙⴰⵄⴰ",hh:"%d ⵜⴰⵙⵙⴰⵄⵉⵏ",d:"ⴰⵙⵙ",dd:"%d oⵙⵙⴰⵏ",M:"ⴰⵢoⵓⵔ",MM:"%d ⵉⵢⵢⵉⵔⵏ",y:"ⴰⵙⴳⴰⵙ",yy:"%d ⵉⵙⴳⴰⵙⵏ"},week:{dow:6,doy:12}}),a.defineLocale("uk",{months:{format:"січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня".split("_"),standalone:"січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень".split("_")},monthsShort:"січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд".split("_"),weekdays:Z,weekdaysShort:"нд_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY р.",LLL:"D MMMM YYYY р., HH:mm",LLLL:"dddd, D MMMM YYYY р., HH:mm"},calendar:{sameDay:$("[Сьогодні "),nextDay:$("[Завтра "),lastDay:$("[Вчора "),nextWeek:$("[У] dddd ["),lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return $("[Минулої] dddd [").call(this);case 1:case 2:case 4:return $("[Минулого] dddd [").call(this)}},sameElse:"L"},relativeTime:{future:"за %s",past:"%s тому",s:"декілька секунд",m:Y,mm:Y,h:"годину",hh:Y,d:"день",dd:Y,M:"місяць",MM:Y,y:"рік",yy:Y},meridiemParse:/ночі|ранку|дня|вечора/,isPM:function(a){return/^(дня|вечора)$/.test(a)},meridiem:function(a,b,c){return 4>a?"ночі":12>a?"ранку":17>a?"дня":"вечора"},ordinalParse:/\d{1,2}-(й|го)/,ordinal:function(a,b){switch(b){case"M":case"d":case"DDD":case"w":case"W":return a+"-й";case"D":return a+"-го";default:return a}},week:{dow:1,doy:7}}),a.defineLocale("uz",{months:"январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр".split("_"),monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба".split("_"),weekdaysShort:"Якш_Душ_Сеш_Чор_Пай_Жум_Шан".split("_"),weekdaysMin:"Як_Ду_Се_Чо_Па_Жу_Ша".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},calendar:{sameDay:"[Бугун соат] LT [да]",nextDay:"[Эртага] LT [да]",nextWeek:"dddd [куни соат] LT [да]",lastDay:"[Кеча соат] LT [да]",lastWeek:"[Утган] dddd [куни соат] LT [да]",sameElse:"L"},relativeTime:{future:"Якин %s ичида",past:"Бир неча %s олдин",s:"фурсат",m:"бир дакика",mm:"%d дакика",h:"бир соат",hh:"%d соат",d:"бир кун",dd:"%d кун",M:"бир ой",MM:"%d ой",y:"бир йил",yy:"%d йил"},week:{dow:1,doy:7}}),a.defineLocale("vi",{months:"tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12".split("_"),monthsShort:"Th01_Th02_Th03_Th04_Th05_Th06_Th07_Th08_Th09_Th10_Th11_Th12".split("_"),weekdays:"chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy".split("_"),weekdaysShort:"CN_T2_T3_T4_T5_T6_T7".split("_"),weekdaysMin:"CN_T2_T3_T4_T5_T6_T7".split("_"),meridiemParse:/sa|ch/i,isPM:function(a){return/^ch$/i.test(a)},meridiem:function(a,b,c){return 12>a?c?"sa":"SA":c?"ch":"CH"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [năm] YYYY",LLL:"D MMMM [năm] YYYY HH:mm",LLLL:"dddd, D MMMM [năm] YYYY HH:mm",l:"DD/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[Hôm nay lúc] LT",nextDay:"[Ngày mai lúc] LT",nextWeek:"dddd [tuần tới lúc] LT",lastDay:"[Hôm qua lúc] LT",lastWeek:"dddd [tuần rồi lúc] LT",sameElse:"L"},relativeTime:{future:"%s tới",past:"%s trước",s:"vài giây",m:"một phút",mm:"%d phút",h:"một giờ",hh:"%d giờ",d:"một ngày",dd:"%d ngày",M:"một tháng",MM:"%d tháng",y:"một năm",yy:"%d năm"},ordinalParse:/\d{1,2}/,ordinal:function(a){return a},week:{dow:1,doy:4}}),a.defineLocale("zh-cn",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"Ah点mm分",LTS:"Ah点m分s秒",L:"YYYY-MM-DD",LL:"YYYY年MMMD日",LLL:"YYYY年MMMD日Ah点mm分",LLLL:"YYYY年MMMD日ddddAh点mm分",l:"YYYY-MM-DD",ll:"YYYY年MMMD日",lll:"YYYY年MMMD日Ah点mm分",llll:"YYYY年MMMD日ddddAh点mm分"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(a,b){return 12===a&&(a=0),"凌晨"===b||"早上"===b||"上午"===b?a:"下午"===b||"晚上"===b?a+12:a>=11?a:a+12},meridiem:function(a,b,c){var d=100*a+b;return 600>d?"凌晨":900>d?"早上":1130>d?"上午":1230>d?"中午":1800>d?"下午":"晚上"},calendar:{sameDay:function(){return 0===this.minutes()?"[今天]Ah[点整]":"[今天]LT"},nextDay:function(){return 0===this.minutes()?"[明天]Ah[点整]":"[明天]LT"},lastDay:function(){return 0===this.minutes()?"[昨天]Ah[点整]":"[昨天]LT"},nextWeek:function(){var b,c;return b=a().startOf("week"),c=this.unix()-b.unix()>=604800?"[下]":"[本]",0===this.minutes()?c+"dddAh点整":c+"dddAh点mm"},lastWeek:function(){var b,c;return b=a().startOf("week"),c=this.unix()=11?a:a+12:"下午"===b||"晚上"===b?a+12:void 0},meridiem:function(a,b,c){var d=100*a+b;return 900>d?"早上":1130>d?"上午":1230>d?"中午":1800>d?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:"[下]ddddLT",lastDay:"[昨天]LT",lastWeek:"[上]ddddLT",sameElse:"L"},ordinalParse:/\d{1,2}(日|月|週)/,ordinal:function(a,b){switch(b){case"d":case"D":case"DDD":return a+"日";case"M":return a+"月";case"w":case"W":return a+"週";default:return a}},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",m:"一分鐘",mm:"%d分鐘",h:"一小時",hh:"%d小時",d:"一天",dd:"%d天",M:"一個月",MM:"%d個月",y:"一年",yy:"%d年"}});a.locale("en")}); \ No newline at end of file diff --git a/bower_components/moment/min/moment-with-locales.js b/bower_components/moment/min/moment-with-locales.js index 411d8c7..745df8b 100644 --- a/bower_components/moment/min/moment-with-locales.js +++ b/bower_components/moment/min/moment-with-locales.js @@ -17,7 +17,7 @@ } function isArray(input) { - return Object.prototype.toString.call(input) === '[object Array]'; + return input instanceof Array || Object.prototype.toString.call(input) === '[object Array]'; } function isDate(input) { @@ -223,7 +223,82 @@ return diffs + lengthDiff; } - function Locale() { + 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 + '\nArguments: ' + Array.prototype.slice.call(arguments).join(', ') + '\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; + + function isFunction(input) { + return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]'; + } + + function isObject(input) { + return Object.prototype.toString.call(input) === '[object Object]'; + } + + function locale_set__set (config) { + var prop, i; + for (i in config) { + prop = config[i]; + if (isFunction(prop)) { + this[i] = prop; + } else { + this['_' + i] = prop; + } + } + this._config = config; + // 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); + } + + function mergeConfigs(parentConfig, childConfig) { + var res = extend({}, parentConfig), prop; + for (prop in childConfig) { + if (hasOwnProp(childConfig, prop)) { + if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) { + res[prop] = {}; + extend(res[prop], parentConfig[prop]); + extend(res[prop], childConfig[prop]); + } else if (childConfig[prop] != null) { + res[prop] = childConfig[prop]; + } else { + delete res[prop]; + } + } + } + return res; + } + + function Locale(config) { + if (config != null) { + this.set(config); + } } // internal storage for locale config files @@ -299,11 +374,25 @@ return globalLocale._abbr; } - function defineLocale (name, values) { - if (values !== null) { - values.abbr = name; - locales[name] = locales[name] || new Locale(); - locales[name].set(values); + function defineLocale (name, config) { + if (config !== null) { + config.abbr = name; + if (locales[name] != null) { + deprecateSimple('defineLocaleOverride', + 'use moment.updateLocale(localeName, config) to change ' + + 'an existing locale. moment.defineLocale(localeName, ' + + 'config) should only be used for creating a new locale'); + config = mergeConfigs(locales[name]._config, config); + } else if (config.parentLocale != null) { + if (locales[config.parentLocale] != null) { + config = mergeConfigs(locales[config.parentLocale]._config, config); + } else { + // treat as if there is no base config + deprecateSimple('parentLocaleUndefined', + 'specified parentLocale is not defined yet'); + } + } + locales[name] = new Locale(config); // backwards compat for now: also set the locale locale_locales__getSetGlobalLocale(name); @@ -316,6 +405,31 @@ } } + function updateLocale(name, config) { + if (config != null) { + var locale; + if (locales[name] != null) { + config = mergeConfigs(locales[name]._config, config); + } + locale = new Locale(config); + locale.parentLocale = locales[name]; + locales[name] = locale; + + // backwards compat for now: also set the locale + locale_locales__getSetGlobalLocale(name); + } else { + // pass null for config to unupdate, useful for tests + if (locales[name] != null) { + if (locales[name].parentLocale != null) { + locales[name] = locales[name].parentLocale; + } else if (locales[name] != null) { + delete locales[name]; + } + } + } + return locales[name]; + } + // returns locale data function locale_locales__getLocale (key) { var locale; @@ -340,6 +454,10 @@ return chooseLocale(key); } + function locale_locales__listLocales() { + return Object.keys(locales); + } + var aliases = {}; function addUnitAlias (unit, shorthand) { @@ -368,10 +486,6 @@ return normalizedInput; } - function isFunction(input) { - return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]'; - } - function makeGetSet (unit, keepTime) { return function (value) { if (value != null) { @@ -705,12 +819,15 @@ return mom; } - // 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; + if (/^\d+$/.test(value)) { + value = toInt(value); + } else { + value = mom.localeData().monthsParse(value); + // TODO: Another silent failure? + if (typeof value !== 'number') { + return mom; + } } } @@ -829,36 +946,6 @@ 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 + '\nArguments: ' + Array.prototype.slice.call(arguments).join(', ') + '\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; - // iso 8601 regex // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00) var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/; @@ -1504,7 +1591,7 @@ } var prototypeMin = deprecate( - 'moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548', + 'moment().min is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548', function () { var other = local__createLocal.apply(null, arguments); if (this.isValid() && other.isValid()) { @@ -1516,7 +1603,7 @@ ); var prototypeMax = deprecate( - 'moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548', + 'moment().max is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548', function () { var other = local__createLocal.apply(null, arguments); if (this.isValid() && other.isValid()) { @@ -1814,7 +1901,8 @@ // 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 isoRegex = /^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/; + // and further modified to allow for strings containing both week and day + var isoRegex = /^(-)?P(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)W)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?$/; function create__createDuration (input, key) { var duration = input, @@ -1852,11 +1940,11 @@ 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) + w : parseIso(match[4], sign), + d : parseIso(match[5], sign), + h : parseIso(match[6], sign), + m : parseIso(match[7], sign), + s : parseIso(match[8], sign) }; } else if (duration == null) {// checks for null or undefined duration = {}; @@ -1920,6 +2008,14 @@ return res; } + function absRound (number) { + if (number < 0) { + return Math.round(-1 * number) * -1; + } else { + return Math.round(number); + } + } + // TODO: remove 'name' arg after deprecation is removed function createAdder(direction, name) { return function (val, period) { @@ -1939,8 +2035,8 @@ function add_subtract__addSubtract (mom, duration, isAdding, updateOffset) { var milliseconds = duration._milliseconds, - days = duration._days, - months = duration._months; + days = absRound(duration._days), + months = absRound(duration._months); if (!mom.isValid()) { // No op @@ -2266,8 +2362,8 @@ } function toJSON () { - // JSON.stringify(new Date(NaN)) === 'null' - return this.isValid() ? this.toISOString() : 'null'; + // new Date(NaN).toJSON() === null + return this.isValid() ? this.toISOString() : null; } function moment_valid__isValid () { @@ -2377,7 +2473,6 @@ var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy), date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear); - // console.log("got", weekYear, week, weekday, "set", date.toISOString()); this.year(date.getUTCFullYear()); this.month(date.getUTCMonth()); this.date(date.getUTCDate()); @@ -3087,21 +3182,6 @@ return isFunction(format) ? format(output) : format.replace(/%s/i, output); } - function locale_set__set (config) { - var prop, i; - for (i in config) { - prop = config[i]; - if (isFunction(prop)) { - 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; @@ -3567,12 +3647,12 @@ ; //! moment.js - //! version : 2.11.2 + //! version : 2.12.0 //! authors : Tim Wood, Iskren Chernev, Moment.js contributors //! license : MIT //! momentjs.com - utils_hooks__hooks.version = '2.11.2'; + utils_hooks__hooks.version = '2.12.0'; setHookCallback(local__createLocal); @@ -3595,6 +3675,8 @@ utils_hooks__hooks.monthsShort = lists__listMonthsShort; utils_hooks__hooks.weekdaysMin = lists__listWeekdaysMin; utils_hooks__hooks.defineLocale = defineLocale; + utils_hooks__hooks.updateLocale = updateLocale; + utils_hooks__hooks.locales = locale_locales__listLocales; utils_hooks__hooks.weekdaysShort = lists__listWeekdaysShort; utils_hooks__hooks.normalizeUnits = normalizeUnits; utils_hooks__hooks.relativeTimeThreshold = duration_humanize__getSetRelativeTimeThreshold; @@ -4347,12 +4429,18 @@ }); }, meridiemParse: /রাত|সকাল|দুপুর|বিকাল|রাত/, - isPM: function (input) { - return /^(দুপুর|বিকাল|রাত)$/.test(input); + meridiemHour : function (hour, meridiem) { + if (hour === 12) { + hour = 0; + } + if ((meridiem === 'রাত' && hour >= 4) || + (meridiem === 'দুপুর' && hour < 5) || + meridiem === 'বিকাল') { + return hour + 12; + } else { + return hour; + } }, - //Bengali is a vast language its spoken - //in different forms in various parts of the world. - //I have just generalized with most common one used meridiem : function (hour, minute, isLower) { if (hour < 4) { return 'রাত'; @@ -4449,8 +4537,17 @@ }); }, meridiemParse: /མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/, - isPM: function (input) { - return /^(ཉིན་གུང|དགོང་དག|མཚན་མོ)$/.test(input); + meridiemHour : function (hour, meridiem) { + if (hour === 12) { + hour = 0; + } + if ((meridiem === 'མཚན་མོ' && hour >= 4) || + (meridiem === 'ཉིན་གུང' && hour < 5) || + meridiem === 'དགོང་དག') { + return hour + 12; + } else { + return hour; + } }, meridiem : function (hour, minute, isLower) { if (hour < 4) { @@ -5269,7 +5366,7 @@ }, meridiemParse: /މކ|މފ/, isPM : function (input) { - return '' === input; + return 'މފ' === input; }, meridiem : function (hour, minute, isLower) { if (hour < 12) { @@ -5465,9 +5562,9 @@ LT : 'h:mm A', LTS : 'h:mm:ss A', L : 'YYYY-MM-DD', - LL : 'D MMMM, YYYY', - LLL : 'D MMMM, YYYY h:mm A', - LLLL : 'dddd, D MMMM, YYYY h:mm A' + LL : 'MMMM D, YYYY', + LLL : 'MMMM D, YYYY h:mm A', + LLLL : 'dddd, MMMM D, YYYY h:mm A' }, calendar : { sameDay : '[Today at] LT', @@ -6567,6 +6664,23 @@ } return number + ' שנים'; } + }, + meridiemParse: /אחה"צ|לפנה"צ|אחרי הצהריים|לפני הצהריים|לפנות בוקר|בבוקר|בערב/i, + isPM : function (input) { + return /^(אחה"צ|אחרי הצהריים|בערב)$/.test(input); + }, + meridiem : function (hour, minute, isLower) { + if (hour < 5) { + return 'לפנות בוקר'; + } else if (hour < 10) { + return 'בבוקר'; + } else if (hour < 12) { + return isLower ? 'לפנה"צ' : 'לפני הצהריים'; + } else if (hour < 18) { + return isLower ? 'אחה"צ' : 'אחרי הצהריים'; + } else { + return 'בערב'; + } } }); @@ -7148,7 +7262,7 @@ longDateFormat : { LT : 'H:mm', LTS : 'H:mm:ss', - L : 'DD/MM/YYYY', + L : 'DD.MM.YYYY', LL : 'D. MMMM YYYY', LLL : 'D. MMMM YYYY [kl.] H:mm', LLLL : 'dddd, D. MMMM YYYY [kl.] H:mm' @@ -7280,6 +7394,17 @@ lastWeek : '[前週]dddd LT', sameElse : 'L' }, + ordinalParse : /\d{1,2}日/, + ordinal : function (number, period) { + switch (period) { + case 'd': + case 'D': + case 'DDD': + return number + '日'; + default: + return number; + } + }, relativeTime : { future : '%s後', past : '%s前', @@ -8216,8 +8341,17 @@ yy : '%d വർഷം' }, meridiemParse: /രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i, - isPM : function (input) { - return /^(ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി)$/.test(input); + meridiemHour : function (hour, meridiem) { + if (hour === 12) { + hour = 0; + } + if ((meridiem === 'രാത്രി' && hour >= 4) || + meridiem === 'ഉച്ച കഴിഞ്ഞ്' || + meridiem === 'വൈകുന്നേരം') { + return hour + 12; + } else { + return hour; + } }, meridiem : function (hour, minute, isLower) { if (hour < 4) { @@ -8874,6 +9008,119 @@ } }); + //! moment.js locale configuration + //! locale : punjabi india (pa-in) + //! author : Harpreet Singh : https://github.com/harpreetkhalsagtbit + + var pa_in__symbolMap = { + '1': '੧', + '2': '੨', + '3': '੩', + '4': '੪', + '5': '੫', + '6': '੬', + '7': '੭', + '8': '੮', + '9': '੯', + '0': '੦' + }, + pa_in__numberMap = { + '੧': '1', + '੨': '2', + '੩': '3', + '੪': '4', + '੫': '5', + '੬': '6', + '੭': '7', + '੮': '8', + '੯': '9', + '੦': '0' + }; + + var pa_in = moment__default.defineLocale('pa-in', { + // There are months name as per Nanakshahi Calender but they are not used as rigidly in modern Punjabi. + months : 'ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ'.split('_'), + monthsShort : 'ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ'.split('_'), + weekdays : 'ਐਤਵਾਰ_ਸੋਮਵਾਰ_ਮੰਗਲਵਾਰ_ਬੁਧਵਾਰ_ਵੀਰਵਾਰ_ਸ਼ੁੱਕਰਵਾਰ_ਸ਼ਨੀਚਰਵਾਰ'.split('_'), + weekdaysShort : 'ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ'.split('_'), + weekdaysMin : 'ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ'.split('_'), + longDateFormat : { + LT : 'A h:mm ਵਜੇ', + LTS : 'A h:mm:ss ਵਜੇ', + L : 'DD/MM/YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY, A h:mm ਵਜੇ', + LLLL : 'dddd, D MMMM YYYY, A h:mm ਵਜੇ' + }, + calendar : { + sameDay : '[ਅਜ] LT', + nextDay : '[ਕਲ] LT', + nextWeek : 'dddd, LT', + lastDay : '[ਕਲ] LT', + lastWeek : '[ਪਿਛਲੇ] dddd, LT', + sameElse : 'L' + }, + relativeTime : { + future : '%s ਵਿੱਚ', + past : '%s ਪਿਛਲੇ', + s : 'ਕੁਝ ਸਕਿੰਟ', + m : 'ਇਕ ਮਿੰਟ', + mm : '%d ਮਿੰਟ', + h : 'ਇੱਕ ਘੰਟਾ', + hh : '%d ਘੰਟੇ', + d : 'ਇੱਕ ਦਿਨ', + dd : '%d ਦਿਨ', + M : 'ਇੱਕ ਮਹੀਨਾ', + MM : '%d ਮਹੀਨੇ', + y : 'ਇੱਕ ਸਾਲ', + yy : '%d ਸਾਲ' + }, + preparse: function (string) { + return string.replace(/[੧੨੩੪੫੬੭੮੯੦]/g, function (match) { + return pa_in__numberMap[match]; + }); + }, + postformat: function (string) { + return string.replace(/\d/g, function (match) { + return pa_in__symbolMap[match]; + }); + }, + // Punjabi notation for meridiems are quite fuzzy in practice. While there exists + // a rigid notion of a 'Pahar' it is not used as rigidly in modern Punjabi. + meridiemParse: /ਰਾਤ|ਸਵੇਰ|ਦੁਪਹਿਰ|ਸ਼ਾਮ/, + meridiemHour : function (hour, meridiem) { + if (hour === 12) { + hour = 0; + } + if (meridiem === 'ਰਾਤ') { + return hour < 4 ? hour : hour + 12; + } else if (meridiem === 'ਸਵੇਰ') { + return hour; + } else if (meridiem === 'ਦੁਪਹਿਰ') { + return hour >= 10 ? hour : hour + 12; + } else if (meridiem === 'ਸ਼ਾਮ') { + return hour + 12; + } + }, + meridiem : function (hour, minute, isLower) { + if (hour < 4) { + return 'ਰਾਤ'; + } else if (hour < 10) { + return 'ਸਵੇਰ'; + } else if (hour < 17) { + return 'ਦੁਪਹਿਰ'; + } else if (hour < 20) { + return 'ਸ਼ਾਮ'; + } else { + return 'ਰਾਤ'; + } + }, + week : { + 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. + } + }); + //! moment.js locale configuration //! locale : polish (pl) //! author : Rafal Hirsz : https://github.com/evoL @@ -8975,7 +9222,7 @@ var pt_br = moment__default.defineLocale('pt-br', { months : 'Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro'.split('_'), monthsShort : 'Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez'.split('_'), - weekdays : 'Domingo_Segunda-Feira_Terça-Feira_Quarta-Feira_Quinta-Feira_Sexta-Feira_Sábado'.split('_'), + weekdays : 'Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado'.split('_'), weekdaysShort : 'Dom_Seg_Ter_Qua_Qui_Sex_Sáb'.split('_'), weekdaysMin : 'Dom_2ª_3ª_4ª_5ª_6ª_Sáb'.split('_'), longDateFormat : { @@ -9137,6 +9384,7 @@ //! locale : russian (ru) //! author : Viktorminator : https://github.com/Viktorminator //! Author : Menelion Elensúle : https://github.com/Oire + //! author : Коренберг Марк : https://github.com/socketpair function ru__plural(word, num) { var forms = word.split('_'); @@ -9159,22 +9407,23 @@ } var monthsParse = [/^янв/i, /^фев/i, /^мар/i, /^апр/i, /^ма[й|я]/i, /^июн/i, /^июл/i, /^авг/i, /^сен/i, /^окт/i, /^ноя/i, /^дек/i]; + // http://new.gramota.ru/spravka/rules/139-prop : § 103 var ru = moment__default.defineLocale('ru', { months : { - format: 'Января_Февраля_Марта_Апреля_Мая_Июня_Июля_Августа_Сентября_Октября_Ноября_Декабря'.split('_'), - standalone: 'Январь_Февраль_Март_Апрель_Май_Июнь_Июль_Август_Сентябрь_Октябрь_Ноябрь_Декабрь'.split('_') + format: 'января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря'.split('_'), + standalone: 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_') }, monthsShort : { format: 'янв_фев_мар_апр_мая_июня_июля_авг_сен_окт_ноя_дек'.split('_'), standalone: 'янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек'.split('_') }, weekdays : { - standalone: 'Воскресенье_Понедельник_Вторник_Среда_Четверг_Пятница_Суббота'.split('_'), - format: 'Воскресенье_Понедельник_Вторник_Среду_Четверг_Пятницу_Субботу'.split('_'), + standalone: 'воскресенье_понедельник_вторник_среда_четверг_пятница_суббота'.split('_'), + format: 'воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу'.split('_'), isFormat: /\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?\] ?dddd/ }, - weekdaysShort : 'Вс_Пн_Вт_Ср_Чт_Пт_Сб'.split('_'), - weekdaysMin : 'Вс_Пн_Вт_Ср_Чт_Пт_Сб'.split('_'), + weekdaysShort : 'вс_пн_вт_ср_чт_пт_сб'.split('_'), + weekdaysMin : 'вс_пн_вт_ср_чт_пт_сб'.split('_'), monthsParse : monthsParse, longMonthsParse : monthsParse, shortMonthsParse : monthsParse, @@ -9384,6 +9633,10 @@ ordinal : function (number) { return number + ' වැනි'; }, + meridiemParse : /පෙර වරු|පස් වරු|පෙ.ව|ප.ව./, + isPM : function (input) { + return input === 'ප.ව.' || input === 'පස් වරු'; + }, meridiem : function (hours, minutes, isLower) { if (hours > 11) { return isLower ? 'ප.ව.' : 'පස් වරු'; @@ -10544,6 +10797,10 @@ LLL : 'D. MMMM [dallas] YYYY HH.mm', LLLL : 'dddd, [li] D. MMMM [dallas] YYYY HH.mm' }, + meridiemParse: /d\'o|d\'a/i, + isPM : function (input) { + return 'd\'o' === input.toLowerCase(); + }, meridiem : function (hours, minutes, isLower) { if (hours > 11) { return isLower ? 'd\'o' : 'D\'O'; @@ -10885,6 +11142,17 @@ weekdays : 'chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy'.split('_'), weekdaysShort : 'CN_T2_T3_T4_T5_T6_T7'.split('_'), weekdaysMin : 'CN_T2_T3_T4_T5_T6_T7'.split('_'), + meridiemParse: /sa|ch/i, + isPM : function (input) { + return /^ch$/i.test(input); + }, + meridiem : function (hours, minutes, isLower) { + if (hours < 12) { + return isLower ? 'sa' : 'SA'; + } else { + return isLower ? 'ch' : 'CH'; + } + }, longDateFormat : { LT : 'HH:mm', LTS : 'HH:mm:ss', diff --git a/bower_components/moment/min/moment-with-locales.min.js b/bower_components/moment/min/moment-with-locales.min.js index 75677d1..d2dc0ef 100644 --- a/bower_components/moment/min/moment-with-locales.min.js +++ b/bower_components/moment/min/moment-with-locales.min.js @@ -1,74 +1,75 @@ -!function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):a.moment=b()}(this,function(){"use strict";function a(){return Rd.apply(null,arguments)}function b(a){Rd=a}function c(a){return"[object Array]"===Object.prototype.toString.call(a)}function d(a){return a instanceof Date||"[object Date]"===Object.prototype.toString.call(a)}function e(a,b){var c,d=[];for(c=0;c0)for(c in Td)d=Td[c],e=b[d],m(e)||(a[d]=e);return a}function o(b){n(this,b),this._d=new Date(null!=b._d?b._d.getTime():NaN),Ud===!1&&(Ud=!0,a.updateOffset(this),Ud=!1)}function p(a){return a instanceof o||null!=a&&null!=a._isAMomentObject}function q(a){return 0>a?Math.ceil(a):Math.floor(a)}function r(a){var b=+a,c=0;return 0!==b&&isFinite(b)&&(c=q(b)),c}function s(a,b,c){var d,e=Math.min(a.length,b.length),f=Math.abs(a.length-b.length),g=0;for(d=0;e>d;d++)(c&&a[d]!==b[d]||!c&&r(a[d])!==r(b[d]))&&g++;return g+f}function t(){}function u(a){return a?a.toLowerCase().replace("_","-"):a}function v(a){for(var b,c,d,e,f=0;f0;){if(d=w(e.slice(0,b).join("-")))return d;if(c&&c.length>=b&&s(e,c,!0)>=b-1)break;b--}f++}return null}function w(a){var b=null;if(!Vd[a]&&"undefined"!=typeof module&&module&&module.exports)try{b=Sd._abbr,require("./locale/"+a),x(b)}catch(c){}return Vd[a]}function x(a,b){var c;return a&&(c=m(b)?z(a):y(a,b),c&&(Sd=c)),Sd._abbr}function y(a,b){return null!==b?(b.abbr=a,Vd[a]=Vd[a]||new t,Vd[a].set(b),x(a),Vd[a]):(delete Vd[a],null)}function z(a){var b;if(a&&a._locale&&a._locale._abbr&&(a=a._locale._abbr),!a)return Sd;if(!c(a)){if(b=w(a))return b;a=[a]}return v(a)}function A(a,b){var c=a.toLowerCase();Wd[c]=Wd[c+"s"]=Wd[b]=a}function B(a){return"string"==typeof a?Wd[a]||Wd[a.toLowerCase()]:void 0}function C(a){var b,c,d={};for(c in a)f(a,c)&&(b=B(c),b&&(d[b]=a[c]));return d}function D(a){return a instanceof Function||"[object Function]"===Object.prototype.toString.call(a)}function E(b,c){return function(d){return null!=d?(G(this,b,d),a.updateOffset(this,c),this):F(this,b)}}function F(a,b){return a.isValid()?a._d["get"+(a._isUTC?"UTC":"")+b]():NaN}function G(a,b,c){a.isValid()&&a._d["set"+(a._isUTC?"UTC":"")+b](c)}function H(a,b){var c;if("object"==typeof a)for(c in a)this.set(c,a[c]);else if(a=B(a),D(this[a]))return this[a](b);return this}function I(a,b,c){var d=""+Math.abs(a),e=b-d.length,f=a>=0;return(f?c?"+":"":"-")+Math.pow(10,Math.max(0,e)).toString().substr(1)+d}function J(a,b,c,d){var e=d;"string"==typeof d&&(e=function(){return this[d]()}),a&&($d[a]=e),b&&($d[b[0]]=function(){return I(e.apply(this,arguments),b[1],b[2])}),c&&($d[c]=function(){return this.localeData().ordinal(e.apply(this,arguments),a)})}function K(a){return a.match(/\[[\s\S]/)?a.replace(/^\[|\]$/g,""):a.replace(/\\/g,"")}function L(a){var b,c,d=a.match(Xd);for(b=0,c=d.length;c>b;b++)$d[d[b]]?d[b]=$d[d[b]]:d[b]=K(d[b]);return function(e){var f="";for(b=0;c>b;b++)f+=d[b]instanceof Function?d[b].call(e,a):d[b];return f}}function M(a,b){return a.isValid()?(b=N(b,a.localeData()),Zd[b]=Zd[b]||L(b),Zd[b](a)):a.localeData().invalidDate()}function N(a,b){function c(a){return b.longDateFormat(a)||a}var d=5;for(Yd.lastIndex=0;d>=0&&Yd.test(a);)a=a.replace(Yd,c),Yd.lastIndex=0,d-=1;return a}function O(a,b,c){qe[a]=D(b)?b:function(a,d){return a&&c?c:b}}function P(a,b){return f(qe,a)?qe[a](b._strict,b._locale):new RegExp(Q(a))}function Q(a){return R(a.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(a,b,c,d,e){return b||c||d||e}))}function R(a){return a.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function S(a,b){var c,d=b;for("string"==typeof a&&(a=[a]),"number"==typeof b&&(d=function(a,c){c[b]=r(a)}),c=0;cd;d++){if(e=h([2e3,d]),c&&!this._longMonthsParse[d]&&(this._longMonthsParse[d]=new RegExp("^"+this.months(e,"").replace(".","")+"$","i"),this._shortMonthsParse[d]=new RegExp("^"+this.monthsShort(e,"").replace(".","")+"$","i")),c||this._monthsParse[d]||(f="^"+this.months(e,"")+"|^"+this.monthsShort(e,""),this._monthsParse[d]=new RegExp(f.replace(".",""),"i")),c&&"MMMM"===b&&this._longMonthsParse[d].test(a))return d;if(c&&"MMM"===b&&this._shortMonthsParse[d].test(a))return d;if(!c&&this._monthsParse[d].test(a))return d}}function Z(a,b){var c;return a.isValid()?"string"==typeof b&&(b=a.localeData().monthsParse(b),"number"!=typeof b)?a:(c=Math.min(a.date(),V(a.year(),b)),a._d["set"+(a._isUTC?"UTC":"")+"Month"](b,c),a):a}function $(b){return null!=b?(Z(this,b),a.updateOffset(this,!0),this):F(this,"Month")}function _(){return V(this.year(),this.month())}function aa(a){return this._monthsParseExact?(f(this,"_monthsRegex")||ca.call(this),a?this._monthsShortStrictRegex:this._monthsShortRegex):this._monthsShortStrictRegex&&a?this._monthsShortStrictRegex:this._monthsShortRegex}function ba(a){return this._monthsParseExact?(f(this,"_monthsRegex")||ca.call(this),a?this._monthsStrictRegex:this._monthsRegex):this._monthsStrictRegex&&a?this._monthsStrictRegex:this._monthsRegex}function ca(){function a(a,b){return b.length-a.length}var b,c,d=[],e=[],f=[];for(b=0;12>b;b++)c=h([2e3,b]),d.push(this.monthsShort(c,"")),e.push(this.months(c,"")),f.push(this.months(c,"")),f.push(this.monthsShort(c,""));for(d.sort(a),e.sort(a),f.sort(a),b=0;12>b;b++)d[b]=R(d[b]),e[b]=R(e[b]),f[b]=R(f[b]);this._monthsRegex=new RegExp("^("+f.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+e.join("|")+")$","i"),this._monthsShortStrictRegex=new RegExp("^("+d.join("|")+")$","i")}function da(a){var b,c=a._a;return c&&-2===j(a).overflow&&(b=c[te]<0||c[te]>11?te:c[ue]<1||c[ue]>V(c[se],c[te])?ue:c[ve]<0||c[ve]>24||24===c[ve]&&(0!==c[we]||0!==c[xe]||0!==c[ye])?ve:c[we]<0||c[we]>59?we:c[xe]<0||c[xe]>59?xe:c[ye]<0||c[ye]>999?ye:-1,j(a)._overflowDayOfYear&&(se>b||b>ue)&&(b=ue),j(a)._overflowWeeks&&-1===b&&(b=ze),j(a)._overflowWeekday&&-1===b&&(b=Ae),j(a).overflow=b),a}function ea(b){a.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+b)}function fa(a,b){var c=!0;return g(function(){return c&&(ea(a+"\nArguments: "+Array.prototype.slice.call(arguments).join(", ")+"\n"+(new Error).stack),c=!1),b.apply(this,arguments)},b)}function ga(a,b){Ge[a]||(ea(b),Ge[a]=!0)}function ha(a){var b,c,d,e,f,g,h=a._i,i=He.exec(h)||Ie.exec(h);if(i){for(j(a).iso=!0,b=0,c=Ke.length;c>b;b++)if(Ke[b][1].exec(i[1])){e=Ke[b][0],d=Ke[b][2]!==!1;break}if(null==e)return void(a._isValid=!1);if(i[3]){for(b=0,c=Le.length;c>b;b++)if(Le[b][1].exec(i[3])){f=(i[2]||" ")+Le[b][0];break}if(null==f)return void(a._isValid=!1)}if(!d&&null!=f)return void(a._isValid=!1);if(i[4]){if(!Je.exec(i[4]))return void(a._isValid=!1);g="Z"}a._f=e+(f||"")+(g||""),wa(a)}else a._isValid=!1}function ia(b){var c=Me.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(ha(b),void(b._isValid===!1&&(delete b._isValid,a.createFromInputFallback(b))))}function ja(a,b,c,d,e,f,g){var h=new Date(a,b,c,d,e,f,g);return 100>a&&a>=0&&isFinite(h.getFullYear())&&h.setFullYear(a),h}function ka(a){var b=new Date(Date.UTC.apply(null,arguments));return 100>a&&a>=0&&isFinite(b.getUTCFullYear())&&b.setUTCFullYear(a),b}function la(a){return ma(a)?366:365}function ma(a){return a%4===0&&a%100!==0||a%400===0}function na(){return ma(this.year())}function oa(a,b,c){var d=7+b-c,e=(7+ka(a,0,d).getUTCDay()-b)%7;return-e+d-1}function pa(a,b,c,d,e){var f,g,h=(7+c-d)%7,i=oa(a,d,e),j=1+7*(b-1)+h+i;return 0>=j?(f=a-1,g=la(f)+j):j>la(a)?(f=a+1,g=j-la(a)):(f=a,g=j),{year:f,dayOfYear:g}}function qa(a,b,c){var d,e,f=oa(a.year(),b,c),g=Math.floor((a.dayOfYear()-f-1)/7)+1;return 1>g?(e=a.year()-1,d=g+ra(e,b,c)):g>ra(a.year(),b,c)?(d=g-ra(a.year(),b,c),e=a.year()+1):(e=a.year(),d=g),{week:d,year:e}}function ra(a,b,c){var d=oa(a,b,c),e=oa(a+1,b,c);return(la(a)-d+e)/7}function sa(a,b,c){return null!=a?a:null!=b?b:c}function ta(b){var c=new Date(a.now());return b._useUTC?[c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()]:[c.getFullYear(),c.getMonth(),c.getDate()]}function ua(a){var b,c,d,e,f=[];if(!a._d){for(d=ta(a),a._w&&null==a._a[ue]&&null==a._a[te]&&va(a),a._dayOfYear&&(e=sa(a._a[se],d[se]),a._dayOfYear>la(e)&&(j(a)._overflowDayOfYear=!0),c=ka(e,0,a._dayOfYear),a._a[te]=c.getUTCMonth(),a._a[ue]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];for(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];24===a._a[ve]&&0===a._a[we]&&0===a._a[xe]&&0===a._a[ye]&&(a._nextDay=!0,a._a[ve]=0),a._d=(a._useUTC?ka:ja).apply(null,f),null!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[ve]=24)}}function va(a){var b,c,d,e,f,g,h,i;b=a._w,null!=b.GG||null!=b.W||null!=b.E?(f=1,g=4,c=sa(b.GG,a._a[se],qa(Ea(),1,4).year),d=sa(b.W,1),e=sa(b.E,1),(1>e||e>7)&&(i=!0)):(f=a._locale._week.dow,g=a._locale._week.doy,c=sa(b.gg,a._a[se],qa(Ea(),f,g).year),d=sa(b.w,1),null!=b.d?(e=b.d,(0>e||e>6)&&(i=!0)):null!=b.e?(e=b.e+f,(b.e<0||b.e>6)&&(i=!0)):e=f),1>d||d>ra(c,f,g)?j(a)._overflowWeeks=!0:null!=i?j(a)._overflowWeekday=!0:(h=pa(c,d,e,f,g),a._a[se]=h.year,a._dayOfYear=h.dayOfYear)}function wa(b){if(b._f===a.ISO_8601)return void ha(b);b._a=[],j(b).empty=!0;var c,d,e,f,g,h=""+b._i,i=h.length,k=0;for(e=N(b._f,b._locale).match(Xd)||[],c=0;c0&&j(b).unusedInput.push(g),h=h.slice(h.indexOf(d)+d.length),k+=d.length),$d[f]?(d?j(b).empty=!1:j(b).unusedTokens.push(f),U(f,d,b)):b._strict&&!d&&j(b).unusedTokens.push(f);j(b).charsLeftOver=i-k,h.length>0&&j(b).unusedInput.push(h),j(b).bigHour===!0&&b._a[ve]<=12&&b._a[ve]>0&&(j(b).bigHour=void 0),b._a[ve]=xa(b._locale,b._a[ve],b._meridiem),ua(b),da(b)}function xa(a,b,c){var d;return null==c?b:null!=a.meridiemHour?a.meridiemHour(b,c):null!=a.isPM?(d=a.isPM(c),d&&12>b&&(b+=12),d||12!==b||(b=0),b):b}function ya(a){var b,c,d,e,f;if(0===a._f.length)return j(a).invalidFormat=!0,void(a._d=new Date(NaN));for(e=0;ef)&&(d=f,c=b));g(a,c||b)}function za(a){if(!a._d){var b=C(a._i);a._a=e([b.year,b.month,b.day||b.date,b.hour,b.minute,b.second,b.millisecond],function(a){return a&&parseInt(a,10)}),ua(a)}}function Aa(a){var b=new o(da(Ba(a)));return b._nextDay&&(b.add(1,"d"),b._nextDay=void 0),b}function Ba(a){var b=a._i,e=a._f;return a._locale=a._locale||z(a._l),null===b||void 0===e&&""===b?l({nullInput:!0}):("string"==typeof b&&(a._i=b=a._locale.preparse(b)),p(b)?new o(da(b)):(c(e)?ya(a):e?wa(a):d(b)?a._d=b:Ca(a),k(a)||(a._d=null),a))}function Ca(b){var f=b._i;void 0===f?b._d=new Date(a.now()):d(f)?b._d=new Date(+f):"string"==typeof f?ia(b):c(f)?(b._a=e(f.slice(0),function(a){return parseInt(a,10)}),ua(b)):"object"==typeof f?za(b):"number"==typeof f?b._d=new Date(f):a.createFromInputFallback(b)}function Da(a,b,c,d,e){var f={};return"boolean"==typeof c&&(d=c,c=void 0),f._isAMomentObject=!0,f._useUTC=f._isUTC=e,f._l=c,f._i=a,f._f=b,f._strict=d,Aa(f)}function Ea(a,b,c,d){return Da(a,b,c,d,!1)}function Fa(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return Ea();for(d=b[0],e=1;ea&&(a=-a,c="-"),c+I(~~(a/60),2)+b+I(~~a%60,2)})}function La(a,b){var c=(b||"").match(a)||[],d=c[c.length-1]||[],e=(d+"").match(Re)||["-",0,0],f=+(60*e[1])+r(e[2]);return"+"===e[0]?f:-f}function Ma(b,c){var e,f;return c._isUTC?(e=c.clone(),f=(p(b)||d(b)?+b:+Ea(b))-+e,e._d.setTime(+e._d+f),a.updateOffset(e,!1),e):Ea(b).local()}function Na(a){return 15*-Math.round(a._d.getTimezoneOffset()/15)}function Oa(b,c){var d,e=this._offset||0;return this.isValid()?null!=b?("string"==typeof b?b=La(ne,b):Math.abs(b)<16&&(b=60*b),!this._isUTC&&c&&(d=Na(this)),this._offset=b,this._isUTC=!0,null!=d&&this.add(d,"m"),e!==b&&(!c||this._changeInProgress?cb(this,Za(b-e,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,a.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?e:Na(this):null!=b?this:NaN}function Pa(a,b){return null!=a?("string"!=typeof a&&(a=-a),this.utcOffset(a,b),this):-this.utcOffset()}function Qa(a){return this.utcOffset(0,a)}function Ra(a){return this._isUTC&&(this.utcOffset(0,a),this._isUTC=!1,a&&this.subtract(Na(this),"m")),this}function Sa(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(La(me,this._i)),this}function Ta(a){return this.isValid()?(a=a?Ea(a).utcOffset():0,(this.utcOffset()-a)%60===0):!1}function Ua(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Va(){if(!m(this._isDSTShifted))return this._isDSTShifted;var a={};if(n(a,this),a=Ba(a),a._a){var b=a._isUTC?h(a._a):Ea(a._a);this._isDSTShifted=this.isValid()&&s(a._a,b.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function Wa(){return this.isValid()?!this._isUTC:!1}function Xa(){return this.isValid()?this._isUTC:!1}function Ya(){return this.isValid()?this._isUTC&&0===this._offset:!1}function Za(a,b){var c,d,e,g=a,h=null;return Ja(a)?g={ms:a._milliseconds,d:a._days,M:a._months}:"number"==typeof a?(g={},b?g[b]=a:g.milliseconds=a):(h=Se.exec(a))?(c="-"===h[1]?-1:1,g={y:0,d:r(h[ue])*c,h:r(h[ve])*c,m:r(h[we])*c,s:r(h[xe])*c,ms:r(h[ye])*c}):(h=Te.exec(a))?(c="-"===h[1]?-1:1,g={y:$a(h[2],c),M:$a(h[3],c),d:$a(h[4],c),h:$a(h[5],c),m:$a(h[6],c),s:$a(h[7],c),w:$a(h[8],c)}):null==g?g={}:"object"==typeof g&&("from"in g||"to"in g)&&(e=ab(Ea(g.from),Ea(g.to)),g={},g.ms=e.milliseconds,g.M=e.months),d=new Ia(g),Ja(a)&&f(a,"_locale")&&(d._locale=a._locale),d}function $a(a,b){var c=a&&parseFloat(a.replace(",","."));return(isNaN(c)?0:c)*b}function _a(a,b){var c={milliseconds:0,months:0};return c.months=b.month()-a.month()+12*(b.year()-a.year()),a.clone().add(c.months,"M").isAfter(b)&&--c.months,c.milliseconds=+b-+a.clone().add(c.months,"M"),c}function ab(a,b){var c;return a.isValid()&&b.isValid()?(b=Ma(b,a),a.isBefore(b)?c=_a(a,b):(c=_a(b,a),c.milliseconds=-c.milliseconds,c.months=-c.months),c):{milliseconds:0,months:0}}function bb(a,b){return function(c,d){var e,f;return null===d||isNaN(+d)||(ga(b,"moment()."+b+"(period, number) is deprecated. Please use moment()."+b+"(number, period)."),f=c,c=d,d=f),c="string"==typeof c?+c:c,e=Za(c,d),cb(this,e,a),this}}function cb(b,c,d,e){var f=c._milliseconds,g=c._days,h=c._months;b.isValid()&&(e=null==e?!0:e,f&&b._d.setTime(+b._d+f*d),g&&G(b,"Date",F(b,"Date")+g*d),h&&Z(b,F(b,"Month")+h*d),e&&a.updateOffset(b,g||h))}function db(a,b){var c=a||Ea(),d=Ma(c,this).startOf("day"),e=this.diff(d,"days",!0),f=-6>e?"sameElse":-1>e?"lastWeek":0>e?"lastDay":1>e?"sameDay":2>e?"nextDay":7>e?"nextWeek":"sameElse",g=b&&(D(b[f])?b[f]():b[f]);return this.format(g||this.localeData().calendar(f,this,Ea(c)))}function eb(){return new o(this)}function fb(a,b){var c=p(a)?a:Ea(a);return this.isValid()&&c.isValid()?(b=B(m(b)?"millisecond":b),"millisecond"===b?+this>+c:+c<+this.clone().startOf(b)):!1}function gb(a,b){var c=p(a)?a:Ea(a);return this.isValid()&&c.isValid()?(b=B(m(b)?"millisecond":b),"millisecond"===b?+c>+this:+this.clone().endOf(b)<+c):!1}function hb(a,b,c){return this.isAfter(a,c)&&this.isBefore(b,c)}function ib(a,b){var c,d=p(a)?a:Ea(a);return this.isValid()&&d.isValid()?(b=B(b||"millisecond"),"millisecond"===b?+this===+d:(c=+d,+this.clone().startOf(b)<=c&&c<=+this.clone().endOf(b))):!1}function jb(a,b){return this.isSame(a,b)||this.isAfter(a,b)}function kb(a,b){return this.isSame(a,b)||this.isBefore(a,b)}function lb(a,b,c){var d,e,f,g;return this.isValid()?(d=Ma(a,this),d.isValid()?(e=6e4*(d.utcOffset()-this.utcOffset()),b=B(b),"year"===b||"month"===b||"quarter"===b?(g=mb(this,d),"quarter"===b?g/=3:"year"===b&&(g/=12)):(f=this-d,g="second"===b?f/1e3:"minute"===b?f/6e4:"hour"===b?f/36e5:"day"===b?(f-e)/864e5:"week"===b?(f-e)/6048e5:f),c?g:q(g)):NaN):NaN}function mb(a,b){var c,d,e=12*(b.year()-a.year())+(b.month()-a.month()),f=a.clone().add(e,"months");return 0>b-f?(c=a.clone().add(e-1,"months"),d=(b-f)/(f-c)):(c=a.clone().add(e+1,"months"),d=(b-f)/(c-f)),-(e+d)}function nb(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function ob(){var a=this.clone().utc();return 0f&&(b=f),Ob.call(this,a,b,c,d,e))}function Ob(a,b,c,d,e){var f=pa(a,b,c,d,e),g=ka(f.year,0,f.dayOfYear);return this.year(g.getUTCFullYear()),this.month(g.getUTCMonth()),this.date(g.getUTCDate()),this}function Pb(a){return null==a?Math.ceil((this.month()+1)/3):this.month(3*(a-1)+this.month()%3)}function Qb(a){return qa(a,this._week.dow,this._week.doy).week}function Rb(){return this._week.dow}function Sb(){return this._week.doy}function Tb(a){var b=this.localeData().week(this);return null==a?b:this.add(7*(a-b),"d")}function Ub(a){var b=qa(this,1,4).week;return null==a?b:this.add(7*(a-b),"d")}function Vb(a,b){return"string"!=typeof a?a:isNaN(a)?(a=b.weekdaysParse(a),"number"==typeof a?a:null):parseInt(a,10)}function Wb(a,b){return c(this._weekdays)?this._weekdays[a.day()]:this._weekdays[this._weekdays.isFormat.test(b)?"format":"standalone"][a.day()]}function Xb(a){return this._weekdaysShort[a.day()]}function Yb(a){return this._weekdaysMin[a.day()]}function Zb(a,b,c){var d,e,f;for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),d=0;7>d;d++){if(e=Ea([2e3,1]).day(d),c&&!this._fullWeekdaysParse[d]&&(this._fullWeekdaysParse[d]=new RegExp("^"+this.weekdays(e,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[d]=new RegExp("^"+this.weekdaysShort(e,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[d]=new RegExp("^"+this.weekdaysMin(e,"").replace(".",".?")+"$","i")),this._weekdaysParse[d]||(f="^"+this.weekdays(e,"")+"|^"+this.weekdaysShort(e,"")+"|^"+this.weekdaysMin(e,""),this._weekdaysParse[d]=new RegExp(f.replace(".",""),"i")),c&&"dddd"===b&&this._fullWeekdaysParse[d].test(a))return d;if(c&&"ddd"===b&&this._shortWeekdaysParse[d].test(a))return d;if(c&&"dd"===b&&this._minWeekdaysParse[d].test(a))return d;if(!c&&this._weekdaysParse[d].test(a))return d}}function $b(a){if(!this.isValid())return null!=a?this:NaN;var b=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=a?(a=Vb(a,this.localeData()),this.add(a-b,"d")):b}function _b(a){if(!this.isValid())return null!=a?this:NaN;var b=(this.day()+7-this.localeData()._week.dow)%7;return null==a?b:this.add(a-b,"d")}function ac(a){return this.isValid()?null==a?this.day()||7:this.day(this.day()%7?a:a-7):null!=a?this:NaN}function bc(a){var b=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==a?b:this.add(a-b,"d")}function cc(){return this.hours()%12||12}function dc(a,b){J(a,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),b)})}function ec(a,b){return b._meridiemParse}function fc(a){return"p"===(a+"").toLowerCase().charAt(0)}function gc(a,b,c){return a>11?c?"pm":"PM":c?"am":"AM"}function hc(a,b){b[ye]=r(1e3*("0."+a))}function ic(){return this._isUTC?"UTC":""}function jc(){return this._isUTC?"Coordinated Universal Time":""}function kc(a){return Ea(1e3*a)}function lc(){return Ea.apply(null,arguments).parseZone()}function mc(a,b,c){var d=this._calendar[a];return D(d)?d.call(b,c):d}function nc(a){var b=this._longDateFormat[a],c=this._longDateFormat[a.toUpperCase()];return b||!c?b:(this._longDateFormat[a]=c.replace(/MMMM|MM|DD|dddd/g,function(a){return a.slice(1)}),this._longDateFormat[a])}function oc(){return this._invalidDate}function pc(a){return this._ordinal.replace("%d",a)}function qc(a){return a}function rc(a,b,c,d){var e=this._relativeTime[c];return D(e)?e(a,b,c,d):e.replace(/%d/i,a)}function sc(a,b){var c=this._relativeTime[a>0?"future":"past"];return D(c)?c(b):c.replace(/%s/i,b)}function tc(a){var b,c;for(c in a)b=a[c],D(b)?this[c]=b:this["_"+c]=b;this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function uc(a,b,c,d){var e=z(),f=h().set(d,b);return e[c](f,a)}function vc(a,b,c,d,e){if("number"==typeof a&&(b=a,a=void 0),a=a||"",null!=b)return uc(a,b,c,e);var f,g=[];for(f=0;d>f;f++)g[f]=uc(a,f,c,e);return g}function wc(a,b){return vc(a,b,"months",12,"month")}function xc(a,b){return vc(a,b,"monthsShort",12,"month")}function yc(a,b){return vc(a,b,"weekdays",7,"day")}function zc(a,b){return vc(a,b,"weekdaysShort",7,"day")}function Ac(a,b){return vc(a,b,"weekdaysMin",7,"day")}function Bc(){var a=this._data;return this._milliseconds=qf(this._milliseconds),this._days=qf(this._days),this._months=qf(this._months),a.milliseconds=qf(a.milliseconds),a.seconds=qf(a.seconds),a.minutes=qf(a.minutes),a.hours=qf(a.hours),a.months=qf(a.months),a.years=qf(a.years),this}function Cc(a,b,c,d){var e=Za(b,c);return a._milliseconds+=d*e._milliseconds,a._days+=d*e._days,a._months+=d*e._months,a._bubble()}function Dc(a,b){return Cc(this,a,b,1)}function Ec(a,b){return Cc(this,a,b,-1)}function Fc(a){return 0>a?Math.floor(a):Math.ceil(a)}function Gc(){var a,b,c,d,e,f=this._milliseconds,g=this._days,h=this._months,i=this._data;return f>=0&&g>=0&&h>=0||0>=f&&0>=g&&0>=h||(f+=864e5*Fc(Ic(h)+g),g=0,h=0),i.milliseconds=f%1e3,a=q(f/1e3),i.seconds=a%60,b=q(a/60),i.minutes=b%60,c=q(b/60),i.hours=c%24,g+=q(c/24),e=q(Hc(g)),h+=e,g-=Fc(Ic(e)),d=q(h/12),h%=12,i.days=g,i.months=h,i.years=d,this}function Hc(a){return 4800*a/146097}function Ic(a){return 146097*a/4800}function Jc(a){var b,c,d=this._milliseconds;if(a=B(a),"month"===a||"year"===a)return b=this._days+d/864e5,c=this._months+Hc(b),"month"===a?c:c/12;switch(b=this._days+Math.round(Ic(this._months)),a){case"week":return b/7+d/6048e5;case"day":return b+d/864e5;case"hour":return 24*b+d/36e5;case"minute":return 1440*b+d/6e4;case"second":return 86400*b+d/1e3;case"millisecond":return Math.floor(864e5*b)+d;default:throw new Error("Unknown unit "+a)}}function Kc(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*r(this._months/12)}function Lc(a){return function(){return this.as(a)}}function Mc(a){return a=B(a),this[a+"s"]()}function Nc(a){return function(){return this._data[a]}}function Oc(){return q(this.days()/7)}function Pc(a,b,c,d,e){return e.relativeTime(b||1,!!c,a,d)}function Qc(a,b,c){var d=Za(a).abs(),e=Gf(d.as("s")),f=Gf(d.as("m")),g=Gf(d.as("h")),h=Gf(d.as("d")),i=Gf(d.as("M")),j=Gf(d.as("y")),k=e=f&&["m"]||f=g&&["h"]||g=h&&["d"]||h=i&&["M"]||i=j&&["y"]||["yy",j];return k[2]=b,k[3]=+a>0,k[4]=c,Pc.apply(null,k)}function Rc(a,b){return void 0===Hf[a]?!1:void 0===b?Hf[a]:(Hf[a]=b,!0)}function Sc(a){var b=this.localeData(),c=Qc(this,!a,b);return a&&(c=b.pastFuture(+this,c)),b.postformat(c)}function Tc(){var a,b,c,d=If(this._milliseconds)/1e3,e=If(this._days),f=If(this._months);a=q(d/60),b=q(a/60),d%=60,a%=60,c=q(f/12),f%=12;var g=c,h=f,i=e,j=b,k=a,l=d,m=this.asSeconds();return m?(0>m?"-":"")+"P"+(g?g+"Y":"")+(h?h+"M":"")+(i?i+"D":"")+(j||k||l?"T":"")+(j?j+"H":"")+(k?k+"M":"")+(l?l+"S":""):"P0D"} +!function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):a.moment=b()}(this,function(){"use strict";function a(){return Wd.apply(null,arguments)}function b(a){Wd=a}function c(a){return a instanceof Array||"[object Array]"===Object.prototype.toString.call(a)}function d(a){return a instanceof Date||"[object Date]"===Object.prototype.toString.call(a)}function e(a,b){var c,d=[];for(c=0;c0)for(c in Xd)d=Xd[c],e=b[d],m(e)||(a[d]=e);return a}function o(b){n(this,b),this._d=new Date(null!=b._d?b._d.getTime():NaN),Yd===!1&&(Yd=!0,a.updateOffset(this),Yd=!1)}function p(a){return a instanceof o||null!=a&&null!=a._isAMomentObject}function q(a){return 0>a?Math.ceil(a):Math.floor(a)}function r(a){var b=+a,c=0;return 0!==b&&isFinite(b)&&(c=q(b)),c}function s(a,b,c){var d,e=Math.min(a.length,b.length),f=Math.abs(a.length-b.length),g=0;for(d=0;e>d;d++)(c&&a[d]!==b[d]||!c&&r(a[d])!==r(b[d]))&&g++;return g+f}function t(b){a.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+b)}function u(a,b){var c=!0;return g(function(){return c&&(t(a+"\nArguments: "+Array.prototype.slice.call(arguments).join(", ")+"\n"+(new Error).stack),c=!1),b.apply(this,arguments)},b)}function v(a,b){Zd[a]||(t(b),Zd[a]=!0)}function w(a){return a instanceof Function||"[object Function]"===Object.prototype.toString.call(a)}function x(a){return"[object Object]"===Object.prototype.toString.call(a)}function y(a){var b,c;for(c in a)b=a[c],w(b)?this[c]=b:this["_"+c]=b;this._config=a,this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function z(a,b){var c,d=g({},a);for(c in b)f(b,c)&&(x(a[c])&&x(b[c])?(d[c]={},g(d[c],a[c]),g(d[c],b[c])):null!=b[c]?d[c]=b[c]:delete d[c]);return d}function A(a){null!=a&&this.set(a)}function B(a){return a?a.toLowerCase().replace("_","-"):a}function C(a){for(var b,c,d,e,f=0;f0;){if(d=D(e.slice(0,b).join("-")))return d;if(c&&c.length>=b&&s(e,c,!0)>=b-1)break;b--}f++}return null}function D(a){var b=null;if(!_d[a]&&"undefined"!=typeof module&&module&&module.exports)try{b=$d._abbr,require("./locale/"+a),E(b)}catch(c){}return _d[a]}function E(a,b){var c;return a&&(c=m(b)?H(a):F(a,b),c&&($d=c)),$d._abbr}function F(a,b){return null!==b?(b.abbr=a,null!=_d[a]?(v("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale"),b=z(_d[a]._config,b)):null!=b.parentLocale&&(null!=_d[b.parentLocale]?b=z(_d[b.parentLocale]._config,b):v("parentLocaleUndefined","specified parentLocale is not defined yet")),_d[a]=new A(b),E(a),_d[a]):(delete _d[a],null)}function G(a,b){if(null!=b){var c;null!=_d[a]&&(b=z(_d[a]._config,b)),c=new A(b),c.parentLocale=_d[a],_d[a]=c,E(a)}else null!=_d[a]&&(null!=_d[a].parentLocale?_d[a]=_d[a].parentLocale:null!=_d[a]&&delete _d[a]);return _d[a]}function H(a){var b;if(a&&a._locale&&a._locale._abbr&&(a=a._locale._abbr),!a)return $d;if(!c(a)){if(b=D(a))return b;a=[a]}return C(a)}function I(){return Object.keys(_d)}function J(a,b){var c=a.toLowerCase();ae[c]=ae[c+"s"]=ae[b]=a}function K(a){return"string"==typeof a?ae[a]||ae[a.toLowerCase()]:void 0}function L(a){var b,c,d={};for(c in a)f(a,c)&&(b=K(c),b&&(d[b]=a[c]));return d}function M(b,c){return function(d){return null!=d?(O(this,b,d),a.updateOffset(this,c),this):N(this,b)}}function N(a,b){return a.isValid()?a._d["get"+(a._isUTC?"UTC":"")+b]():NaN}function O(a,b,c){a.isValid()&&a._d["set"+(a._isUTC?"UTC":"")+b](c)}function P(a,b){var c;if("object"==typeof a)for(c in a)this.set(c,a[c]);else if(a=K(a),w(this[a]))return this[a](b);return this}function Q(a,b,c){var d=""+Math.abs(a),e=b-d.length,f=a>=0;return(f?c?"+":"":"-")+Math.pow(10,Math.max(0,e)).toString().substr(1)+d}function R(a,b,c,d){var e=d;"string"==typeof d&&(e=function(){return this[d]()}),a&&(ee[a]=e),b&&(ee[b[0]]=function(){return Q(e.apply(this,arguments),b[1],b[2])}),c&&(ee[c]=function(){return this.localeData().ordinal(e.apply(this,arguments),a)})}function S(a){return a.match(/\[[\s\S]/)?a.replace(/^\[|\]$/g,""):a.replace(/\\/g,"")}function T(a){var b,c,d=a.match(be);for(b=0,c=d.length;c>b;b++)ee[d[b]]?d[b]=ee[d[b]]:d[b]=S(d[b]);return function(e){var f="";for(b=0;c>b;b++)f+=d[b]instanceof Function?d[b].call(e,a):d[b];return f}}function U(a,b){return a.isValid()?(b=V(b,a.localeData()),de[b]=de[b]||T(b),de[b](a)):a.localeData().invalidDate()}function V(a,b){function c(a){return b.longDateFormat(a)||a}var d=5;for(ce.lastIndex=0;d>=0&&ce.test(a);)a=a.replace(ce,c),ce.lastIndex=0,d-=1;return a}function W(a,b,c){we[a]=w(b)?b:function(a,d){return a&&c?c:b}}function X(a,b){return f(we,a)?we[a](b._strict,b._locale):new RegExp(Y(a))}function Y(a){return Z(a.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(a,b,c,d,e){return b||c||d||e}))}function Z(a){return a.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function $(a,b){var c,d=b;for("string"==typeof a&&(a=[a]),"number"==typeof b&&(d=function(a,c){c[b]=r(a)}),c=0;cd;d++){if(e=h([2e3,d]),c&&!this._longMonthsParse[d]&&(this._longMonthsParse[d]=new RegExp("^"+this.months(e,"").replace(".","")+"$","i"),this._shortMonthsParse[d]=new RegExp("^"+this.monthsShort(e,"").replace(".","")+"$","i")),c||this._monthsParse[d]||(f="^"+this.months(e,"")+"|^"+this.monthsShort(e,""),this._monthsParse[d]=new RegExp(f.replace(".",""),"i")),c&&"MMMM"===b&&this._longMonthsParse[d].test(a))return d;if(c&&"MMM"===b&&this._shortMonthsParse[d].test(a))return d;if(!c&&this._monthsParse[d].test(a))return d}}function fa(a,b){var c;if(!a.isValid())return a;if("string"==typeof b)if(/^\d+$/.test(b))b=r(b);else if(b=a.localeData().monthsParse(b),"number"!=typeof b)return a;return c=Math.min(a.date(),ba(a.year(),b)),a._d["set"+(a._isUTC?"UTC":"")+"Month"](b,c),a}function ga(b){return null!=b?(fa(this,b),a.updateOffset(this,!0),this):N(this,"Month")}function ha(){return ba(this.year(),this.month())}function ia(a){return this._monthsParseExact?(f(this,"_monthsRegex")||ka.call(this),a?this._monthsShortStrictRegex:this._monthsShortRegex):this._monthsShortStrictRegex&&a?this._monthsShortStrictRegex:this._monthsShortRegex}function ja(a){return this._monthsParseExact?(f(this,"_monthsRegex")||ka.call(this),a?this._monthsStrictRegex:this._monthsRegex):this._monthsStrictRegex&&a?this._monthsStrictRegex:this._monthsRegex}function ka(){function a(a,b){return b.length-a.length}var b,c,d=[],e=[],f=[];for(b=0;12>b;b++)c=h([2e3,b]),d.push(this.monthsShort(c,"")),e.push(this.months(c,"")),f.push(this.months(c,"")),f.push(this.monthsShort(c,""));for(d.sort(a),e.sort(a),f.sort(a),b=0;12>b;b++)d[b]=Z(d[b]),e[b]=Z(e[b]),f[b]=Z(f[b]);this._monthsRegex=new RegExp("^("+f.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+e.join("|")+")$","i"),this._monthsShortStrictRegex=new RegExp("^("+d.join("|")+")$","i")}function la(a){var b,c=a._a;return c&&-2===j(a).overflow&&(b=c[ze]<0||c[ze]>11?ze:c[Ae]<1||c[Ae]>ba(c[ye],c[ze])?Ae:c[Be]<0||c[Be]>24||24===c[Be]&&(0!==c[Ce]||0!==c[De]||0!==c[Ee])?Be:c[Ce]<0||c[Ce]>59?Ce:c[De]<0||c[De]>59?De:c[Ee]<0||c[Ee]>999?Ee:-1,j(a)._overflowDayOfYear&&(ye>b||b>Ae)&&(b=Ae),j(a)._overflowWeeks&&-1===b&&(b=Fe),j(a)._overflowWeekday&&-1===b&&(b=Ge),j(a).overflow=b),a}function ma(a){var b,c,d,e,f,g,h=a._i,i=Me.exec(h)||Ne.exec(h);if(i){for(j(a).iso=!0,b=0,c=Pe.length;c>b;b++)if(Pe[b][1].exec(i[1])){e=Pe[b][0],d=Pe[b][2]!==!1;break}if(null==e)return void(a._isValid=!1);if(i[3]){for(b=0,c=Qe.length;c>b;b++)if(Qe[b][1].exec(i[3])){f=(i[2]||" ")+Qe[b][0];break}if(null==f)return void(a._isValid=!1)}if(!d&&null!=f)return void(a._isValid=!1);if(i[4]){if(!Oe.exec(i[4]))return void(a._isValid=!1);g="Z"}a._f=e+(f||"")+(g||""),Ba(a)}else a._isValid=!1}function na(b){var c=Re.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(ma(b),void(b._isValid===!1&&(delete b._isValid,a.createFromInputFallback(b))))}function oa(a,b,c,d,e,f,g){var h=new Date(a,b,c,d,e,f,g);return 100>a&&a>=0&&isFinite(h.getFullYear())&&h.setFullYear(a),h}function pa(a){var b=new Date(Date.UTC.apply(null,arguments));return 100>a&&a>=0&&isFinite(b.getUTCFullYear())&&b.setUTCFullYear(a),b}function qa(a){return ra(a)?366:365}function ra(a){return a%4===0&&a%100!==0||a%400===0}function sa(){return ra(this.year())}function ta(a,b,c){var d=7+b-c,e=(7+pa(a,0,d).getUTCDay()-b)%7;return-e+d-1}function ua(a,b,c,d,e){var f,g,h=(7+c-d)%7,i=ta(a,d,e),j=1+7*(b-1)+h+i;return 0>=j?(f=a-1,g=qa(f)+j):j>qa(a)?(f=a+1,g=j-qa(a)):(f=a,g=j),{year:f,dayOfYear:g}}function va(a,b,c){var d,e,f=ta(a.year(),b,c),g=Math.floor((a.dayOfYear()-f-1)/7)+1;return 1>g?(e=a.year()-1,d=g+wa(e,b,c)):g>wa(a.year(),b,c)?(d=g-wa(a.year(),b,c),e=a.year()+1):(e=a.year(),d=g),{week:d,year:e}}function wa(a,b,c){var d=ta(a,b,c),e=ta(a+1,b,c);return(qa(a)-d+e)/7}function xa(a,b,c){return null!=a?a:null!=b?b:c}function ya(b){var c=new Date(a.now());return b._useUTC?[c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()]:[c.getFullYear(),c.getMonth(),c.getDate()]}function za(a){var b,c,d,e,f=[];if(!a._d){for(d=ya(a),a._w&&null==a._a[Ae]&&null==a._a[ze]&&Aa(a),a._dayOfYear&&(e=xa(a._a[ye],d[ye]),a._dayOfYear>qa(e)&&(j(a)._overflowDayOfYear=!0),c=pa(e,0,a._dayOfYear),a._a[ze]=c.getUTCMonth(),a._a[Ae]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];for(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];24===a._a[Be]&&0===a._a[Ce]&&0===a._a[De]&&0===a._a[Ee]&&(a._nextDay=!0,a._a[Be]=0),a._d=(a._useUTC?pa:oa).apply(null,f),null!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[Be]=24)}}function Aa(a){var b,c,d,e,f,g,h,i;b=a._w,null!=b.GG||null!=b.W||null!=b.E?(f=1,g=4,c=xa(b.GG,a._a[ye],va(Ja(),1,4).year),d=xa(b.W,1),e=xa(b.E,1),(1>e||e>7)&&(i=!0)):(f=a._locale._week.dow,g=a._locale._week.doy,c=xa(b.gg,a._a[ye],va(Ja(),f,g).year),d=xa(b.w,1),null!=b.d?(e=b.d,(0>e||e>6)&&(i=!0)):null!=b.e?(e=b.e+f,(b.e<0||b.e>6)&&(i=!0)):e=f),1>d||d>wa(c,f,g)?j(a)._overflowWeeks=!0:null!=i?j(a)._overflowWeekday=!0:(h=ua(c,d,e,f,g),a._a[ye]=h.year,a._dayOfYear=h.dayOfYear)}function Ba(b){if(b._f===a.ISO_8601)return void ma(b);b._a=[],j(b).empty=!0;var c,d,e,f,g,h=""+b._i,i=h.length,k=0;for(e=V(b._f,b._locale).match(be)||[],c=0;c0&&j(b).unusedInput.push(g),h=h.slice(h.indexOf(d)+d.length),k+=d.length),ee[f]?(d?j(b).empty=!1:j(b).unusedTokens.push(f),aa(f,d,b)):b._strict&&!d&&j(b).unusedTokens.push(f);j(b).charsLeftOver=i-k,h.length>0&&j(b).unusedInput.push(h),j(b).bigHour===!0&&b._a[Be]<=12&&b._a[Be]>0&&(j(b).bigHour=void 0),b._a[Be]=Ca(b._locale,b._a[Be],b._meridiem),za(b),la(b)}function Ca(a,b,c){var d;return null==c?b:null!=a.meridiemHour?a.meridiemHour(b,c):null!=a.isPM?(d=a.isPM(c),d&&12>b&&(b+=12),d||12!==b||(b=0),b):b}function Da(a){var b,c,d,e,f;if(0===a._f.length)return j(a).invalidFormat=!0,void(a._d=new Date(NaN));for(e=0;ef)&&(d=f,c=b));g(a,c||b)}function Ea(a){if(!a._d){var b=L(a._i);a._a=e([b.year,b.month,b.day||b.date,b.hour,b.minute,b.second,b.millisecond],function(a){return a&&parseInt(a,10)}),za(a)}}function Fa(a){var b=new o(la(Ga(a)));return b._nextDay&&(b.add(1,"d"),b._nextDay=void 0),b}function Ga(a){var b=a._i,e=a._f;return a._locale=a._locale||H(a._l),null===b||void 0===e&&""===b?l({nullInput:!0}):("string"==typeof b&&(a._i=b=a._locale.preparse(b)),p(b)?new o(la(b)):(c(e)?Da(a):e?Ba(a):d(b)?a._d=b:Ha(a),k(a)||(a._d=null),a))}function Ha(b){var f=b._i;void 0===f?b._d=new Date(a.now()):d(f)?b._d=new Date(+f):"string"==typeof f?na(b):c(f)?(b._a=e(f.slice(0),function(a){return parseInt(a,10)}),za(b)):"object"==typeof f?Ea(b):"number"==typeof f?b._d=new Date(f):a.createFromInputFallback(b)}function Ia(a,b,c,d,e){var f={};return"boolean"==typeof c&&(d=c,c=void 0),f._isAMomentObject=!0,f._useUTC=f._isUTC=e,f._l=c,f._i=a,f._f=b,f._strict=d,Fa(f)}function Ja(a,b,c,d){return Ia(a,b,c,d,!1)}function Ka(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return Ja();for(d=b[0],e=1;ea&&(a=-a,c="-"),c+Q(~~(a/60),2)+b+Q(~~a%60,2)})}function Qa(a,b){var c=(b||"").match(a)||[],d=c[c.length-1]||[],e=(d+"").match(We)||["-",0,0],f=+(60*e[1])+r(e[2]);return"+"===e[0]?f:-f}function Ra(b,c){var e,f;return c._isUTC?(e=c.clone(),f=(p(b)||d(b)?+b:+Ja(b))-+e,e._d.setTime(+e._d+f),a.updateOffset(e,!1),e):Ja(b).local()}function Sa(a){return 15*-Math.round(a._d.getTimezoneOffset()/15)}function Ta(b,c){var d,e=this._offset||0;return this.isValid()?null!=b?("string"==typeof b?b=Qa(te,b):Math.abs(b)<16&&(b=60*b),!this._isUTC&&c&&(d=Sa(this)),this._offset=b,this._isUTC=!0,null!=d&&this.add(d,"m"),e!==b&&(!c||this._changeInProgress?ib(this,cb(b-e,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,a.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?e:Sa(this):null!=b?this:NaN}function Ua(a,b){return null!=a?("string"!=typeof a&&(a=-a),this.utcOffset(a,b),this):-this.utcOffset()}function Va(a){return this.utcOffset(0,a)}function Wa(a){return this._isUTC&&(this.utcOffset(0,a),this._isUTC=!1,a&&this.subtract(Sa(this),"m")),this}function Xa(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(Qa(se,this._i)),this}function Ya(a){return this.isValid()?(a=a?Ja(a).utcOffset():0,(this.utcOffset()-a)%60===0):!1}function Za(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function $a(){if(!m(this._isDSTShifted))return this._isDSTShifted;var a={};if(n(a,this),a=Ga(a),a._a){var b=a._isUTC?h(a._a):Ja(a._a);this._isDSTShifted=this.isValid()&&s(a._a,b.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function _a(){return this.isValid()?!this._isUTC:!1}function ab(){return this.isValid()?this._isUTC:!1}function bb(){return this.isValid()?this._isUTC&&0===this._offset:!1}function cb(a,b){var c,d,e,g=a,h=null;return Oa(a)?g={ms:a._milliseconds,d:a._days,M:a._months}:"number"==typeof a?(g={},b?g[b]=a:g.milliseconds=a):(h=Xe.exec(a))?(c="-"===h[1]?-1:1,g={y:0,d:r(h[Ae])*c,h:r(h[Be])*c,m:r(h[Ce])*c,s:r(h[De])*c,ms:r(h[Ee])*c}):(h=Ye.exec(a))?(c="-"===h[1]?-1:1,g={y:db(h[2],c),M:db(h[3],c),w:db(h[4],c),d:db(h[5],c),h:db(h[6],c),m:db(h[7],c),s:db(h[8],c)}):null==g?g={}:"object"==typeof g&&("from"in g||"to"in g)&&(e=fb(Ja(g.from),Ja(g.to)),g={},g.ms=e.milliseconds,g.M=e.months),d=new Na(g),Oa(a)&&f(a,"_locale")&&(d._locale=a._locale),d}function db(a,b){var c=a&&parseFloat(a.replace(",","."));return(isNaN(c)?0:c)*b}function eb(a,b){var c={milliseconds:0,months:0};return c.months=b.month()-a.month()+12*(b.year()-a.year()),a.clone().add(c.months,"M").isAfter(b)&&--c.months,c.milliseconds=+b-+a.clone().add(c.months,"M"),c}function fb(a,b){var c;return a.isValid()&&b.isValid()?(b=Ra(b,a),a.isBefore(b)?c=eb(a,b):(c=eb(b,a),c.milliseconds=-c.milliseconds,c.months=-c.months),c):{milliseconds:0,months:0}}function gb(a){return 0>a?-1*Math.round(-1*a):Math.round(a)}function hb(a,b){return function(c,d){var e,f;return null===d||isNaN(+d)||(v(b,"moment()."+b+"(period, number) is deprecated. Please use moment()."+b+"(number, period)."),f=c,c=d,d=f),c="string"==typeof c?+c:c,e=cb(c,d),ib(this,e,a),this}}function ib(b,c,d,e){var f=c._milliseconds,g=gb(c._days),h=gb(c._months);b.isValid()&&(e=null==e?!0:e,f&&b._d.setTime(+b._d+f*d),g&&O(b,"Date",N(b,"Date")+g*d),h&&fa(b,N(b,"Month")+h*d),e&&a.updateOffset(b,g||h))}function jb(a,b){var c=a||Ja(),d=Ra(c,this).startOf("day"),e=this.diff(d,"days",!0),f=-6>e?"sameElse":-1>e?"lastWeek":0>e?"lastDay":1>e?"sameDay":2>e?"nextDay":7>e?"nextWeek":"sameElse",g=b&&(w(b[f])?b[f]():b[f]);return this.format(g||this.localeData().calendar(f,this,Ja(c)))}function kb(){return new o(this)}function lb(a,b){var c=p(a)?a:Ja(a);return this.isValid()&&c.isValid()?(b=K(m(b)?"millisecond":b),"millisecond"===b?+this>+c:+c<+this.clone().startOf(b)):!1}function mb(a,b){var c=p(a)?a:Ja(a);return this.isValid()&&c.isValid()?(b=K(m(b)?"millisecond":b),"millisecond"===b?+c>+this:+this.clone().endOf(b)<+c):!1}function nb(a,b,c){return this.isAfter(a,c)&&this.isBefore(b,c)}function ob(a,b){var c,d=p(a)?a:Ja(a);return this.isValid()&&d.isValid()?(b=K(b||"millisecond"),"millisecond"===b?+this===+d:(c=+d,+this.clone().startOf(b)<=c&&c<=+this.clone().endOf(b))):!1}function pb(a,b){return this.isSame(a,b)||this.isAfter(a,b)}function qb(a,b){return this.isSame(a,b)||this.isBefore(a,b)}function rb(a,b,c){var d,e,f,g;return this.isValid()?(d=Ra(a,this),d.isValid()?(e=6e4*(d.utcOffset()-this.utcOffset()),b=K(b),"year"===b||"month"===b||"quarter"===b?(g=sb(this,d),"quarter"===b?g/=3:"year"===b&&(g/=12)):(f=this-d,g="second"===b?f/1e3:"minute"===b?f/6e4:"hour"===b?f/36e5:"day"===b?(f-e)/864e5:"week"===b?(f-e)/6048e5:f),c?g:q(g)):NaN):NaN}function sb(a,b){var c,d,e=12*(b.year()-a.year())+(b.month()-a.month()),f=a.clone().add(e,"months");return 0>b-f?(c=a.clone().add(e-1,"months"),d=(b-f)/(f-c)):(c=a.clone().add(e+1,"months"),d=(b-f)/(c-f)),-(e+d)}function tb(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function ub(){var a=this.clone().utc();return 0f&&(b=f),Ub.call(this,a,b,c,d,e))}function Ub(a,b,c,d,e){var f=ua(a,b,c,d,e),g=pa(f.year,0,f.dayOfYear);return this.year(g.getUTCFullYear()),this.month(g.getUTCMonth()),this.date(g.getUTCDate()),this}function Vb(a){return null==a?Math.ceil((this.month()+1)/3):this.month(3*(a-1)+this.month()%3)}function Wb(a){return va(a,this._week.dow,this._week.doy).week}function Xb(){return this._week.dow}function Yb(){return this._week.doy}function Zb(a){var b=this.localeData().week(this);return null==a?b:this.add(7*(a-b),"d")}function $b(a){var b=va(this,1,4).week;return null==a?b:this.add(7*(a-b),"d")}function _b(a,b){return"string"!=typeof a?a:isNaN(a)?(a=b.weekdaysParse(a),"number"==typeof a?a:null):parseInt(a,10)}function ac(a,b){return c(this._weekdays)?this._weekdays[a.day()]:this._weekdays[this._weekdays.isFormat.test(b)?"format":"standalone"][a.day()]}function bc(a){return this._weekdaysShort[a.day()]}function cc(a){return this._weekdaysMin[a.day()]}function dc(a,b,c){var d,e,f;for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),d=0;7>d;d++){if(e=Ja([2e3,1]).day(d),c&&!this._fullWeekdaysParse[d]&&(this._fullWeekdaysParse[d]=new RegExp("^"+this.weekdays(e,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[d]=new RegExp("^"+this.weekdaysShort(e,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[d]=new RegExp("^"+this.weekdaysMin(e,"").replace(".",".?")+"$","i")),this._weekdaysParse[d]||(f="^"+this.weekdays(e,"")+"|^"+this.weekdaysShort(e,"")+"|^"+this.weekdaysMin(e,""),this._weekdaysParse[d]=new RegExp(f.replace(".",""),"i")),c&&"dddd"===b&&this._fullWeekdaysParse[d].test(a))return d;if(c&&"ddd"===b&&this._shortWeekdaysParse[d].test(a))return d;if(c&&"dd"===b&&this._minWeekdaysParse[d].test(a))return d;if(!c&&this._weekdaysParse[d].test(a))return d}}function ec(a){if(!this.isValid())return null!=a?this:NaN;var b=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=a?(a=_b(a,this.localeData()),this.add(a-b,"d")):b}function fc(a){if(!this.isValid())return null!=a?this:NaN;var b=(this.day()+7-this.localeData()._week.dow)%7;return null==a?b:this.add(a-b,"d")}function gc(a){return this.isValid()?null==a?this.day()||7:this.day(this.day()%7?a:a-7):null!=a?this:NaN}function hc(a){var b=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==a?b:this.add(a-b,"d")}function ic(){return this.hours()%12||12}function jc(a,b){R(a,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),b)})}function kc(a,b){return b._meridiemParse}function lc(a){return"p"===(a+"").toLowerCase().charAt(0)}function mc(a,b,c){return a>11?c?"pm":"PM":c?"am":"AM"}function nc(a,b){b[Ee]=r(1e3*("0."+a))}function oc(){return this._isUTC?"UTC":""}function pc(){return this._isUTC?"Coordinated Universal Time":""}function qc(a){return Ja(1e3*a)}function rc(){return Ja.apply(null,arguments).parseZone()}function sc(a,b,c){var d=this._calendar[a];return w(d)?d.call(b,c):d}function tc(a){var b=this._longDateFormat[a],c=this._longDateFormat[a.toUpperCase()];return b||!c?b:(this._longDateFormat[a]=c.replace(/MMMM|MM|DD|dddd/g,function(a){return a.slice(1)}),this._longDateFormat[a])}function uc(){return this._invalidDate}function vc(a){return this._ordinal.replace("%d",a)}function wc(a){return a}function xc(a,b,c,d){var e=this._relativeTime[c];return w(e)?e(a,b,c,d):e.replace(/%d/i,a)}function yc(a,b){var c=this._relativeTime[a>0?"future":"past"];return w(c)?c(b):c.replace(/%s/i,b)}function zc(a,b,c,d){var e=H(),f=h().set(d,b);return e[c](f,a)}function Ac(a,b,c,d,e){if("number"==typeof a&&(b=a,a=void 0),a=a||"",null!=b)return zc(a,b,c,e);var f,g=[];for(f=0;d>f;f++)g[f]=zc(a,f,c,e);return g}function Bc(a,b){return Ac(a,b,"months",12,"month")}function Cc(a,b){return Ac(a,b,"monthsShort",12,"month")}function Dc(a,b){return Ac(a,b,"weekdays",7,"day")}function Ec(a,b){return Ac(a,b,"weekdaysShort",7,"day")}function Fc(a,b){return Ac(a,b,"weekdaysMin",7,"day")}function Gc(){var a=this._data;return this._milliseconds=vf(this._milliseconds),this._days=vf(this._days),this._months=vf(this._months),a.milliseconds=vf(a.milliseconds),a.seconds=vf(a.seconds),a.minutes=vf(a.minutes),a.hours=vf(a.hours),a.months=vf(a.months),a.years=vf(a.years),this}function Hc(a,b,c,d){var e=cb(b,c);return a._milliseconds+=d*e._milliseconds,a._days+=d*e._days,a._months+=d*e._months,a._bubble()}function Ic(a,b){return Hc(this,a,b,1)}function Jc(a,b){return Hc(this,a,b,-1)}function Kc(a){return 0>a?Math.floor(a):Math.ceil(a)}function Lc(){var a,b,c,d,e,f=this._milliseconds,g=this._days,h=this._months,i=this._data;return f>=0&&g>=0&&h>=0||0>=f&&0>=g&&0>=h||(f+=864e5*Kc(Nc(h)+g),g=0,h=0),i.milliseconds=f%1e3,a=q(f/1e3),i.seconds=a%60,b=q(a/60),i.minutes=b%60,c=q(b/60),i.hours=c%24,g+=q(c/24),e=q(Mc(g)),h+=e,g-=Kc(Nc(e)),d=q(h/12),h%=12,i.days=g,i.months=h,i.years=d,this}function Mc(a){return 4800*a/146097}function Nc(a){return 146097*a/4800}function Oc(a){var b,c,d=this._milliseconds;if(a=K(a),"month"===a||"year"===a)return b=this._days+d/864e5,c=this._months+Mc(b),"month"===a?c:c/12;switch(b=this._days+Math.round(Nc(this._months)),a){case"week":return b/7+d/6048e5;case"day":return b+d/864e5;case"hour":return 24*b+d/36e5;case"minute":return 1440*b+d/6e4;case"second":return 86400*b+d/1e3;case"millisecond":return Math.floor(864e5*b)+d;default:throw new Error("Unknown unit "+a)}}function Pc(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*r(this._months/12)}function Qc(a){return function(){return this.as(a)}}function Rc(a){return a=K(a),this[a+"s"]()}function Sc(a){return function(){return this._data[a]}}function Tc(){return q(this.days()/7)}function Uc(a,b,c,d,e){return e.relativeTime(b||1,!!c,a,d)}function Vc(a,b,c){var d=cb(a).abs(),e=Lf(d.as("s")),f=Lf(d.as("m")),g=Lf(d.as("h")),h=Lf(d.as("d")),i=Lf(d.as("M")),j=Lf(d.as("y")),k=e=f&&["m"]||f=g&&["h"]||g=h&&["d"]||h=i&&["M"]||i=j&&["y"]||["yy",j];return k[2]=b,k[3]=+a>0,k[4]=c,Uc.apply(null,k)}function Wc(a,b){return void 0===Mf[a]?!1:void 0===b?Mf[a]:(Mf[a]=b,!0)}function Xc(a){var b=this.localeData(),c=Vc(this,!a,b);return a&&(c=b.pastFuture(+this,c)),b.postformat(c)}function Yc(){var a,b,c,d=Nf(this._milliseconds)/1e3,e=Nf(this._days),f=Nf(this._months);a=q(d/60),b=q(a/60),d%=60,a%=60,c=q(f/12),f%=12;var g=c,h=f,i=e,j=b,k=a,l=d,m=this.asSeconds();return m?(0>m?"-":"")+"P"+(g?g+"Y":"")+(h?h+"M":"")+(i?i+"D":"")+(j||k||l?"T":"")+(j?j+"H":"")+(k?k+"M":"")+(l?l+"S":""):"P0D"} //! moment.js locale configuration //! locale : belarusian (be) //! author : Dmitry Demidov : https://github.com/demidov91 //! author: Praleska: http://praleska.pro/ //! Author : Menelion Elensúle : https://github.com/Oire -function Uc(a,b){var c=a.split("_");return b%10===1&&b%100!==11?c[0]:b%10>=2&&4>=b%10&&(10>b%100||b%100>=20)?c[1]:c[2]}function Vc(a,b,c){var d={mm:b?"хвіліна_хвіліны_хвілін":"хвіліну_хвіліны_хвілін",hh:b?"гадзіна_гадзіны_гадзін":"гадзіну_гадзіны_гадзін",dd:"дзень_дні_дзён",MM:"месяц_месяцы_месяцаў",yy:"год_гады_гадоў"};return"m"===c?b?"хвіліна":"хвіліну":"h"===c?b?"гадзіна":"гадзіну":a+" "+Uc(d[c],+a)} +function Zc(a,b){var c=a.split("_");return b%10===1&&b%100!==11?c[0]:b%10>=2&&4>=b%10&&(10>b%100||b%100>=20)?c[1]:c[2]}function $c(a,b,c){var d={mm:b?"хвіліна_хвіліны_хвілін":"хвіліну_хвіліны_хвілін",hh:b?"гадзіна_гадзіны_гадзін":"гадзіну_гадзіны_гадзін",dd:"дзень_дні_дзён",MM:"месяц_месяцы_месяцаў",yy:"год_гады_гадоў"};return"m"===c?b?"хвіліна":"хвіліну":"h"===c?b?"гадзіна":"гадзіну":a+" "+Zc(d[c],+a)} //! moment.js locale configuration //! locale : breton (br) //! author : Jean-Baptiste Le Duigou : https://github.com/jbleduigou -function Wc(a,b,c){var d={mm:"munutenn",MM:"miz",dd:"devezh"};return a+" "+Zc(d[c],a)}function Xc(a){switch(Yc(a)){case 1:case 3:case 4:case 5:case 9:return a+" bloaz";default:return a+" vloaz"}}function Yc(a){return a>9?Yc(a%10):a}function Zc(a,b){return 2===b?$c(a):a}function $c(a){var b={m:"v",b:"v",d:"z"};return void 0===b[a.charAt(0)]?a:b[a.charAt(0)]+a.substring(1)} +function _c(a,b,c){var d={mm:"munutenn",MM:"miz",dd:"devezh"};return a+" "+cd(d[c],a)}function ad(a){switch(bd(a)){case 1:case 3:case 4:case 5:case 9:return a+" bloaz";default:return a+" vloaz"}}function bd(a){return a>9?bd(a%10):a}function cd(a,b){return 2===b?dd(a):a}function dd(a){var b={m:"v",b:"v",d:"z"};return void 0===b[a.charAt(0)]?a:b[a.charAt(0)]+a.substring(1)} //! moment.js locale configuration //! locale : bosnian (bs) //! author : Nedim Cholich : https://github.com/frontyard //! based on (hr) translation by Bojan Marković -function _c(a,b,c){var d=a+" ";switch(c){case"m":return b?"jedna minuta":"jedne minute";case"mm":return d+=1===a?"minuta":2===a||3===a||4===a?"minute":"minuta";case"h":return b?"jedan sat":"jednog sata";case"hh":return d+=1===a?"sat":2===a||3===a||4===a?"sata":"sati";case"dd":return d+=1===a?"dan":"dana";case"MM":return d+=1===a?"mjesec":2===a||3===a||4===a?"mjeseca":"mjeseci";case"yy":return d+=1===a?"godina":2===a||3===a||4===a?"godine":"godina"}}function ad(a){return a>1&&5>a&&1!==~~(a/10)}function bd(a,b,c,d){var e=a+" ";switch(c){case"s":return b||d?"pár sekund":"pár sekundami";case"m":return b?"minuta":d?"minutu":"minutou";case"mm":return b||d?e+(ad(a)?"minuty":"minut"):e+"minutami";break;case"h":return b?"hodina":d?"hodinu":"hodinou";case"hh":return b||d?e+(ad(a)?"hodiny":"hodin"):e+"hodinami";break;case"d":return b||d?"den":"dnem";case"dd":return b||d?e+(ad(a)?"dny":"dní"):e+"dny";break;case"M":return b||d?"měsíc":"měsícem";case"MM":return b||d?e+(ad(a)?"měsíce":"měsíců"):e+"měsíci";break;case"y":return b||d?"rok":"rokem";case"yy":return b||d?e+(ad(a)?"roky":"let"):e+"lety"}} +function ed(a,b,c){var d=a+" ";switch(c){case"m":return b?"jedna minuta":"jedne minute";case"mm":return d+=1===a?"minuta":2===a||3===a||4===a?"minute":"minuta";case"h":return b?"jedan sat":"jednog sata";case"hh":return d+=1===a?"sat":2===a||3===a||4===a?"sata":"sati";case"dd":return d+=1===a?"dan":"dana";case"MM":return d+=1===a?"mjesec":2===a||3===a||4===a?"mjeseca":"mjeseci";case"yy":return d+=1===a?"godina":2===a||3===a||4===a?"godine":"godina"}}function fd(a){return a>1&&5>a&&1!==~~(a/10)}function gd(a,b,c,d){var e=a+" ";switch(c){case"s":return b||d?"pár sekund":"pár sekundami";case"m":return b?"minuta":d?"minutu":"minutou";case"mm":return b||d?e+(fd(a)?"minuty":"minut"):e+"minutami";break;case"h":return b?"hodina":d?"hodinu":"hodinou";case"hh":return b||d?e+(fd(a)?"hodiny":"hodin"):e+"hodinami";break;case"d":return b||d?"den":"dnem";case"dd":return b||d?e+(fd(a)?"dny":"dní"):e+"dny";break;case"M":return b||d?"měsíc":"měsícem";case"MM":return b||d?e+(fd(a)?"měsíce":"měsíců"):e+"měsíci";break;case"y":return b||d?"rok":"rokem";case"yy":return b||d?e+(fd(a)?"roky":"let"):e+"lety"}} //! moment.js locale configuration //! locale : austrian german (de-at) //! author : lluchs : https://github.com/lluchs //! author: Menelion Elensúle: https://github.com/Oire //! author : Martin Groller : https://github.com/MadMG //! author : Mikolaj Dadela : https://github.com/mik01aj -function cd(a,b,c,d){var e={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[a+" Tage",a+" Tagen"],M:["ein Monat","einem Monat"],MM:[a+" Monate",a+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[a+" Jahre",a+" Jahren"]};return b?e[c][0]:e[c][1]} +function hd(a,b,c,d){var e={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[a+" Tage",a+" Tagen"],M:["ein Monat","einem Monat"],MM:[a+" Monate",a+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[a+" Jahre",a+" Jahren"]};return b?e[c][0]:e[c][1]} //! moment.js locale configuration //! locale : german (de) //! author : lluchs : https://github.com/lluchs //! author: Menelion Elensúle: https://github.com/Oire //! author : Mikolaj Dadela : https://github.com/mik01aj -function dd(a,b,c,d){var e={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[a+" Tage",a+" Tagen"],M:["ein Monat","einem Monat"],MM:[a+" Monate",a+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[a+" Jahre",a+" Jahren"]};return b?e[c][0]:e[c][1]} +function id(a,b,c,d){var e={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[a+" Tage",a+" Tagen"],M:["ein Monat","einem Monat"],MM:[a+" Monate",a+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[a+" Jahre",a+" Jahren"]};return b?e[c][0]:e[c][1]} //! moment.js locale configuration //! locale : estonian (et) //! author : Henry Kehlmann : https://github.com/madhenry //! improvements : Illimar Tambek : https://github.com/ragulka -function ed(a,b,c,d){var e={s:["mõne sekundi","mõni sekund","paar sekundit"],m:["ühe minuti","üks minut"],mm:[a+" minuti",a+" minutit"],h:["ühe tunni","tund aega","üks tund"],hh:[a+" tunni",a+" tundi"],d:["ühe päeva","üks päev"],M:["kuu aja","kuu aega","üks kuu"],MM:[a+" kuu",a+" kuud"],y:["ühe aasta","aasta","üks aasta"],yy:[a+" aasta",a+" aastat"]};return b?e[c][2]?e[c][2]:e[c][1]:d?e[c][0]:e[c][1]}function fd(a,b,c,d){var e="";switch(c){case"s":return d?"muutaman sekunnin":"muutama sekunti";case"m":return d?"minuutin":"minuutti";case"mm":e=d?"minuutin":"minuuttia";break;case"h":return d?"tunnin":"tunti";case"hh":e=d?"tunnin":"tuntia";break;case"d":return d?"päivän":"päivä";case"dd":e=d?"päivän":"päivää";break;case"M":return d?"kuukauden":"kuukausi";case"MM":e=d?"kuukauden":"kuukautta";break;case"y":return d?"vuoden":"vuosi";case"yy":e=d?"vuoden":"vuotta"}return e=gd(a,d)+" "+e}function gd(a,b){return 10>a?b?fg[a]:eg[a]:a} +function jd(a,b,c,d){var e={s:["mõne sekundi","mõni sekund","paar sekundit"],m:["ühe minuti","üks minut"],mm:[a+" minuti",a+" minutit"],h:["ühe tunni","tund aega","üks tund"],hh:[a+" tunni",a+" tundi"],d:["ühe päeva","üks päev"],M:["kuu aja","kuu aega","üks kuu"],MM:[a+" kuu",a+" kuud"],y:["ühe aasta","aasta","üks aasta"],yy:[a+" aasta",a+" aastat"]};return b?e[c][2]?e[c][2]:e[c][1]:d?e[c][0]:e[c][1]}function kd(a,b,c,d){var e="";switch(c){case"s":return d?"muutaman sekunnin":"muutama sekunti";case"m":return d?"minuutin":"minuutti";case"mm":e=d?"minuutin":"minuuttia";break;case"h":return d?"tunnin":"tunti";case"hh":e=d?"tunnin":"tuntia";break;case"d":return d?"päivän":"päivä";case"dd":e=d?"päivän":"päivää";break;case"M":return d?"kuukauden":"kuukausi";case"MM":e=d?"kuukauden":"kuukautta";break;case"y":return d?"vuoden":"vuosi";case"yy":e=d?"vuoden":"vuotta"}return e=ld(a,d)+" "+e}function ld(a,b){return 10>a?b?kg[a]:jg[a]:a} //! moment.js locale configuration //! locale : hrvatski (hr) //! author : Bojan Marković : https://github.com/bmarkovic -function hd(a,b,c){var d=a+" ";switch(c){case"m":return b?"jedna minuta":"jedne minute";case"mm":return d+=1===a?"minuta":2===a||3===a||4===a?"minute":"minuta";case"h":return b?"jedan sat":"jednog sata";case"hh":return d+=1===a?"sat":2===a||3===a||4===a?"sata":"sati";case"dd":return d+=1===a?"dan":"dana";case"MM":return d+=1===a?"mjesec":2===a||3===a||4===a?"mjeseca":"mjeseci";case"yy":return d+=1===a?"godina":2===a||3===a||4===a?"godine":"godina"}}function id(a,b,c,d){var e=a;switch(c){case"s":return d||b?"néhány másodperc":"néhány másodperce";case"m":return"egy"+(d||b?" perc":" perce");case"mm":return e+(d||b?" perc":" perce");case"h":return"egy"+(d||b?" óra":" órája");case"hh":return e+(d||b?" óra":" órája");case"d":return"egy"+(d||b?" nap":" napja");case"dd":return e+(d||b?" nap":" napja");case"M":return"egy"+(d||b?" hónap":" hónapja");case"MM":return e+(d||b?" hónap":" hónapja");case"y":return"egy"+(d||b?" év":" éve");case"yy":return e+(d||b?" év":" éve")}return""}function jd(a){return(a?"":"[múlt] ")+"["+pg[this.day()]+"] LT[-kor]"} +function md(a,b,c){var d=a+" ";switch(c){case"m":return b?"jedna minuta":"jedne minute";case"mm":return d+=1===a?"minuta":2===a||3===a||4===a?"minute":"minuta";case"h":return b?"jedan sat":"jednog sata";case"hh":return d+=1===a?"sat":2===a||3===a||4===a?"sata":"sati";case"dd":return d+=1===a?"dan":"dana";case"MM":return d+=1===a?"mjesec":2===a||3===a||4===a?"mjeseca":"mjeseci";case"yy":return d+=1===a?"godina":2===a||3===a||4===a?"godine":"godina"}}function nd(a,b,c,d){var e=a;switch(c){case"s":return d||b?"néhány másodperc":"néhány másodperce";case"m":return"egy"+(d||b?" perc":" perce");case"mm":return e+(d||b?" perc":" perce");case"h":return"egy"+(d||b?" óra":" órája");case"hh":return e+(d||b?" óra":" órája");case"d":return"egy"+(d||b?" nap":" napja");case"dd":return e+(d||b?" nap":" napja");case"M":return"egy"+(d||b?" hónap":" hónapja");case"MM":return e+(d||b?" hónap":" hónapja");case"y":return"egy"+(d||b?" év":" éve");case"yy":return e+(d||b?" év":" éve")}return""}function od(a){return(a?"":"[múlt] ")+"["+ug[this.day()]+"] LT[-kor]"} //! moment.js locale configuration //! locale : icelandic (is) //! author : Hinrik Örn Sigurðsson : https://github.com/hinrik -function kd(a){return a%100===11?!0:a%10===1?!1:!0}function ld(a,b,c,d){var e=a+" ";switch(c){case"s":return b||d?"nokkrar sekúndur":"nokkrum sekúndum";case"m":return b?"mínúta":"mínútu";case"mm":return kd(a)?e+(b||d?"mínútur":"mínútum"):b?e+"mínúta":e+"mínútu";case"hh":return kd(a)?e+(b||d?"klukkustundir":"klukkustundum"):e+"klukkustund";case"d":return b?"dagur":d?"dag":"degi";case"dd":return kd(a)?b?e+"dagar":e+(d?"daga":"dögum"):b?e+"dagur":e+(d?"dag":"degi");case"M":return b?"mánuður":d?"mánuð":"mánuði";case"MM":return kd(a)?b?e+"mánuðir":e+(d?"mánuði":"mánuðum"):b?e+"mánuður":e+(d?"mánuð":"mánuði");case"y":return b||d?"ár":"ári";case"yy":return kd(a)?e+(b||d?"ár":"árum"):e+(b||d?"ár":"ári")}} +function pd(a){return a%100===11?!0:a%10===1?!1:!0}function qd(a,b,c,d){var e=a+" ";switch(c){case"s":return b||d?"nokkrar sekúndur":"nokkrum sekúndum";case"m":return b?"mínúta":"mínútu";case"mm":return pd(a)?e+(b||d?"mínútur":"mínútum"):b?e+"mínúta":e+"mínútu";case"hh":return pd(a)?e+(b||d?"klukkustundir":"klukkustundum"):e+"klukkustund";case"d":return b?"dagur":d?"dag":"degi";case"dd":return pd(a)?b?e+"dagar":e+(d?"daga":"dögum"):b?e+"dagur":e+(d?"dag":"degi");case"M":return b?"mánuður":d?"mánuð":"mánuði";case"MM":return pd(a)?b?e+"mánuðir":e+(d?"mánuði":"mánuðum"):b?e+"mánuður":e+(d?"mánuð":"mánuði");case"y":return b||d?"ár":"ári";case"yy":return pd(a)?e+(b||d?"ár":"árum"):e+(b||d?"ár":"ári")}} //! moment.js locale configuration //! locale : Luxembourgish (lb) //! author : mweimerskirch : https://github.com/mweimerskirch, David Raison : https://github.com/kwisatz -function md(a,b,c,d){var e={m:["eng Minutt","enger Minutt"],h:["eng Stonn","enger Stonn"],d:["een Dag","engem Dag"],M:["ee Mount","engem Mount"],y:["ee Joer","engem Joer"]};return b?e[c][0]:e[c][1]}function nd(a){var b=a.substr(0,a.indexOf(" "));return pd(b)?"a "+a:"an "+a}function od(a){var b=a.substr(0,a.indexOf(" "));return pd(b)?"viru "+a:"virun "+a}function pd(a){if(a=parseInt(a,10),isNaN(a))return!1;if(0>a)return!0;if(10>a)return a>=4&&7>=a?!0:!1;if(100>a){var b=a%10,c=a/10;return pd(0===b?c:b)}if(1e4>a){for(;a>=10;)a/=10;return pd(a)}return a/=1e3,pd(a)}function qd(a,b,c,d){return b?"kelios sekundės":d?"kelių sekundžių":"kelias sekundes"}function rd(a,b,c,d){return b?td(c)[0]:d?td(c)[1]:td(c)[2]}function sd(a){return a%10===0||a>10&&20>a}function td(a){return rg[a].split("_")}function ud(a,b,c,d){var e=a+" ";return 1===a?e+rd(a,b,c[0],d):b?e+(sd(a)?td(c)[1]:td(c)[0]):d?e+td(c)[1]:e+(sd(a)?td(c)[1]:td(c)[2])}function vd(a,b,c){return c?b%10===1&&11!==b?a[2]:a[3]:b%10===1&&11!==b?a[0]:a[1]}function wd(a,b,c){return a+" "+vd(sg[c],a,b)}function xd(a,b,c){return vd(sg[c],a,b)}function yd(a,b){return b?"dažas sekundes":"dažām sekundēm"}function zd(a,b,c,d){var e="";if(b)switch(c){case"s":e="काही सेकंद";break;case"m":e="एक मिनिट";break;case"mm":e="%d मिनिटे";break;case"h":e="एक तास";break;case"hh":e="%d तास";break;case"d":e="एक दिवस";break;case"dd":e="%d दिवस";break;case"M":e="एक महिना";break;case"MM":e="%d महिने";break;case"y":e="एक वर्ष";break;case"yy":e="%d वर्षे"}else switch(c){case"s":e="काही सेकंदां";break;case"m":e="एका मिनिटा";break;case"mm":e="%d मिनिटां";break;case"h":e="एका तासा";break;case"hh":e="%d तासां";break;case"d":e="एका दिवसा";break;case"dd":e="%d दिवसां";break;case"M":e="एका महिन्या";break;case"MM":e="%d महिन्यां";break;case"y":e="एका वर्षा";break;case"yy":e="%d वर्षां"}return e.replace(/%d/i,a)}function Ad(a){return 5>a%10&&a%10>1&&~~(a/10)%10!==1}function Bd(a,b,c){var d=a+" ";switch(c){case"m":return b?"minuta":"minutę";case"mm":return d+(Ad(a)?"minuty":"minut");case"h":return b?"godzina":"godzinę";case"hh":return d+(Ad(a)?"godziny":"godzin");case"MM":return d+(Ad(a)?"miesiące":"miesięcy");case"yy":return d+(Ad(a)?"lata":"lat")}} +function rd(a,b,c,d){var e={m:["eng Minutt","enger Minutt"],h:["eng Stonn","enger Stonn"],d:["een Dag","engem Dag"],M:["ee Mount","engem Mount"],y:["ee Joer","engem Joer"]};return b?e[c][0]:e[c][1]}function sd(a){var b=a.substr(0,a.indexOf(" "));return ud(b)?"a "+a:"an "+a}function td(a){var b=a.substr(0,a.indexOf(" "));return ud(b)?"viru "+a:"virun "+a}function ud(a){if(a=parseInt(a,10),isNaN(a))return!1;if(0>a)return!0;if(10>a)return a>=4&&7>=a?!0:!1;if(100>a){var b=a%10,c=a/10;return ud(0===b?c:b)}if(1e4>a){for(;a>=10;)a/=10;return ud(a)}return a/=1e3,ud(a)}function vd(a,b,c,d){return b?"kelios sekundės":d?"kelių sekundžių":"kelias sekundes"}function wd(a,b,c,d){return b?yd(c)[0]:d?yd(c)[1]:yd(c)[2]}function xd(a){return a%10===0||a>10&&20>a}function yd(a){return wg[a].split("_")}function zd(a,b,c,d){var e=a+" ";return 1===a?e+wd(a,b,c[0],d):b?e+(xd(a)?yd(c)[1]:yd(c)[0]):d?e+yd(c)[1]:e+(xd(a)?yd(c)[1]:yd(c)[2])}function Ad(a,b,c){return c?b%10===1&&11!==b?a[2]:a[3]:b%10===1&&11!==b?a[0]:a[1]}function Bd(a,b,c){return a+" "+Ad(xg[c],a,b)}function Cd(a,b,c){return Ad(xg[c],a,b)}function Dd(a,b){return b?"dažas sekundes":"dažām sekundēm"}function Ed(a,b,c,d){var e="";if(b)switch(c){case"s":e="काही सेकंद";break;case"m":e="एक मिनिट";break;case"mm":e="%d मिनिटे";break;case"h":e="एक तास";break;case"hh":e="%d तास";break;case"d":e="एक दिवस";break;case"dd":e="%d दिवस";break;case"M":e="एक महिना";break;case"MM":e="%d महिने";break;case"y":e="एक वर्ष";break;case"yy":e="%d वर्षे"}else switch(c){case"s":e="काही सेकंदां";break;case"m":e="एका मिनिटा";break;case"mm":e="%d मिनिटां";break;case"h":e="एका तासा";break;case"hh":e="%d तासां";break;case"d":e="एका दिवसा";break;case"dd":e="%d दिवसां";break;case"M":e="एका महिन्या";break;case"MM":e="%d महिन्यां";break;case"y":e="एका वर्षा";break;case"yy":e="%d वर्षां"}return e.replace(/%d/i,a)}function Fd(a){return 5>a%10&&a%10>1&&~~(a/10)%10!==1}function Gd(a,b,c){var d=a+" ";switch(c){case"m":return b?"minuta":"minutę";case"mm":return d+(Fd(a)?"minuty":"minut");case"h":return b?"godzina":"godzinę";case"hh":return d+(Fd(a)?"godziny":"godzin");case"MM":return d+(Fd(a)?"miesiące":"miesięcy");case"yy":return d+(Fd(a)?"lata":"lat")}} //! moment.js locale configuration //! locale : romanian (ro) //! author : Vlad Gurdiga : https://github.com/gurdiga //! author : Valentin Agachi : https://github.com/avaly -function Cd(a,b,c){var d={mm:"minute",hh:"ore",dd:"zile",MM:"luni",yy:"ani"},e=" ";return(a%100>=20||a>=100&&a%100===0)&&(e=" de "),a+e+d[c]} +function Hd(a,b,c){var d={mm:"minute",hh:"ore",dd:"zile",MM:"luni",yy:"ani"},e=" ";return(a%100>=20||a>=100&&a%100===0)&&(e=" de "),a+e+d[c]} //! moment.js locale configuration //! locale : russian (ru) //! author : Viktorminator : https://github.com/Viktorminator //! Author : Menelion Elensúle : https://github.com/Oire -function Dd(a,b){var c=a.split("_");return b%10===1&&b%100!==11?c[0]:b%10>=2&&4>=b%10&&(10>b%100||b%100>=20)?c[1]:c[2]}function Ed(a,b,c){var d={mm:b?"минута_минуты_минут":"минуту_минуты_минут",hh:"час_часа_часов",dd:"день_дня_дней",MM:"месяц_месяца_месяцев",yy:"год_года_лет"};return"m"===c?b?"минута":"минуту":a+" "+Dd(d[c],+a)}function Fd(a){return a>1&&5>a}function Gd(a,b,c,d){var e=a+" ";switch(c){case"s":return b||d?"pár sekúnd":"pár sekundami";case"m":return b?"minúta":d?"minútu":"minútou";case"mm":return b||d?e+(Fd(a)?"minúty":"minút"):e+"minútami";break;case"h":return b?"hodina":d?"hodinu":"hodinou";case"hh":return b||d?e+(Fd(a)?"hodiny":"hodín"):e+"hodinami";break;case"d":return b||d?"deň":"dňom";case"dd":return b||d?e+(Fd(a)?"dni":"dní"):e+"dňami";break;case"M":return b||d?"mesiac":"mesiacom";case"MM":return b||d?e+(Fd(a)?"mesiace":"mesiacov"):e+"mesiacmi";break;case"y":return b||d?"rok":"rokom";case"yy":return b||d?e+(Fd(a)?"roky":"rokov"):e+"rokmi"}} +//! author : Коренберг Марк : https://github.com/socketpair +function Id(a,b){var c=a.split("_");return b%10===1&&b%100!==11?c[0]:b%10>=2&&4>=b%10&&(10>b%100||b%100>=20)?c[1]:c[2]}function Jd(a,b,c){var d={mm:b?"минута_минуты_минут":"минуту_минуты_минут",hh:"час_часа_часов",dd:"день_дня_дней",MM:"месяц_месяца_месяцев",yy:"год_года_лет"};return"m"===c?b?"минута":"минуту":a+" "+Id(d[c],+a)}function Kd(a){return a>1&&5>a}function Ld(a,b,c,d){var e=a+" ";switch(c){case"s":return b||d?"pár sekúnd":"pár sekundami";case"m":return b?"minúta":d?"minútu":"minútou";case"mm":return b||d?e+(Kd(a)?"minúty":"minút"):e+"minútami";break;case"h":return b?"hodina":d?"hodinu":"hodinou";case"hh":return b||d?e+(Kd(a)?"hodiny":"hodín"):e+"hodinami";break;case"d":return b||d?"deň":"dňom";case"dd":return b||d?e+(Kd(a)?"dni":"dní"):e+"dňami";break;case"M":return b||d?"mesiac":"mesiacom";case"MM":return b||d?e+(Kd(a)?"mesiace":"mesiacov"):e+"mesiacmi";break;case"y":return b||d?"rok":"rokom";case"yy":return b||d?e+(Kd(a)?"roky":"rokov"):e+"rokmi"}} //! moment.js locale configuration //! locale : slovenian (sl) //! author : Robert Sedovšek : https://github.com/sedovsek -function Hd(a,b,c,d){var e=a+" ";switch(c){case"s":return b||d?"nekaj sekund":"nekaj sekundami";case"m":return b?"ena minuta":"eno minuto";case"mm":return e+=1===a?b?"minuta":"minuto":2===a?b||d?"minuti":"minutama":5>a?b||d?"minute":"minutami":b||d?"minut":"minutami";case"h":return b?"ena ura":"eno uro";case"hh":return e+=1===a?b?"ura":"uro":2===a?b||d?"uri":"urama":5>a?b||d?"ure":"urami":b||d?"ur":"urami";case"d":return b||d?"en dan":"enim dnem";case"dd":return e+=1===a?b||d?"dan":"dnem":2===a?b||d?"dni":"dnevoma":b||d?"dni":"dnevi";case"M":return b||d?"en mesec":"enim mesecem";case"MM":return e+=1===a?b||d?"mesec":"mesecem":2===a?b||d?"meseca":"mesecema":5>a?b||d?"mesece":"meseci":b||d?"mesecev":"meseci";case"y":return b||d?"eno leto":"enim letom";case"yy":return e+=1===a?b||d?"leto":"letom":2===a?b||d?"leti":"letoma":5>a?b||d?"leta":"leti":b||d?"let":"leti"}}function Id(a){var b=a;return b=-1!==a.indexOf("jaj")?b.slice(0,-3)+"leS":-1!==a.indexOf("jar")?b.slice(0,-3)+"waQ":-1!==a.indexOf("DIS")?b.slice(0,-3)+"nem":b+" pIq"}function Jd(a){var b=a;return b=-1!==a.indexOf("jaj")?b.slice(0,-3)+"Hu’":-1!==a.indexOf("jar")?b.slice(0,-3)+"wen":-1!==a.indexOf("DIS")?b.slice(0,-3)+"ben":b+" ret"}function Kd(a,b,c,d){var e=Ld(a);switch(c){case"mm":return e+" tup";case"hh":return e+" rep";case"dd":return e+" jaj";case"MM":return e+" jar";case"yy":return e+" DIS"}}function Ld(a){var b=Math.floor(a%1e3/100),c=Math.floor(a%100/10),d=a%10,e="";return b>0&&(e+=Lg[b]+"vatlh"),c>0&&(e+=(""!==e?" ":"")+Lg[c]+"maH"),d>0&&(e+=(""!==e?" ":"")+Lg[d]),""===e?"pagh":e}function Md(a,b,c,d){var e={s:["viensas secunds","'iensas secunds"],m:["'n míut","'iens míut"],mm:[a+" míuts",""+a+" míuts"],h:["'n þora","'iensa þora"],hh:[a+" þoras",""+a+" þoras"],d:["'n ziua","'iensa ziua"],dd:[a+" ziuas",""+a+" ziuas"],M:["'n mes","'iens mes"],MM:[a+" mesen",""+a+" mesen"],y:["'n ar","'iens ar"],yy:[a+" ars",""+a+" ars"]};return d?e[c][0]:b?e[c][0]:e[c][1]} +function Md(a,b,c,d){var e=a+" ";switch(c){case"s":return b||d?"nekaj sekund":"nekaj sekundami";case"m":return b?"ena minuta":"eno minuto";case"mm":return e+=1===a?b?"minuta":"minuto":2===a?b||d?"minuti":"minutama":5>a?b||d?"minute":"minutami":b||d?"minut":"minutami";case"h":return b?"ena ura":"eno uro";case"hh":return e+=1===a?b?"ura":"uro":2===a?b||d?"uri":"urama":5>a?b||d?"ure":"urami":b||d?"ur":"urami";case"d":return b||d?"en dan":"enim dnem";case"dd":return e+=1===a?b||d?"dan":"dnem":2===a?b||d?"dni":"dnevoma":b||d?"dni":"dnevi";case"M":return b||d?"en mesec":"enim mesecem";case"MM":return e+=1===a?b||d?"mesec":"mesecem":2===a?b||d?"meseca":"mesecema":5>a?b||d?"mesece":"meseci":b||d?"mesecev":"meseci";case"y":return b||d?"eno leto":"enim letom";case"yy":return e+=1===a?b||d?"leto":"letom":2===a?b||d?"leti":"letoma":5>a?b||d?"leta":"leti":b||d?"let":"leti"}}function Nd(a){var b=a;return b=-1!==a.indexOf("jaj")?b.slice(0,-3)+"leS":-1!==a.indexOf("jar")?b.slice(0,-3)+"waQ":-1!==a.indexOf("DIS")?b.slice(0,-3)+"nem":b+" pIq"}function Od(a){var b=a;return b=-1!==a.indexOf("jaj")?b.slice(0,-3)+"Hu’":-1!==a.indexOf("jar")?b.slice(0,-3)+"wen":-1!==a.indexOf("DIS")?b.slice(0,-3)+"ben":b+" ret"}function Pd(a,b,c,d){var e=Qd(a);switch(c){case"mm":return e+" tup";case"hh":return e+" rep";case"dd":return e+" jaj";case"MM":return e+" jar";case"yy":return e+" DIS"}}function Qd(a){var b=Math.floor(a%1e3/100),c=Math.floor(a%100/10),d=a%10,e="";return b>0&&(e+=Sg[b]+"vatlh"),c>0&&(e+=(""!==e?" ":"")+Sg[c]+"maH"),d>0&&(e+=(""!==e?" ":"")+Sg[d]),""===e?"pagh":e}function Rd(a,b,c,d){var e={s:["viensas secunds","'iensas secunds"],m:["'n míut","'iens míut"],mm:[a+" míuts",""+a+" míuts"],h:["'n þora","'iensa þora"],hh:[a+" þoras",""+a+" þoras"],d:["'n ziua","'iensa ziua"],dd:[a+" ziuas",""+a+" ziuas"],M:["'n mes","'iens mes"],MM:[a+" mesen",""+a+" mesen"],y:["'n ar","'iens ar"],yy:[a+" ars",""+a+" ars"]};return d?e[c][0]:b?e[c][0]:e[c][1]} //! moment.js locale configuration //! locale : ukrainian (uk) //! author : zemlanin : https://github.com/zemlanin //! Author : Menelion Elensúle : https://github.com/Oire -function Nd(a,b){var c=a.split("_");return b%10===1&&b%100!==11?c[0]:b%10>=2&&4>=b%10&&(10>b%100||b%100>=20)?c[1]:c[2]}function Od(a,b,c){var d={mm:b?"хвилина_хвилини_хвилин":"хвилину_хвилини_хвилин",hh:b?"година_години_годин":"годину_години_годин",dd:"день_дні_днів",MM:"місяць_місяці_місяців",yy:"рік_роки_років"};return"m"===c?b?"хвилина":"хвилину":"h"===c?b?"година":"годину":a+" "+Nd(d[c],+a)}function Pd(a,b){var c={nominative:"неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота".split("_"),accusative:"неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу".split("_"),genitive:"неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи".split("_")},d=/(\[[ВвУу]\]) ?dddd/.test(b)?"accusative":/\[?(?:минулої|наступної)? ?\] ?dddd/.test(b)?"genitive":"nominative";return c[d][a.day()]}function Qd(a){return function(){return a+"о"+(11===this.hours()?"б":"")+"] LT"}}var Rd,Sd,Td=a.momentProperties=[],Ud=!1,Vd={},Wd={},Xd=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Yd=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Zd={},$d={},_d=/\d/,ae=/\d\d/,be=/\d{3}/,ce=/\d{4}/,de=/[+-]?\d{6}/,ee=/\d\d?/,fe=/\d\d\d\d?/,ge=/\d\d\d\d\d\d?/,he=/\d{1,3}/,ie=/\d{1,4}/,je=/[+-]?\d{1,6}/,ke=/\d+/,le=/[+-]?\d+/,me=/Z|[+-]\d\d:?\d\d/gi,ne=/Z|[+-]\d\d(?::?\d\d)?/gi,oe=/[+-]?\d+(\.\d{1,3})?/,pe=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,qe={},re={},se=0,te=1,ue=2,ve=3,we=4,xe=5,ye=6,ze=7,Ae=8;J("M",["MM",2],"Mo",function(){return this.month()+1}),J("MMM",0,0,function(a){return this.localeData().monthsShort(this,a)}),J("MMMM",0,0,function(a){return this.localeData().months(this,a)}),A("month","M"),O("M",ee),O("MM",ee,ae),O("MMM",function(a,b){return b.monthsShortRegex(a)}),O("MMMM",function(a,b){return b.monthsRegex(a)}),S(["M","MM"],function(a,b){b[te]=r(a)-1}),S(["MMM","MMMM"],function(a,b,c,d){var e=c._locale.monthsParse(a,d,c._strict);null!=e?b[te]=e:j(c).invalidMonth=a});var Be=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/,Ce="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),De="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Ee=pe,Fe=pe,Ge={};a.suppressDeprecationWarnings=!1;var He=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,Ie=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,Je=/Z|[+-]\d\d(?::?\d\d)?/,Ke=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],Le=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Me=/^\/?Date\((\-?\d+)/i;a.createFromInputFallback=fa("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(a){a._d=new Date(a._i+(a._useUTC?" UTC":""))}),J("Y",0,0,function(){var a=this.year();return 9999>=a?""+a:"+"+a}),J(0,["YY",2],0,function(){return this.year()%100}),J(0,["YYYY",4],0,"year"),J(0,["YYYYY",5],0,"year"),J(0,["YYYYYY",6,!0],0,"year"),A("year","y"),O("Y",le),O("YY",ee,ae),O("YYYY",ie,ce),O("YYYYY",je,de),O("YYYYYY",je,de),S(["YYYYY","YYYYYY"],se),S("YYYY",function(b,c){c[se]=2===b.length?a.parseTwoDigitYear(b):r(b)}),S("YY",function(b,c){c[se]=a.parseTwoDigitYear(b)}),S("Y",function(a,b){b[se]=parseInt(a,10)}),a.parseTwoDigitYear=function(a){return r(a)+(r(a)>68?1900:2e3)};var Ne=E("FullYear",!1);a.ISO_8601=function(){};var Oe=fa("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var a=Ea.apply(null,arguments);return this.isValid()&&a.isValid()?this>a?this:a:l()}),Pe=fa("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var a=Ea.apply(null,arguments);return this.isValid()&&a.isValid()?a>this?this:a:l()}),Qe=function(){return Date.now?Date.now():+new Date};Ka("Z",":"),Ka("ZZ",""),O("Z",ne),O("ZZ",ne),S(["Z","ZZ"],function(a,b,c){c._useUTC=!0,c._tzm=La(ne,a)});var Re=/([\+\-]|\d\d)/gi;a.updateOffset=function(){};var Se=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?\d*)?$/,Te=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/;Za.fn=Ia.prototype;var Ue=bb(1,"add"),Ve=bb(-1,"subtract");a.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";var We=fa("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(a){return void 0===a?this.localeData():this.locale(a)});J(0,["gg",2],0,function(){return this.weekYear()%100}),J(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Ib("gggg","weekYear"),Ib("ggggg","weekYear"),Ib("GGGG","isoWeekYear"),Ib("GGGGG","isoWeekYear"),A("weekYear","gg"),A("isoWeekYear","GG"),O("G",le),O("g",le),O("GG",ee,ae),O("gg",ee,ae),O("GGGG",ie,ce),O("gggg",ie,ce),O("GGGGG",je,de),O("ggggg",je,de),T(["gggg","ggggg","GGGG","GGGGG"],function(a,b,c,d){b[d.substr(0,2)]=r(a)}),T(["gg","GG"],function(b,c,d,e){c[e]=a.parseTwoDigitYear(b)}),J("Q",0,"Qo","quarter"),A("quarter","Q"),O("Q",_d),S("Q",function(a,b){b[te]=3*(r(a)-1)}),J("w",["ww",2],"wo","week"),J("W",["WW",2],"Wo","isoWeek"),A("week","w"),A("isoWeek","W"),O("w",ee),O("ww",ee,ae),O("W",ee),O("WW",ee,ae),T(["w","ww","W","WW"],function(a,b,c,d){b[d.substr(0,1)]=r(a)});var Xe={dow:0,doy:6};J("D",["DD",2],"Do","date"),A("date","D"),O("D",ee),O("DD",ee,ae),O("Do",function(a,b){return a?b._ordinalParse:b._ordinalParseLenient}),S(["D","DD"],ue),S("Do",function(a,b){b[ue]=r(a.match(ee)[0],10)});var Ye=E("Date",!0);J("d",0,"do","day"),J("dd",0,0,function(a){return this.localeData().weekdaysMin(this,a)}),J("ddd",0,0,function(a){return this.localeData().weekdaysShort(this,a)}),J("dddd",0,0,function(a){return this.localeData().weekdays(this,a)}),J("e",0,0,"weekday"),J("E",0,0,"isoWeekday"),A("day","d"),A("weekday","e"),A("isoWeekday","E"),O("d",ee),O("e",ee),O("E",ee),O("dd",pe),O("ddd",pe),O("dddd",pe),T(["dd","ddd","dddd"],function(a,b,c,d){var e=c._locale.weekdaysParse(a,d,c._strict);null!=e?b.d=e:j(c).invalidWeekday=a}),T(["d","e","E"],function(a,b,c,d){b[d]=r(a)});var Ze="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),$e="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),_e="Su_Mo_Tu_We_Th_Fr_Sa".split("_");J("DDD",["DDDD",3],"DDDo","dayOfYear"),A("dayOfYear","DDD"),O("DDD",he),O("DDDD",be),S(["DDD","DDDD"],function(a,b,c){c._dayOfYear=r(a)}),J("H",["HH",2],0,"hour"),J("h",["hh",2],0,cc),J("hmm",0,0,function(){return""+cc.apply(this)+I(this.minutes(),2)}),J("hmmss",0,0,function(){return""+cc.apply(this)+I(this.minutes(),2)+I(this.seconds(),2)}),J("Hmm",0,0,function(){return""+this.hours()+I(this.minutes(),2)}),J("Hmmss",0,0,function(){return""+this.hours()+I(this.minutes(),2)+I(this.seconds(),2)}),dc("a",!0),dc("A",!1),A("hour","h"),O("a",ec),O("A",ec),O("H",ee),O("h",ee),O("HH",ee,ae),O("hh",ee,ae),O("hmm",fe),O("hmmss",ge),O("Hmm",fe),O("Hmmss",ge),S(["H","HH"],ve),S(["a","A"],function(a,b,c){c._isPm=c._locale.isPM(a),c._meridiem=a}),S(["h","hh"],function(a,b,c){b[ve]=r(a),j(c).bigHour=!0}),S("hmm",function(a,b,c){var d=a.length-2;b[ve]=r(a.substr(0,d)),b[we]=r(a.substr(d)),j(c).bigHour=!0}),S("hmmss",function(a,b,c){var d=a.length-4,e=a.length-2;b[ve]=r(a.substr(0,d)),b[we]=r(a.substr(d,2)),b[xe]=r(a.substr(e)),j(c).bigHour=!0}),S("Hmm",function(a,b,c){var d=a.length-2;b[ve]=r(a.substr(0,d)),b[we]=r(a.substr(d))}),S("Hmmss",function(a,b,c){var d=a.length-4,e=a.length-2;b[ve]=r(a.substr(0,d)),b[we]=r(a.substr(d,2)),b[xe]=r(a.substr(e))});var af=/[ap]\.?m?\.?/i,bf=E("Hours",!0);J("m",["mm",2],0,"minute"),A("minute","m"),O("m",ee),O("mm",ee,ae),S(["m","mm"],we);var cf=E("Minutes",!1);J("s",["ss",2],0,"second"),A("second","s"),O("s",ee),O("ss",ee,ae),S(["s","ss"],xe);var df=E("Seconds",!1);J("S",0,0,function(){return~~(this.millisecond()/100)}),J(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),J(0,["SSS",3],0,"millisecond"),J(0,["SSSS",4],0,function(){return 10*this.millisecond()}),J(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),J(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),J(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),J(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),J(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),A("millisecond","ms"),O("S",he,_d),O("SS",he,ae),O("SSS",he,be);var ef;for(ef="SSSS";ef.length<=9;ef+="S")O(ef,ke);for(ef="S";ef.length<=9;ef+="S")S(ef,hc);var ff=E("Milliseconds",!1);J("z",0,0,"zoneAbbr"),J("zz",0,0,"zoneName");var gf=o.prototype;gf.add=Ue,gf.calendar=db,gf.clone=eb,gf.diff=lb,gf.endOf=xb,gf.format=pb,gf.from=qb,gf.fromNow=rb,gf.to=sb,gf.toNow=tb,gf.get=H,gf.invalidAt=Gb,gf.isAfter=fb,gf.isBefore=gb,gf.isBetween=hb,gf.isSame=ib,gf.isSameOrAfter=jb,gf.isSameOrBefore=kb,gf.isValid=Eb,gf.lang=We,gf.locale=ub,gf.localeData=vb,gf.max=Pe,gf.min=Oe,gf.parsingFlags=Fb,gf.set=H,gf.startOf=wb,gf.subtract=Ve,gf.toArray=Bb,gf.toObject=Cb,gf.toDate=Ab,gf.toISOString=ob,gf.toJSON=Db,gf.toString=nb,gf.unix=zb,gf.valueOf=yb,gf.creationData=Hb,gf.year=Ne,gf.isLeapYear=na,gf.weekYear=Jb,gf.isoWeekYear=Kb,gf.quarter=gf.quarters=Pb,gf.month=$,gf.daysInMonth=_,gf.week=gf.weeks=Tb,gf.isoWeek=gf.isoWeeks=Ub,gf.weeksInYear=Mb,gf.isoWeeksInYear=Lb,gf.date=Ye,gf.day=gf.days=$b,gf.weekday=_b,gf.isoWeekday=ac,gf.dayOfYear=bc,gf.hour=gf.hours=bf,gf.minute=gf.minutes=cf,gf.second=gf.seconds=df,gf.millisecond=gf.milliseconds=ff,gf.utcOffset=Oa,gf.utc=Qa,gf.local=Ra,gf.parseZone=Sa,gf.hasAlignedHourOffset=Ta,gf.isDST=Ua,gf.isDSTShifted=Va,gf.isLocal=Wa,gf.isUtcOffset=Xa,gf.isUtc=Ya,gf.isUTC=Ya,gf.zoneAbbr=ic,gf.zoneName=jc,gf.dates=fa("dates accessor is deprecated. Use date instead.",Ye),gf.months=fa("months accessor is deprecated. Use month instead",$),gf.years=fa("years accessor is deprecated. Use year instead",Ne),gf.zone=fa("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",Pa);var hf=gf,jf={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},kf={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"},lf="Invalid date",mf="%d",nf=/\d{1,2}/,of={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"},pf=t.prototype;pf._calendar=jf,pf.calendar=mc,pf._longDateFormat=kf,pf.longDateFormat=nc,pf._invalidDate=lf,pf.invalidDate=oc,pf._ordinal=mf,pf.ordinal=pc,pf._ordinalParse=nf,pf.preparse=qc,pf.postformat=qc,pf._relativeTime=of,pf.relativeTime=rc,pf.pastFuture=sc,pf.set=tc,pf.months=W,pf._months=Ce,pf.monthsShort=X,pf._monthsShort=De,pf.monthsParse=Y,pf._monthsRegex=Fe,pf.monthsRegex=ba,pf._monthsShortRegex=Ee,pf.monthsShortRegex=aa,pf.week=Qb,pf._week=Xe,pf.firstDayOfYear=Sb,pf.firstDayOfWeek=Rb,pf.weekdays=Wb,pf._weekdays=Ze,pf.weekdaysMin=Yb,pf._weekdaysMin=_e,pf.weekdaysShort=Xb,pf._weekdaysShort=$e,pf.weekdaysParse=Zb,pf.isPM=fc,pf._meridiemParse=af,pf.meridiem=gc,x("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(a){var b=a%10,c=1===r(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c}}),a.lang=fa("moment.lang is deprecated. Use moment.locale instead.",x),a.langData=fa("moment.langData is deprecated. Use moment.localeData instead.",z);var qf=Math.abs,rf=Lc("ms"),sf=Lc("s"),tf=Lc("m"),uf=Lc("h"),vf=Lc("d"),wf=Lc("w"),xf=Lc("M"),yf=Lc("y"),zf=Nc("milliseconds"),Af=Nc("seconds"),Bf=Nc("minutes"),Cf=Nc("hours"),Df=Nc("days"),Ef=Nc("months"),Ff=Nc("years"),Gf=Math.round,Hf={s:45,m:45,h:22,d:26,M:11},If=Math.abs,Jf=Ia.prototype;Jf.abs=Bc,Jf.add=Dc,Jf.subtract=Ec,Jf.as=Jc,Jf.asMilliseconds=rf,Jf.asSeconds=sf,Jf.asMinutes=tf,Jf.asHours=uf,Jf.asDays=vf,Jf.asWeeks=wf,Jf.asMonths=xf,Jf.asYears=yf,Jf.valueOf=Kc,Jf._bubble=Gc,Jf.get=Mc,Jf.milliseconds=zf,Jf.seconds=Af,Jf.minutes=Bf,Jf.hours=Cf,Jf.days=Df,Jf.weeks=Oc,Jf.months=Ef,Jf.years=Ff,Jf.humanize=Sc,Jf.toISOString=Tc,Jf.toString=Tc,Jf.toJSON=Tc,Jf.locale=ub,Jf.localeData=vb,Jf.toIsoString=fa("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Tc),Jf.lang=We,J("X",0,0,"unix"),J("x",0,0,"valueOf"),O("x",le),O("X",oe),S("X",function(a,b,c){c._d=new Date(1e3*parseFloat(a,10))}),S("x",function(a,b,c){c._d=new Date(r(a))}), +function Sd(a,b){var c=a.split("_");return b%10===1&&b%100!==11?c[0]:b%10>=2&&4>=b%10&&(10>b%100||b%100>=20)?c[1]:c[2]}function Td(a,b,c){var d={mm:b?"хвилина_хвилини_хвилин":"хвилину_хвилини_хвилин",hh:b?"година_години_годин":"годину_години_годин",dd:"день_дні_днів",MM:"місяць_місяці_місяців",yy:"рік_роки_років"};return"m"===c?b?"хвилина":"хвилину":"h"===c?b?"година":"годину":a+" "+Sd(d[c],+a)}function Ud(a,b){var c={nominative:"неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота".split("_"),accusative:"неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу".split("_"),genitive:"неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи".split("_")},d=/(\[[ВвУу]\]) ?dddd/.test(b)?"accusative":/\[?(?:минулої|наступної)? ?\] ?dddd/.test(b)?"genitive":"nominative";return c[d][a.day()]}function Vd(a){return function(){return a+"о"+(11===this.hours()?"б":"")+"] LT"}}var Wd,Xd=a.momentProperties=[],Yd=!1,Zd={};a.suppressDeprecationWarnings=!1;var $d,_d={},ae={},be=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,ce=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,de={},ee={},fe=/\d/,ge=/\d\d/,he=/\d{3}/,ie=/\d{4}/,je=/[+-]?\d{6}/,ke=/\d\d?/,le=/\d\d\d\d?/,me=/\d\d\d\d\d\d?/,ne=/\d{1,3}/,oe=/\d{1,4}/,pe=/[+-]?\d{1,6}/,qe=/\d+/,re=/[+-]?\d+/,se=/Z|[+-]\d\d:?\d\d/gi,te=/Z|[+-]\d\d(?::?\d\d)?/gi,ue=/[+-]?\d+(\.\d{1,3})?/,ve=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,we={},xe={},ye=0,ze=1,Ae=2,Be=3,Ce=4,De=5,Ee=6,Fe=7,Ge=8;R("M",["MM",2],"Mo",function(){return this.month()+1}),R("MMM",0,0,function(a){return this.localeData().monthsShort(this,a)}),R("MMMM",0,0,function(a){return this.localeData().months(this,a)}),J("month","M"),W("M",ke),W("MM",ke,ge),W("MMM",function(a,b){return b.monthsShortRegex(a)}),W("MMMM",function(a,b){return b.monthsRegex(a)}),$(["M","MM"],function(a,b){b[ze]=r(a)-1}),$(["MMM","MMMM"],function(a,b,c,d){var e=c._locale.monthsParse(a,d,c._strict);null!=e?b[ze]=e:j(c).invalidMonth=a});var He=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/,Ie="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Je="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Ke=ve,Le=ve,Me=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,Ne=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,Oe=/Z|[+-]\d\d(?::?\d\d)?/,Pe=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],Qe=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Re=/^\/?Date\((\-?\d+)/i;a.createFromInputFallback=u("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(a){a._d=new Date(a._i+(a._useUTC?" UTC":""))}),R("Y",0,0,function(){var a=this.year();return 9999>=a?""+a:"+"+a}),R(0,["YY",2],0,function(){return this.year()%100}),R(0,["YYYY",4],0,"year"),R(0,["YYYYY",5],0,"year"),R(0,["YYYYYY",6,!0],0,"year"),J("year","y"),W("Y",re),W("YY",ke,ge),W("YYYY",oe,ie),W("YYYYY",pe,je),W("YYYYYY",pe,je),$(["YYYYY","YYYYYY"],ye),$("YYYY",function(b,c){c[ye]=2===b.length?a.parseTwoDigitYear(b):r(b)}),$("YY",function(b,c){c[ye]=a.parseTwoDigitYear(b)}),$("Y",function(a,b){b[ye]=parseInt(a,10)}),a.parseTwoDigitYear=function(a){return r(a)+(r(a)>68?1900:2e3)};var Se=M("FullYear",!1);a.ISO_8601=function(){};var Te=u("moment().min is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var a=Ja.apply(null,arguments);return this.isValid()&&a.isValid()?this>a?this:a:l()}),Ue=u("moment().max is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var a=Ja.apply(null,arguments);return this.isValid()&&a.isValid()?a>this?this:a:l()}),Ve=function(){return Date.now?Date.now():+new Date};Pa("Z",":"),Pa("ZZ",""),W("Z",te),W("ZZ",te),$(["Z","ZZ"],function(a,b,c){c._useUTC=!0,c._tzm=Qa(te,a)});var We=/([\+\-]|\d\d)/gi;a.updateOffset=function(){};var Xe=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?\d*)?$/,Ye=/^(-)?P(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)W)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?$/;cb.fn=Na.prototype;var Ze=hb(1,"add"),$e=hb(-1,"subtract");a.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";var _e=u("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(a){return void 0===a?this.localeData():this.locale(a)});R(0,["gg",2],0,function(){return this.weekYear()%100}),R(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Ob("gggg","weekYear"),Ob("ggggg","weekYear"),Ob("GGGG","isoWeekYear"),Ob("GGGGG","isoWeekYear"),J("weekYear","gg"),J("isoWeekYear","GG"),W("G",re),W("g",re),W("GG",ke,ge),W("gg",ke,ge),W("GGGG",oe,ie),W("gggg",oe,ie),W("GGGGG",pe,je),W("ggggg",pe,je),_(["gggg","ggggg","GGGG","GGGGG"],function(a,b,c,d){b[d.substr(0,2)]=r(a)}),_(["gg","GG"],function(b,c,d,e){c[e]=a.parseTwoDigitYear(b)}),R("Q",0,"Qo","quarter"),J("quarter","Q"),W("Q",fe),$("Q",function(a,b){b[ze]=3*(r(a)-1)}),R("w",["ww",2],"wo","week"),R("W",["WW",2],"Wo","isoWeek"),J("week","w"),J("isoWeek","W"),W("w",ke),W("ww",ke,ge),W("W",ke),W("WW",ke,ge),_(["w","ww","W","WW"],function(a,b,c,d){b[d.substr(0,1)]=r(a)});var af={dow:0,doy:6};R("D",["DD",2],"Do","date"),J("date","D"),W("D",ke),W("DD",ke,ge),W("Do",function(a,b){return a?b._ordinalParse:b._ordinalParseLenient}),$(["D","DD"],Ae),$("Do",function(a,b){b[Ae]=r(a.match(ke)[0],10)});var bf=M("Date",!0);R("d",0,"do","day"),R("dd",0,0,function(a){return this.localeData().weekdaysMin(this,a)}),R("ddd",0,0,function(a){return this.localeData().weekdaysShort(this,a)}),R("dddd",0,0,function(a){return this.localeData().weekdays(this,a)}),R("e",0,0,"weekday"),R("E",0,0,"isoWeekday"),J("day","d"),J("weekday","e"),J("isoWeekday","E"),W("d",ke),W("e",ke),W("E",ke),W("dd",ve),W("ddd",ve),W("dddd",ve),_(["dd","ddd","dddd"],function(a,b,c,d){var e=c._locale.weekdaysParse(a,d,c._strict);null!=e?b.d=e:j(c).invalidWeekday=a}),_(["d","e","E"],function(a,b,c,d){b[d]=r(a)});var cf="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),df="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),ef="Su_Mo_Tu_We_Th_Fr_Sa".split("_");R("DDD",["DDDD",3],"DDDo","dayOfYear"),J("dayOfYear","DDD"),W("DDD",ne),W("DDDD",he),$(["DDD","DDDD"],function(a,b,c){c._dayOfYear=r(a)}),R("H",["HH",2],0,"hour"),R("h",["hh",2],0,ic),R("hmm",0,0,function(){return""+ic.apply(this)+Q(this.minutes(),2)}),R("hmmss",0,0,function(){return""+ic.apply(this)+Q(this.minutes(),2)+Q(this.seconds(),2)}),R("Hmm",0,0,function(){return""+this.hours()+Q(this.minutes(),2)}),R("Hmmss",0,0,function(){return""+this.hours()+Q(this.minutes(),2)+Q(this.seconds(),2)}),jc("a",!0),jc("A",!1),J("hour","h"),W("a",kc),W("A",kc),W("H",ke),W("h",ke),W("HH",ke,ge),W("hh",ke,ge),W("hmm",le),W("hmmss",me),W("Hmm",le),W("Hmmss",me),$(["H","HH"],Be),$(["a","A"],function(a,b,c){c._isPm=c._locale.isPM(a),c._meridiem=a}),$(["h","hh"],function(a,b,c){b[Be]=r(a),j(c).bigHour=!0}),$("hmm",function(a,b,c){var d=a.length-2;b[Be]=r(a.substr(0,d)),b[Ce]=r(a.substr(d)),j(c).bigHour=!0}),$("hmmss",function(a,b,c){var d=a.length-4,e=a.length-2;b[Be]=r(a.substr(0,d)),b[Ce]=r(a.substr(d,2)),b[De]=r(a.substr(e)),j(c).bigHour=!0}),$("Hmm",function(a,b,c){var d=a.length-2;b[Be]=r(a.substr(0,d)),b[Ce]=r(a.substr(d))}),$("Hmmss",function(a,b,c){var d=a.length-4,e=a.length-2;b[Be]=r(a.substr(0,d)),b[Ce]=r(a.substr(d,2)),b[De]=r(a.substr(e))});var ff=/[ap]\.?m?\.?/i,gf=M("Hours",!0);R("m",["mm",2],0,"minute"),J("minute","m"),W("m",ke),W("mm",ke,ge),$(["m","mm"],Ce);var hf=M("Minutes",!1);R("s",["ss",2],0,"second"),J("second","s"),W("s",ke),W("ss",ke,ge),$(["s","ss"],De);var jf=M("Seconds",!1);R("S",0,0,function(){return~~(this.millisecond()/100)}),R(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),R(0,["SSS",3],0,"millisecond"),R(0,["SSSS",4],0,function(){return 10*this.millisecond()}),R(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),R(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),R(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),R(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),R(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),J("millisecond","ms"),W("S",ne,fe),W("SS",ne,ge),W("SSS",ne,he);var kf;for(kf="SSSS";kf.length<=9;kf+="S")W(kf,qe);for(kf="S";kf.length<=9;kf+="S")$(kf,nc);var lf=M("Milliseconds",!1);R("z",0,0,"zoneAbbr"),R("zz",0,0,"zoneName");var mf=o.prototype;mf.add=Ze,mf.calendar=jb,mf.clone=kb,mf.diff=rb,mf.endOf=Db,mf.format=vb,mf.from=wb,mf.fromNow=xb,mf.to=yb,mf.toNow=zb,mf.get=P,mf.invalidAt=Mb,mf.isAfter=lb,mf.isBefore=mb,mf.isBetween=nb,mf.isSame=ob,mf.isSameOrAfter=pb,mf.isSameOrBefore=qb,mf.isValid=Kb,mf.lang=_e,mf.locale=Ab,mf.localeData=Bb,mf.max=Ue,mf.min=Te,mf.parsingFlags=Lb,mf.set=P,mf.startOf=Cb,mf.subtract=$e,mf.toArray=Hb,mf.toObject=Ib,mf.toDate=Gb,mf.toISOString=ub,mf.toJSON=Jb,mf.toString=tb,mf.unix=Fb,mf.valueOf=Eb,mf.creationData=Nb,mf.year=Se,mf.isLeapYear=sa,mf.weekYear=Pb,mf.isoWeekYear=Qb,mf.quarter=mf.quarters=Vb,mf.month=ga,mf.daysInMonth=ha,mf.week=mf.weeks=Zb,mf.isoWeek=mf.isoWeeks=$b,mf.weeksInYear=Sb,mf.isoWeeksInYear=Rb,mf.date=bf,mf.day=mf.days=ec,mf.weekday=fc,mf.isoWeekday=gc,mf.dayOfYear=hc,mf.hour=mf.hours=gf,mf.minute=mf.minutes=hf,mf.second=mf.seconds=jf,mf.millisecond=mf.milliseconds=lf,mf.utcOffset=Ta,mf.utc=Va,mf.local=Wa,mf.parseZone=Xa,mf.hasAlignedHourOffset=Ya,mf.isDST=Za,mf.isDSTShifted=$a,mf.isLocal=_a,mf.isUtcOffset=ab,mf.isUtc=bb,mf.isUTC=bb,mf.zoneAbbr=oc,mf.zoneName=pc,mf.dates=u("dates accessor is deprecated. Use date instead.",bf),mf.months=u("months accessor is deprecated. Use month instead",ga),mf.years=u("years accessor is deprecated. Use year instead",Se),mf.zone=u("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",Ua);var nf=mf,of={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},pf={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"},qf="Invalid date",rf="%d",sf=/\d{1,2}/,tf={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"},uf=A.prototype;uf._calendar=of,uf.calendar=sc,uf._longDateFormat=pf,uf.longDateFormat=tc,uf._invalidDate=qf,uf.invalidDate=uc,uf._ordinal=rf,uf.ordinal=vc,uf._ordinalParse=sf,uf.preparse=wc,uf.postformat=wc,uf._relativeTime=tf,uf.relativeTime=xc,uf.pastFuture=yc,uf.set=y,uf.months=ca,uf._months=Ie,uf.monthsShort=da,uf._monthsShort=Je,uf.monthsParse=ea,uf._monthsRegex=Le,uf.monthsRegex=ja,uf._monthsShortRegex=Ke,uf.monthsShortRegex=ia,uf.week=Wb,uf._week=af,uf.firstDayOfYear=Yb,uf.firstDayOfWeek=Xb,uf.weekdays=ac,uf._weekdays=cf,uf.weekdaysMin=cc,uf._weekdaysMin=ef,uf.weekdaysShort=bc,uf._weekdaysShort=df,uf.weekdaysParse=dc,uf.isPM=lc,uf._meridiemParse=ff,uf.meridiem=mc,E("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(a){var b=a%10,c=1===r(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c}}),a.lang=u("moment.lang is deprecated. Use moment.locale instead.",E),a.langData=u("moment.langData is deprecated. Use moment.localeData instead.",H);var vf=Math.abs,wf=Qc("ms"),xf=Qc("s"),yf=Qc("m"),zf=Qc("h"),Af=Qc("d"),Bf=Qc("w"),Cf=Qc("M"),Df=Qc("y"),Ef=Sc("milliseconds"),Ff=Sc("seconds"),Gf=Sc("minutes"),Hf=Sc("hours"),If=Sc("days"),Jf=Sc("months"),Kf=Sc("years"),Lf=Math.round,Mf={s:45,m:45,h:22,d:26,M:11},Nf=Math.abs,Of=Na.prototype;Of.abs=Gc,Of.add=Ic,Of.subtract=Jc,Of.as=Oc,Of.asMilliseconds=wf,Of.asSeconds=xf,Of.asMinutes=yf,Of.asHours=zf,Of.asDays=Af,Of.asWeeks=Bf,Of.asMonths=Cf,Of.asYears=Df,Of.valueOf=Pc,Of._bubble=Lc,Of.get=Rc,Of.milliseconds=Ef,Of.seconds=Ff,Of.minutes=Gf,Of.hours=Hf,Of.days=If,Of.weeks=Tc,Of.months=Jf,Of.years=Kf,Of.humanize=Xc,Of.toISOString=Yc,Of.toString=Yc,Of.toJSON=Yc,Of.locale=Ab,Of.localeData=Bb,Of.toIsoString=u("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Yc),Of.lang=_e,R("X",0,0,"unix"),R("x",0,0,"valueOf"),W("x",re),W("X",ue),$("X",function(a,b,c){c._d=new Date(1e3*parseFloat(a,10))}),$("x",function(a,b,c){c._d=new Date(r(a))}), //! moment.js -//! version : 2.11.2 +//! version : 2.12.0 //! authors : Tim Wood, Iskren Chernev, Moment.js contributors //! license : MIT //! momentjs.com -a.version="2.11.2",b(Ea),a.fn=hf,a.min=Ga,a.max=Ha,a.now=Qe,a.utc=h,a.unix=kc,a.months=wc,a.isDate=d,a.locale=x,a.invalid=l,a.duration=Za,a.isMoment=p,a.weekdays=yc,a.parseZone=lc,a.localeData=z,a.isDuration=Ja,a.monthsShort=xc,a.weekdaysMin=Ac,a.defineLocale=y,a.weekdaysShort=zc,a.normalizeUnits=B,a.relativeTimeThreshold=Rc,a.prototype=hf;var Kf=a,Lf=(Kf.defineLocale("af",{months:"Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des".split("_"),weekdays:"Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag".split("_"),weekdaysShort:"Son_Maa_Din_Woe_Don_Vry_Sat".split("_"),weekdaysMin:"So_Ma_Di_Wo_Do_Vr_Sa".split("_"),meridiemParse:/vm|nm/i,isPM:function(a){return/^nm$/i.test(a)},meridiem:function(a,b,c){return 12>a?c?"vm":"VM":c?"nm":"NM"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Vandag om] LT",nextDay:"[Môre om] LT",nextWeek:"dddd [om] LT",lastDay:"[Gister om] LT",lastWeek:"[Laas] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oor %s",past:"%s gelede",s:"'n paar sekondes",m:"'n minuut",mm:"%d minute",h:"'n uur",hh:"%d ure",d:"'n dag",dd:"%d dae",M:"'n maand",MM:"%d maande",y:"'n jaar",yy:"%d jaar"},ordinalParse:/\d{1,2}(ste|de)/,ordinal:function(a){return a+(1===a||8===a||a>=20?"ste":"de")},week:{dow:1,doy:4}}),Kf.defineLocale("ar-ma",{months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdays:"الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:6,doy:12}}),{1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"}),Mf={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},Nf=(Kf.defineLocale("ar-sa",{months:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(a){return"م"===a},meridiem:function(a,b,c){return 12>a?"ص":"م"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},preparse:function(a){return a.replace(/[١٢٣٤٥٦٧٨٩٠]/g,function(a){return Mf[a]}).replace(/،/g,",")},postformat:function(a){return a.replace(/\d/g,function(a){return Lf[a]}).replace(/,/g,"،")},week:{dow:6,doy:12}}),Kf.defineLocale("ar-tn",{months:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:1,doy:4}}),{1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"}),Of={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},Pf=function(a){return 0===a?0:1===a?1:2===a?2:a%100>=3&&10>=a%100?3:a%100>=11?4:5},Qf={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},Rf=function(a){return function(b,c,d,e){var f=Pf(b),g=Qf[a][Pf(b)];return 2===f&&(g=g[c?0:1]),g.replace(/%d/i,b)}},Sf=["كانون الثاني يناير","شباط فبراير","آذار مارس","نيسان أبريل","أيار مايو","حزيران يونيو","تموز يوليو","آب أغسطس","أيلول سبتمبر","تشرين الأول أكتوبر","تشرين الثاني نوفمبر","كانون الأول ديسمبر"],Tf=(Kf.defineLocale("ar",{months:Sf,monthsShort:Sf,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(a){return"م"===a},meridiem:function(a,b,c){return 12>a?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:Rf("s"),m:Rf("m"),mm:Rf("m"),h:Rf("h"),hh:Rf("h"),d:Rf("d"),dd:Rf("d"),M:Rf("M"),MM:Rf("M"),y:Rf("y"),yy:Rf("y")},preparse:function(a){return a.replace(/\u200f/g,"").replace(/[١٢٣٤٥٦٧٨٩٠]/g,function(a){return Of[a]}).replace(/،/g,",")},postformat:function(a){return a.replace(/\d/g,function(a){return Nf[a]}).replace(/,/g,"،")},week:{dow:6,doy:12}}),{1:"-inci",5:"-inci",8:"-inci",70:"-inci",80:"-inci",2:"-nci",7:"-nci",20:"-nci",50:"-nci",3:"-üncü",4:"-üncü",100:"-üncü",6:"-ncı",9:"-uncu",10:"-uncu",30:"-uncu",60:"-ıncı",90:"-ıncı"}),Uf=(Kf.defineLocale("az",{months:"yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr".split("_"),monthsShort:"yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek".split("_"),weekdays:"Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə".split("_"),weekdaysShort:"Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən".split("_"),weekdaysMin:"Bz_BE_ÇA_Çə_CA_Cü_Şə".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[sabah saat] LT",nextWeek:"[gələn həftə] dddd [saat] LT",lastDay:"[dünən] LT",lastWeek:"[keçən həftə] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s əvvəl",s:"birneçə saniyyə",m:"bir dəqiqə",mm:"%d dəqiqə",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir il",yy:"%d il"},meridiemParse:/gecə|səhər|gündüz|axşam/,isPM:function(a){return/^(gündüz|axşam)$/.test(a)},meridiem:function(a,b,c){return 4>a?"gecə":12>a?"səhər":17>a?"gündüz":"axşam"},ordinalParse:/\d{1,2}-(ıncı|inci|nci|üncü|ncı|uncu)/,ordinal:function(a){if(0===a)return a+"-ıncı";var b=a%10,c=a%100-b,d=a>=100?100:null;return a+(Tf[b]||Tf[c]||Tf[d])},week:{dow:1,doy:7}}),Kf.defineLocale("be",{months:{format:"студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня".split("_"),standalone:"студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань".split("_")},monthsShort:"студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж".split("_"),weekdays:{format:"нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу".split("_"),standalone:"нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота".split("_"),isFormat:/\[ ?[Вв] ?(?:мінулую|наступную)? ?\] ?dddd/},weekdaysShort:"нд_пн_ат_ср_чц_пт_сб".split("_"),weekdaysMin:"нд_пн_ат_ср_чц_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., HH:mm",LLLL:"dddd, D MMMM YYYY г., HH:mm"},calendar:{sameDay:"[Сёння ў] LT",nextDay:"[Заўтра ў] LT",lastDay:"[Учора ў] LT",nextWeek:function(){return"[У] dddd [ў] LT"},lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return"[У мінулую] dddd [ў] LT";case 1:case 2:case 4:return"[У мінулы] dddd [ў] LT"}},sameElse:"L"},relativeTime:{future:"праз %s",past:"%s таму",s:"некалькі секунд",m:Vc,mm:Vc,h:Vc,hh:Vc,d:"дзень",dd:Vc,M:"месяц",MM:Vc,y:"год",yy:Vc},meridiemParse:/ночы|раніцы|дня|вечара/,isPM:function(a){return/^(дня|вечара)$/.test(a)},meridiem:function(a,b,c){return 4>a?"ночы":12>a?"раніцы":17>a?"дня":"вечара"},ordinalParse:/\d{1,2}-(і|ы|га)/,ordinal:function(a,b){switch(b){case"M":case"d":case"DDD":case"w":case"W":return a%10!==2&&a%10!==3||a%100===12||a%100===13?a+"-ы":a+"-і";case"D":return a+"-га";default:return a}},week:{dow:1,doy:7}}),Kf.defineLocale("bg",{months:"януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември".split("_"),monthsShort:"янр_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек".split("_"),weekdays:"неделя_понеделник_вторник_сряда_четвъртък_петък_събота".split("_"),weekdaysShort:"нед_пон_вто_сря_чет_пет_съб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Днес в] LT",nextDay:"[Утре в] LT",nextWeek:"dddd [в] LT",lastDay:"[Вчера в] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[В изминалата] dddd [в] LT";case 1:case 2:case 4:case 5:return"[В изминалия] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"след %s",past:"преди %s",s:"няколко секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дни",M:"месец",MM:"%d месеца",y:"година",yy:"%d години"},ordinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(a){var b=a%10,c=a%100;return 0===a?a+"-ев":0===c?a+"-ен":c>10&&20>c?a+"-ти":1===b?a+"-ви":2===b?a+"-ри":7===b||8===b?a+"-ми":a+"-ти"},week:{dow:1,doy:7}}),{1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"}),Vf={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"},Wf=(Kf.defineLocale("bn",{months:"জানুয়ারী_ফেবুয়ারী_মার্চ_এপ্রিল_মে_জুন_জুলাই_অগাস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),monthsShort:"জানু_ফেব_মার্চ_এপর_মে_জুন_জুল_অগ_সেপ্ট_অক্টো_নভ_ডিসেম্".split("_"),weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পত্তিবার_শুক্রবার_শনিবার".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পত্তি_শুক্র_শনি".split("_"),weekdaysMin:"রব_সম_মঙ্গ_বু_ব্রিহ_শু_শনি".split("_"),longDateFormat:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm সময়",LLLL:"dddd, D MMMM YYYY, A h:mm সময়"},calendar:{sameDay:"[আজ] LT",nextDay:"[আগামীকাল] LT",nextWeek:"dddd, LT",lastDay:"[গতকাল] LT",lastWeek:"[গত] dddd, LT",sameElse:"L"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"},preparse:function(a){return a.replace(/[১২৩৪৫৬৭৮৯০]/g,function(a){return Vf[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return Uf[a]})},meridiemParse:/রাত|সকাল|দুপুর|বিকাল|রাত/,isPM:function(a){return/^(দুপুর|বিকাল|রাত)$/.test(a)},meridiem:function(a,b,c){return 4>a?"রাত":10>a?"সকাল":17>a?"দুপুর":20>a?"বিকাল":"রাত"},week:{dow:0,doy:6}}),{1:"༡",2:"༢",3:"༣",4:"༤",5:"༥",6:"༦",7:"༧",8:"༨",9:"༩",0:"༠"}),Xf={"༡":"1","༢":"2","༣":"3","༤":"4","༥":"5","༦":"6","༧":"7","༨":"8","༩":"9","༠":"0"},Yf=(Kf.defineLocale("bo",{months:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),monthsShort:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),weekdays:"གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་".split("_"),weekdaysShort:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),weekdaysMin:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[དི་རིང] LT",nextDay:"[སང་ཉིན] LT",nextWeek:"[བདུན་ཕྲག་རྗེས་མ], LT",lastDay:"[ཁ་སང] LT",lastWeek:"[བདུན་ཕྲག་མཐའ་མ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ལ་",past:"%s སྔན་ལ",s:"ལམ་སང",m:"སྐར་མ་གཅིག",mm:"%d སྐར་མ",h:"ཆུ་ཚོད་གཅིག",hh:"%d ཆུ་ཚོད",d:"ཉིན་གཅིག",dd:"%d ཉིན་",M:"ཟླ་བ་གཅིག",MM:"%d ཟླ་བ",y:"ལོ་གཅིག",yy:"%d ལོ"},preparse:function(a){return a.replace(/[༡༢༣༤༥༦༧༨༩༠]/g,function(a){return Xf[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return Wf[a]})},meridiemParse:/མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/,isPM:function(a){return/^(ཉིན་གུང|དགོང་དག|མཚན་མོ)$/.test(a)},meridiem:function(a,b,c){return 4>a?"མཚན་མོ":10>a?"ཞོགས་ཀས":17>a?"ཉིན་གུང":20>a?"དགོང་དག":"མཚན་མོ"},week:{dow:0,doy:6}}),Kf.defineLocale("br",{months:"Genver_C'hwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu".split("_"),monthsShort:"Gen_C'hwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker".split("_"),weekdays:"Sul_Lun_Meurzh_Merc'her_Yaou_Gwener_Sadorn".split("_"),weekdaysShort:"Sul_Lun_Meu_Mer_Yao_Gwe_Sad".split("_"),weekdaysMin:"Su_Lu_Me_Mer_Ya_Gw_Sa".split("_"),longDateFormat:{LT:"h[e]mm A",LTS:"h[e]mm:ss A",L:"DD/MM/YYYY",LL:"D [a viz] MMMM YYYY",LLL:"D [a viz] MMMM YYYY h[e]mm A",LLLL:"dddd, D [a viz] MMMM YYYY h[e]mm A"},calendar:{sameDay:"[Hiziv da] LT",nextDay:"[Warc'hoazh da] LT",nextWeek:"dddd [da] LT",lastDay:"[Dec'h da] LT",lastWeek:"dddd [paset da] LT",sameElse:"L"},relativeTime:{future:"a-benn %s",past:"%s 'zo",s:"un nebeud segondennoù",m:"ur vunutenn",mm:Wc,h:"un eur",hh:"%d eur",d:"un devezh",dd:Wc,M:"ur miz",MM:Wc,y:"ur bloaz",yy:Xc},ordinalParse:/\d{1,2}(añ|vet)/,ordinal:function(a){var b=1===a?"añ":"vet";return a+b},week:{dow:1,doy:4}}),Kf.defineLocale("bs",{months:"januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.".split("_"),weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:case 3:return"[prošlu] dddd [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",m:_c,mm:_c,h:_c,hh:_c,d:"dan",dd:_c,M:"mjesec",MM:_c,y:"godinu",yy:_c},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),Kf.defineLocale("ca",{months:"gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre".split("_"),monthsShort:"gen._febr._mar._abr._mai._jun._jul._ag._set._oct._nov._des.".split("_"),weekdays:"diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dt._dc._dj._dv._ds.".split("_"),weekdaysMin:"Dg_Dl_Dt_Dc_Dj_Dv_Ds".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd D MMMM YYYY H:mm"},calendar:{sameDay:function(){return"[avui a "+(1!==this.hours()?"les":"la")+"] LT"},nextDay:function(){return"[demà a "+(1!==this.hours()?"les":"la")+"] LT"},nextWeek:function(){return"dddd [a "+(1!==this.hours()?"les":"la")+"] LT"},lastDay:function(){return"[ahir a "+(1!==this.hours()?"les":"la")+"] LT"},lastWeek:function(){return"[el] dddd [passat a "+(1!==this.hours()?"les":"la")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"fa %s",s:"uns segons",m:"un minut",mm:"%d minuts",h:"una hora",hh:"%d hores",d:"un dia",dd:"%d dies",M:"un mes",MM:"%d mesos",y:"un any",yy:"%d anys"},ordinalParse:/\d{1,2}(r|n|t|è|a)/,ordinal:function(a,b){var c=1===a?"r":2===a?"n":3===a?"r":4===a?"t":"è";return("w"===b||"W"===b)&&(c="a"),a+c},week:{dow:1,doy:4}}),"leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec".split("_")),Zf="led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro".split("_"),$f=(Kf.defineLocale("cs",{months:Yf,monthsShort:Zf,monthsParse:function(a,b){var c,d=[];for(c=0;12>c;c++)d[c]=new RegExp("^"+a[c]+"$|^"+b[c]+"$","i");return d}(Yf,Zf),shortMonthsParse:function(a){var b,c=[];for(b=0;12>b;b++)c[b]=new RegExp("^"+a[b]+"$","i");return c}(Zf),longMonthsParse:function(a){var b,c=[];for(b=0;12>b;b++)c[b]=new RegExp("^"+a[b]+"$","i");return c}(Yf),weekdays:"neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota".split("_"),weekdaysShort:"ne_po_út_st_čt_pá_so".split("_"),weekdaysMin:"ne_po_út_st_čt_pá_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm"},calendar:{sameDay:"[dnes v] LT",nextDay:"[zítra v] LT",nextWeek:function(){switch(this.day()){case 0:return"[v neděli v] LT";case 1:case 2:return"[v] dddd [v] LT";case 3:return"[ve středu v] LT";case 4:return"[ve čtvrtek v] LT";case 5:return"[v pátek v] LT";case 6:return"[v sobotu v] LT"}},lastDay:"[včera v] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulou neděli v] LT";case 1:case 2:return"[minulé] dddd [v] LT";case 3:return"[minulou středu v] LT";case 4:case 5:return"[minulý] dddd [v] LT";case 6:return"[minulou sobotu v] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"před %s",s:bd,m:bd,mm:bd,h:bd,hh:bd,d:bd,dd:bd,M:bd,MM:bd,y:bd,yy:bd},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),Kf.defineLocale("cv",{months:"кӑрлач_нарӑс_пуш_ака_май_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав".split("_"),monthsShort:"кӑр_нар_пуш_ака_май_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш".split("_"),weekdays:"вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун".split("_"),weekdaysShort:"выр_тун_ытл_юн_кӗҫ_эрн_шӑм".split("_"),weekdaysMin:"вр_тн_ыт_юн_кҫ_эр_шм".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]",LLL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm",LLLL:"dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm"},calendar:{sameDay:"[Паян] LT [сехетре]",nextDay:"[Ыран] LT [сехетре]",lastDay:"[Ӗнер] LT [сехетре]",nextWeek:"[Ҫитес] dddd LT [сехетре]",lastWeek:"[Иртнӗ] dddd LT [сехетре]",sameElse:"L"},relativeTime:{future:function(a){var b=/сехет$/i.exec(a)?"рен":/ҫул$/i.exec(a)?"тан":"ран";return a+b},past:"%s каялла",s:"пӗр-ик ҫеккунт",m:"пӗр минут",mm:"%d минут",h:"пӗр сехет",hh:"%d сехет",d:"пӗр кун",dd:"%d кун",M:"пӗр уйӑх",MM:"%d уйӑх",y:"пӗр ҫул",yy:"%d ҫул"},ordinalParse:/\d{1,2}-мӗш/,ordinal:"%d-мӗш",week:{dow:1,doy:7}}),Kf.defineLocale("cy",{months:"Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr".split("_"),monthsShort:"Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag".split("_"),weekdays:"Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn".split("_"),weekdaysShort:"Sul_Llun_Maw_Mer_Iau_Gwe_Sad".split("_"),weekdaysMin:"Su_Ll_Ma_Me_Ia_Gw_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Heddiw am] LT",nextDay:"[Yfory am] LT",nextWeek:"dddd [am] LT",lastDay:"[Ddoe am] LT",lastWeek:"dddd [diwethaf am] LT",sameElse:"L"},relativeTime:{future:"mewn %s",past:"%s yn ôl",s:"ychydig eiliadau",m:"munud",mm:"%d munud",h:"awr",hh:"%d awr",d:"diwrnod",dd:"%d diwrnod",M:"mis",MM:"%d mis",y:"blwyddyn",yy:"%d flynedd"},ordinalParse:/\d{1,2}(fed|ain|af|il|ydd|ed|eg)/,ordinal:function(a){var b=a,c="",d=["","af","il","ydd","ydd","ed","ed","ed","fed","fed","fed","eg","fed","eg","eg","fed","eg","eg","fed","eg","fed"];return b>20?c=40===b||50===b||60===b||80===b||100===b?"fed":"ain":b>0&&(c=d[b]),a+c},week:{dow:1,doy:4}}),Kf.defineLocale("da",{months:"januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"søn_man_tir_ons_tor_fre_lør".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd [d.] D. MMMM YYYY HH:mm"},calendar:{sameDay:"[I dag kl.] LT",nextDay:"[I morgen kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[I går kl.] LT",lastWeek:"[sidste] dddd [kl] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"få sekunder",m:"et minut",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dage",M:"en måned",MM:"%d måneder",y:"et år",yy:"%d år"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),Kf.defineLocale("de-at",{months:"Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jän._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",m:cd,mm:"%d Minuten",h:cd,hh:"%d Stunden",d:cd,dd:cd,M:cd,MM:cd,y:cd,yy:cd},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),Kf.defineLocale("de",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",m:dd,mm:"%d Minuten",h:dd,hh:"%d Stunden",d:dd,dd:dd,M:dd,MM:dd,y:dd,yy:dd},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),["ޖެނުއަރީ","ފެބްރުއަރީ","މާރިޗު","އޭޕްރީލު","މޭ","ޖޫން","ޖުލައި","އޯގަސްޓު","ސެޕްޓެމްބަރު","އޮކްޓޯބަރު","ނޮވެމްބަރު","ޑިސެމްބަރު"]),_f=["އާދިއްތަ","ހޯމަ","އަންގާރަ","ބުދަ","ބުރާސްފަތި","ހުކުރު","ހޮނިހިރު"],ag=(Kf.defineLocale("dv",{months:$f,monthsShort:$f,weekdays:_f,weekdaysShort:_f,weekdaysMin:"އާދި_ހޯމަ_އަން_ބުދަ_ބުރާ_ހުކު_ހޮނި".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/M/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/މކ|މފ/,isPM:function(a){return""===a},meridiem:function(a,b,c){return 12>a?"މކ":"މފ"},calendar:{sameDay:"[މިއަދު] LT",nextDay:"[މާދަމާ] LT",nextWeek:"dddd LT",lastDay:"[އިއްޔެ] LT",lastWeek:"[ފާއިތުވި] dddd LT",sameElse:"L"},relativeTime:{future:"ތެރޭގައި %s",past:"ކުރިން %s",s:"ސިކުންތުކޮޅެއް",m:"މިނިޓެއް",mm:"މިނިޓު %d",h:"ގަޑިއިރެއް",hh:"ގަޑިއިރު %d",d:"ދުވަހެއް",dd:"ދުވަސް %d",M:"މަހެއް",MM:"މަސް %d",y:"އަހަރެއް",yy:"އަހަރު %d"},preparse:function(a){return a.replace(/،/g,",")},postformat:function(a){return a.replace(/,/g,"،")},week:{dow:7,doy:12}}),Kf.defineLocale("el",{monthsNominativeEl:"Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος".split("_"),monthsGenitiveEl:"Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου".split("_"),months:function(a,b){return/D/.test(b.substring(0,b.indexOf("MMMM")))?this._monthsGenitiveEl[a.month()]:this._monthsNominativeEl[a.month()]},monthsShort:"Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ".split("_"),weekdays:"Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο".split("_"),weekdaysShort:"Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ".split("_"),weekdaysMin:"Κυ_Δε_Τρ_Τε_Πε_Πα_Σα".split("_"),meridiem:function(a,b,c){return a>11?c?"μμ":"ΜΜ":c?"πμ":"ΠΜ"},isPM:function(a){return"μ"===(a+"").toLowerCase()[0]},meridiemParse:/[ΠΜ]\.?Μ?\.?/i,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendarEl:{sameDay:"[Σήμερα {}] LT",nextDay:"[Αύριο {}] LT",nextWeek:"dddd [{}] LT",lastDay:"[Χθες {}] LT",lastWeek:function(){switch(this.day()){case 6:return"[το προηγούμενο] dddd [{}] LT";default:return"[την προηγούμενη] dddd [{}] LT"}},sameElse:"L"},calendar:function(a,b){var c=this._calendarEl[a],d=b&&b.hours();return D(c)&&(c=c.apply(b)),c.replace("{}",d%12===1?"στη":"στις")},relativeTime:{future:"σε %s",past:"%s πριν",s:"λίγα δευτερόλεπτα",m:"ένα λεπτό",mm:"%d λεπτά",h:"μία ώρα",hh:"%d ώρες",d:"μία μέρα",dd:"%d μέρες",M:"ένας μήνας",MM:"%d μήνες",y:"ένας χρόνος",yy:"%d χρόνια"},ordinalParse:/\d{1,2}η/,ordinal:"%dη",week:{dow:1,doy:4}}),Kf.defineLocale("en-au",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{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"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(a){var b=a%10,c=1===~~(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c},week:{dow:1,doy:4}}),Kf.defineLocale("en-ca",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"YYYY-MM-DD",LL:"D MMMM, YYYY",LLL:"D MMMM, YYYY h:mm A",LLLL:"dddd, D MMMM, YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{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"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(a){var b=a%10,c=1===~~(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c}}),Kf.defineLocale("en-gb",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{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"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(a){var b=a%10,c=1===~~(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c},week:{dow:1,doy:4}}),Kf.defineLocale("en-ie",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{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"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(a){var b=a%10,c=1===~~(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c},week:{dow:1,doy:4}}),Kf.defineLocale("en-nz",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{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"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(a){var b=a%10,c=1===~~(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c},week:{dow:1,doy:4}}),Kf.defineLocale("eo",{months:"januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aŭg_sep_okt_nov_dec".split("_"),weekdays:"Dimanĉo_Lundo_Mardo_Merkredo_Ĵaŭdo_Vendredo_Sabato".split("_"), -weekdaysShort:"Dim_Lun_Mard_Merk_Ĵaŭ_Ven_Sab".split("_"),weekdaysMin:"Di_Lu_Ma_Me_Ĵa_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D[-an de] MMMM, YYYY",LLL:"D[-an de] MMMM, YYYY HH:mm",LLLL:"dddd, [la] D[-an de] MMMM, YYYY HH:mm"},meridiemParse:/[ap]\.t\.m/i,isPM:function(a){return"p"===a.charAt(0).toLowerCase()},meridiem:function(a,b,c){return a>11?c?"p.t.m.":"P.T.M.":c?"a.t.m.":"A.T.M."},calendar:{sameDay:"[Hodiaŭ je] LT",nextDay:"[Morgaŭ je] LT",nextWeek:"dddd [je] LT",lastDay:"[Hieraŭ je] LT",lastWeek:"[pasinta] dddd [je] LT",sameElse:"L"},relativeTime:{future:"je %s",past:"antaŭ %s",s:"sekundoj",m:"minuto",mm:"%d minutoj",h:"horo",hh:"%d horoj",d:"tago",dd:"%d tagoj",M:"monato",MM:"%d monatoj",y:"jaro",yy:"%d jaroj"},ordinalParse:/\d{1,2}a/,ordinal:"%da",week:{dow:1,doy:7}}),"ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_")),bg="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),cg=(Kf.defineLocale("es",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(a,b){return/-MMM-/.test(b)?bg[a.month()]:ag[a.month()]},weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}}),Kf.defineLocale("et",{months:"jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember".split("_"),monthsShort:"jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets".split("_"),weekdays:"pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev".split("_"),weekdaysShort:"P_E_T_K_N_R_L".split("_"),weekdaysMin:"P_E_T_K_N_R_L".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[Täna,] LT",nextDay:"[Homme,] LT",nextWeek:"[Järgmine] dddd LT",lastDay:"[Eile,] LT",lastWeek:"[Eelmine] dddd LT",sameElse:"L"},relativeTime:{future:"%s pärast",past:"%s tagasi",s:ed,m:ed,mm:ed,h:ed,hh:ed,d:ed,dd:"%d päeva",M:ed,MM:ed,y:ed,yy:ed},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),Kf.defineLocale("eu",{months:"urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua".split("_"),monthsShort:"urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.".split("_"),weekdays:"igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata".split("_"),weekdaysShort:"ig._al._ar._az._og._ol._lr.".split("_"),weekdaysMin:"ig_al_ar_az_og_ol_lr".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY[ko] MMMM[ren] D[a]",LLL:"YYYY[ko] MMMM[ren] D[a] HH:mm",LLLL:"dddd, YYYY[ko] MMMM[ren] D[a] HH:mm",l:"YYYY-M-D",ll:"YYYY[ko] MMM D[a]",lll:"YYYY[ko] MMM D[a] HH:mm",llll:"ddd, YYYY[ko] MMM D[a] HH:mm"},calendar:{sameDay:"[gaur] LT[etan]",nextDay:"[bihar] LT[etan]",nextWeek:"dddd LT[etan]",lastDay:"[atzo] LT[etan]",lastWeek:"[aurreko] dddd LT[etan]",sameElse:"L"},relativeTime:{future:"%s barru",past:"duela %s",s:"segundo batzuk",m:"minutu bat",mm:"%d minutu",h:"ordu bat",hh:"%d ordu",d:"egun bat",dd:"%d egun",M:"hilabete bat",MM:"%d hilabete",y:"urte bat",yy:"%d urte"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),{1:"۱",2:"۲",3:"۳",4:"۴",5:"۵",6:"۶",7:"۷",8:"۸",9:"۹",0:"۰"}),dg={"۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","۰":"0"},eg=(Kf.defineLocale("fa",{months:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),monthsShort:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),weekdays:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysShort:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysMin:"ی_د_س_چ_پ_ج_ش".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/قبل از ظهر|بعد از ظهر/,isPM:function(a){return/بعد از ظهر/.test(a)},meridiem:function(a,b,c){return 12>a?"قبل از ظهر":"بعد از ظهر"},calendar:{sameDay:"[امروز ساعت] LT",nextDay:"[فردا ساعت] LT",nextWeek:"dddd [ساعت] LT",lastDay:"[دیروز ساعت] LT",lastWeek:"dddd [پیش] [ساعت] LT",sameElse:"L"},relativeTime:{future:"در %s",past:"%s پیش",s:"چندین ثانیه",m:"یک دقیقه",mm:"%d دقیقه",h:"یک ساعت",hh:"%d ساعت",d:"یک روز",dd:"%d روز",M:"یک ماه",MM:"%d ماه",y:"یک سال",yy:"%d سال"},preparse:function(a){return a.replace(/[۰-۹]/g,function(a){return dg[a]}).replace(/،/g,",")},postformat:function(a){return a.replace(/\d/g,function(a){return cg[a]}).replace(/,/g,"،")},ordinalParse:/\d{1,2}م/,ordinal:"%dم",week:{dow:6,doy:12}}),"nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän".split(" ")),fg=["nolla","yhden","kahden","kolmen","neljän","viiden","kuuden",eg[7],eg[8],eg[9]],gg=(Kf.defineLocale("fi",{months:"tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu".split("_"),monthsShort:"tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu".split("_"),weekdays:"sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai".split("_"),weekdaysShort:"su_ma_ti_ke_to_pe_la".split("_"),weekdaysMin:"su_ma_ti_ke_to_pe_la".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"Do MMMM[ta] YYYY",LLL:"Do MMMM[ta] YYYY, [klo] HH.mm",LLLL:"dddd, Do MMMM[ta] YYYY, [klo] HH.mm",l:"D.M.YYYY",ll:"Do MMM YYYY",lll:"Do MMM YYYY, [klo] HH.mm",llll:"ddd, Do MMM YYYY, [klo] HH.mm"},calendar:{sameDay:"[tänään] [klo] LT",nextDay:"[huomenna] [klo] LT",nextWeek:"dddd [klo] LT",lastDay:"[eilen] [klo] LT",lastWeek:"[viime] dddd[na] [klo] LT",sameElse:"L"},relativeTime:{future:"%s päästä",past:"%s sitten",s:fd,m:fd,mm:fd,h:fd,hh:fd,d:fd,dd:fd,M:fd,MM:fd,y:fd,yy:fd},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),Kf.defineLocale("fo",{months:"januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur".split("_"),weekdaysShort:"sun_mán_týs_mik_hós_frí_ley".split("_"),weekdaysMin:"su_má_tý_mi_hó_fr_le".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D. MMMM, YYYY HH:mm"},calendar:{sameDay:"[Í dag kl.] LT",nextDay:"[Í morgin kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[Í gjár kl.] LT",lastWeek:"[síðstu] dddd [kl] LT",sameElse:"L"},relativeTime:{future:"um %s",past:"%s síðani",s:"fá sekund",m:"ein minutt",mm:"%d minuttir",h:"ein tími",hh:"%d tímar",d:"ein dagur",dd:"%d dagar",M:"ein mánaði",MM:"%d mánaðir",y:"eitt ár",yy:"%d ár"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),Kf.defineLocale("fr-ca",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"Di_Lu_Ma_Me_Je_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd'hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},ordinalParse:/\d{1,2}(er|e)/,ordinal:function(a){return a+(1===a?"er":"e")}}),Kf.defineLocale("fr-ch",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"Di_Lu_Ma_Me_Je_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd'hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},ordinalParse:/\d{1,2}(er|e)/,ordinal:function(a){return a+(1===a?"er":"e")},week:{dow:1,doy:4}}),Kf.defineLocale("fr",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"Di_Lu_Ma_Me_Je_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd'hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},ordinalParse:/\d{1,2}(er|)/,ordinal:function(a){return a+(1===a?"er":"")},week:{dow:1,doy:4}}),"jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.".split("_")),hg="jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),ig=(Kf.defineLocale("fy",{months:"jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber".split("_"),monthsShort:function(a,b){return/-MMM-/.test(b)?hg[a.month()]:gg[a.month()]},weekdays:"snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon".split("_"),weekdaysShort:"si._mo._ti._wo._to._fr._so.".split("_"),weekdaysMin:"Si_Mo_Ti_Wo_To_Fr_So".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[hjoed om] LT",nextDay:"[moarn om] LT",nextWeek:"dddd [om] LT",lastDay:"[juster om] LT",lastWeek:"[ôfrûne] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oer %s",past:"%s lyn",s:"in pear sekonden",m:"ien minút",mm:"%d minuten",h:"ien oere",hh:"%d oeren",d:"ien dei",dd:"%d dagen",M:"ien moanne",MM:"%d moannen",y:"ien jier",yy:"%d jierren"},ordinalParse:/\d{1,2}(ste|de)/,ordinal:function(a){return a+(1===a||8===a||a>=20?"ste":"de")},week:{dow:1,doy:4}}),["Am Faoilleach","An Gearran","Am Màrt","An Giblean","An Cèitean","An t-Ògmhios","An t-Iuchar","An Lùnastal","An t-Sultain","An Dàmhair","An t-Samhain","An Dùbhlachd"]),jg=["Faoi","Gear","Màrt","Gibl","Cèit","Ògmh","Iuch","Lùn","Sult","Dàmh","Samh","Dùbh"],kg=["Didòmhnaich","Diluain","Dimàirt","Diciadain","Diardaoin","Dihaoine","Disathairne"],lg=["Did","Dil","Dim","Dic","Dia","Dih","Dis"],mg=["Dò","Lu","Mà","Ci","Ar","Ha","Sa"],ng=(Kf.defineLocale("gd",{months:ig,monthsShort:jg,monthsParseExact:!0,weekdays:kg,weekdaysShort:lg,weekdaysMin:mg,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[An-diugh aig] LT",nextDay:"[A-màireach aig] LT",nextWeek:"dddd [aig] LT",lastDay:"[An-dè aig] LT",lastWeek:"dddd [seo chaidh] [aig] LT",sameElse:"L"},relativeTime:{future:"ann an %s",past:"bho chionn %s",s:"beagan diogan",m:"mionaid",mm:"%d mionaidean",h:"uair",hh:"%d uairean",d:"latha",dd:"%d latha",M:"mìos",MM:"%d mìosan",y:"bliadhna",yy:"%d bliadhna"},ordinalParse:/\d{1,2}(d|na|mh)/,ordinal:function(a){var b=1===a?"d":a%10===2?"na":"mh";return a+b},week:{dow:1,doy:4}}),Kf.defineLocale("gl",{months:"Xaneiro_Febreiro_Marzo_Abril_Maio_Xuño_Xullo_Agosto_Setembro_Outubro_Novembro_Decembro".split("_"),monthsShort:"Xan._Feb._Mar._Abr._Mai._Xuñ._Xul._Ago._Set._Out._Nov._Dec.".split("_"),weekdays:"Domingo_Luns_Martes_Mércores_Xoves_Venres_Sábado".split("_"),weekdaysShort:"Dom._Lun._Mar._Mér._Xov._Ven._Sáb.".split("_"),weekdaysMin:"Do_Lu_Ma_Mé_Xo_Ve_Sá".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd D MMMM YYYY H:mm"},calendar:{sameDay:function(){return"[hoxe "+(1!==this.hours()?"ás":"á")+"] LT"},nextDay:function(){return"[mañá "+(1!==this.hours()?"ás":"á")+"] LT"},nextWeek:function(){return"dddd ["+(1!==this.hours()?"ás":"a")+"] LT"},lastDay:function(){return"[onte "+(1!==this.hours()?"á":"a")+"] LT"},lastWeek:function(){return"[o] dddd [pasado "+(1!==this.hours()?"ás":"a")+"] LT"},sameElse:"L"},relativeTime:{future:function(a){return"uns segundos"===a?"nuns segundos":"en "+a},past:"hai %s",s:"uns segundos",m:"un minuto",mm:"%d minutos",h:"unha hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un ano",yy:"%d anos"},ordinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:7}}),Kf.defineLocale("he",{months:"ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר".split("_"),monthsShort:"ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳".split("_"),weekdays:"ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת".split("_"),weekdaysShort:"א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳".split("_"),weekdaysMin:"א_ב_ג_ד_ה_ו_ש".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [ב]MMMM YYYY",LLL:"D [ב]MMMM YYYY HH:mm",LLLL:"dddd, D [ב]MMMM YYYY HH:mm",l:"D/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[היום ב־]LT",nextDay:"[מחר ב־]LT",nextWeek:"dddd [בשעה] LT",lastDay:"[אתמול ב־]LT",lastWeek:"[ביום] dddd [האחרון בשעה] LT",sameElse:"L"},relativeTime:{future:"בעוד %s",past:"לפני %s",s:"מספר שניות",m:"דקה",mm:"%d דקות",h:"שעה",hh:function(a){return 2===a?"שעתיים":a+" שעות"},d:"יום",dd:function(a){return 2===a?"יומיים":a+" ימים"},M:"חודש",MM:function(a){return 2===a?"חודשיים":a+" חודשים"},y:"שנה",yy:function(a){return 2===a?"שנתיים":a%10===0&&10!==a?a+" שנה":a+" שנים"}}}),{1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"}),og={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"},pg=(Kf.defineLocale("hi",{months:"जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर".split("_"),monthsShort:"जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.".split("_"),weekdays:"रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm बजे",LTS:"A h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm बजे",LLLL:"dddd, D MMMM YYYY, A h:mm बजे"},calendar:{sameDay:"[आज] LT",nextDay:"[कल] LT",nextWeek:"dddd, LT",lastDay:"[कल] LT",lastWeek:"[पिछले] dddd, LT",sameElse:"L"},relativeTime:{future:"%s में",past:"%s पहले",s:"कुछ ही क्षण",m:"एक मिनट",mm:"%d मिनट",h:"एक घंटा",hh:"%d घंटे",d:"एक दिन",dd:"%d दिन",M:"एक महीने",MM:"%d महीने",y:"एक वर्ष",yy:"%d वर्ष"},preparse:function(a){return a.replace(/[१२३४५६७८९०]/g,function(a){return og[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return ng[a]})},meridiemParse:/रात|सुबह|दोपहर|शाम/,meridiemHour:function(a,b){return 12===a&&(a=0),"रात"===b?4>a?a:a+12:"सुबह"===b?a:"दोपहर"===b?a>=10?a:a+12:"शाम"===b?a+12:void 0},meridiem:function(a,b,c){return 4>a?"रात":10>a?"सुबह":17>a?"दोपहर":20>a?"शाम":"रात"},week:{dow:0,doy:6}}),Kf.defineLocale("hr",{months:{format:"siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca".split("_"),standalone:"siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac".split("_")},monthsShort:"sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.".split("_"),weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:case 3:return"[prošlu] dddd [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",m:hd,mm:hd,h:hd,hh:hd,d:"dan",dd:hd,M:"mjesec",MM:hd,y:"godinu",yy:hd},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),"vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton".split(" ")),qg=(Kf.defineLocale("hu",{months:"január_február_március_április_május_június_július_augusztus_szeptember_október_november_december".split("_"),monthsShort:"jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec".split("_"),weekdays:"vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat".split("_"),weekdaysShort:"vas_hét_kedd_sze_csüt_pén_szo".split("_"),weekdaysMin:"v_h_k_sze_cs_p_szo".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY. MMMM D.",LLL:"YYYY. MMMM D. H:mm",LLLL:"YYYY. MMMM D., dddd H:mm"},meridiemParse:/de|du/i,isPM:function(a){return"u"===a.charAt(1).toLowerCase()},meridiem:function(a,b,c){return 12>a?c===!0?"de":"DE":c===!0?"du":"DU"},calendar:{sameDay:"[ma] LT[-kor]",nextDay:"[holnap] LT[-kor]",nextWeek:function(){return jd.call(this,!0)},lastDay:"[tegnap] LT[-kor]",lastWeek:function(){return jd.call(this,!1)},sameElse:"L"},relativeTime:{future:"%s múlva",past:"%s",s:id,m:id,mm:id,h:id,hh:id,d:id,dd:id,M:id,MM:id,y:id,yy:id},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),Kf.defineLocale("hy-am",{months:{format:"հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի".split("_"),standalone:"հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր".split("_")},monthsShort:"հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ".split("_"),weekdays:"կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ".split("_"),weekdaysShort:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),weekdaysMin:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY թ.",LLL:"D MMMM YYYY թ., HH:mm",LLLL:"dddd, D MMMM YYYY թ., HH:mm"},calendar:{sameDay:"[այսօր] LT",nextDay:"[վաղը] LT",lastDay:"[երեկ] LT",nextWeek:function(){return"dddd [օրը ժամը] LT"},lastWeek:function(){return"[անցած] dddd [օրը ժամը] LT"},sameElse:"L"},relativeTime:{future:"%s հետո",past:"%s առաջ",s:"մի քանի վայրկյան",m:"րոպե",mm:"%d րոպե",h:"ժամ",hh:"%d ժամ",d:"օր",dd:"%d օր",M:"ամիս",MM:"%d ամիս",y:"տարի",yy:"%d տարի"},meridiemParse:/գիշերվա|առավոտվա|ցերեկվա|երեկոյան/,isPM:function(a){return/^(ցերեկվա|երեկոյան)$/.test(a)},meridiem:function(a){return 4>a?"գիշերվա":12>a?"առավոտվա":17>a?"ցերեկվա":"երեկոյան"},ordinalParse:/\d{1,2}|\d{1,2}-(ին|րդ)/,ordinal:function(a,b){switch(b){case"DDD":case"w":case"W":case"DDDo":return 1===a?a+"-ին":a+"-րդ";default:return a}},week:{dow:1,doy:7}}),Kf.defineLocale("id",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nov_Des".split("_"),weekdays:"Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu".split("_"),weekdaysShort:"Min_Sen_Sel_Rab_Kam_Jum_Sab".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|siang|sore|malam/,meridiemHour:function(a,b){return 12===a&&(a=0),"pagi"===b?a:"siang"===b?a>=11?a:a+12:"sore"===b||"malam"===b?a+12:void 0},meridiem:function(a,b,c){return 11>a?"pagi":15>a?"siang":19>a?"sore":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Besok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kemarin pukul] LT",lastWeek:"dddd [lalu pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lalu",s:"beberapa detik",m:"semenit",mm:"%d menit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}}),Kf.defineLocale("is",{months:"janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember".split("_"),monthsShort:"jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des".split("_"),weekdays:"sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur".split("_"),weekdaysShort:"sun_mán_þri_mið_fim_fös_lau".split("_"),weekdaysMin:"Su_Má_Þr_Mi_Fi_Fö_La".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd, D. MMMM YYYY [kl.] H:mm"},calendar:{sameDay:"[í dag kl.] LT",nextDay:"[á morgun kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[í gær kl.] LT",lastWeek:"[síðasta] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"eftir %s",past:"fyrir %s síðan",s:ld,m:ld,mm:ld,h:"klukkustund",hh:ld,d:ld,dd:ld,M:ld,MM:ld,y:ld,yy:ld},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),Kf.defineLocale("it",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"Domenica_Lunedì_Martedì_Mercoledì_Giovedì_Venerdì_Sabato".split("_"),weekdaysShort:"Dom_Lun_Mar_Mer_Gio_Ven_Sab".split("_"),weekdaysMin:"Do_Lu_Ma_Me_Gi_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Oggi alle] LT",nextDay:"[Domani alle] LT",nextWeek:"dddd [alle] LT",lastDay:"[Ieri alle] LT",lastWeek:function(){switch(this.day()){case 0:return"[la scorsa] dddd [alle] LT";default:return"[lo scorso] dddd [alle] LT"}},sameElse:"L"},relativeTime:{future:function(a){return(/^[0-9].+$/.test(a)?"tra":"in")+" "+a},past:"%s fa",s:"alcuni secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},ordinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}}),Kf.defineLocale("ja",{months:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"),weekdaysShort:"日_月_火_水_木_金_土".split("_"),weekdaysMin:"日_月_火_水_木_金_土".split("_"),longDateFormat:{LT:"Ah時m分",LTS:"Ah時m分s秒",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah時m分",LLLL:"YYYY年M月D日Ah時m分 dddd"},meridiemParse:/午前|午後/i,isPM:function(a){return"午後"===a},meridiem:function(a,b,c){return 12>a?"午前":"午後"},calendar:{sameDay:"[今日] LT",nextDay:"[明日] LT",nextWeek:"[来週]dddd LT",lastDay:"[昨日] LT",lastWeek:"[前週]dddd LT",sameElse:"L"},relativeTime:{future:"%s後",past:"%s前",s:"数秒",m:"1分",mm:"%d分",h:"1時間",hh:"%d時間",d:"1日",dd:"%d日",M:"1ヶ月",MM:"%dヶ月",y:"1年",yy:"%d年"}}),Kf.defineLocale("jv",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des".split("_"),weekdays:"Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu".split("_"),weekdaysShort:"Min_Sen_Sel_Reb_Kem_Jem_Sep".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sp".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/enjing|siyang|sonten|ndalu/,meridiemHour:function(a,b){return 12===a&&(a=0),"enjing"===b?a:"siyang"===b?a>=11?a:a+12:"sonten"===b||"ndalu"===b?a+12:void 0},meridiem:function(a,b,c){return 11>a?"enjing":15>a?"siyang":19>a?"sonten":"ndalu"},calendar:{sameDay:"[Dinten puniko pukul] LT",nextDay:"[Mbenjang pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kala wingi pukul] LT",lastWeek:"dddd [kepengker pukul] LT",sameElse:"L"},relativeTime:{future:"wonten ing %s",past:"%s ingkang kepengker",s:"sawetawis detik",m:"setunggal menit",mm:"%d menit",h:"setunggal jam",hh:"%d jam",d:"sedinten",dd:"%d dinten",M:"sewulan",MM:"%d wulan",y:"setaun",yy:"%d taun"},week:{dow:1,doy:7}}),Kf.defineLocale("ka",{months:{standalone:"იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი".split("_"),format:"იანვარს_თებერვალს_მარტს_აპრილის_მაისს_ივნისს_ივლისს_აგვისტს_სექტემბერს_ოქტომბერს_ნოემბერს_დეკემბერს".split("_")},monthsShort:"იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ".split("_"),weekdays:{standalone:"კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი".split("_"),format:"კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს".split("_"),isFormat:/(წინა|შემდეგ)/},weekdaysShort:"კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ".split("_"),weekdaysMin:"კვ_ორ_სა_ოთ_ხუ_პა_შა".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[დღეს] LT[-ზე]",nextDay:"[ხვალ] LT[-ზე]",lastDay:"[გუშინ] LT[-ზე]",nextWeek:"[შემდეგ] dddd LT[-ზე]",lastWeek:"[წინა] dddd LT-ზე",sameElse:"L"},relativeTime:{future:function(a){return/(წამი|წუთი|საათი|წელი)/.test(a)?a.replace(/ი$/,"ში"):a+"ში"},past:function(a){return/(წამი|წუთი|საათი|დღე|თვე)/.test(a)?a.replace(/(ი|ე)$/,"ის წინ"):/წელი/.test(a)?a.replace(/წელი$/,"წლის წინ"):void 0},s:"რამდენიმე წამი",m:"წუთი",mm:"%d წუთი",h:"საათი",hh:"%d საათი",d:"დღე",dd:"%d დღე",M:"თვე",MM:"%d თვე",y:"წელი",yy:"%d წელი"},ordinalParse:/0|1-ლი|მე-\d{1,2}|\d{1,2}-ე/,ordinal:function(a){return 0===a?a:1===a?a+"-ლი":20>a||100>=a&&a%20===0||a%100===0?"მე-"+a:a+"-ე"},week:{dow:1,doy:7}}),{0:"-ші",1:"-ші",2:"-ші",3:"-ші",4:"-ші",5:"-ші",6:"-шы",7:"-ші",8:"-ші",9:"-шы",10:"-шы",20:"-шы",30:"-шы",40:"-шы",50:"-ші",60:"-шы",70:"-ші",80:"-ші",90:"-шы",100:"-ші"}),rg=(Kf.defineLocale("kk",{months:"Қаңтар_Ақпан_Наурыз_Сәуір_Мамыр_Маусым_Шілде_Тамыз_Қыркүйек_Қазан_Қараша_Желтоқсан".split("_"),monthsShort:"Қаң_Ақп_Нау_Сәу_Мам_Мау_Шіл_Там_Қыр_Қаз_Қар_Жел".split("_"),weekdays:"Жексенбі_Дүйсенбі_Сейсенбі_Сәрсенбі_Бейсенбі_Жұма_Сенбі".split("_"),weekdaysShort:"Жек_Дүй_Сей_Сәр_Бей_Жұм_Сен".split("_"),weekdaysMin:"Жк_Дй_Сй_Ср_Бй_Жм_Сн".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Бүгін сағат] LT",nextDay:"[Ертең сағат] LT",nextWeek:"dddd [сағат] LT",lastDay:"[Кеше сағат] LT",lastWeek:"[Өткен аптаның] dddd [сағат] LT",sameElse:"L"},relativeTime:{future:"%s ішінде",past:"%s бұрын",s:"бірнеше секунд",m:"бір минут",mm:"%d минут",h:"бір сағат",hh:"%d сағат",d:"бір күн",dd:"%d күн",M:"бір ай",MM:"%d ай",y:"бір жыл",yy:"%d жыл"},ordinalParse:/\d{1,2}-(ші|шы)/,ordinal:function(a){var b=a%10,c=a>=100?100:null;return a+(qg[a]||qg[b]||qg[c])},week:{dow:1,doy:7}}),Kf.defineLocale("km",{months:"មករា_កុម្ភៈ_មិនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),monthsShort:"មករា_កុម្ភៈ_មិនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),weekdays:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),weekdaysShort:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),weekdaysMin:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[ថ្ងៃនេះ ម៉ោង] LT",nextDay:"[ស្អែក ម៉ោង] LT",nextWeek:"dddd [ម៉ោង] LT",lastDay:"[ម្សិលមិញ ម៉ោង] LT",lastWeek:"dddd [សប្តាហ៍មុន] [ម៉ោង] LT",sameElse:"L"},relativeTime:{future:"%sទៀត",past:"%sមុន",s:"ប៉ុន្មានវិនាទី",m:"មួយនាទី",mm:"%d នាទី",h:"មួយម៉ោង",hh:"%d ម៉ោង",d:"មួយថ្ងៃ",dd:"%d ថ្ងៃ",M:"មួយខែ",MM:"%d ខែ",y:"មួយឆ្នាំ",yy:"%d ឆ្នាំ"},week:{dow:1,doy:4}}),Kf.defineLocale("ko",{months:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),monthsShort:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),weekdays:"일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"),weekdaysShort:"일_월_화_수_목_금_토".split("_"),weekdaysMin:"일_월_화_수_목_금_토".split("_"),longDateFormat:{LT:"A h시 m분",LTS:"A h시 m분 s초",L:"YYYY.MM.DD",LL:"YYYY년 MMMM D일",LLL:"YYYY년 MMMM D일 A h시 m분",LLLL:"YYYY년 MMMM D일 dddd A h시 m분"},calendar:{sameDay:"오늘 LT",nextDay:"내일 LT",nextWeek:"dddd LT",lastDay:"어제 LT",lastWeek:"지난주 dddd LT",sameElse:"L"},relativeTime:{future:"%s 후",past:"%s 전",s:"몇초",ss:"%d초",m:"일분",mm:"%d분",h:"한시간",hh:"%d시간",d:"하루",dd:"%d일",M:"한달",MM:"%d달",y:"일년",yy:"%d년"},ordinalParse:/\d{1,2}일/,ordinal:"%d일",meridiemParse:/오전|오후/,isPM:function(a){return"오후"===a},meridiem:function(a,b,c){return 12>a?"오전":"오후"}}),Kf.defineLocale("lb",{months:"Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),weekdays:"Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg".split("_"),weekdaysShort:"So._Mé._Dë._Më._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mé_Dë_Më_Do_Fr_Sa".split("_"),longDateFormat:{LT:"H:mm [Auer]",LTS:"H:mm:ss [Auer]",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm [Auer]",LLLL:"dddd, D. MMMM YYYY H:mm [Auer]"},calendar:{sameDay:"[Haut um] LT",sameElse:"L",nextDay:"[Muer um] LT",nextWeek:"dddd [um] LT",lastDay:"[Gëschter um] LT",lastWeek:function(){switch(this.day()){case 2:case 4:return"[Leschten] dddd [um] LT";default:return"[Leschte] dddd [um] LT"}}},relativeTime:{future:nd,past:od,s:"e puer Sekonnen",m:md,mm:"%d Minutten",h:md,hh:"%d Stonnen",d:md,dd:"%d Deeg",M:md,MM:"%d Méint",y:md,yy:"%d Joer"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),Kf.defineLocale("lo",{months:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),monthsShort:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),weekdays:"ອາທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),weekdaysShort:"ທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),weekdaysMin:"ທ_ຈ_ອຄ_ພ_ພຫ_ສກ_ສ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"ວັນdddd D MMMM YYYY HH:mm"},meridiemParse:/ຕອນເຊົ້າ|ຕອນແລງ/,isPM:function(a){return"ຕອນແລງ"===a},meridiem:function(a,b,c){return 12>a?"ຕອນເຊົ້າ":"ຕອນແລງ"},calendar:{sameDay:"[ມື້ນີ້ເວລາ] LT",nextDay:"[ມື້ອື່ນເວລາ] LT",nextWeek:"[ວັນ]dddd[ໜ້າເວລາ] LT",lastDay:"[ມື້ວານນີ້ເວລາ] LT",lastWeek:"[ວັນ]dddd[ແລ້ວນີ້ເວລາ] LT",sameElse:"L"},relativeTime:{future:"ອີກ %s",past:"%sຜ່ານມາ",s:"ບໍ່ເທົ່າໃດວິນາທີ",m:"1 ນາທີ",mm:"%d ນາທີ",h:"1 ຊົ່ວໂມງ",hh:"%d ຊົ່ວໂມງ",d:"1 ມື້",dd:"%d ມື້",M:"1 ເດືອນ",MM:"%d ເດືອນ",y:"1 ປີ",yy:"%d ປີ"},ordinalParse:/(ທີ່)\d{1,2}/,ordinal:function(a){ -return"ທີ່"+a}}),{m:"minutė_minutės_minutę",mm:"minutės_minučių_minutes",h:"valanda_valandos_valandą",hh:"valandos_valandų_valandas",d:"diena_dienos_dieną",dd:"dienos_dienų_dienas",M:"mėnuo_mėnesio_mėnesį",MM:"mėnesiai_mėnesių_mėnesius",y:"metai_metų_metus",yy:"metai_metų_metus"}),sg=(Kf.defineLocale("lt",{months:{format:"sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio".split("_"),standalone:"sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis".split("_")},monthsShort:"sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd".split("_"),weekdays:{format:"sekmadienį_pirmadienį_antradienį_trečiadienį_ketvirtadienį_penktadienį_šeštadienį".split("_"),standalone:"sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis".split("_"),isFormat:/dddd HH:mm/},weekdaysShort:"Sek_Pir_Ant_Tre_Ket_Pen_Šeš".split("_"),weekdaysMin:"S_P_A_T_K_Pn_Š".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY [m.] MMMM D [d.]",LLL:"YYYY [m.] MMMM D [d.], HH:mm [val.]",LLLL:"YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]",l:"YYYY-MM-DD",ll:"YYYY [m.] MMMM D [d.]",lll:"YYYY [m.] MMMM D [d.], HH:mm [val.]",llll:"YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]"},calendar:{sameDay:"[Šiandien] LT",nextDay:"[Rytoj] LT",nextWeek:"dddd LT",lastDay:"[Vakar] LT",lastWeek:"[Praėjusį] dddd LT",sameElse:"L"},relativeTime:{future:"po %s",past:"prieš %s",s:qd,m:rd,mm:ud,h:rd,hh:ud,d:rd,dd:ud,M:rd,MM:ud,y:rd,yy:ud},ordinalParse:/\d{1,2}-oji/,ordinal:function(a){return a+"-oji"},week:{dow:1,doy:4}}),{m:"minūtes_minūtēm_minūte_minūtes".split("_"),mm:"minūtes_minūtēm_minūte_minūtes".split("_"),h:"stundas_stundām_stunda_stundas".split("_"),hh:"stundas_stundām_stunda_stundas".split("_"),d:"dienas_dienām_diena_dienas".split("_"),dd:"dienas_dienām_diena_dienas".split("_"),M:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),MM:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),y:"gada_gadiem_gads_gadi".split("_"),yy:"gada_gadiem_gads_gadi".split("_")}),tg=(Kf.defineLocale("lv",{months:"janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris".split("_"),monthsShort:"jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec".split("_"),weekdays:"svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena".split("_"),weekdaysShort:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysMin:"Sv_P_O_T_C_Pk_S".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY.",LL:"YYYY. [gada] D. MMMM",LLL:"YYYY. [gada] D. MMMM, HH:mm",LLLL:"YYYY. [gada] D. MMMM, dddd, HH:mm"},calendar:{sameDay:"[Šodien pulksten] LT",nextDay:"[Rīt pulksten] LT",nextWeek:"dddd [pulksten] LT",lastDay:"[Vakar pulksten] LT",lastWeek:"[Pagājušā] dddd [pulksten] LT",sameElse:"L"},relativeTime:{future:"pēc %s",past:"pirms %s",s:yd,m:xd,mm:wd,h:xd,hh:wd,d:xd,dd:wd,M:xd,MM:wd,y:xd,yy:wd},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),{words:{m:["jedan minut","jednog minuta"],mm:["minut","minuta","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mjesec","mjeseca","mjeseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(a,b){return 1===a?b[0]:a>=2&&4>=a?b[1]:b[2]},translate:function(a,b,c){var d=tg.words[c];return 1===c.length?b?d[0]:d[1]:a+" "+tg.correctGrammaticalCase(a,d)}}),ug=(Kf.defineLocale("me",{months:["januar","februar","mart","april","maj","jun","jul","avgust","septembar","oktobar","novembar","decembar"],monthsShort:["jan.","feb.","mar.","apr.","maj","jun","jul","avg.","sep.","okt.","nov.","dec."],weekdays:["nedjelja","ponedjeljak","utorak","srijeda","četvrtak","petak","subota"],weekdaysShort:["ned.","pon.","uto.","sri.","čet.","pet.","sub."],weekdaysMin:["ne","po","ut","sr","če","pe","su"],longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sjutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){var a=["[prošle] [nedjelje] [u] LT","[prošlog] [ponedjeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srijede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"];return a[this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"nekoliko sekundi",m:tg.translate,mm:tg.translate,h:tg.translate,hh:tg.translate,d:"dan",dd:tg.translate,M:"mjesec",MM:tg.translate,y:"godinu",yy:tg.translate},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),Kf.defineLocale("mk",{months:"јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември".split("_"),monthsShort:"јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек".split("_"),weekdays:"недела_понеделник_вторник_среда_четврток_петок_сабота".split("_"),weekdaysShort:"нед_пон_вто_сре_чет_пет_саб".split("_"),weekdaysMin:"нe_пo_вт_ср_че_пе_сa".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Денес во] LT",nextDay:"[Утре во] LT",nextWeek:"[Во] dddd [во] LT",lastDay:"[Вчера во] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[Изминатата] dddd [во] LT";case 1:case 2:case 4:case 5:return"[Изминатиот] dddd [во] LT"}},sameElse:"L"},relativeTime:{future:"после %s",past:"пред %s",s:"неколку секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дена",M:"месец",MM:"%d месеци",y:"година",yy:"%d години"},ordinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(a){var b=a%10,c=a%100;return 0===a?a+"-ев":0===c?a+"-ен":c>10&&20>c?a+"-ти":1===b?a+"-ви":2===b?a+"-ри":7===b||8===b?a+"-ми":a+"-ти"},week:{dow:1,doy:7}}),Kf.defineLocale("ml",{months:"ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ".split("_"),monthsShort:"ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.".split("_"),weekdays:"ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച".split("_"),weekdaysShort:"ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി".split("_"),weekdaysMin:"ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ".split("_"),longDateFormat:{LT:"A h:mm -നു",LTS:"A h:mm:ss -നു",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm -നു",LLLL:"dddd, D MMMM YYYY, A h:mm -നു"},calendar:{sameDay:"[ഇന്ന്] LT",nextDay:"[നാളെ] LT",nextWeek:"dddd, LT",lastDay:"[ഇന്നലെ] LT",lastWeek:"[കഴിഞ്ഞ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s കഴിഞ്ഞ്",past:"%s മുൻപ്",s:"അൽപ നിമിഷങ്ങൾ",m:"ഒരു മിനിറ്റ്",mm:"%d മിനിറ്റ്",h:"ഒരു മണിക്കൂർ",hh:"%d മണിക്കൂർ",d:"ഒരു ദിവസം",dd:"%d ദിവസം",M:"ഒരു മാസം",MM:"%d മാസം",y:"ഒരു വർഷം",yy:"%d വർഷം"},meridiemParse:/രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i,isPM:function(a){return/^(ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി)$/.test(a)},meridiem:function(a,b,c){return 4>a?"രാത്രി":12>a?"രാവിലെ":17>a?"ഉച്ച കഴിഞ്ഞ്":20>a?"വൈകുന്നേരം":"രാത്രി"}}),{1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"}),vg={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"},wg=(Kf.defineLocale("mr",{months:"जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),monthsShort:"जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),weekdays:"रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm वाजता",LTS:"A h:mm:ss वाजता",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm वाजता",LLLL:"dddd, D MMMM YYYY, A h:mm वाजता"},calendar:{sameDay:"[आज] LT",nextDay:"[उद्या] LT",nextWeek:"dddd, LT",lastDay:"[काल] LT",lastWeek:"[मागील] dddd, LT",sameElse:"L"},relativeTime:{future:"%sमध्ये",past:"%sपूर्वी",s:zd,m:zd,mm:zd,h:zd,hh:zd,d:zd,dd:zd,M:zd,MM:zd,y:zd,yy:zd},preparse:function(a){return a.replace(/[१२३४५६७८९०]/g,function(a){return vg[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return ug[a]})},meridiemParse:/रात्री|सकाळी|दुपारी|सायंकाळी/,meridiemHour:function(a,b){return 12===a&&(a=0),"रात्री"===b?4>a?a:a+12:"सकाळी"===b?a:"दुपारी"===b?a>=10?a:a+12:"सायंकाळी"===b?a+12:void 0},meridiem:function(a,b,c){return 4>a?"रात्री":10>a?"सकाळी":17>a?"दुपारी":20>a?"सायंकाळी":"रात्री"},week:{dow:0,doy:6}}),Kf.defineLocale("ms-my",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(a,b){return 12===a&&(a=0),"pagi"===b?a:"tengahari"===b?a>=11?a:a+12:"petang"===b||"malam"===b?a+12:void 0},meridiem:function(a,b,c){return 11>a?"pagi":15>a?"tengahari":19>a?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}}),Kf.defineLocale("ms",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(a,b){return 12===a&&(a=0),"pagi"===b?a:"tengahari"===b?a>=11?a:a+12:"petang"===b||"malam"===b?a+12:void 0},meridiem:function(a,b,c){return 11>a?"pagi":15>a?"tengahari":19>a?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}}),{1:"၁",2:"၂",3:"၃",4:"၄",5:"၅",6:"၆",7:"၇",8:"၈",9:"၉",0:"၀"}),xg={"၁":"1","၂":"2","၃":"3","၄":"4","၅":"5","၆":"6","၇":"7","၈":"8","၉":"9","၀":"0"},yg=(Kf.defineLocale("my",{months:"ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ".split("_"),monthsShort:"ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ".split("_"),weekdays:"တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ".split("_"),weekdaysShort:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),weekdaysMin:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ယနေ.] LT [မှာ]",nextDay:"[မနက်ဖြန်] LT [မှာ]",nextWeek:"dddd LT [မှာ]",lastDay:"[မနေ.က] LT [မှာ]",lastWeek:"[ပြီးခဲ့သော] dddd LT [မှာ]",sameElse:"L"},relativeTime:{future:"လာမည့် %s မှာ",past:"လွန်ခဲ့သော %s က",s:"စက္ကန်.အနည်းငယ်",m:"တစ်မိနစ်",mm:"%d မိနစ်",h:"တစ်နာရီ",hh:"%d နာရီ",d:"တစ်ရက်",dd:"%d ရက်",M:"တစ်လ",MM:"%d လ",y:"တစ်နှစ်",yy:"%d နှစ်"},preparse:function(a){return a.replace(/[၁၂၃၄၅၆၇၈၉၀]/g,function(a){return xg[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return wg[a]})},week:{dow:1,doy:4}}),Kf.defineLocale("nb",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan._feb._mars_april_mai_juni_juli_aug._sep._okt._nov._des.".split("_"),weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"sø._ma._ti._on._to._fr._lø.".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] HH:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[i går kl.] LT",lastWeek:"[forrige] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"for %s siden",s:"noen sekunder",m:"ett minutt",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dager",M:"en måned",MM:"%d måneder",y:"ett år",yy:"%d år"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),{1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"}),zg={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"},Ag=(Kf.defineLocale("ne",{months:"जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर".split("_"),monthsShort:"जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.".split("_"),weekdays:"आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार".split("_"),weekdaysShort:"आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.".split("_"),weekdaysMin:"आ._सो._मं._बु._बि._शु._श.".split("_"),longDateFormat:{LT:"Aको h:mm बजे",LTS:"Aको h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, Aको h:mm बजे",LLLL:"dddd, D MMMM YYYY, Aको h:mm बजे"},preparse:function(a){return a.replace(/[१२३४५६७८९०]/g,function(a){return zg[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return yg[a]})},meridiemParse:/राति|बिहान|दिउँसो|साँझ/,meridiemHour:function(a,b){return 12===a&&(a=0),"राति"===b?4>a?a:a+12:"बिहान"===b?a:"दिउँसो"===b?a>=10?a:a+12:"साँझ"===b?a+12:void 0},meridiem:function(a,b,c){return 3>a?"राति":12>a?"बिहान":16>a?"दिउँसो":20>a?"साँझ":"राति"},calendar:{sameDay:"[आज] LT",nextDay:"[भोलि] LT",nextWeek:"[आउँदो] dddd[,] LT",lastDay:"[हिजो] LT",lastWeek:"[गएको] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%sमा",past:"%s अगाडि",s:"केही क्षण",m:"एक मिनेट",mm:"%d मिनेट",h:"एक घण्टा",hh:"%d घण्टा",d:"एक दिन",dd:"%d दिन",M:"एक महिना",MM:"%d महिना",y:"एक बर्ष",yy:"%d बर्ष"},week:{dow:0,doy:6}}),"jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_")),Bg="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),Cg=(Kf.defineLocale("nl",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(a,b){return/-MMM-/.test(b)?Bg[a.month()]:Ag[a.month()]},weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"Zo_Ma_Di_Wo_Do_Vr_Za".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},ordinalParse:/\d{1,2}(ste|de)/,ordinal:function(a){return a+(1===a||8===a||a>=20?"ste":"de")},week:{dow:1,doy:4}}),Kf.defineLocale("nn",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag".split("_"),weekdaysShort:"sun_mån_tys_ons_tor_fre_lau".split("_"),weekdaysMin:"su_må_ty_on_to_fr_lø".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[I dag klokka] LT",nextDay:"[I morgon klokka] LT",nextWeek:"dddd [klokka] LT",lastDay:"[I går klokka] LT",lastWeek:"[Føregåande] dddd [klokka] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"for %s sidan",s:"nokre sekund",m:"eit minutt",mm:"%d minutt",h:"ein time",hh:"%d timar",d:"ein dag",dd:"%d dagar",M:"ein månad",MM:"%d månader",y:"eit år",yy:"%d år"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),"styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_")),Dg="stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia".split("_"),Eg=(Kf.defineLocale("pl",{months:function(a,b){return""===b?"("+Dg[a.month()]+"|"+Cg[a.month()]+")":/D MMMM/.test(b)?Dg[a.month()]:Cg[a.month()]},monthsShort:"sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"),weekdays:"niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"),weekdaysShort:"nie_pon_wt_śr_czw_pt_sb".split("_"),weekdaysMin:"Nd_Pn_Wt_Śr_Cz_Pt_So".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Dziś o] LT",nextDay:"[Jutro o] LT",nextWeek:"[W] dddd [o] LT",lastDay:"[Wczoraj o] LT",lastWeek:function(){switch(this.day()){case 0:return"[W zeszłą niedzielę o] LT";case 3:return"[W zeszłą środę o] LT";case 6:return"[W zeszłą sobotę o] LT";default:return"[W zeszły] dddd [o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"%s temu",s:"kilka sekund",m:Bd,mm:Bd,h:Bd,hh:Bd,d:"1 dzień",dd:"%d dni",M:"miesiąc",MM:Bd,y:"rok",yy:Bd},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),Kf.defineLocale("pt-br",{months:"Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingo_Segunda-Feira_Terça-Feira_Quarta-Feira_Quinta-Feira_Sexta-Feira_Sábado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),weekdaysMin:"Dom_2ª_3ª_4ª_5ª_6ª_Sáb".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [às] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [às] HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"%s atrás",s:"poucos segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},ordinalParse:/\d{1,2}º/,ordinal:"%dº"}),Kf.defineLocale("pt",{months:"Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingo_Segunda-Feira_Terça-Feira_Quarta-Feira_Quinta-Feira_Sexta-Feira_Sábado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),weekdaysMin:"Dom_2ª_3ª_4ª_5ª_6ª_Sáb".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"há %s",s:"segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},ordinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}}),Kf.defineLocale("ro",{months:"ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie".split("_"),monthsShort:"ian._febr._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.".split("_"),weekdays:"duminică_luni_marți_miercuri_joi_vineri_sâmbătă".split("_"),weekdaysShort:"Dum_Lun_Mar_Mie_Joi_Vin_Sâm".split("_"),weekdaysMin:"Du_Lu_Ma_Mi_Jo_Vi_Sâ".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[azi la] LT",nextDay:"[mâine la] LT",nextWeek:"dddd [la] LT",lastDay:"[ieri la] LT",lastWeek:"[fosta] dddd [la] LT",sameElse:"L"},relativeTime:{future:"peste %s",past:"%s în urmă",s:"câteva secunde",m:"un minut",mm:Cd,h:"o oră",hh:Cd,d:"o zi",dd:Cd,M:"o lună",MM:Cd,y:"un an",yy:Cd},week:{dow:1,doy:7}}),[/^янв/i,/^фев/i,/^мар/i,/^апр/i,/^ма[й|я]/i,/^июн/i,/^июл/i,/^авг/i,/^сен/i,/^окт/i,/^ноя/i,/^дек/i]),Fg=(Kf.defineLocale("ru",{months:{format:"Января_Февраля_Марта_Апреля_Мая_Июня_Июля_Августа_Сентября_Октября_Ноября_Декабря".split("_"),standalone:"Январь_Февраль_Март_Апрель_Май_Июнь_Июль_Август_Сентябрь_Октябрь_Ноябрь_Декабрь".split("_")},monthsShort:{format:"янв_фев_мар_апр_мая_июня_июля_авг_сен_окт_ноя_дек".split("_"),standalone:"янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек".split("_")},weekdays:{standalone:"Воскресенье_Понедельник_Вторник_Среда_Четверг_Пятница_Суббота".split("_"),format:"Воскресенье_Понедельник_Вторник_Среду_Четверг_Пятницу_Субботу".split("_"),isFormat:/\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?\] ?dddd/},weekdaysShort:"Вс_Пн_Вт_Ср_Чт_Пт_Сб".split("_"),weekdaysMin:"Вс_Пн_Вт_Ср_Чт_Пт_Сб".split("_"),monthsParse:Eg,longMonthsParse:Eg,shortMonthsParse:Eg,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., HH:mm",LLLL:"dddd, D MMMM YYYY г., HH:mm"},calendar:{sameDay:"[Сегодня в] LT",nextDay:"[Завтра в] LT",lastDay:"[Вчера в] LT",nextWeek:function(a){if(a.week()===this.week())return 2===this.day()?"[Во] dddd [в] LT":"[В] dddd [в] LT";switch(this.day()){case 0:return"[В следующее] dddd [в] LT";case 1:case 2:case 4:return"[В следующий] dddd [в] LT";case 3:case 5:case 6:return"[В следующую] dddd [в] LT"}},lastWeek:function(a){if(a.week()===this.week())return 2===this.day()?"[Во] dddd [в] LT":"[В] dddd [в] LT";switch(this.day()){case 0:return"[В прошлое] dddd [в] LT";case 1:case 2:case 4:return"[В прошлый] dddd [в] LT";case 3:case 5:case 6:return"[В прошлую] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",m:Ed,mm:Ed,h:"час",hh:Ed,d:"день",dd:Ed,M:"месяц",MM:Ed,y:"год",yy:Ed},meridiemParse:/ночи|утра|дня|вечера/i,isPM:function(a){return/^(дня|вечера)$/.test(a)},meridiem:function(a,b,c){return 4>a?"ночи":12>a?"утра":17>a?"дня":"вечера"},ordinalParse:/\d{1,2}-(й|го|я)/,ordinal:function(a,b){switch(b){case"M":case"d":case"DDD":return a+"-й";case"D":return a+"-го";case"w":case"W":return a+"-я";default:return a}},week:{dow:1,doy:7}}),Kf.defineLocale("se",{months:"ođđajagemánnu_guovvamánnu_njukčamánnu_cuoŋománnu_miessemánnu_geassemánnu_suoidnemánnu_borgemánnu_čakčamánnu_golggotmánnu_skábmamánnu_juovlamánnu".split("_"),monthsShort:"ođđj_guov_njuk_cuo_mies_geas_suoi_borg_čakč_golg_skáb_juov".split("_"),weekdays:"sotnabeaivi_vuossárga_maŋŋebárga_gaskavahkku_duorastat_bearjadat_lávvardat".split("_"),weekdaysShort:"sotn_vuos_maŋ_gask_duor_bear_láv".split("_"),weekdaysMin:"s_v_m_g_d_b_L".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"MMMM D. [b.] YYYY",LLL:"MMMM D. [b.] YYYY [ti.] HH:mm",LLLL:"dddd, MMMM D. [b.] YYYY [ti.] HH:mm"},calendar:{sameDay:"[otne ti] LT",nextDay:"[ihttin ti] LT",nextWeek:"dddd [ti] LT",lastDay:"[ikte ti] LT",lastWeek:"[ovddit] dddd [ti] LT",sameElse:"L"},relativeTime:{future:"%s geažes",past:"maŋit %s",s:"moadde sekunddat",m:"okta minuhta",mm:"%d minuhtat",h:"okta diimmu",hh:"%d diimmut",d:"okta beaivi",dd:"%d beaivvit",M:"okta mánnu",MM:"%d mánut",y:"okta jahki",yy:"%d jagit"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),Kf.defineLocale("si",{months:"ජනවාරි_පෙබරවාරි_මාර්තු_අප්‍රේල්_මැයි_ජූනි_ජූලි_අගෝස්තු_සැප්තැම්බර්_ඔක්තෝබර්_නොවැම්බර්_දෙසැම්බර්".split("_"),monthsShort:"ජන_පෙබ_මාර්_අප්_මැයි_ජූනි_ජූලි_අගෝ_සැප්_ඔක්_නොවැ_දෙසැ".split("_"),weekdays:"ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්‍රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා".split("_"),weekdaysShort:"ඉරි_සඳු_අඟ_බදා_බ්‍රහ_සිකු_සෙන".split("_"),weekdaysMin:"ඉ_ස_අ_බ_බ්‍ර_සි_සෙ".split("_"),longDateFormat:{LT:"a h:mm",LTS:"a h:mm:ss",L:"YYYY/MM/DD",LL:"YYYY MMMM D",LLL:"YYYY MMMM D, a h:mm",LLLL:"YYYY MMMM D [වැනි] dddd, a h:mm:ss"},calendar:{sameDay:"[අද] LT[ට]",nextDay:"[හෙට] LT[ට]",nextWeek:"dddd LT[ට]",lastDay:"[ඊයේ] LT[ට]",lastWeek:"[පසුගිය] dddd LT[ට]",sameElse:"L"},relativeTime:{future:"%sකින්",past:"%sකට පෙර",s:"තත්පර කිහිපය",m:"මිනිත්තුව",mm:"මිනිත්තු %d",h:"පැය",hh:"පැය %d",d:"දිනය",dd:"දින %d",M:"මාසය",MM:"මාස %d",y:"වසර",yy:"වසර %d"},ordinalParse:/\d{1,2} වැනි/,ordinal:function(a){return a+" වැනි"},meridiem:function(a,b,c){return a>11?c?"ප.ව.":"පස් වරු":c?"පෙ.ව.":"පෙර වරු"}}),"január_február_marec_apríl_máj_jún_júl_august_september_október_november_december".split("_")),Gg="jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec".split("_"),Hg=(Kf.defineLocale("sk",{months:Fg,monthsShort:Gg,weekdays:"nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota".split("_"),weekdaysShort:"ne_po_ut_st_št_pi_so".split("_"),weekdaysMin:"ne_po_ut_st_št_pi_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm"},calendar:{sameDay:"[dnes o] LT",nextDay:"[zajtra o] LT",nextWeek:function(){switch(this.day()){case 0:return"[v nedeľu o] LT";case 1:case 2:return"[v] dddd [o] LT";case 3:return"[v stredu o] LT";case 4:return"[vo štvrtok o] LT";case 5:return"[v piatok o] LT";case 6:return"[v sobotu o] LT"}},lastDay:"[včera o] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulú nedeľu o] LT";case 1:case 2:return"[minulý] dddd [o] LT";case 3:return"[minulú stredu o] LT";case 4:case 5:return"[minulý] dddd [o] LT";case 6:return"[minulú sobotu o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"pred %s",s:Gd,m:Gd,mm:Gd,h:Gd,hh:Gd,d:Gd,dd:Gd,M:Gd,MM:Gd,y:Gd,yy:Gd},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),Kf.defineLocale("sl",{months:"januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.".split("_"),weekdays:"nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota".split("_"),weekdaysShort:"ned._pon._tor._sre._čet._pet._sob.".split("_"),weekdaysMin:"ne_po_to_sr_če_pe_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danes ob] LT",nextDay:"[jutri ob] LT",nextWeek:function(){switch(this.day()){case 0:return"[v] [nedeljo] [ob] LT";case 3:return"[v] [sredo] [ob] LT";case 6:return"[v] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[v] dddd [ob] LT"}},lastDay:"[včeraj ob] LT",lastWeek:function(){switch(this.day()){case 0:return"[prejšnjo] [nedeljo] [ob] LT";case 3:return"[prejšnjo] [sredo] [ob] LT";case 6:return"[prejšnjo] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[prejšnji] dddd [ob] LT"}},sameElse:"L"},relativeTime:{future:"čez %s",past:"pred %s",s:Hd,m:Hd,mm:Hd,h:Hd,hh:Hd,d:Hd,dd:Hd,M:Hd,MM:Hd,y:Hd,yy:Hd},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),Kf.defineLocale("sq",{months:"Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor".split("_"),monthsShort:"Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj".split("_"),weekdays:"E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë".split("_"),weekdaysShort:"Die_Hën_Mar_Mër_Enj_Pre_Sht".split("_"),weekdaysMin:"D_H_Ma_Më_E_P_Sh".split("_"),meridiemParse:/PD|MD/,isPM:function(a){return"M"===a.charAt(0)},meridiem:function(a,b,c){return 12>a?"PD":"MD"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Sot në] LT",nextDay:"[Nesër në] LT",nextWeek:"dddd [në] LT",lastDay:"[Dje në] LT",lastWeek:"dddd [e kaluar në] LT",sameElse:"L"},relativeTime:{future:"në %s",past:"%s më parë",s:"disa sekonda",m:"një minutë",mm:"%d minuta",h:"një orë",hh:"%d orë",d:"një ditë",dd:"%d ditë",M:"një muaj",MM:"%d muaj",y:"një vit",yy:"%d vite"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),{words:{m:["један минут","једне минуте"],mm:["минут","минуте","минута"],h:["један сат","једног сата"],hh:["сат","сата","сати"],dd:["дан","дана","дана"],MM:["месец","месеца","месеци"],yy:["година","године","година"]},correctGrammaticalCase:function(a,b){return 1===a?b[0]:a>=2&&4>=a?b[1]:b[2]},translate:function(a,b,c){var d=Hg.words[c];return 1===c.length?b?d[0]:d[1]:a+" "+Hg.correctGrammaticalCase(a,d)}}),Ig=(Kf.defineLocale("sr-cyrl",{months:["јануар","фебруар","март","април","мај","јун","јул","август","септембар","октобар","новембар","децембар"],monthsShort:["јан.","феб.","мар.","апр.","мај","јун","јул","авг.","сеп.","окт.","нов.","дец."],weekdays:["недеља","понедељак","уторак","среда","четвртак","петак","субота"],weekdaysShort:["нед.","пон.","уто.","сре.","чет.","пет.","суб."],weekdaysMin:["не","по","ут","ср","че","пе","су"],longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[данас у] LT",nextDay:"[сутра у] LT",nextWeek:function(){switch(this.day()){case 0:return"[у] [недељу] [у] LT";case 3:return"[у] [среду] [у] LT";case 6:return"[у] [суботу] [у] LT";case 1:case 2:case 4:case 5:return"[у] dddd [у] LT"}},lastDay:"[јуче у] LT",lastWeek:function(){var a=["[прошле] [недеље] [у] LT","[прошлог] [понедељка] [у] LT","[прошлог] [уторка] [у] LT","[прошле] [среде] [у] LT","[прошлог] [четвртка] [у] LT","[прошлог] [петка] [у] LT","[прошле] [суботе] [у] LT"];return a[this.day()]},sameElse:"L"},relativeTime:{future:"за %s",past:"пре %s",s:"неколико секунди",m:Hg.translate,mm:Hg.translate,h:Hg.translate,hh:Hg.translate,d:"дан",dd:Hg.translate,M:"месец",MM:Hg.translate,y:"годину",yy:Hg.translate},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),{words:{m:["jedan minut","jedne minute"],mm:["minut","minute","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mesec","meseca","meseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(a,b){return 1===a?b[0]:a>=2&&4>=a?b[1]:b[2]},translate:function(a,b,c){var d=Ig.words[c];return 1===c.length?b?d[0]:d[1]:a+" "+Ig.correctGrammaticalCase(a,d)}}),Jg=(Kf.defineLocale("sr",{months:["januar","februar","mart","april","maj","jun","jul","avgust","septembar","oktobar","novembar","decembar"],monthsShort:["jan.","feb.","mar.","apr.","maj","jun","jul","avg.","sep.","okt.","nov.","dec."],weekdays:["nedelja","ponedeljak","utorak","sreda","četvrtak","petak","subota"],weekdaysShort:["ned.","pon.","uto.","sre.","čet.","pet.","sub."],weekdaysMin:["ne","po","ut","sr","če","pe","su"],longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedelju] [u] LT";case 3:return"[u] [sredu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){var a=["[prošle] [nedelje] [u] LT","[prošlog] [ponedeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"];return a[this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"pre %s",s:"nekoliko sekundi",m:Ig.translate,mm:Ig.translate,h:Ig.translate,hh:Ig.translate,d:"dan",dd:Ig.translate,M:"mesec",MM:Ig.translate,y:"godinu",yy:Ig.translate -},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),Kf.defineLocale("sv",{months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"),weekdaysShort:"sön_mån_tis_ons_tor_fre_lör".split("_"),weekdaysMin:"sö_må_ti_on_to_fr_lö".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Idag] LT",nextDay:"[Imorgon] LT",lastDay:"[Igår] LT",nextWeek:"[På] dddd LT",lastWeek:"[I] dddd[s] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"för %s sedan",s:"några sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en månad",MM:"%d månader",y:"ett år",yy:"%d år"},ordinalParse:/\d{1,2}(e|a)/,ordinal:function(a){var b=a%10,c=1===~~(a%100/10)?"e":1===b?"a":2===b?"a":"e";return a+c},week:{dow:1,doy:4}}),Kf.defineLocale("sw",{months:"Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des".split("_"),weekdays:"Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi".split("_"),weekdaysShort:"Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos".split("_"),weekdaysMin:"J2_J3_J4_J5_Al_Ij_J1".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[leo saa] LT",nextDay:"[kesho saa] LT",nextWeek:"[wiki ijayo] dddd [saat] LT",lastDay:"[jana] LT",lastWeek:"[wiki iliyopita] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s baadaye",past:"tokea %s",s:"hivi punde",m:"dakika moja",mm:"dakika %d",h:"saa limoja",hh:"masaa %d",d:"siku moja",dd:"masiku %d",M:"mwezi mmoja",MM:"miezi %d",y:"mwaka mmoja",yy:"miaka %d"},week:{dow:1,doy:7}}),{1:"௧",2:"௨",3:"௩",4:"௪",5:"௫",6:"௬",7:"௭",8:"௮",9:"௯",0:"௦"}),Kg={"௧":"1","௨":"2","௩":"3","௪":"4","௫":"5","௬":"6","௭":"7","௮":"8","௯":"9","௦":"0"},Lg=(Kf.defineLocale("ta",{months:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),monthsShort:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),weekdays:"ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை".split("_"),weekdaysShort:"ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி".split("_"),weekdaysMin:"ஞா_தி_செ_பு_வி_வெ_ச".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, HH:mm",LLLL:"dddd, D MMMM YYYY, HH:mm"},calendar:{sameDay:"[இன்று] LT",nextDay:"[நாளை] LT",nextWeek:"dddd, LT",lastDay:"[நேற்று] LT",lastWeek:"[கடந்த வாரம்] dddd, LT",sameElse:"L"},relativeTime:{future:"%s இல்",past:"%s முன்",s:"ஒரு சில விநாடிகள்",m:"ஒரு நிமிடம்",mm:"%d நிமிடங்கள்",h:"ஒரு மணி நேரம்",hh:"%d மணி நேரம்",d:"ஒரு நாள்",dd:"%d நாட்கள்",M:"ஒரு மாதம்",MM:"%d மாதங்கள்",y:"ஒரு வருடம்",yy:"%d ஆண்டுகள்"},ordinalParse:/\d{1,2}வது/,ordinal:function(a){return a+"வது"},preparse:function(a){return a.replace(/[௧௨௩௪௫௬௭௮௯௦]/g,function(a){return Kg[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return Jg[a]})},meridiemParse:/யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/,meridiem:function(a,b,c){return 2>a?" யாமம்":6>a?" வைகறை":10>a?" காலை":14>a?" நண்பகல்":18>a?" எற்பாடு":22>a?" மாலை":" யாமம்"},meridiemHour:function(a,b){return 12===a&&(a=0),"யாமம்"===b?2>a?a:a+12:"வைகறை"===b||"காலை"===b?a:"நண்பகல்"===b&&a>=10?a:a+12},week:{dow:0,doy:6}}),Kf.defineLocale("te",{months:"జనవరి_ఫిబ్రవరి_మార్చి_ఏప్రిల్_మే_జూన్_జూలై_ఆగస్టు_సెప్టెంబర్_అక్టోబర్_నవంబర్_డిసెంబర్".split("_"),monthsShort:"జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జూలై_ఆగ._సెప్._అక్టో._నవ._డిసె.".split("_"),weekdays:"ఆదివారం_సోమవారం_మంగళవారం_బుధవారం_గురువారం_శుక్రవారం_శనివారం".split("_"),weekdaysShort:"ఆది_సోమ_మంగళ_బుధ_గురు_శుక్ర_శని".split("_"),weekdaysMin:"ఆ_సో_మం_బు_గు_శు_శ".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[నేడు] LT",nextDay:"[రేపు] LT",nextWeek:"dddd, LT",lastDay:"[నిన్న] LT",lastWeek:"[గత] dddd, LT",sameElse:"L"},relativeTime:{future:"%s లో",past:"%s క్రితం",s:"కొన్ని క్షణాలు",m:"ఒక నిమిషం",mm:"%d నిమిషాలు",h:"ఒక గంట",hh:"%d గంటలు",d:"ఒక రోజు",dd:"%d రోజులు",M:"ఒక నెల",MM:"%d నెలలు",y:"ఒక సంవత్సరం",yy:"%d సంవత్సరాలు"},ordinalParse:/\d{1,2}వ/,ordinal:"%dవ",meridiemParse:/రాత్రి|ఉదయం|మధ్యాహ్నం|సాయంత్రం/,meridiemHour:function(a,b){return 12===a&&(a=0),"రాత్రి"===b?4>a?a:a+12:"ఉదయం"===b?a:"మధ్యాహ్నం"===b?a>=10?a:a+12:"సాయంత్రం"===b?a+12:void 0},meridiem:function(a,b,c){return 4>a?"రాత్రి":10>a?"ఉదయం":17>a?"మధ్యాహ్నం":20>a?"సాయంత్రం":"రాత్రి"},week:{dow:0,doy:6}}),Kf.defineLocale("th",{months:"มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม".split("_"),monthsShort:"มกรา_กุมภา_มีนา_เมษา_พฤษภา_มิถุนา_กรกฎา_สิงหา_กันยา_ตุลา_พฤศจิกา_ธันวา".split("_"),weekdays:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์".split("_"),weekdaysShort:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์".split("_"),weekdaysMin:"อา._จ._อ._พ._พฤ._ศ._ส.".split("_"),longDateFormat:{LT:"H นาฬิกา m นาที",LTS:"H นาฬิกา m นาที s วินาที",L:"YYYY/MM/DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY เวลา H นาฬิกา m นาที",LLLL:"วันddddที่ D MMMM YYYY เวลา H นาฬิกา m นาที"},meridiemParse:/ก่อนเที่ยง|หลังเที่ยง/,isPM:function(a){return"หลังเที่ยง"===a},meridiem:function(a,b,c){return 12>a?"ก่อนเที่ยง":"หลังเที่ยง"},calendar:{sameDay:"[วันนี้ เวลา] LT",nextDay:"[พรุ่งนี้ เวลา] LT",nextWeek:"dddd[หน้า เวลา] LT",lastDay:"[เมื่อวานนี้ เวลา] LT",lastWeek:"[วัน]dddd[ที่แล้ว เวลา] LT",sameElse:"L"},relativeTime:{future:"อีก %s",past:"%sที่แล้ว",s:"ไม่กี่วินาที",m:"1 นาที",mm:"%d นาที",h:"1 ชั่วโมง",hh:"%d ชั่วโมง",d:"1 วัน",dd:"%d วัน",M:"1 เดือน",MM:"%d เดือน",y:"1 ปี",yy:"%d ปี"}}),Kf.defineLocale("tl-ph",{months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},calendar:{sameDay:"[Ngayon sa] LT",nextDay:"[Bukas sa] LT",nextWeek:"dddd [sa] LT",lastDay:"[Kahapon sa] LT",lastWeek:"dddd [huling linggo] LT",sameElse:"L"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"},ordinalParse:/\d{1,2}/,ordinal:function(a){return a},week:{dow:1,doy:4}}),"pagh_wa’_cha’_wej_loS_vagh_jav_Soch_chorgh_Hut".split("_")),Mg=(Kf.defineLocale("tlh",{months:"tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’".split("_"),monthsShort:"jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’".split("_"),weekdays:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysShort:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysMin:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[DaHjaj] LT",nextDay:"[wa’leS] LT",nextWeek:"LLL",lastDay:"[wa’Hu’] LT",lastWeek:"LLL",sameElse:"L"},relativeTime:{future:Id,past:Jd,s:"puS lup",m:"wa’ tup",mm:Kd,h:"wa’ rep",hh:Kd,d:"wa’ jaj",dd:Kd,M:"wa’ jar",MM:Kd,y:"wa’ DIS",yy:Kd},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),{1:"'inci",5:"'inci",8:"'inci",70:"'inci",80:"'inci",2:"'nci",7:"'nci",20:"'nci",50:"'nci",3:"'üncü",4:"'üncü",100:"'üncü",6:"'ncı",9:"'uncu",10:"'uncu",30:"'uncu",60:"'ıncı",90:"'ıncı"}),Ng=(Kf.defineLocale("tr",{months:"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),monthsShort:"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),weekdays:"Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"),weekdaysMin:"Pz_Pt_Sa_Ça_Pe_Cu_Ct".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[yarın saat] LT",nextWeek:"[haftaya] dddd [saat] LT",lastDay:"[dün] LT",lastWeek:"[geçen hafta] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s önce",s:"birkaç saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ordinalParse:/\d{1,2}'(inci|nci|üncü|ncı|uncu|ıncı)/,ordinal:function(a){if(0===a)return a+"'ıncı";var b=a%10,c=a%100-b,d=a>=100?100:null;return a+(Mg[b]||Mg[c]||Mg[d])},week:{dow:1,doy:7}}),Kf.defineLocale("tzl",{months:"Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar".split("_"),monthsShort:"Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec".split("_"),weekdays:"Súladi_Lúneçi_Maitzi_Márcuri_Xhúadi_Viénerçi_Sáturi".split("_"),weekdaysShort:"Súl_Lún_Mai_Már_Xhú_Vié_Sát".split("_"),weekdaysMin:"Sú_Lú_Ma_Má_Xh_Vi_Sá".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"D. MMMM [dallas] YYYY",LLL:"D. MMMM [dallas] YYYY HH.mm",LLLL:"dddd, [li] D. MMMM [dallas] YYYY HH.mm"},meridiem:function(a,b,c){return a>11?c?"d'o":"D'O":c?"d'a":"D'A"},calendar:{sameDay:"[oxhi à] LT",nextDay:"[demà à] LT",nextWeek:"dddd [à] LT",lastDay:"[ieiri à] LT",lastWeek:"[sür el] dddd [lasteu à] LT",sameElse:"L"},relativeTime:{future:"osprei %s",past:"ja%s",s:Md,m:Md,mm:Md,h:Md,hh:Md,d:Md,dd:Md,M:Md,MM:Md,y:Md,yy:Md},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),Kf.defineLocale("tzm-latn",{months:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),monthsShort:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),weekdays:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysShort:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysMin:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[asdkh g] LT",nextDay:"[aska g] LT",nextWeek:"dddd [g] LT",lastDay:"[assant g] LT",lastWeek:"dddd [g] LT",sameElse:"L"},relativeTime:{future:"dadkh s yan %s",past:"yan %s",s:"imik",m:"minuḍ",mm:"%d minuḍ",h:"saɛa",hh:"%d tassaɛin",d:"ass",dd:"%d ossan",M:"ayowr",MM:"%d iyyirn",y:"asgas",yy:"%d isgasn"},week:{dow:6,doy:12}}),Kf.defineLocale("tzm",{months:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),monthsShort:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),weekdays:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysShort:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysMin:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ⴰⵙⴷⵅ ⴴ] LT",nextDay:"[ⴰⵙⴽⴰ ⴴ] LT",nextWeek:"dddd [ⴴ] LT",lastDay:"[ⴰⵚⴰⵏⵜ ⴴ] LT",lastWeek:"dddd [ⴴ] LT",sameElse:"L"},relativeTime:{future:"ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s",past:"ⵢⴰⵏ %s",s:"ⵉⵎⵉⴽ",m:"ⵎⵉⵏⵓⴺ",mm:"%d ⵎⵉⵏⵓⴺ",h:"ⵙⴰⵄⴰ",hh:"%d ⵜⴰⵙⵙⴰⵄⵉⵏ",d:"ⴰⵙⵙ",dd:"%d oⵙⵙⴰⵏ",M:"ⴰⵢoⵓⵔ",MM:"%d ⵉⵢⵢⵉⵔⵏ",y:"ⴰⵙⴳⴰⵙ",yy:"%d ⵉⵙⴳⴰⵙⵏ"},week:{dow:6,doy:12}}),Kf.defineLocale("uk",{months:{format:"січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня".split("_"),standalone:"січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень".split("_")},monthsShort:"січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд".split("_"),weekdays:Pd,weekdaysShort:"нд_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY р.",LLL:"D MMMM YYYY р., HH:mm",LLLL:"dddd, D MMMM YYYY р., HH:mm"},calendar:{sameDay:Qd("[Сьогодні "),nextDay:Qd("[Завтра "),lastDay:Qd("[Вчора "),nextWeek:Qd("[У] dddd ["),lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return Qd("[Минулої] dddd [").call(this);case 1:case 2:case 4:return Qd("[Минулого] dddd [").call(this)}},sameElse:"L"},relativeTime:{future:"за %s",past:"%s тому",s:"декілька секунд",m:Od,mm:Od,h:"годину",hh:Od,d:"день",dd:Od,M:"місяць",MM:Od,y:"рік",yy:Od},meridiemParse:/ночі|ранку|дня|вечора/,isPM:function(a){return/^(дня|вечора)$/.test(a)},meridiem:function(a,b,c){return 4>a?"ночі":12>a?"ранку":17>a?"дня":"вечора"},ordinalParse:/\d{1,2}-(й|го)/,ordinal:function(a,b){switch(b){case"M":case"d":case"DDD":case"w":case"W":return a+"-й";case"D":return a+"-го";default:return a}},week:{dow:1,doy:7}}),Kf.defineLocale("uz",{months:"январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр".split("_"),monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба".split("_"),weekdaysShort:"Якш_Душ_Сеш_Чор_Пай_Жум_Шан".split("_"),weekdaysMin:"Як_Ду_Се_Чо_Па_Жу_Ша".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},calendar:{sameDay:"[Бугун соат] LT [да]",nextDay:"[Эртага] LT [да]",nextWeek:"dddd [куни соат] LT [да]",lastDay:"[Кеча соат] LT [да]",lastWeek:"[Утган] dddd [куни соат] LT [да]",sameElse:"L"},relativeTime:{future:"Якин %s ичида",past:"Бир неча %s олдин",s:"фурсат",m:"бир дакика",mm:"%d дакика",h:"бир соат",hh:"%d соат",d:"бир кун",dd:"%d кун",M:"бир ой",MM:"%d ой",y:"бир йил",yy:"%d йил"},week:{dow:1,doy:7}}),Kf.defineLocale("vi",{months:"tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12".split("_"),monthsShort:"Th01_Th02_Th03_Th04_Th05_Th06_Th07_Th08_Th09_Th10_Th11_Th12".split("_"),weekdays:"chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy".split("_"),weekdaysShort:"CN_T2_T3_T4_T5_T6_T7".split("_"),weekdaysMin:"CN_T2_T3_T4_T5_T6_T7".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [năm] YYYY",LLL:"D MMMM [năm] YYYY HH:mm",LLLL:"dddd, D MMMM [năm] YYYY HH:mm",l:"DD/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[Hôm nay lúc] LT",nextDay:"[Ngày mai lúc] LT",nextWeek:"dddd [tuần tới lúc] LT",lastDay:"[Hôm qua lúc] LT",lastWeek:"dddd [tuần rồi lúc] LT",sameElse:"L"},relativeTime:{future:"%s tới",past:"%s trước",s:"vài giây",m:"một phút",mm:"%d phút",h:"một giờ",hh:"%d giờ",d:"một ngày",dd:"%d ngày",M:"một tháng",MM:"%d tháng",y:"một năm",yy:"%d năm"},ordinalParse:/\d{1,2}/,ordinal:function(a){return a},week:{dow:1,doy:4}}),Kf.defineLocale("zh-cn",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"Ah点mm分",LTS:"Ah点m分s秒",L:"YYYY-MM-DD",LL:"YYYY年MMMD日",LLL:"YYYY年MMMD日Ah点mm分",LLLL:"YYYY年MMMD日ddddAh点mm分",l:"YYYY-MM-DD",ll:"YYYY年MMMD日",lll:"YYYY年MMMD日Ah点mm分",llll:"YYYY年MMMD日ddddAh点mm分"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(a,b){return 12===a&&(a=0),"凌晨"===b||"早上"===b||"上午"===b?a:"下午"===b||"晚上"===b?a+12:a>=11?a:a+12},meridiem:function(a,b,c){var d=100*a+b;return 600>d?"凌晨":900>d?"早上":1130>d?"上午":1230>d?"中午":1800>d?"下午":"晚上"},calendar:{sameDay:function(){return 0===this.minutes()?"[今天]Ah[点整]":"[今天]LT"},nextDay:function(){return 0===this.minutes()?"[明天]Ah[点整]":"[明天]LT"},lastDay:function(){return 0===this.minutes()?"[昨天]Ah[点整]":"[昨天]LT"},nextWeek:function(){var a,b;return a=Kf().startOf("week"),b=this.unix()-a.unix()>=604800?"[下]":"[本]",0===this.minutes()?b+"dddAh点整":b+"dddAh点mm"},lastWeek:function(){var a,b;return a=Kf().startOf("week"),b=this.unix()=11?a:a+12:"下午"===b||"晚上"===b?a+12:void 0},meridiem:function(a,b,c){var d=100*a+b;return 900>d?"早上":1130>d?"上午":1230>d?"中午":1800>d?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:"[下]ddddLT",lastDay:"[昨天]LT",lastWeek:"[上]ddddLT",sameElse:"L"},ordinalParse:/\d{1,2}(日|月|週)/,ordinal:function(a,b){switch(b){case"d":case"D":case"DDD":return a+"日";case"M":return a+"月";case"w":case"W":return a+"週";default:return a}},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",m:"一分鐘",mm:"%d分鐘",h:"一小時",hh:"%d小時",d:"一天",dd:"%d天",M:"一個月",MM:"%d個月",y:"一年",yy:"%d年"}}),Kf);return Ng.locale("en"),Ng}); \ No newline at end of file +a.version="2.12.0",b(Ja),a.fn=nf,a.min=La,a.max=Ma,a.now=Ve,a.utc=h,a.unix=qc,a.months=Bc,a.isDate=d,a.locale=E,a.invalid=l,a.duration=cb,a.isMoment=p,a.weekdays=Dc,a.parseZone=rc,a.localeData=H,a.isDuration=Oa,a.monthsShort=Cc,a.weekdaysMin=Fc,a.defineLocale=F,a.updateLocale=G,a.locales=I,a.weekdaysShort=Ec,a.normalizeUnits=K,a.relativeTimeThreshold=Wc,a.prototype=nf;var Pf=a,Qf=(Pf.defineLocale("af",{months:"Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des".split("_"),weekdays:"Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag".split("_"),weekdaysShort:"Son_Maa_Din_Woe_Don_Vry_Sat".split("_"),weekdaysMin:"So_Ma_Di_Wo_Do_Vr_Sa".split("_"),meridiemParse:/vm|nm/i,isPM:function(a){return/^nm$/i.test(a)},meridiem:function(a,b,c){return 12>a?c?"vm":"VM":c?"nm":"NM"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Vandag om] LT",nextDay:"[Môre om] LT",nextWeek:"dddd [om] LT",lastDay:"[Gister om] LT",lastWeek:"[Laas] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oor %s",past:"%s gelede",s:"'n paar sekondes",m:"'n minuut",mm:"%d minute",h:"'n uur",hh:"%d ure",d:"'n dag",dd:"%d dae",M:"'n maand",MM:"%d maande",y:"'n jaar",yy:"%d jaar"},ordinalParse:/\d{1,2}(ste|de)/,ordinal:function(a){return a+(1===a||8===a||a>=20?"ste":"de")},week:{dow:1,doy:4}}),Pf.defineLocale("ar-ma",{months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdays:"الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:6,doy:12}}),{1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"}),Rf={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},Sf=(Pf.defineLocale("ar-sa",{months:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(a){return"م"===a},meridiem:function(a,b,c){return 12>a?"ص":"م"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},preparse:function(a){return a.replace(/[١٢٣٤٥٦٧٨٩٠]/g,function(a){return Rf[a]}).replace(/،/g,",")},postformat:function(a){return a.replace(/\d/g,function(a){return Qf[a]}).replace(/,/g,"،")},week:{dow:6,doy:12}}),Pf.defineLocale("ar-tn",{months:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:1,doy:4}}),{1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"}),Tf={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},Uf=function(a){return 0===a?0:1===a?1:2===a?2:a%100>=3&&10>=a%100?3:a%100>=11?4:5},Vf={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},Wf=function(a){return function(b,c,d,e){var f=Uf(b),g=Vf[a][Uf(b)];return 2===f&&(g=g[c?0:1]),g.replace(/%d/i,b)}},Xf=["كانون الثاني يناير","شباط فبراير","آذار مارس","نيسان أبريل","أيار مايو","حزيران يونيو","تموز يوليو","آب أغسطس","أيلول سبتمبر","تشرين الأول أكتوبر","تشرين الثاني نوفمبر","كانون الأول ديسمبر"],Yf=(Pf.defineLocale("ar",{months:Xf,monthsShort:Xf,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(a){return"م"===a},meridiem:function(a,b,c){return 12>a?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:Wf("s"),m:Wf("m"),mm:Wf("m"),h:Wf("h"),hh:Wf("h"),d:Wf("d"),dd:Wf("d"),M:Wf("M"),MM:Wf("M"),y:Wf("y"),yy:Wf("y")},preparse:function(a){return a.replace(/\u200f/g,"").replace(/[١٢٣٤٥٦٧٨٩٠]/g,function(a){return Tf[a]}).replace(/،/g,",")},postformat:function(a){return a.replace(/\d/g,function(a){return Sf[a]}).replace(/,/g,"،")},week:{dow:6,doy:12}}),{1:"-inci",5:"-inci",8:"-inci",70:"-inci",80:"-inci",2:"-nci",7:"-nci",20:"-nci",50:"-nci",3:"-üncü",4:"-üncü",100:"-üncü",6:"-ncı",9:"-uncu",10:"-uncu",30:"-uncu",60:"-ıncı",90:"-ıncı"}),Zf=(Pf.defineLocale("az",{months:"yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr".split("_"),monthsShort:"yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek".split("_"),weekdays:"Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə".split("_"),weekdaysShort:"Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən".split("_"),weekdaysMin:"Bz_BE_ÇA_Çə_CA_Cü_Şə".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[sabah saat] LT",nextWeek:"[gələn həftə] dddd [saat] LT",lastDay:"[dünən] LT",lastWeek:"[keçən həftə] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s əvvəl",s:"birneçə saniyyə",m:"bir dəqiqə",mm:"%d dəqiqə",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir il",yy:"%d il"},meridiemParse:/gecə|səhər|gündüz|axşam/,isPM:function(a){return/^(gündüz|axşam)$/.test(a)},meridiem:function(a,b,c){return 4>a?"gecə":12>a?"səhər":17>a?"gündüz":"axşam"},ordinalParse:/\d{1,2}-(ıncı|inci|nci|üncü|ncı|uncu)/,ordinal:function(a){if(0===a)return a+"-ıncı";var b=a%10,c=a%100-b,d=a>=100?100:null;return a+(Yf[b]||Yf[c]||Yf[d])},week:{dow:1,doy:7}}),Pf.defineLocale("be",{months:{format:"студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня".split("_"),standalone:"студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань".split("_")},monthsShort:"студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж".split("_"),weekdays:{format:"нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу".split("_"),standalone:"нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота".split("_"),isFormat:/\[ ?[Вв] ?(?:мінулую|наступную)? ?\] ?dddd/},weekdaysShort:"нд_пн_ат_ср_чц_пт_сб".split("_"),weekdaysMin:"нд_пн_ат_ср_чц_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., HH:mm",LLLL:"dddd, D MMMM YYYY г., HH:mm"},calendar:{sameDay:"[Сёння ў] LT",nextDay:"[Заўтра ў] LT",lastDay:"[Учора ў] LT",nextWeek:function(){return"[У] dddd [ў] LT"},lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return"[У мінулую] dddd [ў] LT";case 1:case 2:case 4:return"[У мінулы] dddd [ў] LT"}},sameElse:"L"},relativeTime:{future:"праз %s",past:"%s таму",s:"некалькі секунд",m:$c,mm:$c,h:$c,hh:$c,d:"дзень",dd:$c,M:"месяц",MM:$c,y:"год",yy:$c},meridiemParse:/ночы|раніцы|дня|вечара/,isPM:function(a){return/^(дня|вечара)$/.test(a)},meridiem:function(a,b,c){return 4>a?"ночы":12>a?"раніцы":17>a?"дня":"вечара"},ordinalParse:/\d{1,2}-(і|ы|га)/,ordinal:function(a,b){switch(b){case"M":case"d":case"DDD":case"w":case"W":return a%10!==2&&a%10!==3||a%100===12||a%100===13?a+"-ы":a+"-і";case"D":return a+"-га";default:return a}},week:{dow:1,doy:7}}),Pf.defineLocale("bg",{months:"януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември".split("_"),monthsShort:"янр_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек".split("_"),weekdays:"неделя_понеделник_вторник_сряда_четвъртък_петък_събота".split("_"),weekdaysShort:"нед_пон_вто_сря_чет_пет_съб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Днес в] LT",nextDay:"[Утре в] LT",nextWeek:"dddd [в] LT",lastDay:"[Вчера в] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[В изминалата] dddd [в] LT";case 1:case 2:case 4:case 5:return"[В изминалия] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"след %s",past:"преди %s",s:"няколко секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дни",M:"месец",MM:"%d месеца",y:"година",yy:"%d години"},ordinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(a){var b=a%10,c=a%100;return 0===a?a+"-ев":0===c?a+"-ен":c>10&&20>c?a+"-ти":1===b?a+"-ви":2===b?a+"-ри":7===b||8===b?a+"-ми":a+"-ти"},week:{dow:1,doy:7}}),{1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"}),$f={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"},_f=(Pf.defineLocale("bn",{months:"জানুয়ারী_ফেবুয়ারী_মার্চ_এপ্রিল_মে_জুন_জুলাই_অগাস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),monthsShort:"জানু_ফেব_মার্চ_এপর_মে_জুন_জুল_অগ_সেপ্ট_অক্টো_নভ_ডিসেম্".split("_"),weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পত্তিবার_শুক্রবার_শনিবার".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পত্তি_শুক্র_শনি".split("_"),weekdaysMin:"রব_সম_মঙ্গ_বু_ব্রিহ_শু_শনি".split("_"),longDateFormat:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm সময়",LLLL:"dddd, D MMMM YYYY, A h:mm সময়"},calendar:{sameDay:"[আজ] LT",nextDay:"[আগামীকাল] LT",nextWeek:"dddd, LT",lastDay:"[গতকাল] LT",lastWeek:"[গত] dddd, LT",sameElse:"L"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"},preparse:function(a){return a.replace(/[১২৩৪৫৬৭৮৯০]/g,function(a){return $f[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return Zf[a]})},meridiemParse:/রাত|সকাল|দুপুর|বিকাল|রাত/,meridiemHour:function(a,b){return 12===a&&(a=0),"রাত"===b&&a>=4||"দুপুর"===b&&5>a||"বিকাল"===b?a+12:a},meridiem:function(a,b,c){return 4>a?"রাত":10>a?"সকাল":17>a?"দুপুর":20>a?"বিকাল":"রাত"},week:{dow:0,doy:6}}),{1:"༡",2:"༢",3:"༣",4:"༤",5:"༥",6:"༦",7:"༧",8:"༨",9:"༩",0:"༠"}),ag={"༡":"1","༢":"2","༣":"3","༤":"4","༥":"5","༦":"6","༧":"7","༨":"8","༩":"9","༠":"0"},bg=(Pf.defineLocale("bo",{months:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),monthsShort:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),weekdays:"གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་".split("_"),weekdaysShort:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),weekdaysMin:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[དི་རིང] LT",nextDay:"[སང་ཉིན] LT",nextWeek:"[བདུན་ཕྲག་རྗེས་མ], LT",lastDay:"[ཁ་སང] LT",lastWeek:"[བདུན་ཕྲག་མཐའ་མ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ལ་",past:"%s སྔན་ལ",s:"ལམ་སང",m:"སྐར་མ་གཅིག",mm:"%d སྐར་མ",h:"ཆུ་ཚོད་གཅིག",hh:"%d ཆུ་ཚོད",d:"ཉིན་གཅིག",dd:"%d ཉིན་",M:"ཟླ་བ་གཅིག",MM:"%d ཟླ་བ",y:"ལོ་གཅིག",yy:"%d ལོ"},preparse:function(a){return a.replace(/[༡༢༣༤༥༦༧༨༩༠]/g,function(a){return ag[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return _f[a]})},meridiemParse:/མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/,meridiemHour:function(a,b){return 12===a&&(a=0),"མཚན་མོ"===b&&a>=4||"ཉིན་གུང"===b&&5>a||"དགོང་དག"===b?a+12:a},meridiem:function(a,b,c){return 4>a?"མཚན་མོ":10>a?"ཞོགས་ཀས":17>a?"ཉིན་གུང":20>a?"དགོང་དག":"མཚན་མོ"},week:{dow:0,doy:6}}),Pf.defineLocale("br",{months:"Genver_C'hwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu".split("_"),monthsShort:"Gen_C'hwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker".split("_"),weekdays:"Sul_Lun_Meurzh_Merc'her_Yaou_Gwener_Sadorn".split("_"),weekdaysShort:"Sul_Lun_Meu_Mer_Yao_Gwe_Sad".split("_"),weekdaysMin:"Su_Lu_Me_Mer_Ya_Gw_Sa".split("_"),longDateFormat:{LT:"h[e]mm A",LTS:"h[e]mm:ss A",L:"DD/MM/YYYY",LL:"D [a viz] MMMM YYYY",LLL:"D [a viz] MMMM YYYY h[e]mm A",LLLL:"dddd, D [a viz] MMMM YYYY h[e]mm A"},calendar:{sameDay:"[Hiziv da] LT",nextDay:"[Warc'hoazh da] LT",nextWeek:"dddd [da] LT",lastDay:"[Dec'h da] LT",lastWeek:"dddd [paset da] LT",sameElse:"L"},relativeTime:{future:"a-benn %s",past:"%s 'zo",s:"un nebeud segondennoù",m:"ur vunutenn",mm:_c,h:"un eur",hh:"%d eur",d:"un devezh",dd:_c,M:"ur miz",MM:_c,y:"ur bloaz",yy:ad},ordinalParse:/\d{1,2}(añ|vet)/,ordinal:function(a){var b=1===a?"añ":"vet";return a+b},week:{dow:1,doy:4}}),Pf.defineLocale("bs",{months:"januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.".split("_"),weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:case 3:return"[prošlu] dddd [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",m:ed,mm:ed,h:ed,hh:ed,d:"dan",dd:ed,M:"mjesec",MM:ed,y:"godinu",yy:ed},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),Pf.defineLocale("ca",{months:"gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre".split("_"),monthsShort:"gen._febr._mar._abr._mai._jun._jul._ag._set._oct._nov._des.".split("_"),weekdays:"diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dt._dc._dj._dv._ds.".split("_"),weekdaysMin:"Dg_Dl_Dt_Dc_Dj_Dv_Ds".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd D MMMM YYYY H:mm"},calendar:{sameDay:function(){return"[avui a "+(1!==this.hours()?"les":"la")+"] LT"},nextDay:function(){return"[demà a "+(1!==this.hours()?"les":"la")+"] LT"},nextWeek:function(){return"dddd [a "+(1!==this.hours()?"les":"la")+"] LT"},lastDay:function(){return"[ahir a "+(1!==this.hours()?"les":"la")+"] LT"},lastWeek:function(){return"[el] dddd [passat a "+(1!==this.hours()?"les":"la")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"fa %s",s:"uns segons",m:"un minut",mm:"%d minuts",h:"una hora",hh:"%d hores",d:"un dia",dd:"%d dies",M:"un mes",MM:"%d mesos",y:"un any",yy:"%d anys"},ordinalParse:/\d{1,2}(r|n|t|è|a)/,ordinal:function(a,b){var c=1===a?"r":2===a?"n":3===a?"r":4===a?"t":"è";return("w"===b||"W"===b)&&(c="a"),a+c},week:{dow:1,doy:4}}),"leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec".split("_")),cg="led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro".split("_"),dg=(Pf.defineLocale("cs",{months:bg,monthsShort:cg,monthsParse:function(a,b){var c,d=[];for(c=0;12>c;c++)d[c]=new RegExp("^"+a[c]+"$|^"+b[c]+"$","i");return d}(bg,cg),shortMonthsParse:function(a){var b,c=[];for(b=0;12>b;b++)c[b]=new RegExp("^"+a[b]+"$","i");return c}(cg),longMonthsParse:function(a){var b,c=[];for(b=0;12>b;b++)c[b]=new RegExp("^"+a[b]+"$","i");return c}(bg),weekdays:"neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota".split("_"),weekdaysShort:"ne_po_út_st_čt_pá_so".split("_"),weekdaysMin:"ne_po_út_st_čt_pá_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm"},calendar:{sameDay:"[dnes v] LT",nextDay:"[zítra v] LT",nextWeek:function(){switch(this.day()){case 0:return"[v neděli v] LT";case 1:case 2:return"[v] dddd [v] LT";case 3:return"[ve středu v] LT";case 4:return"[ve čtvrtek v] LT";case 5:return"[v pátek v] LT";case 6:return"[v sobotu v] LT"}},lastDay:"[včera v] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulou neděli v] LT";case 1:case 2:return"[minulé] dddd [v] LT";case 3:return"[minulou středu v] LT";case 4:case 5:return"[minulý] dddd [v] LT";case 6:return"[minulou sobotu v] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"před %s",s:gd,m:gd,mm:gd,h:gd,hh:gd,d:gd,dd:gd,M:gd,MM:gd,y:gd,yy:gd},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),Pf.defineLocale("cv",{months:"кӑрлач_нарӑс_пуш_ака_май_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав".split("_"),monthsShort:"кӑр_нар_пуш_ака_май_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш".split("_"),weekdays:"вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун".split("_"),weekdaysShort:"выр_тун_ытл_юн_кӗҫ_эрн_шӑм".split("_"),weekdaysMin:"вр_тн_ыт_юн_кҫ_эр_шм".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]",LLL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm",LLLL:"dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm"},calendar:{sameDay:"[Паян] LT [сехетре]",nextDay:"[Ыран] LT [сехетре]",lastDay:"[Ӗнер] LT [сехетре]",nextWeek:"[Ҫитес] dddd LT [сехетре]",lastWeek:"[Иртнӗ] dddd LT [сехетре]",sameElse:"L"},relativeTime:{future:function(a){var b=/сехет$/i.exec(a)?"рен":/ҫул$/i.exec(a)?"тан":"ран";return a+b},past:"%s каялла",s:"пӗр-ик ҫеккунт",m:"пӗр минут",mm:"%d минут",h:"пӗр сехет",hh:"%d сехет",d:"пӗр кун",dd:"%d кун",M:"пӗр уйӑх",MM:"%d уйӑх",y:"пӗр ҫул",yy:"%d ҫул"},ordinalParse:/\d{1,2}-мӗш/,ordinal:"%d-мӗш",week:{dow:1,doy:7}}),Pf.defineLocale("cy",{months:"Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr".split("_"),monthsShort:"Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag".split("_"),weekdays:"Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn".split("_"),weekdaysShort:"Sul_Llun_Maw_Mer_Iau_Gwe_Sad".split("_"),weekdaysMin:"Su_Ll_Ma_Me_Ia_Gw_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Heddiw am] LT",nextDay:"[Yfory am] LT",nextWeek:"dddd [am] LT",lastDay:"[Ddoe am] LT",lastWeek:"dddd [diwethaf am] LT",sameElse:"L"},relativeTime:{future:"mewn %s",past:"%s yn ôl",s:"ychydig eiliadau",m:"munud",mm:"%d munud",h:"awr",hh:"%d awr",d:"diwrnod",dd:"%d diwrnod",M:"mis",MM:"%d mis",y:"blwyddyn",yy:"%d flynedd"},ordinalParse:/\d{1,2}(fed|ain|af|il|ydd|ed|eg)/,ordinal:function(a){var b=a,c="",d=["","af","il","ydd","ydd","ed","ed","ed","fed","fed","fed","eg","fed","eg","eg","fed","eg","eg","fed","eg","fed"];return b>20?c=40===b||50===b||60===b||80===b||100===b?"fed":"ain":b>0&&(c=d[b]),a+c},week:{dow:1,doy:4}}),Pf.defineLocale("da",{months:"januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"søn_man_tir_ons_tor_fre_lør".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd [d.] D. MMMM YYYY HH:mm"},calendar:{sameDay:"[I dag kl.] LT",nextDay:"[I morgen kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[I går kl.] LT",lastWeek:"[sidste] dddd [kl] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"få sekunder",m:"et minut",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dage",M:"en måned",MM:"%d måneder",y:"et år",yy:"%d år"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),Pf.defineLocale("de-at",{months:"Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jän._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",m:hd,mm:"%d Minuten",h:hd,hh:"%d Stunden",d:hd,dd:hd,M:hd,MM:hd,y:hd,yy:hd},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),Pf.defineLocale("de",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",m:id,mm:"%d Minuten",h:id,hh:"%d Stunden",d:id,dd:id,M:id,MM:id,y:id,yy:id},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),["ޖެނުއަރީ","ފެބްރުއަރީ","މާރިޗު","އޭޕްރީލު","މޭ","ޖޫން","ޖުލައި","އޯގަސްޓު","ސެޕްޓެމްބަރު","އޮކްޓޯބަރު","ނޮވެމްބަރު","ޑިސެމްބަރު"]),eg=["އާދިއްތަ","ހޯމަ","އަންގާރަ","ބުދަ","ބުރާސްފަތި","ހުކުރު","ހޮނިހިރު"],fg=(Pf.defineLocale("dv",{months:dg,monthsShort:dg,weekdays:eg,weekdaysShort:eg,weekdaysMin:"އާދި_ހޯމަ_އަން_ބުދަ_ބުރާ_ހުކު_ހޮނި".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/M/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/މކ|މފ/,isPM:function(a){return"މފ"===a},meridiem:function(a,b,c){return 12>a?"މކ":"މފ"},calendar:{sameDay:"[މިއަދު] LT",nextDay:"[މާދަމާ] LT",nextWeek:"dddd LT",lastDay:"[އިއްޔެ] LT",lastWeek:"[ފާއިތުވި] dddd LT",sameElse:"L"},relativeTime:{future:"ތެރޭގައި %s",past:"ކުރިން %s",s:"ސިކުންތުކޮޅެއް",m:"މިނިޓެއް",mm:"މިނިޓު %d",h:"ގަޑިއިރެއް",hh:"ގަޑިއިރު %d",d:"ދުވަހެއް",dd:"ދުވަސް %d",M:"މަހެއް",MM:"މަސް %d",y:"އަހަރެއް",yy:"އަހަރު %d"},preparse:function(a){return a.replace(/،/g,",")},postformat:function(a){return a.replace(/,/g,"،")},week:{dow:7,doy:12}}),Pf.defineLocale("el",{monthsNominativeEl:"Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος".split("_"),monthsGenitiveEl:"Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου".split("_"),months:function(a,b){return/D/.test(b.substring(0,b.indexOf("MMMM")))?this._monthsGenitiveEl[a.month()]:this._monthsNominativeEl[a.month()]},monthsShort:"Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ".split("_"),weekdays:"Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο".split("_"),weekdaysShort:"Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ".split("_"),weekdaysMin:"Κυ_Δε_Τρ_Τε_Πε_Πα_Σα".split("_"),meridiem:function(a,b,c){return a>11?c?"μμ":"ΜΜ":c?"πμ":"ΠΜ"},isPM:function(a){return"μ"===(a+"").toLowerCase()[0]},meridiemParse:/[ΠΜ]\.?Μ?\.?/i,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendarEl:{sameDay:"[Σήμερα {}] LT",nextDay:"[Αύριο {}] LT",nextWeek:"dddd [{}] LT",lastDay:"[Χθες {}] LT",lastWeek:function(){switch(this.day()){case 6:return"[το προηγούμενο] dddd [{}] LT";default:return"[την προηγούμενη] dddd [{}] LT"}},sameElse:"L"},calendar:function(a,b){var c=this._calendarEl[a],d=b&&b.hours();return w(c)&&(c=c.apply(b)),c.replace("{}",d%12===1?"στη":"στις")},relativeTime:{future:"σε %s",past:"%s πριν",s:"λίγα δευτερόλεπτα",m:"ένα λεπτό",mm:"%d λεπτά",h:"μία ώρα",hh:"%d ώρες",d:"μία μέρα",dd:"%d μέρες",M:"ένας μήνας",MM:"%d μήνες",y:"ένας χρόνος",yy:"%d χρόνια"},ordinalParse:/\d{1,2}η/,ordinal:"%dη",week:{dow:1,doy:4}}),Pf.defineLocale("en-au",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{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"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(a){var b=a%10,c=1===~~(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c},week:{dow:1,doy:4}}),Pf.defineLocale("en-ca",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"YYYY-MM-DD",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{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"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(a){var b=a%10,c=1===~~(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c}}),Pf.defineLocale("en-gb",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{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"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(a){var b=a%10,c=1===~~(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c},week:{dow:1,doy:4}}),Pf.defineLocale("en-ie",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{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"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(a){var b=a%10,c=1===~~(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c},week:{dow:1,doy:4}}),Pf.defineLocale("en-nz",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{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"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(a){var b=a%10,c=1===~~(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c},week:{dow:1,doy:4}}),Pf.defineLocale("eo",{months:"januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro".split("_"), +monthsShort:"jan_feb_mar_apr_maj_jun_jul_aŭg_sep_okt_nov_dec".split("_"),weekdays:"Dimanĉo_Lundo_Mardo_Merkredo_Ĵaŭdo_Vendredo_Sabato".split("_"),weekdaysShort:"Dim_Lun_Mard_Merk_Ĵaŭ_Ven_Sab".split("_"),weekdaysMin:"Di_Lu_Ma_Me_Ĵa_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D[-an de] MMMM, YYYY",LLL:"D[-an de] MMMM, YYYY HH:mm",LLLL:"dddd, [la] D[-an de] MMMM, YYYY HH:mm"},meridiemParse:/[ap]\.t\.m/i,isPM:function(a){return"p"===a.charAt(0).toLowerCase()},meridiem:function(a,b,c){return a>11?c?"p.t.m.":"P.T.M.":c?"a.t.m.":"A.T.M."},calendar:{sameDay:"[Hodiaŭ je] LT",nextDay:"[Morgaŭ je] LT",nextWeek:"dddd [je] LT",lastDay:"[Hieraŭ je] LT",lastWeek:"[pasinta] dddd [je] LT",sameElse:"L"},relativeTime:{future:"je %s",past:"antaŭ %s",s:"sekundoj",m:"minuto",mm:"%d minutoj",h:"horo",hh:"%d horoj",d:"tago",dd:"%d tagoj",M:"monato",MM:"%d monatoj",y:"jaro",yy:"%d jaroj"},ordinalParse:/\d{1,2}a/,ordinal:"%da",week:{dow:1,doy:7}}),"ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_")),gg="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),hg=(Pf.defineLocale("es",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(a,b){return/-MMM-/.test(b)?gg[a.month()]:fg[a.month()]},weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}}),Pf.defineLocale("et",{months:"jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember".split("_"),monthsShort:"jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets".split("_"),weekdays:"pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev".split("_"),weekdaysShort:"P_E_T_K_N_R_L".split("_"),weekdaysMin:"P_E_T_K_N_R_L".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[Täna,] LT",nextDay:"[Homme,] LT",nextWeek:"[Järgmine] dddd LT",lastDay:"[Eile,] LT",lastWeek:"[Eelmine] dddd LT",sameElse:"L"},relativeTime:{future:"%s pärast",past:"%s tagasi",s:jd,m:jd,mm:jd,h:jd,hh:jd,d:jd,dd:"%d päeva",M:jd,MM:jd,y:jd,yy:jd},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),Pf.defineLocale("eu",{months:"urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua".split("_"),monthsShort:"urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.".split("_"),weekdays:"igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata".split("_"),weekdaysShort:"ig._al._ar._az._og._ol._lr.".split("_"),weekdaysMin:"ig_al_ar_az_og_ol_lr".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY[ko] MMMM[ren] D[a]",LLL:"YYYY[ko] MMMM[ren] D[a] HH:mm",LLLL:"dddd, YYYY[ko] MMMM[ren] D[a] HH:mm",l:"YYYY-M-D",ll:"YYYY[ko] MMM D[a]",lll:"YYYY[ko] MMM D[a] HH:mm",llll:"ddd, YYYY[ko] MMM D[a] HH:mm"},calendar:{sameDay:"[gaur] LT[etan]",nextDay:"[bihar] LT[etan]",nextWeek:"dddd LT[etan]",lastDay:"[atzo] LT[etan]",lastWeek:"[aurreko] dddd LT[etan]",sameElse:"L"},relativeTime:{future:"%s barru",past:"duela %s",s:"segundo batzuk",m:"minutu bat",mm:"%d minutu",h:"ordu bat",hh:"%d ordu",d:"egun bat",dd:"%d egun",M:"hilabete bat",MM:"%d hilabete",y:"urte bat",yy:"%d urte"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),{1:"۱",2:"۲",3:"۳",4:"۴",5:"۵",6:"۶",7:"۷",8:"۸",9:"۹",0:"۰"}),ig={"۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","۰":"0"},jg=(Pf.defineLocale("fa",{months:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),monthsShort:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),weekdays:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysShort:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysMin:"ی_د_س_چ_پ_ج_ش".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/قبل از ظهر|بعد از ظهر/,isPM:function(a){return/بعد از ظهر/.test(a)},meridiem:function(a,b,c){return 12>a?"قبل از ظهر":"بعد از ظهر"},calendar:{sameDay:"[امروز ساعت] LT",nextDay:"[فردا ساعت] LT",nextWeek:"dddd [ساعت] LT",lastDay:"[دیروز ساعت] LT",lastWeek:"dddd [پیش] [ساعت] LT",sameElse:"L"},relativeTime:{future:"در %s",past:"%s پیش",s:"چندین ثانیه",m:"یک دقیقه",mm:"%d دقیقه",h:"یک ساعت",hh:"%d ساعت",d:"یک روز",dd:"%d روز",M:"یک ماه",MM:"%d ماه",y:"یک سال",yy:"%d سال"},preparse:function(a){return a.replace(/[۰-۹]/g,function(a){return ig[a]}).replace(/،/g,",")},postformat:function(a){return a.replace(/\d/g,function(a){return hg[a]}).replace(/,/g,"،")},ordinalParse:/\d{1,2}م/,ordinal:"%dم",week:{dow:6,doy:12}}),"nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän".split(" ")),kg=["nolla","yhden","kahden","kolmen","neljän","viiden","kuuden",jg[7],jg[8],jg[9]],lg=(Pf.defineLocale("fi",{months:"tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu".split("_"),monthsShort:"tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu".split("_"),weekdays:"sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai".split("_"),weekdaysShort:"su_ma_ti_ke_to_pe_la".split("_"),weekdaysMin:"su_ma_ti_ke_to_pe_la".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"Do MMMM[ta] YYYY",LLL:"Do MMMM[ta] YYYY, [klo] HH.mm",LLLL:"dddd, Do MMMM[ta] YYYY, [klo] HH.mm",l:"D.M.YYYY",ll:"Do MMM YYYY",lll:"Do MMM YYYY, [klo] HH.mm",llll:"ddd, Do MMM YYYY, [klo] HH.mm"},calendar:{sameDay:"[tänään] [klo] LT",nextDay:"[huomenna] [klo] LT",nextWeek:"dddd [klo] LT",lastDay:"[eilen] [klo] LT",lastWeek:"[viime] dddd[na] [klo] LT",sameElse:"L"},relativeTime:{future:"%s päästä",past:"%s sitten",s:kd,m:kd,mm:kd,h:kd,hh:kd,d:kd,dd:kd,M:kd,MM:kd,y:kd,yy:kd},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),Pf.defineLocale("fo",{months:"januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur".split("_"),weekdaysShort:"sun_mán_týs_mik_hós_frí_ley".split("_"),weekdaysMin:"su_má_tý_mi_hó_fr_le".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D. MMMM, YYYY HH:mm"},calendar:{sameDay:"[Í dag kl.] LT",nextDay:"[Í morgin kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[Í gjár kl.] LT",lastWeek:"[síðstu] dddd [kl] LT",sameElse:"L"},relativeTime:{future:"um %s",past:"%s síðani",s:"fá sekund",m:"ein minutt",mm:"%d minuttir",h:"ein tími",hh:"%d tímar",d:"ein dagur",dd:"%d dagar",M:"ein mánaði",MM:"%d mánaðir",y:"eitt ár",yy:"%d ár"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),Pf.defineLocale("fr-ca",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"Di_Lu_Ma_Me_Je_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd'hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},ordinalParse:/\d{1,2}(er|e)/,ordinal:function(a){return a+(1===a?"er":"e")}}),Pf.defineLocale("fr-ch",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"Di_Lu_Ma_Me_Je_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd'hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},ordinalParse:/\d{1,2}(er|e)/,ordinal:function(a){return a+(1===a?"er":"e")},week:{dow:1,doy:4}}),Pf.defineLocale("fr",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"Di_Lu_Ma_Me_Je_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd'hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},ordinalParse:/\d{1,2}(er|)/,ordinal:function(a){return a+(1===a?"er":"")},week:{dow:1,doy:4}}),"jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.".split("_")),mg="jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),ng=(Pf.defineLocale("fy",{months:"jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber".split("_"),monthsShort:function(a,b){return/-MMM-/.test(b)?mg[a.month()]:lg[a.month()]},weekdays:"snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon".split("_"),weekdaysShort:"si._mo._ti._wo._to._fr._so.".split("_"),weekdaysMin:"Si_Mo_Ti_Wo_To_Fr_So".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[hjoed om] LT",nextDay:"[moarn om] LT",nextWeek:"dddd [om] LT",lastDay:"[juster om] LT",lastWeek:"[ôfrûne] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oer %s",past:"%s lyn",s:"in pear sekonden",m:"ien minút",mm:"%d minuten",h:"ien oere",hh:"%d oeren",d:"ien dei",dd:"%d dagen",M:"ien moanne",MM:"%d moannen",y:"ien jier",yy:"%d jierren"},ordinalParse:/\d{1,2}(ste|de)/,ordinal:function(a){return a+(1===a||8===a||a>=20?"ste":"de")},week:{dow:1,doy:4}}),["Am Faoilleach","An Gearran","Am Màrt","An Giblean","An Cèitean","An t-Ògmhios","An t-Iuchar","An Lùnastal","An t-Sultain","An Dàmhair","An t-Samhain","An Dùbhlachd"]),og=["Faoi","Gear","Màrt","Gibl","Cèit","Ògmh","Iuch","Lùn","Sult","Dàmh","Samh","Dùbh"],pg=["Didòmhnaich","Diluain","Dimàirt","Diciadain","Diardaoin","Dihaoine","Disathairne"],qg=["Did","Dil","Dim","Dic","Dia","Dih","Dis"],rg=["Dò","Lu","Mà","Ci","Ar","Ha","Sa"],sg=(Pf.defineLocale("gd",{months:ng,monthsShort:og,monthsParseExact:!0,weekdays:pg,weekdaysShort:qg,weekdaysMin:rg,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[An-diugh aig] LT",nextDay:"[A-màireach aig] LT",nextWeek:"dddd [aig] LT",lastDay:"[An-dè aig] LT",lastWeek:"dddd [seo chaidh] [aig] LT",sameElse:"L"},relativeTime:{future:"ann an %s",past:"bho chionn %s",s:"beagan diogan",m:"mionaid",mm:"%d mionaidean",h:"uair",hh:"%d uairean",d:"latha",dd:"%d latha",M:"mìos",MM:"%d mìosan",y:"bliadhna",yy:"%d bliadhna"},ordinalParse:/\d{1,2}(d|na|mh)/,ordinal:function(a){var b=1===a?"d":a%10===2?"na":"mh";return a+b},week:{dow:1,doy:4}}),Pf.defineLocale("gl",{months:"Xaneiro_Febreiro_Marzo_Abril_Maio_Xuño_Xullo_Agosto_Setembro_Outubro_Novembro_Decembro".split("_"),monthsShort:"Xan._Feb._Mar._Abr._Mai._Xuñ._Xul._Ago._Set._Out._Nov._Dec.".split("_"),weekdays:"Domingo_Luns_Martes_Mércores_Xoves_Venres_Sábado".split("_"),weekdaysShort:"Dom._Lun._Mar._Mér._Xov._Ven._Sáb.".split("_"),weekdaysMin:"Do_Lu_Ma_Mé_Xo_Ve_Sá".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd D MMMM YYYY H:mm"},calendar:{sameDay:function(){return"[hoxe "+(1!==this.hours()?"ás":"á")+"] LT"},nextDay:function(){return"[mañá "+(1!==this.hours()?"ás":"á")+"] LT"},nextWeek:function(){return"dddd ["+(1!==this.hours()?"ás":"a")+"] LT"},lastDay:function(){return"[onte "+(1!==this.hours()?"á":"a")+"] LT"},lastWeek:function(){return"[o] dddd [pasado "+(1!==this.hours()?"ás":"a")+"] LT"},sameElse:"L"},relativeTime:{future:function(a){return"uns segundos"===a?"nuns segundos":"en "+a},past:"hai %s",s:"uns segundos",m:"un minuto",mm:"%d minutos",h:"unha hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un ano",yy:"%d anos"},ordinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:7}}),Pf.defineLocale("he",{months:"ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר".split("_"),monthsShort:"ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳".split("_"),weekdays:"ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת".split("_"),weekdaysShort:"א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳".split("_"),weekdaysMin:"א_ב_ג_ד_ה_ו_ש".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [ב]MMMM YYYY",LLL:"D [ב]MMMM YYYY HH:mm",LLLL:"dddd, D [ב]MMMM YYYY HH:mm",l:"D/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[היום ב־]LT",nextDay:"[מחר ב־]LT",nextWeek:"dddd [בשעה] LT",lastDay:"[אתמול ב־]LT",lastWeek:"[ביום] dddd [האחרון בשעה] LT",sameElse:"L"},relativeTime:{future:"בעוד %s",past:"לפני %s",s:"מספר שניות",m:"דקה",mm:"%d דקות",h:"שעה",hh:function(a){return 2===a?"שעתיים":a+" שעות"},d:"יום",dd:function(a){return 2===a?"יומיים":a+" ימים"},M:"חודש",MM:function(a){return 2===a?"חודשיים":a+" חודשים"},y:"שנה",yy:function(a){return 2===a?"שנתיים":a%10===0&&10!==a?a+" שנה":a+" שנים"}},meridiemParse:/אחה"צ|לפנה"צ|אחרי הצהריים|לפני הצהריים|לפנות בוקר|בבוקר|בערב/i,isPM:function(a){return/^(אחה"צ|אחרי הצהריים|בערב)$/.test(a)},meridiem:function(a,b,c){return 5>a?"לפנות בוקר":10>a?"בבוקר":12>a?c?'לפנה"צ':"לפני הצהריים":18>a?c?'אחה"צ':"אחרי הצהריים":"בערב"}}),{1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"}),tg={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"},ug=(Pf.defineLocale("hi",{months:"जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर".split("_"),monthsShort:"जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.".split("_"),weekdays:"रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm बजे",LTS:"A h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm बजे",LLLL:"dddd, D MMMM YYYY, A h:mm बजे"},calendar:{sameDay:"[आज] LT",nextDay:"[कल] LT",nextWeek:"dddd, LT",lastDay:"[कल] LT",lastWeek:"[पिछले] dddd, LT",sameElse:"L"},relativeTime:{future:"%s में",past:"%s पहले",s:"कुछ ही क्षण",m:"एक मिनट",mm:"%d मिनट",h:"एक घंटा",hh:"%d घंटे",d:"एक दिन",dd:"%d दिन",M:"एक महीने",MM:"%d महीने",y:"एक वर्ष",yy:"%d वर्ष"},preparse:function(a){return a.replace(/[१२३४५६७८९०]/g,function(a){return tg[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return sg[a]})},meridiemParse:/रात|सुबह|दोपहर|शाम/,meridiemHour:function(a,b){return 12===a&&(a=0),"रात"===b?4>a?a:a+12:"सुबह"===b?a:"दोपहर"===b?a>=10?a:a+12:"शाम"===b?a+12:void 0},meridiem:function(a,b,c){return 4>a?"रात":10>a?"सुबह":17>a?"दोपहर":20>a?"शाम":"रात"},week:{dow:0,doy:6}}),Pf.defineLocale("hr",{months:{format:"siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca".split("_"),standalone:"siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac".split("_")},monthsShort:"sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.".split("_"),weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:case 3:return"[prošlu] dddd [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",m:md,mm:md,h:md,hh:md,d:"dan",dd:md,M:"mjesec",MM:md,y:"godinu",yy:md},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),"vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton".split(" ")),vg=(Pf.defineLocale("hu",{months:"január_február_március_április_május_június_július_augusztus_szeptember_október_november_december".split("_"),monthsShort:"jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec".split("_"),weekdays:"vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat".split("_"),weekdaysShort:"vas_hét_kedd_sze_csüt_pén_szo".split("_"),weekdaysMin:"v_h_k_sze_cs_p_szo".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY. MMMM D.",LLL:"YYYY. MMMM D. H:mm",LLLL:"YYYY. MMMM D., dddd H:mm"},meridiemParse:/de|du/i,isPM:function(a){return"u"===a.charAt(1).toLowerCase()},meridiem:function(a,b,c){return 12>a?c===!0?"de":"DE":c===!0?"du":"DU"},calendar:{sameDay:"[ma] LT[-kor]",nextDay:"[holnap] LT[-kor]",nextWeek:function(){return od.call(this,!0)},lastDay:"[tegnap] LT[-kor]",lastWeek:function(){return od.call(this,!1)},sameElse:"L"},relativeTime:{future:"%s múlva",past:"%s",s:nd,m:nd,mm:nd,h:nd,hh:nd,d:nd,dd:nd,M:nd,MM:nd,y:nd,yy:nd},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),Pf.defineLocale("hy-am",{months:{format:"հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի".split("_"),standalone:"հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր".split("_")},monthsShort:"հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ".split("_"),weekdays:"կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ".split("_"),weekdaysShort:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),weekdaysMin:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY թ.",LLL:"D MMMM YYYY թ., HH:mm",LLLL:"dddd, D MMMM YYYY թ., HH:mm"},calendar:{sameDay:"[այսօր] LT",nextDay:"[վաղը] LT",lastDay:"[երեկ] LT",nextWeek:function(){return"dddd [օրը ժամը] LT"},lastWeek:function(){return"[անցած] dddd [օրը ժամը] LT"},sameElse:"L"},relativeTime:{future:"%s հետո",past:"%s առաջ",s:"մի քանի վայրկյան",m:"րոպե",mm:"%d րոպե",h:"ժամ",hh:"%d ժամ",d:"օր",dd:"%d օր",M:"ամիս",MM:"%d ամիս",y:"տարի",yy:"%d տարի"},meridiemParse:/գիշերվա|առավոտվա|ցերեկվա|երեկոյան/,isPM:function(a){return/^(ցերեկվա|երեկոյան)$/.test(a)},meridiem:function(a){return 4>a?"գիշերվա":12>a?"առավոտվա":17>a?"ցերեկվա":"երեկոյան"},ordinalParse:/\d{1,2}|\d{1,2}-(ին|րդ)/,ordinal:function(a,b){switch(b){case"DDD":case"w":case"W":case"DDDo":return 1===a?a+"-ին":a+"-րդ";default:return a}},week:{dow:1,doy:7}}),Pf.defineLocale("id",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nov_Des".split("_"),weekdays:"Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu".split("_"),weekdaysShort:"Min_Sen_Sel_Rab_Kam_Jum_Sab".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|siang|sore|malam/,meridiemHour:function(a,b){return 12===a&&(a=0),"pagi"===b?a:"siang"===b?a>=11?a:a+12:"sore"===b||"malam"===b?a+12:void 0},meridiem:function(a,b,c){return 11>a?"pagi":15>a?"siang":19>a?"sore":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Besok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kemarin pukul] LT",lastWeek:"dddd [lalu pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lalu",s:"beberapa detik",m:"semenit",mm:"%d menit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}}),Pf.defineLocale("is",{months:"janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember".split("_"),monthsShort:"jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des".split("_"),weekdays:"sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur".split("_"),weekdaysShort:"sun_mán_þri_mið_fim_fös_lau".split("_"),weekdaysMin:"Su_Má_Þr_Mi_Fi_Fö_La".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd, D. MMMM YYYY [kl.] H:mm"},calendar:{sameDay:"[í dag kl.] LT",nextDay:"[á morgun kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[í gær kl.] LT",lastWeek:"[síðasta] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"eftir %s",past:"fyrir %s síðan",s:qd,m:qd,mm:qd,h:"klukkustund",hh:qd,d:qd,dd:qd,M:qd,MM:qd,y:qd,yy:qd},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),Pf.defineLocale("it",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"Domenica_Lunedì_Martedì_Mercoledì_Giovedì_Venerdì_Sabato".split("_"),weekdaysShort:"Dom_Lun_Mar_Mer_Gio_Ven_Sab".split("_"),weekdaysMin:"Do_Lu_Ma_Me_Gi_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Oggi alle] LT",nextDay:"[Domani alle] LT",nextWeek:"dddd [alle] LT",lastDay:"[Ieri alle] LT",lastWeek:function(){switch(this.day()){case 0:return"[la scorsa] dddd [alle] LT";default:return"[lo scorso] dddd [alle] LT"}},sameElse:"L"},relativeTime:{future:function(a){return(/^[0-9].+$/.test(a)?"tra":"in")+" "+a},past:"%s fa",s:"alcuni secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},ordinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}}),Pf.defineLocale("ja",{months:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"),weekdaysShort:"日_月_火_水_木_金_土".split("_"),weekdaysMin:"日_月_火_水_木_金_土".split("_"),longDateFormat:{LT:"Ah時m分",LTS:"Ah時m分s秒",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah時m分",LLLL:"YYYY年M月D日Ah時m分 dddd"},meridiemParse:/午前|午後/i,isPM:function(a){return"午後"===a},meridiem:function(a,b,c){return 12>a?"午前":"午後"},calendar:{sameDay:"[今日] LT",nextDay:"[明日] LT",nextWeek:"[来週]dddd LT",lastDay:"[昨日] LT",lastWeek:"[前週]dddd LT",sameElse:"L"},ordinalParse:/\d{1,2}日/,ordinal:function(a,b){switch(b){case"d":case"D":case"DDD":return a+"日";default:return a}},relativeTime:{future:"%s後",past:"%s前",s:"数秒",m:"1分",mm:"%d分",h:"1時間",hh:"%d時間",d:"1日",dd:"%d日",M:"1ヶ月",MM:"%dヶ月",y:"1年",yy:"%d年"}}),Pf.defineLocale("jv",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des".split("_"),weekdays:"Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu".split("_"),weekdaysShort:"Min_Sen_Sel_Reb_Kem_Jem_Sep".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sp".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/enjing|siyang|sonten|ndalu/,meridiemHour:function(a,b){return 12===a&&(a=0),"enjing"===b?a:"siyang"===b?a>=11?a:a+12:"sonten"===b||"ndalu"===b?a+12:void 0},meridiem:function(a,b,c){return 11>a?"enjing":15>a?"siyang":19>a?"sonten":"ndalu"},calendar:{sameDay:"[Dinten puniko pukul] LT",nextDay:"[Mbenjang pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kala wingi pukul] LT",lastWeek:"dddd [kepengker pukul] LT",sameElse:"L"},relativeTime:{future:"wonten ing %s",past:"%s ingkang kepengker",s:"sawetawis detik",m:"setunggal menit",mm:"%d menit",h:"setunggal jam",hh:"%d jam",d:"sedinten",dd:"%d dinten",M:"sewulan",MM:"%d wulan",y:"setaun",yy:"%d taun"},week:{dow:1,doy:7}}),Pf.defineLocale("ka",{months:{standalone:"იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი".split("_"),format:"იანვარს_თებერვალს_მარტს_აპრილის_მაისს_ივნისს_ივლისს_აგვისტს_სექტემბერს_ოქტომბერს_ნოემბერს_დეკემბერს".split("_")},monthsShort:"იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ".split("_"),weekdays:{standalone:"კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი".split("_"),format:"კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს".split("_"),isFormat:/(წინა|შემდეგ)/},weekdaysShort:"კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ".split("_"),weekdaysMin:"კვ_ორ_სა_ოთ_ხუ_პა_შა".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[დღეს] LT[-ზე]",nextDay:"[ხვალ] LT[-ზე]",lastDay:"[გუშინ] LT[-ზე]",nextWeek:"[შემდეგ] dddd LT[-ზე]",lastWeek:"[წინა] dddd LT-ზე",sameElse:"L"},relativeTime:{future:function(a){return/(წამი|წუთი|საათი|წელი)/.test(a)?a.replace(/ი$/,"ში"):a+"ში"},past:function(a){return/(წამი|წუთი|საათი|დღე|თვე)/.test(a)?a.replace(/(ი|ე)$/,"ის წინ"):/წელი/.test(a)?a.replace(/წელი$/,"წლის წინ"):void 0},s:"რამდენიმე წამი",m:"წუთი",mm:"%d წუთი",h:"საათი",hh:"%d საათი",d:"დღე",dd:"%d დღე",M:"თვე",MM:"%d თვე",y:"წელი",yy:"%d წელი"},ordinalParse:/0|1-ლი|მე-\d{1,2}|\d{1,2}-ე/,ordinal:function(a){return 0===a?a:1===a?a+"-ლი":20>a||100>=a&&a%20===0||a%100===0?"მე-"+a:a+"-ე"},week:{dow:1,doy:7}}),{0:"-ші",1:"-ші",2:"-ші",3:"-ші",4:"-ші",5:"-ші",6:"-шы",7:"-ші",8:"-ші",9:"-шы",10:"-шы",20:"-шы",30:"-шы",40:"-шы",50:"-ші",60:"-шы",70:"-ші",80:"-ші",90:"-шы",100:"-ші"}),wg=(Pf.defineLocale("kk",{months:"Қаңтар_Ақпан_Наурыз_Сәуір_Мамыр_Маусым_Шілде_Тамыз_Қыркүйек_Қазан_Қараша_Желтоқсан".split("_"),monthsShort:"Қаң_Ақп_Нау_Сәу_Мам_Мау_Шіл_Там_Қыр_Қаз_Қар_Жел".split("_"),weekdays:"Жексенбі_Дүйсенбі_Сейсенбі_Сәрсенбі_Бейсенбі_Жұма_Сенбі".split("_"),weekdaysShort:"Жек_Дүй_Сей_Сәр_Бей_Жұм_Сен".split("_"),weekdaysMin:"Жк_Дй_Сй_Ср_Бй_Жм_Сн".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Бүгін сағат] LT",nextDay:"[Ертең сағат] LT",nextWeek:"dddd [сағат] LT",lastDay:"[Кеше сағат] LT",lastWeek:"[Өткен аптаның] dddd [сағат] LT",sameElse:"L"},relativeTime:{future:"%s ішінде",past:"%s бұрын",s:"бірнеше секунд",m:"бір минут",mm:"%d минут",h:"бір сағат",hh:"%d сағат",d:"бір күн",dd:"%d күн",M:"бір ай",MM:"%d ай",y:"бір жыл",yy:"%d жыл"},ordinalParse:/\d{1,2}-(ші|шы)/,ordinal:function(a){var b=a%10,c=a>=100?100:null;return a+(vg[a]||vg[b]||vg[c])},week:{dow:1,doy:7}}),Pf.defineLocale("km",{months:"មករា_កុម្ភៈ_មិនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),monthsShort:"មករា_កុម្ភៈ_មិនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),weekdays:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),weekdaysShort:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),weekdaysMin:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[ថ្ងៃនេះ ម៉ោង] LT",nextDay:"[ស្អែក ម៉ោង] LT",nextWeek:"dddd [ម៉ោង] LT",lastDay:"[ម្សិលមិញ ម៉ោង] LT",lastWeek:"dddd [សប្តាហ៍មុន] [ម៉ោង] LT",sameElse:"L"},relativeTime:{future:"%sទៀត",past:"%sមុន",s:"ប៉ុន្មានវិនាទី",m:"មួយនាទី",mm:"%d នាទី",h:"មួយម៉ោង",hh:"%d ម៉ោង",d:"មួយថ្ងៃ",dd:"%d ថ្ងៃ",M:"មួយខែ",MM:"%d ខែ",y:"មួយឆ្នាំ",yy:"%d ឆ្នាំ"},week:{dow:1,doy:4}}),Pf.defineLocale("ko",{months:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),monthsShort:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),weekdays:"일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"),weekdaysShort:"일_월_화_수_목_금_토".split("_"),weekdaysMin:"일_월_화_수_목_금_토".split("_"),longDateFormat:{LT:"A h시 m분",LTS:"A h시 m분 s초",L:"YYYY.MM.DD",LL:"YYYY년 MMMM D일",LLL:"YYYY년 MMMM D일 A h시 m분",LLLL:"YYYY년 MMMM D일 dddd A h시 m분"},calendar:{sameDay:"오늘 LT",nextDay:"내일 LT",nextWeek:"dddd LT",lastDay:"어제 LT",lastWeek:"지난주 dddd LT",sameElse:"L"},relativeTime:{future:"%s 후",past:"%s 전",s:"몇초",ss:"%d초",m:"일분",mm:"%d분",h:"한시간",hh:"%d시간",d:"하루",dd:"%d일",M:"한달",MM:"%d달",y:"일년",yy:"%d년"},ordinalParse:/\d{1,2}일/,ordinal:"%d일",meridiemParse:/오전|오후/,isPM:function(a){return"오후"===a},meridiem:function(a,b,c){return 12>a?"오전":"오후"}}),Pf.defineLocale("lb",{months:"Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),weekdays:"Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg".split("_"),weekdaysShort:"So._Mé._Dë._Më._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mé_Dë_Më_Do_Fr_Sa".split("_"),longDateFormat:{LT:"H:mm [Auer]",LTS:"H:mm:ss [Auer]",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm [Auer]",LLLL:"dddd, D. MMMM YYYY H:mm [Auer]"},calendar:{sameDay:"[Haut um] LT",sameElse:"L",nextDay:"[Muer um] LT",nextWeek:"dddd [um] LT",lastDay:"[Gëschter um] LT",lastWeek:function(){switch(this.day()){case 2:case 4:return"[Leschten] dddd [um] LT";default:return"[Leschte] dddd [um] LT"}}},relativeTime:{future:sd,past:td,s:"e puer Sekonnen",m:rd,mm:"%d Minutten",h:rd,hh:"%d Stonnen",d:rd,dd:"%d Deeg",M:rd,MM:"%d Méint",y:rd,yy:"%d Joer"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),Pf.defineLocale("lo",{months:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),monthsShort:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),weekdays:"ອາທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),weekdaysShort:"ທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),weekdaysMin:"ທ_ຈ_ອຄ_ພ_ພຫ_ສກ_ສ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"ວັນdddd D MMMM YYYY HH:mm"},meridiemParse:/ຕອນເຊົ້າ|ຕອນແລງ/, +isPM:function(a){return"ຕອນແລງ"===a},meridiem:function(a,b,c){return 12>a?"ຕອນເຊົ້າ":"ຕອນແລງ"},calendar:{sameDay:"[ມື້ນີ້ເວລາ] LT",nextDay:"[ມື້ອື່ນເວລາ] LT",nextWeek:"[ວັນ]dddd[ໜ້າເວລາ] LT",lastDay:"[ມື້ວານນີ້ເວລາ] LT",lastWeek:"[ວັນ]dddd[ແລ້ວນີ້ເວລາ] LT",sameElse:"L"},relativeTime:{future:"ອີກ %s",past:"%sຜ່ານມາ",s:"ບໍ່ເທົ່າໃດວິນາທີ",m:"1 ນາທີ",mm:"%d ນາທີ",h:"1 ຊົ່ວໂມງ",hh:"%d ຊົ່ວໂມງ",d:"1 ມື້",dd:"%d ມື້",M:"1 ເດືອນ",MM:"%d ເດືອນ",y:"1 ປີ",yy:"%d ປີ"},ordinalParse:/(ທີ່)\d{1,2}/,ordinal:function(a){return"ທີ່"+a}}),{m:"minutė_minutės_minutę",mm:"minutės_minučių_minutes",h:"valanda_valandos_valandą",hh:"valandos_valandų_valandas",d:"diena_dienos_dieną",dd:"dienos_dienų_dienas",M:"mėnuo_mėnesio_mėnesį",MM:"mėnesiai_mėnesių_mėnesius",y:"metai_metų_metus",yy:"metai_metų_metus"}),xg=(Pf.defineLocale("lt",{months:{format:"sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio".split("_"),standalone:"sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis".split("_")},monthsShort:"sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd".split("_"),weekdays:{format:"sekmadienį_pirmadienį_antradienį_trečiadienį_ketvirtadienį_penktadienį_šeštadienį".split("_"),standalone:"sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis".split("_"),isFormat:/dddd HH:mm/},weekdaysShort:"Sek_Pir_Ant_Tre_Ket_Pen_Šeš".split("_"),weekdaysMin:"S_P_A_T_K_Pn_Š".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY [m.] MMMM D [d.]",LLL:"YYYY [m.] MMMM D [d.], HH:mm [val.]",LLLL:"YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]",l:"YYYY-MM-DD",ll:"YYYY [m.] MMMM D [d.]",lll:"YYYY [m.] MMMM D [d.], HH:mm [val.]",llll:"YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]"},calendar:{sameDay:"[Šiandien] LT",nextDay:"[Rytoj] LT",nextWeek:"dddd LT",lastDay:"[Vakar] LT",lastWeek:"[Praėjusį] dddd LT",sameElse:"L"},relativeTime:{future:"po %s",past:"prieš %s",s:vd,m:wd,mm:zd,h:wd,hh:zd,d:wd,dd:zd,M:wd,MM:zd,y:wd,yy:zd},ordinalParse:/\d{1,2}-oji/,ordinal:function(a){return a+"-oji"},week:{dow:1,doy:4}}),{m:"minūtes_minūtēm_minūte_minūtes".split("_"),mm:"minūtes_minūtēm_minūte_minūtes".split("_"),h:"stundas_stundām_stunda_stundas".split("_"),hh:"stundas_stundām_stunda_stundas".split("_"),d:"dienas_dienām_diena_dienas".split("_"),dd:"dienas_dienām_diena_dienas".split("_"),M:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),MM:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),y:"gada_gadiem_gads_gadi".split("_"),yy:"gada_gadiem_gads_gadi".split("_")}),yg=(Pf.defineLocale("lv",{months:"janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris".split("_"),monthsShort:"jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec".split("_"),weekdays:"svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena".split("_"),weekdaysShort:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysMin:"Sv_P_O_T_C_Pk_S".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY.",LL:"YYYY. [gada] D. MMMM",LLL:"YYYY. [gada] D. MMMM, HH:mm",LLLL:"YYYY. [gada] D. MMMM, dddd, HH:mm"},calendar:{sameDay:"[Šodien pulksten] LT",nextDay:"[Rīt pulksten] LT",nextWeek:"dddd [pulksten] LT",lastDay:"[Vakar pulksten] LT",lastWeek:"[Pagājušā] dddd [pulksten] LT",sameElse:"L"},relativeTime:{future:"pēc %s",past:"pirms %s",s:Dd,m:Cd,mm:Bd,h:Cd,hh:Bd,d:Cd,dd:Bd,M:Cd,MM:Bd,y:Cd,yy:Bd},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),{words:{m:["jedan minut","jednog minuta"],mm:["minut","minuta","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mjesec","mjeseca","mjeseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(a,b){return 1===a?b[0]:a>=2&&4>=a?b[1]:b[2]},translate:function(a,b,c){var d=yg.words[c];return 1===c.length?b?d[0]:d[1]:a+" "+yg.correctGrammaticalCase(a,d)}}),zg=(Pf.defineLocale("me",{months:["januar","februar","mart","april","maj","jun","jul","avgust","septembar","oktobar","novembar","decembar"],monthsShort:["jan.","feb.","mar.","apr.","maj","jun","jul","avg.","sep.","okt.","nov.","dec."],weekdays:["nedjelja","ponedjeljak","utorak","srijeda","četvrtak","petak","subota"],weekdaysShort:["ned.","pon.","uto.","sri.","čet.","pet.","sub."],weekdaysMin:["ne","po","ut","sr","če","pe","su"],longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sjutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){var a=["[prošle] [nedjelje] [u] LT","[prošlog] [ponedjeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srijede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"];return a[this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"nekoliko sekundi",m:yg.translate,mm:yg.translate,h:yg.translate,hh:yg.translate,d:"dan",dd:yg.translate,M:"mjesec",MM:yg.translate,y:"godinu",yy:yg.translate},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),Pf.defineLocale("mk",{months:"јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември".split("_"),monthsShort:"јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек".split("_"),weekdays:"недела_понеделник_вторник_среда_четврток_петок_сабота".split("_"),weekdaysShort:"нед_пон_вто_сре_чет_пет_саб".split("_"),weekdaysMin:"нe_пo_вт_ср_че_пе_сa".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Денес во] LT",nextDay:"[Утре во] LT",nextWeek:"[Во] dddd [во] LT",lastDay:"[Вчера во] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[Изминатата] dddd [во] LT";case 1:case 2:case 4:case 5:return"[Изминатиот] dddd [во] LT"}},sameElse:"L"},relativeTime:{future:"после %s",past:"пред %s",s:"неколку секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дена",M:"месец",MM:"%d месеци",y:"година",yy:"%d години"},ordinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(a){var b=a%10,c=a%100;return 0===a?a+"-ев":0===c?a+"-ен":c>10&&20>c?a+"-ти":1===b?a+"-ви":2===b?a+"-ри":7===b||8===b?a+"-ми":a+"-ти"},week:{dow:1,doy:7}}),Pf.defineLocale("ml",{months:"ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ".split("_"),monthsShort:"ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.".split("_"),weekdays:"ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച".split("_"),weekdaysShort:"ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി".split("_"),weekdaysMin:"ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ".split("_"),longDateFormat:{LT:"A h:mm -നു",LTS:"A h:mm:ss -നു",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm -നു",LLLL:"dddd, D MMMM YYYY, A h:mm -നു"},calendar:{sameDay:"[ഇന്ന്] LT",nextDay:"[നാളെ] LT",nextWeek:"dddd, LT",lastDay:"[ഇന്നലെ] LT",lastWeek:"[കഴിഞ്ഞ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s കഴിഞ്ഞ്",past:"%s മുൻപ്",s:"അൽപ നിമിഷങ്ങൾ",m:"ഒരു മിനിറ്റ്",mm:"%d മിനിറ്റ്",h:"ഒരു മണിക്കൂർ",hh:"%d മണിക്കൂർ",d:"ഒരു ദിവസം",dd:"%d ദിവസം",M:"ഒരു മാസം",MM:"%d മാസം",y:"ഒരു വർഷം",yy:"%d വർഷം"},meridiemParse:/രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i,meridiemHour:function(a,b){return 12===a&&(a=0),"രാത്രി"===b&&a>=4||"ഉച്ച കഴിഞ്ഞ്"===b||"വൈകുന്നേരം"===b?a+12:a},meridiem:function(a,b,c){return 4>a?"രാത്രി":12>a?"രാവിലെ":17>a?"ഉച്ച കഴിഞ്ഞ്":20>a?"വൈകുന്നേരം":"രാത്രി"}}),{1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"}),Ag={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"},Bg=(Pf.defineLocale("mr",{months:"जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),monthsShort:"जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),weekdays:"रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm वाजता",LTS:"A h:mm:ss वाजता",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm वाजता",LLLL:"dddd, D MMMM YYYY, A h:mm वाजता"},calendar:{sameDay:"[आज] LT",nextDay:"[उद्या] LT",nextWeek:"dddd, LT",lastDay:"[काल] LT",lastWeek:"[मागील] dddd, LT",sameElse:"L"},relativeTime:{future:"%sमध्ये",past:"%sपूर्वी",s:Ed,m:Ed,mm:Ed,h:Ed,hh:Ed,d:Ed,dd:Ed,M:Ed,MM:Ed,y:Ed,yy:Ed},preparse:function(a){return a.replace(/[१२३४५६७८९०]/g,function(a){return Ag[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return zg[a]})},meridiemParse:/रात्री|सकाळी|दुपारी|सायंकाळी/,meridiemHour:function(a,b){return 12===a&&(a=0),"रात्री"===b?4>a?a:a+12:"सकाळी"===b?a:"दुपारी"===b?a>=10?a:a+12:"सायंकाळी"===b?a+12:void 0},meridiem:function(a,b,c){return 4>a?"रात्री":10>a?"सकाळी":17>a?"दुपारी":20>a?"सायंकाळी":"रात्री"},week:{dow:0,doy:6}}),Pf.defineLocale("ms-my",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(a,b){return 12===a&&(a=0),"pagi"===b?a:"tengahari"===b?a>=11?a:a+12:"petang"===b||"malam"===b?a+12:void 0},meridiem:function(a,b,c){return 11>a?"pagi":15>a?"tengahari":19>a?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}}),Pf.defineLocale("ms",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(a,b){return 12===a&&(a=0),"pagi"===b?a:"tengahari"===b?a>=11?a:a+12:"petang"===b||"malam"===b?a+12:void 0},meridiem:function(a,b,c){return 11>a?"pagi":15>a?"tengahari":19>a?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}}),{1:"၁",2:"၂",3:"၃",4:"၄",5:"၅",6:"၆",7:"၇",8:"၈",9:"၉",0:"၀"}),Cg={"၁":"1","၂":"2","၃":"3","၄":"4","၅":"5","၆":"6","၇":"7","၈":"8","၉":"9","၀":"0"},Dg=(Pf.defineLocale("my",{months:"ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ".split("_"),monthsShort:"ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ".split("_"),weekdays:"တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ".split("_"),weekdaysShort:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),weekdaysMin:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ယနေ.] LT [မှာ]",nextDay:"[မနက်ဖြန်] LT [မှာ]",nextWeek:"dddd LT [မှာ]",lastDay:"[မနေ.က] LT [မှာ]",lastWeek:"[ပြီးခဲ့သော] dddd LT [မှာ]",sameElse:"L"},relativeTime:{future:"လာမည့် %s မှာ",past:"လွန်ခဲ့သော %s က",s:"စက္ကန်.အနည်းငယ်",m:"တစ်မိနစ်",mm:"%d မိနစ်",h:"တစ်နာရီ",hh:"%d နာရီ",d:"တစ်ရက်",dd:"%d ရက်",M:"တစ်လ",MM:"%d လ",y:"တစ်နှစ်",yy:"%d နှစ်"},preparse:function(a){return a.replace(/[၁၂၃၄၅၆၇၈၉၀]/g,function(a){return Cg[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return Bg[a]})},week:{dow:1,doy:4}}),Pf.defineLocale("nb",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan._feb._mars_april_mai_juni_juli_aug._sep._okt._nov._des.".split("_"),weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"sø._ma._ti._on._to._fr._lø.".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] HH:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[i går kl.] LT",lastWeek:"[forrige] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"for %s siden",s:"noen sekunder",m:"ett minutt",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dager",M:"en måned",MM:"%d måneder",y:"ett år",yy:"%d år"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),{1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"}),Eg={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"},Fg=(Pf.defineLocale("ne",{months:"जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर".split("_"),monthsShort:"जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.".split("_"),weekdays:"आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार".split("_"),weekdaysShort:"आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.".split("_"),weekdaysMin:"आ._सो._मं._बु._बि._शु._श.".split("_"),longDateFormat:{LT:"Aको h:mm बजे",LTS:"Aको h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, Aको h:mm बजे",LLLL:"dddd, D MMMM YYYY, Aको h:mm बजे"},preparse:function(a){return a.replace(/[१२३४५६७८९०]/g,function(a){return Eg[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return Dg[a]})},meridiemParse:/राति|बिहान|दिउँसो|साँझ/,meridiemHour:function(a,b){return 12===a&&(a=0),"राति"===b?4>a?a:a+12:"बिहान"===b?a:"दिउँसो"===b?a>=10?a:a+12:"साँझ"===b?a+12:void 0},meridiem:function(a,b,c){return 3>a?"राति":12>a?"बिहान":16>a?"दिउँसो":20>a?"साँझ":"राति"},calendar:{sameDay:"[आज] LT",nextDay:"[भोलि] LT",nextWeek:"[आउँदो] dddd[,] LT",lastDay:"[हिजो] LT",lastWeek:"[गएको] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%sमा",past:"%s अगाडि",s:"केही क्षण",m:"एक मिनेट",mm:"%d मिनेट",h:"एक घण्टा",hh:"%d घण्टा",d:"एक दिन",dd:"%d दिन",M:"एक महिना",MM:"%d महिना",y:"एक बर्ष",yy:"%d बर्ष"},week:{dow:0,doy:6}}),"jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_")),Gg="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),Hg=(Pf.defineLocale("nl",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(a,b){return/-MMM-/.test(b)?Gg[a.month()]:Fg[a.month()]},weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"Zo_Ma_Di_Wo_Do_Vr_Za".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},ordinalParse:/\d{1,2}(ste|de)/,ordinal:function(a){return a+(1===a||8===a||a>=20?"ste":"de")},week:{dow:1,doy:4}}),Pf.defineLocale("nn",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag".split("_"),weekdaysShort:"sun_mån_tys_ons_tor_fre_lau".split("_"),weekdaysMin:"su_må_ty_on_to_fr_lø".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[I dag klokka] LT",nextDay:"[I morgon klokka] LT",nextWeek:"dddd [klokka] LT",lastDay:"[I går klokka] LT",lastWeek:"[Føregåande] dddd [klokka] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"for %s sidan",s:"nokre sekund",m:"eit minutt",mm:"%d minutt",h:"ein time",hh:"%d timar",d:"ein dag",dd:"%d dagar",M:"ein månad",MM:"%d månader",y:"eit år",yy:"%d år"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),{1:"੧",2:"੨",3:"੩",4:"੪",5:"੫",6:"੬",7:"੭",8:"੮",9:"੯",0:"੦"}),Ig={"੧":"1","੨":"2","੩":"3","੪":"4","੫":"5","੬":"6","੭":"7","੮":"8","੯":"9","੦":"0"},Jg=(Pf.defineLocale("pa-in",{months:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),monthsShort:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),weekdays:"ਐਤਵਾਰ_ਸੋਮਵਾਰ_ਮੰਗਲਵਾਰ_ਬੁਧਵਾਰ_ਵੀਰਵਾਰ_ਸ਼ੁੱਕਰਵਾਰ_ਸ਼ਨੀਚਰਵਾਰ".split("_"),weekdaysShort:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),weekdaysMin:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),longDateFormat:{LT:"A h:mm ਵਜੇ",LTS:"A h:mm:ss ਵਜੇ",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm ਵਜੇ",LLLL:"dddd, D MMMM YYYY, A h:mm ਵਜੇ"},calendar:{sameDay:"[ਅਜ] LT",nextDay:"[ਕਲ] LT",nextWeek:"dddd, LT",lastDay:"[ਕਲ] LT",lastWeek:"[ਪਿਛਲੇ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ਵਿੱਚ",past:"%s ਪਿਛਲੇ",s:"ਕੁਝ ਸਕਿੰਟ",m:"ਇਕ ਮਿੰਟ",mm:"%d ਮਿੰਟ",h:"ਇੱਕ ਘੰਟਾ",hh:"%d ਘੰਟੇ",d:"ਇੱਕ ਦਿਨ",dd:"%d ਦਿਨ",M:"ਇੱਕ ਮਹੀਨਾ",MM:"%d ਮਹੀਨੇ",y:"ਇੱਕ ਸਾਲ",yy:"%d ਸਾਲ"},preparse:function(a){return a.replace(/[੧੨੩੪੫੬੭੮੯੦]/g,function(a){return Ig[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return Hg[a]})},meridiemParse:/ਰਾਤ|ਸਵੇਰ|ਦੁਪਹਿਰ|ਸ਼ਾਮ/,meridiemHour:function(a,b){return 12===a&&(a=0),"ਰਾਤ"===b?4>a?a:a+12:"ਸਵੇਰ"===b?a:"ਦੁਪਹਿਰ"===b?a>=10?a:a+12:"ਸ਼ਾਮ"===b?a+12:void 0},meridiem:function(a,b,c){return 4>a?"ਰਾਤ":10>a?"ਸਵੇਰ":17>a?"ਦੁਪਹਿਰ":20>a?"ਸ਼ਾਮ":"ਰਾਤ"},week:{dow:0,doy:6}}),"styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_")),Kg="stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia".split("_"),Lg=(Pf.defineLocale("pl",{months:function(a,b){return""===b?"("+Kg[a.month()]+"|"+Jg[a.month()]+")":/D MMMM/.test(b)?Kg[a.month()]:Jg[a.month()]},monthsShort:"sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"),weekdays:"niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"),weekdaysShort:"nie_pon_wt_śr_czw_pt_sb".split("_"),weekdaysMin:"Nd_Pn_Wt_Śr_Cz_Pt_So".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Dziś o] LT",nextDay:"[Jutro o] LT",nextWeek:"[W] dddd [o] LT",lastDay:"[Wczoraj o] LT",lastWeek:function(){switch(this.day()){case 0:return"[W zeszłą niedzielę o] LT";case 3:return"[W zeszłą środę o] LT";case 6:return"[W zeszłą sobotę o] LT";default:return"[W zeszły] dddd [o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"%s temu",s:"kilka sekund",m:Gd,mm:Gd,h:Gd,hh:Gd,d:"1 dzień",dd:"%d dni",M:"miesiąc",MM:Gd,y:"rok",yy:Gd},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),Pf.defineLocale("pt-br",{months:"Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),weekdaysMin:"Dom_2ª_3ª_4ª_5ª_6ª_Sáb".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [às] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [às] HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"%s atrás",s:"poucos segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},ordinalParse:/\d{1,2}º/,ordinal:"%dº"}),Pf.defineLocale("pt",{months:"Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingo_Segunda-Feira_Terça-Feira_Quarta-Feira_Quinta-Feira_Sexta-Feira_Sábado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),weekdaysMin:"Dom_2ª_3ª_4ª_5ª_6ª_Sáb".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"há %s",s:"segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},ordinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}}),Pf.defineLocale("ro",{months:"ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie".split("_"),monthsShort:"ian._febr._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.".split("_"),weekdays:"duminică_luni_marți_miercuri_joi_vineri_sâmbătă".split("_"),weekdaysShort:"Dum_Lun_Mar_Mie_Joi_Vin_Sâm".split("_"),weekdaysMin:"Du_Lu_Ma_Mi_Jo_Vi_Sâ".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[azi la] LT",nextDay:"[mâine la] LT",nextWeek:"dddd [la] LT",lastDay:"[ieri la] LT",lastWeek:"[fosta] dddd [la] LT",sameElse:"L"},relativeTime:{future:"peste %s",past:"%s în urmă",s:"câteva secunde",m:"un minut",mm:Hd,h:"o oră",hh:Hd,d:"o zi",dd:Hd,M:"o lună",MM:Hd,y:"un an",yy:Hd},week:{dow:1,doy:7}}),[/^янв/i,/^фев/i,/^мар/i,/^апр/i,/^ма[й|я]/i,/^июн/i,/^июл/i,/^авг/i,/^сен/i,/^окт/i,/^ноя/i,/^дек/i]),Mg=(Pf.defineLocale("ru",{months:{format:"января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря".split("_"),standalone:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_")},monthsShort:{format:"янв_фев_мар_апр_мая_июня_июля_авг_сен_окт_ноя_дек".split("_"),standalone:"янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек".split("_")},weekdays:{standalone:"воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"),format:"воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу".split("_"),isFormat:/\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?\] ?dddd/},weekdaysShort:"вс_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"вс_пн_вт_ср_чт_пт_сб".split("_"),monthsParse:Lg,longMonthsParse:Lg,shortMonthsParse:Lg,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., HH:mm",LLLL:"dddd, D MMMM YYYY г., HH:mm"},calendar:{sameDay:"[Сегодня в] LT",nextDay:"[Завтра в] LT",lastDay:"[Вчера в] LT",nextWeek:function(a){if(a.week()===this.week())return 2===this.day()?"[Во] dddd [в] LT":"[В] dddd [в] LT";switch(this.day()){case 0:return"[В следующее] dddd [в] LT";case 1:case 2:case 4:return"[В следующий] dddd [в] LT";case 3:case 5:case 6:return"[В следующую] dddd [в] LT"}},lastWeek:function(a){if(a.week()===this.week())return 2===this.day()?"[Во] dddd [в] LT":"[В] dddd [в] LT";switch(this.day()){case 0:return"[В прошлое] dddd [в] LT";case 1:case 2:case 4:return"[В прошлый] dddd [в] LT";case 3:case 5:case 6:return"[В прошлую] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",m:Jd,mm:Jd,h:"час",hh:Jd,d:"день",dd:Jd,M:"месяц",MM:Jd,y:"год",yy:Jd},meridiemParse:/ночи|утра|дня|вечера/i,isPM:function(a){return/^(дня|вечера)$/.test(a)},meridiem:function(a,b,c){return 4>a?"ночи":12>a?"утра":17>a?"дня":"вечера"},ordinalParse:/\d{1,2}-(й|го|я)/,ordinal:function(a,b){switch(b){case"M":case"d":case"DDD":return a+"-й";case"D":return a+"-го";case"w":case"W":return a+"-я";default:return a}},week:{dow:1,doy:7}}),Pf.defineLocale("se",{months:"ođđajagemánnu_guovvamánnu_njukčamánnu_cuoŋománnu_miessemánnu_geassemánnu_suoidnemánnu_borgemánnu_čakčamánnu_golggotmánnu_skábmamánnu_juovlamánnu".split("_"),monthsShort:"ođđj_guov_njuk_cuo_mies_geas_suoi_borg_čakč_golg_skáb_juov".split("_"),weekdays:"sotnabeaivi_vuossárga_maŋŋebárga_gaskavahkku_duorastat_bearjadat_lávvardat".split("_"),weekdaysShort:"sotn_vuos_maŋ_gask_duor_bear_láv".split("_"),weekdaysMin:"s_v_m_g_d_b_L".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"MMMM D. [b.] YYYY",LLL:"MMMM D. [b.] YYYY [ti.] HH:mm",LLLL:"dddd, MMMM D. [b.] YYYY [ti.] HH:mm"},calendar:{sameDay:"[otne ti] LT",nextDay:"[ihttin ti] LT",nextWeek:"dddd [ti] LT",lastDay:"[ikte ti] LT",lastWeek:"[ovddit] dddd [ti] LT",sameElse:"L"},relativeTime:{future:"%s geažes",past:"maŋit %s",s:"moadde sekunddat",m:"okta minuhta",mm:"%d minuhtat",h:"okta diimmu",hh:"%d diimmut",d:"okta beaivi",dd:"%d beaivvit",M:"okta mánnu",MM:"%d mánut",y:"okta jahki",yy:"%d jagit"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),Pf.defineLocale("si",{months:"ජනවාරි_පෙබරවාරි_මාර්තු_අප්‍රේල්_මැයි_ජූනි_ජූලි_අගෝස්තු_සැප්තැම්බර්_ඔක්තෝබර්_නොවැම්බර්_දෙසැම්බර්".split("_"),monthsShort:"ජන_පෙබ_මාර්_අප්_මැයි_ජූනි_ජූලි_අගෝ_සැප්_ඔක්_නොවැ_දෙසැ".split("_"),weekdays:"ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්‍රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා".split("_"),weekdaysShort:"ඉරි_සඳු_අඟ_බදා_බ්‍රහ_සිකු_සෙන".split("_"),weekdaysMin:"ඉ_ස_අ_බ_බ්‍ර_සි_සෙ".split("_"),longDateFormat:{LT:"a h:mm",LTS:"a h:mm:ss",L:"YYYY/MM/DD",LL:"YYYY MMMM D",LLL:"YYYY MMMM D, a h:mm",LLLL:"YYYY MMMM D [වැනි] dddd, a h:mm:ss"},calendar:{sameDay:"[අද] LT[ට]",nextDay:"[හෙට] LT[ට]",nextWeek:"dddd LT[ට]",lastDay:"[ඊයේ] LT[ට]",lastWeek:"[පසුගිය] dddd LT[ට]",sameElse:"L"},relativeTime:{future:"%sකින්",past:"%sකට පෙර",s:"තත්පර කිහිපය",m:"මිනිත්තුව",mm:"මිනිත්තු %d",h:"පැය",hh:"පැය %d",d:"දිනය",dd:"දින %d",M:"මාසය",MM:"මාස %d",y:"වසර",yy:"වසර %d"},ordinalParse:/\d{1,2} වැනි/,ordinal:function(a){return a+" වැනි"},meridiemParse:/පෙර වරු|පස් වරු|පෙ.ව|ප.ව./,isPM:function(a){return"ප.ව."===a||"පස් වරු"===a},meridiem:function(a,b,c){return a>11?c?"ප.ව.":"පස් වරු":c?"පෙ.ව.":"පෙර වරු"}}),"január_február_marec_apríl_máj_jún_júl_august_september_október_november_december".split("_")),Ng="jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec".split("_"),Og=(Pf.defineLocale("sk",{months:Mg,monthsShort:Ng,weekdays:"nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota".split("_"),weekdaysShort:"ne_po_ut_st_št_pi_so".split("_"),weekdaysMin:"ne_po_ut_st_št_pi_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm"},calendar:{sameDay:"[dnes o] LT",nextDay:"[zajtra o] LT",nextWeek:function(){switch(this.day()){case 0:return"[v nedeľu o] LT";case 1:case 2:return"[v] dddd [o] LT";case 3:return"[v stredu o] LT";case 4:return"[vo štvrtok o] LT";case 5:return"[v piatok o] LT";case 6:return"[v sobotu o] LT"}},lastDay:"[včera o] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulú nedeľu o] LT";case 1:case 2:return"[minulý] dddd [o] LT";case 3:return"[minulú stredu o] LT";case 4:case 5:return"[minulý] dddd [o] LT";case 6:return"[minulú sobotu o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"pred %s",s:Ld,m:Ld,mm:Ld,h:Ld,hh:Ld,d:Ld,dd:Ld,M:Ld,MM:Ld,y:Ld,yy:Ld},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),Pf.defineLocale("sl",{months:"januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.".split("_"),weekdays:"nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota".split("_"),weekdaysShort:"ned._pon._tor._sre._čet._pet._sob.".split("_"),weekdaysMin:"ne_po_to_sr_če_pe_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danes ob] LT",nextDay:"[jutri ob] LT",nextWeek:function(){switch(this.day()){case 0:return"[v] [nedeljo] [ob] LT";case 3:return"[v] [sredo] [ob] LT";case 6:return"[v] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[v] dddd [ob] LT"}},lastDay:"[včeraj ob] LT",lastWeek:function(){switch(this.day()){case 0:return"[prejšnjo] [nedeljo] [ob] LT";case 3:return"[prejšnjo] [sredo] [ob] LT";case 6:return"[prejšnjo] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[prejšnji] dddd [ob] LT"}},sameElse:"L"},relativeTime:{future:"čez %s",past:"pred %s",s:Md,m:Md,mm:Md,h:Md,hh:Md,d:Md,dd:Md,M:Md,MM:Md,y:Md,yy:Md},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),Pf.defineLocale("sq",{months:"Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor".split("_"),monthsShort:"Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj".split("_"),weekdays:"E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë".split("_"),weekdaysShort:"Die_Hën_Mar_Mër_Enj_Pre_Sht".split("_"),weekdaysMin:"D_H_Ma_Më_E_P_Sh".split("_"),meridiemParse:/PD|MD/,isPM:function(a){return"M"===a.charAt(0)},meridiem:function(a,b,c){return 12>a?"PD":"MD"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Sot në] LT",nextDay:"[Nesër në] LT",nextWeek:"dddd [në] LT",lastDay:"[Dje në] LT",lastWeek:"dddd [e kaluar në] LT",sameElse:"L"},relativeTime:{future:"në %s",past:"%s më parë",s:"disa sekonda",m:"një minutë",mm:"%d minuta",h:"një orë",hh:"%d orë",d:"një ditë",dd:"%d ditë",M:"një muaj",MM:"%d muaj",y:"një vit",yy:"%d vite"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),{words:{m:["један минут","једне минуте"],mm:["минут","минуте","минута"],h:["један сат","једног сата"],hh:["сат","сата","сати"],dd:["дан","дана","дана"],MM:["месец","месеца","месеци"],yy:["година","године","година"]},correctGrammaticalCase:function(a,b){return 1===a?b[0]:a>=2&&4>=a?b[1]:b[2]},translate:function(a,b,c){var d=Og.words[c];return 1===c.length?b?d[0]:d[1]:a+" "+Og.correctGrammaticalCase(a,d)}}),Pg=(Pf.defineLocale("sr-cyrl",{months:["јануар","фебруар","март","април","мај","јун","јул","август","септембар","октобар","новембар","децембар"],monthsShort:["јан.","феб.","мар.","апр.","мај","јун","јул","авг.","сеп.","окт.","нов.","дец."],weekdays:["недеља","понедељак","уторак","среда","четвртак","петак","субота"],weekdaysShort:["нед.","пон.","уто.","сре.","чет.","пет.","суб."],weekdaysMin:["не","по","ут","ср","че","пе","су"],longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[данас у] LT",nextDay:"[сутра у] LT",nextWeek:function(){switch(this.day()){case 0:return"[у] [недељу] [у] LT";case 3:return"[у] [среду] [у] LT";case 6:return"[у] [суботу] [у] LT";case 1:case 2:case 4:case 5:return"[у] dddd [у] LT"}},lastDay:"[јуче у] LT",lastWeek:function(){var a=["[прошле] [недеље] [у] LT","[прошлог] [понедељка] [у] LT","[прошлог] [уторка] [у] LT","[прошле] [среде] [у] LT","[прошлог] [четвртка] [у] LT","[прошлог] [петка] [у] LT","[прошле] [суботе] [у] LT"]; +return a[this.day()]},sameElse:"L"},relativeTime:{future:"за %s",past:"пре %s",s:"неколико секунди",m:Og.translate,mm:Og.translate,h:Og.translate,hh:Og.translate,d:"дан",dd:Og.translate,M:"месец",MM:Og.translate,y:"годину",yy:Og.translate},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),{words:{m:["jedan minut","jedne minute"],mm:["minut","minute","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mesec","meseca","meseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(a,b){return 1===a?b[0]:a>=2&&4>=a?b[1]:b[2]},translate:function(a,b,c){var d=Pg.words[c];return 1===c.length?b?d[0]:d[1]:a+" "+Pg.correctGrammaticalCase(a,d)}}),Qg=(Pf.defineLocale("sr",{months:["januar","februar","mart","april","maj","jun","jul","avgust","septembar","oktobar","novembar","decembar"],monthsShort:["jan.","feb.","mar.","apr.","maj","jun","jul","avg.","sep.","okt.","nov.","dec."],weekdays:["nedelja","ponedeljak","utorak","sreda","četvrtak","petak","subota"],weekdaysShort:["ned.","pon.","uto.","sre.","čet.","pet.","sub."],weekdaysMin:["ne","po","ut","sr","če","pe","su"],longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedelju] [u] LT";case 3:return"[u] [sredu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){var a=["[prošle] [nedelje] [u] LT","[prošlog] [ponedeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"];return a[this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"pre %s",s:"nekoliko sekundi",m:Pg.translate,mm:Pg.translate,h:Pg.translate,hh:Pg.translate,d:"dan",dd:Pg.translate,M:"mesec",MM:Pg.translate,y:"godinu",yy:Pg.translate},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),Pf.defineLocale("sv",{months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"),weekdaysShort:"sön_mån_tis_ons_tor_fre_lör".split("_"),weekdaysMin:"sö_må_ti_on_to_fr_lö".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Idag] LT",nextDay:"[Imorgon] LT",lastDay:"[Igår] LT",nextWeek:"[På] dddd LT",lastWeek:"[I] dddd[s] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"för %s sedan",s:"några sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en månad",MM:"%d månader",y:"ett år",yy:"%d år"},ordinalParse:/\d{1,2}(e|a)/,ordinal:function(a){var b=a%10,c=1===~~(a%100/10)?"e":1===b?"a":2===b?"a":"e";return a+c},week:{dow:1,doy:4}}),Pf.defineLocale("sw",{months:"Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des".split("_"),weekdays:"Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi".split("_"),weekdaysShort:"Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos".split("_"),weekdaysMin:"J2_J3_J4_J5_Al_Ij_J1".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[leo saa] LT",nextDay:"[kesho saa] LT",nextWeek:"[wiki ijayo] dddd [saat] LT",lastDay:"[jana] LT",lastWeek:"[wiki iliyopita] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s baadaye",past:"tokea %s",s:"hivi punde",m:"dakika moja",mm:"dakika %d",h:"saa limoja",hh:"masaa %d",d:"siku moja",dd:"masiku %d",M:"mwezi mmoja",MM:"miezi %d",y:"mwaka mmoja",yy:"miaka %d"},week:{dow:1,doy:7}}),{1:"௧",2:"௨",3:"௩",4:"௪",5:"௫",6:"௬",7:"௭",8:"௮",9:"௯",0:"௦"}),Rg={"௧":"1","௨":"2","௩":"3","௪":"4","௫":"5","௬":"6","௭":"7","௮":"8","௯":"9","௦":"0"},Sg=(Pf.defineLocale("ta",{months:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),monthsShort:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),weekdays:"ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை".split("_"),weekdaysShort:"ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி".split("_"),weekdaysMin:"ஞா_தி_செ_பு_வி_வெ_ச".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, HH:mm",LLLL:"dddd, D MMMM YYYY, HH:mm"},calendar:{sameDay:"[இன்று] LT",nextDay:"[நாளை] LT",nextWeek:"dddd, LT",lastDay:"[நேற்று] LT",lastWeek:"[கடந்த வாரம்] dddd, LT",sameElse:"L"},relativeTime:{future:"%s இல்",past:"%s முன்",s:"ஒரு சில விநாடிகள்",m:"ஒரு நிமிடம்",mm:"%d நிமிடங்கள்",h:"ஒரு மணி நேரம்",hh:"%d மணி நேரம்",d:"ஒரு நாள்",dd:"%d நாட்கள்",M:"ஒரு மாதம்",MM:"%d மாதங்கள்",y:"ஒரு வருடம்",yy:"%d ஆண்டுகள்"},ordinalParse:/\d{1,2}வது/,ordinal:function(a){return a+"வது"},preparse:function(a){return a.replace(/[௧௨௩௪௫௬௭௮௯௦]/g,function(a){return Rg[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return Qg[a]})},meridiemParse:/யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/,meridiem:function(a,b,c){return 2>a?" யாமம்":6>a?" வைகறை":10>a?" காலை":14>a?" நண்பகல்":18>a?" எற்பாடு":22>a?" மாலை":" யாமம்"},meridiemHour:function(a,b){return 12===a&&(a=0),"யாமம்"===b?2>a?a:a+12:"வைகறை"===b||"காலை"===b?a:"நண்பகல்"===b&&a>=10?a:a+12},week:{dow:0,doy:6}}),Pf.defineLocale("te",{months:"జనవరి_ఫిబ్రవరి_మార్చి_ఏప్రిల్_మే_జూన్_జూలై_ఆగస్టు_సెప్టెంబర్_అక్టోబర్_నవంబర్_డిసెంబర్".split("_"),monthsShort:"జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జూలై_ఆగ._సెప్._అక్టో._నవ._డిసె.".split("_"),weekdays:"ఆదివారం_సోమవారం_మంగళవారం_బుధవారం_గురువారం_శుక్రవారం_శనివారం".split("_"),weekdaysShort:"ఆది_సోమ_మంగళ_బుధ_గురు_శుక్ర_శని".split("_"),weekdaysMin:"ఆ_సో_మం_బు_గు_శు_శ".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[నేడు] LT",nextDay:"[రేపు] LT",nextWeek:"dddd, LT",lastDay:"[నిన్న] LT",lastWeek:"[గత] dddd, LT",sameElse:"L"},relativeTime:{future:"%s లో",past:"%s క్రితం",s:"కొన్ని క్షణాలు",m:"ఒక నిమిషం",mm:"%d నిమిషాలు",h:"ఒక గంట",hh:"%d గంటలు",d:"ఒక రోజు",dd:"%d రోజులు",M:"ఒక నెల",MM:"%d నెలలు",y:"ఒక సంవత్సరం",yy:"%d సంవత్సరాలు"},ordinalParse:/\d{1,2}వ/,ordinal:"%dవ",meridiemParse:/రాత్రి|ఉదయం|మధ్యాహ్నం|సాయంత్రం/,meridiemHour:function(a,b){return 12===a&&(a=0),"రాత్రి"===b?4>a?a:a+12:"ఉదయం"===b?a:"మధ్యాహ్నం"===b?a>=10?a:a+12:"సాయంత్రం"===b?a+12:void 0},meridiem:function(a,b,c){return 4>a?"రాత్రి":10>a?"ఉదయం":17>a?"మధ్యాహ్నం":20>a?"సాయంత్రం":"రాత్రి"},week:{dow:0,doy:6}}),Pf.defineLocale("th",{months:"มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม".split("_"),monthsShort:"มกรา_กุมภา_มีนา_เมษา_พฤษภา_มิถุนา_กรกฎา_สิงหา_กันยา_ตุลา_พฤศจิกา_ธันวา".split("_"),weekdays:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์".split("_"),weekdaysShort:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์".split("_"),weekdaysMin:"อา._จ._อ._พ._พฤ._ศ._ส.".split("_"),longDateFormat:{LT:"H นาฬิกา m นาที",LTS:"H นาฬิกา m นาที s วินาที",L:"YYYY/MM/DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY เวลา H นาฬิกา m นาที",LLLL:"วันddddที่ D MMMM YYYY เวลา H นาฬิกา m นาที"},meridiemParse:/ก่อนเที่ยง|หลังเที่ยง/,isPM:function(a){return"หลังเที่ยง"===a},meridiem:function(a,b,c){return 12>a?"ก่อนเที่ยง":"หลังเที่ยง"},calendar:{sameDay:"[วันนี้ เวลา] LT",nextDay:"[พรุ่งนี้ เวลา] LT",nextWeek:"dddd[หน้า เวลา] LT",lastDay:"[เมื่อวานนี้ เวลา] LT",lastWeek:"[วัน]dddd[ที่แล้ว เวลา] LT",sameElse:"L"},relativeTime:{future:"อีก %s",past:"%sที่แล้ว",s:"ไม่กี่วินาที",m:"1 นาที",mm:"%d นาที",h:"1 ชั่วโมง",hh:"%d ชั่วโมง",d:"1 วัน",dd:"%d วัน",M:"1 เดือน",MM:"%d เดือน",y:"1 ปี",yy:"%d ปี"}}),Pf.defineLocale("tl-ph",{months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},calendar:{sameDay:"[Ngayon sa] LT",nextDay:"[Bukas sa] LT",nextWeek:"dddd [sa] LT",lastDay:"[Kahapon sa] LT",lastWeek:"dddd [huling linggo] LT",sameElse:"L"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"},ordinalParse:/\d{1,2}/,ordinal:function(a){return a},week:{dow:1,doy:4}}),"pagh_wa’_cha’_wej_loS_vagh_jav_Soch_chorgh_Hut".split("_")),Tg=(Pf.defineLocale("tlh",{months:"tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’".split("_"),monthsShort:"jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’".split("_"),weekdays:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysShort:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysMin:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[DaHjaj] LT",nextDay:"[wa’leS] LT",nextWeek:"LLL",lastDay:"[wa’Hu’] LT",lastWeek:"LLL",sameElse:"L"},relativeTime:{future:Nd,past:Od,s:"puS lup",m:"wa’ tup",mm:Pd,h:"wa’ rep",hh:Pd,d:"wa’ jaj",dd:Pd,M:"wa’ jar",MM:Pd,y:"wa’ DIS",yy:Pd},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),{1:"'inci",5:"'inci",8:"'inci",70:"'inci",80:"'inci",2:"'nci",7:"'nci",20:"'nci",50:"'nci",3:"'üncü",4:"'üncü",100:"'üncü",6:"'ncı",9:"'uncu",10:"'uncu",30:"'uncu",60:"'ıncı",90:"'ıncı"}),Ug=(Pf.defineLocale("tr",{months:"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),monthsShort:"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),weekdays:"Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"),weekdaysMin:"Pz_Pt_Sa_Ça_Pe_Cu_Ct".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[yarın saat] LT",nextWeek:"[haftaya] dddd [saat] LT",lastDay:"[dün] LT",lastWeek:"[geçen hafta] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s önce",s:"birkaç saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ordinalParse:/\d{1,2}'(inci|nci|üncü|ncı|uncu|ıncı)/,ordinal:function(a){if(0===a)return a+"'ıncı";var b=a%10,c=a%100-b,d=a>=100?100:null;return a+(Tg[b]||Tg[c]||Tg[d])},week:{dow:1,doy:7}}),Pf.defineLocale("tzl",{months:"Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar".split("_"),monthsShort:"Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec".split("_"),weekdays:"Súladi_Lúneçi_Maitzi_Márcuri_Xhúadi_Viénerçi_Sáturi".split("_"),weekdaysShort:"Súl_Lún_Mai_Már_Xhú_Vié_Sát".split("_"),weekdaysMin:"Sú_Lú_Ma_Má_Xh_Vi_Sá".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"D. MMMM [dallas] YYYY",LLL:"D. MMMM [dallas] YYYY HH.mm",LLLL:"dddd, [li] D. MMMM [dallas] YYYY HH.mm"},meridiemParse:/d\'o|d\'a/i,isPM:function(a){return"d'o"===a.toLowerCase()},meridiem:function(a,b,c){return a>11?c?"d'o":"D'O":c?"d'a":"D'A"},calendar:{sameDay:"[oxhi à] LT",nextDay:"[demà à] LT",nextWeek:"dddd [à] LT",lastDay:"[ieiri à] LT",lastWeek:"[sür el] dddd [lasteu à] LT",sameElse:"L"},relativeTime:{future:"osprei %s",past:"ja%s",s:Rd,m:Rd,mm:Rd,h:Rd,hh:Rd,d:Rd,dd:Rd,M:Rd,MM:Rd,y:Rd,yy:Rd},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),Pf.defineLocale("tzm-latn",{months:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),monthsShort:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),weekdays:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysShort:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysMin:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[asdkh g] LT",nextDay:"[aska g] LT",nextWeek:"dddd [g] LT",lastDay:"[assant g] LT",lastWeek:"dddd [g] LT",sameElse:"L"},relativeTime:{future:"dadkh s yan %s",past:"yan %s",s:"imik",m:"minuḍ",mm:"%d minuḍ",h:"saɛa",hh:"%d tassaɛin",d:"ass",dd:"%d ossan",M:"ayowr",MM:"%d iyyirn",y:"asgas",yy:"%d isgasn"},week:{dow:6,doy:12}}),Pf.defineLocale("tzm",{months:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),monthsShort:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),weekdays:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysShort:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysMin:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ⴰⵙⴷⵅ ⴴ] LT",nextDay:"[ⴰⵙⴽⴰ ⴴ] LT",nextWeek:"dddd [ⴴ] LT",lastDay:"[ⴰⵚⴰⵏⵜ ⴴ] LT",lastWeek:"dddd [ⴴ] LT",sameElse:"L"},relativeTime:{future:"ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s",past:"ⵢⴰⵏ %s",s:"ⵉⵎⵉⴽ",m:"ⵎⵉⵏⵓⴺ",mm:"%d ⵎⵉⵏⵓⴺ",h:"ⵙⴰⵄⴰ",hh:"%d ⵜⴰⵙⵙⴰⵄⵉⵏ",d:"ⴰⵙⵙ",dd:"%d oⵙⵙⴰⵏ",M:"ⴰⵢoⵓⵔ",MM:"%d ⵉⵢⵢⵉⵔⵏ",y:"ⴰⵙⴳⴰⵙ",yy:"%d ⵉⵙⴳⴰⵙⵏ"},week:{dow:6,doy:12}}),Pf.defineLocale("uk",{months:{format:"січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня".split("_"),standalone:"січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень".split("_")},monthsShort:"січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд".split("_"),weekdays:Ud,weekdaysShort:"нд_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY р.",LLL:"D MMMM YYYY р., HH:mm",LLLL:"dddd, D MMMM YYYY р., HH:mm"},calendar:{sameDay:Vd("[Сьогодні "),nextDay:Vd("[Завтра "),lastDay:Vd("[Вчора "),nextWeek:Vd("[У] dddd ["),lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return Vd("[Минулої] dddd [").call(this);case 1:case 2:case 4:return Vd("[Минулого] dddd [").call(this)}},sameElse:"L"},relativeTime:{future:"за %s",past:"%s тому",s:"декілька секунд",m:Td,mm:Td,h:"годину",hh:Td,d:"день",dd:Td,M:"місяць",MM:Td,y:"рік",yy:Td},meridiemParse:/ночі|ранку|дня|вечора/,isPM:function(a){return/^(дня|вечора)$/.test(a)},meridiem:function(a,b,c){return 4>a?"ночі":12>a?"ранку":17>a?"дня":"вечора"},ordinalParse:/\d{1,2}-(й|го)/,ordinal:function(a,b){switch(b){case"M":case"d":case"DDD":case"w":case"W":return a+"-й";case"D":return a+"-го";default:return a}},week:{dow:1,doy:7}}),Pf.defineLocale("uz",{months:"январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр".split("_"),monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба".split("_"),weekdaysShort:"Якш_Душ_Сеш_Чор_Пай_Жум_Шан".split("_"),weekdaysMin:"Як_Ду_Се_Чо_Па_Жу_Ша".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},calendar:{sameDay:"[Бугун соат] LT [да]",nextDay:"[Эртага] LT [да]",nextWeek:"dddd [куни соат] LT [да]",lastDay:"[Кеча соат] LT [да]",lastWeek:"[Утган] dddd [куни соат] LT [да]",sameElse:"L"},relativeTime:{future:"Якин %s ичида",past:"Бир неча %s олдин",s:"фурсат",m:"бир дакика",mm:"%d дакика",h:"бир соат",hh:"%d соат",d:"бир кун",dd:"%d кун",M:"бир ой",MM:"%d ой",y:"бир йил",yy:"%d йил"},week:{dow:1,doy:7}}),Pf.defineLocale("vi",{months:"tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12".split("_"),monthsShort:"Th01_Th02_Th03_Th04_Th05_Th06_Th07_Th08_Th09_Th10_Th11_Th12".split("_"),weekdays:"chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy".split("_"),weekdaysShort:"CN_T2_T3_T4_T5_T6_T7".split("_"),weekdaysMin:"CN_T2_T3_T4_T5_T6_T7".split("_"),meridiemParse:/sa|ch/i,isPM:function(a){return/^ch$/i.test(a)},meridiem:function(a,b,c){return 12>a?c?"sa":"SA":c?"ch":"CH"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [năm] YYYY",LLL:"D MMMM [năm] YYYY HH:mm",LLLL:"dddd, D MMMM [năm] YYYY HH:mm",l:"DD/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[Hôm nay lúc] LT",nextDay:"[Ngày mai lúc] LT",nextWeek:"dddd [tuần tới lúc] LT",lastDay:"[Hôm qua lúc] LT",lastWeek:"dddd [tuần rồi lúc] LT",sameElse:"L"},relativeTime:{future:"%s tới",past:"%s trước",s:"vài giây",m:"một phút",mm:"%d phút",h:"một giờ",hh:"%d giờ",d:"một ngày",dd:"%d ngày",M:"một tháng",MM:"%d tháng",y:"một năm",yy:"%d năm"},ordinalParse:/\d{1,2}/,ordinal:function(a){return a},week:{dow:1,doy:4}}),Pf.defineLocale("zh-cn",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"Ah点mm分",LTS:"Ah点m分s秒",L:"YYYY-MM-DD",LL:"YYYY年MMMD日",LLL:"YYYY年MMMD日Ah点mm分",LLLL:"YYYY年MMMD日ddddAh点mm分",l:"YYYY-MM-DD",ll:"YYYY年MMMD日",lll:"YYYY年MMMD日Ah点mm分",llll:"YYYY年MMMD日ddddAh点mm分"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(a,b){return 12===a&&(a=0),"凌晨"===b||"早上"===b||"上午"===b?a:"下午"===b||"晚上"===b?a+12:a>=11?a:a+12},meridiem:function(a,b,c){var d=100*a+b;return 600>d?"凌晨":900>d?"早上":1130>d?"上午":1230>d?"中午":1800>d?"下午":"晚上"},calendar:{sameDay:function(){return 0===this.minutes()?"[今天]Ah[点整]":"[今天]LT"},nextDay:function(){return 0===this.minutes()?"[明天]Ah[点整]":"[明天]LT"},lastDay:function(){return 0===this.minutes()?"[昨天]Ah[点整]":"[昨天]LT"},nextWeek:function(){var a,b;return a=Pf().startOf("week"),b=this.unix()-a.unix()>=604800?"[下]":"[本]",0===this.minutes()?b+"dddAh点整":b+"dddAh点mm"},lastWeek:function(){var a,b;return a=Pf().startOf("week"),b=this.unix()=11?a:a+12:"下午"===b||"晚上"===b?a+12:void 0},meridiem:function(a,b,c){var d=100*a+b;return 900>d?"早上":1130>d?"上午":1230>d?"中午":1800>d?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:"[下]ddddLT",lastDay:"[昨天]LT",lastWeek:"[上]ddddLT",sameElse:"L"},ordinalParse:/\d{1,2}(日|月|週)/,ordinal:function(a,b){switch(b){case"d":case"D":case"DDD":return a+"日";case"M":return a+"月";case"w":case"W":return a+"週";default:return a}},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",m:"一分鐘",mm:"%d分鐘",h:"一小時",hh:"%d小時",d:"一天",dd:"%d天",M:"一個月",MM:"%d個月",y:"一年",yy:"%d年"}}),Pf);return Ug.locale("en"),Ug}); \ No newline at end of file diff --git a/bower_components/moment/min/moment.min.js b/bower_components/moment/min/moment.min.js index caaf8b3..ba38995 100644 --- a/bower_components/moment/min/moment.min.js +++ b/bower_components/moment/min/moment.min.js @@ -1,7 +1,7 @@ //! moment.js -//! version : 2.11.2 +//! version : 2.12.0 //! authors : Tim Wood, Iskren Chernev, Moment.js contributors //! license : MIT //! momentjs.com -!function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):a.moment=b()}(this,function(){"use strict";function a(){return Uc.apply(null,arguments)}function b(a){Uc=a}function c(a){return"[object Array]"===Object.prototype.toString.call(a)}function d(a){return a instanceof Date||"[object Date]"===Object.prototype.toString.call(a)}function e(a,b){var c,d=[];for(c=0;c0)for(c in Wc)d=Wc[c],e=b[d],m(e)||(a[d]=e);return a}function o(b){n(this,b),this._d=new Date(null!=b._d?b._d.getTime():NaN),Xc===!1&&(Xc=!0,a.updateOffset(this),Xc=!1)}function p(a){return a instanceof o||null!=a&&null!=a._isAMomentObject}function q(a){return 0>a?Math.ceil(a):Math.floor(a)}function r(a){var b=+a,c=0;return 0!==b&&isFinite(b)&&(c=q(b)),c}function s(a,b,c){var d,e=Math.min(a.length,b.length),f=Math.abs(a.length-b.length),g=0;for(d=0;e>d;d++)(c&&a[d]!==b[d]||!c&&r(a[d])!==r(b[d]))&&g++;return g+f}function t(){}function u(a){return a?a.toLowerCase().replace("_","-"):a}function v(a){for(var b,c,d,e,f=0;f0;){if(d=w(e.slice(0,b).join("-")))return d;if(c&&c.length>=b&&s(e,c,!0)>=b-1)break;b--}f++}return null}function w(a){var b=null;if(!Yc[a]&&"undefined"!=typeof module&&module&&module.exports)try{b=Vc._abbr,require("./locale/"+a),x(b)}catch(c){}return Yc[a]}function x(a,b){var c;return a&&(c=m(b)?z(a):y(a,b),c&&(Vc=c)),Vc._abbr}function y(a,b){return null!==b?(b.abbr=a,Yc[a]=Yc[a]||new t,Yc[a].set(b),x(a),Yc[a]):(delete Yc[a],null)}function z(a){var b;if(a&&a._locale&&a._locale._abbr&&(a=a._locale._abbr),!a)return Vc;if(!c(a)){if(b=w(a))return b;a=[a]}return v(a)}function A(a,b){var c=a.toLowerCase();Zc[c]=Zc[c+"s"]=Zc[b]=a}function B(a){return"string"==typeof a?Zc[a]||Zc[a.toLowerCase()]:void 0}function C(a){var b,c,d={};for(c in a)f(a,c)&&(b=B(c),b&&(d[b]=a[c]));return d}function D(a){return a instanceof Function||"[object Function]"===Object.prototype.toString.call(a)}function E(b,c){return function(d){return null!=d?(G(this,b,d),a.updateOffset(this,c),this):F(this,b)}}function F(a,b){return a.isValid()?a._d["get"+(a._isUTC?"UTC":"")+b]():NaN}function G(a,b,c){a.isValid()&&a._d["set"+(a._isUTC?"UTC":"")+b](c)}function H(a,b){var c;if("object"==typeof a)for(c in a)this.set(c,a[c]);else if(a=B(a),D(this[a]))return this[a](b);return this}function I(a,b,c){var d=""+Math.abs(a),e=b-d.length,f=a>=0;return(f?c?"+":"":"-")+Math.pow(10,Math.max(0,e)).toString().substr(1)+d}function J(a,b,c,d){var e=d;"string"==typeof d&&(e=function(){return this[d]()}),a&&(bd[a]=e),b&&(bd[b[0]]=function(){return I(e.apply(this,arguments),b[1],b[2])}),c&&(bd[c]=function(){return this.localeData().ordinal(e.apply(this,arguments),a)})}function K(a){return a.match(/\[[\s\S]/)?a.replace(/^\[|\]$/g,""):a.replace(/\\/g,"")}function L(a){var b,c,d=a.match($c);for(b=0,c=d.length;c>b;b++)bd[d[b]]?d[b]=bd[d[b]]:d[b]=K(d[b]);return function(e){var f="";for(b=0;c>b;b++)f+=d[b]instanceof Function?d[b].call(e,a):d[b];return f}}function M(a,b){return a.isValid()?(b=N(b,a.localeData()),ad[b]=ad[b]||L(b),ad[b](a)):a.localeData().invalidDate()}function N(a,b){function c(a){return b.longDateFormat(a)||a}var d=5;for(_c.lastIndex=0;d>=0&&_c.test(a);)a=a.replace(_c,c),_c.lastIndex=0,d-=1;return a}function O(a,b,c){td[a]=D(b)?b:function(a,d){return a&&c?c:b}}function P(a,b){return f(td,a)?td[a](b._strict,b._locale):new RegExp(Q(a))}function Q(a){return R(a.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(a,b,c,d,e){return b||c||d||e}))}function R(a){return a.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function S(a,b){var c,d=b;for("string"==typeof a&&(a=[a]),"number"==typeof b&&(d=function(a,c){c[b]=r(a)}),c=0;cd;d++){if(e=h([2e3,d]),c&&!this._longMonthsParse[d]&&(this._longMonthsParse[d]=new RegExp("^"+this.months(e,"").replace(".","")+"$","i"),this._shortMonthsParse[d]=new RegExp("^"+this.monthsShort(e,"").replace(".","")+"$","i")),c||this._monthsParse[d]||(f="^"+this.months(e,"")+"|^"+this.monthsShort(e,""),this._monthsParse[d]=new RegExp(f.replace(".",""),"i")),c&&"MMMM"===b&&this._longMonthsParse[d].test(a))return d;if(c&&"MMM"===b&&this._shortMonthsParse[d].test(a))return d;if(!c&&this._monthsParse[d].test(a))return d}}function Z(a,b){var c;return a.isValid()?"string"==typeof b&&(b=a.localeData().monthsParse(b),"number"!=typeof b)?a:(c=Math.min(a.date(),V(a.year(),b)),a._d["set"+(a._isUTC?"UTC":"")+"Month"](b,c),a):a}function $(b){return null!=b?(Z(this,b),a.updateOffset(this,!0),this):F(this,"Month")}function _(){return V(this.year(),this.month())}function aa(a){return this._monthsParseExact?(f(this,"_monthsRegex")||ca.call(this),a?this._monthsShortStrictRegex:this._monthsShortRegex):this._monthsShortStrictRegex&&a?this._monthsShortStrictRegex:this._monthsShortRegex}function ba(a){return this._monthsParseExact?(f(this,"_monthsRegex")||ca.call(this),a?this._monthsStrictRegex:this._monthsRegex):this._monthsStrictRegex&&a?this._monthsStrictRegex:this._monthsRegex}function ca(){function a(a,b){return b.length-a.length}var b,c,d=[],e=[],f=[];for(b=0;12>b;b++)c=h([2e3,b]),d.push(this.monthsShort(c,"")),e.push(this.months(c,"")),f.push(this.months(c,"")),f.push(this.monthsShort(c,""));for(d.sort(a),e.sort(a),f.sort(a),b=0;12>b;b++)d[b]=R(d[b]),e[b]=R(e[b]),f[b]=R(f[b]);this._monthsRegex=new RegExp("^("+f.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+e.join("|")+")$","i"),this._monthsShortStrictRegex=new RegExp("^("+d.join("|")+")$","i")}function da(a){var b,c=a._a;return c&&-2===j(a).overflow&&(b=c[wd]<0||c[wd]>11?wd:c[xd]<1||c[xd]>V(c[vd],c[wd])?xd:c[yd]<0||c[yd]>24||24===c[yd]&&(0!==c[zd]||0!==c[Ad]||0!==c[Bd])?yd:c[zd]<0||c[zd]>59?zd:c[Ad]<0||c[Ad]>59?Ad:c[Bd]<0||c[Bd]>999?Bd:-1,j(a)._overflowDayOfYear&&(vd>b||b>xd)&&(b=xd),j(a)._overflowWeeks&&-1===b&&(b=Cd),j(a)._overflowWeekday&&-1===b&&(b=Dd),j(a).overflow=b),a}function ea(b){a.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+b)}function fa(a,b){var c=!0;return g(function(){return c&&(ea(a+"\nArguments: "+Array.prototype.slice.call(arguments).join(", ")+"\n"+(new Error).stack),c=!1),b.apply(this,arguments)},b)}function ga(a,b){Jd[a]||(ea(b),Jd[a]=!0)}function ha(a){var b,c,d,e,f,g,h=a._i,i=Kd.exec(h)||Ld.exec(h);if(i){for(j(a).iso=!0,b=0,c=Nd.length;c>b;b++)if(Nd[b][1].exec(i[1])){e=Nd[b][0],d=Nd[b][2]!==!1;break}if(null==e)return void(a._isValid=!1);if(i[3]){for(b=0,c=Od.length;c>b;b++)if(Od[b][1].exec(i[3])){f=(i[2]||" ")+Od[b][0];break}if(null==f)return void(a._isValid=!1)}if(!d&&null!=f)return void(a._isValid=!1);if(i[4]){if(!Md.exec(i[4]))return void(a._isValid=!1);g="Z"}a._f=e+(f||"")+(g||""),wa(a)}else a._isValid=!1}function ia(b){var c=Pd.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(ha(b),void(b._isValid===!1&&(delete b._isValid,a.createFromInputFallback(b))))}function ja(a,b,c,d,e,f,g){var h=new Date(a,b,c,d,e,f,g);return 100>a&&a>=0&&isFinite(h.getFullYear())&&h.setFullYear(a),h}function ka(a){var b=new Date(Date.UTC.apply(null,arguments));return 100>a&&a>=0&&isFinite(b.getUTCFullYear())&&b.setUTCFullYear(a),b}function la(a){return ma(a)?366:365}function ma(a){return a%4===0&&a%100!==0||a%400===0}function na(){return ma(this.year())}function oa(a,b,c){var d=7+b-c,e=(7+ka(a,0,d).getUTCDay()-b)%7;return-e+d-1}function pa(a,b,c,d,e){var f,g,h=(7+c-d)%7,i=oa(a,d,e),j=1+7*(b-1)+h+i;return 0>=j?(f=a-1,g=la(f)+j):j>la(a)?(f=a+1,g=j-la(a)):(f=a,g=j),{year:f,dayOfYear:g}}function qa(a,b,c){var d,e,f=oa(a.year(),b,c),g=Math.floor((a.dayOfYear()-f-1)/7)+1;return 1>g?(e=a.year()-1,d=g+ra(e,b,c)):g>ra(a.year(),b,c)?(d=g-ra(a.year(),b,c),e=a.year()+1):(e=a.year(),d=g),{week:d,year:e}}function ra(a,b,c){var d=oa(a,b,c),e=oa(a+1,b,c);return(la(a)-d+e)/7}function sa(a,b,c){return null!=a?a:null!=b?b:c}function ta(b){var c=new Date(a.now());return b._useUTC?[c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()]:[c.getFullYear(),c.getMonth(),c.getDate()]}function ua(a){var b,c,d,e,f=[];if(!a._d){for(d=ta(a),a._w&&null==a._a[xd]&&null==a._a[wd]&&va(a),a._dayOfYear&&(e=sa(a._a[vd],d[vd]),a._dayOfYear>la(e)&&(j(a)._overflowDayOfYear=!0),c=ka(e,0,a._dayOfYear),a._a[wd]=c.getUTCMonth(),a._a[xd]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];for(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];24===a._a[yd]&&0===a._a[zd]&&0===a._a[Ad]&&0===a._a[Bd]&&(a._nextDay=!0,a._a[yd]=0),a._d=(a._useUTC?ka:ja).apply(null,f),null!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[yd]=24)}}function va(a){var b,c,d,e,f,g,h,i;b=a._w,null!=b.GG||null!=b.W||null!=b.E?(f=1,g=4,c=sa(b.GG,a._a[vd],qa(Ea(),1,4).year),d=sa(b.W,1),e=sa(b.E,1),(1>e||e>7)&&(i=!0)):(f=a._locale._week.dow,g=a._locale._week.doy,c=sa(b.gg,a._a[vd],qa(Ea(),f,g).year),d=sa(b.w,1),null!=b.d?(e=b.d,(0>e||e>6)&&(i=!0)):null!=b.e?(e=b.e+f,(b.e<0||b.e>6)&&(i=!0)):e=f),1>d||d>ra(c,f,g)?j(a)._overflowWeeks=!0:null!=i?j(a)._overflowWeekday=!0:(h=pa(c,d,e,f,g),a._a[vd]=h.year,a._dayOfYear=h.dayOfYear)}function wa(b){if(b._f===a.ISO_8601)return void ha(b);b._a=[],j(b).empty=!0;var c,d,e,f,g,h=""+b._i,i=h.length,k=0;for(e=N(b._f,b._locale).match($c)||[],c=0;c0&&j(b).unusedInput.push(g),h=h.slice(h.indexOf(d)+d.length),k+=d.length),bd[f]?(d?j(b).empty=!1:j(b).unusedTokens.push(f),U(f,d,b)):b._strict&&!d&&j(b).unusedTokens.push(f);j(b).charsLeftOver=i-k,h.length>0&&j(b).unusedInput.push(h),j(b).bigHour===!0&&b._a[yd]<=12&&b._a[yd]>0&&(j(b).bigHour=void 0),b._a[yd]=xa(b._locale,b._a[yd],b._meridiem),ua(b),da(b)}function xa(a,b,c){var d;return null==c?b:null!=a.meridiemHour?a.meridiemHour(b,c):null!=a.isPM?(d=a.isPM(c),d&&12>b&&(b+=12),d||12!==b||(b=0),b):b}function ya(a){var b,c,d,e,f;if(0===a._f.length)return j(a).invalidFormat=!0,void(a._d=new Date(NaN));for(e=0;ef)&&(d=f,c=b));g(a,c||b)}function za(a){if(!a._d){var b=C(a._i);a._a=e([b.year,b.month,b.day||b.date,b.hour,b.minute,b.second,b.millisecond],function(a){return a&&parseInt(a,10)}),ua(a)}}function Aa(a){var b=new o(da(Ba(a)));return b._nextDay&&(b.add(1,"d"),b._nextDay=void 0),b}function Ba(a){var b=a._i,e=a._f;return a._locale=a._locale||z(a._l),null===b||void 0===e&&""===b?l({nullInput:!0}):("string"==typeof b&&(a._i=b=a._locale.preparse(b)),p(b)?new o(da(b)):(c(e)?ya(a):e?wa(a):d(b)?a._d=b:Ca(a),k(a)||(a._d=null),a))}function Ca(b){var f=b._i;void 0===f?b._d=new Date(a.now()):d(f)?b._d=new Date(+f):"string"==typeof f?ia(b):c(f)?(b._a=e(f.slice(0),function(a){return parseInt(a,10)}),ua(b)):"object"==typeof f?za(b):"number"==typeof f?b._d=new Date(f):a.createFromInputFallback(b)}function Da(a,b,c,d,e){var f={};return"boolean"==typeof c&&(d=c,c=void 0),f._isAMomentObject=!0,f._useUTC=f._isUTC=e,f._l=c,f._i=a,f._f=b,f._strict=d,Aa(f)}function Ea(a,b,c,d){return Da(a,b,c,d,!1)}function Fa(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return Ea();for(d=b[0],e=1;ea&&(a=-a,c="-"),c+I(~~(a/60),2)+b+I(~~a%60,2)})}function La(a,b){var c=(b||"").match(a)||[],d=c[c.length-1]||[],e=(d+"").match(Ud)||["-",0,0],f=+(60*e[1])+r(e[2]);return"+"===e[0]?f:-f}function Ma(b,c){var e,f;return c._isUTC?(e=c.clone(),f=(p(b)||d(b)?+b:+Ea(b))-+e,e._d.setTime(+e._d+f),a.updateOffset(e,!1),e):Ea(b).local()}function Na(a){return 15*-Math.round(a._d.getTimezoneOffset()/15)}function Oa(b,c){var d,e=this._offset||0;return this.isValid()?null!=b?("string"==typeof b?b=La(qd,b):Math.abs(b)<16&&(b=60*b),!this._isUTC&&c&&(d=Na(this)),this._offset=b,this._isUTC=!0,null!=d&&this.add(d,"m"),e!==b&&(!c||this._changeInProgress?cb(this,Za(b-e,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,a.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?e:Na(this):null!=b?this:NaN}function Pa(a,b){return null!=a?("string"!=typeof a&&(a=-a),this.utcOffset(a,b),this):-this.utcOffset()}function Qa(a){return this.utcOffset(0,a)}function Ra(a){return this._isUTC&&(this.utcOffset(0,a),this._isUTC=!1,a&&this.subtract(Na(this),"m")),this}function Sa(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(La(pd,this._i)),this}function Ta(a){return this.isValid()?(a=a?Ea(a).utcOffset():0,(this.utcOffset()-a)%60===0):!1}function Ua(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Va(){if(!m(this._isDSTShifted))return this._isDSTShifted;var a={};if(n(a,this),a=Ba(a),a._a){var b=a._isUTC?h(a._a):Ea(a._a);this._isDSTShifted=this.isValid()&&s(a._a,b.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function Wa(){return this.isValid()?!this._isUTC:!1}function Xa(){return this.isValid()?this._isUTC:!1}function Ya(){return this.isValid()?this._isUTC&&0===this._offset:!1}function Za(a,b){var c,d,e,g=a,h=null;return Ja(a)?g={ms:a._milliseconds,d:a._days,M:a._months}:"number"==typeof a?(g={},b?g[b]=a:g.milliseconds=a):(h=Vd.exec(a))?(c="-"===h[1]?-1:1,g={y:0,d:r(h[xd])*c,h:r(h[yd])*c,m:r(h[zd])*c,s:r(h[Ad])*c,ms:r(h[Bd])*c}):(h=Wd.exec(a))?(c="-"===h[1]?-1:1,g={y:$a(h[2],c),M:$a(h[3],c),d:$a(h[4],c),h:$a(h[5],c),m:$a(h[6],c),s:$a(h[7],c),w:$a(h[8],c)}):null==g?g={}:"object"==typeof g&&("from"in g||"to"in g)&&(e=ab(Ea(g.from),Ea(g.to)),g={},g.ms=e.milliseconds,g.M=e.months),d=new Ia(g),Ja(a)&&f(a,"_locale")&&(d._locale=a._locale),d}function $a(a,b){var c=a&&parseFloat(a.replace(",","."));return(isNaN(c)?0:c)*b}function _a(a,b){var c={milliseconds:0,months:0};return c.months=b.month()-a.month()+12*(b.year()-a.year()),a.clone().add(c.months,"M").isAfter(b)&&--c.months,c.milliseconds=+b-+a.clone().add(c.months,"M"),c}function ab(a,b){var c;return a.isValid()&&b.isValid()?(b=Ma(b,a),a.isBefore(b)?c=_a(a,b):(c=_a(b,a),c.milliseconds=-c.milliseconds,c.months=-c.months),c):{milliseconds:0,months:0}}function bb(a,b){return function(c,d){var e,f;return null===d||isNaN(+d)||(ga(b,"moment()."+b+"(period, number) is deprecated. Please use moment()."+b+"(number, period)."),f=c,c=d,d=f),c="string"==typeof c?+c:c,e=Za(c,d),cb(this,e,a),this}}function cb(b,c,d,e){var f=c._milliseconds,g=c._days,h=c._months;b.isValid()&&(e=null==e?!0:e,f&&b._d.setTime(+b._d+f*d),g&&G(b,"Date",F(b,"Date")+g*d),h&&Z(b,F(b,"Month")+h*d),e&&a.updateOffset(b,g||h))}function db(a,b){var c=a||Ea(),d=Ma(c,this).startOf("day"),e=this.diff(d,"days",!0),f=-6>e?"sameElse":-1>e?"lastWeek":0>e?"lastDay":1>e?"sameDay":2>e?"nextDay":7>e?"nextWeek":"sameElse",g=b&&(D(b[f])?b[f]():b[f]);return this.format(g||this.localeData().calendar(f,this,Ea(c)))}function eb(){return new o(this)}function fb(a,b){var c=p(a)?a:Ea(a);return this.isValid()&&c.isValid()?(b=B(m(b)?"millisecond":b),"millisecond"===b?+this>+c:+c<+this.clone().startOf(b)):!1}function gb(a,b){var c=p(a)?a:Ea(a);return this.isValid()&&c.isValid()?(b=B(m(b)?"millisecond":b),"millisecond"===b?+c>+this:+this.clone().endOf(b)<+c):!1}function hb(a,b,c){return this.isAfter(a,c)&&this.isBefore(b,c)}function ib(a,b){var c,d=p(a)?a:Ea(a);return this.isValid()&&d.isValid()?(b=B(b||"millisecond"),"millisecond"===b?+this===+d:(c=+d,+this.clone().startOf(b)<=c&&c<=+this.clone().endOf(b))):!1}function jb(a,b){return this.isSame(a,b)||this.isAfter(a,b)}function kb(a,b){return this.isSame(a,b)||this.isBefore(a,b)}function lb(a,b,c){var d,e,f,g;return this.isValid()?(d=Ma(a,this),d.isValid()?(e=6e4*(d.utcOffset()-this.utcOffset()),b=B(b),"year"===b||"month"===b||"quarter"===b?(g=mb(this,d),"quarter"===b?g/=3:"year"===b&&(g/=12)):(f=this-d,g="second"===b?f/1e3:"minute"===b?f/6e4:"hour"===b?f/36e5:"day"===b?(f-e)/864e5:"week"===b?(f-e)/6048e5:f),c?g:q(g)):NaN):NaN}function mb(a,b){var c,d,e=12*(b.year()-a.year())+(b.month()-a.month()),f=a.clone().add(e,"months");return 0>b-f?(c=a.clone().add(e-1,"months"),d=(b-f)/(f-c)):(c=a.clone().add(e+1,"months"),d=(b-f)/(c-f)),-(e+d)}function nb(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function ob(){var a=this.clone().utc();return 0f&&(b=f),Ob.call(this,a,b,c,d,e))}function Ob(a,b,c,d,e){var f=pa(a,b,c,d,e),g=ka(f.year,0,f.dayOfYear);return this.year(g.getUTCFullYear()),this.month(g.getUTCMonth()),this.date(g.getUTCDate()),this}function Pb(a){return null==a?Math.ceil((this.month()+1)/3):this.month(3*(a-1)+this.month()%3)}function Qb(a){return qa(a,this._week.dow,this._week.doy).week}function Rb(){return this._week.dow}function Sb(){return this._week.doy}function Tb(a){var b=this.localeData().week(this);return null==a?b:this.add(7*(a-b),"d")}function Ub(a){var b=qa(this,1,4).week;return null==a?b:this.add(7*(a-b),"d")}function Vb(a,b){return"string"!=typeof a?a:isNaN(a)?(a=b.weekdaysParse(a),"number"==typeof a?a:null):parseInt(a,10)}function Wb(a,b){return c(this._weekdays)?this._weekdays[a.day()]:this._weekdays[this._weekdays.isFormat.test(b)?"format":"standalone"][a.day()]}function Xb(a){return this._weekdaysShort[a.day()]}function Yb(a){return this._weekdaysMin[a.day()]}function Zb(a,b,c){var d,e,f;for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),d=0;7>d;d++){if(e=Ea([2e3,1]).day(d),c&&!this._fullWeekdaysParse[d]&&(this._fullWeekdaysParse[d]=new RegExp("^"+this.weekdays(e,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[d]=new RegExp("^"+this.weekdaysShort(e,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[d]=new RegExp("^"+this.weekdaysMin(e,"").replace(".",".?")+"$","i")),this._weekdaysParse[d]||(f="^"+this.weekdays(e,"")+"|^"+this.weekdaysShort(e,"")+"|^"+this.weekdaysMin(e,""),this._weekdaysParse[d]=new RegExp(f.replace(".",""),"i")),c&&"dddd"===b&&this._fullWeekdaysParse[d].test(a))return d;if(c&&"ddd"===b&&this._shortWeekdaysParse[d].test(a))return d;if(c&&"dd"===b&&this._minWeekdaysParse[d].test(a))return d;if(!c&&this._weekdaysParse[d].test(a))return d}}function $b(a){if(!this.isValid())return null!=a?this:NaN;var b=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=a?(a=Vb(a,this.localeData()),this.add(a-b,"d")):b}function _b(a){if(!this.isValid())return null!=a?this:NaN;var b=(this.day()+7-this.localeData()._week.dow)%7;return null==a?b:this.add(a-b,"d")}function ac(a){return this.isValid()?null==a?this.day()||7:this.day(this.day()%7?a:a-7):null!=a?this:NaN}function bc(a){var b=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==a?b:this.add(a-b,"d")}function cc(){return this.hours()%12||12}function dc(a,b){J(a,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),b)})}function ec(a,b){return b._meridiemParse}function fc(a){return"p"===(a+"").toLowerCase().charAt(0)}function gc(a,b,c){return a>11?c?"pm":"PM":c?"am":"AM"}function hc(a,b){b[Bd]=r(1e3*("0."+a))}function ic(){return this._isUTC?"UTC":""}function jc(){return this._isUTC?"Coordinated Universal Time":""}function kc(a){return Ea(1e3*a)}function lc(){return Ea.apply(null,arguments).parseZone()}function mc(a,b,c){var d=this._calendar[a];return D(d)?d.call(b,c):d}function nc(a){var b=this._longDateFormat[a],c=this._longDateFormat[a.toUpperCase()];return b||!c?b:(this._longDateFormat[a]=c.replace(/MMMM|MM|DD|dddd/g,function(a){return a.slice(1)}),this._longDateFormat[a])}function oc(){return this._invalidDate}function pc(a){return this._ordinal.replace("%d",a)}function qc(a){return a}function rc(a,b,c,d){var e=this._relativeTime[c];return D(e)?e(a,b,c,d):e.replace(/%d/i,a)}function sc(a,b){var c=this._relativeTime[a>0?"future":"past"];return D(c)?c(b):c.replace(/%s/i,b)}function tc(a){var b,c;for(c in a)b=a[c],D(b)?this[c]=b:this["_"+c]=b;this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function uc(a,b,c,d){var e=z(),f=h().set(d,b);return e[c](f,a)}function vc(a,b,c,d,e){if("number"==typeof a&&(b=a,a=void 0),a=a||"",null!=b)return uc(a,b,c,e);var f,g=[];for(f=0;d>f;f++)g[f]=uc(a,f,c,e);return g}function wc(a,b){return vc(a,b,"months",12,"month")}function xc(a,b){return vc(a,b,"monthsShort",12,"month")}function yc(a,b){return vc(a,b,"weekdays",7,"day")}function zc(a,b){return vc(a,b,"weekdaysShort",7,"day")}function Ac(a,b){return vc(a,b,"weekdaysMin",7,"day")}function Bc(){var a=this._data;return this._milliseconds=se(this._milliseconds),this._days=se(this._days),this._months=se(this._months),a.milliseconds=se(a.milliseconds),a.seconds=se(a.seconds),a.minutes=se(a.minutes),a.hours=se(a.hours),a.months=se(a.months),a.years=se(a.years),this}function Cc(a,b,c,d){var e=Za(b,c);return a._milliseconds+=d*e._milliseconds,a._days+=d*e._days,a._months+=d*e._months,a._bubble()}function Dc(a,b){return Cc(this,a,b,1)}function Ec(a,b){return Cc(this,a,b,-1)}function Fc(a){return 0>a?Math.floor(a):Math.ceil(a)}function Gc(){var a,b,c,d,e,f=this._milliseconds,g=this._days,h=this._months,i=this._data;return f>=0&&g>=0&&h>=0||0>=f&&0>=g&&0>=h||(f+=864e5*Fc(Ic(h)+g),g=0,h=0),i.milliseconds=f%1e3,a=q(f/1e3),i.seconds=a%60,b=q(a/60),i.minutes=b%60,c=q(b/60),i.hours=c%24,g+=q(c/24),e=q(Hc(g)),h+=e,g-=Fc(Ic(e)),d=q(h/12),h%=12,i.days=g,i.months=h,i.years=d,this}function Hc(a){return 4800*a/146097}function Ic(a){return 146097*a/4800}function Jc(a){var b,c,d=this._milliseconds;if(a=B(a),"month"===a||"year"===a)return b=this._days+d/864e5,c=this._months+Hc(b),"month"===a?c:c/12;switch(b=this._days+Math.round(Ic(this._months)),a){case"week":return b/7+d/6048e5;case"day":return b+d/864e5;case"hour":return 24*b+d/36e5;case"minute":return 1440*b+d/6e4;case"second":return 86400*b+d/1e3;case"millisecond":return Math.floor(864e5*b)+d;default:throw new Error("Unknown unit "+a)}}function Kc(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*r(this._months/12)}function Lc(a){return function(){return this.as(a)}}function Mc(a){return a=B(a),this[a+"s"]()}function Nc(a){return function(){return this._data[a]}}function Oc(){return q(this.days()/7)}function Pc(a,b,c,d,e){return e.relativeTime(b||1,!!c,a,d)}function Qc(a,b,c){var d=Za(a).abs(),e=Ie(d.as("s")),f=Ie(d.as("m")),g=Ie(d.as("h")),h=Ie(d.as("d")),i=Ie(d.as("M")),j=Ie(d.as("y")),k=e=f&&["m"]||f=g&&["h"]||g=h&&["d"]||h=i&&["M"]||i=j&&["y"]||["yy",j];return k[2]=b,k[3]=+a>0,k[4]=c,Pc.apply(null,k)}function Rc(a,b){return void 0===Je[a]?!1:void 0===b?Je[a]:(Je[a]=b,!0)}function Sc(a){var b=this.localeData(),c=Qc(this,!a,b);return a&&(c=b.pastFuture(+this,c)),b.postformat(c)}function Tc(){var a,b,c,d=Ke(this._milliseconds)/1e3,e=Ke(this._days),f=Ke(this._months);a=q(d/60),b=q(a/60),d%=60,a%=60,c=q(f/12),f%=12;var g=c,h=f,i=e,j=b,k=a,l=d,m=this.asSeconds();return m?(0>m?"-":"")+"P"+(g?g+"Y":"")+(h?h+"M":"")+(i?i+"D":"")+(j||k||l?"T":"")+(j?j+"H":"")+(k?k+"M":"")+(l?l+"S":""):"P0D"}var Uc,Vc,Wc=a.momentProperties=[],Xc=!1,Yc={},Zc={},$c=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,_c=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,ad={},bd={},cd=/\d/,dd=/\d\d/,ed=/\d{3}/,fd=/\d{4}/,gd=/[+-]?\d{6}/,hd=/\d\d?/,id=/\d\d\d\d?/,jd=/\d\d\d\d\d\d?/,kd=/\d{1,3}/,ld=/\d{1,4}/,md=/[+-]?\d{1,6}/,nd=/\d+/,od=/[+-]?\d+/,pd=/Z|[+-]\d\d:?\d\d/gi,qd=/Z|[+-]\d\d(?::?\d\d)?/gi,rd=/[+-]?\d+(\.\d{1,3})?/,sd=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,td={},ud={},vd=0,wd=1,xd=2,yd=3,zd=4,Ad=5,Bd=6,Cd=7,Dd=8;J("M",["MM",2],"Mo",function(){return this.month()+1}),J("MMM",0,0,function(a){return this.localeData().monthsShort(this,a)}),J("MMMM",0,0,function(a){return this.localeData().months(this,a)}),A("month","M"),O("M",hd),O("MM",hd,dd),O("MMM",function(a,b){return b.monthsShortRegex(a)}),O("MMMM",function(a,b){return b.monthsRegex(a)}),S(["M","MM"],function(a,b){b[wd]=r(a)-1}),S(["MMM","MMMM"],function(a,b,c,d){var e=c._locale.monthsParse(a,d,c._strict);null!=e?b[wd]=e:j(c).invalidMonth=a});var Ed=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/,Fd="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Gd="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Hd=sd,Id=sd,Jd={};a.suppressDeprecationWarnings=!1;var Kd=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,Ld=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,Md=/Z|[+-]\d\d(?::?\d\d)?/,Nd=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],Od=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Pd=/^\/?Date\((\-?\d+)/i;a.createFromInputFallback=fa("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(a){a._d=new Date(a._i+(a._useUTC?" UTC":""))}),J("Y",0,0,function(){var a=this.year();return 9999>=a?""+a:"+"+a}),J(0,["YY",2],0,function(){return this.year()%100}),J(0,["YYYY",4],0,"year"),J(0,["YYYYY",5],0,"year"),J(0,["YYYYYY",6,!0],0,"year"),A("year","y"),O("Y",od),O("YY",hd,dd),O("YYYY",ld,fd),O("YYYYY",md,gd),O("YYYYYY",md,gd),S(["YYYYY","YYYYYY"],vd),S("YYYY",function(b,c){c[vd]=2===b.length?a.parseTwoDigitYear(b):r(b)}),S("YY",function(b,c){c[vd]=a.parseTwoDigitYear(b)}),S("Y",function(a,b){b[vd]=parseInt(a,10)}),a.parseTwoDigitYear=function(a){return r(a)+(r(a)>68?1900:2e3)};var Qd=E("FullYear",!1);a.ISO_8601=function(){};var Rd=fa("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var a=Ea.apply(null,arguments);return this.isValid()&&a.isValid()?this>a?this:a:l()}),Sd=fa("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var a=Ea.apply(null,arguments);return this.isValid()&&a.isValid()?a>this?this:a:l()}),Td=function(){return Date.now?Date.now():+new Date};Ka("Z",":"),Ka("ZZ",""),O("Z",qd),O("ZZ",qd),S(["Z","ZZ"],function(a,b,c){c._useUTC=!0,c._tzm=La(qd,a)});var Ud=/([\+\-]|\d\d)/gi;a.updateOffset=function(){};var Vd=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?\d*)?$/,Wd=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/; -Za.fn=Ia.prototype;var Xd=bb(1,"add"),Yd=bb(-1,"subtract");a.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";var Zd=fa("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(a){return void 0===a?this.localeData():this.locale(a)});J(0,["gg",2],0,function(){return this.weekYear()%100}),J(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Ib("gggg","weekYear"),Ib("ggggg","weekYear"),Ib("GGGG","isoWeekYear"),Ib("GGGGG","isoWeekYear"),A("weekYear","gg"),A("isoWeekYear","GG"),O("G",od),O("g",od),O("GG",hd,dd),O("gg",hd,dd),O("GGGG",ld,fd),O("gggg",ld,fd),O("GGGGG",md,gd),O("ggggg",md,gd),T(["gggg","ggggg","GGGG","GGGGG"],function(a,b,c,d){b[d.substr(0,2)]=r(a)}),T(["gg","GG"],function(b,c,d,e){c[e]=a.parseTwoDigitYear(b)}),J("Q",0,"Qo","quarter"),A("quarter","Q"),O("Q",cd),S("Q",function(a,b){b[wd]=3*(r(a)-1)}),J("w",["ww",2],"wo","week"),J("W",["WW",2],"Wo","isoWeek"),A("week","w"),A("isoWeek","W"),O("w",hd),O("ww",hd,dd),O("W",hd),O("WW",hd,dd),T(["w","ww","W","WW"],function(a,b,c,d){b[d.substr(0,1)]=r(a)});var $d={dow:0,doy:6};J("D",["DD",2],"Do","date"),A("date","D"),O("D",hd),O("DD",hd,dd),O("Do",function(a,b){return a?b._ordinalParse:b._ordinalParseLenient}),S(["D","DD"],xd),S("Do",function(a,b){b[xd]=r(a.match(hd)[0],10)});var _d=E("Date",!0);J("d",0,"do","day"),J("dd",0,0,function(a){return this.localeData().weekdaysMin(this,a)}),J("ddd",0,0,function(a){return this.localeData().weekdaysShort(this,a)}),J("dddd",0,0,function(a){return this.localeData().weekdays(this,a)}),J("e",0,0,"weekday"),J("E",0,0,"isoWeekday"),A("day","d"),A("weekday","e"),A("isoWeekday","E"),O("d",hd),O("e",hd),O("E",hd),O("dd",sd),O("ddd",sd),O("dddd",sd),T(["dd","ddd","dddd"],function(a,b,c,d){var e=c._locale.weekdaysParse(a,d,c._strict);null!=e?b.d=e:j(c).invalidWeekday=a}),T(["d","e","E"],function(a,b,c,d){b[d]=r(a)});var ae="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),be="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),ce="Su_Mo_Tu_We_Th_Fr_Sa".split("_");J("DDD",["DDDD",3],"DDDo","dayOfYear"),A("dayOfYear","DDD"),O("DDD",kd),O("DDDD",ed),S(["DDD","DDDD"],function(a,b,c){c._dayOfYear=r(a)}),J("H",["HH",2],0,"hour"),J("h",["hh",2],0,cc),J("hmm",0,0,function(){return""+cc.apply(this)+I(this.minutes(),2)}),J("hmmss",0,0,function(){return""+cc.apply(this)+I(this.minutes(),2)+I(this.seconds(),2)}),J("Hmm",0,0,function(){return""+this.hours()+I(this.minutes(),2)}),J("Hmmss",0,0,function(){return""+this.hours()+I(this.minutes(),2)+I(this.seconds(),2)}),dc("a",!0),dc("A",!1),A("hour","h"),O("a",ec),O("A",ec),O("H",hd),O("h",hd),O("HH",hd,dd),O("hh",hd,dd),O("hmm",id),O("hmmss",jd),O("Hmm",id),O("Hmmss",jd),S(["H","HH"],yd),S(["a","A"],function(a,b,c){c._isPm=c._locale.isPM(a),c._meridiem=a}),S(["h","hh"],function(a,b,c){b[yd]=r(a),j(c).bigHour=!0}),S("hmm",function(a,b,c){var d=a.length-2;b[yd]=r(a.substr(0,d)),b[zd]=r(a.substr(d)),j(c).bigHour=!0}),S("hmmss",function(a,b,c){var d=a.length-4,e=a.length-2;b[yd]=r(a.substr(0,d)),b[zd]=r(a.substr(d,2)),b[Ad]=r(a.substr(e)),j(c).bigHour=!0}),S("Hmm",function(a,b,c){var d=a.length-2;b[yd]=r(a.substr(0,d)),b[zd]=r(a.substr(d))}),S("Hmmss",function(a,b,c){var d=a.length-4,e=a.length-2;b[yd]=r(a.substr(0,d)),b[zd]=r(a.substr(d,2)),b[Ad]=r(a.substr(e))});var de=/[ap]\.?m?\.?/i,ee=E("Hours",!0);J("m",["mm",2],0,"minute"),A("minute","m"),O("m",hd),O("mm",hd,dd),S(["m","mm"],zd);var fe=E("Minutes",!1);J("s",["ss",2],0,"second"),A("second","s"),O("s",hd),O("ss",hd,dd),S(["s","ss"],Ad);var ge=E("Seconds",!1);J("S",0,0,function(){return~~(this.millisecond()/100)}),J(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),J(0,["SSS",3],0,"millisecond"),J(0,["SSSS",4],0,function(){return 10*this.millisecond()}),J(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),J(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),J(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),J(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),J(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),A("millisecond","ms"),O("S",kd,cd),O("SS",kd,dd),O("SSS",kd,ed);var he;for(he="SSSS";he.length<=9;he+="S")O(he,nd);for(he="S";he.length<=9;he+="S")S(he,hc);var ie=E("Milliseconds",!1);J("z",0,0,"zoneAbbr"),J("zz",0,0,"zoneName");var je=o.prototype;je.add=Xd,je.calendar=db,je.clone=eb,je.diff=lb,je.endOf=xb,je.format=pb,je.from=qb,je.fromNow=rb,je.to=sb,je.toNow=tb,je.get=H,je.invalidAt=Gb,je.isAfter=fb,je.isBefore=gb,je.isBetween=hb,je.isSame=ib,je.isSameOrAfter=jb,je.isSameOrBefore=kb,je.isValid=Eb,je.lang=Zd,je.locale=ub,je.localeData=vb,je.max=Sd,je.min=Rd,je.parsingFlags=Fb,je.set=H,je.startOf=wb,je.subtract=Yd,je.toArray=Bb,je.toObject=Cb,je.toDate=Ab,je.toISOString=ob,je.toJSON=Db,je.toString=nb,je.unix=zb,je.valueOf=yb,je.creationData=Hb,je.year=Qd,je.isLeapYear=na,je.weekYear=Jb,je.isoWeekYear=Kb,je.quarter=je.quarters=Pb,je.month=$,je.daysInMonth=_,je.week=je.weeks=Tb,je.isoWeek=je.isoWeeks=Ub,je.weeksInYear=Mb,je.isoWeeksInYear=Lb,je.date=_d,je.day=je.days=$b,je.weekday=_b,je.isoWeekday=ac,je.dayOfYear=bc,je.hour=je.hours=ee,je.minute=je.minutes=fe,je.second=je.seconds=ge,je.millisecond=je.milliseconds=ie,je.utcOffset=Oa,je.utc=Qa,je.local=Ra,je.parseZone=Sa,je.hasAlignedHourOffset=Ta,je.isDST=Ua,je.isDSTShifted=Va,je.isLocal=Wa,je.isUtcOffset=Xa,je.isUtc=Ya,je.isUTC=Ya,je.zoneAbbr=ic,je.zoneName=jc,je.dates=fa("dates accessor is deprecated. Use date instead.",_d),je.months=fa("months accessor is deprecated. Use month instead",$),je.years=fa("years accessor is deprecated. Use year instead",Qd),je.zone=fa("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",Pa);var ke=je,le={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},me={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"},ne="Invalid date",oe="%d",pe=/\d{1,2}/,qe={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"},re=t.prototype;re._calendar=le,re.calendar=mc,re._longDateFormat=me,re.longDateFormat=nc,re._invalidDate=ne,re.invalidDate=oc,re._ordinal=oe,re.ordinal=pc,re._ordinalParse=pe,re.preparse=qc,re.postformat=qc,re._relativeTime=qe,re.relativeTime=rc,re.pastFuture=sc,re.set=tc,re.months=W,re._months=Fd,re.monthsShort=X,re._monthsShort=Gd,re.monthsParse=Y,re._monthsRegex=Id,re.monthsRegex=ba,re._monthsShortRegex=Hd,re.monthsShortRegex=aa,re.week=Qb,re._week=$d,re.firstDayOfYear=Sb,re.firstDayOfWeek=Rb,re.weekdays=Wb,re._weekdays=ae,re.weekdaysMin=Yb,re._weekdaysMin=ce,re.weekdaysShort=Xb,re._weekdaysShort=be,re.weekdaysParse=Zb,re.isPM=fc,re._meridiemParse=de,re.meridiem=gc,x("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(a){var b=a%10,c=1===r(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c}}),a.lang=fa("moment.lang is deprecated. Use moment.locale instead.",x),a.langData=fa("moment.langData is deprecated. Use moment.localeData instead.",z);var se=Math.abs,te=Lc("ms"),ue=Lc("s"),ve=Lc("m"),we=Lc("h"),xe=Lc("d"),ye=Lc("w"),ze=Lc("M"),Ae=Lc("y"),Be=Nc("milliseconds"),Ce=Nc("seconds"),De=Nc("minutes"),Ee=Nc("hours"),Fe=Nc("days"),Ge=Nc("months"),He=Nc("years"),Ie=Math.round,Je={s:45,m:45,h:22,d:26,M:11},Ke=Math.abs,Le=Ia.prototype;Le.abs=Bc,Le.add=Dc,Le.subtract=Ec,Le.as=Jc,Le.asMilliseconds=te,Le.asSeconds=ue,Le.asMinutes=ve,Le.asHours=we,Le.asDays=xe,Le.asWeeks=ye,Le.asMonths=ze,Le.asYears=Ae,Le.valueOf=Kc,Le._bubble=Gc,Le.get=Mc,Le.milliseconds=Be,Le.seconds=Ce,Le.minutes=De,Le.hours=Ee,Le.days=Fe,Le.weeks=Oc,Le.months=Ge,Le.years=He,Le.humanize=Sc,Le.toISOString=Tc,Le.toString=Tc,Le.toJSON=Tc,Le.locale=ub,Le.localeData=vb,Le.toIsoString=fa("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Tc),Le.lang=Zd,J("X",0,0,"unix"),J("x",0,0,"valueOf"),O("x",od),O("X",rd),S("X",function(a,b,c){c._d=new Date(1e3*parseFloat(a,10))}),S("x",function(a,b,c){c._d=new Date(r(a))}),a.version="2.11.2",b(Ea),a.fn=ke,a.min=Ga,a.max=Ha,a.now=Td,a.utc=h,a.unix=kc,a.months=wc,a.isDate=d,a.locale=x,a.invalid=l,a.duration=Za,a.isMoment=p,a.weekdays=yc,a.parseZone=lc,a.localeData=z,a.isDuration=Ja,a.monthsShort=xc,a.weekdaysMin=Ac,a.defineLocale=y,a.weekdaysShort=zc,a.normalizeUnits=B,a.relativeTimeThreshold=Rc,a.prototype=ke;var Me=a;return Me}); \ No newline at end of file +!function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):a.moment=b()}(this,function(){"use strict";function a(){return Zc.apply(null,arguments)}function b(a){Zc=a}function c(a){return a instanceof Array||"[object Array]"===Object.prototype.toString.call(a)}function d(a){return a instanceof Date||"[object Date]"===Object.prototype.toString.call(a)}function e(a,b){var c,d=[];for(c=0;c0)for(c in $c)d=$c[c],e=b[d],m(e)||(a[d]=e);return a}function o(b){n(this,b),this._d=new Date(null!=b._d?b._d.getTime():NaN),_c===!1&&(_c=!0,a.updateOffset(this),_c=!1)}function p(a){return a instanceof o||null!=a&&null!=a._isAMomentObject}function q(a){return 0>a?Math.ceil(a):Math.floor(a)}function r(a){var b=+a,c=0;return 0!==b&&isFinite(b)&&(c=q(b)),c}function s(a,b,c){var d,e=Math.min(a.length,b.length),f=Math.abs(a.length-b.length),g=0;for(d=0;e>d;d++)(c&&a[d]!==b[d]||!c&&r(a[d])!==r(b[d]))&&g++;return g+f}function t(b){a.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+b)}function u(a,b){var c=!0;return g(function(){return c&&(t(a+"\nArguments: "+Array.prototype.slice.call(arguments).join(", ")+"\n"+(new Error).stack),c=!1),b.apply(this,arguments)},b)}function v(a,b){ad[a]||(t(b),ad[a]=!0)}function w(a){return a instanceof Function||"[object Function]"===Object.prototype.toString.call(a)}function x(a){return"[object Object]"===Object.prototype.toString.call(a)}function y(a){var b,c;for(c in a)b=a[c],w(b)?this[c]=b:this["_"+c]=b;this._config=a,this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function z(a,b){var c,d=g({},a);for(c in b)f(b,c)&&(x(a[c])&&x(b[c])?(d[c]={},g(d[c],a[c]),g(d[c],b[c])):null!=b[c]?d[c]=b[c]:delete d[c]);return d}function A(a){null!=a&&this.set(a)}function B(a){return a?a.toLowerCase().replace("_","-"):a}function C(a){for(var b,c,d,e,f=0;f0;){if(d=D(e.slice(0,b).join("-")))return d;if(c&&c.length>=b&&s(e,c,!0)>=b-1)break;b--}f++}return null}function D(a){var b=null;if(!cd[a]&&"undefined"!=typeof module&&module&&module.exports)try{b=bd._abbr,require("./locale/"+a),E(b)}catch(c){}return cd[a]}function E(a,b){var c;return a&&(c=m(b)?H(a):F(a,b),c&&(bd=c)),bd._abbr}function F(a,b){return null!==b?(b.abbr=a,null!=cd[a]?(v("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale"),b=z(cd[a]._config,b)):null!=b.parentLocale&&(null!=cd[b.parentLocale]?b=z(cd[b.parentLocale]._config,b):v("parentLocaleUndefined","specified parentLocale is not defined yet")),cd[a]=new A(b),E(a),cd[a]):(delete cd[a],null)}function G(a,b){if(null!=b){var c;null!=cd[a]&&(b=z(cd[a]._config,b)),c=new A(b),c.parentLocale=cd[a],cd[a]=c,E(a)}else null!=cd[a]&&(null!=cd[a].parentLocale?cd[a]=cd[a].parentLocale:null!=cd[a]&&delete cd[a]);return cd[a]}function H(a){var b;if(a&&a._locale&&a._locale._abbr&&(a=a._locale._abbr),!a)return bd;if(!c(a)){if(b=D(a))return b;a=[a]}return C(a)}function I(){return Object.keys(cd)}function J(a,b){var c=a.toLowerCase();dd[c]=dd[c+"s"]=dd[b]=a}function K(a){return"string"==typeof a?dd[a]||dd[a.toLowerCase()]:void 0}function L(a){var b,c,d={};for(c in a)f(a,c)&&(b=K(c),b&&(d[b]=a[c]));return d}function M(b,c){return function(d){return null!=d?(O(this,b,d),a.updateOffset(this,c),this):N(this,b)}}function N(a,b){return a.isValid()?a._d["get"+(a._isUTC?"UTC":"")+b]():NaN}function O(a,b,c){a.isValid()&&a._d["set"+(a._isUTC?"UTC":"")+b](c)}function P(a,b){var c;if("object"==typeof a)for(c in a)this.set(c,a[c]);else if(a=K(a),w(this[a]))return this[a](b);return this}function Q(a,b,c){var d=""+Math.abs(a),e=b-d.length,f=a>=0;return(f?c?"+":"":"-")+Math.pow(10,Math.max(0,e)).toString().substr(1)+d}function R(a,b,c,d){var e=d;"string"==typeof d&&(e=function(){return this[d]()}),a&&(hd[a]=e),b&&(hd[b[0]]=function(){return Q(e.apply(this,arguments),b[1],b[2])}),c&&(hd[c]=function(){return this.localeData().ordinal(e.apply(this,arguments),a)})}function S(a){return a.match(/\[[\s\S]/)?a.replace(/^\[|\]$/g,""):a.replace(/\\/g,"")}function T(a){var b,c,d=a.match(ed);for(b=0,c=d.length;c>b;b++)hd[d[b]]?d[b]=hd[d[b]]:d[b]=S(d[b]);return function(e){var f="";for(b=0;c>b;b++)f+=d[b]instanceof Function?d[b].call(e,a):d[b];return f}}function U(a,b){return a.isValid()?(b=V(b,a.localeData()),gd[b]=gd[b]||T(b),gd[b](a)):a.localeData().invalidDate()}function V(a,b){function c(a){return b.longDateFormat(a)||a}var d=5;for(fd.lastIndex=0;d>=0&&fd.test(a);)a=a.replace(fd,c),fd.lastIndex=0,d-=1;return a}function W(a,b,c){zd[a]=w(b)?b:function(a,d){return a&&c?c:b}}function X(a,b){return f(zd,a)?zd[a](b._strict,b._locale):new RegExp(Y(a))}function Y(a){return Z(a.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(a,b,c,d,e){return b||c||d||e}))}function Z(a){return a.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function $(a,b){var c,d=b;for("string"==typeof a&&(a=[a]),"number"==typeof b&&(d=function(a,c){c[b]=r(a)}),c=0;cd;d++){if(e=h([2e3,d]),c&&!this._longMonthsParse[d]&&(this._longMonthsParse[d]=new RegExp("^"+this.months(e,"").replace(".","")+"$","i"),this._shortMonthsParse[d]=new RegExp("^"+this.monthsShort(e,"").replace(".","")+"$","i")),c||this._monthsParse[d]||(f="^"+this.months(e,"")+"|^"+this.monthsShort(e,""),this._monthsParse[d]=new RegExp(f.replace(".",""),"i")),c&&"MMMM"===b&&this._longMonthsParse[d].test(a))return d;if(c&&"MMM"===b&&this._shortMonthsParse[d].test(a))return d;if(!c&&this._monthsParse[d].test(a))return d}}function fa(a,b){var c;if(!a.isValid())return a;if("string"==typeof b)if(/^\d+$/.test(b))b=r(b);else if(b=a.localeData().monthsParse(b),"number"!=typeof b)return a;return c=Math.min(a.date(),ba(a.year(),b)),a._d["set"+(a._isUTC?"UTC":"")+"Month"](b,c),a}function ga(b){return null!=b?(fa(this,b),a.updateOffset(this,!0),this):N(this,"Month")}function ha(){return ba(this.year(),this.month())}function ia(a){return this._monthsParseExact?(f(this,"_monthsRegex")||ka.call(this),a?this._monthsShortStrictRegex:this._monthsShortRegex):this._monthsShortStrictRegex&&a?this._monthsShortStrictRegex:this._monthsShortRegex}function ja(a){return this._monthsParseExact?(f(this,"_monthsRegex")||ka.call(this),a?this._monthsStrictRegex:this._monthsRegex):this._monthsStrictRegex&&a?this._monthsStrictRegex:this._monthsRegex}function ka(){function a(a,b){return b.length-a.length}var b,c,d=[],e=[],f=[];for(b=0;12>b;b++)c=h([2e3,b]),d.push(this.monthsShort(c,"")),e.push(this.months(c,"")),f.push(this.months(c,"")),f.push(this.monthsShort(c,""));for(d.sort(a),e.sort(a),f.sort(a),b=0;12>b;b++)d[b]=Z(d[b]),e[b]=Z(e[b]),f[b]=Z(f[b]);this._monthsRegex=new RegExp("^("+f.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+e.join("|")+")$","i"),this._monthsShortStrictRegex=new RegExp("^("+d.join("|")+")$","i")}function la(a){var b,c=a._a;return c&&-2===j(a).overflow&&(b=c[Cd]<0||c[Cd]>11?Cd:c[Dd]<1||c[Dd]>ba(c[Bd],c[Cd])?Dd:c[Ed]<0||c[Ed]>24||24===c[Ed]&&(0!==c[Fd]||0!==c[Gd]||0!==c[Hd])?Ed:c[Fd]<0||c[Fd]>59?Fd:c[Gd]<0||c[Gd]>59?Gd:c[Hd]<0||c[Hd]>999?Hd:-1,j(a)._overflowDayOfYear&&(Bd>b||b>Dd)&&(b=Dd),j(a)._overflowWeeks&&-1===b&&(b=Id),j(a)._overflowWeekday&&-1===b&&(b=Jd),j(a).overflow=b),a}function ma(a){var b,c,d,e,f,g,h=a._i,i=Pd.exec(h)||Qd.exec(h);if(i){for(j(a).iso=!0,b=0,c=Sd.length;c>b;b++)if(Sd[b][1].exec(i[1])){e=Sd[b][0],d=Sd[b][2]!==!1;break}if(null==e)return void(a._isValid=!1);if(i[3]){for(b=0,c=Td.length;c>b;b++)if(Td[b][1].exec(i[3])){f=(i[2]||" ")+Td[b][0];break}if(null==f)return void(a._isValid=!1)}if(!d&&null!=f)return void(a._isValid=!1);if(i[4]){if(!Rd.exec(i[4]))return void(a._isValid=!1);g="Z"}a._f=e+(f||"")+(g||""),Ba(a)}else a._isValid=!1}function na(b){var c=Ud.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(ma(b),void(b._isValid===!1&&(delete b._isValid,a.createFromInputFallback(b))))}function oa(a,b,c,d,e,f,g){var h=new Date(a,b,c,d,e,f,g);return 100>a&&a>=0&&isFinite(h.getFullYear())&&h.setFullYear(a),h}function pa(a){var b=new Date(Date.UTC.apply(null,arguments));return 100>a&&a>=0&&isFinite(b.getUTCFullYear())&&b.setUTCFullYear(a),b}function qa(a){return ra(a)?366:365}function ra(a){return a%4===0&&a%100!==0||a%400===0}function sa(){return ra(this.year())}function ta(a,b,c){var d=7+b-c,e=(7+pa(a,0,d).getUTCDay()-b)%7;return-e+d-1}function ua(a,b,c,d,e){var f,g,h=(7+c-d)%7,i=ta(a,d,e),j=1+7*(b-1)+h+i;return 0>=j?(f=a-1,g=qa(f)+j):j>qa(a)?(f=a+1,g=j-qa(a)):(f=a,g=j),{year:f,dayOfYear:g}}function va(a,b,c){var d,e,f=ta(a.year(),b,c),g=Math.floor((a.dayOfYear()-f-1)/7)+1;return 1>g?(e=a.year()-1,d=g+wa(e,b,c)):g>wa(a.year(),b,c)?(d=g-wa(a.year(),b,c),e=a.year()+1):(e=a.year(),d=g),{week:d,year:e}}function wa(a,b,c){var d=ta(a,b,c),e=ta(a+1,b,c);return(qa(a)-d+e)/7}function xa(a,b,c){return null!=a?a:null!=b?b:c}function ya(b){var c=new Date(a.now());return b._useUTC?[c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()]:[c.getFullYear(),c.getMonth(),c.getDate()]}function za(a){var b,c,d,e,f=[];if(!a._d){for(d=ya(a),a._w&&null==a._a[Dd]&&null==a._a[Cd]&&Aa(a),a._dayOfYear&&(e=xa(a._a[Bd],d[Bd]),a._dayOfYear>qa(e)&&(j(a)._overflowDayOfYear=!0),c=pa(e,0,a._dayOfYear),a._a[Cd]=c.getUTCMonth(),a._a[Dd]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];for(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];24===a._a[Ed]&&0===a._a[Fd]&&0===a._a[Gd]&&0===a._a[Hd]&&(a._nextDay=!0,a._a[Ed]=0),a._d=(a._useUTC?pa:oa).apply(null,f),null!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[Ed]=24)}}function Aa(a){var b,c,d,e,f,g,h,i;b=a._w,null!=b.GG||null!=b.W||null!=b.E?(f=1,g=4,c=xa(b.GG,a._a[Bd],va(Ja(),1,4).year),d=xa(b.W,1),e=xa(b.E,1),(1>e||e>7)&&(i=!0)):(f=a._locale._week.dow,g=a._locale._week.doy,c=xa(b.gg,a._a[Bd],va(Ja(),f,g).year),d=xa(b.w,1),null!=b.d?(e=b.d,(0>e||e>6)&&(i=!0)):null!=b.e?(e=b.e+f,(b.e<0||b.e>6)&&(i=!0)):e=f),1>d||d>wa(c,f,g)?j(a)._overflowWeeks=!0:null!=i?j(a)._overflowWeekday=!0:(h=ua(c,d,e,f,g),a._a[Bd]=h.year,a._dayOfYear=h.dayOfYear)}function Ba(b){if(b._f===a.ISO_8601)return void ma(b);b._a=[],j(b).empty=!0;var c,d,e,f,g,h=""+b._i,i=h.length,k=0;for(e=V(b._f,b._locale).match(ed)||[],c=0;c0&&j(b).unusedInput.push(g),h=h.slice(h.indexOf(d)+d.length),k+=d.length),hd[f]?(d?j(b).empty=!1:j(b).unusedTokens.push(f),aa(f,d,b)):b._strict&&!d&&j(b).unusedTokens.push(f);j(b).charsLeftOver=i-k,h.length>0&&j(b).unusedInput.push(h),j(b).bigHour===!0&&b._a[Ed]<=12&&b._a[Ed]>0&&(j(b).bigHour=void 0),b._a[Ed]=Ca(b._locale,b._a[Ed],b._meridiem),za(b),la(b)}function Ca(a,b,c){var d;return null==c?b:null!=a.meridiemHour?a.meridiemHour(b,c):null!=a.isPM?(d=a.isPM(c),d&&12>b&&(b+=12),d||12!==b||(b=0),b):b}function Da(a){var b,c,d,e,f;if(0===a._f.length)return j(a).invalidFormat=!0,void(a._d=new Date(NaN));for(e=0;ef)&&(d=f,c=b));g(a,c||b)}function Ea(a){if(!a._d){var b=L(a._i);a._a=e([b.year,b.month,b.day||b.date,b.hour,b.minute,b.second,b.millisecond],function(a){return a&&parseInt(a,10)}),za(a)}}function Fa(a){var b=new o(la(Ga(a)));return b._nextDay&&(b.add(1,"d"),b._nextDay=void 0),b}function Ga(a){var b=a._i,e=a._f;return a._locale=a._locale||H(a._l),null===b||void 0===e&&""===b?l({nullInput:!0}):("string"==typeof b&&(a._i=b=a._locale.preparse(b)),p(b)?new o(la(b)):(c(e)?Da(a):e?Ba(a):d(b)?a._d=b:Ha(a),k(a)||(a._d=null),a))}function Ha(b){var f=b._i;void 0===f?b._d=new Date(a.now()):d(f)?b._d=new Date(+f):"string"==typeof f?na(b):c(f)?(b._a=e(f.slice(0),function(a){return parseInt(a,10)}),za(b)):"object"==typeof f?Ea(b):"number"==typeof f?b._d=new Date(f):a.createFromInputFallback(b)}function Ia(a,b,c,d,e){var f={};return"boolean"==typeof c&&(d=c,c=void 0),f._isAMomentObject=!0,f._useUTC=f._isUTC=e,f._l=c,f._i=a,f._f=b,f._strict=d,Fa(f)}function Ja(a,b,c,d){return Ia(a,b,c,d,!1)}function Ka(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return Ja();for(d=b[0],e=1;ea&&(a=-a,c="-"),c+Q(~~(a/60),2)+b+Q(~~a%60,2)})}function Qa(a,b){var c=(b||"").match(a)||[],d=c[c.length-1]||[],e=(d+"").match(Zd)||["-",0,0],f=+(60*e[1])+r(e[2]);return"+"===e[0]?f:-f}function Ra(b,c){var e,f;return c._isUTC?(e=c.clone(),f=(p(b)||d(b)?+b:+Ja(b))-+e,e._d.setTime(+e._d+f),a.updateOffset(e,!1),e):Ja(b).local()}function Sa(a){return 15*-Math.round(a._d.getTimezoneOffset()/15)}function Ta(b,c){var d,e=this._offset||0;return this.isValid()?null!=b?("string"==typeof b?b=Qa(wd,b):Math.abs(b)<16&&(b=60*b),!this._isUTC&&c&&(d=Sa(this)),this._offset=b,this._isUTC=!0,null!=d&&this.add(d,"m"),e!==b&&(!c||this._changeInProgress?ib(this,cb(b-e,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,a.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?e:Sa(this):null!=b?this:NaN}function Ua(a,b){return null!=a?("string"!=typeof a&&(a=-a),this.utcOffset(a,b),this):-this.utcOffset()}function Va(a){return this.utcOffset(0,a)}function Wa(a){return this._isUTC&&(this.utcOffset(0,a),this._isUTC=!1,a&&this.subtract(Sa(this),"m")),this}function Xa(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(Qa(vd,this._i)),this}function Ya(a){return this.isValid()?(a=a?Ja(a).utcOffset():0,(this.utcOffset()-a)%60===0):!1}function Za(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function $a(){if(!m(this._isDSTShifted))return this._isDSTShifted;var a={};if(n(a,this),a=Ga(a),a._a){var b=a._isUTC?h(a._a):Ja(a._a);this._isDSTShifted=this.isValid()&&s(a._a,b.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function _a(){return this.isValid()?!this._isUTC:!1}function ab(){return this.isValid()?this._isUTC:!1}function bb(){return this.isValid()?this._isUTC&&0===this._offset:!1}function cb(a,b){var c,d,e,g=a,h=null;return Oa(a)?g={ms:a._milliseconds,d:a._days,M:a._months}:"number"==typeof a?(g={},b?g[b]=a:g.milliseconds=a):(h=$d.exec(a))?(c="-"===h[1]?-1:1,g={y:0,d:r(h[Dd])*c,h:r(h[Ed])*c,m:r(h[Fd])*c,s:r(h[Gd])*c,ms:r(h[Hd])*c}):(h=_d.exec(a))?(c="-"===h[1]?-1:1,g={y:db(h[2],c),M:db(h[3],c),w:db(h[4],c),d:db(h[5],c),h:db(h[6],c),m:db(h[7],c),s:db(h[8],c)}):null==g?g={}:"object"==typeof g&&("from"in g||"to"in g)&&(e=fb(Ja(g.from),Ja(g.to)),g={},g.ms=e.milliseconds,g.M=e.months),d=new Na(g),Oa(a)&&f(a,"_locale")&&(d._locale=a._locale),d}function db(a,b){var c=a&&parseFloat(a.replace(",","."));return(isNaN(c)?0:c)*b}function eb(a,b){var c={milliseconds:0,months:0};return c.months=b.month()-a.month()+12*(b.year()-a.year()),a.clone().add(c.months,"M").isAfter(b)&&--c.months,c.milliseconds=+b-+a.clone().add(c.months,"M"),c}function fb(a,b){var c;return a.isValid()&&b.isValid()?(b=Ra(b,a),a.isBefore(b)?c=eb(a,b):(c=eb(b,a),c.milliseconds=-c.milliseconds,c.months=-c.months),c):{milliseconds:0,months:0}}function gb(a){return 0>a?-1*Math.round(-1*a):Math.round(a)}function hb(a,b){return function(c,d){var e,f;return null===d||isNaN(+d)||(v(b,"moment()."+b+"(period, number) is deprecated. Please use moment()."+b+"(number, period)."),f=c,c=d,d=f),c="string"==typeof c?+c:c,e=cb(c,d),ib(this,e,a),this}}function ib(b,c,d,e){var f=c._milliseconds,g=gb(c._days),h=gb(c._months);b.isValid()&&(e=null==e?!0:e,f&&b._d.setTime(+b._d+f*d),g&&O(b,"Date",N(b,"Date")+g*d),h&&fa(b,N(b,"Month")+h*d),e&&a.updateOffset(b,g||h))}function jb(a,b){var c=a||Ja(),d=Ra(c,this).startOf("day"),e=this.diff(d,"days",!0),f=-6>e?"sameElse":-1>e?"lastWeek":0>e?"lastDay":1>e?"sameDay":2>e?"nextDay":7>e?"nextWeek":"sameElse",g=b&&(w(b[f])?b[f]():b[f]);return this.format(g||this.localeData().calendar(f,this,Ja(c)))}function kb(){return new o(this)}function lb(a,b){var c=p(a)?a:Ja(a);return this.isValid()&&c.isValid()?(b=K(m(b)?"millisecond":b),"millisecond"===b?+this>+c:+c<+this.clone().startOf(b)):!1}function mb(a,b){var c=p(a)?a:Ja(a);return this.isValid()&&c.isValid()?(b=K(m(b)?"millisecond":b),"millisecond"===b?+c>+this:+this.clone().endOf(b)<+c):!1}function nb(a,b,c){return this.isAfter(a,c)&&this.isBefore(b,c)}function ob(a,b){var c,d=p(a)?a:Ja(a);return this.isValid()&&d.isValid()?(b=K(b||"millisecond"),"millisecond"===b?+this===+d:(c=+d,+this.clone().startOf(b)<=c&&c<=+this.clone().endOf(b))):!1}function pb(a,b){return this.isSame(a,b)||this.isAfter(a,b)}function qb(a,b){return this.isSame(a,b)||this.isBefore(a,b)}function rb(a,b,c){var d,e,f,g;return this.isValid()?(d=Ra(a,this),d.isValid()?(e=6e4*(d.utcOffset()-this.utcOffset()),b=K(b),"year"===b||"month"===b||"quarter"===b?(g=sb(this,d),"quarter"===b?g/=3:"year"===b&&(g/=12)):(f=this-d,g="second"===b?f/1e3:"minute"===b?f/6e4:"hour"===b?f/36e5:"day"===b?(f-e)/864e5:"week"===b?(f-e)/6048e5:f),c?g:q(g)):NaN):NaN}function sb(a,b){var c,d,e=12*(b.year()-a.year())+(b.month()-a.month()),f=a.clone().add(e,"months");return 0>b-f?(c=a.clone().add(e-1,"months"),d=(b-f)/(f-c)):(c=a.clone().add(e+1,"months"),d=(b-f)/(c-f)),-(e+d)}function tb(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function ub(){var a=this.clone().utc();return 0f&&(b=f),Ub.call(this,a,b,c,d,e))}function Ub(a,b,c,d,e){var f=ua(a,b,c,d,e),g=pa(f.year,0,f.dayOfYear);return this.year(g.getUTCFullYear()),this.month(g.getUTCMonth()),this.date(g.getUTCDate()),this}function Vb(a){return null==a?Math.ceil((this.month()+1)/3):this.month(3*(a-1)+this.month()%3)}function Wb(a){return va(a,this._week.dow,this._week.doy).week}function Xb(){return this._week.dow}function Yb(){return this._week.doy}function Zb(a){var b=this.localeData().week(this);return null==a?b:this.add(7*(a-b),"d")}function $b(a){var b=va(this,1,4).week;return null==a?b:this.add(7*(a-b),"d")}function _b(a,b){return"string"!=typeof a?a:isNaN(a)?(a=b.weekdaysParse(a),"number"==typeof a?a:null):parseInt(a,10)}function ac(a,b){return c(this._weekdays)?this._weekdays[a.day()]:this._weekdays[this._weekdays.isFormat.test(b)?"format":"standalone"][a.day()]}function bc(a){return this._weekdaysShort[a.day()]}function cc(a){return this._weekdaysMin[a.day()]}function dc(a,b,c){var d,e,f;for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),d=0;7>d;d++){if(e=Ja([2e3,1]).day(d),c&&!this._fullWeekdaysParse[d]&&(this._fullWeekdaysParse[d]=new RegExp("^"+this.weekdays(e,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[d]=new RegExp("^"+this.weekdaysShort(e,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[d]=new RegExp("^"+this.weekdaysMin(e,"").replace(".",".?")+"$","i")),this._weekdaysParse[d]||(f="^"+this.weekdays(e,"")+"|^"+this.weekdaysShort(e,"")+"|^"+this.weekdaysMin(e,""),this._weekdaysParse[d]=new RegExp(f.replace(".",""),"i")),c&&"dddd"===b&&this._fullWeekdaysParse[d].test(a))return d;if(c&&"ddd"===b&&this._shortWeekdaysParse[d].test(a))return d;if(c&&"dd"===b&&this._minWeekdaysParse[d].test(a))return d;if(!c&&this._weekdaysParse[d].test(a))return d}}function ec(a){if(!this.isValid())return null!=a?this:NaN;var b=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=a?(a=_b(a,this.localeData()),this.add(a-b,"d")):b}function fc(a){if(!this.isValid())return null!=a?this:NaN;var b=(this.day()+7-this.localeData()._week.dow)%7;return null==a?b:this.add(a-b,"d")}function gc(a){return this.isValid()?null==a?this.day()||7:this.day(this.day()%7?a:a-7):null!=a?this:NaN}function hc(a){var b=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==a?b:this.add(a-b,"d")}function ic(){return this.hours()%12||12}function jc(a,b){R(a,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),b)})}function kc(a,b){return b._meridiemParse}function lc(a){return"p"===(a+"").toLowerCase().charAt(0)}function mc(a,b,c){return a>11?c?"pm":"PM":c?"am":"AM"}function nc(a,b){b[Hd]=r(1e3*("0."+a))}function oc(){return this._isUTC?"UTC":""}function pc(){return this._isUTC?"Coordinated Universal Time":""}function qc(a){return Ja(1e3*a)}function rc(){return Ja.apply(null,arguments).parseZone()}function sc(a,b,c){var d=this._calendar[a];return w(d)?d.call(b,c):d}function tc(a){var b=this._longDateFormat[a],c=this._longDateFormat[a.toUpperCase()];return b||!c?b:(this._longDateFormat[a]=c.replace(/MMMM|MM|DD|dddd/g,function(a){return a.slice(1)}),this._longDateFormat[a])}function uc(){return this._invalidDate}function vc(a){return this._ordinal.replace("%d",a)}function wc(a){return a}function xc(a,b,c,d){var e=this._relativeTime[c];return w(e)?e(a,b,c,d):e.replace(/%d/i,a)}function yc(a,b){var c=this._relativeTime[a>0?"future":"past"];return w(c)?c(b):c.replace(/%s/i,b)}function zc(a,b,c,d){var e=H(),f=h().set(d,b);return e[c](f,a)}function Ac(a,b,c,d,e){if("number"==typeof a&&(b=a,a=void 0),a=a||"",null!=b)return zc(a,b,c,e);var f,g=[];for(f=0;d>f;f++)g[f]=zc(a,f,c,e);return g}function Bc(a,b){return Ac(a,b,"months",12,"month")}function Cc(a,b){return Ac(a,b,"monthsShort",12,"month")}function Dc(a,b){return Ac(a,b,"weekdays",7,"day")}function Ec(a,b){return Ac(a,b,"weekdaysShort",7,"day")}function Fc(a,b){return Ac(a,b,"weekdaysMin",7,"day")}function Gc(){var a=this._data;return this._milliseconds=xe(this._milliseconds),this._days=xe(this._days),this._months=xe(this._months),a.milliseconds=xe(a.milliseconds),a.seconds=xe(a.seconds),a.minutes=xe(a.minutes),a.hours=xe(a.hours),a.months=xe(a.months),a.years=xe(a.years),this}function Hc(a,b,c,d){var e=cb(b,c);return a._milliseconds+=d*e._milliseconds,a._days+=d*e._days,a._months+=d*e._months,a._bubble()}function Ic(a,b){return Hc(this,a,b,1)}function Jc(a,b){return Hc(this,a,b,-1)}function Kc(a){return 0>a?Math.floor(a):Math.ceil(a)}function Lc(){var a,b,c,d,e,f=this._milliseconds,g=this._days,h=this._months,i=this._data;return f>=0&&g>=0&&h>=0||0>=f&&0>=g&&0>=h||(f+=864e5*Kc(Nc(h)+g),g=0,h=0),i.milliseconds=f%1e3,a=q(f/1e3),i.seconds=a%60,b=q(a/60),i.minutes=b%60,c=q(b/60),i.hours=c%24,g+=q(c/24),e=q(Mc(g)),h+=e,g-=Kc(Nc(e)),d=q(h/12),h%=12,i.days=g,i.months=h,i.years=d,this}function Mc(a){return 4800*a/146097}function Nc(a){return 146097*a/4800}function Oc(a){var b,c,d=this._milliseconds;if(a=K(a),"month"===a||"year"===a)return b=this._days+d/864e5,c=this._months+Mc(b),"month"===a?c:c/12;switch(b=this._days+Math.round(Nc(this._months)),a){case"week":return b/7+d/6048e5;case"day":return b+d/864e5;case"hour":return 24*b+d/36e5;case"minute":return 1440*b+d/6e4;case"second":return 86400*b+d/1e3;case"millisecond":return Math.floor(864e5*b)+d;default:throw new Error("Unknown unit "+a)}}function Pc(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*r(this._months/12)}function Qc(a){return function(){return this.as(a)}}function Rc(a){return a=K(a),this[a+"s"]()}function Sc(a){return function(){return this._data[a]}}function Tc(){return q(this.days()/7)}function Uc(a,b,c,d,e){return e.relativeTime(b||1,!!c,a,d)}function Vc(a,b,c){var d=cb(a).abs(),e=Ne(d.as("s")),f=Ne(d.as("m")),g=Ne(d.as("h")),h=Ne(d.as("d")),i=Ne(d.as("M")),j=Ne(d.as("y")),k=e=f&&["m"]||f=g&&["h"]||g=h&&["d"]||h=i&&["M"]||i=j&&["y"]||["yy",j];return k[2]=b,k[3]=+a>0,k[4]=c,Uc.apply(null,k)}function Wc(a,b){return void 0===Oe[a]?!1:void 0===b?Oe[a]:(Oe[a]=b,!0)}function Xc(a){var b=this.localeData(),c=Vc(this,!a,b);return a&&(c=b.pastFuture(+this,c)),b.postformat(c)}function Yc(){var a,b,c,d=Pe(this._milliseconds)/1e3,e=Pe(this._days),f=Pe(this._months);a=q(d/60),b=q(a/60),d%=60,a%=60,c=q(f/12),f%=12;var g=c,h=f,i=e,j=b,k=a,l=d,m=this.asSeconds();return m?(0>m?"-":"")+"P"+(g?g+"Y":"")+(h?h+"M":"")+(i?i+"D":"")+(j||k||l?"T":"")+(j?j+"H":"")+(k?k+"M":"")+(l?l+"S":""):"P0D"}var Zc,$c=a.momentProperties=[],_c=!1,ad={};a.suppressDeprecationWarnings=!1;var bd,cd={},dd={},ed=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,fd=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,gd={},hd={},id=/\d/,jd=/\d\d/,kd=/\d{3}/,ld=/\d{4}/,md=/[+-]?\d{6}/,nd=/\d\d?/,od=/\d\d\d\d?/,pd=/\d\d\d\d\d\d?/,qd=/\d{1,3}/,rd=/\d{1,4}/,sd=/[+-]?\d{1,6}/,td=/\d+/,ud=/[+-]?\d+/,vd=/Z|[+-]\d\d:?\d\d/gi,wd=/Z|[+-]\d\d(?::?\d\d)?/gi,xd=/[+-]?\d+(\.\d{1,3})?/,yd=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,zd={},Ad={},Bd=0,Cd=1,Dd=2,Ed=3,Fd=4,Gd=5,Hd=6,Id=7,Jd=8;R("M",["MM",2],"Mo",function(){return this.month()+1}),R("MMM",0,0,function(a){return this.localeData().monthsShort(this,a)}),R("MMMM",0,0,function(a){return this.localeData().months(this,a)}),J("month","M"),W("M",nd),W("MM",nd,jd),W("MMM",function(a,b){return b.monthsShortRegex(a)}),W("MMMM",function(a,b){return b.monthsRegex(a)}),$(["M","MM"],function(a,b){b[Cd]=r(a)-1}),$(["MMM","MMMM"],function(a,b,c,d){var e=c._locale.monthsParse(a,d,c._strict);null!=e?b[Cd]=e:j(c).invalidMonth=a});var Kd=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/,Ld="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Md="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Nd=yd,Od=yd,Pd=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,Qd=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,Rd=/Z|[+-]\d\d(?::?\d\d)?/,Sd=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],Td=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Ud=/^\/?Date\((\-?\d+)/i;a.createFromInputFallback=u("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(a){a._d=new Date(a._i+(a._useUTC?" UTC":""))}),R("Y",0,0,function(){var a=this.year();return 9999>=a?""+a:"+"+a}),R(0,["YY",2],0,function(){return this.year()%100}),R(0,["YYYY",4],0,"year"),R(0,["YYYYY",5],0,"year"),R(0,["YYYYYY",6,!0],0,"year"),J("year","y"),W("Y",ud),W("YY",nd,jd),W("YYYY",rd,ld),W("YYYYY",sd,md),W("YYYYYY",sd,md),$(["YYYYY","YYYYYY"],Bd),$("YYYY",function(b,c){c[Bd]=2===b.length?a.parseTwoDigitYear(b):r(b); +}),$("YY",function(b,c){c[Bd]=a.parseTwoDigitYear(b)}),$("Y",function(a,b){b[Bd]=parseInt(a,10)}),a.parseTwoDigitYear=function(a){return r(a)+(r(a)>68?1900:2e3)};var Vd=M("FullYear",!1);a.ISO_8601=function(){};var Wd=u("moment().min is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var a=Ja.apply(null,arguments);return this.isValid()&&a.isValid()?this>a?this:a:l()}),Xd=u("moment().max is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var a=Ja.apply(null,arguments);return this.isValid()&&a.isValid()?a>this?this:a:l()}),Yd=function(){return Date.now?Date.now():+new Date};Pa("Z",":"),Pa("ZZ",""),W("Z",wd),W("ZZ",wd),$(["Z","ZZ"],function(a,b,c){c._useUTC=!0,c._tzm=Qa(wd,a)});var Zd=/([\+\-]|\d\d)/gi;a.updateOffset=function(){};var $d=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?\d*)?$/,_d=/^(-)?P(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)W)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?$/;cb.fn=Na.prototype;var ae=hb(1,"add"),be=hb(-1,"subtract");a.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";var ce=u("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(a){return void 0===a?this.localeData():this.locale(a)});R(0,["gg",2],0,function(){return this.weekYear()%100}),R(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Ob("gggg","weekYear"),Ob("ggggg","weekYear"),Ob("GGGG","isoWeekYear"),Ob("GGGGG","isoWeekYear"),J("weekYear","gg"),J("isoWeekYear","GG"),W("G",ud),W("g",ud),W("GG",nd,jd),W("gg",nd,jd),W("GGGG",rd,ld),W("gggg",rd,ld),W("GGGGG",sd,md),W("ggggg",sd,md),_(["gggg","ggggg","GGGG","GGGGG"],function(a,b,c,d){b[d.substr(0,2)]=r(a)}),_(["gg","GG"],function(b,c,d,e){c[e]=a.parseTwoDigitYear(b)}),R("Q",0,"Qo","quarter"),J("quarter","Q"),W("Q",id),$("Q",function(a,b){b[Cd]=3*(r(a)-1)}),R("w",["ww",2],"wo","week"),R("W",["WW",2],"Wo","isoWeek"),J("week","w"),J("isoWeek","W"),W("w",nd),W("ww",nd,jd),W("W",nd),W("WW",nd,jd),_(["w","ww","W","WW"],function(a,b,c,d){b[d.substr(0,1)]=r(a)});var de={dow:0,doy:6};R("D",["DD",2],"Do","date"),J("date","D"),W("D",nd),W("DD",nd,jd),W("Do",function(a,b){return a?b._ordinalParse:b._ordinalParseLenient}),$(["D","DD"],Dd),$("Do",function(a,b){b[Dd]=r(a.match(nd)[0],10)});var ee=M("Date",!0);R("d",0,"do","day"),R("dd",0,0,function(a){return this.localeData().weekdaysMin(this,a)}),R("ddd",0,0,function(a){return this.localeData().weekdaysShort(this,a)}),R("dddd",0,0,function(a){return this.localeData().weekdays(this,a)}),R("e",0,0,"weekday"),R("E",0,0,"isoWeekday"),J("day","d"),J("weekday","e"),J("isoWeekday","E"),W("d",nd),W("e",nd),W("E",nd),W("dd",yd),W("ddd",yd),W("dddd",yd),_(["dd","ddd","dddd"],function(a,b,c,d){var e=c._locale.weekdaysParse(a,d,c._strict);null!=e?b.d=e:j(c).invalidWeekday=a}),_(["d","e","E"],function(a,b,c,d){b[d]=r(a)});var fe="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),ge="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),he="Su_Mo_Tu_We_Th_Fr_Sa".split("_");R("DDD",["DDDD",3],"DDDo","dayOfYear"),J("dayOfYear","DDD"),W("DDD",qd),W("DDDD",kd),$(["DDD","DDDD"],function(a,b,c){c._dayOfYear=r(a)}),R("H",["HH",2],0,"hour"),R("h",["hh",2],0,ic),R("hmm",0,0,function(){return""+ic.apply(this)+Q(this.minutes(),2)}),R("hmmss",0,0,function(){return""+ic.apply(this)+Q(this.minutes(),2)+Q(this.seconds(),2)}),R("Hmm",0,0,function(){return""+this.hours()+Q(this.minutes(),2)}),R("Hmmss",0,0,function(){return""+this.hours()+Q(this.minutes(),2)+Q(this.seconds(),2)}),jc("a",!0),jc("A",!1),J("hour","h"),W("a",kc),W("A",kc),W("H",nd),W("h",nd),W("HH",nd,jd),W("hh",nd,jd),W("hmm",od),W("hmmss",pd),W("Hmm",od),W("Hmmss",pd),$(["H","HH"],Ed),$(["a","A"],function(a,b,c){c._isPm=c._locale.isPM(a),c._meridiem=a}),$(["h","hh"],function(a,b,c){b[Ed]=r(a),j(c).bigHour=!0}),$("hmm",function(a,b,c){var d=a.length-2;b[Ed]=r(a.substr(0,d)),b[Fd]=r(a.substr(d)),j(c).bigHour=!0}),$("hmmss",function(a,b,c){var d=a.length-4,e=a.length-2;b[Ed]=r(a.substr(0,d)),b[Fd]=r(a.substr(d,2)),b[Gd]=r(a.substr(e)),j(c).bigHour=!0}),$("Hmm",function(a,b,c){var d=a.length-2;b[Ed]=r(a.substr(0,d)),b[Fd]=r(a.substr(d))}),$("Hmmss",function(a,b,c){var d=a.length-4,e=a.length-2;b[Ed]=r(a.substr(0,d)),b[Fd]=r(a.substr(d,2)),b[Gd]=r(a.substr(e))});var ie=/[ap]\.?m?\.?/i,je=M("Hours",!0);R("m",["mm",2],0,"minute"),J("minute","m"),W("m",nd),W("mm",nd,jd),$(["m","mm"],Fd);var ke=M("Minutes",!1);R("s",["ss",2],0,"second"),J("second","s"),W("s",nd),W("ss",nd,jd),$(["s","ss"],Gd);var le=M("Seconds",!1);R("S",0,0,function(){return~~(this.millisecond()/100)}),R(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),R(0,["SSS",3],0,"millisecond"),R(0,["SSSS",4],0,function(){return 10*this.millisecond()}),R(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),R(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),R(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),R(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),R(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),J("millisecond","ms"),W("S",qd,id),W("SS",qd,jd),W("SSS",qd,kd);var me;for(me="SSSS";me.length<=9;me+="S")W(me,td);for(me="S";me.length<=9;me+="S")$(me,nc);var ne=M("Milliseconds",!1);R("z",0,0,"zoneAbbr"),R("zz",0,0,"zoneName");var oe=o.prototype;oe.add=ae,oe.calendar=jb,oe.clone=kb,oe.diff=rb,oe.endOf=Db,oe.format=vb,oe.from=wb,oe.fromNow=xb,oe.to=yb,oe.toNow=zb,oe.get=P,oe.invalidAt=Mb,oe.isAfter=lb,oe.isBefore=mb,oe.isBetween=nb,oe.isSame=ob,oe.isSameOrAfter=pb,oe.isSameOrBefore=qb,oe.isValid=Kb,oe.lang=ce,oe.locale=Ab,oe.localeData=Bb,oe.max=Xd,oe.min=Wd,oe.parsingFlags=Lb,oe.set=P,oe.startOf=Cb,oe.subtract=be,oe.toArray=Hb,oe.toObject=Ib,oe.toDate=Gb,oe.toISOString=ub,oe.toJSON=Jb,oe.toString=tb,oe.unix=Fb,oe.valueOf=Eb,oe.creationData=Nb,oe.year=Vd,oe.isLeapYear=sa,oe.weekYear=Pb,oe.isoWeekYear=Qb,oe.quarter=oe.quarters=Vb,oe.month=ga,oe.daysInMonth=ha,oe.week=oe.weeks=Zb,oe.isoWeek=oe.isoWeeks=$b,oe.weeksInYear=Sb,oe.isoWeeksInYear=Rb,oe.date=ee,oe.day=oe.days=ec,oe.weekday=fc,oe.isoWeekday=gc,oe.dayOfYear=hc,oe.hour=oe.hours=je,oe.minute=oe.minutes=ke,oe.second=oe.seconds=le,oe.millisecond=oe.milliseconds=ne,oe.utcOffset=Ta,oe.utc=Va,oe.local=Wa,oe.parseZone=Xa,oe.hasAlignedHourOffset=Ya,oe.isDST=Za,oe.isDSTShifted=$a,oe.isLocal=_a,oe.isUtcOffset=ab,oe.isUtc=bb,oe.isUTC=bb,oe.zoneAbbr=oc,oe.zoneName=pc,oe.dates=u("dates accessor is deprecated. Use date instead.",ee),oe.months=u("months accessor is deprecated. Use month instead",ga),oe.years=u("years accessor is deprecated. Use year instead",Vd),oe.zone=u("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",Ua);var pe=oe,qe={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},re={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"},se="Invalid date",te="%d",ue=/\d{1,2}/,ve={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"},we=A.prototype;we._calendar=qe,we.calendar=sc,we._longDateFormat=re,we.longDateFormat=tc,we._invalidDate=se,we.invalidDate=uc,we._ordinal=te,we.ordinal=vc,we._ordinalParse=ue,we.preparse=wc,we.postformat=wc,we._relativeTime=ve,we.relativeTime=xc,we.pastFuture=yc,we.set=y,we.months=ca,we._months=Ld,we.monthsShort=da,we._monthsShort=Md,we.monthsParse=ea,we._monthsRegex=Od,we.monthsRegex=ja,we._monthsShortRegex=Nd,we.monthsShortRegex=ia,we.week=Wb,we._week=de,we.firstDayOfYear=Yb,we.firstDayOfWeek=Xb,we.weekdays=ac,we._weekdays=fe,we.weekdaysMin=cc,we._weekdaysMin=he,we.weekdaysShort=bc,we._weekdaysShort=ge,we.weekdaysParse=dc,we.isPM=lc,we._meridiemParse=ie,we.meridiem=mc,E("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(a){var b=a%10,c=1===r(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c}}),a.lang=u("moment.lang is deprecated. Use moment.locale instead.",E),a.langData=u("moment.langData is deprecated. Use moment.localeData instead.",H);var xe=Math.abs,ye=Qc("ms"),ze=Qc("s"),Ae=Qc("m"),Be=Qc("h"),Ce=Qc("d"),De=Qc("w"),Ee=Qc("M"),Fe=Qc("y"),Ge=Sc("milliseconds"),He=Sc("seconds"),Ie=Sc("minutes"),Je=Sc("hours"),Ke=Sc("days"),Le=Sc("months"),Me=Sc("years"),Ne=Math.round,Oe={s:45,m:45,h:22,d:26,M:11},Pe=Math.abs,Qe=Na.prototype;Qe.abs=Gc,Qe.add=Ic,Qe.subtract=Jc,Qe.as=Oc,Qe.asMilliseconds=ye,Qe.asSeconds=ze,Qe.asMinutes=Ae,Qe.asHours=Be,Qe.asDays=Ce,Qe.asWeeks=De,Qe.asMonths=Ee,Qe.asYears=Fe,Qe.valueOf=Pc,Qe._bubble=Lc,Qe.get=Rc,Qe.milliseconds=Ge,Qe.seconds=He,Qe.minutes=Ie,Qe.hours=Je,Qe.days=Ke,Qe.weeks=Tc,Qe.months=Le,Qe.years=Me,Qe.humanize=Xc,Qe.toISOString=Yc,Qe.toString=Yc,Qe.toJSON=Yc,Qe.locale=Ab,Qe.localeData=Bb,Qe.toIsoString=u("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Yc),Qe.lang=ce,R("X",0,0,"unix"),R("x",0,0,"valueOf"),W("x",ud),W("X",xd),$("X",function(a,b,c){c._d=new Date(1e3*parseFloat(a,10))}),$("x",function(a,b,c){c._d=new Date(r(a))}),a.version="2.12.0",b(Ja),a.fn=pe,a.min=La,a.max=Ma,a.now=Yd,a.utc=h,a.unix=qc,a.months=Bc,a.isDate=d,a.locale=E,a.invalid=l,a.duration=cb,a.isMoment=p,a.weekdays=Dc,a.parseZone=rc,a.localeData=H,a.isDuration=Oa,a.monthsShort=Cc,a.weekdaysMin=Fc,a.defineLocale=F,a.updateLocale=G,a.locales=I,a.weekdaysShort=Ec,a.normalizeUnits=K,a.relativeTimeThreshold=Wc,a.prototype=pe;var Re=a;return Re}); \ No newline at end of file diff --git a/bower_components/moment/min/tests.js b/bower_components/moment/min/tests.js index 7be8bc2..3f7e6d3 100644 --- a/bower_components/moment/min/tests.js +++ b/bower_components/moment/min/tests.js @@ -6,6 +6,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -49,6 +148,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('af'); @@ -251,67 +351,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); - assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); - assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); - assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); - assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); - assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); - assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); - assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); - assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); - assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); - assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52ste', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1ste', 'Jan 2 2012 should be week 1'); @@ -320,42 +359,6 @@ assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2de', 'Jan 15 2012 should be week 2'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -365,6 +368,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -408,6 +510,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('ar-ma'); @@ -610,65 +713,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2011, 11, 31]).week(), 1, 'Dec 31 2011 should be week 1'); - assert.equal(moment([2012, 0, 6]).week(), 1, 'Jan 6 2012 should be week 1'); - assert.equal(moment([2012, 0, 7]).week(), 2, 'Jan 7 2012 should be week 2'); - assert.equal(moment([2012, 0, 13]).week(), 2, 'Jan 13 2012 should be week 2'); - assert.equal(moment([2012, 0, 14]).week(), 3, 'Jan 14 2012 should be week 3'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2006, 11, 30]).week(), 1, 'Dec 30 2006 should be week 1'); - assert.equal(moment([2007, 0, 5]).week(), 1, 'Jan 5 2007 should be week 1'); - assert.equal(moment([2007, 0, 6]).week(), 2, 'Jan 6 2007 should be week 2'); - assert.equal(moment([2007, 0, 12]).week(), 2, 'Jan 12 2007 should be week 2'); - assert.equal(moment([2007, 0, 13]).week(), 3, 'Jan 13 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 29]).week(), 1, 'Dec 29 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 4]).week(), 1, 'Jan 4 2008 should be week 1'); - assert.equal(moment([2008, 0, 5]).week(), 2, 'Jan 5 2008 should be week 2'); - assert.equal(moment([2008, 0, 11]).week(), 2, 'Jan 11 2008 should be week 2'); - assert.equal(moment([2008, 0, 12]).week(), 3, 'Jan 12 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 28]).week(), 1, 'Dec 28 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 3]).week(), 1, 'Jan 3 2003 should be week 1'); - assert.equal(moment([2003, 0, 4]).week(), 2, 'Jan 4 2003 should be week 2'); - assert.equal(moment([2003, 0, 10]).week(), 2, 'Jan 10 2003 should be week 2'); - assert.equal(moment([2003, 0, 11]).week(), 3, 'Jan 11 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 27]).week(), 1, 'Dec 27 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 2]).week(), 1, 'Jan 2 2009 should be week 1'); - assert.equal(moment([2009, 0, 3]).week(), 2, 'Jan 3 2009 should be week 2'); - assert.equal(moment([2009, 0, 9]).week(), 2, 'Jan 9 2009 should be week 2'); - assert.equal(moment([2009, 0, 10]).week(), 3, 'Jan 10 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 26]).week(), 1, 'Dec 26 2009 should be week 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 2]).week(), 2, 'Jan 2 2010 should be week 2'); - assert.equal(moment([2010, 0, 8]).week(), 2, 'Jan 8 2010 should be week 2'); - assert.equal(moment([2010, 0, 9]).week(), 3, 'Jan 9 2010 should be week 3'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 7]).week(), 1, 'Jan 7 2011 should be week 1'); - assert.equal(moment([2011, 0, 8]).week(), 2, 'Jan 8 2011 should be week 2'); - assert.equal(moment([2011, 0, 14]).week(), 2, 'Jan 14 2011 should be week 2'); - assert.equal(moment([2011, 0, 15]).week(), 3, 'Jan 15 2011 should be week 3'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2011, 11, 31]).format('w ww wo'), '1 01 1', 'Dec 31 2011 should be week 1'); assert.equal(moment([2012, 0, 6]).format('w ww wo'), '1 01 1', 'Jan 6 2012 should be week 1'); @@ -677,42 +721,6 @@ assert.equal(moment([2012, 0, 14]).format('w ww wo'), '3 03 3', 'Jan 14 2012 should be week 3'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -722,6 +730,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -765,6 +872,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('ar-sa'); @@ -967,70 +1075,13 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2011, 11, 31]).week(), 1, 'Dec 31 2011 should be week 1'); - assert.equal(moment([2012, 0, 6]).week(), 1, 'Jan 6 2012 should be week 1'); - assert.equal(moment([2012, 0, 7]).week(), 2, 'Jan 7 2012 should be week 2'); - assert.equal(moment([2012, 0, 13]).week(), 2, 'Jan 13 2012 should be week 2'); - assert.equal(moment([2012, 0, 14]).week(), 3, 'Jan 14 2012 should be week 3'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2006, 11, 30]).week(), 1, 'Dec 30 2006 should be week 1'); - assert.equal(moment([2007, 0, 5]).week(), 1, 'Jan 5 2007 should be week 1'); - assert.equal(moment([2007, 0, 6]).week(), 2, 'Jan 6 2007 should be week 2'); - assert.equal(moment([2007, 0, 12]).week(), 2, 'Jan 12 2007 should be week 2'); - assert.equal(moment([2007, 0, 13]).week(), 3, 'Jan 13 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 29]).week(), 1, 'Dec 29 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 4]).week(), 1, 'Jan 4 2008 should be week 1'); - assert.equal(moment([2008, 0, 5]).week(), 2, 'Jan 5 2008 should be week 2'); - assert.equal(moment([2008, 0, 11]).week(), 2, 'Jan 11 2008 should be week 2'); - assert.equal(moment([2008, 0, 12]).week(), 3, 'Jan 12 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 28]).week(), 1, 'Dec 28 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 3]).week(), 1, 'Jan 3 2003 should be week 1'); - assert.equal(moment([2003, 0, 4]).week(), 2, 'Jan 4 2003 should be week 2'); - assert.equal(moment([2003, 0, 10]).week(), 2, 'Jan 10 2003 should be week 2'); - assert.equal(moment([2003, 0, 11]).week(), 3, 'Jan 11 2003 should be week 3'); - + test('weeks year starting wednesday custom', function (assert) { assert.equal(moment('2003 1 6', 'gggg w d').format('YYYY-MM-DD'), '٢٠٠٢-١٢-٢٨', 'Week 1 of 2003 should be Dec 28 2002'); assert.equal(moment('2003 1 0', 'gggg w e').format('YYYY-MM-DD'), '٢٠٠٢-١٢-٢٨', 'Week 1 of 2003 should be Dec 28 2002'); assert.equal(moment('2003 1 6', 'gggg w d').format('gggg w d'), '٢٠٠٣ ١ ٦', 'Saturday of week 1 of 2003 parsed should be formatted as 2003 1 6'); assert.equal(moment('2003 1 0', 'gggg w e').format('gggg w e'), '٢٠٠٣ ١ ٠', '1st day of week 1 of 2003 parsed should be formatted as 2003 1 0'); }); - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 27]).week(), 1, 'Dec 27 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 2]).week(), 1, 'Jan 2 2009 should be week 1'); - assert.equal(moment([2009, 0, 3]).week(), 2, 'Jan 3 2009 should be week 2'); - assert.equal(moment([2009, 0, 9]).week(), 2, 'Jan 9 2009 should be week 2'); - assert.equal(moment([2009, 0, 10]).week(), 3, 'Jan 10 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 26]).week(), 1, 'Dec 26 2009 should be week 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 2]).week(), 2, 'Jan 2 2010 should be week 2'); - assert.equal(moment([2010, 0, 8]).week(), 2, 'Jan 8 2010 should be week 2'); - assert.equal(moment([2010, 0, 9]).week(), 3, 'Jan 9 2010 should be week 3'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 7]).week(), 1, 'Jan 7 2011 should be week 1'); - assert.equal(moment([2011, 0, 8]).week(), 2, 'Jan 8 2011 should be week 2'); - assert.equal(moment([2011, 0, 14]).week(), 2, 'Jan 14 2011 should be week 2'); - assert.equal(moment([2011, 0, 15]).week(), 3, 'Jan 15 2011 should be week 3'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2011, 11, 31]).format('w ww wo'), '١ ٠١ ١', 'Dec 31 2011 should be week 1'); assert.equal(moment([2012, 0, 6]).format('w ww wo'), '١ ٠١ ١', 'Jan 6 2012 should be week 1'); @@ -1039,42 +1090,6 @@ assert.equal(moment([2012, 0, 14]).format('w ww wo'), '٣ ٠٣ ٣', 'Jan 14 2012 should be week 3'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -1084,6 +1099,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -1127,6 +1241,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('ar-tn'); @@ -1415,67 +1530,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); - assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); - assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); - assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); - assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); - assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); - assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); - assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); - assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); - assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); - assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1', 'Jan 2 2012 should be week 1'); @@ -1484,42 +1538,6 @@ assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2', 'Jan 15 2012 should be week 2'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -1529,6 +1547,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -1572,6 +1689,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('ar'); @@ -1789,70 +1907,13 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2011, 11, 31]).week(), 1, 'Dec 31 2011 should be week 1'); - assert.equal(moment([2012, 0, 6]).week(), 1, 'Jan 6 2012 should be week 1'); - assert.equal(moment([2012, 0, 7]).week(), 2, 'Jan 7 2012 should be week 2'); - assert.equal(moment([2012, 0, 13]).week(), 2, 'Jan 13 2012 should be week 2'); - assert.equal(moment([2012, 0, 14]).week(), 3, 'Jan 14 2012 should be week 3'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2006, 11, 30]).week(), 1, 'Dec 30 2006 should be week 1'); - assert.equal(moment([2007, 0, 5]).week(), 1, 'Jan 5 2007 should be week 1'); - assert.equal(moment([2007, 0, 6]).week(), 2, 'Jan 6 2007 should be week 2'); - assert.equal(moment([2007, 0, 12]).week(), 2, 'Jan 12 2007 should be week 2'); - assert.equal(moment([2007, 0, 13]).week(), 3, 'Jan 13 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 29]).week(), 1, 'Dec 29 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 4]).week(), 1, 'Jan 4 2008 should be week 1'); - assert.equal(moment([2008, 0, 5]).week(), 2, 'Jan 5 2008 should be week 2'); - assert.equal(moment([2008, 0, 11]).week(), 2, 'Jan 11 2008 should be week 2'); - assert.equal(moment([2008, 0, 12]).week(), 3, 'Jan 12 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 28]).week(), 1, 'Dec 28 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 3]).week(), 1, 'Jan 3 2003 should be week 1'); - assert.equal(moment([2003, 0, 4]).week(), 2, 'Jan 4 2003 should be week 2'); - assert.equal(moment([2003, 0, 10]).week(), 2, 'Jan 10 2003 should be week 2'); - assert.equal(moment([2003, 0, 11]).week(), 3, 'Jan 11 2003 should be week 3'); - + test('weeks year starting wednesday custom', function (assert) { assert.equal(moment('2003 1 6', 'gggg w d').format('YYYY-MM-DD'), '٢٠٠٢-١٢-٢٨', 'Week 1 of 2003 should be Dec 28 2002'); assert.equal(moment('2003 1 0', 'gggg w e').format('YYYY-MM-DD'), '٢٠٠٢-١٢-٢٨', 'Week 1 of 2003 should be Dec 28 2002'); assert.equal(moment('2003 1 6', 'gggg w d').format('gggg w d'), '٢٠٠٣ ١ ٦', 'Saturday of week 1 of 2003 parsed should be formatted as 2003 1 6'); assert.equal(moment('2003 1 0', 'gggg w e').format('gggg w e'), '٢٠٠٣ ١ ٠', '1st day of week 1 of 2003 parsed should be formatted as 2003 1 0'); }); - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 27]).week(), 1, 'Dec 27 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 2]).week(), 1, 'Jan 2 2009 should be week 1'); - assert.equal(moment([2009, 0, 3]).week(), 2, 'Jan 3 2009 should be week 2'); - assert.equal(moment([2009, 0, 9]).week(), 2, 'Jan 9 2009 should be week 2'); - assert.equal(moment([2009, 0, 10]).week(), 3, 'Jan 10 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 26]).week(), 1, 'Dec 26 2009 should be week 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 2]).week(), 2, 'Jan 2 2010 should be week 2'); - assert.equal(moment([2010, 0, 8]).week(), 2, 'Jan 8 2010 should be week 2'); - assert.equal(moment([2010, 0, 9]).week(), 3, 'Jan 9 2010 should be week 3'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 7]).week(), 1, 'Jan 7 2011 should be week 1'); - assert.equal(moment([2011, 0, 8]).week(), 2, 'Jan 8 2011 should be week 2'); - assert.equal(moment([2011, 0, 14]).week(), 2, 'Jan 14 2011 should be week 2'); - assert.equal(moment([2011, 0, 15]).week(), 3, 'Jan 15 2011 should be week 3'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2011, 11, 31]).format('w ww wo'), '١ ٠١ ١', 'Dec 31 2011 should be week 1'); assert.equal(moment([2012, 0, 6]).format('w ww wo'), '١ ٠١ ١', 'Jan 6 2012 should be week 1'); @@ -1861,42 +1922,6 @@ assert.equal(moment([2012, 0, 14]).format('w ww wo'), '٣ ٠٣ ٣', 'Jan 14 2012 should be week 3'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - test('no leading zeros in long date formats', function (assert) { var i, j, longDateStr, shortDateStr; for (i = 1; i <= 9; ++i) { @@ -1917,6 +1942,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -1960,6 +2084,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('az'); @@ -2172,67 +2297,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); - assert.equal(moment([2010, 0, 4]).week(), 2, 'Jan 4 2010 should be week 2'); - assert.equal(moment([2010, 0, 10]).week(), 2, 'Jan 10 2010 should be week 2'); - assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); - assert.equal(moment([2011, 0, 3]).week(), 2, 'Jan 3 2011 should be week 2'); - assert.equal(moment([2011, 0, 9]).week(), 2, 'Jan 9 2011 should be week 2'); - assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1-inci', 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1-inci', 'Jan 1 2012 should be week 1'); @@ -2241,42 +2305,6 @@ assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3-üncü', 'Jan 9 2012 should be week 3'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -2286,6 +2314,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -2329,6 +2456,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('be'); @@ -2586,67 +2714,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); - assert.equal(moment([2010, 0, 4]).week(), 2, 'Jan 4 2010 should be week 2'); - assert.equal(moment([2010, 0, 10]).week(), 2, 'Jan 10 2010 should be week 2'); - assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); - assert.equal(moment([2011, 0, 3]).week(), 2, 'Jan 3 2011 should be week 2'); - assert.equal(moment([2011, 0, 9]).week(), 2, 'Jan 9 2011 should be week 2'); - assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1-ы', 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1-ы', 'Jan 1 2012 should be week 1'); @@ -2655,42 +2722,6 @@ assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3-і', 'Jan 9 2012 should be week 3'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -2700,6 +2731,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -2743,6 +2873,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('bg'); @@ -2960,67 +3091,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); - assert.equal(moment([2010, 0, 4]).week(), 2, 'Jan 4 2010 should be week 2'); - assert.equal(moment([2010, 0, 10]).week(), 2, 'Jan 10 2010 should be week 2'); - assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); - assert.equal(moment([2011, 0, 3]).week(), 2, 'Jan 3 2011 should be week 2'); - assert.equal(moment([2011, 0, 9]).week(), 2, 'Jan 9 2011 should be week 2'); - assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1-ви', 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1-ви', 'Jan 1 2012 should be week 1'); @@ -3029,42 +3099,6 @@ assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3-ти', 'Jan 9 2012 should be week 3'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -3074,6 +3108,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -3117,6 +3250,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('bn'); @@ -3334,67 +3468,6 @@ assert.equal(moment([2011, 2, 23, 21, 20]).format('A'), 'রাত', 'night'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 7]).week(), 1, 'Jan 7 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 14]).week(), 2, 'Jan 14 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1'); - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 2, 'Jan 7 2007 should be week 2'); - assert.equal(moment([2007, 0, 13]).week(), 2, 'Jan 13 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 3, 'Jan 14 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 2, 'Jan 6 2008 should be week 2'); - assert.equal(moment([2008, 0, 12]).week(), 2, 'Jan 12 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 3, 'Jan 13 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 2, 'Jan 5 2003 should be week 2'); - assert.equal(moment([2003, 0, 11]).week(), 2, 'Jan 11 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 3, 'Jan 12 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 2, 'Jan 4 2009 should be week 2'); - assert.equal(moment([2009, 0, 10]).week(), 2, 'Jan 10 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 3, 'Jan 11 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 2]).week(), 1, 'Jan 2 2010 should be week 1'); - assert.equal(moment([2010, 0, 3]).week(), 2, 'Jan 3 2010 should be week 2'); - assert.equal(moment([2010, 0, 9]).week(), 2, 'Jan 9 2010 should be week 2'); - assert.equal(moment([2010, 0, 10]).week(), 3, 'Jan 10 2010 should be week 3'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1'); - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 2]).week(), 2, 'Jan 2 2011 should be week 2'); - assert.equal(moment([2011, 0, 8]).week(), 2, 'Jan 8 2011 should be week 2'); - assert.equal(moment([2011, 0, 9]).week(), 3, 'Jan 9 2011 should be week 3'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '১ ০১ ১', 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 7]).format('w ww wo'), '১ ০১ ১', 'Jan 7 2012 should be week 1'); @@ -3403,42 +3476,6 @@ assert.equal(moment([2012, 0, 15]).format('w ww wo'), '৩ ০৩ ৩', 'Jan 15 2012 should be week 3'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -3448,6 +3485,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -3491,6 +3627,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('bo'); @@ -3709,67 +3846,6 @@ assert.equal(moment([2011, 2, 23, 21, 20]).format('A'), 'མཚན་མོ', 'night'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 7]).week(), 1, 'Jan 7 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 14]).week(), 2, 'Jan 14 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1'); - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 2, 'Jan 7 2007 should be week 2'); - assert.equal(moment([2007, 0, 13]).week(), 2, 'Jan 13 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 3, 'Jan 14 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 2, 'Jan 6 2008 should be week 2'); - assert.equal(moment([2008, 0, 12]).week(), 2, 'Jan 12 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 3, 'Jan 13 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 2, 'Jan 5 2003 should be week 2'); - assert.equal(moment([2003, 0, 11]).week(), 2, 'Jan 11 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 3, 'Jan 12 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 2, 'Jan 4 2009 should be week 2'); - assert.equal(moment([2009, 0, 10]).week(), 2, 'Jan 10 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 3, 'Jan 11 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 2]).week(), 1, 'Jan 2 2010 should be week 1'); - assert.equal(moment([2010, 0, 3]).week(), 2, 'Jan 3 2010 should be week 2'); - assert.equal(moment([2010, 0, 9]).week(), 2, 'Jan 9 2010 should be week 2'); - assert.equal(moment([2010, 0, 10]).week(), 3, 'Jan 10 2010 should be week 3'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1'); - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 2]).week(), 2, 'Jan 2 2011 should be week 2'); - assert.equal(moment([2011, 0, 8]).week(), 2, 'Jan 8 2011 should be week 2'); - assert.equal(moment([2011, 0, 9]).week(), 3, 'Jan 9 2011 should be week 3'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '༡ ༠༡ ༡', 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 7]).format('w ww wo'), '༡ ༠༡ ༡', 'Jan 7 2012 should be week 1'); @@ -3778,42 +3854,6 @@ assert.equal(moment([2012, 0, 15]).format('w ww wo'), '༣ ༠༣ ༣', 'Jan 15 2012 should be week 3'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -3823,6 +3863,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -3866,6 +4005,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('br'); @@ -4093,42 +4233,6 @@ assert.equal(start.from(moment([2007, 1, 28]).add({y: 261}), true), '261 bloaz', 'mutation 261 years'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -4138,6 +4242,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -4181,6 +4384,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('bs'); @@ -4415,67 +4619,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); - assert.equal(moment([2010, 0, 4]).week(), 2, 'Jan 4 2010 should be week 2'); - assert.equal(moment([2010, 0, 10]).week(), 2, 'Jan 10 2010 should be week 2'); - assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); - assert.equal(moment([2011, 0, 3]).week(), 2, 'Jan 3 2011 should be week 2'); - assert.equal(moment([2011, 0, 9]).week(), 2, 'Jan 9 2011 should be week 2'); - assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1.', 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1.', 'Jan 1 2012 should be week 1'); @@ -4484,42 +4627,6 @@ assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3.', 'Jan 9 2012 should be week 3'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -4529,6 +4636,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -4572,6 +4778,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('ca'); @@ -4774,67 +4981,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); - assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); - assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); - assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); - assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); - assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); - assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); - assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); - assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); - assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); - assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52a', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1a', 'Jan 2 2012 should be week 1'); @@ -4843,42 +4989,6 @@ assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2a', 'Jan 15 2012 should be week 2'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -4888,6 +4998,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -4931,6 +5140,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('cs'); @@ -5230,67 +5440,6 @@ assert.equal(moment.duration(-1, 'minutes').humanize(true), 'před minutou', 'a minute ago'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); - assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); - assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); - assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); - assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); - assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); - assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); - assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); - assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); - assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); - assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52.', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1.', 'Jan 2 2012 should be week 1'); @@ -5299,42 +5448,6 @@ assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -5344,6 +5457,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -5387,6 +5599,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('cv'); @@ -5594,67 +5807,6 @@ // Monday is the first day of the week. // The week that contains Jan 1st is the first week of the year. - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); - assert.equal(moment([2010, 0, 4]).week(), 2, 'Jan 4 2010 should be week 2'); - assert.equal(moment([2010, 0, 10]).week(), 2, 'Jan 10 2010 should be week 2'); - assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); - assert.equal(moment([2011, 0, 3]).week(), 2, 'Jan 3 2011 should be week 2'); - assert.equal(moment([2011, 0, 9]).week(), 2, 'Jan 9 2011 should be week 2'); - assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1-мӗш', 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1-мӗш', 'Jan 1 2012 should be week 1'); @@ -5663,42 +5815,6 @@ assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3-мӗш', 'Jan 9 2012 should be week 3'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -5708,6 +5824,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -5751,6 +5966,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('cy'); @@ -5951,67 +6167,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); - assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); - assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); - assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); - assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); - assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); - assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); - assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); - assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); - assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); - assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52ain', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1af', 'Jan 2 2012 should be week 1'); @@ -6020,42 +6175,6 @@ assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2il', 'Jan 15 2012 should be week 2'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -6065,6 +6184,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -6108,6 +6326,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('da'); @@ -6260,67 +6479,6 @@ assert.equal(moment().add({d: 5}).fromNow(), 'om 5 dage', 'in 5 days'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); - assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); - assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); - assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); - assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); - assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); - assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); - assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); - assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); - assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); - assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52.', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1.', 'Jan 2 2012 should be week 1'); @@ -6329,42 +6487,6 @@ assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -6374,6 +6496,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -6417,6 +6638,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('de-at'); @@ -6615,67 +6837,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); - assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); - assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); - assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); - assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); - assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); - assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); - assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); - assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); - assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); - assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52.', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1.', 'Jan 2 2012 should be week 1'); @@ -6684,42 +6845,6 @@ assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -6729,6 +6854,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -6772,6 +6996,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('de'); @@ -6969,67 +7194,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); - assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); - assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); - assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); - assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); - assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); - assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); - assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); - assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); - assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); - assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52.', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1.', 'Jan 2 2012 should be week 1'); @@ -7038,42 +7202,6 @@ assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -7083,6 +7211,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -7126,6 +7353,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('dv'); @@ -7240,6 +7468,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -7283,6 +7610,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('el'); @@ -7535,69 +7863,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 7]).week(), 1, 'Jan 7 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 14]).week(), 2, 'Jan 14 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2006, 11, 31]).week(), 52, 'Dec 31 2006 should be week 52'); - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 13]).week(), 2, 'Jan 13 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 30]).week(), 52, 'Dec 30 2007 should be week 52'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 12]).week(), 2, 'Jan 12 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 29]).week(), 52, 'Dec 29 2002 should be week 52'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 11]).week(), 2, 'Jan 11 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 28]).week(), 52, 'Dec 28 2008 should be week 52'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 10]).week(), 2, 'Jan 10 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 27]).week(), 52, 'Dec 27 2009 should be week 52'); - assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); - assert.equal(moment([2010, 0, 2]).week(), 53, 'Jan 2 2010 should be week 53'); - assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 1'); - assert.equal(moment([2010, 0, 9]).week(), 1, 'Jan 9 2010 should be week 1'); - assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); - assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 26]).week(), 51, 'Dec 26 2010 should be week 51'); - assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); - assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); - assert.equal(moment([2011, 0, 8]).week(), 1, 'Jan 8 2011 should be week 1'); - assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); - assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); - }); - test('weeks year starting sunday format', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52η', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 7]).format('w ww wo'), '1 01 1η', 'Jan 7 2012 should be week 1'); @@ -7606,42 +7871,6 @@ assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2η', 'Jan 15 2012 should be week 2'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -7651,6 +7880,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -7694,6 +8022,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('en-au'); @@ -7896,67 +8225,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); - assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); - assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); - assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); - assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); - assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); - assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); - assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); - assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); - assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); - assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52nd', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1st', 'Jan 2 2012 should be week 1'); @@ -7965,33 +8233,6 @@ assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2nd', 'Jan 15 2012 should be week 2'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testStr; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testStr = moment(ordinalStr, 'YYYY MM Do').format('YYYY MM D'); - assert.equal(testStr, '2014 01 ' + i, 'lenient ordinal parsing ' + i); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testStr; - for (i = 1; i <= 31; ++i) { - testStr = moment('2014 01 ' + i, 'YYYY MM Do').format('YYYY MM D'); - assert.equal(testStr, '2014 01 ' + i, - 'lenient ordinal parsing of number ' + i); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MMM Do'); - testMoment = moment(ordinalStr, 'YYYY MMM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -8001,6 +8242,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -8044,6 +8384,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('en-ca'); @@ -8087,13 +8428,13 @@ ['[the] DDDo [day of the year]', 'the 45th day of the year'], ['L', '2010-02-14'], ['LTS', '3:25:50 PM'], - ['LL', '14 February, 2010'], - ['LLL', '14 February, 2010 3:25 PM'], - ['LLLL', 'Sunday, 14 February, 2010 3:25 PM'], + ['LL', 'February 14, 2010'], + ['LLL', 'February 14, 2010 3:25 PM'], + ['LLLL', 'Sunday, February 14, 2010 3:25 PM'], ['l', '2010-2-14'], - ['ll', '14 Feb, 2010'], - ['lll', '14 Feb, 2010 3:25 PM'], - ['llll', 'Sun, 14 Feb, 2010 3:25 PM'] + ['ll', 'Feb 14, 2010'], + ['lll', 'Feb 14, 2010 3:25 PM'], + ['llll', 'Sun, Feb 14, 2010 3:25 PM'] ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; @@ -8255,67 +8596,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 7]).week(), 1, 'Jan 7 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 14]).week(), 2, 'Jan 14 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1'); - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 2, 'Jan 7 2007 should be week 2'); - assert.equal(moment([2007, 0, 13]).week(), 2, 'Jan 13 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 3, 'Jan 14 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 2, 'Jan 6 2008 should be week 2'); - assert.equal(moment([2008, 0, 12]).week(), 2, 'Jan 12 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 3, 'Jan 13 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 2, 'Jan 5 2003 should be week 2'); - assert.equal(moment([2003, 0, 11]).week(), 2, 'Jan 11 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 3, 'Jan 12 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 2, 'Jan 4 2009 should be week 2'); - assert.equal(moment([2009, 0, 10]).week(), 2, 'Jan 10 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 3, 'Jan 11 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 2]).week(), 1, 'Jan 2 2010 should be week 1'); - assert.equal(moment([2010, 0, 3]).week(), 2, 'Jan 3 2010 should be week 2'); - assert.equal(moment([2010, 0, 9]).week(), 2, 'Jan 9 2010 should be week 2'); - assert.equal(moment([2010, 0, 10]).week(), 3, 'Jan 10 2010 should be week 3'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1'); - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 2]).week(), 2, 'Jan 2 2011 should be week 2'); - assert.equal(moment([2011, 0, 8]).week(), 2, 'Jan 8 2011 should be week 2'); - assert.equal(moment([2011, 0, 9]).week(), 3, 'Jan 9 2011 should be week 3'); - }); - test('weeks year starting sunday format', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1st', 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 7]).format('w ww wo'), '1 01 1st', 'Jan 7 2012 should be week 1'); @@ -8324,42 +8604,6 @@ assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3rd', 'Jan 15 2012 should be week 3'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -8369,6 +8613,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -8412,6 +8755,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('en-gb'); @@ -8614,67 +8958,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); - assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); - assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); - assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); - assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); - assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); - assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); - assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); - assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); - assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); - assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52nd', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1st', 'Jan 2 2012 should be week 1'); @@ -8683,42 +8966,6 @@ assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2nd', 'Jan 15 2012 should be week 2'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -8728,6 +8975,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -8771,6 +9117,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('en-ie'); @@ -8973,67 +9320,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); - assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); - assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); - assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); - assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); - assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); - assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); - assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); - assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); - assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); - assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52nd', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1st', 'Jan 2 2012 should be week 1'); @@ -9042,42 +9328,6 @@ assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2nd', 'Jan 15 2012 should be week 2'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -9087,6 +9337,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -9130,6 +9479,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('en-nz'); @@ -9332,67 +9682,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); - assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); - assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); - assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); - assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); - assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); - assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); - assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); - assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); - assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); - assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52nd', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1st', 'Jan 2 2012 should be week 1'); @@ -9401,33 +9690,6 @@ assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2nd', 'Jan 15 2012 should be week 2'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testStr; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testStr = moment(ordinalStr, 'YYYY MM Do').format('YYYY MM D'); - assert.equal(testStr, '2014 01 ' + i, 'lenient ordinal parsing ' + i); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testStr; - for (i = 1; i <= 31; ++i) { - testStr = moment('2014 01 ' + i, 'YYYY MM Do').format('YYYY MM D'); - assert.equal(testStr, '2014 01 ' + i, - 'lenient ordinal parsing of number ' + i); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MMM Do'); - testMoment = moment(ordinalStr, 'YYYY MMM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -9437,6 +9699,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -9480,6 +9841,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('en'); @@ -9692,67 +10054,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 7]).week(), 1, 'Jan 7 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 14]).week(), 2, 'Jan 14 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1'); - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 2, 'Jan 7 2007 should be week 2'); - assert.equal(moment([2007, 0, 13]).week(), 2, 'Jan 13 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 3, 'Jan 14 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 2, 'Jan 6 2008 should be week 2'); - assert.equal(moment([2008, 0, 12]).week(), 2, 'Jan 12 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 3, 'Jan 13 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 2, 'Jan 5 2003 should be week 2'); - assert.equal(moment([2003, 0, 11]).week(), 2, 'Jan 11 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 3, 'Jan 12 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 2, 'Jan 4 2009 should be week 2'); - assert.equal(moment([2009, 0, 10]).week(), 2, 'Jan 10 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 3, 'Jan 11 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 2]).week(), 1, 'Jan 2 2010 should be week 1'); - assert.equal(moment([2010, 0, 3]).week(), 2, 'Jan 3 2010 should be week 2'); - assert.equal(moment([2010, 0, 9]).week(), 2, 'Jan 9 2010 should be week 2'); - assert.equal(moment([2010, 0, 10]).week(), 3, 'Jan 10 2010 should be week 3'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1'); - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 2]).week(), 2, 'Jan 2 2011 should be week 2'); - assert.equal(moment([2011, 0, 8]).week(), 2, 'Jan 8 2011 should be week 2'); - assert.equal(moment([2011, 0, 9]).week(), 3, 'Jan 9 2011 should be week 3'); - }); - test('weeks year starting sunday format', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1st', 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 7]).format('w ww wo'), '1 01 1st', 'Jan 7 2012 should be week 1'); @@ -9761,20 +10062,6 @@ assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3rd', 'Jan 15 2012 should be week 3'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - test('weekdays strict parsing', function (assert) { var m = moment('2015-01-01T12', moment.ISO_8601, true), enLocale = moment.localeData('en'); @@ -9790,28 +10077,6 @@ } }); - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -9821,6 +10086,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -9864,6 +10228,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('eo'); @@ -10067,67 +10432,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); - assert.equal(moment([2010, 0, 4]).week(), 2, 'Jan 4 2010 should be week 2'); - assert.equal(moment([2010, 0, 10]).week(), 2, 'Jan 10 2010 should be week 2'); - assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); - assert.equal(moment([2011, 0, 3]).week(), 2, 'Jan 3 2011 should be week 2'); - assert.equal(moment([2011, 0, 9]).week(), 2, 'Jan 9 2011 should be week 2'); - assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1a', 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1a', 'Jan 1 2012 should be week 1'); @@ -10136,42 +10440,6 @@ assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3a', 'Jan 9 2012 should be week 3'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -10181,6 +10449,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -10224,6 +10591,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('es'); @@ -10429,67 +10797,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); - assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); - assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); - assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); - assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); - assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); - assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); - assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); - assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); - assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); - assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52º', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1º', 'Jan 2 2012 should be week 1'); @@ -10498,42 +10805,6 @@ assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2º', 'Jan 15 2012 should be week 2'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -10543,6 +10814,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -10586,6 +10956,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('et'); @@ -10811,67 +11182,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), '2 nädala pärast'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); - assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); - assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); - assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); - assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); - assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); - assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); - assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); - assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); - assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); - assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52.', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1.', 'Jan 2 2012 should be week 1'); @@ -10880,42 +11190,6 @@ assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -10925,6 +11199,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -10968,6 +11341,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('eu'); @@ -11169,67 +11543,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); - assert.equal(moment([2010, 0, 4]).week(), 2, 'Jan 4 2010 should be week 2'); - assert.equal(moment([2010, 0, 10]).week(), 2, 'Jan 10 2010 should be week 2'); - assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); - assert.equal(moment([2011, 0, 3]).week(), 2, 'Jan 3 2011 should be week 2'); - assert.equal(moment([2011, 0, 9]).week(), 2, 'Jan 9 2011 should be week 2'); - assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1.', 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1.', 'Jan 1 2012 should be week 1'); @@ -11238,42 +11551,6 @@ assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3.', 'Jan 9 2012 should be week 3'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -11283,6 +11560,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -11326,6 +11702,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('fa'); @@ -11520,65 +11897,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2011, 11, 31]).week(), 1, 'Dec 31 2011 should be week 1'); - assert.equal(moment([2012, 0, 6]).week(), 1, 'Jan 6 2012 should be week 1'); - assert.equal(moment([2012, 0, 7]).week(), 2, 'Jan 7 2012 should be week 2'); - assert.equal(moment([2012, 0, 13]).week(), 2, 'Jan 13 2012 should be week 2'); - assert.equal(moment([2012, 0, 14]).week(), 3, 'Jan 14 2012 should be week 3'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2006, 11, 30]).week(), 1, 'Dec 30 2006 should be week 1'); - assert.equal(moment([2007, 0, 5]).week(), 1, 'Jan 5 2007 should be week 1'); - assert.equal(moment([2007, 0, 6]).week(), 2, 'Jan 6 2007 should be week 2'); - assert.equal(moment([2007, 0, 12]).week(), 2, 'Jan 12 2007 should be week 2'); - assert.equal(moment([2007, 0, 13]).week(), 3, 'Jan 13 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 29]).week(), 1, 'Dec 29 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 4]).week(), 1, 'Jan 4 2008 should be week 1'); - assert.equal(moment([2008, 0, 5]).week(), 2, 'Jan 5 2008 should be week 2'); - assert.equal(moment([2008, 0, 11]).week(), 2, 'Jan 11 2008 should be week 2'); - assert.equal(moment([2008, 0, 12]).week(), 3, 'Jan 12 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 28]).week(), 1, 'Dec 28 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 3]).week(), 1, 'Jan 3 2003 should be week 1'); - assert.equal(moment([2003, 0, 4]).week(), 2, 'Jan 4 2003 should be week 2'); - assert.equal(moment([2003, 0, 10]).week(), 2, 'Jan 10 2003 should be week 2'); - assert.equal(moment([2003, 0, 11]).week(), 3, 'Jan 11 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 27]).week(), 1, 'Dec 27 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 2]).week(), 1, 'Jan 2 2009 should be week 1'); - assert.equal(moment([2009, 0, 3]).week(), 2, 'Jan 3 2009 should be week 2'); - assert.equal(moment([2009, 0, 9]).week(), 2, 'Jan 9 2009 should be week 2'); - assert.equal(moment([2009, 0, 10]).week(), 3, 'Jan 10 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 26]).week(), 1, 'Dec 26 2009 should be week 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 2]).week(), 2, 'Jan 2 2010 should be week 2'); - assert.equal(moment([2010, 0, 8]).week(), 2, 'Jan 8 2010 should be week 2'); - assert.equal(moment([2010, 0, 9]).week(), 3, 'Jan 9 2010 should be week 3'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 7]).week(), 1, 'Jan 7 2011 should be week 1'); - assert.equal(moment([2011, 0, 8]).week(), 2, 'Jan 8 2011 should be week 2'); - assert.equal(moment([2011, 0, 14]).week(), 2, 'Jan 14 2011 should be week 2'); - assert.equal(moment([2011, 0, 15]).week(), 3, 'Jan 15 2011 should be week 3'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2011, 11, 31]).format('w ww wo'), '۱ ۰۱ ۱م', 'Dec 31 2011 should be week 1'); assert.equal(moment([2012, 0, 6]).format('w ww wo'), '۱ ۰۱ ۱م', 'Jan 6 2012 should be week 1'); @@ -11587,42 +11905,6 @@ assert.equal(moment([2012, 0, 14]).format('w ww wo'), '۳ ۰۳ ۳م', 'Jan 14 2012 should be week 3'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -11632,6 +11914,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -11675,6 +12056,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('fi'); @@ -11877,67 +12259,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'kaden viikon päästä'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); - assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); - assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); - assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); - assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); - assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); - assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); - assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); - assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); - assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); - assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52.', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1.', 'Jan 2 2012 should be week 1'); @@ -11946,42 +12267,6 @@ assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -11991,6 +12276,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -12034,6 +12418,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('fo'); @@ -12186,67 +12571,6 @@ assert.equal(moment().add({d: 5}).fromNow(), 'um 5 dagar', 'in 5 days'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); - assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); - assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); - assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); - assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); - assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); - assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); - assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); - assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); - assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); - assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52.', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1.', 'Jan 2 2012 should be week 1'); @@ -12255,42 +12579,6 @@ assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -12300,6 +12588,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -12343,6 +12730,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('fr-ca'); @@ -12551,67 +12939,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 7]).week(), 1, 'Jan 7 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 14]).week(), 2, 'Jan 14 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1'); - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 2, 'Jan 7 2007 should be week 2'); - assert.equal(moment([2007, 0, 13]).week(), 2, 'Jan 13 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 3, 'Jan 14 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 2, 'Jan 6 2008 should be week 2'); - assert.equal(moment([2008, 0, 12]).week(), 2, 'Jan 12 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 3, 'Jan 13 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 2, 'Jan 5 2003 should be week 2'); - assert.equal(moment([2003, 0, 11]).week(), 2, 'Jan 11 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 3, 'Jan 12 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 2, 'Jan 4 2009 should be week 2'); - assert.equal(moment([2009, 0, 10]).week(), 2, 'Jan 10 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 3, 'Jan 11 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 2]).week(), 1, 'Jan 2 2010 should be week 1'); - assert.equal(moment([2010, 0, 3]).week(), 2, 'Jan 3 2010 should be week 2'); - assert.equal(moment([2010, 0, 9]).week(), 2, 'Jan 9 2010 should be week 2'); - assert.equal(moment([2010, 0, 10]).week(), 3, 'Jan 10 2010 should be week 3'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1'); - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 2]).week(), 2, 'Jan 2 2011 should be week 2'); - assert.equal(moment([2011, 0, 8]).week(), 2, 'Jan 8 2011 should be week 2'); - assert.equal(moment([2011, 0, 9]).week(), 3, 'Jan 9 2011 should be week 3'); - }); - test('weeks year starting sunday format', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1er', 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 7]).format('w ww wo'), '1 01 1er', 'Jan 7 2012 should be week 1'); @@ -12620,42 +12947,6 @@ assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3e', 'Jan 15 2012 should be week 3'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -12665,6 +12956,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -12708,6 +13098,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('fr-ch'); @@ -12916,67 +13307,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); - assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); - assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); - assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); - assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); - assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); - assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); - assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); - assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); - assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); - assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52e', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1er', 'Jan 2 2012 should be week 1'); @@ -12985,42 +13315,6 @@ assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2e', 'Jan 15 2012 should be week 2'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -13030,6 +13324,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -13073,6 +13466,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('fr'); @@ -13273,67 +13667,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); - assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); - assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); - assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); - assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); - assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); - assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); - assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); - assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); - assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); - assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1er', 'Jan 2 2012 should be week 1'); @@ -13342,42 +13675,6 @@ assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2', 'Jan 15 2012 should be week 2'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -13387,6 +13684,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -13430,6 +13826,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('fy'); @@ -13636,67 +14033,6 @@ assert.equal(moment([2012, 5, 23]).format('D MMM YYYY'), '23 jun. 2012', 'format month abbreviation not surrounded by dashes should include a dot'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); - assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); - assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); - assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); - assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); - assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); - assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); - assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); - assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); - assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); - assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52ste', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1ste', 'Jan 2 2012 should be week 1'); @@ -13705,42 +14041,6 @@ assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2de', 'Jan 15 2012 should be week 2'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -13750,6 +14050,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -13793,6 +14192,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('gd'); @@ -14007,67 +14407,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 52, 'Faoi 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).week(), 1, 'Faoi 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 1, 'Faoi 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).week(), 2, 'Faoi 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 2, 'Faoi 15 2012 should be week 2'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Faoi 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Faoi 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Faoi 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Faoi 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Faoi 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dùbh 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Faoi 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Faoi 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Faoi 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Faoi 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Faoi 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dùbh 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Faoi 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Faoi 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Faoi 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Faoi 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Faoi 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dùbh 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Faoi 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Faoi 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Faoi 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Faoi 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 13]).week(), 3, 'Faoi 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 53, 'Dùbh 28 2009 should be week 53'); - assert.equal(moment([2010, 0, 1]).week(), 53, 'Faoi 1 2010 should be week 53'); - assert.equal(moment([2010, 0, 3]).week(), 53, 'Faoi 3 2010 should be week 53'); - assert.equal(moment([2010, 0, 4]).week(), 1, 'Faoi 4 2010 should be week 1'); - assert.equal(moment([2010, 0, 10]).week(), 1, 'Faoi 10 2010 should be week 1'); - assert.equal(moment([2010, 0, 11]).week(), 2, 'Faoi 11 2010 should be week 2'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 52, 'Dùbh 27 2010 should be week 52'); - assert.equal(moment([2011, 0, 1]).week(), 52, 'Faoi 1 2011 should be week 52'); - assert.equal(moment([2011, 0, 2]).week(), 52, 'Faoi 2 2011 should be week 52'); - assert.equal(moment([2011, 0, 3]).week(), 1, 'Faoi 3 2011 should be week 1'); - assert.equal(moment([2011, 0, 9]).week(), 1, 'Faoi 9 2011 should be week 1'); - assert.equal(moment([2011, 0, 10]).week(), 2, 'Faoi 10 2011 should be week 2'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52na', 'Faoi 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1d', 'Faoi 2 2012 should be week 1'); @@ -14076,42 +14415,6 @@ assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2na', 'Faoi 15 2012 should be week 2'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -14121,6 +14424,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -14164,6 +14566,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('gl'); @@ -14374,67 +14777,6 @@ assert.equal(lastWeek.calendar(), lastWeek.format('[o] dddd [pasado a] LT'), '1 o\'clock bug'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); - assert.equal(moment([2010, 0, 4]).week(), 2, 'Jan 4 2010 should be week 2'); - assert.equal(moment([2010, 0, 10]).week(), 2, 'Jan 10 2010 should be week 2'); - assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); - assert.equal(moment([2011, 0, 3]).week(), 2, 'Jan 3 2011 should be week 2'); - assert.equal(moment([2011, 0, 9]).week(), 2, 'Jan 9 2011 should be week 2'); - assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1º', 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1º', 'Jan 1 2012 should be week 1'); @@ -14443,42 +14785,6 @@ assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3º', 'Jan 9 2012 should be week 3'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -14488,6 +14794,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -14531,6 +14936,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('he'); @@ -14555,8 +14961,8 @@ test('format', function (assert) { var a = [ - ['dddd, MMMM Do YYYY, h:mm:ss a', 'ראשון, פברואר 14 2010, 3:25:50 pm'], - ['ddd, hA', 'א׳, 3PM'], + ['dddd, MMMM Do YYYY, h:mm:ss a', 'ראשון, פברואר 14 2010, 3:25:50 אחה"צ'], + ['ddd, h A', 'א׳, 3 אחרי הצהריים'], ['M Mo MM MMMM MMM', '2 2 02 פברואר פבר׳'], ['YYYY YY', '2010 10'], ['D Do DD', '14 14 14'], @@ -14567,7 +14973,7 @@ ['H HH', '15 15'], ['m mm', '25 25'], ['s ss', '50 50'], - ['a A', 'pm PM'], + ['a A', 'אחה"צ אחרי הצהריים'], ['[the] DDDo [day of the year]', 'the 45 day of the year'], ['LTS', '15:25:50'], ['L', '14/02/2010'], @@ -14697,67 +15103,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 7]).week(), 1, 'Jan 7 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 14]).week(), 2, 'Jan 14 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1'); - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 2, 'Jan 7 2007 should be week 2'); - assert.equal(moment([2007, 0, 13]).week(), 2, 'Jan 13 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 3, 'Jan 14 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 2, 'Jan 6 2008 should be week 2'); - assert.equal(moment([2008, 0, 12]).week(), 2, 'Jan 12 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 3, 'Jan 13 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 2, 'Jan 5 2003 should be week 2'); - assert.equal(moment([2003, 0, 11]).week(), 2, 'Jan 11 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 3, 'Jan 12 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 2, 'Jan 4 2009 should be week 2'); - assert.equal(moment([2009, 0, 10]).week(), 2, 'Jan 10 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 3, 'Jan 11 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 2]).week(), 1, 'Jan 2 2010 should be week 1'); - assert.equal(moment([2010, 0, 3]).week(), 2, 'Jan 3 2010 should be week 2'); - assert.equal(moment([2010, 0, 9]).week(), 2, 'Jan 9 2010 should be week 2'); - assert.equal(moment([2010, 0, 10]).week(), 3, 'Jan 10 2010 should be week 3'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1'); - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 2]).week(), 2, 'Jan 2 2011 should be week 2'); - assert.equal(moment([2011, 0, 8]).week(), 2, 'Jan 8 2011 should be week 2'); - assert.equal(moment([2011, 0, 9]).week(), 3, 'Jan 9 2011 should be week 3'); - }); - test('weeks year starting sunday format', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1', 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 7]).format('w ww wo'), '1 01 1', 'Jan 7 2012 should be week 1'); @@ -14766,42 +15111,6 @@ assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3', 'Jan 15 2012 should be week 3'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -14811,6 +15120,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -14854,6 +15262,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('hi'); @@ -15055,7 +15464,7 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('meridiem invariant', function (assert) { + test('meridiem', function (assert) { assert.equal(moment([2011, 2, 23, 2, 30]).format('a'), 'रात', 'before dawn'); assert.equal(moment([2011, 2, 23, 9, 30]).format('a'), 'सुबह', 'morning'); assert.equal(moment([2011, 2, 23, 14, 30]).format('a'), 'दोपहर', 'during day'); @@ -15071,67 +15480,6 @@ assert.equal(moment([2011, 2, 23, 21, 20]).format('A'), 'रात', 'night'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 7]).week(), 1, 'Jan 7 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 14]).week(), 2, 'Jan 14 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1'); - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 2, 'Jan 7 2007 should be week 2'); - assert.equal(moment([2007, 0, 13]).week(), 2, 'Jan 13 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 3, 'Jan 14 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 2, 'Jan 6 2008 should be week 2'); - assert.equal(moment([2008, 0, 12]).week(), 2, 'Jan 12 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 3, 'Jan 13 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 2, 'Jan 5 2003 should be week 2'); - assert.equal(moment([2003, 0, 11]).week(), 2, 'Jan 11 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 3, 'Jan 12 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 2, 'Jan 4 2009 should be week 2'); - assert.equal(moment([2009, 0, 10]).week(), 2, 'Jan 10 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 3, 'Jan 11 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 2]).week(), 1, 'Jan 2 2010 should be week 1'); - assert.equal(moment([2010, 0, 3]).week(), 2, 'Jan 3 2010 should be week 2'); - assert.equal(moment([2010, 0, 9]).week(), 2, 'Jan 9 2010 should be week 2'); - assert.equal(moment([2010, 0, 10]).week(), 3, 'Jan 10 2010 should be week 3'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1'); - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 2]).week(), 2, 'Jan 2 2011 should be week 2'); - assert.equal(moment([2011, 0, 8]).week(), 2, 'Jan 8 2011 should be week 2'); - assert.equal(moment([2011, 0, 9]).week(), 3, 'Jan 9 2011 should be week 3'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '१ ०१ १', 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 7]).format('w ww wo'), '१ ०१ १', 'Jan 7 2012 should be week 1'); @@ -15140,62 +15488,113 @@ assert.equal(moment([2012, 0, 15]).format('w ww wo'), '३ ०३ ३', 'Jan 15 2012 should be week 3'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); +})); - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : + typeof define === 'function' && define.amd ? define(['../../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); } - }); + } - test('meridiem', function (assert) { - var h, m, t1, t2; - for (h = 0; h < 24; ++h) { - for (m = 0; m < 60; m += 15) { - t1 = moment.utc([2000, 0, 1, h, m]); - t2 = moment(t1.format('A h:mm'), 'A h:mm'); - assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), - 'meridiem at ' + t1.format('HH:mm')); + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } } + return res; } - }); + } - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../../moment')) : - typeof define === 'function' && define.amd ? define(['../../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } /*global QUnit:false*/ @@ -15240,6 +15639,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('hr'); @@ -15474,67 +15874,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); - assert.equal(moment([2010, 0, 4]).week(), 2, 'Jan 4 2010 should be week 2'); - assert.equal(moment([2010, 0, 10]).week(), 2, 'Jan 10 2010 should be week 2'); - assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); - assert.equal(moment([2011, 0, 3]).week(), 2, 'Jan 3 2011 should be week 2'); - assert.equal(moment([2011, 0, 9]).week(), 2, 'Jan 9 2011 should be week 2'); - assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1.', 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1.', 'Jan 1 2012 should be week 1'); @@ -15543,42 +15882,6 @@ assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3.', 'Jan 9 2012 should be week 3'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -15588,6 +15891,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -15631,6 +16033,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('hu'); @@ -15846,67 +16249,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), '2 hét múlva'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); - assert.equal(moment([2010, 0, 4]).week(), 2, 'Jan 4 2010 should be week 2'); - assert.equal(moment([2010, 0, 10]).week(), 2, 'Jan 10 2010 should be week 2'); - assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); - assert.equal(moment([2011, 0, 3]).week(), 2, 'Jan 3 2011 should be week 2'); - assert.equal(moment([2011, 0, 9]).week(), 2, 'Jan 9 2011 should be week 2'); - assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1.', 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1.', 'Jan 1 2012 should be week 1'); @@ -15915,42 +16257,6 @@ assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3.', 'Jan 9 2012 should be week 3'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -15960,6 +16266,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -16003,6 +16408,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('hy-am'); @@ -16274,67 +16680,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); - assert.equal(moment([2010, 0, 4]).week(), 2, 'Jan 4 2010 should be week 2'); - assert.equal(moment([2010, 0, 10]).week(), 2, 'Jan 10 2010 should be week 2'); - assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); - assert.equal(moment([2011, 0, 3]).week(), 2, 'Jan 3 2011 should be week 2'); - assert.equal(moment([2011, 0, 9]).week(), 2, 'Jan 9 2011 should be week 2'); - assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1-ին', 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1-ին', 'Jan 1 2012 should be week 1'); @@ -16343,42 +16688,6 @@ assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3-րդ', 'Jan 9 2012 should be week 3'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -16388,6 +16697,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -16431,6 +16839,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('id'); @@ -16595,67 +17004,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); - assert.equal(moment([2010, 0, 4]).week(), 2, 'Jan 4 2010 should be week 2'); - assert.equal(moment([2010, 0, 10]).week(), 2, 'Jan 10 2010 should be week 2'); - assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); - assert.equal(moment([2011, 0, 3]).week(), 2, 'Jan 3 2011 should be week 2'); - assert.equal(moment([2011, 0, 9]).week(), 2, 'Jan 9 2011 should be week 2'); - assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1', 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1', 'Jan 1 2012 should be week 1'); @@ -16664,62 +17012,113 @@ assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3', 'Jan 9 2012 should be week 3'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); +})); - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : + typeof define === 'function' && define.amd ? define(['../../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); } - }); + } - test('meridiem invariant', function (assert) { - var h, m, t1, t2; - for (h = 0; h < 24; ++h) { - for (m = 0; m < 60; m += 15) { - t1 = moment.utc([2000, 0, 1, h, m]); - t2 = moment(t1.format('A h:mm'), 'A h:mm'); - assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), - 'meridiem at ' + t1.format('HH:mm')); + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } } + return res; } - }); + } - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../../moment')) : - typeof define === 'function' && define.amd ? define(['../../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } /*global QUnit:false*/ @@ -16764,6 +17163,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('is'); @@ -16803,11 +17203,11 @@ ['a A', 'pm PM'], ['[the] DDDo [day of the year]', 'the 45. day of the year'], ['LTS', '15:25:50'], - ['L', '14/02/2010'], + ['L', '14.02.2010'], ['LL', '14. febrúar 2010'], ['LLL', '14. febrúar 2010 kl. 15:25'], ['LLLL', 'sunnudagur, 14. febrúar 2010 kl. 15:25'], - ['l', '14/2/2010'], + ['l', '14.2.2010'], ['ll', '14. feb 2010'], ['lll', '14. feb 2010 kl. 15:25'], ['llll', 'sun, 14. feb 2010 kl. 15:25'] @@ -16972,67 +17372,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); - assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); - assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); - assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); - assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); - assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); - assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); - assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); - assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); - assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); - assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52.', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1.', 'Jan 2 2012 should be week 1'); @@ -17041,42 +17380,6 @@ assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -17086,6 +17389,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -17129,6 +17531,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('it'); @@ -17329,67 +17732,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); - assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); - assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); - assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); - assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); - assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); - assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); - assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); - assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); - assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); - assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52º', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1º', 'Jan 2 2012 should be week 1'); @@ -17398,42 +17740,6 @@ assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2º', 'Jan 15 2012 should be week 2'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -17443,6 +17749,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -17486,6 +17891,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('ja'); @@ -17510,20 +17916,20 @@ test('format', function (assert) { var a = [ - ['dddd, MMMM Do YYYY, a h:mm:ss', '日曜日, 2月 14 2010, 午後 3:25:50'], + ['dddd, MMMM Do YYYY, a h:mm:ss', '日曜日, 2月 14日 2010, 午後 3:25:50'], ['ddd, Ah', '日, 午後3'], ['M Mo MM MMMM MMM', '2 2 02 2月 2月'], ['YYYY YY', '2010 10'], - ['D Do DD', '14 14 14'], - ['d do dddd ddd dd', '0 0 日曜日 日 日'], - ['DDD DDDo DDDD', '45 45 045'], + ['D Do DD', '14 14日 14'], + ['d do dddd ddd dd', '0 0日 日曜日 日 日'], + ['DDD DDDo DDDD', '45 45日 045'], ['w wo ww', '8 8 08'], ['h hh', '3 03'], ['H HH', '15 15'], ['m mm', '25 25'], ['s ss', '50 50'], ['a A', '午後 午後'], - ['[the] DDDo [day of the year]', 'the 45 day of the year'], + ['[the] DDDo [day of the year]', 'the 45日 day of the year'], ['LTS', '午後3時25分50秒'], ['L', '2010/02/14'], ['LL', '2010年2月14日'], @@ -17650,67 +18056,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 7]).week(), 1, 'Jan 7 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 14]).week(), 2, 'Jan 14 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1'); - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 2, 'Jan 7 2007 should be week 2'); - assert.equal(moment([2007, 0, 13]).week(), 2, 'Jan 13 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 3, 'Jan 14 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 2, 'Jan 6 2008 should be week 2'); - assert.equal(moment([2008, 0, 12]).week(), 2, 'Jan 12 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 3, 'Jan 13 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 2, 'Jan 5 2003 should be week 2'); - assert.equal(moment([2003, 0, 11]).week(), 2, 'Jan 11 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 3, 'Jan 12 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 2, 'Jan 4 2009 should be week 2'); - assert.equal(moment([2009, 0, 10]).week(), 2, 'Jan 10 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 3, 'Jan 11 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 2]).week(), 1, 'Jan 2 2010 should be week 1'); - assert.equal(moment([2010, 0, 3]).week(), 2, 'Jan 3 2010 should be week 2'); - assert.equal(moment([2010, 0, 9]).week(), 2, 'Jan 9 2010 should be week 2'); - assert.equal(moment([2010, 0, 10]).week(), 3, 'Jan 10 2010 should be week 3'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1'); - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 2]).week(), 2, 'Jan 2 2011 should be week 2'); - assert.equal(moment([2011, 0, 8]).week(), 2, 'Jan 8 2011 should be week 2'); - assert.equal(moment([2011, 0, 9]).week(), 3, 'Jan 9 2011 should be week 3'); - }); - test('weeks year starting sunday format', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1', 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 7]).format('w ww wo'), '1 01 1', 'Jan 7 2012 should be week 1'); @@ -17719,42 +18064,6 @@ assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3', 'Jan 15 2012 should be week 3'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -17764,6 +18073,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -17807,11 +18215,11 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('jv'); - test('parse', function (assert) { var tests = 'Januari Jan_Februari Feb_Maret Mar_April Apr_Mei Mei_Juni Jun_Juli Jul_Agustus Ags_September Sep_Oktober Okt_Nopember Nop_Desember Des'.split('_'), i; function equalTest(input, mmm, i) { @@ -17975,67 +18383,6 @@ // Monday is the first day of the week. // The week that contains Jan 1st is the first week of the year. - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); - assert.equal(moment([2010, 0, 4]).week(), 2, 'Jan 4 2010 should be week 2'); - assert.equal(moment([2010, 0, 10]).week(), 2, 'Jan 10 2010 should be week 2'); - assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); - assert.equal(moment([2011, 0, 3]).week(), 2, 'Jan 3 2011 should be week 2'); - assert.equal(moment([2011, 0, 9]).week(), 2, 'Jan 9 2011 should be week 2'); - assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1', 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1', 'Jan 1 2012 should be week 1'); @@ -18044,62 +18391,113 @@ assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3', 'Jan 9 2012 should be week 3'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); +})); - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : + typeof define === 'function' && define.amd ? define(['../../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); } - }); + } - test('meridiem invariant', function (assert) { - var h, m, t1, t2; - for (h = 0; h < 24; ++h) { - for (m = 0; m < 60; m += 15) { - t1 = moment.utc([2000, 0, 1, h, m]); - t2 = moment(t1.format('A h:mm'), 'A h:mm'); - assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), - 'meridiem at ' + t1.format('HH:mm')); + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } } + return res; } - }); + } - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../../moment')) : - typeof define === 'function' && define.amd ? define(['../../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } /*global QUnit:false*/ @@ -18144,6 +18542,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('ka'); @@ -18358,67 +18757,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), '2 კვირაში'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2011, 11, 26]).week(), 1, 'დეკ 26 2011 უნდა იყოს კვირა 1'); - assert.equal(moment([2012, 0, 1]).week(), 1, 'იან 1 2012 უნდა იყოს კვირა 1'); - assert.equal(moment([2012, 0, 2]).week(), 2, 'იან 2 2012 უნდა იყოს კვირა 2'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'იან 8 2012 უნდა იყოს კვირა 2'); - assert.equal(moment([2012, 0, 9]).week(), 3, 'იან 9 2012 უნდა იყოს კვირა 3'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'იან 1 2007 უნდა იყოს კვირა 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'იან 7 2007 უნდა იყოს კვირა 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'იან 8 2007 უნდა იყოს კვირა 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'იან 14 2007 უნდა იყოს კვირა 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'იან 15 2007 უნდა იყოს კვირა 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'დეკ 31 2007 უნდა იყოს კვირა 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'იან 1 2008 უნდა იყოს კვირა 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'იან 6 2008 უნდა იყოს კვირა 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'იან 7 2008 უნდა იყოს კვირა 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'იან 13 2008 უნდა იყოს კვირა 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'იან 14 2008 უნდა იყოს კვირა 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'დეკ 30 2002 უნდა იყოს კვირა 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'იან 1 2003 უნდა იყოს კვირა 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'იან 5 2003 უნდა იყოს კვირა 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'იან 6 2003 უნდა იყოს კვირა 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'იან 12 2003 უნდა იყოს კვირა 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'იან 13 2003 უნდა იყოს კვირა 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'დეკ 29 2008 უნდა იყოს კვირა 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'იან 1 2009 უნდა იყოს კვირა 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'იან 4 2009 უნდა იყოს კვირა 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'იან 5 2009 უნდა იყოს კვირა 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'იან 11 2009 უნდა იყოს კვირა 2'); - assert.equal(moment([2009, 0, 12]).week(), 3, 'იან 12 2009 უნდა იყოს კვირა 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 1, 'დეკ 28 2009 უნდა იყოს კვირა 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'იან 1 2010 უნდა იყოს კვირა 1'); - assert.equal(moment([2010, 0, 3]).week(), 1, 'იან 3 2010 უნდა იყოს კვირა 1'); - assert.equal(moment([2010, 0, 4]).week(), 2, 'იან 4 2010 უნდა იყოს კვირა 2'); - assert.equal(moment([2010, 0, 10]).week(), 2, 'იან 10 2010 უნდა იყოს კვირა 2'); - assert.equal(moment([2010, 0, 11]).week(), 3, 'იან 11 2010 უნდა იყოს კვირა 3'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 1, 'დეკ 27 2010 უნდა იყოს კვირა 1'); - assert.equal(moment([2011, 0, 1]).week(), 1, 'იან 1 2011 უნდა იყოს კვირა 1'); - assert.equal(moment([2011, 0, 2]).week(), 1, 'იან 2 2011 უნდა იყოს კვირა 1'); - assert.equal(moment([2011, 0, 3]).week(), 2, 'იან 3 2011 უნდა იყოს კვირა 2'); - assert.equal(moment([2011, 0, 9]).week(), 2, 'იან 9 2011 უნდა იყოს კვირა 2'); - assert.equal(moment([2011, 0, 10]).week(), 3, 'იან 10 2011 უნდა იყოს კვირა 3'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1-ლი', 'დეკ 26 2011 უნდა იყოს კვირა 1'); assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1-ლი', 'იან 1 2012 უნდა იყოს კვირა 1'); @@ -18427,42 +18765,6 @@ assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 მე-3', 'იან 9 2012 უნდა იყოს კვირა 3'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -18472,19 +18774,118 @@ factory(global.moment) }(this, function (moment) { 'use strict'; - /*global QUnit:false*/ + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } - var test = QUnit.test; + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } - var expect = QUnit.expect; + // 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 module (name, lifecycle) { - QUnit.module(name, { - setup : function () { - moment.locale('en'); - moment.createFromInputFallback = function (config) { - throw new Error('input not handled by moment: ' + config._i); - }; + function defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + + /*global QUnit:false*/ + + var test = QUnit.test; + + var expect = QUnit.expect; + + function module (name, lifecycle) { + QUnit.module(name, { + setup : function () { + moment.locale('en'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); + }; if (lifecycle && lifecycle.setup) { lifecycle.setup(); } @@ -18515,6 +18916,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('kk'); @@ -18717,67 +19119,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2011, 11, 25]).week(), 52, 'Dec 25 2011 should be week 52'); - assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); - assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); - assert.equal(moment([2010, 0, 4]).week(), 2, 'Jan 4 2010 should be week 2'); - assert.equal(moment([2010, 0, 10]).week(), 2, 'Jan 10 2010 should be week 2'); - assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); - assert.equal(moment([2011, 0, 3]).week(), 2, 'Jan 3 2011 should be week 2'); - assert.equal(moment([2011, 0, 9]).week(), 2, 'Jan 9 2011 should be week 2'); - assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1-ші', 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '2 02 2-ші', 'Jan 2 2012 should be week 2'); @@ -18786,42 +19127,6 @@ assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3-ші', 'Jan 15 2012 should be week 3'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -18831,6 +19136,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -18874,6 +19278,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('km'); @@ -19106,67 +19511,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); - assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); - assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); - assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); - assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); - assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); - assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); - assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); - assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); - assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); - assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1', 'Jan 2 2012 should be week 1'); @@ -19175,42 +19519,6 @@ assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2', 'Jan 15 2012 should be week 2'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -19220,6 +19528,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -19263,6 +19670,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('ko'); @@ -19308,7 +19716,6 @@ expected : '16' }], i, l, it, actual; - for (i = 0, l = elements.length; i < l; ++i) { it = elements[i]; actual = moment(it.expression, it.inputFormat).format(it.outputFormat); @@ -19500,67 +19907,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 7]).week(), 1, 'Jan 7 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 14]).week(), 2, 'Jan 14 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1'); - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 2, 'Jan 7 2007 should be week 2'); - assert.equal(moment([2007, 0, 13]).week(), 2, 'Jan 13 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 3, 'Jan 14 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 2, 'Jan 6 2008 should be week 2'); - assert.equal(moment([2008, 0, 12]).week(), 2, 'Jan 12 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 3, 'Jan 13 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 2, 'Jan 5 2003 should be week 2'); - assert.equal(moment([2003, 0, 11]).week(), 2, 'Jan 11 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 3, 'Jan 12 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 2, 'Jan 4 2009 should be week 2'); - assert.equal(moment([2009, 0, 10]).week(), 2, 'Jan 10 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 3, 'Jan 11 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 2]).week(), 1, 'Jan 2 2010 should be week 1'); - assert.equal(moment([2010, 0, 3]).week(), 2, 'Jan 3 2010 should be week 2'); - assert.equal(moment([2010, 0, 9]).week(), 2, 'Jan 9 2010 should be week 2'); - assert.equal(moment([2010, 0, 10]).week(), 3, 'Jan 10 2010 should be week 3'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1'); - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 2]).week(), 2, 'Jan 2 2011 should be week 2'); - assert.equal(moment([2011, 0, 8]).week(), 2, 'Jan 8 2011 should be week 2'); - assert.equal(moment([2011, 0, 9]).week(), 3, 'Jan 9 2011 should be week 3'); - }); - test('weeks year starting sunday format', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1일', 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 7]).format('w ww wo'), '1 01 1일', 'Jan 7 2012 should be week 1'); @@ -19569,42 +19915,6 @@ assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3일', 'Jan 15 2012 should be week 3'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -19614,6 +19924,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -19657,6 +20066,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('lb'); @@ -19798,42 +20208,6 @@ } }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -19843,6 +20217,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -19886,6 +20359,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('lo'); @@ -20088,67 +20562,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 7]).week(), 1, 'Jan 7 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 14]).week(), 2, 'Jan 14 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1'); - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 2, 'Jan 7 2007 should be week 2'); - assert.equal(moment([2007, 0, 13]).week(), 2, 'Jan 13 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 3, 'Jan 14 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 2, 'Jan 6 2008 should be week 2'); - assert.equal(moment([2008, 0, 12]).week(), 2, 'Jan 12 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 3, 'Jan 13 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 2, 'Jan 5 2003 should be week 2'); - assert.equal(moment([2003, 0, 11]).week(), 2, 'Jan 11 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 3, 'Jan 12 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 2, 'Jan 4 2009 should be week 2'); - assert.equal(moment([2009, 0, 10]).week(), 2, 'Jan 10 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 3, 'Jan 11 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 2]).week(), 1, 'Jan 2 2010 should be week 1'); - assert.equal(moment([2010, 0, 3]).week(), 2, 'Jan 3 2010 should be week 2'); - assert.equal(moment([2010, 0, 9]).week(), 2, 'Jan 9 2010 should be week 2'); - assert.equal(moment([2010, 0, 10]).week(), 3, 'Jan 10 2010 should be week 3'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1'); - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 2]).week(), 2, 'Jan 2 2011 should be week 2'); - assert.equal(moment([2011, 0, 8]).week(), 2, 'Jan 8 2011 should be week 2'); - assert.equal(moment([2011, 0, 9]).week(), 3, 'Jan 9 2011 should be week 3'); - }); - test('weeks year starting sunday format', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 ທີ່1', 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 7]).format('w ww wo'), '1 01 ທີ່1', 'Jan 7 2012 should be week 1'); @@ -20157,42 +20570,6 @@ assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 ທີ່3', 'Jan 15 2012 should be week 3'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -20202,6 +20579,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -20245,6 +20721,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('lt'); @@ -20463,67 +20940,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); - assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); - assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); - assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); - assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); - assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); - assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); - assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); - assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); - assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); - assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52-oji', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1-oji', 'Jan 2 2012 should be week 1'); @@ -20532,42 +20948,6 @@ assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2-oji', 'Jan 15 2012 should be week 2'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -20577,6 +20957,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -20620,6 +21099,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('lv'); @@ -20842,67 +21322,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); - assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); - assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); - assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); - assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); - assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); - assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); - assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); - assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); - assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); - assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52.', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1.', 'Jan 2 2012 should be week 1'); @@ -20911,42 +21330,6 @@ assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -20956,6 +21339,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -20999,6 +21481,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('me'); @@ -21238,67 +21721,6 @@ // Monday is the first day of the week. // The week that contains Jan 1st is the first week of the year. - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); - assert.equal(moment([2010, 0, 4]).week(), 2, 'Jan 4 2010 should be week 2'); - assert.equal(moment([2010, 0, 10]).week(), 2, 'Jan 10 2010 should be week 2'); - assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); - assert.equal(moment([2011, 0, 3]).week(), 2, 'Jan 3 2011 should be week 2'); - assert.equal(moment([2011, 0, 9]).week(), 2, 'Jan 9 2011 should be week 2'); - assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1.', 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1.', 'Jan 1 2012 should be week 1'); @@ -21307,42 +21729,6 @@ assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3.', 'Jan 9 2012 should be week 3'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -21352,6 +21738,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -21395,6 +21880,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('mk'); @@ -21611,67 +22097,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); - assert.equal(moment([2010, 0, 4]).week(), 2, 'Jan 4 2010 should be week 2'); - assert.equal(moment([2010, 0, 10]).week(), 2, 'Jan 10 2010 should be week 2'); - assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); - assert.equal(moment([2011, 0, 3]).week(), 2, 'Jan 3 2011 should be week 2'); - assert.equal(moment([2011, 0, 9]).week(), 2, 'Jan 9 2011 should be week 2'); - assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1-ви', 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1-ви', 'Jan 1 2012 should be week 1'); @@ -21680,42 +22105,6 @@ assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3-ти', 'Jan 9 2012 should be week 3'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -21725,6 +22114,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -21768,6 +22256,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('ml'); @@ -21985,67 +22474,6 @@ assert.equal(moment([2011, 2, 23, 21, 20]).format('A'), 'രാത്രി', 'night'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 7]).week(), 1, 'Jan 7 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 14]).week(), 2, 'Jan 14 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1'); - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 2, 'Jan 7 2007 should be week 2'); - assert.equal(moment([2007, 0, 13]).week(), 2, 'Jan 13 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 3, 'Jan 14 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 2, 'Jan 6 2008 should be week 2'); - assert.equal(moment([2008, 0, 12]).week(), 2, 'Jan 12 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 3, 'Jan 13 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 2, 'Jan 5 2003 should be week 2'); - assert.equal(moment([2003, 0, 11]).week(), 2, 'Jan 11 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 3, 'Jan 12 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 2, 'Jan 4 2009 should be week 2'); - assert.equal(moment([2009, 0, 10]).week(), 2, 'Jan 10 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 3, 'Jan 11 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 2]).week(), 1, 'Jan 2 2010 should be week 1'); - assert.equal(moment([2010, 0, 3]).week(), 2, 'Jan 3 2010 should be week 2'); - assert.equal(moment([2010, 0, 9]).week(), 2, 'Jan 9 2010 should be week 2'); - assert.equal(moment([2010, 0, 10]).week(), 3, 'Jan 10 2010 should be week 3'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1'); - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 2]).week(), 2, 'Jan 2 2011 should be week 2'); - assert.equal(moment([2011, 0, 8]).week(), 2, 'Jan 8 2011 should be week 2'); - assert.equal(moment([2011, 0, 9]).week(), 3, 'Jan 9 2011 should be week 3'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1', 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 7]).format('w ww wo'), '1 01 1', 'Jan 7 2012 should be week 1'); @@ -22054,42 +22482,6 @@ assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3', 'Jan 15 2012 should be week 3'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -22099,6 +22491,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -22142,6 +22633,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('mr'); @@ -22359,67 +22851,6 @@ assert.equal(moment([2011, 2, 23, 21, 20]).format('A'), 'रात्री', 'night'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 7]).week(), 1, 'Jan 7 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 14]).week(), 2, 'Jan 14 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1'); - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 2, 'Jan 7 2007 should be week 2'); - assert.equal(moment([2007, 0, 13]).week(), 2, 'Jan 13 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 3, 'Jan 14 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 2, 'Jan 6 2008 should be week 2'); - assert.equal(moment([2008, 0, 12]).week(), 2, 'Jan 12 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 3, 'Jan 13 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 2, 'Jan 5 2003 should be week 2'); - assert.equal(moment([2003, 0, 11]).week(), 2, 'Jan 11 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 3, 'Jan 12 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 2, 'Jan 4 2009 should be week 2'); - assert.equal(moment([2009, 0, 10]).week(), 2, 'Jan 10 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 3, 'Jan 11 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 2]).week(), 1, 'Jan 2 2010 should be week 1'); - assert.equal(moment([2010, 0, 3]).week(), 2, 'Jan 3 2010 should be week 2'); - assert.equal(moment([2010, 0, 9]).week(), 2, 'Jan 9 2010 should be week 2'); - assert.equal(moment([2010, 0, 10]).week(), 3, 'Jan 10 2010 should be week 3'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1'); - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 2]).week(), 2, 'Jan 2 2011 should be week 2'); - assert.equal(moment([2011, 0, 8]).week(), 2, 'Jan 8 2011 should be week 2'); - assert.equal(moment([2011, 0, 9]).week(), 3, 'Jan 9 2011 should be week 3'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '१ ०१ १', 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 7]).format('w ww wo'), '१ ०१ १', 'Jan 7 2012 should be week 1'); @@ -22428,62 +22859,113 @@ assert.equal(moment([2012, 0, 15]).format('w ww wo'), '३ ०३ ३', 'Jan 15 2012 should be week 3'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); +})); - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : + typeof define === 'function' && define.amd ? define(['../../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); } - }); + } - test('meridiem invariant', function (assert) { - var h, m, t1, t2; - for (h = 0; h < 24; ++h) { - for (m = 0; m < 60; m += 15) { - t1 = moment.utc([2000, 0, 1, h, m]); - t2 = moment(t1.format('A h:mm'), 'A h:mm'); - assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), - 'meridiem at ' + t1.format('HH:mm')); + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } } + return res; } - }); + } - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../../moment')) : - typeof define === 'function' && define.amd ? define(['../../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } /*global QUnit:false*/ @@ -22528,6 +23010,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('ms-my'); @@ -22738,67 +23221,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'dalam 2 minggu'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 sepatutnya minggu 1'); - assert.equal(moment([2012, 0, 7]).week(), 2, 'Jan 7 2012 sepatutnya minggu 2'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 sepatutnya minggu 2'); - assert.equal(moment([2012, 0, 14]).week(), 3, 'Jan 14 2012 sepatutnya minggu 3'); - assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 sepatutnya minggu 3'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2006, 11, 31]).week(), 53, 'Dec 31 2006 sepatutnya minggu 53'); - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 sepatutnya minggu 1'); - assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 sepatutnya minggu 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 sepatutnya minggu 1'); - assert.equal(moment([2007, 0, 13]).week(), 2, 'Jan 13 2007 sepatutnya minggu 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 sepatutnya minggu 2'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 30]).week(), 52, 'Dec 30 2007 sepatutnya minggu 52'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 sepatutnya minggu 1'); - assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 sepatutnya minggu 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 sepatutnya minggu 1'); - assert.equal(moment([2008, 0, 12]).week(), 2, 'Jan 12 2008 sepatutnya minggu 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 sepatutnya minggu 2'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 29]).week(), 52, 'Dec 29 2002 sepatutnya minggu 52'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 sepatutnya minggu 1'); - assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 sepatutnya minggu 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 sepatutnya minggu 1'); - assert.equal(moment([2003, 0, 11]).week(), 2, 'Jan 11 2003 sepatutnya minggu 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 sepatutnya minggu 2'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 28]).week(), 52, 'Dec 28 2008 sepatutnya minggu 52'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 sepatutnya minggu 1'); - assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 sepatutnya minggu 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 sepatutnya minggu 1'); - assert.equal(moment([2009, 0, 10]).week(), 2, 'Jan 10 2009 sepatutnya minggu 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 sepatutnya minggu 2'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 27]).week(), 52, 'Dec 27 2009 sepatutnya minggu 52'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 sepatutnya minggu 1'); - assert.equal(moment([2010, 0, 2]).week(), 1, 'Jan 2 2010 sepatutnya minggu 1'); - assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 sepatutnya minggu 1'); - assert.equal(moment([2010, 0, 9]).week(), 2, 'Jan 9 2010 sepatutnya minggu 2'); - assert.equal(moment([2010, 0, 10]).week(), 2, 'Jan 10 2010 sepatutnya minggu 2'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 26]).week(), 52, 'Dec 26 2010 sepatutnya minggu 52'); - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 sepatutnya minggu 1'); - assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 sepatutnya minggu 1'); - assert.equal(moment([2011, 0, 8]).week(), 2, 'Jan 8 2011 sepatutnya minggu 2'); - assert.equal(moment([2011, 0, 9]).week(), 2, 'Jan 9 2011 sepatutnya minggu 2'); - }); - test('weeks year starting sunday format', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1', 'Jan 1 2012 sepatutnya minggu 1'); assert.equal(moment([2012, 0, 7]).format('w ww wo'), '2 02 2', 'Jan 7 2012 sepatutnya minggu 2'); @@ -22807,62 +23229,113 @@ assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3', 'Jan 15 2012 sepatutnya minggu 3'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); +})); + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : + typeof define === 'function' && define.amd ? define(['../../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); } - }); + } - test('meridiem invariant', function (assert) { - var h, m, t1, t2; - for (h = 0; h < 24; ++h) { - for (m = 0; m < 60; m += 15) { - t1 = moment.utc([2000, 0, 1, h, m]); - t2 = moment(t1.format('A h:mm'), 'A h:mm'); - assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), - 'meridiem at ' + t1.format('HH:mm')); + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } } + return res; } - }); + } - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); + // Pick the first defined of two or three arguments. + function defaults(a, b, c) { + if (a != null) { + return a; } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + if (b != null) { + return b; } - }); + return c; + } -})); + function defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../../moment')) : - typeof define === 'function' && define.amd ? define(['../../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } /*global QUnit:false*/ @@ -22907,6 +23380,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('ms'); @@ -23117,67 +23591,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'dalam 2 minggu'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 sepatutnya minggu 1'); - assert.equal(moment([2012, 0, 7]).week(), 2, 'Jan 7 2012 sepatutnya minggu 2'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 sepatutnya minggu 2'); - assert.equal(moment([2012, 0, 14]).week(), 3, 'Jan 14 2012 sepatutnya minggu 3'); - assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 sepatutnya minggu 3'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2006, 11, 31]).week(), 53, 'Dec 31 2006 sepatutnya minggu 53'); - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 sepatutnya minggu 1'); - assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 sepatutnya minggu 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 sepatutnya minggu 1'); - assert.equal(moment([2007, 0, 13]).week(), 2, 'Jan 13 2007 sepatutnya minggu 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 sepatutnya minggu 2'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 30]).week(), 52, 'Dec 30 2007 sepatutnya minggu 52'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 sepatutnya minggu 1'); - assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 sepatutnya minggu 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 sepatutnya minggu 1'); - assert.equal(moment([2008, 0, 12]).week(), 2, 'Jan 12 2008 sepatutnya minggu 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 sepatutnya minggu 2'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 29]).week(), 52, 'Dec 29 2002 sepatutnya minggu 52'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 sepatutnya minggu 1'); - assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 sepatutnya minggu 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 sepatutnya minggu 1'); - assert.equal(moment([2003, 0, 11]).week(), 2, 'Jan 11 2003 sepatutnya minggu 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 sepatutnya minggu 2'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 28]).week(), 52, 'Dec 28 2008 sepatutnya minggu 52'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 sepatutnya minggu 1'); - assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 sepatutnya minggu 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 sepatutnya minggu 1'); - assert.equal(moment([2009, 0, 10]).week(), 2, 'Jan 10 2009 sepatutnya minggu 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 sepatutnya minggu 2'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 27]).week(), 52, 'Dec 27 2009 sepatutnya minggu 52'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 sepatutnya minggu 1'); - assert.equal(moment([2010, 0, 2]).week(), 1, 'Jan 2 2010 sepatutnya minggu 1'); - assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 sepatutnya minggu 1'); - assert.equal(moment([2010, 0, 9]).week(), 2, 'Jan 9 2010 sepatutnya minggu 2'); - assert.equal(moment([2010, 0, 10]).week(), 2, 'Jan 10 2010 sepatutnya minggu 2'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 26]).week(), 52, 'Dec 26 2010 sepatutnya minggu 52'); - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 sepatutnya minggu 1'); - assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 sepatutnya minggu 1'); - assert.equal(moment([2011, 0, 8]).week(), 2, 'Jan 8 2011 sepatutnya minggu 2'); - assert.equal(moment([2011, 0, 9]).week(), 2, 'Jan 9 2011 sepatutnya minggu 2'); - }); - test('weeks year starting sunday format', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1', 'Jan 1 2012 sepatutnya minggu 1'); assert.equal(moment([2012, 0, 7]).format('w ww wo'), '2 02 2', 'Jan 7 2012 sepatutnya minggu 2'); @@ -23186,62 +23599,113 @@ assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3', 'Jan 15 2012 sepatutnya minggu 3'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); +})); + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : + typeof define === 'function' && define.amd ? define(['../../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); } - }); + } - test('meridiem invariant', function (assert) { - var h, m, t1, t2; - for (h = 0; h < 24; ++h) { - for (m = 0; m < 60; m += 15) { - t1 = moment.utc([2000, 0, 1, h, m]); - t2 = moment(t1.format('A h:mm'), 'A h:mm'); - assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), - 'meridiem at ' + t1.format('HH:mm')); + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } } + return res; } - }); + } - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); + // Pick the first defined of two or three arguments. + function defaults(a, b, c) { + if (a != null) { + return a; } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + if (b != null) { + return b; } - }); + return c; + } -})); + function defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../../moment')) : - typeof define === 'function' && define.amd ? define(['../../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } /*global QUnit:false*/ @@ -23286,6 +23750,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('my'); @@ -23575,67 +24040,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), '၂ ပတ် အတွင်း'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); - assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); - assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); - assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); - assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); - assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); - assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); - assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); - assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); - assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); - assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '၅၂ ၅၂ ၅၂', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '၁ ၀၁ ၁', 'Jan 2 2012 should be week 1'); @@ -23644,42 +24048,6 @@ assert.equal(moment([2012, 0, 15]).format('w ww wo'), '၂ ၀၂ ၂', 'Jan 15 2012 should be week 2'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -23689,6 +24057,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -23732,6 +24199,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('nb'); @@ -23934,67 +24402,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); - assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); - assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); - assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); - assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); - assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); - assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); - assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); - assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); - assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); - assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52.', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1.', 'Jan 2 2012 should be week 1'); @@ -24003,42 +24410,6 @@ assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -24048,6 +24419,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -24091,6 +24561,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('ne'); @@ -24307,68 +24778,6 @@ assert.equal(moment([2011, 2, 23, 21, 20]).format('A'), 'राति', 'night'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 7]).week(), 1, 'Jan 7 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 14]).week(), 2, 'Jan 14 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1'); - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 2, 'Jan 7 2007 should be week 2'); - assert.equal(moment([2007, 0, 13]).week(), 2, 'Jan 13 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 3, 'Jan 14 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 2, 'Jan 6 2008 should be week 2'); - assert.equal(moment([2008, 0, 12]).week(), 2, 'Jan 12 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 3, 'Jan 13 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 2, 'Jan 5 2003 should be week 2'); - assert.equal(moment([2003, 0, 11]).week(), 2, 'Jan 11 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 3, 'Jan 12 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 2, 'Jan 4 2009 should be week 2'); - assert.equal(moment([2009, 0, 10]).week(), 2, 'Jan 10 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 3, 'Jan 11 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 2]).week(), 1, 'Jan 2 2010 should be week 1'); - assert.equal(moment([2010, 0, 3]).week(), 2, 'Jan 3 2010 should be week 2'); - assert.equal(moment([2010, 0, 9]).week(), 2, 'Jan 9 2010 should be week 2'); - assert.equal(moment([2010, 0, 10]).week(), 3, 'Jan 10 2010 should be week 3'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1'); - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 2]).week(), 2, 'Jan 2 2011 should be week 2'); - assert.equal(moment([2011, 0, 8]).week(), 2, 'Jan 8 2011 should be week 2'); - assert.equal(moment([2011, 0, 9]).week(), 3, 'Jan 9 2011 should be week 3'); - }); - - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2011, 11, 26]).format('w ww wo'), '५३ ५३ ५३', 'Dec 26 2011 should be week 53'); assert.equal(moment([2012, 0, 1]).format('w ww wo'), '१ ०१ १', 'Jan 1 2012 should be week 1'); @@ -24377,62 +24786,113 @@ assert.equal(moment([2012, 0, 9]).format('w ww wo'), '२ ०२ २', 'Jan 9 2012 should be week 2'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); +})); - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : + typeof define === 'function' && define.amd ? define(['../../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); } - }); + } - test('meridiem invariant', function (assert) { - var h, m, t1, t2; - for (h = 0; h < 24; ++h) { - for (m = 0; m < 60; m += 15) { - t1 = moment.utc([2000, 0, 1, h, m]); - t2 = moment(t1.format('A h:mm'), 'A h:mm'); - assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), - 'meridiem at ' + t1.format('HH:mm')); + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } } + return res; } - }); + } - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../../moment')) : - typeof define === 'function' && define.amd ? define(['../../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } /*global QUnit:false*/ @@ -24477,6 +24937,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('nl'); @@ -24683,67 +25144,6 @@ assert.equal(moment([2012, 5, 23]).format('D MMM YYYY'), '23 jun. 2012', 'format month abbreviation not surrounded by dashes should include a dot'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); - assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); - assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); - assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); - assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); - assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); - assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); - assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); - assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); - assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); - assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52ste', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1ste', 'Jan 2 2012 should be week 1'); @@ -24752,42 +25152,6 @@ assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2de', 'Jan 15 2012 should be week 2'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -24797,6 +25161,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -24840,6 +25303,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('nn'); @@ -25041,73 +25505,450 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); + test('weeks year starting sunday formatted', function (assert) { + assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52.', 'Jan 1 2012 should be week 52'); + assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1.', 'Jan 2 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1.', 'Jan 8 2012 should be week 1'); + assert.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2.', 'Jan 9 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2'); + }); + +})); + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : + typeof define === 'function' && define.amd ? define(['../../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + + /*global QUnit:false*/ + + var test = QUnit.test; + + var expect = QUnit.expect; + + function module (name, lifecycle) { + QUnit.module(name, { + setup : function () { + moment.locale('en'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); + }; + if (lifecycle && lifecycle.setup) { + lifecycle.setup(); + } + }, + teardown : function () { + if (lifecycle && lifecycle.teardown) { + lifecycle.teardown(); + } + } + }); + } + + function localeModule (name, lifecycle) { + QUnit.module('locale:' + name, { + setup : function () { + moment.locale(name); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); + }; + if (lifecycle && lifecycle.setup) { + lifecycle.setup(); + } + }, + teardown : function () { + moment.locale('en'); + if (lifecycle && lifecycle.teardown) { + lifecycle.teardown(); + } + } + }); + defineCommonLocaleTests(name, -1, -1); + } + + localeModule('pa-in'); + + test('parse', function (assert) { + var tests = 'ਜਨਵਰੀ ਜਨਵਰੀ_ਫ਼ਰਵਰੀ ਫ਼ਰਵਰੀ_ਮਾਰਚ ਮਾਰਚ_ਅਪ੍ਰੈਲ ਅਪ੍ਰੈਲ_ਮਈ ਮਈ_ਜੂਨ ਜੂਨ_ਜੁਲਾਈ ਜੁਲਾਈ_ਅਗਸਤ ਅਗਸਤ_ਸਤੰਬਰ ਸਤੰਬਰ_ਅਕਤੂਬਰ ਅਕਤੂਬਰ_ਨਵੰਬਰ ਨਵੰਬਰ_ਦਸੰਬਰ ਦਸੰਬਰ'.split('_'), i; + function equalTest(input, mmm, i) { + assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); + } + for (i = 0; i < 12; i++) { + tests[i] = tests[i].split(' '); + equalTest(tests[i][0], 'MMM', i); + equalTest(tests[i][1], 'MMM', i); + equalTest(tests[i][0], 'MMMM', i); + equalTest(tests[i][1], 'MMMM', i); + equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i); + equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i); + equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i); + equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i); + } + }); + + test('format', function (assert) { + var a = [ + ['dddd, Do MMMM YYYY, a h:mm:ss ਵਜੇ', 'ਐਤਵਾਰ, ੧੪ ਫ਼ਰਵਰੀ ੨੦੧੦, ਦੁਪਹਿਰ ੩:੨੫:੫੦ ਵਜੇ'], + ['ddd, a h ਵਜੇ', 'ਐਤ, ਦੁਪਹਿਰ ੩ ਵਜੇ'], + ['M Mo MM MMMM MMM', '੨ ੨ ੦੨ ਫ਼ਰਵਰੀ ਫ਼ਰਵਰੀ'], + ['YYYY YY', '੨੦੧੦ ੧੦'], + ['D Do DD', '੧੪ ੧੪ ੧੪'], + ['d do dddd ddd dd', '੦ ੦ ਐਤਵਾਰ ਐਤ ਐਤ'], + ['DDD DDDo DDDD', '੪੫ ੪੫ ੦੪੫'], + ['w wo ww', '੮ ੮ ੦੮'], + ['h hh', '੩ ੦੩'], + ['H HH', '੧੫ ੧੫'], + ['m mm', '੨੫ ੨੫'], + ['s ss', '੫੦ ੫੦'], + ['a A', 'ਦੁਪਹਿਰ ਦੁਪਹਿਰ'], + ['LTS', 'ਦੁਪਹਿਰ ੩:੨੫:੫੦ ਵਜੇ'], + ['L', '੧੪/੦੨/੨੦੧੦'], + ['LL', '੧੪ ਫ਼ਰਵਰੀ ੨੦੧੦'], + ['LLL', '੧੪ ਫ਼ਰਵਰੀ ੨੦੧੦, ਦੁਪਹਿਰ ੩:੨੫ ਵਜੇ'], + ['LLLL', 'ਐਤਵਾਰ, ੧੪ ਫ਼ਰਵਰੀ ੨੦੧੦, ਦੁਪਹਿਰ ੩:੨੫ ਵਜੇ'], + ['l', '੧੪/੨/੨੦੧੦'], + ['ll', '੧੪ ਫ਼ਰਵਰੀ ੨੦੧੦'], + ['lll', '੧੪ ਫ਼ਰਵਰੀ ੨੦੧੦, ਦੁਪਹਿਰ ੩:੨੫ ਵਜੇ'], + ['llll', 'ਐਤ, ੧੪ ਫ਼ਰਵਰੀ ੨੦੧੦, ਦੁਪਹਿਰ ੩:੨੫ ਵਜੇ'] + ], + b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), + i; + for (i = 0; i < a.length; i++) { + assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]); + } + }); + + test('format ordinal', function (assert) { + assert.equal(moment([2011, 0, 1]).format('DDDo'), '੧', '੧'); + assert.equal(moment([2011, 0, 2]).format('DDDo'), '੨', '੨'); + assert.equal(moment([2011, 0, 3]).format('DDDo'), '੩', '੩'); + assert.equal(moment([2011, 0, 4]).format('DDDo'), '੪', '੪'); + assert.equal(moment([2011, 0, 5]).format('DDDo'), '੫', '੫'); + assert.equal(moment([2011, 0, 6]).format('DDDo'), '੬', '੬'); + assert.equal(moment([2011, 0, 7]).format('DDDo'), '੭', '੭'); + assert.equal(moment([2011, 0, 8]).format('DDDo'), '੮', '੮'); + assert.equal(moment([2011, 0, 9]).format('DDDo'), '੯', '੯'); + assert.equal(moment([2011, 0, 10]).format('DDDo'), '੧੦', '੧੦'); + + assert.equal(moment([2011, 0, 11]).format('DDDo'), '੧੧', '੧੧'); + assert.equal(moment([2011, 0, 12]).format('DDDo'), '੧੨', '੧੨'); + assert.equal(moment([2011, 0, 13]).format('DDDo'), '੧੩', '੧੩'); + assert.equal(moment([2011, 0, 14]).format('DDDo'), '੧੪', '੧੪'); + assert.equal(moment([2011, 0, 15]).format('DDDo'), '੧੫', '੧੫'); + assert.equal(moment([2011, 0, 16]).format('DDDo'), '੧੬', '੧੬'); + assert.equal(moment([2011, 0, 17]).format('DDDo'), '੧੭', '੧੭'); + assert.equal(moment([2011, 0, 18]).format('DDDo'), '੧੮', '੧੮'); + assert.equal(moment([2011, 0, 19]).format('DDDo'), '੧੯', '੧੯'); + assert.equal(moment([2011, 0, 20]).format('DDDo'), '੨੦', '੨੦'); + + assert.equal(moment([2011, 0, 21]).format('DDDo'), '੨੧', '੨੧'); + assert.equal(moment([2011, 0, 22]).format('DDDo'), '੨੨', '੨੨'); + assert.equal(moment([2011, 0, 23]).format('DDDo'), '੨੩', '੨੩'); + assert.equal(moment([2011, 0, 24]).format('DDDo'), '੨੪', '੨੪'); + assert.equal(moment([2011, 0, 25]).format('DDDo'), '੨੫', '੨੫'); + assert.equal(moment([2011, 0, 26]).format('DDDo'), '੨੬', '੨੬'); + assert.equal(moment([2011, 0, 27]).format('DDDo'), '੨੭', '੨੭'); + assert.equal(moment([2011, 0, 28]).format('DDDo'), '੨੮', '੨੮'); + assert.equal(moment([2011, 0, 29]).format('DDDo'), '੨੯', '੨੯'); + assert.equal(moment([2011, 0, 30]).format('DDDo'), '੩੦', '੩੦'); + + assert.equal(moment([2011, 0, 31]).format('DDDo'), '੩੧', '੩੧'); + }); + + test('format month', function (assert) { + var expected = 'ਜਨਵਰੀ ਜਨਵਰੀ_ਫ਼ਰਵਰੀ ਫ਼ਰਵਰੀ_ਮਾਰਚ ਮਾਰਚ_ਅਪ੍ਰੈਲ ਅਪ੍ਰੈਲ_ਮਈ ਮਈ_ਜੂਨ ਜੂਨ_ਜੁਲਾਈ ਜੁਲਾਈ_ਅਗਸਤ ਅਗਸਤ_ਸਤੰਬਰ ਸਤੰਬਰ_ਅਕਤੂਬਰ ਅਕਤੂਬਰ_ਨਵੰਬਰ ਨਵੰਬਰ_ਦਸੰਬਰ ਦਸੰਬਰ'.split('_'), i; + for (i = 0; i < expected.length; i++) { + assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); + } + }); + + test('format week', function (assert) { + var expected = 'ਐਤਵਾਰ ਐਤ ਐਤ_ਸੋਮਵਾਰ ਸੋਮ ਸੋਮ_ਮੰਗਲਵਾਰ ਮੰਗਲ ਮੰਗਲ_ਬੁਧਵਾਰ ਬੁਧ ਬੁਧ_ਵੀਰਵਾਰ ਵੀਰ ਵੀਰ_ਸ਼ੁੱਕਰਵਾਰ ਸ਼ੁਕਰ ਸ਼ੁਕਰ_ਸ਼ਨੀਚਰਵਾਰ ਸ਼ਨੀ ਸ਼ਨੀ'.split('_'), i; + for (i = 0; i < expected.length; i++) { + assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); + } + }); + + test('from', function (assert) { + var start = moment([2007, 1, 28]); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'ਕੁਝ ਸਕਿੰਟ', '44 seconds = a few seconds'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'ਇਕ ਮਿੰਟ', '45 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'ਇਕ ਮਿੰਟ', '89 seconds = a minute'); + assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '੨ ਮਿੰਟ', '90 seconds = 2 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '੪੪ ਮਿੰਟ', '44 minutes = 44 minutes'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'ਇੱਕ ਘੰਟਾ', '45 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'ਇੱਕ ਘੰਟਾ', '89 minutes = an hour'); + assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '੨ ਘੰਟੇ', '90 minutes = 2 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '੫ ਘੰਟੇ', '5 hours = 5 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '੨੧ ਘੰਟੇ', '21 hours = 21 hours'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'ਇੱਕ ਦਿਨ', '22 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'ਇੱਕ ਦਿਨ', '35 hours = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '੨ ਦਿਨ', '36 hours = 2 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'ਇੱਕ ਦਿਨ', '1 day = a day'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '੫ ਦਿਨ', '5 days = 5 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '੨੫ ਦਿਨ', '25 days = 25 days'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'ਇੱਕ ਮਹੀਨਾ', '26 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'ਇੱਕ ਮਹੀਨਾ', '30 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'ਇੱਕ ਮਹੀਨਾ', '43 days = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '੨ ਮਹੀਨੇ', '46 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '੨ ਮਹੀਨੇ', '75 days = 2 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '੩ ਮਹੀਨੇ', '76 days = 3 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'ਇੱਕ ਮਹੀਨਾ', '1 month = a month'); + assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '੫ ਮਹੀਨੇ', '5 months = 5 months'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'ਇੱਕ ਸਾਲ', '345 days = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '੨ ਸਾਲ', '548 days = 2 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'ਇੱਕ ਸਾਲ', '1 year = a year'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '੫ ਸਾਲ', '5 years = 5 years'); + }); + + test('suffix', function (assert) { + assert.equal(moment(30000).from(0), 'ਕੁਝ ਸਕਿੰਟ ਵਿੱਚ', 'prefix'); + assert.equal(moment(0).from(30000), 'ਕੁਝ ਸਕਿੰਟ ਪਿਛਲੇ', 'suffix'); + }); + + test('now from now', function (assert) { + assert.equal(moment().fromNow(), 'ਕੁਝ ਸਕਿੰਟ ਪਿਛਲੇ', 'now from now should display as in the past'); + }); + + test('fromNow', function (assert) { + assert.equal(moment().add({s: 30}).fromNow(), 'ਕੁਝ ਸਕਿੰਟ ਵਿੱਚ', 'ਕੁਝ ਸਕਿੰਟ ਵਿੱਚ'); + assert.equal(moment().add({d: 5}).fromNow(), '੫ ਦਿਨ ਵਿੱਚ', '੫ ਦਿਨ ਵਿੱਚ'); + }); + + test('calendar day', function (assert) { + var a = moment().hours(2).minutes(0).seconds(0); + + assert.equal(moment(a).calendar(), 'ਅਜ ਰਾਤ ੨:੦੦ ਵਜੇ', 'today at the same time'); + assert.equal(moment(a).add({m: 25}).calendar(), 'ਅਜ ਰਾਤ ੨:੨੫ ਵਜੇ', 'Now plus 25 min'); + assert.equal(moment(a).add({h: 3}).calendar(), 'ਅਜ ਸਵੇਰ ੫:੦੦ ਵਜੇ', 'Now plus 3 hour'); + assert.equal(moment(a).add({d: 1}).calendar(), 'ਕਲ ਰਾਤ ੨:੦੦ ਵਜੇ', 'tomorrow at the same time'); + assert.equal(moment(a).subtract({h: 1}).calendar(), 'ਅਜ ਰਾਤ ੧:੦੦ ਵਜੇ', 'Now minus 1 hour'); + assert.equal(moment(a).subtract({d: 1}).calendar(), 'ਕਲ ਰਾਤ ੨:੦੦ ਵਜੇ', 'yesterday at the same time'); + }); + + test('calendar next week', function (assert) { + var i, m; + for (i = 2; i < 7; i++) { + m = moment().add({d: i}); + assert.equal(m.calendar(), m.format('dddd[,] LT'), 'Today + ' + i + ' days current time'); + m.hours(0).minutes(0).seconds(0).milliseconds(0); + assert.equal(m.calendar(), m.format('dddd[,] LT'), 'Today + ' + i + ' days beginning of day'); + m.hours(23).minutes(59).seconds(59).milliseconds(999); + assert.equal(m.calendar(), m.format('dddd[,] LT'), 'Today + ' + i + ' days end of day'); + } + }); + + test('calendar last week', function (assert) { + var i, m; + + for (i = 2; i < 7; i++) { + m = moment().subtract({d: i}); + assert.equal(m.calendar(), m.format('[ਪਿਛਲੇ] dddd[,] LT'), 'Today - ' + i + ' days current time'); + m.hours(0).minutes(0).seconds(0).milliseconds(0); + assert.equal(m.calendar(), m.format('[ਪਿਛਲੇ] dddd[,] LT'), 'Today - ' + i + ' days beginning of day'); + m.hours(23).minutes(59).seconds(59).milliseconds(999); + assert.equal(m.calendar(), m.format('[ਪਿਛਲੇ] dddd[,] LT'), 'Today - ' + i + ' days end of day'); + } + }); + + test('calendar all else', function (assert) { + var weeksAgo = moment().subtract({w: 1}), + weeksFromNow = moment().add({w: 1}); + + assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '1 week ago'); + assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 1 week'); + + weeksAgo = moment().subtract({w: 2}); + weeksFromNow = moment().add({w: 2}); + + assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '2 weeks ago'); + assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); + }); + + test('meridiem invariant', function (assert) { + assert.equal(moment([2011, 2, 23, 2, 30]).format('a'), 'ਰਾਤ', 'before dawn'); + assert.equal(moment([2011, 2, 23, 9, 30]).format('a'), 'ਸਵੇਰ', 'morning'); + assert.equal(moment([2011, 2, 23, 14, 30]).format('a'), 'ਦੁਪਹਿਰ', 'during day'); + assert.equal(moment([2011, 2, 23, 17, 30]).format('a'), 'ਸ਼ਾਮ', 'evening'); + assert.equal(moment([2011, 2, 23, 19, 30]).format('a'), 'ਸ਼ਾਮ', 'late evening'); + assert.equal(moment([2011, 2, 23, 21, 20]).format('a'), 'ਰਾਤ', 'night'); + + assert.equal(moment([2011, 2, 23, 2, 30]).format('A'), 'ਰਾਤ', 'before dawn'); + assert.equal(moment([2011, 2, 23, 9, 30]).format('A'), 'ਸਵੇਰ', 'morning'); + assert.equal(moment([2011, 2, 23, 14, 30]).format('A'), 'ਦੁਪਹਿਰ', ' during day'); + assert.equal(moment([2011, 2, 23, 17, 30]).format('A'), 'ਸ਼ਾਮ', 'evening'); + assert.equal(moment([2011, 2, 23, 19, 30]).format('A'), 'ਸ਼ਾਮ', 'late evening'); + assert.equal(moment([2011, 2, 23, 21, 20]).format('A'), 'ਰਾਤ', 'night'); + }); + test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); + assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); + assert.equal(moment([2012, 0, 7]).week(), 1, 'Jan 7 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); + assert.equal(moment([2012, 0, 14]).week(), 2, 'Jan 14 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3'); }); test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); + assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1'); + assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); + assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 should be week 1'); + assert.equal(moment([2007, 0, 7]).week(), 2, 'Jan 7 2007 should be week 2'); + assert.equal(moment([2007, 0, 13]).week(), 2, 'Jan 13 2007 should be week 2'); + assert.equal(moment([2007, 0, 14]).week(), 3, 'Jan 14 2007 should be week 3'); }); test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); + assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52'); assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); + assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 should be week 1'); + assert.equal(moment([2008, 0, 6]).week(), 2, 'Jan 6 2008 should be week 2'); + assert.equal(moment([2008, 0, 12]).week(), 2, 'Jan 12 2008 should be week 2'); + assert.equal(moment([2008, 0, 13]).week(), 3, 'Jan 13 2008 should be week 3'); }); test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); + assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1'); assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); + assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 should be week 1'); + assert.equal(moment([2003, 0, 5]).week(), 2, 'Jan 5 2003 should be week 2'); + assert.equal(moment([2003, 0, 11]).week(), 2, 'Jan 11 2003 should be week 2'); + assert.equal(moment([2003, 0, 12]).week(), 3, 'Jan 12 2003 should be week 3'); }); test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); + assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1'); assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); + assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 should be week 1'); + assert.equal(moment([2009, 0, 4]).week(), 2, 'Jan 4 2009 should be week 2'); + assert.equal(moment([2009, 0, 10]).week(), 2, 'Jan 10 2009 should be week 2'); + assert.equal(moment([2009, 0, 11]).week(), 3, 'Jan 11 2009 should be week 3'); }); test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); - assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); - assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); - assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); - assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); - assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); + assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1'); + assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); + assert.equal(moment([2010, 0, 2]).week(), 1, 'Jan 2 2010 should be week 1'); + assert.equal(moment([2010, 0, 3]).week(), 2, 'Jan 3 2010 should be week 2'); + assert.equal(moment([2010, 0, 9]).week(), 2, 'Jan 9 2010 should be week 2'); + assert.equal(moment([2010, 0, 10]).week(), 3, 'Jan 10 2010 should be week 3'); }); test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); - assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); - assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); - assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); - assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); - assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); + assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1'); + assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); + assert.equal(moment([2011, 0, 2]).week(), 2, 'Jan 2 2011 should be week 2'); + assert.equal(moment([2011, 0, 8]).week(), 2, 'Jan 8 2011 should be week 2'); + assert.equal(moment([2011, 0, 9]).week(), 3, 'Jan 9 2011 should be week 3'); }); test('weeks year starting sunday formatted', function (assert) { - assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52.', 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1.', 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1.', 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2.', 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2'); + assert.equal(moment([2012, 0, 1]).format('w ww wo'), '੧ ੦੧ ੧', 'Jan 1 2012 should be week 1'); + assert.equal(moment([2012, 0, 7]).format('w ww wo'), '੧ ੦੧ ੧', 'Jan 7 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).format('w ww wo'), '੨ ੦੨ ੨', 'Jan 8 2012 should be week 2'); + assert.equal(moment([2012, 0, 14]).format('w ww wo'), '੨ ੦੨ ੨', 'Jan 14 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).format('w ww wo'), '੩ ੦੩ ੩', 'Jan 15 2012 should be week 3'); }); test('lenient ordinal parsing', function (assert) { @@ -25137,6 +25978,18 @@ } }); + test('meridiem', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + test('strict ordinal parsing', function (assert) { var i, ordinalStr, testMoment; for (i = 1; i <= 31; ++i) { @@ -25155,6 +26008,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -25198,6 +26150,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('pl'); @@ -25443,67 +26396,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); - assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); - assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); - assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); - assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); - assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); - assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); - assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); - assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); - assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); - assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52.', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1.', 'Jan 2 2012 should be week 1'); @@ -25512,42 +26404,6 @@ assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -25557,6 +26413,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -25600,6 +26555,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('pt-br'); @@ -25702,7 +26658,7 @@ }); test('format week', function (assert) { - var expected = 'Domingo Dom_Segunda-Feira Seg_Terça-Feira Ter_Quarta-Feira Qua_Quinta-Feira Qui_Sexta-Feira Sex_Sábado Sáb'.split('_'), i; + var expected = 'Domingo Dom_Segunda-feira Seg_Terça-feira Ter_Quarta-feira Qua_Quinta-feira Qui_Sexta-feira Sex_Sábado Sáb'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]); } @@ -25799,67 +26755,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 7]).week(), 1, 'Jan 7 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 14]).week(), 2, 'Jan 14 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1'); - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 2, 'Jan 7 2007 should be week 2'); - assert.equal(moment([2007, 0, 13]).week(), 2, 'Jan 13 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 3, 'Jan 14 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 2, 'Jan 6 2008 should be week 2'); - assert.equal(moment([2008, 0, 12]).week(), 2, 'Jan 12 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 3, 'Jan 13 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 2, 'Jan 5 2003 should be week 2'); - assert.equal(moment([2003, 0, 11]).week(), 2, 'Jan 11 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 3, 'Jan 12 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 2, 'Jan 4 2009 should be week 2'); - assert.equal(moment([2009, 0, 10]).week(), 2, 'Jan 10 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 3, 'Jan 11 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 2]).week(), 1, 'Jan 2 2010 should be week 1'); - assert.equal(moment([2010, 0, 3]).week(), 2, 'Jan 3 2010 should be week 2'); - assert.equal(moment([2010, 0, 9]).week(), 2, 'Jan 9 2010 should be week 2'); - assert.equal(moment([2010, 0, 10]).week(), 3, 'Jan 10 2010 should be week 3'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1'); - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 2]).week(), 2, 'Jan 2 2011 should be week 2'); - assert.equal(moment([2011, 0, 8]).week(), 2, 'Jan 8 2011 should be week 2'); - assert.equal(moment([2011, 0, 9]).week(), 3, 'Jan 9 2011 should be week 3'); - }); - test('weeks year starting sunday format', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1º', 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 7]).format('w ww wo'), '1 01 1º', 'Jan 7 2012 should be week 1'); @@ -25868,42 +26763,6 @@ assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3º', 'Jan 15 2012 should be week 3'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -25913,6 +26772,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -25956,6 +26914,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('pt'); @@ -26153,67 +27112,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); - assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); - assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); - assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); - assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); - assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); - assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); - assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); - assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); - assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); - assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52º', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1º', 'Jan 2 2012 should be week 1'); @@ -26222,42 +27120,6 @@ assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2º', 'Jan 15 2012 should be week 2'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -26267,6 +27129,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -26310,6 +27271,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('ro'); @@ -26519,67 +27481,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); - assert.equal(moment([2010, 0, 4]).week(), 2, 'Jan 4 2010 should be week 2'); - assert.equal(moment([2010, 0, 10]).week(), 2, 'Jan 10 2010 should be week 2'); - assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); - assert.equal(moment([2011, 0, 3]).week(), 2, 'Jan 3 2011 should be week 2'); - assert.equal(moment([2011, 0, 9]).week(), 2, 'Jan 9 2011 should be week 2'); - assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1', 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1', 'Jan 1 2012 should be week 1'); @@ -26588,42 +27489,6 @@ assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3', 'Jan 9 2012 should be week 3'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -26633,6 +27498,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -26676,12 +27640,13 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('ru'); test('parse', function (assert) { - var tests = 'Январь янв_Февраль фев_Март март_Апрель апр_Май май_Июнь июнь_Июль июль_Август авг_Сентябрь сен_Октябрь окт_Ноябрь ноя_Декабрь дек'.split('_'), i; + var tests = 'январь янв_февраль фев_март март_апрель апр_май май_июнь июнь_июль июль_август авг_сентябрь сен_октябрь окт_ноябрь ноя_декабрь дек'.split('_'), i; function equalTest(input, mmm, i) { assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); } @@ -26714,12 +27679,12 @@ test('format', function (assert) { var a = [ - ['dddd, Do MMMM YYYY, HH:mm:ss', 'Воскресенье, 14-го Февраля 2010, 15:25:50'], - ['ddd, h A', 'Вс, 3 дня'], - ['M Mo MM MMMM MMM', '2 2-й 02 Февраль фев'], + ['dddd, Do MMMM YYYY, HH:mm:ss', 'воскресенье, 14-го февраля 2010, 15:25:50'], + ['ddd, h A', 'вс, 3 дня'], + ['M Mo MM MMMM MMM', '2 2-й 02 февраль фев'], ['YYYY YY', '2010 10'], ['D Do DD', '14 14-го 14'], - ['d do dddd ddd dd', '0 0-й Воскресенье Вс Вс'], + ['d do dddd ddd dd', '0 0-й воскресенье вс вс'], ['DDD DDDo DDDD', '45 45-й 045'], ['w wo ww', '7 7-я 07'], ['h hh', '3 03'], @@ -26730,13 +27695,13 @@ ['DDDo [день года]', '45-й день года'], ['LTS', '15:25:50'], ['L', '14.02.2010'], - ['LL', '14 Февраля 2010 г.'], - ['LLL', '14 Февраля 2010 г., 15:25'], - ['LLLL', 'Воскресенье, 14 Февраля 2010 г., 15:25'], + ['LL', '14 февраля 2010 г.'], + ['LLL', '14 февраля 2010 г., 15:25'], + ['LLLL', 'воскресенье, 14 февраля 2010 г., 15:25'], ['l', '14.2.2010'], ['ll', '14 фев 2010 г.'], ['lll', '14 фев 2010 г., 15:25'], - ['llll', 'Вс, 14 фев 2010 г., 15:25'] + ['llll', 'вс, 14 фев 2010 г., 15:25'] ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; @@ -26794,7 +27759,7 @@ }); test('format month', function (assert) { - var expected = 'Январь янв_Февраль фев_Март март_Апрель апр_Май май_Июнь июнь_Июль июль_Август авг_Сентябрь сен_Октябрь окт_Ноябрь ноя_Декабрь дек'.split('_'), i; + var expected = 'январь янв_февраль фев_март март_апрель апр_май май_июнь июнь_июль июль_август авг_сентябрь сен_октябрь окт_ноябрь ноя_декабрь дек'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); } @@ -26802,8 +27767,8 @@ test('format month case', function (assert) { var months = { - 'nominative': 'Январь_Февраль_Март_Апрель_Май_Июнь_Июль_Август_Сентябрь_Октябрь_Ноябрь_Декабрь'.split('_'), - 'accusative': 'Января_Февраля_Марта_Апреля_Мая_Июня_Июля_Августа_Сентября_Октября_Ноября_Декабря'.split('_') + 'nominative': 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_'), + 'accusative': 'января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря'.split('_') }, i; for (i = 0; i < 12; i++) { assert.equal(moment([2011, i, 1]).format('D MMMM'), '1 ' + months.accusative[i], '1 ' + months.accusative[i]); @@ -26824,8 +27789,8 @@ test('format month case with escaped symbols', function (assert) { var months = { - 'nominative': 'Январь_Февраль_Март_Апрель_Май_Июнь_Июль_Август_Сентябрь_Октябрь_Ноябрь_Декабрь'.split('_'), - 'accusative': 'Января_Февраля_Марта_Апреля_Мая_Июня_Июля_Августа_Сентября_Октября_Ноября_Декабря'.split('_') + 'nominative': 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_'), + 'accusative': 'января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря'.split('_') }, i; for (i = 0; i < 12; i++) { assert.equal(moment([2013, i, 1]).format('D[] MMMM'), '1 ' + months.accusative[i], '1 ' + months.accusative[i]); @@ -26849,7 +27814,7 @@ }); test('format week', function (assert) { - var expected = 'Воскресенье Вс Вс_Понедельник Пн Пн_Вторник Вт Вт_Среда Ср Ср_Четверг Чт Чт_Пятница Пт Пт_Суббота Сб Сб'.split('_'), i; + var expected = 'воскресенье вс вс_понедельник пн пн_вторник вт вт_среда ср ср_четверг чт чт_пятница пт пт_суббота сб сб'.split('_'), i; for (i = 0; i < expected.length; i++) { assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); } @@ -27023,67 +27988,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); - assert.equal(moment([2010, 0, 4]).week(), 2, 'Jan 4 2010 should be week 2'); - assert.equal(moment([2010, 0, 10]).week(), 2, 'Jan 10 2010 should be week 2'); - assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); - assert.equal(moment([2011, 0, 3]).week(), 2, 'Jan 3 2011 should be week 2'); - assert.equal(moment([2011, 0, 9]).week(), 2, 'Jan 9 2011 should be week 2'); - assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1-я', 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1-я', 'Jan 1 2012 should be week 1'); @@ -27092,42 +27996,6 @@ assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3-я', 'Jan 9 2012 should be week 3'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -27137,6 +28005,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -27180,6 +28147,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('se'); @@ -27392,67 +28360,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); - assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); - assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); - assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); - assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); - assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); - assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); - assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); - assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); - assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); - assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52.', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1.', 'Jan 2 2012 should be week 1'); @@ -27461,42 +28368,6 @@ assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -27506,6 +28377,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -27549,6 +28519,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('si'); @@ -27753,42 +28724,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -27798,6 +28733,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -27841,6 +28875,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('sk'); @@ -28130,67 +29165,6 @@ assert.equal(moment.duration(-1, 'minutes').humanize(true), 'pred minútou', 'a minute ago'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); - assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); - assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); - assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); - assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); - assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); - assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); - assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); - assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); - assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); - assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52.', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1.', 'Jan 2 2012 should be week 1'); @@ -28199,42 +29173,6 @@ assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -28244,6 +29182,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -28287,6 +29324,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('sl'); @@ -28612,67 +29650,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); - assert.equal(moment([2010, 0, 4]).week(), 2, 'Jan 4 2010 should be week 2'); - assert.equal(moment([2010, 0, 10]).week(), 2, 'Jan 10 2010 should be week 2'); - assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); - assert.equal(moment([2011, 0, 3]).week(), 2, 'Jan 3 2011 should be week 2'); - assert.equal(moment([2011, 0, 9]).week(), 2, 'Jan 9 2011 should be week 2'); - assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1.', 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1.', 'Jan 1 2012 should be week 1'); @@ -28681,42 +29658,6 @@ assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3.', 'Jan 9 2012 should be week 3'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -28726,6 +29667,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -28769,6 +29809,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('sq'); @@ -28986,67 +30027,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); - assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); - assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); - assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); - assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); - assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); - assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); - assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); - assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); - assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); - assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52.', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1.', 'Jan 2 2012 should be week 1'); @@ -29055,42 +30035,6 @@ assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -29100,6 +30044,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -29143,6 +30186,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('sr-cyrl'); @@ -29379,67 +30423,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); - assert.equal(moment([2010, 0, 4]).week(), 2, 'Jan 4 2010 should be week 2'); - assert.equal(moment([2010, 0, 10]).week(), 2, 'Jan 10 2010 should be week 2'); - assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); - assert.equal(moment([2011, 0, 3]).week(), 2, 'Jan 3 2011 should be week 2'); - assert.equal(moment([2011, 0, 9]).week(), 2, 'Jan 9 2011 should be week 2'); - assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1.', 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1.', 'Jan 1 2012 should be week 1'); @@ -29448,42 +30431,6 @@ assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3.', 'Jan 9 2012 should be week 3'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -29493,6 +30440,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -29536,6 +30582,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('sr'); @@ -29772,67 +30819,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); - assert.equal(moment([2010, 0, 4]).week(), 2, 'Jan 4 2010 should be week 2'); - assert.equal(moment([2010, 0, 10]).week(), 2, 'Jan 10 2010 should be week 2'); - assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); - assert.equal(moment([2011, 0, 3]).week(), 2, 'Jan 3 2011 should be week 2'); - assert.equal(moment([2011, 0, 9]).week(), 2, 'Jan 9 2011 should be week 2'); - assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1.', 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1.', 'Jan 1 2012 should be week 1'); @@ -29841,42 +30827,6 @@ assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3.', 'Jan 9 2012 should be week 3'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -29886,6 +30836,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -29929,6 +30978,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('sv'); @@ -30130,67 +31180,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); - assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); - assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); - assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); - assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); - assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); - assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); - assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); - assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); - assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); - assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52a', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1a', 'Jan 2 2012 should be week 1'); @@ -30199,42 +31188,6 @@ assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2a', 'Jan 15 2012 should be week 2'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -30244,6 +31197,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -30287,6 +31339,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('sw'); @@ -30488,67 +31541,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); - assert.equal(moment([2010, 0, 4]).week(), 2, 'Jan 4 2010 should be week 2'); - assert.equal(moment([2010, 0, 10]).week(), 2, 'Jan 10 2010 should be week 2'); - assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); - assert.equal(moment([2011, 0, 3]).week(), 2, 'Jan 3 2011 should be week 2'); - assert.equal(moment([2011, 0, 9]).week(), 2, 'Jan 9 2011 should be week 2'); - assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); - }); - test('weeks year starting sunday format', function (assert) { assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1', 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1', 'Jan 1 2012 should be week 1'); @@ -30557,42 +31549,6 @@ assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3', 'Jan 9 2012 should be week 3'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -30602,6 +31558,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -30645,6 +31700,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('ta'); @@ -30847,67 +31903,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 7]).week(), 1, 'Jan 7 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 14]).week(), 2, 'Jan 14 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1'); - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 2, 'Jan 7 2007 should be week 2'); - assert.equal(moment([2007, 0, 13]).week(), 2, 'Jan 13 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 3, 'Jan 14 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 2, 'Jan 6 2008 should be week 2'); - assert.equal(moment([2008, 0, 12]).week(), 2, 'Jan 12 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 3, 'Jan 13 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 2, 'Jan 5 2003 should be week 2'); - assert.equal(moment([2003, 0, 11]).week(), 2, 'Jan 11 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 3, 'Jan 12 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 2, 'Jan 4 2009 should be week 2'); - assert.equal(moment([2009, 0, 10]).week(), 2, 'Jan 10 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 3, 'Jan 11 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 2]).week(), 1, 'Jan 2 2010 should be week 1'); - assert.equal(moment([2010, 0, 3]).week(), 2, 'Jan 3 2010 should be week 2'); - assert.equal(moment([2010, 0, 9]).week(), 2, 'Jan 9 2010 should be week 2'); - assert.equal(moment([2010, 0, 10]).week(), 3, 'Jan 10 2010 should be week 3'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1'); - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 2]).week(), 2, 'Jan 2 2011 should be week 2'); - assert.equal(moment([2011, 0, 8]).week(), 2, 'Jan 8 2011 should be week 2'); - assert.equal(moment([2011, 0, 9]).week(), 3, 'Jan 9 2011 should be week 3'); - }); - test('meridiem', function (assert) { assert.equal(moment([2011, 2, 23, 0, 30]).format('a'), ' யாமம்', '(after) midnight'); assert.equal(moment([2011, 2, 23, 2, 30]).format('a'), ' வைகறை', 'before dawn'); @@ -30918,62 +31913,113 @@ assert.equal(moment([2011, 2, 23, 23, 30]).format('a'), ' யாமம்', '(before) midnight'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); +})); - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : + typeof define === 'function' && define.amd ? define(['../../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); } - }); + } - test('meridiem invariant', function (assert) { - var h, m, t1, t2; - for (h = 0; h < 24; ++h) { - for (m = 0; m < 60; m += 15) { - t1 = moment.utc([2000, 0, 1, h, m]); - t2 = moment(t1.format('A h:mm'), 'A h:mm'); - assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), - 'meridiem at ' + t1.format('HH:mm')); + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } } + return res; } - }); + } - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../../moment')) : - typeof define === 'function' && define.amd ? define(['../../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } /*global QUnit:false*/ @@ -31018,6 +32064,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('te'); @@ -31219,7 +32266,7 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('meridiem invariant', function (assert) { + test('meridiem', function (assert) { assert.equal(moment([2011, 2, 23, 2, 30]).format('a'), 'రాత్రి', 'before dawn'); assert.equal(moment([2011, 2, 23, 9, 30]).format('a'), 'ఉదయం', 'morning'); assert.equal(moment([2011, 2, 23, 14, 30]).format('a'), 'మధ్యాహ్నం', 'during day'); @@ -31235,67 +32282,6 @@ assert.equal(moment([2011, 2, 23, 21, 20]).format('A'), 'రాత్రి', 'night'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 7]).week(), 1, 'Jan 7 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 14]).week(), 2, 'Jan 14 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1'); - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 2, 'Jan 7 2007 should be week 2'); - assert.equal(moment([2007, 0, 13]).week(), 2, 'Jan 13 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 3, 'Jan 14 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 2, 'Jan 6 2008 should be week 2'); - assert.equal(moment([2008, 0, 12]).week(), 2, 'Jan 12 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 3, 'Jan 13 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 2, 'Jan 5 2003 should be week 2'); - assert.equal(moment([2003, 0, 11]).week(), 2, 'Jan 11 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 3, 'Jan 12 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 2, 'Jan 4 2009 should be week 2'); - assert.equal(moment([2009, 0, 10]).week(), 2, 'Jan 10 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 3, 'Jan 11 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 2]).week(), 1, 'Jan 2 2010 should be week 1'); - assert.equal(moment([2010, 0, 3]).week(), 2, 'Jan 3 2010 should be week 2'); - assert.equal(moment([2010, 0, 9]).week(), 2, 'Jan 9 2010 should be week 2'); - assert.equal(moment([2010, 0, 10]).week(), 3, 'Jan 10 2010 should be week 3'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1'); - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 2]).week(), 2, 'Jan 2 2011 should be week 2'); - assert.equal(moment([2011, 0, 8]).week(), 2, 'Jan 8 2011 should be week 2'); - assert.equal(moment([2011, 0, 9]).week(), 3, 'Jan 9 2011 should be week 3'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1వ', 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 7]).format('w ww wo'), '1 01 1వ', 'Jan 7 2012 should be week 1'); @@ -31304,62 +32290,113 @@ assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3వ', 'Jan 15 2012 should be week 3'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); +})); - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : + typeof define === 'function' && define.amd ? define(['../../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); } - }); + } - test('meridiem', function (assert) { - var h, m, t1, t2; - for (h = 0; h < 24; ++h) { - for (m = 0; m < 60; m += 15) { - t1 = moment.utc([2000, 0, 1, h, m]); - t2 = moment(t1.format('A h:mm'), 'A h:mm'); - assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), - 'meridiem at ' + t1.format('HH:mm')); + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } } + return res; } - }); + } - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../../moment')) : - typeof define === 'function' && define.amd ? define(['../../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } /*global QUnit:false*/ @@ -31404,6 +32441,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('th'); @@ -31568,67 +32606,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 7]).week(), 1, 'Jan 7 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 14]).week(), 2, 'Jan 14 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1'); - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 2, 'Jan 7 2007 should be week 2'); - assert.equal(moment([2007, 0, 13]).week(), 2, 'Jan 13 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 3, 'Jan 14 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 2, 'Jan 6 2008 should be week 2'); - assert.equal(moment([2008, 0, 12]).week(), 2, 'Jan 12 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 3, 'Jan 13 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 2, 'Jan 5 2003 should be week 2'); - assert.equal(moment([2003, 0, 11]).week(), 2, 'Jan 11 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 3, 'Jan 12 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 2, 'Jan 4 2009 should be week 2'); - assert.equal(moment([2009, 0, 10]).week(), 2, 'Jan 10 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 3, 'Jan 11 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 2]).week(), 1, 'Jan 2 2010 should be week 1'); - assert.equal(moment([2010, 0, 3]).week(), 2, 'Jan 3 2010 should be week 2'); - assert.equal(moment([2010, 0, 9]).week(), 2, 'Jan 9 2010 should be week 2'); - assert.equal(moment([2010, 0, 10]).week(), 3, 'Jan 10 2010 should be week 3'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1'); - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 2]).week(), 2, 'Jan 2 2011 should be week 2'); - assert.equal(moment([2011, 0, 8]).week(), 2, 'Jan 8 2011 should be week 2'); - assert.equal(moment([2011, 0, 9]).week(), 3, 'Jan 9 2011 should be week 3'); - }); - test('weeks year starting sunday format', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1', 'Jan 1 2012 should be week 1'); assert.equal(moment([2012, 0, 7]).format('w ww wo'), '1 01 1', 'Jan 7 2012 should be week 1'); @@ -31637,42 +32614,6 @@ assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3', 'Jan 15 2012 should be week 3'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -31682,6 +32623,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -31725,6 +32765,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('tl-ph'); @@ -31925,67 +32966,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); - assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); - assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); - assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); - assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); - assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); - assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); - assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); - assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); - assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); - assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1', 'Jan 2 2012 should be week 1'); @@ -31994,42 +32974,6 @@ assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2', 'Jan 15 2012 should be week 2'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -32039,6 +32983,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -32082,6 +33125,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('tlh'); @@ -32299,67 +33343,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); - assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); - assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); - assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); - assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); - assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); - assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); - assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); - assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); - assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); - assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52.', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1.', 'Jan 2 2012 should be week 1'); @@ -32368,42 +33351,6 @@ assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -32413,6 +33360,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -32456,6 +33502,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('tr'); @@ -32668,67 +33715,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); - assert.equal(moment([2010, 0, 4]).week(), 2, 'Jan 4 2010 should be week 2'); - assert.equal(moment([2010, 0, 10]).week(), 2, 'Jan 10 2010 should be week 2'); - assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); - assert.equal(moment([2011, 0, 3]).week(), 2, 'Jan 3 2011 should be week 2'); - assert.equal(moment([2011, 0, 9]).week(), 2, 'Jan 9 2011 should be week 2'); - assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1\'inci', 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1\'inci', 'Jan 1 2012 should be week 1'); @@ -32737,42 +33723,6 @@ assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3\'üncü', 'Jan 9 2012 should be week 3'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -32782,6 +33732,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -32825,6 +33874,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('tzl'); @@ -33030,67 +34080,6 @@ // Monday is the first day of the week. // The week that contains Jan 4th is the first week of the year. - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); - assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); - assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); - assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); - assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); - assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); - assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); - assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); - assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); - assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); - assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52.', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1.', 'Jan 2 2012 should be week 1'); @@ -33099,42 +34088,6 @@ assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -33144,6 +34097,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -33187,6 +34239,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('tzm-latn'); @@ -33388,65 +34441,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2011, 11, 31]).week(), 1, 'Dec 31 2011 should be week 1'); - assert.equal(moment([2012, 0, 6]).week(), 1, 'Jan 6 2012 should be week 1'); - assert.equal(moment([2012, 0, 7]).week(), 2, 'Jan 7 2012 should be week 2'); - assert.equal(moment([2012, 0, 13]).week(), 2, 'Jan 13 2012 should be week 2'); - assert.equal(moment([2012, 0, 14]).week(), 3, 'Jan 14 2012 should be week 3'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2006, 11, 30]).week(), 1, 'Dec 30 2006 should be week 1'); - assert.equal(moment([2007, 0, 5]).week(), 1, 'Jan 5 2007 should be week 1'); - assert.equal(moment([2007, 0, 6]).week(), 2, 'Jan 6 2007 should be week 2'); - assert.equal(moment([2007, 0, 12]).week(), 2, 'Jan 12 2007 should be week 2'); - assert.equal(moment([2007, 0, 13]).week(), 3, 'Jan 13 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 29]).week(), 1, 'Dec 29 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 4]).week(), 1, 'Jan 4 2008 should be week 1'); - assert.equal(moment([2008, 0, 5]).week(), 2, 'Jan 5 2008 should be week 2'); - assert.equal(moment([2008, 0, 11]).week(), 2, 'Jan 11 2008 should be week 2'); - assert.equal(moment([2008, 0, 12]).week(), 3, 'Jan 12 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 28]).week(), 1, 'Dec 28 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 3]).week(), 1, 'Jan 3 2003 should be week 1'); - assert.equal(moment([2003, 0, 4]).week(), 2, 'Jan 4 2003 should be week 2'); - assert.equal(moment([2003, 0, 10]).week(), 2, 'Jan 10 2003 should be week 2'); - assert.equal(moment([2003, 0, 11]).week(), 3, 'Jan 11 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 27]).week(), 1, 'Dec 27 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 2]).week(), 1, 'Jan 2 2009 should be week 1'); - assert.equal(moment([2009, 0, 3]).week(), 2, 'Jan 3 2009 should be week 2'); - assert.equal(moment([2009, 0, 9]).week(), 2, 'Jan 9 2009 should be week 2'); - assert.equal(moment([2009, 0, 10]).week(), 3, 'Jan 10 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 26]).week(), 1, 'Dec 26 2009 should be week 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 2]).week(), 2, 'Jan 2 2010 should be week 2'); - assert.equal(moment([2010, 0, 8]).week(), 2, 'Jan 8 2010 should be week 2'); - assert.equal(moment([2010, 0, 9]).week(), 3, 'Jan 9 2010 should be week 3'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 7]).week(), 1, 'Jan 7 2011 should be week 1'); - assert.equal(moment([2011, 0, 8]).week(), 2, 'Jan 8 2011 should be week 2'); - assert.equal(moment([2011, 0, 14]).week(), 2, 'Jan 14 2011 should be week 2'); - assert.equal(moment([2011, 0, 15]).week(), 3, 'Jan 15 2011 should be week 3'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2011, 11, 31]).format('w ww wo'), '1 01 1', 'Dec 31 2011 should be week 1'); assert.equal(moment([2012, 0, 6]).format('w ww wo'), '1 01 1', 'Jan 6 2012 should be week 1'); @@ -33455,42 +34449,6 @@ assert.equal(moment([2012, 0, 14]).format('w ww wo'), '3 03 3', 'Jan 14 2012 should be week 3'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -33500,6 +34458,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -33543,6 +34600,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('tzm'); @@ -33744,65 +34802,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2011, 11, 31]).week(), 1, 'Dec 31 2011 should be week 1'); - assert.equal(moment([2012, 0, 6]).week(), 1, 'Jan 6 2012 should be week 1'); - assert.equal(moment([2012, 0, 7]).week(), 2, 'Jan 7 2012 should be week 2'); - assert.equal(moment([2012, 0, 13]).week(), 2, 'Jan 13 2012 should be week 2'); - assert.equal(moment([2012, 0, 14]).week(), 3, 'Jan 14 2012 should be week 3'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2006, 11, 30]).week(), 1, 'Dec 30 2006 should be week 1'); - assert.equal(moment([2007, 0, 5]).week(), 1, 'Jan 5 2007 should be week 1'); - assert.equal(moment([2007, 0, 6]).week(), 2, 'Jan 6 2007 should be week 2'); - assert.equal(moment([2007, 0, 12]).week(), 2, 'Jan 12 2007 should be week 2'); - assert.equal(moment([2007, 0, 13]).week(), 3, 'Jan 13 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 29]).week(), 1, 'Dec 29 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 4]).week(), 1, 'Jan 4 2008 should be week 1'); - assert.equal(moment([2008, 0, 5]).week(), 2, 'Jan 5 2008 should be week 2'); - assert.equal(moment([2008, 0, 11]).week(), 2, 'Jan 11 2008 should be week 2'); - assert.equal(moment([2008, 0, 12]).week(), 3, 'Jan 12 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 28]).week(), 1, 'Dec 28 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 3]).week(), 1, 'Jan 3 2003 should be week 1'); - assert.equal(moment([2003, 0, 4]).week(), 2, 'Jan 4 2003 should be week 2'); - assert.equal(moment([2003, 0, 10]).week(), 2, 'Jan 10 2003 should be week 2'); - assert.equal(moment([2003, 0, 11]).week(), 3, 'Jan 11 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 27]).week(), 1, 'Dec 27 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 2]).week(), 1, 'Jan 2 2009 should be week 1'); - assert.equal(moment([2009, 0, 3]).week(), 2, 'Jan 3 2009 should be week 2'); - assert.equal(moment([2009, 0, 9]).week(), 2, 'Jan 9 2009 should be week 2'); - assert.equal(moment([2009, 0, 10]).week(), 3, 'Jan 10 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 26]).week(), 1, 'Dec 26 2009 should be week 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 2]).week(), 2, 'Jan 2 2010 should be week 2'); - assert.equal(moment([2010, 0, 8]).week(), 2, 'Jan 8 2010 should be week 2'); - assert.equal(moment([2010, 0, 9]).week(), 3, 'Jan 9 2010 should be week 3'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 7]).week(), 1, 'Jan 7 2011 should be week 1'); - assert.equal(moment([2011, 0, 8]).week(), 2, 'Jan 8 2011 should be week 2'); - assert.equal(moment([2011, 0, 14]).week(), 2, 'Jan 14 2011 should be week 2'); - assert.equal(moment([2011, 0, 15]).week(), 3, 'Jan 15 2011 should be week 3'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2011, 11, 31]).format('w ww wo'), '1 01 1', 'Dec 31 2011 should be week 1'); assert.equal(moment([2012, 0, 6]).format('w ww wo'), '1 01 1', 'Jan 6 2012 should be week 1'); @@ -33811,42 +34810,6 @@ assert.equal(moment([2012, 0, 14]).format('w ww wo'), '3 03 3', 'Jan 14 2012 should be week 3'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -33856,6 +34819,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -33899,6 +34961,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('uk'); @@ -34133,67 +35196,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); - assert.equal(moment([2010, 0, 4]).week(), 2, 'Jan 4 2010 should be week 2'); - assert.equal(moment([2010, 0, 10]).week(), 2, 'Jan 10 2010 should be week 2'); - assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); - assert.equal(moment([2011, 0, 3]).week(), 2, 'Jan 3 2011 should be week 2'); - assert.equal(moment([2011, 0, 9]).week(), 2, 'Jan 9 2011 should be week 2'); - assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2011, 11, 26]).format('w ww wo'), '1 01 1-й', 'Dec 26 2011 should be week 1'); assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1-й', 'Jan 1 2012 should be week 1'); @@ -34202,42 +35204,6 @@ assert.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3-й', 'Jan 9 2012 should be week 3'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -34247,6 +35213,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -34290,6 +35355,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('uz'); @@ -34492,67 +35558,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 2'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 53'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 53'); - assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 53'); - assert.equal(moment([2010, 0, 4]).week(), 2, 'Jan 4 2010 should be week 1'); - assert.equal(moment([2010, 0, 10]).week(), 2, 'Jan 10 2010 should be week 1'); - assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 2'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 52'); - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 52'); - assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 52'); - assert.equal(moment([2011, 0, 3]).week(), 2, 'Jan 3 2011 should be week 1'); - assert.equal(moment([2011, 0, 9]).week(), 2, 'Jan 9 2011 should be week 1'); - assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 2'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '2 02 2', 'Jan 2 2012 should be week 1'); @@ -34561,42 +35566,6 @@ assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3', 'Jan 15 2012 should be week 2'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -34606,6 +35575,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -34649,6 +35717,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('vi'); @@ -34676,8 +35745,8 @@ test('format', function (assert) { var a = [ - ['dddd, MMMM Do YYYY, h:mm:ss a', 'chủ nhật, tháng 2 14 2010, 3:25:50 pm'], - ['ddd, hA', 'CN, 3PM'], + ['dddd, MMMM Do YYYY, h:mm:ss a', 'chủ nhật, tháng 2 14 2010, 3:25:50 ch'], + ['ddd, hA', 'CN, 3CH'], ['M Mo MM MMMM MMM', '2 2 02 tháng 2 Th02'], ['YYYY YY', '2010 10'], ['D Do DD', '14 14 14'], @@ -34688,7 +35757,7 @@ ['H HH', '15 15'], ['m mm', '25 25'], ['s ss', '50 50'], - ['a A', 'pm PM'], + ['a A', 'ch CH'], ['[ngày thứ] DDDo [của năm]', 'ngày thứ 45 của năm'], ['LTS', '15:25:50'], ['L', '14/02/2010'], @@ -34861,67 +35930,6 @@ assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); - assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); - assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); - assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); - assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); - assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); - assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); - assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); - assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); - assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); - assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); - assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); - }); - test('weeks year starting sunday formatted', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52', 'Jan 1 2012 should be week 52'); assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1', 'Jan 2 2012 should be week 1'); @@ -34930,42 +35938,6 @@ assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2', 'Jan 15 2012 should be week 2'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); - - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); - } - }); - - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); - } - }); - })); ;(function (global, factory) { @@ -34975,6 +35947,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -35018,6 +36089,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('zh-cn'); @@ -35216,121 +36288,119 @@ assert.equal(moment([2011, 2, 23, 18, 0]).format('A'), '晚上', 'night'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); - assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 52'); - assert.equal(moment([2012, 0, 7]).week(), 1, 'Jan 7 2012 should be week 1'); - assert.equal(moment([2012, 0, 14]).week(), 2, 'Jan 14 2012 should be week 2'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2006, 11, 31]).week(), 52, 'Dec 31 2006 should be week 52'); - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); - assert.equal(moment([2007, 0, 13]).week(), 2, 'Jan 13 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); - assert.equal(moment([2008, 0, 12]).week(), 2, 'Jan 12 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 29]).week(), 52, 'Dec 29 2002 should be week 52'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); - assert.equal(moment([2003, 0, 11]).week(), 2, 'Jan 11 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); - assert.equal(moment([2009, 0, 10]).week(), 2, 'Jan 10 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2010, 0, 2]).week(), 53, 'Jan 2 2010 should be week 53'); - assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); - assert.equal(moment([2011, 0, 8]).week(), 1, 'Jan 8 2011 should be week 1'); - assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); - }); - test('weeks year starting sunday format', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52周', 'Jan 1 2012 应该是第52周'); assert.equal(moment([2012, 0, 7]).format('w ww wo'), '1 01 1周', 'Jan 7 2012 应该是第 1周'); assert.equal(moment([2012, 0, 14]).format('w ww wo'), '2 02 2周', 'Jan 14 2012 应该是第 2周'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); +})); - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : + typeof define === 'function' && define.amd ? define(['../../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); } - }); + } - test('meridiem invariant', function (assert) { - var h, m, t1, t2; - for (h = 0; h < 24; ++h) { - for (m = 0; m < 60; m += 15) { - t1 = moment.utc([2000, 0, 1, h, m]); - t2 = moment(t1.format('A h:mm'), 'A h:mm'); - assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), - 'meridiem at ' + t1.format('HH:mm')); + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } } + return res; } - }); + } - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../../moment')) : - typeof define === 'function' && define.amd ? define(['../../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } /*global QUnit:false*/ @@ -35375,6 +36445,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } localeModule('zh-tw'); @@ -35556,67 +36627,6 @@ assert.equal(moment([2011, 2, 23, 18, 0]).format('A'), '晚上', 'night'); }); - test('weeks year starting sunday', function (assert) { - assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); - assert.equal(moment([2012, 0, 7]).week(), 1, 'Jan 7 2012 should be week 1'); - assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); - assert.equal(moment([2012, 0, 14]).week(), 2, 'Jan 14 2012 should be week 2'); - assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3'); - }); - - test('weeks year starting monday', function (assert) { - assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1'); - assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); - assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 should be week 1'); - assert.equal(moment([2007, 0, 7]).week(), 2, 'Jan 7 2007 should be week 2'); - assert.equal(moment([2007, 0, 13]).week(), 2, 'Jan 13 2007 should be week 2'); - assert.equal(moment([2007, 0, 14]).week(), 3, 'Jan 14 2007 should be week 3'); - }); - - test('weeks year starting tuesday', function (assert) { - assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52'); - assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); - assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 should be week 1'); - assert.equal(moment([2008, 0, 6]).week(), 2, 'Jan 6 2008 should be week 2'); - assert.equal(moment([2008, 0, 12]).week(), 2, 'Jan 12 2008 should be week 2'); - assert.equal(moment([2008, 0, 13]).week(), 3, 'Jan 13 2008 should be week 3'); - }); - - test('weeks year starting wednesday', function (assert) { - assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1'); - assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); - assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 should be week 1'); - assert.equal(moment([2003, 0, 5]).week(), 2, 'Jan 5 2003 should be week 2'); - assert.equal(moment([2003, 0, 11]).week(), 2, 'Jan 11 2003 should be week 2'); - assert.equal(moment([2003, 0, 12]).week(), 3, 'Jan 12 2003 should be week 3'); - }); - - test('weeks year starting thursday', function (assert) { - assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1'); - assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); - assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 should be week 1'); - assert.equal(moment([2009, 0, 4]).week(), 2, 'Jan 4 2009 should be week 2'); - assert.equal(moment([2009, 0, 10]).week(), 2, 'Jan 10 2009 should be week 2'); - assert.equal(moment([2009, 0, 11]).week(), 3, 'Jan 11 2009 should be week 3'); - }); - - test('weeks year starting friday', function (assert) { - assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1'); - assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); - assert.equal(moment([2010, 0, 2]).week(), 1, 'Jan 2 2010 should be week 1'); - assert.equal(moment([2010, 0, 3]).week(), 2, 'Jan 3 2010 should be week 2'); - assert.equal(moment([2010, 0, 9]).week(), 2, 'Jan 9 2010 should be week 2'); - assert.equal(moment([2010, 0, 10]).week(), 3, 'Jan 10 2010 should be week 3'); - }); - - test('weeks year starting saturday', function (assert) { - assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1'); - assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); - assert.equal(moment([2011, 0, 2]).week(), 2, 'Jan 2 2011 should be week 2'); - assert.equal(moment([2011, 0, 8]).week(), 2, 'Jan 8 2011 should be week 2'); - assert.equal(moment([2011, 0, 9]).week(), 3, 'Jan 9 2011 should be week 3'); - }); - test('weeks year starting sunday format', function (assert) { assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1週', 'Jan 1 2012 應該是第 1週'); assert.equal(moment([2012, 0, 7]).format('w ww wo'), '1 01 1週', 'Jan 7 2012 應該是第 1週'); @@ -35625,62 +36635,113 @@ assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3週', 'Jan 15 2012 應該是第 3週'); }); - test('lenient ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing ' + i + ' date check'); - } - }); +})); - test('lenient ordinal parsing of number', function (assert) { - var i, testMoment; - for (i = 1; i <= 31; ++i) { - testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); - assert.equal(testMoment.year(), 2014, - 'lenient ordinal parsing of number ' + i + ' year check'); - assert.equal(testMoment.month(), 0, - 'lenient ordinal parsing of number ' + i + ' month check'); - assert.equal(testMoment.date(), i, - 'lenient ordinal parsing of number ' + i + ' date check'); +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : + typeof define === 'function' && define.amd ? define(['../../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); } - }); + } - test('meridiem invariant', function (assert) { - var h, m, t1, t2; - for (h = 0; h < 24; ++h) { - for (m = 0; m < 60; m += 15) { - t1 = moment.utc([2000, 0, 1, h, m]); - t2 = moment(t1.format('A h:mm'), 'A h:mm'); - assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), - 'meridiem at ' + t1.format('HH:mm')); + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } } + return res; } - }); + } - test('strict ordinal parsing', function (assert) { - var i, ordinalStr, testMoment; - for (i = 1; i <= 31; ++i) { - ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); - testMoment = moment(ordinalStr, 'YYYY MM Do', true); - assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../../moment')) : - typeof define === 'function' && define.amd ? define(['../../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } /*global QUnit:false*/ @@ -35725,6 +36786,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } module('add and subtract'); @@ -36050,6 +37112,26 @@ assert.equal(e.hours(), 5, 'adding quarters over DST difference should result in the same hour'); }); + test('add decimal values of days and months', function (assert) { + assert.equal(moment([2016,3,3]).add(1.5, 'days').date(), 5, 'adding 1.5 days is rounded to adding 2 day'); + assert.equal(moment([2016,3,3]).add(-1.5, 'days').date(), 1, 'adding -1.5 days is rounded to adding -2 day'); + assert.equal(moment([2016,3,1]).add(-1.5, 'days').date(), 30, 'adding -1.5 days on first of month wraps around'); + assert.equal(moment([2016,3,3]).add(1.5, 'months').month(), 5, 'adding 1.5 months adds 2 months'); + assert.equal(moment([2016,3,3]).add(-1.5, 'months').month(), 1, 'adding -1.5 months adds -2 months'); + assert.equal(moment([2016,0,3]).add(-1.5, 'months').month(), 10, 'adding -1.5 months at start of year wraps back'); + assert.equal(moment([2016,3,3]).subtract(1.5, 'days').date(),1, 'subtract 1.5 days is rounded to subtract 2 day'); + assert.equal(moment([2016,3,2]).subtract(1.5, 'days').date(), 31, 'subtract 1.5 days subtracts 2 days'); + assert.equal(moment([2016,1,1]).subtract(1.1, 'days').date(), 31, 'subtract 1.1 days wraps to previous month'); + assert.equal(moment([2016,3,3]).subtract(-1.5, 'days').date(), 5, 'subtract -1.5 days is rounded to subtract -2 day'); + assert.equal(moment([2016,3,30]).subtract(-1.5, 'days').date(), 2, 'subtract -1.5 days on last of month wraps around'); + assert.equal(moment([2016,3,3]).subtract(1.5, 'months').month(), 1, 'subtract 1.5 months subtract 2 months'); + assert.equal(moment([2016,3,3]).subtract(-1.5, 'months').month(), 5, 'subtract -1.5 months subtract -2 month'); + assert.equal(moment([2016,11,31]).subtract(-1.5, 'months').month(),1, 'subtract -1.5 months at end of year wraps back'); + assert.equal(moment([2016, 0,1]).add(1.5, 'years').format('YYYY-MM-DD'), '2017-07-01', 'add 1.5 years adds 1 year six months'); + assert.equal(moment([2016, 0,1]).add(1.6, 'years').format('YYYY-MM-DD'), '2017-08-01', 'add 1.6 years becomes 1.6*12 = 19.2, round, 19 months'); + assert.equal(moment([2016,0,1]).add(1.1, 'quarters').format('YYYY-MM-DD'), '2016-04-01', 'add 1.1 quarters 1.1*3=3.3, round, 3 months'); + }); + })); ;(function (global, factory) { @@ -36059,6 +37141,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -36102,6 +37283,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } // These tests are for locale independent features @@ -36126,6 +37308,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -36169,6 +37450,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } module('create'); @@ -37221,6 +38503,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -37264,6 +38645,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } module('creation data'); @@ -37307,6 +38689,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -37350,13 +38831,7 @@ } } }); - } - - function each(array, callback) { - var i; - for (i = 0; i < array.length; i++) { - callback(array[i], i, array); - } + defineCommonLocaleTests(name, -1, -1); } module('days in month'); @@ -37386,6 +38861,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -37429,6 +39003,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } function hasOwnProp(a, b) { @@ -37518,6 +39093,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -37561,6 +39235,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } function equal(assert, a, b, message) { @@ -37804,6 +39479,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -37847,6 +39621,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } module('duration'); @@ -38098,6 +39873,7 @@ test('instantiation from ISO 8601 duration', function (assert) { assert.equal(moment.duration('P1Y2M3DT4H5M6S').asSeconds(), moment.duration({y: 1, M: 2, d: 3, h: 4, m: 5, s: 6}).asSeconds(), 'all fields'); + assert.equal(moment.duration('P3W3D').asSeconds(), moment.duration({w: 3, d: 3}).asSeconds(), 'week and day fields'); assert.equal(moment.duration('P1M').asSeconds(), moment.duration({M: 1}).asSeconds(), 'single month field'); assert.equal(moment.duration('PT1M').asSeconds(), moment.duration({m: 1}).asSeconds(), 'single minute field'); assert.equal(moment.duration('P1MT2H').asSeconds(), moment.duration({M: 1, h: 2}).asSeconds(), 'random fields missing'); @@ -38486,6 +40262,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -38529,6 +40404,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } module('duration from moments'); @@ -38583,6 +40459,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -38626,6 +40601,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } module('format'); @@ -38968,54 +40944,44 @@ assert.equal(moment([2000, 0, 2]).format('Qo [quarter] YYYY'), '1st quarter 2000', 'Jan 2 2000 is 1st quarter'); }); - test('full expanded format is returned from abbreviated formats', function (assert) { - function forEach(ar, fn) { - if (ar.forEach) { - return ar.forEach(fn); - } else { - // IE8 - for (var i = 0; i < ar.length; i += 1) { - fn(ar[i]); - } - } - } - function objectKeys(obj) { - if (Object.keys) { - return Object.keys(obj); - } else { - // IE8 - var res = [], i; - for (i in obj) { - if (obj.hasOwnProperty(i)) { - res.push(i); - } - } - return res; - } - } - - var locales = - 'ar-sa ar-tn ar az be bg bn bo br bs ca cs cv cy da de-at de dv el ' + - 'en-au en-ca en-gb en-ie en-nz eo es et eu fa fi fo fr-ca fr-ch fr fy ' + - 'gd gl he hi hr hu hy-am id is it ja jv ka kk km ko lb lo lt lv me mk ml ' + - 'mr ms-my ms my nb ne nl nn pl pt-br pt ro ru se si sk sl sq sr-cyrl ' + - 'sr sv sw ta te th tl-ph tlh tr tzl tzm-latn tzm uk uz vi zh-cn zh-tw'; - - forEach(locales.split(' '), function (locale) { - var data, tokens; - data = moment().locale(locale).localeData()._longDateFormat; - tokens = objectKeys(data); - forEach(tokens, function (token) { - // Check each format string to make sure it does not contain any - // tokens that need to be expanded. - forEach(tokens, function (i) { - // strip escaped sequences - var format = data[i].replace(/(\[[^\]]*\])/g, ''); - assert.equal(false, !!~format.indexOf(token), 'locale ' + locale + ' contains ' + token + ' in ' + i); - }); - }); - }); - }); + // test('full expanded format is returned from abbreviated formats', function (assert) { + // function objectKeys(obj) { + // if (Object.keys) { + // return Object.keys(obj); + // } else { + // // IE8 + // var res = [], i; + // for (i in obj) { + // if (obj.hasOwnProperty(i)) { + // res.push(i); + // } + // } + // return res; + // } + // } + + // var locales = + // 'ar-sa ar-tn ar az be bg bn bo br bs ca cs cv cy da de-at de dv el ' + + // 'en-au en-ca en-gb en-ie en-nz eo es et eu fa fi fo fr-ca fr-ch fr fy ' + + // 'gd gl he hi hr hu hy-am id is it ja jv ka kk km ko lb lo lt lv me mk ml ' + + // 'mr ms-my ms my nb ne nl nn pl pt-br pt ro ru se si sk sl sq sr-cyrl ' + + // 'sr sv sw ta te th tl-ph tlh tr tzl tzm-latn tzm uk uz vi zh-cn zh-tw'; + + // each(locales.split(' '), function (locale) { + // var data, tokens; + // data = moment().locale(locale).localeData()._longDateFormat; + // tokens = objectKeys(data); + // each(tokens, function (token) { + // // Check each format string to make sure it does not contain any + // // tokens that need to be expanded. + // each(tokens, function (i) { + // // strip escaped sequences + // var format = data[i].replace(/(\[[^\]]*\])/g, ''); + // assert.equal(false, !!~format.indexOf(token), 'locale ' + locale + ' contains ' + token + ' in ' + i); + // }); + // }); + // }); + // }); test('milliseconds', function (assert) { var m = moment('123', 'SSS'); @@ -39071,6 +41037,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -39114,6 +41179,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } module('from_to'); @@ -39175,6 +41241,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -39218,6 +41383,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } module('getters and setters'); @@ -39456,6 +41622,25 @@ assert.equal(moment(a).day(17).date(), 26, 'set from wednesday to second next wednesday'); }); + test('string setters', function (assert) { + var a = moment(); + a.year('2011'); + a.month('9'); + a.date('12'); + a.hours('6'); + a.minutes('7'); + a.seconds('8'); + a.milliseconds('9'); + assert.equal(a.year(), 2011, 'year'); + assert.equal(a.month(), 9, 'month'); + assert.equal(a.date(), 12, 'date'); + assert.equal(a.day(), 3, 'day'); + assert.equal(a.hours(), 6, 'hour'); + assert.equal(a.minutes(), 7, 'minute'); + assert.equal(a.seconds(), 8, 'second'); + assert.equal(a.milliseconds(), 9, 'milliseconds'); + }); + })); ;(function (global, factory) { @@ -39465,6 +41650,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -39508,6 +41792,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } module('instanceof'); @@ -39545,6 +41830,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -39588,6 +41972,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } module('invalid'); @@ -39688,7 +42073,7 @@ }); assert.ok(moment.isDate(invalid.toDate())); assert.ok(isNaN(invalid.toDate().valueOf())); - assert.equal(invalid.toJSON(), 'null'); + assert.equal(invalid.toJSON(), null); assert.equal(invalid.toString(), 'Invalid date'); assert.ok(isNaN(invalid.unix())); assert.ok(isNaN(invalid.valueOf())); @@ -39776,6 +42161,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -39819,6 +42303,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } module('is after'); @@ -40005,6 +42490,279 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + + /*global QUnit:false*/ + + var test = QUnit.test; + + var expect = QUnit.expect; + + function module (name, lifecycle) { + QUnit.module(name, { + setup : function () { + moment.locale('en'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); + }; + if (lifecycle && lifecycle.setup) { + lifecycle.setup(); + } + }, + teardown : function () { + if (lifecycle && lifecycle.teardown) { + lifecycle.teardown(); + } + } + }); + } + + function localeModule (name, lifecycle) { + QUnit.module('locale:' + name, { + setup : function () { + moment.locale(name); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); + }; + if (lifecycle && lifecycle.setup) { + lifecycle.setup(); + } + }, + teardown : function () { + moment.locale('en'); + if (lifecycle && lifecycle.teardown) { + lifecycle.teardown(); + } + } + }); + defineCommonLocaleTests(name, -1, -1); + } + + function isArray(input) { + return input instanceof Array || Object.prototype.toString.call(input) === '[object Array]'; + } + + test('isArray recognizes Array objects', function (assert) { + assert.ok(isArray([1,2,3]), 'array args'); + assert.ok(isArray([]), 'empty array'); + assert.ok(isArray(new Array(1,2,3)), 'array constructor'); + }); + + test('isArray rejects non-Array objects', function (assert) { + assert.ok(!isArray(), 'nothing'); + assert.ok(!isArray(undefined), 'undefined'); + assert.ok(!isArray(null), 'null'); + assert.ok(!isArray(123), 'number'); + assert.ok(!isArray('[1,2,3]'), 'string'); + assert.ok(!isArray(new Date()), 'date'); + assert.ok(!isArray({a:1,b:2}), 'object'); + }); + +})); + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : + typeof define === 'function' && define.amd ? define(['../../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -40048,6 +42806,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } module('is before'); @@ -40234,6 +42993,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -40277,6 +43135,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } module('is between'); @@ -40506,6 +43365,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -40549,6 +43507,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } module('is date'); @@ -40582,6 +43541,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -40625,6 +43683,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } module('is moment'); @@ -40677,6 +43736,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -40720,6 +43878,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } module('is same'); @@ -40880,6 +44039,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -40923,6 +44181,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } module('is same or after'); @@ -41114,6 +44373,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -41157,6 +44515,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } module('is same or before'); @@ -41348,6 +44707,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -41391,6 +44849,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } module('is valid'); @@ -41677,6 +45136,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -41720,6 +45278,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } module('leap year'); @@ -41740,6 +45299,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -41783,6 +45441,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } module('listers'); @@ -41872,6 +45531,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -41915,13 +45673,7 @@ } } }); - } - - function each(array, callback) { - var i; - for (i = 0; i < array.length; i++) { - callback(array[i], i, array); - } + defineCommonLocaleTests(name, -1, -1); } module('locale', { @@ -42074,6 +45826,12 @@ assert.equal(moment().locale('dude').locale(), 'dude', 'defineLocale defines a locale'); }); + test('locales', function (assert) { + moment.defineLocale('dude', {months: ['Movember']}); + assert.equal(true, !!~moment.locales().indexOf('dude'), 'locales returns an array of defined locales'); + assert.equal(true, !!~moment.locales().indexOf('en'), 'locales should always include english'); + }); + test('library convenience', function (assert) { moment.locale('something', {week: {dow: 3}}); moment.locale('something'); @@ -42239,166 +45997,802 @@ var a = moment([2012, 5, 6]).locale('es'), b = moment([2012, 5, 7]); - assert.equal(a.from(b), 'hace un día', 'preserve locale of first moment'); - assert.equal(b.from(a), 'in a day', 'do not preserve locale of second moment'); + assert.equal(a.from(b), 'hace un día', 'preserve locale of first moment'); + assert.equal(b.from(a), 'in a day', 'do not preserve locale of second moment'); + }); + + test('instance localeData', function (assert) { + moment.defineLocale('dude', {week: {dow: 3}}); + assert.equal(moment().locale('dude').localeData()._week.dow, 3); + }); + + test('month name callback function', function (assert) { + function fakeReplace(m, format) { + if (/test/.test(format)) { + return 'test'; + } + if (m.date() === 1) { + return 'date'; + } + return 'default'; + } + + moment.locale('made-up-2', { + months : fakeReplace, + monthsShort : fakeReplace, + weekdays : fakeReplace, + weekdaysShort : fakeReplace, + weekdaysMin : fakeReplace + }); + + assert.equal(moment().format('[test] dd ddd dddd MMM MMMM'), 'test test test test test test', 'format month name function should be able to access the format string'); + assert.equal(moment([2011, 0, 1]).format('dd ddd dddd MMM MMMM'), 'date date date date date', 'format month name function should be able to access the moment object'); + assert.equal(moment([2011, 0, 2]).format('dd ddd dddd MMM MMMM'), 'default default default default default', 'format month name function should be able to access the moment object'); + }); + + test('changing parts of a locale config', function (assert) { + moment.locale('partial-lang', { + months : 'a b c d e f g h i j k l'.split(' ') + }); + + assert.equal(moment([2011, 0, 1]).format('MMMM'), 'a', 'should be able to set locale values when creating the localeuage'); + + moment.locale('partial-lang', { + monthsShort : 'A B C D E F G H I J K L'.split(' ') + }); + + assert.equal(moment([2011, 0, 1]).format('MMMM MMM'), 'a A', 'should be able to set locale values after creating the localeuage'); + }); + + test('start/endOf week feature for first-day-is-monday locales', function (assert) { + moment.locale('monday-lang', { + week : { + dow : 1 // Monday is the first day of the week + } + }); + + moment.locale('monday-lang'); + assert.equal(moment([2013, 0, 1]).startOf('week').day(), 1, 'for locale monday-lang first day of the week should be monday'); + assert.equal(moment([2013, 0, 1]).endOf('week').day(), 0, 'for locale monday-lang last day of the week should be sunday'); + }); + + test('meridiem parsing', function (assert) { + moment.locale('meridiem-parsing', { + meridiemParse : /[bd]/i, + isPM : function (input) { + return input === 'b'; + } + }); + + moment.locale('meridiem-parsing'); + assert.equal(moment('2012-01-01 3b', 'YYYY-MM-DD ha').hour(), 15, 'Custom parsing of meridiem should work'); + assert.equal(moment('2012-01-01 3d', 'YYYY-MM-DD ha').hour(), 3, 'Custom parsing of meridiem should work'); + }); + + test('invalid date formatting', function (assert) { + moment.locale('has-invalid', { + invalidDate: 'KHAAAAAAAAAAAN!' + }); + + assert.equal(moment.invalid().format(), 'KHAAAAAAAAAAAN!'); + assert.equal(moment.invalid().format('YYYY-MM-DD'), 'KHAAAAAAAAAAAN!'); + }); + + test('return locale name', function (assert) { + var registered = moment.locale('return-this', {}); + + assert.equal(registered, 'return-this', 'returns the locale configured'); + }); + + test('changing the global locale doesn\'t affect existing instances', function (assert) { + var mom = moment(); + moment.locale('fr'); + assert.equal('en', mom.locale()); + }); + + test('setting a language on instance returns the original moment for chaining', function (assert) { + var mom = moment(); + + assert.equal(mom.lang('fr'), mom, 'setting the language (lang) returns the original moment for chaining'); + assert.equal(mom.locale('it'), mom, 'setting the language (locale) returns the original moment for chaining'); + }); + + test('lang(key) changes the language of the instance', function (assert) { + var m = moment().month(0); + m.lang('fr'); + assert.equal(m.locale(), 'fr', 'm.lang(key) changes instance locale'); + }); + + test('moment#locale(false) resets to global locale', function (assert) { + var m = moment(); + + moment.locale('fr'); + m.locale('it'); + + assert.equal(moment.locale(), 'fr', 'global locale is it'); + assert.equal(m.locale(), 'it', 'instance locale is it'); + m.locale(false); + assert.equal(m.locale(), 'fr', 'instance locale reset to global locale'); + }); + + test('moment().locale with missing key doesn\'t change locale', function (assert) { + assert.equal(moment().locale('boo').localeData(), moment.localeData(), + 'preserve global locale in case of bad locale id'); + }); + + test('moment().lang with missing key doesn\'t change locale', function (assert) { + assert.equal(moment().lang('boo').localeData(), moment.localeData(), + 'preserve global locale in case of bad locale id'); + }); + + + // TODO: Enable this after fixing pl months parse hack hack + // test('monthsParseExact', function (assert) { + // var locale = 'test-months-parse-exact'; + + // moment.defineLocale(locale, { + // monthsParseExact: true, + // months: 'A_AA_AAA_B_B B_BB B_C_C-C_C,C2C_D_D+D_D`D*D'.split('_'), + // monthsShort: 'E_EE_EEE_F_FF_FFF_G_GG_GGG_H_HH_HHH'.split('_') + // }); + + // assert.equal(moment('A', 'MMMM', true).month(), 0, 'parse long month 0 with MMMM'); + // assert.equal(moment('AA', 'MMMM', true).month(), 1, 'parse long month 1 with MMMM'); + // assert.equal(moment('AAA', 'MMMM', true).month(), 2, 'parse long month 2 with MMMM'); + // assert.equal(moment('B B', 'MMMM', true).month(), 4, 'parse long month 4 with MMMM'); + // assert.equal(moment('BB B', 'MMMM', true).month(), 5, 'parse long month 5 with MMMM'); + // assert.equal(moment('C-C', 'MMMM', true).month(), 7, 'parse long month 7 with MMMM'); + // assert.equal(moment('C,C2C', 'MMMM', true).month(), 8, 'parse long month 8 with MMMM'); + // assert.equal(moment('D+D', 'MMMM', true).month(), 10, 'parse long month 10 with MMMM'); + // assert.equal(moment('D`D*D', 'MMMM', true).month(), 11, 'parse long month 11 with MMMM'); + + // assert.equal(moment('E', 'MMM', true).month(), 0, 'parse long month 0 with MMM'); + // assert.equal(moment('EE', 'MMM', true).month(), 1, 'parse long month 1 with MMM'); + // assert.equal(moment('EEE', 'MMM', true).month(), 2, 'parse long month 2 with MMM'); + + // assert.equal(moment('A', 'MMM').month(), 0, 'non-strict parse long month 0 with MMM'); + // assert.equal(moment('AA', 'MMM').month(), 1, 'non-strict parse long month 1 with MMM'); + // assert.equal(moment('AAA', 'MMM').month(), 2, 'non-strict parse long month 2 with MMM'); + // assert.equal(moment('E', 'MMMM').month(), 0, 'non-strict parse short month 0 with MMMM'); + // assert.equal(moment('EE', 'MMMM').month(), 1, 'non-strict parse short month 1 with MMMM'); + // assert.equal(moment('EEE', 'MMMM').month(), 2, 'non-strict parse short month 2 with MMMM'); + // }); + +})); + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : + typeof define === 'function' && define.amd ? define(['../../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + + /*global QUnit:false*/ + + var test = QUnit.test; + + var expect = QUnit.expect; + + function module (name, lifecycle) { + QUnit.module(name, { + setup : function () { + moment.locale('en'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); + }; + if (lifecycle && lifecycle.setup) { + lifecycle.setup(); + } + }, + teardown : function () { + if (lifecycle && lifecycle.teardown) { + lifecycle.teardown(); + } + } + }); + } + + function localeModule (name, lifecycle) { + QUnit.module('locale:' + name, { + setup : function () { + moment.locale(name); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); + }; + if (lifecycle && lifecycle.setup) { + lifecycle.setup(); + } + }, + teardown : function () { + moment.locale('en'); + if (lifecycle && lifecycle.teardown) { + lifecycle.teardown(); + } + } + }); + defineCommonLocaleTests(name, -1, -1); + } + + module('locale inheritance'); + + test('calendar', function (assert) { + moment.defineLocale('base-cal', { + calendar : { + sameDay: '[Today at] HH:mm', + nextDay: '[Tomorrow at] HH:mm', + nextWeek: '[Next week at] HH:mm', + lastDay: '[Yesterday at] HH:mm', + lastWeek: '[Last week at] HH:mm', + sameElse: '[whatever]' + } + }); + moment.defineLocale('child-cal', { + parentLocale: 'base-cal', + calendar: { + sameDay: '[Today] HH:mm', + nextDay: '[Tomorrow] HH:mm', + nextWeek: '[Next week] HH:mm' + } + }); + + moment.locale('child-cal'); + var anchor = moment.utc('2015-05-05T12:00:00', moment.ISO_8601); + assert.equal(anchor.clone().add(3, 'hours').calendar(anchor), 'Today 15:00', 'today uses child version'); + assert.equal(anchor.clone().add(1, 'day').calendar(anchor), 'Tomorrow 12:00', 'tomorrow uses child version'); + assert.equal(anchor.clone().add(3, 'days').calendar(anchor), 'Next week 12:00', 'next week uses child version'); + + assert.equal(anchor.clone().subtract(1, 'day').calendar(anchor), 'Yesterday at 12:00', 'yesterday uses parent version'); + assert.equal(anchor.clone().subtract(3, 'days').calendar(anchor), 'Last week at 12:00', 'last week uses parent version'); + assert.equal(anchor.clone().subtract(7, 'days').calendar(anchor), 'whatever', 'sameElse uses parent version -'); + assert.equal(anchor.clone().add(7, 'days').calendar(anchor), 'whatever', 'sameElse uses parent version +'); + }); + + test('missing', function (assert) { + moment.defineLocale('base-cal-2', { + calendar: { + sameDay: '[Today at] HH:mm', + nextDay: '[Tomorrow at] HH:mm', + nextWeek: '[Next week at] HH:mm', + lastDay: '[Yesterday at] HH:mm', + lastWeek: '[Last week at] HH:mm', + sameElse: '[whatever]' + } + }); + moment.defineLocale('child-cal-2', { + parentLocale: 'base-cal-2' + }); + moment.locale('child-cal-2'); + var anchor = moment.utc('2015-05-05T12:00:00', moment.ISO_8601); + assert.equal(anchor.clone().add(3, 'hours').calendar(anchor), 'Today at 15:00', 'today uses parent version'); + assert.equal(anchor.clone().add(1, 'day').calendar(anchor), 'Tomorrow at 12:00', 'tomorrow uses parent version'); + assert.equal(anchor.clone().add(3, 'days').calendar(anchor), 'Next week at 12:00', 'next week uses parent version'); + assert.equal(anchor.clone().subtract(1, 'day').calendar(anchor), 'Yesterday at 12:00', 'yesterday uses parent version'); + assert.equal(anchor.clone().subtract(3, 'days').calendar(anchor), 'Last week at 12:00', 'last week uses parent version'); + assert.equal(anchor.clone().subtract(7, 'days').calendar(anchor), 'whatever', 'sameElse uses parent version -'); + assert.equal(anchor.clone().add(7, 'days').calendar(anchor), 'whatever', 'sameElse uses parent version +'); + }); + + // Test function vs obj both directions + + test('long date format', function (assert) { + moment.defineLocale('base-ldf', { + longDateFormat : { + 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' + } + }); + moment.defineLocale('child-ldf', { + parentLocale: 'base-ldf', + longDateFormat: { + LLL : '[child] MMMM D, YYYY h:mm A', + LLLL : '[child] dddd, MMMM D, YYYY h:mm A' + } + }); + + moment.locale('child-ldf'); + var anchor = moment.utc('2015-09-06T12:34:56', moment.ISO_8601); + assert.equal(anchor.format('LTS'), '12:34:56 PM', 'LTS uses base'); + assert.equal(anchor.format('LT'), '12:34 PM', 'LT uses base'); + assert.equal(anchor.format('L'), '09/06/2015', 'L uses base'); + assert.equal(anchor.format('l'), '9/6/2015', 'l uses base'); + assert.equal(anchor.format('LL'), 'September 6, 2015', 'LL uses base'); + assert.equal(anchor.format('ll'), 'Sep 6, 2015', 'll uses base'); + assert.equal(anchor.format('LLL'), 'child September 6, 2015 12:34 PM', 'LLL uses child'); + assert.equal(anchor.format('lll'), 'child Sep 6, 2015 12:34 PM', 'lll uses child'); + assert.equal(anchor.format('LLLL'), 'child Sunday, September 6, 2015 12:34 PM', 'LLLL uses child'); + assert.equal(anchor.format('llll'), 'child Sun, Sep 6, 2015 12:34 PM', 'llll uses child'); + }); + + test('ordinal', function (assert) { + moment.defineLocale('base-ordinal-1', { + ordinal : '%dx' + }); + moment.defineLocale('child-ordinal-1', { + parentLocale: 'base-ordinal-1', + ordinal : '%dy' + }); + + assert.equal(moment.utc('2015-02-03', moment.ISO_8601).format('Do'), '3y', 'ordinal uses child string'); + + moment.defineLocale('base-ordinal-2', { + ordinal : '%dx' + }); + moment.defineLocale('child-ordinal-2', { + parentLocale: 'base-ordinal-2', + ordinal : function (num) { + return num + 'y'; + } + }); + + assert.equal(moment.utc('2015-02-03', moment.ISO_8601).format('Do'), '3y', 'ordinal uses child function'); + + moment.defineLocale('base-ordinal-3', { + ordinal : function (num) { + return num + 'x'; + } + }); + moment.defineLocale('child-ordinal-3', { + parentLocale: 'base-ordinal-3', + ordinal : '%dy' + }); + + assert.equal(moment.utc('2015-02-03', moment.ISO_8601).format('Do'), '3y', 'ordinal uses child string (overwrite parent function)'); + }); + + test('ordinal parse', function (assert) { + moment.defineLocale('base-ordinal-parse-1', { + ordinalParse : /\d{1,2}x/ + }); + moment.defineLocale('child-ordinal-parse-1', { + parentLocale: 'base-ordinal-parse-1', + ordinalParse : /\d{1,2}y/ + }); + + assert.ok(moment.utc('2015-01-1y', 'YYYY-MM-Do', true).isValid(), 'ordinal parse uses child'); + + moment.defineLocale('base-ordinal-parse-2', { + ordinalParse : /\d{1,2}x/ + }); + moment.defineLocale('child-ordinal-parse-2', { + parentLocale: 'base-ordinal-parse-2', + ordinalParse : null + }); + + assert.ok(moment.utc('2015-01-1', 'YYYY-MM-Do', true).isValid(), 'ordinal parse uses child (default)'); }); - test('instance localeData', function (assert) { - moment.defineLocale('dude', {week: {dow: 3}}); - assert.equal(moment().locale('dude').localeData()._week.dow, 3); + test('months', function (assert) { + moment.defineLocale('base-months', { + months : 'One_Two_Three_Four_Five_Six_Seven_Eight_Nine_Ten_Eleven_Twelve'.split('_') + }); + moment.defineLocale('child-months', { + parentLocale: 'base-months', + months : 'First_Second_Third_Fourth_Fifth_Sixth_Seventh_Eighth_Ninth_Tenth_Eleventh_Twelveth '.split('_') + }); + assert.ok(moment.utc('2015-01-01', 'YYYY-MM-DD').format('MMMM'), 'First', 'months uses child'); }); - test('month name callback function', function (assert) { - function fakeReplace(m, format) { - if (/test/.test(format)) { - return 'test'; - } - if (m.date() === 1) { - return 'date'; +})); + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + && typeof require === 'function' ? factory(require('../../moment')) : + typeof define === 'function' && define.amd ? define(['../../moment'], factory) : + factory(global.moment) +}(this, function (moment) { 'use strict'; + + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } } - return 'default'; + return res; } + } - moment.locale('made-up-2', { - months : fakeReplace, - monthsShort : fakeReplace, - weekdays : fakeReplace, - weekdaysShort : fakeReplace, - weekdaysMin : fakeReplace + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } }); - assert.equal(moment().format('[test] dd ddd dddd MMM MMMM'), 'test test test test test test', 'format month name function should be able to access the format string'); - assert.equal(moment([2011, 0, 1]).format('dd ddd dddd MMM MMMM'), 'date date date date date', 'format month name function should be able to access the moment object'); - assert.equal(moment([2011, 0, 2]).format('dd ddd dddd MMM MMMM'), 'default default default default default', 'format month name function should be able to access the moment object'); - }); + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); - test('changing parts of a locale config', function (assert) { - moment.locale('partial-lang', { - months : 'a b c d e f g h i j k l'.split(' ') + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } }); - assert.equal(moment([2011, 0, 1]).format('MMMM'), 'a', 'should be able to set locale values when creating the localeuage'); + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); - moment.locale('partial-lang', { - monthsShort : 'A B C D E F G H I J K L'.split(' ') + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); }); + } - assert.equal(moment([2011, 0, 1]).format('MMMM MMM'), 'a A', 'should be able to set locale values after creating the localeuage'); - }); + /*global QUnit:false*/ - test('start/endOf week feature for first-day-is-monday locales', function (assert) { - moment.locale('monday-lang', { - week : { - dow : 1 // Monday is the first day of the week + var test = QUnit.test; + + var expect = QUnit.expect; + + function module (name, lifecycle) { + QUnit.module(name, { + setup : function () { + moment.locale('en'); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); + }; + if (lifecycle && lifecycle.setup) { + lifecycle.setup(); + } + }, + teardown : function () { + if (lifecycle && lifecycle.teardown) { + lifecycle.teardown(); + } } }); + } - moment.locale('monday-lang'); - assert.equal(moment([2013, 0, 1]).startOf('week').day(), 1, 'for locale monday-lang first day of the week should be monday'); - assert.equal(moment([2013, 0, 1]).endOf('week').day(), 0, 'for locale monday-lang last day of the week should be sunday'); - }); - - test('meridiem parsing', function (assert) { - moment.locale('meridiem-parsing', { - meridiemParse : /[bd]/i, - isPM : function (input) { - return input === 'b'; + function localeModule (name, lifecycle) { + QUnit.module('locale:' + name, { + setup : function () { + moment.locale(name); + moment.createFromInputFallback = function (config) { + throw new Error('input not handled by moment: ' + config._i); + }; + if (lifecycle && lifecycle.setup) { + lifecycle.setup(); + } + }, + teardown : function () { + moment.locale('en'); + if (lifecycle && lifecycle.teardown) { + lifecycle.teardown(); + } } }); + defineCommonLocaleTests(name, -1, -1); + } - moment.locale('meridiem-parsing'); - assert.equal(moment('2012-01-01 3b', 'YYYY-MM-DD ha').hour(), 15, 'Custom parsing of meridiem should work'); - assert.equal(moment('2012-01-01 3d', 'YYYY-MM-DD ha').hour(), 3, 'Custom parsing of meridiem should work'); - }); + module('locale update'); - test('invalid date formatting', function (assert) { - moment.locale('has-invalid', { - invalidDate: 'KHAAAAAAAAAAAN!' + test('calendar', function (assert) { + moment.defineLocale('cal', null); + moment.defineLocale('cal', { + calendar : { + sameDay: '[Today at] HH:mm', + nextDay: '[Tomorrow at] HH:mm', + nextWeek: '[Next week at] HH:mm', + lastDay: '[Yesterday at] HH:mm', + lastWeek: '[Last week at] HH:mm', + sameElse: '[whatever]' + } + }); + moment.updateLocale('cal', { + calendar: { + sameDay: '[Today] HH:mm', + nextDay: '[Tomorrow] HH:mm', + nextWeek: '[Next week] HH:mm' + } }); - assert.equal(moment.invalid().format(), 'KHAAAAAAAAAAAN!'); - assert.equal(moment.invalid().format('YYYY-MM-DD'), 'KHAAAAAAAAAAAN!'); - }); - - test('return locale name', function (assert) { - var registered = moment.locale('return-this', {}); + moment.locale('cal'); + var anchor = moment.utc('2015-05-05T12:00:00', moment.ISO_8601); + assert.equal(anchor.clone().add(3, 'hours').calendar(anchor), 'Today 15:00', 'today uses child version'); + assert.equal(anchor.clone().add(1, 'day').calendar(anchor), 'Tomorrow 12:00', 'tomorrow uses child version'); + assert.equal(anchor.clone().add(3, 'days').calendar(anchor), 'Next week 12:00', 'next week uses child version'); - assert.equal(registered, 'return-this', 'returns the locale configured'); + assert.equal(anchor.clone().subtract(1, 'day').calendar(anchor), 'Yesterday at 12:00', 'yesterday uses parent version'); + assert.equal(anchor.clone().subtract(3, 'days').calendar(anchor), 'Last week at 12:00', 'last week uses parent version'); + assert.equal(anchor.clone().subtract(7, 'days').calendar(anchor), 'whatever', 'sameElse uses parent version -'); + assert.equal(anchor.clone().add(7, 'days').calendar(anchor), 'whatever', 'sameElse uses parent version +'); }); - test('changing the global locale doesn\'t affect existing instances', function (assert) { - var mom = moment(); - moment.locale('fr'); - assert.equal('en', mom.locale()); + test('missing', function (assert) { + moment.defineLocale('cal-2', null); + moment.defineLocale('cal-2', { + calendar: { + sameDay: '[Today at] HH:mm', + nextDay: '[Tomorrow at] HH:mm', + nextWeek: '[Next week at] HH:mm', + lastDay: '[Yesterday at] HH:mm', + lastWeek: '[Last week at] HH:mm', + sameElse: '[whatever]' + } + }); + moment.updateLocale('cal-2', { + }); + moment.locale('cal-2'); + var anchor = moment.utc('2015-05-05T12:00:00', moment.ISO_8601); + assert.equal(anchor.clone().add(3, 'hours').calendar(anchor), 'Today at 15:00', 'today uses parent version'); + assert.equal(anchor.clone().add(1, 'day').calendar(anchor), 'Tomorrow at 12:00', 'tomorrow uses parent version'); + assert.equal(anchor.clone().add(3, 'days').calendar(anchor), 'Next week at 12:00', 'next week uses parent version'); + assert.equal(anchor.clone().subtract(1, 'day').calendar(anchor), 'Yesterday at 12:00', 'yesterday uses parent version'); + assert.equal(anchor.clone().subtract(3, 'days').calendar(anchor), 'Last week at 12:00', 'last week uses parent version'); + assert.equal(anchor.clone().subtract(7, 'days').calendar(anchor), 'whatever', 'sameElse uses parent version -'); + assert.equal(anchor.clone().add(7, 'days').calendar(anchor), 'whatever', 'sameElse uses parent version +'); }); - test('setting a language on instance returns the original moment for chaining', function (assert) { - var mom = moment(); + // Test function vs obj both directions - assert.equal(mom.lang('fr'), mom, 'setting the language (lang) returns the original moment for chaining'); - assert.equal(mom.locale('it'), mom, 'setting the language (locale) returns the original moment for chaining'); - }); + test('long date format', function (assert) { + moment.defineLocale('ldf', null); + moment.defineLocale('ldf', { + longDateFormat : { + 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' + } + }); + moment.updateLocale('ldf', { + longDateFormat: { + LLL : '[child] MMMM D, YYYY h:mm A', + LLLL : '[child] dddd, MMMM D, YYYY h:mm A' + } + }); - test('lang(key) changes the language of the instance', function (assert) { - var m = moment().month(0); - m.lang('fr'); - assert.equal(m.locale(), 'fr', 'm.lang(key) changes instance locale'); + moment.locale('ldf'); + var anchor = moment.utc('2015-09-06T12:34:56', moment.ISO_8601); + assert.equal(anchor.format('LTS'), '12:34:56 PM', 'LTS uses base'); + assert.equal(anchor.format('LT'), '12:34 PM', 'LT uses base'); + assert.equal(anchor.format('L'), '09/06/2015', 'L uses base'); + assert.equal(anchor.format('l'), '9/6/2015', 'l uses base'); + assert.equal(anchor.format('LL'), 'September 6, 2015', 'LL uses base'); + assert.equal(anchor.format('ll'), 'Sep 6, 2015', 'll uses base'); + assert.equal(anchor.format('LLL'), 'child September 6, 2015 12:34 PM', 'LLL uses child'); + assert.equal(anchor.format('lll'), 'child Sep 6, 2015 12:34 PM', 'lll uses child'); + assert.equal(anchor.format('LLLL'), 'child Sunday, September 6, 2015 12:34 PM', 'LLLL uses child'); + assert.equal(anchor.format('llll'), 'child Sun, Sep 6, 2015 12:34 PM', 'llll uses child'); }); - test('moment#locale(false) resets to global locale', function (assert) { - var m = moment(); + test('ordinal', function (assert) { + moment.defineLocale('ordinal-1', null); + moment.defineLocale('ordinal-1', { + ordinal : '%dx' + }); + moment.updateLocale('ordinal-1', { + ordinal : '%dy' + }); - moment.locale('fr'); - m.locale('it'); + assert.equal(moment.utc('2015-02-03', moment.ISO_8601).format('Do'), '3y', 'ordinal uses child string'); - assert.equal(moment.locale(), 'fr', 'global locale is it'); - assert.equal(m.locale(), 'it', 'instance locale is it'); - m.locale(false); - assert.equal(m.locale(), 'fr', 'instance locale reset to global locale'); - }); + moment.defineLocale('ordinal-2', null); + moment.defineLocale('ordinal-2', { + ordinal : '%dx' + }); + moment.defineLocale('ordinal-2', { + parentLocale: 'ordinal-2', + ordinal : function (num) { + return num + 'y'; + } + }); - test('moment().locale with missing key doesn\'t change locale', function (assert) { - assert.equal(moment().locale('boo').localeData(), moment.localeData(), - 'preserve global locale in case of bad locale id'); - }); + assert.equal(moment.utc('2015-02-03', moment.ISO_8601).format('Do'), '3y', 'ordinal uses child function'); - test('moment().lang with missing key doesn\'t change locale', function (assert) { - assert.equal(moment().lang('boo').localeData(), moment.localeData(), - 'preserve global locale in case of bad locale id'); - }); + moment.defineLocale('ordinal-3', null); + moment.defineLocale('ordinal-3', { + ordinal : function (num) { + return num + 'x'; + } + }); + moment.updateLocale('ordinal-3', { + ordinal : '%dy' + }); + assert.equal(moment.utc('2015-02-03', moment.ISO_8601).format('Do'), '3y', 'ordinal uses child string (overwrite parent function)'); + }); - // TODO: Enable this after fixing pl months parse hack hack - // test('monthsParseExact', function (assert) { - // var locale = 'test-months-parse-exact'; + test('ordinal parse', function (assert) { + moment.defineLocale('ordinal-parse-1', null); + moment.defineLocale('ordinal-parse-1', { + ordinalParse : /\d{1,2}x/ + }); + moment.updateLocale('ordinal-parse-1', { + ordinalParse : /\d{1,2}y/ + }); - // moment.defineLocale(locale, { - // monthsParseExact: true, - // months: 'A_AA_AAA_B_B B_BB B_C_C-C_C,C2C_D_D+D_D`D*D'.split('_'), - // monthsShort: 'E_EE_EEE_F_FF_FFF_G_GG_GGG_H_HH_HHH'.split('_') - // }); + assert.ok(moment.utc('2015-01-1y', 'YYYY-MM-Do', true).isValid(), 'ordinal parse uses child'); - // assert.equal(moment('A', 'MMMM', true).month(), 0, 'parse long month 0 with MMMM'); - // assert.equal(moment('AA', 'MMMM', true).month(), 1, 'parse long month 1 with MMMM'); - // assert.equal(moment('AAA', 'MMMM', true).month(), 2, 'parse long month 2 with MMMM'); - // assert.equal(moment('B B', 'MMMM', true).month(), 4, 'parse long month 4 with MMMM'); - // assert.equal(moment('BB B', 'MMMM', true).month(), 5, 'parse long month 5 with MMMM'); - // assert.equal(moment('C-C', 'MMMM', true).month(), 7, 'parse long month 7 with MMMM'); - // assert.equal(moment('C,C2C', 'MMMM', true).month(), 8, 'parse long month 8 with MMMM'); - // assert.equal(moment('D+D', 'MMMM', true).month(), 10, 'parse long month 10 with MMMM'); - // assert.equal(moment('D`D*D', 'MMMM', true).month(), 11, 'parse long month 11 with MMMM'); + moment.defineLocale('ordinal-parse-2', null); + moment.defineLocale('ordinal-parse-2', { + ordinalParse : /\d{1,2}x/ + }); + moment.updateLocale('ordinal-parse-2', { + ordinalParse : null + }); - // assert.equal(moment('E', 'MMM', true).month(), 0, 'parse long month 0 with MMM'); - // assert.equal(moment('EE', 'MMM', true).month(), 1, 'parse long month 1 with MMM'); - // assert.equal(moment('EEE', 'MMM', true).month(), 2, 'parse long month 2 with MMM'); + assert.ok(moment.utc('2015-01-1', 'YYYY-MM-Do', true).isValid(), 'ordinal parse uses child (default)'); + }); - // assert.equal(moment('A', 'MMM').month(), 0, 'non-strict parse long month 0 with MMM'); - // assert.equal(moment('AA', 'MMM').month(), 1, 'non-strict parse long month 1 with MMM'); - // assert.equal(moment('AAA', 'MMM').month(), 2, 'non-strict parse long month 2 with MMM'); - // assert.equal(moment('E', 'MMMM').month(), 0, 'non-strict parse short month 0 with MMMM'); - // assert.equal(moment('EE', 'MMMM').month(), 1, 'non-strict parse short month 1 with MMMM'); - // assert.equal(moment('EEE', 'MMMM').month(), 2, 'non-strict parse short month 2 with MMMM'); - // }); + test('months', function (assert) { + moment.defineLocale('months', null); + moment.defineLocale('months', { + months : 'One_Two_Three_Four_Five_Six_Seven_Eight_Nine_Ten_Eleven_Twelve'.split('_') + }); + moment.updateLocale('months', { + parentLocale: 'base-months', + months : 'First_Second_Third_Fourth_Fifth_Sixth_Seventh_Eighth_Ninth_Tenth_Eleventh_Twelveth '.split('_') + }); + assert.ok(moment.utc('2015-01-01', 'YYYY-MM-DD').format('MMMM'), 'First', 'months uses child'); + }); })); @@ -42409,6 +46803,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -42452,6 +46945,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } module('min max'); @@ -42509,6 +47003,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -42552,6 +47145,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } module('mutable'); @@ -42587,6 +47181,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -42630,6 +47323,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } module('normalize units'); @@ -42670,6 +47364,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -42713,6 +47506,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } module('now'); @@ -42778,6 +47572,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -42821,6 +47714,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } module('parsing flags'); @@ -42998,6 +47892,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -43041,6 +48034,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } var symbolMap = { @@ -43120,6 +48114,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -43163,6 +48256,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } module('quarter'); @@ -43273,6 +48367,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -43316,6 +48509,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } module('relative time'); @@ -43472,6 +48666,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -43515,6 +48808,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } module('start and end of units'); @@ -43882,6 +49176,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -43925,6 +49318,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } module('string prototype'); @@ -43950,6 +49344,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -43993,6 +49486,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } module('to type'); @@ -44024,6 +49518,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -44067,6 +49660,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } module('utc'); @@ -44154,6 +49748,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -44197,6 +49890,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } module('utc offset'); @@ -44775,6 +50469,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -44818,6 +50611,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } module('week year'); @@ -44911,6 +50705,180 @@ assert.equal(52, moment('2012-01-01', 'YYYY-MM-DD').weeksInYear(), 'weeks in 2012 are 52'); // 52 }); + test('weeks numbers dow:1 doy:4', function (assert) { + moment.locale('dow: 1, doy: 4', {week: {dow: 1, doy: 4}}); + assert.equal(moment([2012, 0, 1]).week(), 52, 'Jan 1 2012 should be week 52'); + assert.equal(moment([2012, 0, 2]).week(), 1, 'Jan 2 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).week(), 1, 'Jan 8 2012 should be week 1'); + assert.equal(moment([2012, 0, 9]).week(), 2, 'Jan 9 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).week(), 2, 'Jan 15 2012 should be week 2'); + assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); + assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); + assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); + assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); + assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); + assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); + assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); + assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); + assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); + assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); + assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); + assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); + assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); + assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); + assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); + assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); + assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); + assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); + assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); + assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); + assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); + assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); + assert.equal(moment([2009, 0, 13]).week(), 3, 'Jan 12 2009 should be week 3'); + assert.equal(moment([2009, 11, 28]).week(), 53, 'Dec 28 2009 should be week 53'); + assert.equal(moment([2010, 0, 1]).week(), 53, 'Jan 1 2010 should be week 53'); + assert.equal(moment([2010, 0, 3]).week(), 53, 'Jan 3 2010 should be week 53'); + assert.equal(moment([2010, 0, 4]).week(), 1, 'Jan 4 2010 should be week 1'); + assert.equal(moment([2010, 0, 10]).week(), 1, 'Jan 10 2010 should be week 1'); + assert.equal(moment([2010, 0, 11]).week(), 2, 'Jan 11 2010 should be week 2'); + assert.equal(moment([2010, 11, 27]).week(), 52, 'Dec 27 2010 should be week 52'); + assert.equal(moment([2011, 0, 1]).week(), 52, 'Jan 1 2011 should be week 52'); + assert.equal(moment([2011, 0, 2]).week(), 52, 'Jan 2 2011 should be week 52'); + assert.equal(moment([2011, 0, 3]).week(), 1, 'Jan 3 2011 should be week 1'); + assert.equal(moment([2011, 0, 9]).week(), 1, 'Jan 9 2011 should be week 1'); + assert.equal(moment([2011, 0, 10]).week(), 2, 'Jan 10 2011 should be week 2'); + }); + + test('weeks numbers dow:6 doy:12', function (assert) { + moment.locale('dow: 6, doy: 12', {week: {dow: 6, doy: 12}}); + assert.equal(moment([2011, 11, 31]).week(), 1, 'Dec 31 2011 should be week 1'); + assert.equal(moment([2012, 0, 6]).week(), 1, 'Jan 6 2012 should be week 1'); + assert.equal(moment([2012, 0, 7]).week(), 2, 'Jan 7 2012 should be week 2'); + assert.equal(moment([2012, 0, 13]).week(), 2, 'Jan 13 2012 should be week 2'); + assert.equal(moment([2012, 0, 14]).week(), 3, 'Jan 14 2012 should be week 3'); + assert.equal(moment([2006, 11, 30]).week(), 1, 'Dec 30 2006 should be week 1'); + assert.equal(moment([2007, 0, 5]).week(), 1, 'Jan 5 2007 should be week 1'); + assert.equal(moment([2007, 0, 6]).week(), 2, 'Jan 6 2007 should be week 2'); + assert.equal(moment([2007, 0, 12]).week(), 2, 'Jan 12 2007 should be week 2'); + assert.equal(moment([2007, 0, 13]).week(), 3, 'Jan 13 2007 should be week 3'); + assert.equal(moment([2007, 11, 29]).week(), 1, 'Dec 29 2007 should be week 1'); + assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); + assert.equal(moment([2008, 0, 4]).week(), 1, 'Jan 4 2008 should be week 1'); + assert.equal(moment([2008, 0, 5]).week(), 2, 'Jan 5 2008 should be week 2'); + assert.equal(moment([2008, 0, 11]).week(), 2, 'Jan 11 2008 should be week 2'); + assert.equal(moment([2008, 0, 12]).week(), 3, 'Jan 12 2008 should be week 3'); + assert.equal(moment([2002, 11, 28]).week(), 1, 'Dec 28 2002 should be week 1'); + assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); + assert.equal(moment([2003, 0, 3]).week(), 1, 'Jan 3 2003 should be week 1'); + assert.equal(moment([2003, 0, 4]).week(), 2, 'Jan 4 2003 should be week 2'); + assert.equal(moment([2003, 0, 10]).week(), 2, 'Jan 10 2003 should be week 2'); + assert.equal(moment([2003, 0, 11]).week(), 3, 'Jan 11 2003 should be week 3'); + assert.equal(moment([2008, 11, 27]).week(), 1, 'Dec 27 2008 should be week 1'); + assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); + assert.equal(moment([2009, 0, 2]).week(), 1, 'Jan 2 2009 should be week 1'); + assert.equal(moment([2009, 0, 3]).week(), 2, 'Jan 3 2009 should be week 2'); + assert.equal(moment([2009, 0, 9]).week(), 2, 'Jan 9 2009 should be week 2'); + assert.equal(moment([2009, 0, 10]).week(), 3, 'Jan 10 2009 should be week 3'); + assert.equal(moment([2009, 11, 26]).week(), 1, 'Dec 26 2009 should be week 1'); + assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); + assert.equal(moment([2010, 0, 2]).week(), 2, 'Jan 2 2010 should be week 2'); + assert.equal(moment([2010, 0, 8]).week(), 2, 'Jan 8 2010 should be week 2'); + assert.equal(moment([2010, 0, 9]).week(), 3, 'Jan 9 2010 should be week 3'); + assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); + assert.equal(moment([2011, 0, 7]).week(), 1, 'Jan 7 2011 should be week 1'); + assert.equal(moment([2011, 0, 8]).week(), 2, 'Jan 8 2011 should be week 2'); + assert.equal(moment([2011, 0, 14]).week(), 2, 'Jan 14 2011 should be week 2'); + assert.equal(moment([2011, 0, 15]).week(), 3, 'Jan 15 2011 should be week 3'); + }); + + test('weeks numbers dow:1 doy:7', function (assert) { + moment.locale('dow: 1, doy: 7', {week: {dow: 1, doy: 7}}); + assert.equal(moment([2011, 11, 26]).week(), 1, 'Dec 26 2011 should be week 1'); + assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); + assert.equal(moment([2012, 0, 2]).week(), 2, 'Jan 2 2012 should be week 2'); + assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); + assert.equal(moment([2012, 0, 9]).week(), 3, 'Jan 9 2012 should be week 3'); + assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); + assert.equal(moment([2007, 0, 7]).week(), 1, 'Jan 7 2007 should be week 1'); + assert.equal(moment([2007, 0, 8]).week(), 2, 'Jan 8 2007 should be week 2'); + assert.equal(moment([2007, 0, 14]).week(), 2, 'Jan 14 2007 should be week 2'); + assert.equal(moment([2007, 0, 15]).week(), 3, 'Jan 15 2007 should be week 3'); + assert.equal(moment([2007, 11, 31]).week(), 1, 'Dec 31 2007 should be week 1'); + assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); + assert.equal(moment([2008, 0, 6]).week(), 1, 'Jan 6 2008 should be week 1'); + assert.equal(moment([2008, 0, 7]).week(), 2, 'Jan 7 2008 should be week 2'); + assert.equal(moment([2008, 0, 13]).week(), 2, 'Jan 13 2008 should be week 2'); + assert.equal(moment([2008, 0, 14]).week(), 3, 'Jan 14 2008 should be week 3'); + assert.equal(moment([2002, 11, 30]).week(), 1, 'Dec 30 2002 should be week 1'); + assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); + assert.equal(moment([2003, 0, 5]).week(), 1, 'Jan 5 2003 should be week 1'); + assert.equal(moment([2003, 0, 6]).week(), 2, 'Jan 6 2003 should be week 2'); + assert.equal(moment([2003, 0, 12]).week(), 2, 'Jan 12 2003 should be week 2'); + assert.equal(moment([2003, 0, 13]).week(), 3, 'Jan 13 2003 should be week 3'); + assert.equal(moment([2008, 11, 29]).week(), 1, 'Dec 29 2008 should be week 1'); + assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); + assert.equal(moment([2009, 0, 4]).week(), 1, 'Jan 4 2009 should be week 1'); + assert.equal(moment([2009, 0, 5]).week(), 2, 'Jan 5 2009 should be week 2'); + assert.equal(moment([2009, 0, 11]).week(), 2, 'Jan 11 2009 should be week 2'); + assert.equal(moment([2009, 0, 12]).week(), 3, 'Jan 12 2009 should be week 3'); + assert.equal(moment([2009, 11, 28]).week(), 1, 'Dec 28 2009 should be week 1'); + assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); + assert.equal(moment([2010, 0, 3]).week(), 1, 'Jan 3 2010 should be week 1'); + assert.equal(moment([2010, 0, 4]).week(), 2, 'Jan 4 2010 should be week 2'); + assert.equal(moment([2010, 0, 10]).week(), 2, 'Jan 10 2010 should be week 2'); + assert.equal(moment([2010, 0, 11]).week(), 3, 'Jan 11 2010 should be week 3'); + assert.equal(moment([2010, 11, 27]).week(), 1, 'Dec 27 2010 should be week 1'); + assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); + assert.equal(moment([2011, 0, 2]).week(), 1, 'Jan 2 2011 should be week 1'); + assert.equal(moment([2011, 0, 3]).week(), 2, 'Jan 3 2011 should be week 2'); + assert.equal(moment([2011, 0, 9]).week(), 2, 'Jan 9 2011 should be week 2'); + assert.equal(moment([2011, 0, 10]).week(), 3, 'Jan 10 2011 should be week 3'); + }); + + test('weeks numbers dow:0 doy:6', function (assert) { + moment.locale('dow: 0, doy: 6', {week: {dow: 0, doy: 6}}); + assert.equal(moment([2012, 0, 1]).week(), 1, 'Jan 1 2012 should be week 1'); + assert.equal(moment([2012, 0, 7]).week(), 1, 'Jan 7 2012 should be week 1'); + assert.equal(moment([2012, 0, 8]).week(), 2, 'Jan 8 2012 should be week 2'); + assert.equal(moment([2012, 0, 14]).week(), 2, 'Jan 14 2012 should be week 2'); + assert.equal(moment([2012, 0, 15]).week(), 3, 'Jan 15 2012 should be week 3'); + assert.equal(moment([2006, 11, 31]).week(), 1, 'Dec 31 2006 should be week 1'); + assert.equal(moment([2007, 0, 1]).week(), 1, 'Jan 1 2007 should be week 1'); + assert.equal(moment([2007, 0, 6]).week(), 1, 'Jan 6 2007 should be week 1'); + assert.equal(moment([2007, 0, 7]).week(), 2, 'Jan 7 2007 should be week 2'); + assert.equal(moment([2007, 0, 13]).week(), 2, 'Jan 13 2007 should be week 2'); + assert.equal(moment([2007, 0, 14]).week(), 3, 'Jan 14 2007 should be week 3'); + assert.equal(moment([2007, 11, 29]).week(), 52, 'Dec 29 2007 should be week 52'); + assert.equal(moment([2008, 0, 1]).week(), 1, 'Jan 1 2008 should be week 1'); + assert.equal(moment([2008, 0, 5]).week(), 1, 'Jan 5 2008 should be week 1'); + assert.equal(moment([2008, 0, 6]).week(), 2, 'Jan 6 2008 should be week 2'); + assert.equal(moment([2008, 0, 12]).week(), 2, 'Jan 12 2008 should be week 2'); + assert.equal(moment([2008, 0, 13]).week(), 3, 'Jan 13 2008 should be week 3'); + assert.equal(moment([2002, 11, 29]).week(), 1, 'Dec 29 2002 should be week 1'); + assert.equal(moment([2003, 0, 1]).week(), 1, 'Jan 1 2003 should be week 1'); + assert.equal(moment([2003, 0, 4]).week(), 1, 'Jan 4 2003 should be week 1'); + assert.equal(moment([2003, 0, 5]).week(), 2, 'Jan 5 2003 should be week 2'); + assert.equal(moment([2003, 0, 11]).week(), 2, 'Jan 11 2003 should be week 2'); + assert.equal(moment([2003, 0, 12]).week(), 3, 'Jan 12 2003 should be week 3'); + assert.equal(moment([2008, 11, 28]).week(), 1, 'Dec 28 2008 should be week 1'); + assert.equal(moment([2009, 0, 1]).week(), 1, 'Jan 1 2009 should be week 1'); + assert.equal(moment([2009, 0, 3]).week(), 1, 'Jan 3 2009 should be week 1'); + assert.equal(moment([2009, 0, 4]).week(), 2, 'Jan 4 2009 should be week 2'); + assert.equal(moment([2009, 0, 10]).week(), 2, 'Jan 10 2009 should be week 2'); + assert.equal(moment([2009, 0, 11]).week(), 3, 'Jan 11 2009 should be week 3'); + assert.equal(moment([2009, 11, 27]).week(), 1, 'Dec 27 2009 should be week 1'); + assert.equal(moment([2010, 0, 1]).week(), 1, 'Jan 1 2010 should be week 1'); + assert.equal(moment([2010, 0, 2]).week(), 1, 'Jan 2 2010 should be week 1'); + assert.equal(moment([2010, 0, 3]).week(), 2, 'Jan 3 2010 should be week 2'); + assert.equal(moment([2010, 0, 9]).week(), 2, 'Jan 9 2010 should be week 2'); + assert.equal(moment([2010, 0, 10]).week(), 3, 'Jan 10 2010 should be week 3'); + assert.equal(moment([2010, 11, 26]).week(), 1, 'Dec 26 2010 should be week 1'); + assert.equal(moment([2011, 0, 1]).week(), 1, 'Jan 1 2011 should be week 1'); + assert.equal(moment([2011, 0, 2]).week(), 2, 'Jan 2 2011 should be week 2'); + assert.equal(moment([2011, 0, 8]).week(), 2, 'Jan 8 2011 should be week 2'); + assert.equal(moment([2011, 0, 9]).week(), 3, 'Jan 9 2011 should be week 3'); + }); + test('week year overflows', function (assert) { assert.equal('2005-01-01', moment.utc('2004-W53-6', moment.ISO_8601, true).format('YYYY-MM-DD'), '2004-W53-6 is 1st Jan 2005'); assert.equal('2007-12-31', moment.utc('2008-W01-1', moment.ISO_8601, true).format('YYYY-MM-DD'), '2008-W01-1 is 31st Dec 2007'); @@ -44954,6 +50922,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -44997,6 +51064,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } module('week day'); @@ -45138,6 +51206,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -45181,6 +51348,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } module('weeks'); @@ -45414,6 +51582,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -45457,6 +51724,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } module('weeks in year'); @@ -45553,6 +51821,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -45596,6 +51963,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } module('zone switching'); @@ -45696,6 +52064,105 @@ factory(global.moment) }(this, function (moment) { 'use strict'; + function each(array, callback) { + var i; + for (i = 0; i < array.length; i++) { + callback(array[i], i, array); + } + } + + function objectKeys(obj) { + if (Object.keys) { + return Object.keys(obj); + } else { + // IE8 + var res = [], i; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(i); + } + } + return res; + } + } + + // 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 defineCommonLocaleTests(locale, options) { + test('lenient ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing ' + i + ' date check'); + } + }); + + test('lenient ordinal parsing of number', function (assert) { + var i, testMoment; + for (i = 1; i <= 31; ++i) { + testMoment = moment('2014 01 ' + i, 'YYYY MM Do'); + assert.equal(testMoment.year(), 2014, + 'lenient ordinal parsing of number ' + i + ' year check'); + assert.equal(testMoment.month(), 0, + 'lenient ordinal parsing of number ' + i + ' month check'); + assert.equal(testMoment.date(), i, + 'lenient ordinal parsing of number ' + i + ' date check'); + } + }); + + test('strict ordinal parsing', function (assert) { + var i, ordinalStr, testMoment; + for (i = 1; i <= 31; ++i) { + ordinalStr = moment([2014, 0, i]).format('YYYY MM Do'); + testMoment = moment(ordinalStr, 'YYYY MM Do', true); + assert.ok(testMoment.isValid(), 'strict ordinal parsing ' + i); + } + }); + + test('meridiem invariant', function (assert) { + var h, m, t1, t2; + for (h = 0; h < 24; ++h) { + for (m = 0; m < 60; m += 15) { + t1 = moment.utc([2000, 0, 1, h, m]); + t2 = moment(t1.format('A h:mm'), 'A h:mm'); + assert.equal(t2.format('HH:mm'), t1.format('HH:mm'), + 'meridiem at ' + t1.format('HH:mm')); + } + } + }); + + test('date format correctness', function (assert) { + var data, tokens; + data = moment.localeData()._longDateFormat; + tokens = objectKeys(data); + each(tokens, function (srchToken) { + // Check each format string to make sure it does not contain any + // tokens that need to be expanded. + each(tokens, function (baseToken) { + // strip escaped sequences + var format = data[baseToken].replace(/(\[[^\]]*\])/g, ''); + assert.equal(false, !!~format.indexOf(srchToken), + 'contains ' + srchToken + ' in ' + baseToken); + }); + }); + }); + } + /*global QUnit:false*/ var test = QUnit.test; @@ -45739,6 +52206,7 @@ } } }); + defineCommonLocaleTests(name, -1, -1); } module('zones'); diff --git a/bower_components/moment/moment.js b/bower_components/moment/moment.js index 7299fa4..b5f0b36 100644 --- a/bower_components/moment/moment.js +++ b/bower_components/moment/moment.js @@ -1,5 +1,5 @@ //! moment.js -//! version : 2.11.2 +//! version : 2.12.0 //! authors : Tim Wood, Iskren Chernev, Moment.js contributors //! license : MIT //! momentjs.com @@ -23,7 +23,7 @@ } function isArray(input) { - return Object.prototype.toString.call(input) === '[object Array]'; + return input instanceof Array || Object.prototype.toString.call(input) === '[object Array]'; } function isDate(input) { @@ -229,7 +229,82 @@ return diffs + lengthDiff; } - function Locale() { + 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 + '\nArguments: ' + Array.prototype.slice.call(arguments).join(', ') + '\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; + + function isFunction(input) { + return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]'; + } + + function isObject(input) { + return Object.prototype.toString.call(input) === '[object Object]'; + } + + function locale_set__set (config) { + var prop, i; + for (i in config) { + prop = config[i]; + if (isFunction(prop)) { + this[i] = prop; + } else { + this['_' + i] = prop; + } + } + this._config = config; + // 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); + } + + function mergeConfigs(parentConfig, childConfig) { + var res = extend({}, parentConfig), prop; + for (prop in childConfig) { + if (hasOwnProp(childConfig, prop)) { + if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) { + res[prop] = {}; + extend(res[prop], parentConfig[prop]); + extend(res[prop], childConfig[prop]); + } else if (childConfig[prop] != null) { + res[prop] = childConfig[prop]; + } else { + delete res[prop]; + } + } + } + return res; + } + + function Locale(config) { + if (config != null) { + this.set(config); + } } // internal storage for locale config files @@ -305,11 +380,25 @@ return globalLocale._abbr; } - function defineLocale (name, values) { - if (values !== null) { - values.abbr = name; - locales[name] = locales[name] || new Locale(); - locales[name].set(values); + function defineLocale (name, config) { + if (config !== null) { + config.abbr = name; + if (locales[name] != null) { + deprecateSimple('defineLocaleOverride', + 'use moment.updateLocale(localeName, config) to change ' + + 'an existing locale. moment.defineLocale(localeName, ' + + 'config) should only be used for creating a new locale'); + config = mergeConfigs(locales[name]._config, config); + } else if (config.parentLocale != null) { + if (locales[config.parentLocale] != null) { + config = mergeConfigs(locales[config.parentLocale]._config, config); + } else { + // treat as if there is no base config + deprecateSimple('parentLocaleUndefined', + 'specified parentLocale is not defined yet'); + } + } + locales[name] = new Locale(config); // backwards compat for now: also set the locale locale_locales__getSetGlobalLocale(name); @@ -322,6 +411,31 @@ } } + function updateLocale(name, config) { + if (config != null) { + var locale; + if (locales[name] != null) { + config = mergeConfigs(locales[name]._config, config); + } + locale = new Locale(config); + locale.parentLocale = locales[name]; + locales[name] = locale; + + // backwards compat for now: also set the locale + locale_locales__getSetGlobalLocale(name); + } else { + // pass null for config to unupdate, useful for tests + if (locales[name] != null) { + if (locales[name].parentLocale != null) { + locales[name] = locales[name].parentLocale; + } else if (locales[name] != null) { + delete locales[name]; + } + } + } + return locales[name]; + } + // returns locale data function locale_locales__getLocale (key) { var locale; @@ -346,6 +460,10 @@ return chooseLocale(key); } + function locale_locales__listLocales() { + return Object.keys(locales); + } + var aliases = {}; function addUnitAlias (unit, shorthand) { @@ -374,10 +492,6 @@ return normalizedInput; } - function isFunction(input) { - return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]'; - } - function makeGetSet (unit, keepTime) { return function (value) { if (value != null) { @@ -711,12 +825,15 @@ return mom; } - // 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; + if (/^\d+$/.test(value)) { + value = toInt(value); + } else { + value = mom.localeData().monthsParse(value); + // TODO: Another silent failure? + if (typeof value !== 'number') { + return mom; + } } } @@ -835,36 +952,6 @@ 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 + '\nArguments: ' + Array.prototype.slice.call(arguments).join(', ') + '\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; - // iso 8601 regex // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00) var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/; @@ -1510,7 +1597,7 @@ } var prototypeMin = deprecate( - 'moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548', + 'moment().min is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548', function () { var other = local__createLocal.apply(null, arguments); if (this.isValid() && other.isValid()) { @@ -1522,7 +1609,7 @@ ); var prototypeMax = deprecate( - 'moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548', + 'moment().max is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548', function () { var other = local__createLocal.apply(null, arguments); if (this.isValid() && other.isValid()) { @@ -1820,7 +1907,8 @@ // 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 isoRegex = /^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/; + // and further modified to allow for strings containing both week and day + var isoRegex = /^(-)?P(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)W)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?$/; function create__createDuration (input, key) { var duration = input, @@ -1858,11 +1946,11 @@ 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) + w : parseIso(match[4], sign), + d : parseIso(match[5], sign), + h : parseIso(match[6], sign), + m : parseIso(match[7], sign), + s : parseIso(match[8], sign) }; } else if (duration == null) {// checks for null or undefined duration = {}; @@ -1926,6 +2014,14 @@ return res; } + function absRound (number) { + if (number < 0) { + return Math.round(-1 * number) * -1; + } else { + return Math.round(number); + } + } + // TODO: remove 'name' arg after deprecation is removed function createAdder(direction, name) { return function (val, period) { @@ -1945,8 +2041,8 @@ function add_subtract__addSubtract (mom, duration, isAdding, updateOffset) { var milliseconds = duration._milliseconds, - days = duration._days, - months = duration._months; + days = absRound(duration._days), + months = absRound(duration._months); if (!mom.isValid()) { // No op @@ -2272,8 +2368,8 @@ } function toJSON () { - // JSON.stringify(new Date(NaN)) === 'null' - return this.isValid() ? this.toISOString() : 'null'; + // new Date(NaN).toJSON() === null + return this.isValid() ? this.toISOString() : null; } function moment_valid__isValid () { @@ -2383,7 +2479,6 @@ var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy), date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear); - // console.log("got", weekYear, week, weekday, "set", date.toISOString()); this.year(date.getUTCFullYear()); this.month(date.getUTCMonth()); this.date(date.getUTCDate()); @@ -3093,21 +3188,6 @@ return isFunction(format) ? format(output) : format.replace(/%s/i, output); } - function locale_set__set (config) { - var prop, i; - for (i in config) { - prop = config[i]; - if (isFunction(prop)) { - 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; @@ -3571,7 +3651,7 @@ // Side effect imports - utils_hooks__hooks.version = '2.11.2'; + utils_hooks__hooks.version = '2.12.0'; setHookCallback(local__createLocal); @@ -3594,6 +3674,8 @@ utils_hooks__hooks.monthsShort = lists__listMonthsShort; utils_hooks__hooks.weekdaysMin = lists__listWeekdaysMin; utils_hooks__hooks.defineLocale = defineLocale; + utils_hooks__hooks.updateLocale = updateLocale; + utils_hooks__hooks.locales = locale_locales__listLocales; utils_hooks__hooks.weekdaysShort = lists__listWeekdaysShort; utils_hooks__hooks.normalizeUnits = normalizeUnits; utils_hooks__hooks.relativeTimeThreshold = duration_humanize__getSetRelativeTimeThreshold; diff --git a/bower_components/moment/src/lib/duration/create.js b/bower_components/moment/src/lib/duration/create.js index d465cee..ef7257d 100644 --- a/bower_components/moment/src/lib/duration/create.js +++ b/bower_components/moment/src/lib/duration/create.js @@ -10,7 +10,8 @@ var aspNetRegex = /^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?\d*)?$/; // 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 isoRegex = /^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/; +// and further modified to allow for strings containing both week and day +var isoRegex = /^(-)?P(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)W)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?$/; export function createDuration (input, key) { var duration = input, @@ -48,11 +49,11 @@ export function createDuration (input, key) { 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) + w : parseIso(match[4], sign), + d : parseIso(match[5], sign), + h : parseIso(match[6], sign), + m : parseIso(match[7], sign), + s : parseIso(match[8], sign) }; } else if (duration == null) {// checks for null or undefined duration = {}; diff --git a/bower_components/moment/src/lib/locale/constructor.js b/bower_components/moment/src/lib/locale/constructor.js index 2c17b5d..c32b73e 100644 --- a/bower_components/moment/src/lib/locale/constructor.js +++ b/bower_components/moment/src/lib/locale/constructor.js @@ -1,2 +1,5 @@ -export function Locale() { +export function Locale(config) { + if (config != null) { + this.set(config); + } } diff --git a/bower_components/moment/src/lib/locale/locale.js b/bower_components/moment/src/lib/locale/locale.js index 2fc3c46..ac9cebf 100644 --- a/bower_components/moment/src/lib/locale/locale.js +++ b/bower_components/moment/src/lib/locale/locale.js @@ -4,7 +4,9 @@ import './prototype'; import { getSetGlobalLocale, defineLocale, - getLocale + updateLocale, + getLocale, + listLocales } from './locales'; import { @@ -18,7 +20,9 @@ import { export { getSetGlobalLocale, defineLocale, + updateLocale, getLocale, + listLocales, listMonths, listMonthsShort, listWeekdays, diff --git a/bower_components/moment/src/lib/locale/locales.js b/bower_components/moment/src/lib/locale/locales.js index 00114cf..b238606 100644 --- a/bower_components/moment/src/lib/locale/locales.js +++ b/bower_components/moment/src/lib/locale/locales.js @@ -1,6 +1,8 @@ import isArray from '../utils/is-array'; import isUndefined from '../utils/is-undefined'; import compareArrays from '../utils/compare-arrays'; +import { deprecateSimple } from '../utils/deprecate'; +import { mergeConfigs } from './set'; import { Locale } from './constructor'; // internal storage for locale config files @@ -76,11 +78,25 @@ export function getSetGlobalLocale (key, values) { return globalLocale._abbr; } -export function defineLocale (name, values) { - if (values !== null) { - values.abbr = name; - locales[name] = locales[name] || new Locale(); - locales[name].set(values); +export function defineLocale (name, config) { + if (config !== null) { + config.abbr = name; + if (locales[name] != null) { + deprecateSimple('defineLocaleOverride', + 'use moment.updateLocale(localeName, config) to change ' + + 'an existing locale. moment.defineLocale(localeName, ' + + 'config) should only be used for creating a new locale'); + config = mergeConfigs(locales[name]._config, config); + } else if (config.parentLocale != null) { + if (locales[config.parentLocale] != null) { + config = mergeConfigs(locales[config.parentLocale]._config, config); + } else { + // treat as if there is no base config + deprecateSimple('parentLocaleUndefined', + 'specified parentLocale is not defined yet'); + } + } + locales[name] = new Locale(config); // backwards compat for now: also set the locale getSetGlobalLocale(name); @@ -93,6 +109,31 @@ export function defineLocale (name, values) { } } +export function updateLocale(name, config) { + if (config != null) { + var locale; + if (locales[name] != null) { + config = mergeConfigs(locales[name]._config, config); + } + locale = new Locale(config); + locale.parentLocale = locales[name]; + locales[name] = locale; + + // backwards compat for now: also set the locale + getSetGlobalLocale(name); + } else { + // pass null for config to unupdate, useful for tests + if (locales[name] != null) { + if (locales[name].parentLocale != null) { + locales[name] = locales[name].parentLocale; + } else if (locales[name] != null) { + delete locales[name]; + } + } + } + return locales[name]; +} + // returns locale data export function getLocale (key) { var locale; @@ -116,3 +157,7 @@ export function getLocale (key) { return chooseLocale(key); } + +export function listLocales() { + return Object.keys(locales); +} diff --git a/bower_components/moment/src/lib/locale/set.js b/bower_components/moment/src/lib/locale/set.js index 062e842..1fd1389 100644 --- a/bower_components/moment/src/lib/locale/set.js +++ b/bower_components/moment/src/lib/locale/set.js @@ -1,4 +1,7 @@ import isFunction from '../utils/is-function'; +import extend from '../utils/extend'; +import isObject from '../utils/is-object'; +import hasOwnProp from '../utils/has-own-prop'; export function set (config) { var prop, i; @@ -10,7 +13,26 @@ export function set (config) { this['_' + i] = prop; } } + this._config = config; // 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); } + +export function mergeConfigs(parentConfig, childConfig) { + var res = extend({}, parentConfig), prop; + for (prop in childConfig) { + if (hasOwnProp(childConfig, prop)) { + if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) { + res[prop] = {}; + extend(res[prop], parentConfig[prop]); + extend(res[prop], childConfig[prop]); + } else if (childConfig[prop] != null) { + res[prop] = childConfig[prop]; + } else { + delete res[prop]; + } + } + } + return res; +} diff --git a/bower_components/moment/src/lib/moment/add-subtract.js b/bower_components/moment/src/lib/moment/add-subtract.js index 988eff3..dd33333 100644 --- a/bower_components/moment/src/lib/moment/add-subtract.js +++ b/bower_components/moment/src/lib/moment/add-subtract.js @@ -3,6 +3,8 @@ import { setMonth } from '../units/month'; import { createDuration } from '../duration/create'; import { deprecateSimple } from '../utils/deprecate'; import { hooks } from '../utils/hooks'; +import absRound from '../utils/abs-round'; + // TODO: remove 'name' arg after deprecation is removed function createAdder(direction, name) { @@ -23,8 +25,8 @@ function createAdder(direction, name) { export function addSubtract (mom, duration, isAdding, updateOffset) { var milliseconds = duration._milliseconds, - days = duration._days, - months = duration._months; + days = absRound(duration._days), + months = absRound(duration._months); if (!mom.isValid()) { // No op diff --git a/bower_components/moment/src/lib/moment/min-max.js b/bower_components/moment/src/lib/moment/min-max.js index e355883..aad6f6f 100644 --- a/bower_components/moment/src/lib/moment/min-max.js +++ b/bower_components/moment/src/lib/moment/min-max.js @@ -4,7 +4,7 @@ import { createLocal } from '../create/local'; import { createInvalid } from '../create/valid'; export var prototypeMin = deprecate( - 'moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548', + 'moment().min is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548', function () { var other = createLocal.apply(null, arguments); if (this.isValid() && other.isValid()) { @@ -16,7 +16,7 @@ export var prototypeMin = deprecate( ); export var prototypeMax = deprecate( - 'moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548', + 'moment().max is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548', function () { var other = createLocal.apply(null, arguments); if (this.isValid() && other.isValid()) { diff --git a/bower_components/moment/src/lib/moment/to-type.js b/bower_components/moment/src/lib/moment/to-type.js index b6787af..0fba999 100644 --- a/bower_components/moment/src/lib/moment/to-type.js +++ b/bower_components/moment/src/lib/moment/to-type.js @@ -29,6 +29,6 @@ export function toObject () { } export function toJSON () { - // JSON.stringify(new Date(NaN)) === 'null' - return this.isValid() ? this.toISOString() : 'null'; + // new Date(NaN).toJSON() === null + return this.isValid() ? this.toISOString() : null; } diff --git a/bower_components/moment/src/lib/units/month.js b/bower_components/moment/src/lib/units/month.js index 60806d6..fc5bfe6 100644 --- a/bower_components/moment/src/lib/units/month.js +++ b/bower_components/moment/src/lib/units/month.js @@ -114,12 +114,15 @@ export function setMonth (mom, value) { return mom; } - // 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; + if (/^\d+$/.test(value)) { + value = toInt(value); + } else { + value = mom.localeData().monthsParse(value); + // TODO: Another silent failure? + if (typeof value !== 'number') { + return mom; + } } } diff --git a/bower_components/moment/src/lib/units/week-year.js b/bower_components/moment/src/lib/units/week-year.js index 44c4f33..29d1fec 100644 --- a/bower_components/moment/src/lib/units/week-year.js +++ b/bower_components/moment/src/lib/units/week-year.js @@ -93,7 +93,6 @@ function setWeekAll(weekYear, week, weekday, dow, doy) { var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy), date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear); - // console.log("got", weekYear, week, weekday, "set", date.toISOString()); this.year(date.getUTCFullYear()); this.month(date.getUTCMonth()); this.date(date.getUTCDate()); diff --git a/bower_components/moment/src/lib/utils/abs-round.js b/bower_components/moment/src/lib/utils/abs-round.js new file mode 100644 index 0000000..98f54bc --- /dev/null +++ b/bower_components/moment/src/lib/utils/abs-round.js @@ -0,0 +1,7 @@ +export default function absRound (number) { + if (number < 0) { + return Math.round(-1 * number) * -1; + } else { + return Math.round(number); + } +} diff --git a/bower_components/moment/src/lib/utils/is-array.js b/bower_components/moment/src/lib/utils/is-array.js index 46bd6c6..2d0e0f3 100644 --- a/bower_components/moment/src/lib/utils/is-array.js +++ b/bower_components/moment/src/lib/utils/is-array.js @@ -1,3 +1,3 @@ export default function isArray(input) { - return Object.prototype.toString.call(input) === '[object Array]'; + return input instanceof Array || Object.prototype.toString.call(input) === '[object Array]'; } diff --git a/bower_components/moment/src/lib/utils/is-object.js b/bower_components/moment/src/lib/utils/is-object.js new file mode 100644 index 0000000..6018e12 --- /dev/null +++ b/bower_components/moment/src/lib/utils/is-object.js @@ -0,0 +1,3 @@ +export default function isObject(input) { + return Object.prototype.toString.call(input) === '[object Object]'; +} diff --git a/bower_components/moment/src/locale/bn.js b/bower_components/moment/src/locale/bn.js index 3ab629c..6d2f59d 100644 --- a/bower_components/moment/src/locale/bn.js +++ b/bower_components/moment/src/locale/bn.js @@ -77,12 +77,18 @@ export default moment.defineLocale('bn', { }); }, meridiemParse: /রাত|সকাল|দুপুর|বিকাল|রাত/, - isPM: function (input) { - return /^(দুপুর|বিকাল|রাত)$/.test(input); + meridiemHour : function (hour, meridiem) { + if (hour === 12) { + hour = 0; + } + if ((meridiem === 'রাত' && hour >= 4) || + (meridiem === 'দুপুর' && hour < 5) || + meridiem === 'বিকাল') { + return hour + 12; + } else { + return hour; + } }, - //Bengali is a vast language its spoken - //in different forms in various parts of the world. - //I have just generalized with most common one used meridiem : function (hour, minute, isLower) { if (hour < 4) { return 'রাত'; diff --git a/bower_components/moment/src/locale/bo.js b/bower_components/moment/src/locale/bo.js index 6da128d..05b1fdc 100644 --- a/bower_components/moment/src/locale/bo.js +++ b/bower_components/moment/src/locale/bo.js @@ -77,8 +77,17 @@ export default moment.defineLocale('bo', { }); }, meridiemParse: /མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/, - isPM: function (input) { - return /^(ཉིན་གུང|དགོང་དག|མཚན་མོ)$/.test(input); + meridiemHour : function (hour, meridiem) { + if (hour === 12) { + hour = 0; + } + if ((meridiem === 'མཚན་མོ' && hour >= 4) || + (meridiem === 'ཉིན་གུང' && hour < 5) || + meridiem === 'དགོང་དག') { + return hour + 12; + } else { + return hour; + } }, meridiem : function (hour, minute, isLower) { if (hour < 4) { diff --git a/bower_components/moment/src/locale/dv.js b/bower_components/moment/src/locale/dv.js index 481237f..6e7a42d 100644 --- a/bower_components/moment/src/locale/dv.js +++ b/bower_components/moment/src/locale/dv.js @@ -44,7 +44,7 @@ export default moment.defineLocale('dv', { }, meridiemParse: /މކ|މފ/, isPM : function (input) { - return '' === input; + return 'މފ' === input; }, meridiem : function (hour, minute, isLower) { if (hour < 12) { diff --git a/bower_components/moment/src/locale/en-ca.js b/bower_components/moment/src/locale/en-ca.js index 9273cf6..54b4981 100644 --- a/bower_components/moment/src/locale/en-ca.js +++ b/bower_components/moment/src/locale/en-ca.js @@ -14,9 +14,9 @@ export default moment.defineLocale('en-ca', { LT : 'h:mm A', LTS : 'h:mm:ss A', L : 'YYYY-MM-DD', - LL : 'D MMMM, YYYY', - LLL : 'D MMMM, YYYY h:mm A', - LLLL : 'dddd, D MMMM, YYYY h:mm A' + LL : 'MMMM D, YYYY', + LLL : 'MMMM D, YYYY h:mm A', + LLLL : 'dddd, MMMM D, YYYY h:mm A' }, calendar : { sameDay : '[Today at] LT', @@ -51,4 +51,3 @@ export default moment.defineLocale('en-ca', { return number + output; } }); - diff --git a/bower_components/moment/src/locale/he.js b/bower_components/moment/src/locale/he.js index e353158..9f4be80 100644 --- a/bower_components/moment/src/locale/he.js +++ b/bower_components/moment/src/locale/he.js @@ -68,6 +68,23 @@ export default moment.defineLocale('he', { } return number + ' שנים'; } + }, + meridiemParse: /אחה"צ|לפנה"צ|אחרי הצהריים|לפני הצהריים|לפנות בוקר|בבוקר|בערב/i, + isPM : function (input) { + return /^(אחה"צ|אחרי הצהריים|בערב)$/.test(input); + }, + meridiem : function (hour, minute, isLower) { + if (hour < 5) { + return 'לפנות בוקר'; + } else if (hour < 10) { + return 'בבוקר'; + } else if (hour < 12) { + return isLower ? 'לפנה"צ' : 'לפני הצהריים'; + } else if (hour < 18) { + return isLower ? 'אחה"צ' : 'אחרי הצהריים'; + } else { + return 'בערב'; + } } }); diff --git a/bower_components/moment/src/locale/is.js b/bower_components/moment/src/locale/is.js index 833907d..5a452bd 100644 --- a/bower_components/moment/src/locale/is.js +++ b/bower_components/moment/src/locale/is.js @@ -80,7 +80,7 @@ export default moment.defineLocale('is', { longDateFormat : { LT : 'H:mm', LTS : 'H:mm:ss', - L : 'DD/MM/YYYY', + L : 'DD.MM.YYYY', LL : 'D. MMMM YYYY', LLL : 'D. MMMM YYYY [kl.] H:mm', LLLL : 'dddd, D. MMMM YYYY [kl.] H:mm' diff --git a/bower_components/moment/src/locale/ja.js b/bower_components/moment/src/locale/ja.js index 6cdc4fc..13944e4 100644 --- a/bower_components/moment/src/locale/ja.js +++ b/bower_components/moment/src/locale/ja.js @@ -37,6 +37,17 @@ export default moment.defineLocale('ja', { lastWeek : '[前週]dddd LT', sameElse : 'L' }, + ordinalParse : /\d{1,2}日/, + ordinal : function (number, period) { + switch (period) { + case 'd': + case 'D': + case 'DDD': + return number + '日'; + default: + return number; + } + }, relativeTime : { future : '%s後', past : '%s前', diff --git a/bower_components/moment/src/locale/ml.js b/bower_components/moment/src/locale/ml.js index 7bafa7a..0387253 100644 --- a/bower_components/moment/src/locale/ml.js +++ b/bower_components/moment/src/locale/ml.js @@ -42,8 +42,17 @@ export default moment.defineLocale('ml', { yy : '%d വർഷം' }, meridiemParse: /രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i, - isPM : function (input) { - return /^(ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി)$/.test(input); + meridiemHour : function (hour, meridiem) { + if (hour === 12) { + hour = 0; + } + if ((meridiem === 'രാത്രി' && hour >= 4) || + meridiem === 'ഉച്ച കഴിഞ്ഞ്' || + meridiem === 'വൈകുന്നേരം') { + return hour + 12; + } else { + return hour; + } }, meridiem : function (hour, minute, isLower) { if (hour < 4) { diff --git a/bower_components/moment/src/locale/pa-in.js b/bower_components/moment/src/locale/pa-in.js new file mode 100644 index 0000000..5f2721a --- /dev/null +++ b/bower_components/moment/src/locale/pa-in.js @@ -0,0 +1,115 @@ +//! moment.js locale configuration +//! locale : punjabi india (pa-in) +//! author : Harpreet Singh : https://github.com/harpreetkhalsagtbit + +import moment from '../moment'; + +var symbolMap = { + '1': '੧', + '2': '੨', + '3': '੩', + '4': '੪', + '5': '੫', + '6': '੬', + '7': '੭', + '8': '੮', + '9': '੯', + '0': '੦' +}, +numberMap = { + '੧': '1', + '੨': '2', + '੩': '3', + '੪': '4', + '੫': '5', + '੬': '6', + '੭': '7', + '੮': '8', + '੯': '9', + '੦': '0' +}; + +export default moment.defineLocale('pa-in', { + // There are months name as per Nanakshahi Calender but they are not used as rigidly in modern Punjabi. + months : 'ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ'.split('_'), + monthsShort : 'ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ'.split('_'), + weekdays : 'ਐਤਵਾਰ_ਸੋਮਵਾਰ_ਮੰਗਲਵਾਰ_ਬੁਧਵਾਰ_ਵੀਰਵਾਰ_ਸ਼ੁੱਕਰਵਾਰ_ਸ਼ਨੀਚਰਵਾਰ'.split('_'), + weekdaysShort : 'ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ'.split('_'), + weekdaysMin : 'ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ'.split('_'), + longDateFormat : { + LT : 'A h:mm ਵਜੇ', + LTS : 'A h:mm:ss ਵਜੇ', + L : 'DD/MM/YYYY', + LL : 'D MMMM YYYY', + LLL : 'D MMMM YYYY, A h:mm ਵਜੇ', + LLLL : 'dddd, D MMMM YYYY, A h:mm ਵਜੇ' + }, + calendar : { + sameDay : '[ਅਜ] LT', + nextDay : '[ਕਲ] LT', + nextWeek : 'dddd, LT', + lastDay : '[ਕਲ] LT', + lastWeek : '[ਪਿਛਲੇ] dddd, LT', + sameElse : 'L' + }, + relativeTime : { + future : '%s ਵਿੱਚ', + past : '%s ਪਿਛਲੇ', + s : 'ਕੁਝ ਸਕਿੰਟ', + m : 'ਇਕ ਮਿੰਟ', + mm : '%d ਮਿੰਟ', + h : 'ਇੱਕ ਘੰਟਾ', + hh : '%d ਘੰਟੇ', + d : 'ਇੱਕ ਦਿਨ', + dd : '%d ਦਿਨ', + M : 'ਇੱਕ ਮਹੀਨਾ', + MM : '%d ਮਹੀਨੇ', + y : 'ਇੱਕ ਸਾਲ', + yy : '%d ਸਾਲ' + }, + preparse: function (string) { + return string.replace(/[੧੨੩੪੫੬੭੮੯੦]/g, function (match) { + return numberMap[match]; + }); + }, + postformat: function (string) { + return string.replace(/\d/g, function (match) { + return symbolMap[match]; + }); + }, + // Punjabi notation for meridiems are quite fuzzy in practice. While there exists + // a rigid notion of a 'Pahar' it is not used as rigidly in modern Punjabi. + meridiemParse: /ਰਾਤ|ਸਵੇਰ|ਦੁਪਹਿਰ|ਸ਼ਾਮ/, + meridiemHour : function (hour, meridiem) { + if (hour === 12) { + hour = 0; + } + if (meridiem === 'ਰਾਤ') { + return hour < 4 ? hour : hour + 12; + } else if (meridiem === 'ਸਵੇਰ') { + return hour; + } else if (meridiem === 'ਦੁਪਹਿਰ') { + return hour >= 10 ? hour : hour + 12; + } else if (meridiem === 'ਸ਼ਾਮ') { + return hour + 12; + } + }, + meridiem : function (hour, minute, isLower) { + if (hour < 4) { + return 'ਰਾਤ'; + } else if (hour < 10) { + return 'ਸਵੇਰ'; + } else if (hour < 17) { + return 'ਦੁਪਹਿਰ'; + } else if (hour < 20) { + return 'ਸ਼ਾਮ'; + } else { + return 'ਰਾਤ'; + } + }, + week : { + 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. + } +}); + diff --git a/bower_components/moment/src/locale/pt-br.js b/bower_components/moment/src/locale/pt-br.js index c002fdb..56e4d53 100644 --- a/bower_components/moment/src/locale/pt-br.js +++ b/bower_components/moment/src/locale/pt-br.js @@ -7,7 +7,7 @@ import moment from '../moment'; export default moment.defineLocale('pt-br', { months : 'Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro'.split('_'), monthsShort : 'Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez'.split('_'), - weekdays : 'Domingo_Segunda-Feira_Terça-Feira_Quarta-Feira_Quinta-Feira_Sexta-Feira_Sábado'.split('_'), + weekdays : 'Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado'.split('_'), weekdaysShort : 'Dom_Seg_Ter_Qua_Qui_Sex_Sáb'.split('_'), weekdaysMin : 'Dom_2ª_3ª_4ª_5ª_6ª_Sáb'.split('_'), longDateFormat : { diff --git a/bower_components/moment/src/locale/ru.js b/bower_components/moment/src/locale/ru.js index e9f0635..5ed2a24 100644 --- a/bower_components/moment/src/locale/ru.js +++ b/bower_components/moment/src/locale/ru.js @@ -2,6 +2,7 @@ //! locale : russian (ru) //! author : Viktorminator : https://github.com/Viktorminator //! Author : Menelion Elensúle : https://github.com/Oire +//! author : Коренберг Марк : https://github.com/socketpair import moment from '../moment'; @@ -26,22 +27,23 @@ function relativeTimeWithPlural(number, withoutSuffix, key) { } var monthsParse = [/^янв/i, /^фев/i, /^мар/i, /^апр/i, /^ма[й|я]/i, /^июн/i, /^июл/i, /^авг/i, /^сен/i, /^окт/i, /^ноя/i, /^дек/i]; +// http://new.gramota.ru/spravka/rules/139-prop : § 103 export default moment.defineLocale('ru', { months : { - format: 'Января_Февраля_Марта_Апреля_Мая_Июня_Июля_Августа_Сентября_Октября_Ноября_Декабря'.split('_'), - standalone: 'Январь_Февраль_Март_Апрель_Май_Июнь_Июль_Август_Сентябрь_Октябрь_Ноябрь_Декабрь'.split('_') + format: 'января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря'.split('_'), + standalone: 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_') }, monthsShort : { format: 'янв_фев_мар_апр_мая_июня_июля_авг_сен_окт_ноя_дек'.split('_'), standalone: 'янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек'.split('_') }, weekdays : { - standalone: 'Воскресенье_Понедельник_Вторник_Среда_Четверг_Пятница_Суббота'.split('_'), - format: 'Воскресенье_Понедельник_Вторник_Среду_Четверг_Пятницу_Субботу'.split('_'), + standalone: 'воскресенье_понедельник_вторник_среда_четверг_пятница_суббота'.split('_'), + format: 'воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу'.split('_'), isFormat: /\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?\] ?dddd/ }, - weekdaysShort : 'Вс_Пн_Вт_Ср_Чт_Пт_Сб'.split('_'), - weekdaysMin : 'Вс_Пн_Вт_Ср_Чт_Пт_Сб'.split('_'), + weekdaysShort : 'вс_пн_вт_ср_чт_пт_сб'.split('_'), + weekdaysMin : 'вс_пн_вт_ср_чт_пт_сб'.split('_'), monthsParse : monthsParse, longMonthsParse : monthsParse, shortMonthsParse : monthsParse, diff --git a/bower_components/moment/src/locale/si.js b/bower_components/moment/src/locale/si.js index 15c9f15..c2d8a88 100644 --- a/bower_components/moment/src/locale/si.js +++ b/bower_components/moment/src/locale/si.js @@ -46,6 +46,10 @@ export default moment.defineLocale('si', { ordinal : function (number) { return number + ' වැනි'; }, + meridiemParse : /පෙර වරු|පස් වරු|පෙ.ව|ප.ව./, + isPM : function (input) { + return input === 'ප.ව.' || input === 'පස් වරු'; + }, meridiem : function (hours, minutes, isLower) { if (hours > 11) { return isLower ? 'ප.ව.' : 'පස් වරු'; diff --git a/bower_components/moment/src/locale/tzl.js b/bower_components/moment/src/locale/tzl.js index 7c2a77a..9f983f7 100644 --- a/bower_components/moment/src/locale/tzl.js +++ b/bower_components/moment/src/locale/tzl.js @@ -21,6 +21,10 @@ export default moment.defineLocale('tzl', { LLL : 'D. MMMM [dallas] YYYY HH.mm', LLLL : 'dddd, [li] D. MMMM [dallas] YYYY HH.mm' }, + meridiemParse: /d\'o|d\'a/i, + isPM : function (input) { + return 'd\'o' === input.toLowerCase(); + }, meridiem : function (hours, minutes, isLower) { if (hours > 11) { return isLower ? 'd\'o' : 'D\'O'; diff --git a/bower_components/moment/src/locale/vi.js b/bower_components/moment/src/locale/vi.js index 0fafda7..3888345 100644 --- a/bower_components/moment/src/locale/vi.js +++ b/bower_components/moment/src/locale/vi.js @@ -10,6 +10,17 @@ export default moment.defineLocale('vi', { weekdays : 'chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy'.split('_'), weekdaysShort : 'CN_T2_T3_T4_T5_T6_T7'.split('_'), weekdaysMin : 'CN_T2_T3_T4_T5_T6_T7'.split('_'), + meridiemParse: /sa|ch/i, + isPM : function (input) { + return /^ch$/i.test(input); + }, + meridiem : function (hours, minutes, isLower) { + if (hours < 12) { + return isLower ? 'sa' : 'SA'; + } else { + return isLower ? 'ch' : 'CH'; + } + }, longDateFormat : { LT : 'HH:mm', LTS : 'HH:mm:ss', diff --git a/bower_components/moment/src/moment.js b/bower_components/moment/src/moment.js index fccc13d..0429329 100644 --- a/bower_components/moment/src/moment.js +++ b/bower_components/moment/src/moment.js @@ -1,12 +1,12 @@ //! moment.js -//! version : 2.11.2 +//! version : 2.12.0 //! authors : Tim Wood, Iskren Chernev, Moment.js contributors //! license : MIT //! momentjs.com import { hooks as moment, setHookCallback } from './lib/utils/hooks'; -moment.version = '2.11.2'; +moment.version = '2.12.0'; import { min, @@ -23,8 +23,10 @@ import { import { defineLocale, + updateLocale, getSetGlobalLocale as locale, getLocale as localeData, + listLocales as locales, listMonths as months, listMonthsShort as monthsShort, listWeekdays as weekdays, @@ -63,6 +65,8 @@ moment.isDuration = isDuration; moment.monthsShort = monthsShort; moment.weekdaysMin = weekdaysMin; moment.defineLocale = defineLocale; +moment.updateLocale = updateLocale; +moment.locales = locales; moment.weekdaysShort = weekdaysShort; moment.normalizeUnits = normalizeUnits; moment.relativeTimeThreshold = relativeTimeThreshold; diff --git a/lib/handsontable.meteor.0.24.1.css b/lib/handsontable.meteor.0.24.1.css new file mode 100644 index 0000000..9f317df --- /dev/null +++ b/lib/handsontable.meteor.0.24.1.css @@ -0,0 +1,1395 @@ +/*! +(The MIT License) + +Copyright (c) 2012-2014 Marcin Warpechowski +Copyright (c) 2015 Handsoncode sp. z o.o. + +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. + +*/ +.handsontable { + position: relative; +} + +.handsontable .hide{ + display: none; +} +.handsontable .relative { + position: relative; +} + +.handsontable.htAutoSize { + visibility: hidden; + left: -99000px; + position: absolute; + top: -99000px; +} + +.handsontable .wtHider { + width: 0; +} + +.handsontable .wtSpreader { + position: relative; + width: 0; /*must be 0, otherwise blank space appears in scroll demo after scrolling max to the right */ + height: auto; +} + +.handsontable table, +.handsontable tbody, +.handsontable thead, +.handsontable td, +.handsontable th, +.handsontable input, +.handsontable textarea, +.handsontable div { + box-sizing: content-box; + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; +} + +.handsontable input, +.handsontable textarea { + min-height: initial; +} + +.handsontable table.htCore { + border-collapse: separate; + /*it must be separate, otherwise there are offset miscalculations in WebKit: http://stackoverflow.com/questions/2655987/border-collapse-differences-in-ff-and-webkit*/ + /*this actually only changes appearance of user selection - does not make text unselectable + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -o-user-select: none; + -ms-user-select: none; + /*user-select: none; /*no browser supports unprefixed version*/ + border-spacing: 0; + margin: 0; + border-width: 0; + table-layout: fixed; + width: 0; + outline-width: 0; + /* reset bootstrap table style. for more info see: https://github.com/handsontable/handsontable/issues/224 */ + max-width: none; + max-height: none; +} + +.handsontable col { + width: 50px; +} + +.handsontable col.rowHeader { + width: 50px; +} + +.handsontable th, +.handsontable td { + border-top-width: 0; + border-left-width: 0; + border-right: 1px solid #CCC; + border-bottom: 1px solid #CCC; + height: 22px; + empty-cells: show; + line-height: 21px; + padding: 0 4px 0 4px; + /* top, bottom padding different than 0 is handled poorly by FF with HTML5 doctype */ + background-color: #FFF; + vertical-align: top; + overflow: hidden; + outline-width: 0; + white-space: pre-line; + /* preserve new line character in cell */ +} + +.handsontable td.htInvalid { + background-color: #ff4c42 !important; /*gives priority over td.area selection background*/ +} + +.handsontable td.htNoWrap { + white-space: nowrap; +} + +.handsontable th:last-child { + /*Foundation framework fix*/ + border-right: 1px solid #CCC; + border-bottom: 1px solid #CCC; +} + +.handsontable tr:first-child th.htNoFrame, +.handsontable th:first-child.htNoFrame, +.handsontable th.htNoFrame { + border-left-width: 0; + background-color: white; + border-color: #FFF; +} + +.handsontable th:first-child, +.handsontable td:first-of-type, +.handsontable .htNoFrame + th, +.handsontable .htNoFrame + td { + border-left: 1px solid #CCC; +} + +.handsontable.htRowHeaders thead tr th:nth-child(2) { + border-left: 1px solid #CCC; +} + +.handsontable tr:first-child th, +.handsontable tr:first-child td { + border-top: 1px solid #CCC; +} + +.ht_master:not(.innerBorderLeft) ~ .handsontable tbody tr th, +.ht_master:not(.innerBorderLeft) ~ .handsontable:not(.ht_clone_top) thead tr th:first-child +{ + border-right-width: 0; +} + +.ht_master:not(.innerBorderTop) thead tr:last-child th, +.ht_master:not(.innerBorderTop) ~ .handsontable thead tr:last-child th, +.ht_master:not(.innerBorderTop) thead tr.lastChild th, +.ht_master:not(.innerBorderTop) ~ .handsontable thead tr.lastChild th { + border-bottom-width: 0; +} + +.handsontable th { + background-color: #EEE; + color: #222; + text-align: center; + font-weight: normal; + white-space: nowrap; +} + +.handsontable thead th { + padding: 0; +} + +.handsontable th.active { + background-color: #CCC; +} + +.handsontable thead th .relative { + padding: 2px 4px; +} + +/* plugins */ + +.handsontable .manualColumnMover { + position: fixed; + left: 0; + top: 0; + background-color: transparent; + width: 5px; + height: 25px; + z-index: 999; + cursor: move; +} + +.handsontable .manualRowMover { + position: fixed; + left: -4px; + top: 0; + background-color: transparent; + height: 5px; + width: 50px; + z-index: 999; + cursor: move; +} + +.handsontable .manualColumnMoverGuide, +.handsontable .manualRowMoverGuide { + position: fixed; + left: 0; + top: 0; + background-color: #CCC; + width: 25px; + height: 25px; + opacity: 0.7; + display: none; +} + +.handsontable .manualColumnMoverGuide.active, +.handsontable .manualRowMoverGuide.active { + display: block; +} + +.handsontable .manualColumnMover:hover, +.handsontable .manualColumnMover.active, +.handsontable .manualRowMover:hover, +.handsontable .manualRowMover.active{ + background-color: #88F; +} + +/* row + column resizer*/ + +.handsontable .manualColumnResizer { + position: fixed; + top: 0; + cursor: col-resize; + z-index: 110; + width: 5px; + height: 25px; +} + +.handsontable .manualRowResizer { + position: fixed; + left: 0; + cursor: row-resize; + z-index: 110; + height: 5px; + width: 50px; +} + +.handsontable .manualColumnResizer:hover, +.handsontable .manualColumnResizer.active, +.handsontable .manualRowResizer:hover, +.handsontable .manualRowResizer.active { + background-color: #AAB; +} + +.handsontable .manualColumnResizerGuide { + position: fixed; + right: 0; + top: 0; + background-color: #AAB; + display: none; + width: 0; + border-right: 1px dashed #777; + margin-left: 5px; +} + +.handsontable .manualRowResizerGuide { + position: fixed; + left: 0; + bottom: 0; + background-color: #AAB; + display: none; + height: 0; + border-bottom: 1px dashed #777; + margin-top: 5px; +} + +.handsontable .manualColumnResizerGuide.active, +.handsontable .manualRowResizerGuide.active { + display: block; +} + +.handsontable .columnSorting { + position: relative; +} + +.handsontable .columnSorting:hover { + text-decoration: underline; + cursor: pointer; +} + +.handsontable .columnSorting.ascending::after { + content: '\25B2'; + color: #5f5f5f; + position: absolute; + right: -15px; +} + +.handsontable .columnSorting.descending::after { + content: '\25BC'; + color: #5f5f5f; + position: absolute; + right: -15px; +} + +.handsontable th.beforeHiddenColumn { + position: relative; +} + +.handsontable th.beforeHiddenColumn::after, +.handsontable th.afterHiddenColumn::before { + content: '\25C0'; + color: #bbb; + position: absolute; + right: 1px; + top: 2px; + font-size: 5pt; +} + +.handsontable th.afterHiddenColumn { + position: relative; +} + +.handsontable th.afterHiddenColumn::before { + left: 1px; + top: 2px; + right: auto; + content: '\25B6'; +} + +.handsontable td.afterHiddenColumn.firstVisible { + border-left: 1px solid #CCC; +} + +.handsontable thead th.hiddenHeader { + display: none; +} + +/* border line */ + +.handsontable .wtBorder { + position: absolute; + font-size: 0; +} +.handsontable .wtBorder.hidden{ + display:none !important; +} + +.handsontable td.area { + background: -moz-linear-gradient(top, rgba(181,209,255,0.34) 0%, rgba(181,209,255,0.34) 100%); /* FF3.6+ */ + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(181,209,255,0.34)), color-stop(100%,rgba(181,209,255,0.34))); /* Chrome,Safari4+ */ + background: -webkit-linear-gradient(top, rgba(181,209,255,0.34) 0%,rgba(181,209,255,0.34) 100%); /* Chrome10+,Safari5.1+ */ + background: -o-linear-gradient(top, rgba(181,209,255,0.34) 0%,rgba(181,209,255,0.34) 100%); /* Opera 11.10+ */ + background: -ms-linear-gradient(top, rgba(181,209,255,0.34) 0%,rgba(181,209,255,0.34) 100%); /* IE10+ */ + background: linear-gradient(to bottom, rgba(181,209,255,0.34) 0%,rgba(181,209,255,0.34) 100%); /* W3C */ + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#57b5d1ff', endColorstr='#57b5d1ff',GradientType=0 ); /* IE6-9 */ + background-color: #fff; +} + +/* fill handle */ + +.handsontable .wtBorder.corner { + font-size: 0; + cursor: crosshair; +} + +.handsontable .htBorder.htFillBorder { + background: red; + width: 1px; + height: 1px; +} + +.handsontableInput { + border:none; + outline-width: 0; + margin: 0 ; + padding: 1px 5px 0 5px; + font-family: inherit; + line-height: 21px; + font-size: inherit; + box-shadow: 0 0 0 2px #5292F7 inset; + resize: none; + /*below are needed to overwrite stuff added by jQuery UI Bootstrap theme*/ + display: inline-block; + color: #000; + border-radius: 0; + background-color: #FFF; + /*overwrite styles potentionally made by a framework*/ +} + +.handsontableInputHolder { + position: absolute; + top: 0; + left: 0; + z-index: 100; +} + +.htSelectEditor { + -webkit-appearance: menulist-button !important; + position: absolute; + width: auto; +} + +/* +TextRenderer readOnly cell +*/ + +.handsontable .htDimmed { + color: #777; +} + +.handsontable .htSubmenu { + position: relative; +} + +.handsontable .htSubmenu :after{ + content: '▶'; + color: #777; + position: absolute; + right: 5px; +} + + +/* +TextRenderer horizontal alignment +*/ +.handsontable .htLeft{ + text-align: left; +} +.handsontable .htCenter{ + text-align: center; +} +.handsontable .htRight{ + text-align: right; +} +.handsontable .htJustify{ + text-align: justify; +} +/* +TextRenderer vertical alignment +*/ +.handsontable .htTop{ + vertical-align: top; +} +.handsontable .htMiddle{ + vertical-align: middle; +} +.handsontable .htBottom{ + vertical-align: bottom; +} + +/* +TextRenderer placeholder value +*/ + +.handsontable .htPlaceholder { + color: #999; +} + +/* +AutocompleteRenderer down arrow +*/ + +.handsontable .htAutocompleteArrow { + float: right; + font-size: 10px; + color: #EEE; + cursor: default; + width: 16px; + text-align: center; +} + +.handsontable td .htAutocompleteArrow:hover { + color: #777; +} + +.handsontable td.area .htAutocompleteArrow { + color: #d3d3d3; +} + +/* +CheckboxRenderer +*/ + +.handsontable .htCheckboxRendererInput.noValue { + opacity: 0.5; +} +.handsontable .htCheckboxRendererLabel { + cursor: pointer; + display: inline-block; + width: 100%; +} + +/* +NumericRenderer +*/ + +.handsontable .htNumeric { + text-align: right; +} + +/* +Comment For Cell +*/ +.htCommentCell{ + position: relative; +} +.htCommentCell:after{ + content: ''; + position: absolute; + top: 0; + right: 0; + border-left: 6px solid transparent; + border-top: 6px solid red; +} + +@-webkit-keyframes opacity-hide { + from { + opacity: 1; + } + to { + opacity: 0; + /*display: none;*/ + } +} +@keyframes opacity-hide { + from { + /*display: block;*/ + opacity: 1; + } + to { + opacity: 0; + /*display: none;*/ + } +} + +@-webkit-keyframes opacity-show { + from { + opacity: 0; + /*display: none;*/ + } + to { + opacity: 1; + /*display: block;*/ + } +} +@keyframes opacity-show { + from { + opacity: 0; + /*display: none;*/ + } + to { + opacity: 1; + /*display: block;*/ + } +} + +/** + * Handsontable in Handsontable + */ + +.handsontable .handsontable.ht_clone_top .wtHider { + padding: 0 0 5px 0; +} + +/* removing shadows, TODO: remove the commented code and this comment */ +/*.handsontable .handsontable:not(.ht_master) table {*/ + /*-webkit-box-shadow: 1px 2px 5px rgba(0, 0, 0, 0.4);*/ + /*box-shadow: 1px 2px 5px rgba(0, 0, 0, 0.4);*/ +/*}*/ + +/** +* Autocomplete Editor +*/ +.handsontable .autocompleteEditor.handsontable { + padding-right: 17px; +} +.handsontable .autocompleteEditor.handsontable.htMacScroll { + padding-right: 15px; +} + + +/** + * Handsontable listbox theme + */ + +.handsontable.listbox { + margin: 0; +} + +.handsontable.listbox .ht_master table { + border: 1px solid #ccc; + border-collapse: separate; + background: white; +} + +.handsontable.listbox th, +.handsontable.listbox tr:first-child th, +.handsontable.listbox tr:last-child th, +.handsontable.listbox tr:first-child td, +.handsontable.listbox td { + border-color: transparent; +} + +.handsontable.listbox th, +.handsontable.listbox td { + white-space: nowrap; + text-overflow: ellipsis; +} + +.handsontable.listbox td.htDimmed { + cursor: default; + color: inherit; + font-style: inherit; +} + +.handsontable.listbox .wtBorder { + visibility: hidden; +} + +.handsontable.listbox tr td.current, +.handsontable.listbox tr:hover td { + background: #eee; +} + +.ht_clone_top { + z-index: 101; +} + +.ht_clone_left { + z-index: 102; +} + +.ht_clone_top_left_corner, +.ht_clone_bottom_left_corner { + z-index: 103; +} + +.ht_clone_debug { + z-index: 103; +} + +.handsontable td.htSearchResult { + background: #fcedd9; + color: #583707; +} + +/* +Cell borders +*/ +.htBordered{ + /*box-sizing: border-box !important;*/ + border-width: 1px; +} +.htBordered.htTopBorderSolid { + border-top-style: solid; + border-top-color: #000; +} +.htBordered.htRightBorderSolid { + border-right-style: solid; + border-right-color: #000; +} +.htBordered.htBottomBorderSolid { + border-bottom-style: solid; + border-bottom-color: #000; +} +.htBordered.htLeftBorderSolid { + border-left-style: solid; + border-left-color: #000; +} + +.htCommentTextArea{ + -moz-box-shadow: 1px 1px 2px #bbb; + -webkit-box-shadow: 1px 1px 2px #bbb; + background-color: #FFFACD; + border: 1px solid #999; + box-shadow: 1px 1px 2px #bbb; + font-family: 'Arial'; +} + +.handsontable tbody tr th:nth-last-child(2) { + border-right: 1px solid #CCC; +} + +.handsontable thead tr:nth-last-child(2) th.htGroupIndicatorContainer { + border-bottom: 1px solid #CCC; + padding-bottom: 5px; +} + + +.ht_clone_top_left_corner thead tr th:nth-last-child(2) { + border-right: 1px solid #CCC; +} + +.htCollapseButton { + width: 10px; + height: 10px; + line-height: 10px; + text-align: center; + border-radius: 5px; + border: 1px solid #f3f3f3; + -webkit-box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.4); + box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.4); + cursor: pointer; + margin-bottom: 3px; + position: relative; +} + +.htCollapseButton:after { + content: ""; + height: 300%; + width: 1px; + display: block; + background: #ccc; + margin-left: 4px; + position: absolute; + /*top: -300%;*/ + bottom: 10px; +} + + +thead .htCollapseButton { + right: 5px; + position: absolute; + top: 5px; + background: #fff; +} + +thead .htCollapseButton:after { + height: 1px; + width: 700%; + right: 10px; + top: 4px; +} + +.handsontable tr th .htExpandButton { + position: absolute; + width: 10px; + height: 10px; + line-height: 10px; + text-align: center; + border-radius: 5px; + border: 1px solid #f3f3f3; + -webkit-box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.4); + box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.4); + cursor: pointer; + top: 0; + display: none; +} + +.handsontable thead tr th .htExpandButton { + /*left: 5px;*/ + top: 5px; +} + +.handsontable tr th .htExpandButton.clickable { + display: block; +} + +.collapsibleIndicator { + position: absolute; + top: 50%; + transform: translate(0% ,-50%); + right: 5px; + border: 1px solid #A6A6A6; + line-height: 10px; + color: #222; + border-radius: 10px; + font-size: 10px; + width: 10px; + height: 10px; + cursor: pointer; + -webkit-box-shadow: 0px 0px 0px 6px rgba(238,238,238,1); + -moz-box-shadow: 0px 0px 0px 6px rgba(238,238,238,1); + box-shadow: 0px 0px 0px 6px rgba(238,238,238,1); + background: #eee; +} + +.handsontable col.hidden { + width: 0 !important; +} + +.handsontable table tr th.lightRightBorder { + border-right: 1px solid #E6E6E6; +} + +.handsontable tr.hidden, +.handsontable tr.hidden td, +.handsontable tr.hidden th { + display: none; +} + +.ht_master, +.ht_clone_left, +.ht_clone_top, +.ht_clone_bottom { + overflow: hidden; +} + +.ht_master .wtHolder { + overflow: auto; +} + +.ht_clone_left .wtHolder { + overflow-x: hidden; + overflow-y: auto; +} + +.ht_clone_top .wtHolder, +.ht_clone_bottom .wtHolder { + overflow-x: auto; + overflow-y: hidden; +} + + +/*WalkontableDebugOverlay*/ + +.wtDebugHidden { + display: none; +} + +.wtDebugVisible { + display: block; + -webkit-animation-duration: 0.5s; + -webkit-animation-name: wtFadeInFromNone; + animation-duration: 0.5s; + animation-name: wtFadeInFromNone; +} + +@keyframes wtFadeInFromNone { + 0% { + display: none; + opacity: 0; + } + + 1% { + display: block; + opacity: 0; + } + + 100% { + display: block; + opacity: 1; + } +} + +@-webkit-keyframes wtFadeInFromNone { + 0% { + display: none; + opacity: 0; + } + + 1% { + display: block; + opacity: 0; + } + + 100% { + display: block; + opacity: 1; + } +} +/* + + Handsontable Mobile Text Editor stylesheet + + */ + +.handsontable.mobile, +.handsontable.mobile .wtHolder { + -webkit-touch-callout:none; + -webkit-user-select:none; + -khtml-user-select:none; + -moz-user-select:none; + -ms-user-select:none; + user-select:none; + -webkit-tap-highlight-color:rgba(0,0,0,0); + -webkit-overflow-scrolling: touch; +} + +.htMobileEditorContainer { + display: none; + position: absolute; + top: 0; + width: 70%; + height: 54pt; + background: #f8f8f8; + border-radius: 20px; + border: 1px solid #ebebeb; + z-index: 999; + box-sizing: border-box; + -webkit-box-sizing: border-box; + -webkit-text-size-adjust: none; +} + +.topLeftSelectionHandle:not(.ht_master .topLeftSelectionHandle), +.topLeftSelectionHandle-HitArea:not(.ht_master .topLeftSelectionHandle-HitArea) { + z-index: 9999; +} + +/* Initial left/top coordinates - overwritten when actual position is set */ +.topLeftSelectionHandle, +.topLeftSelectionHandle-HitArea, +.bottomRightSelectionHandle, +.bottomRightSelectionHandle-HitArea { + left: -10000px; + top: -10000px; +} + +.htMobileEditorContainer.active { + display: block; +} + +.htMobileEditorContainer .inputs { + position: absolute; + right: 210pt; + bottom: 10pt; + top: 10pt; + left: 14px; + height: 34pt; +} + +.htMobileEditorContainer .inputs textarea { + font-size: 13pt; + border: 1px solid #a1a1a1; + -webkit-appearance: none; + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; + position: absolute; + left: 14px; + right: 14px; + top: 0; + bottom: 0; + padding: 7pt; +} + +.htMobileEditorContainer .cellPointer { + position: absolute; + top: -13pt; + height: 0; + width: 0; + left: 30px; + + border-left: 13pt solid transparent; + border-right: 13pt solid transparent; + border-bottom: 13pt solid #ebebeb; +} + +.htMobileEditorContainer .cellPointer.hidden { + display: none; +} + +.htMobileEditorContainer .cellPointer:before { + content: ''; + display: block; + position: absolute; + top: 2px; + height: 0; + width: 0; + left: -13pt; + + border-left: 13pt solid transparent; + border-right: 13pt solid transparent; + border-bottom: 13pt solid #f8f8f8; +} + +.htMobileEditorContainer .moveHandle { + position: absolute; + top: 10pt; + left: 5px; + width: 30px; + bottom: 0px; + cursor: move; + z-index: 9999; +} + +.htMobileEditorContainer .moveHandle:after { + content: "..\a..\a..\a.."; + white-space: pre; + line-height: 10px; + font-size: 20pt; + display: inline-block; + margin-top: -8px; + color: #ebebeb; +} + +.htMobileEditorContainer .positionControls { + width: 205pt; + position: absolute; + right: 5pt; + top: 0; + bottom: 0; +} + +.htMobileEditorContainer .positionControls > div { + width: 50pt; + height: 100%; + float: left; +} + +.htMobileEditorContainer .positionControls > div:after { + content: " "; + display: block; + width: 15pt; + height: 15pt; + text-align: center; + line-height: 50pt; +} + +.htMobileEditorContainer .leftButton:after, +.htMobileEditorContainer .rightButton:after, +.htMobileEditorContainer .upButton:after, +.htMobileEditorContainer .downButton:after { + transform-origin: 5pt 5pt; + -webkit-transform-origin: 5pt 5pt; + margin: 21pt 0 0 21pt; +} + +.htMobileEditorContainer .leftButton:after { + border-top: 2px solid #288ffe; + border-left: 2px solid #288ffe; + -webkit-transform: rotate(-45deg); + /*margin-top: 17pt;*/ + /*margin-left: 20pt;*/ +} +.htMobileEditorContainer .leftButton:active:after { + border-color: #cfcfcf; +} + +.htMobileEditorContainer .rightButton:after { + border-top: 2px solid #288ffe; + border-left: 2px solid #288ffe; + -webkit-transform: rotate(135deg); + /*margin-top: 17pt;*/ + /*margin-left: 10pt;*/ +} +.htMobileEditorContainer .rightButton:active:after { + border-color: #cfcfcf; +} + +.htMobileEditorContainer .upButton:after { + /*border-top: 2px solid #cfcfcf;*/ + border-top: 2px solid #288ffe; + border-left: 2px solid #288ffe; + -webkit-transform: rotate(45deg); + /*margin-top: 22pt;*/ + /*margin-left: 15pt;*/ +} +.htMobileEditorContainer .upButton:active:after { + border-color: #cfcfcf; +} + +.htMobileEditorContainer .downButton:after { + border-top: 2px solid #288ffe; + border-left: 2px solid #288ffe; + -webkit-transform: rotate(225deg); + /*margin-top: 15pt;*/ + /*margin-left: 15pt;*/ +} +.htMobileEditorContainer .downButton:active:after { + border-color: #cfcfcf; +} + +.handsontable.hide-tween { + -webkit-animation: opacity-hide 0.3s; + animation: opacity-hide 0.3s; + animation-fill-mode: forwards; + -webkit-animation-fill-mode: forwards; +} + +.handsontable.show-tween { + -webkit-animation: opacity-show 0.3s; + animation: opacity-show 0.3s; + animation-fill-mode: forwards; + -webkit-animation-fill-mode: forwards; +} +/*! + * Handsontable ContextMenu + */ + +.htContextMenu { + display: none; + position: absolute; + z-index: 1060; /* needs to be higher than 1050 - z-index for Twitter Bootstrap modal (#1569) */ +} + +.htContextMenu .ht_clone_top, +.htContextMenu .ht_clone_left, +.htContextMenu .ht_clone_corner, +.htContextMenu .ht_clone_debug { + display: none; +} + +.htContextMenu table.htCore { + border: 1px solid #bbb; + border-bottom-width: 2px; + border-right-width: 2px; +} + +.htContextMenu .wtBorder { + visibility: hidden; +} + +.htContextMenu table tbody tr td { + background: white; + border-width: 0; + padding: 4px 6px 0 6px; + cursor: pointer; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} + +.htContextMenu table tbody tr td:first-child { + border: 0; +} + +.htContextMenu table tbody tr td.htDimmed { + font-style: normal; + color: #323232; +} + +.htContextMenu table tbody tr td.current, +.htContextMenu table tbody tr td.zeroclipboard-is-hover { + background: #e9e9e9; +} + +.htContextMenu table tbody tr td.htSeparator { + border-top: 1px solid #bbb; + height: 0; + padding: 0; + cursor: default; +} + +.htContextMenu table tbody tr td.htDisabled { + color: #999; +} + +.htContextMenu table tbody tr td.htDisabled:hover { + background: #fff; + color: #999; + cursor: default; +} + +.htContextMenu table tbody tr.htHidden { + display: none; +} + +.htContextMenu table tbody tr td .htItemWrapper { + margin-left: 10px; + margin-right: 6px; +} + +.htContextMenu table tbody tr td div span.selected { + margin-top: -2px; + position: absolute; + left: 4px; +} + +.htContextMenu .ht_master .wtHolder { + overflow: hidden; +} +@charset "UTF-8"; + +/*! + * Pikaday + * Copyright © 2014 David Bushell | BSD & MIT license | http://dbushell.com/ + */ + +.pika-single { + z-index: 9999; + display: block; + position: relative; + color: #333; + background: #fff; + border: 1px solid #ccc; + border-bottom-color: #bbb; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; +} + +/* +clear child float (pika-lendar), using the famous micro clearfix hack +http://nicolasgallagher.com/micro-clearfix-hack/ +*/ +.pika-single:before, +.pika-single:after { + content: " "; + display: table; +} +.pika-single:after { clear: both } +.pika-single { *zoom: 1 } + +.pika-single.is-hidden { + display: none; +} + +.pika-single.is-bound { + position: absolute; + box-shadow: 0 5px 15px -5px rgba(0,0,0,.5); +} + +.pika-lendar { + float: left; + width: 240px; + margin: 8px; +} + +.pika-title { + position: relative; + text-align: center; +} + +.pika-label { + display: inline-block; + *display: inline; + position: relative; + z-index: 9999; + overflow: hidden; + margin: 0; + padding: 5px 3px; + font-size: 14px; + line-height: 20px; + font-weight: bold; + background-color: #fff; +} +.pika-title select { + cursor: pointer; + position: absolute; + z-index: 9998; + margin: 0; + left: 0; + top: 5px; + filter: alpha(opacity=0); + opacity: 0; +} + +.pika-prev, +.pika-next { + display: block; + cursor: pointer; + position: relative; + outline: none; + border: 0; + padding: 0; + width: 20px; + height: 30px; + /* hide text using text-indent trick, using width value (it's enough) */ + text-indent: 20px; + white-space: nowrap; + overflow: hidden; + background-color: transparent; + background-position: center center; + background-repeat: no-repeat; + background-size: 75% 75%; + opacity: .5; + *position: absolute; + *top: 0; +} + +.pika-prev:hover, +.pika-next:hover { + opacity: 1; +} + +.pika-prev, +.is-rtl .pika-next { + float: left; + background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAeCAYAAAAsEj5rAAAAUklEQVR42u3VMQoAIBADQf8Pgj+OD9hG2CtONJB2ymQkKe0HbwAP0xucDiQWARITIDEBEnMgMQ8S8+AqBIl6kKgHiXqQqAeJepBo/z38J/U0uAHlaBkBl9I4GwAAAABJRU5ErkJggg=='); + *left: 0; +} + +.pika-next, +.is-rtl .pika-prev { + float: right; + background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAeCAYAAAAsEj5rAAAAU0lEQVR42u3VOwoAMAgE0dwfAnNjU26bYkBCFGwfiL9VVWoO+BJ4Gf3gtsEKKoFBNTCoCAYVwaAiGNQGMUHMkjGbgjk2mIONuXo0nC8XnCf1JXgArVIZAQh5TKYAAAAASUVORK5CYII='); + *right: 0; +} + +.pika-prev.is-disabled, +.pika-next.is-disabled { + cursor: default; + opacity: .2; +} + +.pika-select { + display: inline-block; + *display: inline; +} + +.pika-table { + width: 100%; + border-collapse: collapse; + border-spacing: 0; + border: 0; +} + +.pika-table th, +.pika-table td { + width: 14.285714285714286%; + padding: 0; +} + +.pika-table th { + color: #999; + font-size: 12px; + line-height: 25px; + font-weight: bold; + text-align: center; +} + +.pika-button { + cursor: pointer; + display: block; + box-sizing: border-box; + -moz-box-sizing: border-box; + outline: none; + border: 0; + margin: 0; + width: 100%; + padding: 5px; + color: #666; + font-size: 12px; + line-height: 15px; + text-align: right; + background: #f5f5f5; +} + +.pika-week { + font-size: 11px; + color: #999; +} + +.is-today .pika-button { + color: #33aaff; + font-weight: bold; +} + +.is-selected .pika-button { + color: #fff; + font-weight: bold; + background: #33aaff; + box-shadow: inset 0 1px 3px #178fe5; + border-radius: 3px; +} + +.is-inrange .pika-button { + background: #D5E9F7; +} + +.is-startrange .pika-button { + color: #fff; + background: #6CB31D; + box-shadow: none; + border-radius: 3px; +} + +.is-endrange .pika-button { + color: #fff; + background: #33aaff; + box-shadow: none; + border-radius: 3px; +} + +.is-disabled .pika-button { + pointer-events: none; + cursor: default; + color: #999; + opacity: .3; +} + +.pika-button:hover { + color: #fff; + background: #ff8000; + box-shadow: none; + border-radius: 3px; +} + +/* styling for abbr */ +.pika-table abbr { + border-bottom: none; + cursor: help; +} + diff --git a/lib/handsontable.meteor.0.24.1.js b/lib/handsontable.meteor.0.24.1.js new file mode 100644 index 0000000..03af1d5 --- /dev/null +++ b/lib/handsontable.meteor.0.24.1.js @@ -0,0 +1,29355 @@ +/*! +(The MIT License) + +Copyright (c) 2012-2014 Marcin Warpechowski +Copyright (c) 2015 Handsoncode sp. z o.o. + +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 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":51,"helpers/string":53,"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); + var referenceTABLE = closest(TD, ['TABLE']); + if (TD && isChildOf(TD, TABLE) && referenceTABLE == 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; + }, + updateTrimmingContainer: function() { + this.trimmingContainer = getTrimmingContainer(this.hider.parentNode.parentNode); + }, + updateMainScrollableElement: function() { + this.mainTableScrollableElement = getScrollableElement(this.wot.wtTable.TABLE); + }, + 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":51}],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, + resetCssTransform = $__0.resetCssTransform; +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(); + resetCssTransform(overlayRoot); + } + 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; + this.updateTrimmingContainer(); + 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'; + } else { + overlayRootStyle.height = ''; + } + 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, + resetCssTransform = $__0.resetCssTransform; +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(); + resetCssTransform(overlayRoot); + } + 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; + this.updateTrimmingContainer(); + 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'; + } else { + overlayRootStyle.width = ''; + } + 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, + resetCssTransform = $__0.resetCssTransform; +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() { + this.updateTrimmingContainer(); + 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); + } else { + resetCssTransform(overlayRoot); + } + 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.pendingScrollCallbacks = { + master: { + top: 0, + left: 0 + }, + top: {left: 0}, + bottom: {left: 0}, + left: {top: 0} + }; + this.verticalScrolling = false; + this.horizontalScrolling = false; + this.delegatedScrollCallback = false; + this.registeredListeners = []; + 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; + var topOverlayScrollable = this.topOverlay.mainTableScrollableElement; + var leftOverlayScrollable = this.leftOverlay.mainTableScrollableElement; + var listenersToRegister = []; + listenersToRegister.push([document.documentElement, 'keydown', (function(event) { + return $__3.onKeyDown(event); + })]); + listenersToRegister.push([document.documentElement, 'keyup', (function() { + return $__3.onKeyUp(); + })]); + listenersToRegister.push([document, 'visibilitychange', (function() { + return $__3.onKeyUp(); + })]); + listenersToRegister.push([topOverlayScrollable, 'scroll', (function(event) { + return $__3.onTableScroll(event); + })]); + if (topOverlayScrollable !== leftOverlayScrollable) { + listenersToRegister.push([leftOverlayScrollable, 'scroll', (function(event) { + return $__3.onTableScroll(event); + })]); + } + if (this.topOverlay.needFullRender) { + listenersToRegister.push([this.topOverlay.clone.wtTable.holder, 'scroll', (function(event) { + return $__3.onTableScroll(event); + })]); + listenersToRegister.push([this.topOverlay.clone.wtTable.holder, 'wheel', (function(event) { + return $__3.onTableScroll(event); + })]); + } + if (this.bottomOverlay.needFullRender) { + listenersToRegister.push([this.bottomOverlay.clone.wtTable.holder, 'scroll', (function(event) { + return $__3.onTableScroll(event); + })]); + listenersToRegister.push([this.bottomOverlay.clone.wtTable.holder, 'wheel', (function(event) { + return $__3.onTableScroll(event); + })]); + } + if (this.leftOverlay.needFullRender) { + listenersToRegister.push([this.leftOverlay.clone.wtTable.holder, 'scroll', (function(event) { + return $__3.onTableScroll(event); + })]); + listenersToRegister.push([this.leftOverlay.clone.wtTable.holder, 'wheel', (function(event) { + return $__3.onTableScroll(event); + })]); + } + if (this.topOverlay.trimmingContainer !== window && this.leftOverlay.trimmingContainer !== window) { + listenersToRegister.push([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(); + } + })]); + } + while (listenersToRegister.length) { + var listener = listenersToRegister.pop(); + this.eventManager.addEventListener(listener[0], listener[1], listener[2]); + this.registeredListeners.push(listener); + } + }, + deregisterListeners: function() { + while (this.registeredListeners.length) { + var listener = this.registeredListeners.pop(); + this.eventManager.removeEventListener(listener[0], listener[1], listener[2]); + } + }, + 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); + } + this.horizontalScrolling = true; + this.overlayScrollPositions.master.left = tempScrollValue; + scrollValueChanged = true; + if (this.pendingScrollCallbacks.master.left > 0) { + this.pendingScrollCallbacks.master.left--; + } else { + if (topOverlay && topOverlay.scrollLeft !== tempScrollValue) { + if (fakeScrollValue == null) { + this.pendingScrollCallbacks.top.left++; + } + topOverlay.scrollLeft = tempScrollValue; + delegatedScroll = (masterHorizontal !== window); + } + if (bottomOverlay && bottomOverlay.scrollLeft !== tempScrollValue) { + if (fakeScrollValue == null) { + this.pendingScrollCallbacks.bottom.left++; + } + bottomOverlay.scrollLeft = tempScrollValue; + delegatedScroll = (masterHorizontal !== window); + } + } + tempScrollValue = getScrollTop(target); + this.verticalScrolling = true; + this.overlayScrollPositions.master.top = tempScrollValue; + scrollValueChanged = true; + if (this.pendingScrollCallbacks.master.top > 0) { + this.pendingScrollCallbacks.master.top--; + } else { + if (leftOverlay && leftOverlay.scrollTop !== tempScrollValue) { + if (fakeScrollValue == null) { + this.pendingScrollCallbacks.left.top++; + } + leftOverlay.scrollTop = tempScrollValue; + delegatedScroll = (masterVertical !== window); + } + } + } else if (target === bottomOverlay) { + tempScrollValue = getScrollLeft(target); + this.horizontalScrolling = true; + this.overlayScrollPositions.bottom.left = tempScrollValue; + scrollValueChanged = true; + if (this.pendingScrollCallbacks.bottom.left > 0) { + this.pendingScrollCallbacks.bottom.left--; + } else { + if (fakeScrollValue == null) { + this.pendingScrollCallbacks.master.left++; + } + masterHorizontal.scrollLeft = tempScrollValue; + if (topOverlay && topOverlay.scrollLeft !== tempScrollValue) { + if (fakeScrollValue == null) { + this.pendingScrollCallbacks.top.left++; + } + topOverlay.scrollLeft = tempScrollValue; + delegatedScroll = (masterVertical !== window); + } + } + if (fakeScrollValue !== null) { + scrollValueChanged = true; + masterVertical.scrollTop += fakeScrollValue; + } + } else if (target === topOverlay) { + tempScrollValue = getScrollLeft(target); + this.horizontalScrolling = true; + this.overlayScrollPositions.top.left = tempScrollValue; + scrollValueChanged = true; + if (this.pendingScrollCallbacks.top.left > 0) { + this.pendingScrollCallbacks.top.left--; + } else { + if (fakeScrollValue == null) { + this.pendingScrollCallbacks.master.left++; + } + masterHorizontal.scrollLeft = tempScrollValue; + } + if (fakeScrollValue !== null) { + scrollValueChanged = true; + masterVertical.scrollTop += fakeScrollValue; + } + if (bottomOverlay && bottomOverlay.scrollLeft !== tempScrollValue) { + if (fakeScrollValue == null) { + this.pendingScrollCallbacks.bottom.left++; + } + bottomOverlay.scrollLeft = tempScrollValue; + delegatedScroll = (masterVertical !== window); + } + } else if (target === leftOverlay) { + tempScrollValue = getScrollTop(target); + if (this.overlayScrollPositions.left.top !== tempScrollValue) { + this.verticalScrolling = true; + this.overlayScrollPositions.left.top = tempScrollValue; + scrollValueChanged = true; + if (this.pendingScrollCallbacks.left.top > 0) { + this.pendingScrollCallbacks.left.top--; + } else { + if (fakeScrollValue == null) { + this.pendingScrollCallbacks.master.top++; + } + 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; + } + }, + updateMainScrollableElements: function() { + this.deregisterListeners(); + this.leftOverlay.updateMainScrollableElement(); + this.topOverlay.updateMainScrollableElement(); + if (this.bottomOverlay.needFullRender) { + this.bottomOverlay.updateMainScrollableElement(); + } + this.scrollableElement = getScrollableElement(this.wot.wtTable.TABLE); + this.registerListeners(); + }, + 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":54}],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":50}],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_feature__, + $__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__; +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 featureHelpers = ($__helpers_47_feature__ = require("helpers/feature"), $__helpers_47_feature__ && $__helpers_47_feature__.__esModule && $__helpers_47_feature__ || {default: $__helpers_47_feature__}); +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, featureHelpers, functionHelpers, mixedHelpers, numberHelpers, objectHelpers, settingHelpers, stringHelpers, unicodeHelpers]; +var DOM = [domHelpers, domEventHelpers]; +Handsontable.buildDate = 'Wed Mar 16 2016 12:23:01 GMT+0100 (CET)'; +Handsontable.packageName = 'handsontable'; +Handsontable.version = '0.24.1'; +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/feature":47,"helpers/function":48,"helpers/mixed":49,"helpers/number":50,"helpers/object":51,"helpers/setting":52,"helpers/string":53,"helpers/unicode":54,"pluginHooks":57,"plugins":58,"plugins/jqueryHandsontable":1,"renderers/_cellDecorator":92,"shims/classes":99}],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_timeValidator__, + $__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 TimeValidator = ($__validators_47_timeValidator__ = require("validators/timeValidator"), $__validators_47_timeValidator__ && $__validators_47_timeValidator__.__esModule && $__validators_47_timeValidator__ || {default: $__validators_47_timeValidator__}).TimeValidator; +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.TimeCell = { + editor: getEditorConstructor('text'), + validator: Handsontable.TimeValidator, + renderer: getRenderer('text') +}; +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, + time: Handsontable.TimeCell, + 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":91,"renderers/autocompleteRenderer":93,"renderers/checkboxRenderer":94,"renderers/htmlRenderer":95,"renderers/numericRenderer":96,"renderers/passwordRenderer":97,"renderers/textRenderer":98,"validators/autocompleteValidator":104,"validators/dateValidator":105,"validators/numericValidator":106,"validators/timeValidator":107}],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 $__7 = ($__helpers_47_array__ = require("helpers/array"), $__helpers_47_array__ && $__helpers_47_array__.__esModule && $__helpers_47_array__ || {default: $__helpers_47_array__}), + arrayFlatten = $__7.arrayFlatten, + arrayMap = $__7.arrayMap; +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; + function spliceWith(data, index, count, toInject) { + var valueFactory = (function() { + var result; + if (toInject === 'array') { + result = []; + } else if (toInject === 'object') { + result = {}; + } + return result; + }); + var spliceArgs = arrayMap(new Array(count), (function() { + return valueFactory(); + })); + spliceArgs.unshift(index, 0); + data.splice.apply(data, spliceArgs); + } + switch (action) { + case 'insert_row': + if (instance.getSettings().maxRows === instance.countSourceRows()) { + return; + } + delta = datamap.createRow(index, amount); + spliceWith(priv.cellSettings, index, amount, 'array'); + 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); + for (var row = 0, + len = instance.countSourceRows(); row < len; row++) { + if (priv.cellSettings[row]) { + spliceWith(priv.cellSettings[row], 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': + var logicalColumnIndex = translateColIndex(index); + datamap.removeCol(index, amount); + for (var row$__20 = 0, + len$__21 = instance.countSourceRows(); row$__20 < len$__21; row$__20++) { + if (priv.cellSettings[row$__20]) { + priv.cellSettings[row$__20].splice(logicalColumnIndex, 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 logicalColumnIndex == 'undefined') { + logicalColumnIndex = -1; + } + instance.getSettings().colHeaders.splice(logicalColumnIndex, amount); + } + grid.adjustRowsAndCols(); + selection.refreshBorders(); + break; + default: + throw new Error('There is no such action "' + action + '"'); + } + 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 cellProperties = instance.getCellMeta(row, col); + 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 { + instance._registerTimeout(setTimeout(function() { + cellProperties.valid = true; + done(cellProperties.valid); + }, 0)); + } + }; + 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'; + } + if (datamap) { + datamap.destroy(); + } + 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(); + if (settings.cell !== void 0 || settings.cells !== void 0 || settings.columns !== void 0) { + 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]; + if (column) { + 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); + } + } + var currentHeight = instance.rootElement.style.height; + if (currentHeight !== '') { + currentHeight = parseInt(instance.rootElement.style.height, 10); + } + var height = settings.height; + if (typeof height == 'function') { + height = height(); + } + if (init) { + var initialStyle = instance.rootElement.getAttribute('style'); + if (initialStyle) { + instance.rootElement.setAttribute('data-initialstyle', instance.rootElement.getAttribute('style')); + } + } + if (height === null) { + var initialStyle$__22 = instance.rootElement.getAttribute('data-initialstyle'); + if (initialStyle$__22 && (initialStyle$__22.indexOf('height') > -1 || initialStyle$__22.indexOf('overflow') > -1)) { + instance.rootElement.setAttribute('style', initialStyle$__22); + } else { + instance.rootElement.style.height = ''; + instance.rootElement.style.overflow = ''; + } + } else if (height !== void 0) { + instance.rootElement.style.height = height + 'px'; + instance.rootElement.style.overflow = 'hidden'; + } + if (typeof settings.width != 'undefined') { + var width = settings.width; + if (typeof width == 'function') { + width = width(); + } + instance.rootElement.style.width = width + 'px'; + } + if (!init) { + Handsontable.hooks.run(instance, 'afterUpdateSettings'); + } + grid.adjustRowsAndCols(); + if (instance.view && !priv.firstRun) { + instance.forceFullRender = true; + selection.refreshBorders(null, true); + } + if (!init && instance.view && (currentHeight === '' || height === '' || height === void 0) && currentHeight !== height) { + instance.view.wt.wtOverlays.updateMainScrollableElements(); + } + }; + 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; + } + } + } + if (datamap) { + datamap.destroy(); + } + datamap = null; + priv = 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, + allowEmpty: 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, + observeChanges: void 0, + sortFunction: 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":50,"helpers/object":51,"helpers/setting":52,"helpers/string":53,"numeral":"numeral","plugins":58,"renderers":91,"tableView":100}],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__, + $__utils_47_interval__, + $__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 Interval = ($__utils_47_interval__ = require("utils/interval"), $__utils_47_interval__ && $__utils_47_interval__.__esModule && $__utils_47_interval__ || {default: $__utils_47_interval__}).Interval; +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) { + var $__8 = this; + this.instance = instance; + this.priv = priv; + this.GridSettings = GridSettings; + this.dataSource = this.instance.getSettings().data; + this.cachedLength = null; + this.latestSourceRowsCount = 0; + if (this.dataSource[0]) { + this.duckSchema = this.recursiveDuckSchema(this.dataSource[0]); + } else { + this.duckSchema = {}; + } + this.createMap(); + this.interval = Interval.create((function() { + return $__8.clearLengthCache(); + }), '15fps'); +} +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, 'unmodifyCol', 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 descendingLogicRows = logicRows.slice(0).sort(function(a, b) { + return b - a; + }); + var actionWasNotCancelled = Handsontable.hooks.run(this.instance, 'beforeRemoveRow', index, amount, logicRows); + if (actionWasNotCancelled === false) { + return; + } + var data = this.dataSource; + var newData; + 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 logicColumns = this.physicalColumnsToLogical(index, amount); + var descendingLogicColumns = logicColumns.slice(0).sort(function(a, b) { + return b - a; + }); + var actionWasNotCancelled = Handsontable.hooks.run(this.instance, 'beforeRemoveCol', index, amount, logicColumns); + if (actionWasNotCancelled === false) { + return; + } + var isTableUniform = true; + var removedColumnsCount = descendingLogicColumns.length; + var data = this.dataSource; + for (var c = 0; c < removedColumnsCount; c++) { + if (isTableUniform && logicColumns[0] !== logicColumns[c] - c) { + isTableUniform = false; + } + } + if (isTableUniform) { + for (var r = 0, + rlen = this.instance.countSourceRows(); r < rlen; r++) { + data[r].splice(logicColumns[0], amount); + } + } else { + for (var r$__9 = 0, + rlen$__10 = this.instance.countSourceRows(); r$__9 < rlen$__10; r$__9++) { + for (var c$__11 = 0; c$__11 < removedColumnsCount; c$__11++) { + data[r$__9].splice(descendingLogicColumns[c$__11], 1); + } + } + for (var c$__12 = 0; c$__12 < removedColumnsCount; c$__12++) { + this.priv.columnSettings.splice(logicColumns[c$__12], 1); + } + } + 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); + var dataRow = this.dataSource[row]; + if (dataRow && dataRow.hasOwnProperty && dataRow.hasOwnProperty(prop)) { + return dataRow[prop]; + } else if (typeof prop === 'string' && prop.indexOf('.') > -1) { + var sliced = prop.split('.'); + var out = dataRow; + 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]); + } + 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'); + var dataRow = this.dataSource[row]; + if (dataRow && dataRow.hasOwnProperty && dataRow.hasOwnProperty(prop)) { + dataRow[prop] = value; + } else if (typeof prop === 'string' && prop.indexOf('.') > -1) { + var sliced = prop.split('.'); + var out = dataRow; + 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 { + dataRow[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.physicalColumnsToLogical = function(index, amount) { + var totalCols = this.instance.countCols(); + var physicalCol = (totalCols + index) % totalCols; + var logicalCols = []; + var colsToRemove = amount; + while (physicalCol < totalCols && colsToRemove) { + var col = Handsontable.hooks.run(this.instance, 'modifyCol', physicalCol); + logicalCols.push(col); + colsToRemove--; + physicalCol++; + } + return logicalCols; +}; +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.clearLengthCache = function() { + this.cachedLength = null; +}; +DataMap.prototype.getLength = function() { + var $__8 = this; + var length = this.instance.countSourceRows(); + if (Handsontable.hooks.has('modifyRow', this.instance)) { + var reValidate = false; + this.interval.start(); + if (length !== this.latestSourceRowsCount) { + reValidate = true; + } + this.latestSourceRowsCount = length; + if (this.cachedLength === null || reValidate) { + rangeEach(length - 1, (function(row) { + row = Handsontable.hooks.run($__8.instance, 'modifyRow', row); + if (row === null) { + --length; + } + })); + this.cachedLength = length; + } else { + length = this.cachedLength; + } + } else { + this.interval.stop(); + } + 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)); +}; +DataMap.prototype.destroy = function() { + this.interval.stop(); + this.interval = null; + this.instance = null; + this.priv = null; + this.GridSettings = null; + this.dataSource = null; + this.cachedLength = null; + this.duckSchema = null; +}; +; +Handsontable.DataMap = DataMap; + +//# +},{"SheetClip":"SheetClip","helpers/array":42,"helpers/data":44,"helpers/number":50,"helpers/object":51,"helpers/setting":52,"multiMap":56,"utils/interval":102}],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":50,"helpers/object":51,"helpers/setting":52}],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":54}],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":53}],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; + } + var value = this.getValue(); + if (this.instance.getSettings().trimWhitespace) { + val = [[typeof value === 'string' ? String.prototype.trim.call(value || '') : value]]; + } else { + val = [[value]]; + } + 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":49}],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, '' + match + ''); + } + } + }, + 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":49,"helpers/unicode":54}],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":51,"helpers/unicode":54,"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":51,"helpers/unicode":54,"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":54}],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":54}],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.TEXTAREA_PARENT); + } + 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":54}],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_feature__, + $__helpers_47_dom_47_event__; +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_feature__ = require("helpers/feature"), $__helpers_47_feature__ && $__helpers_47_feature__.__esModule && $__helpers_47_feature__ || {default: $__helpers_47_feature__}).isWebComponentSupportedNatively; +var _stopImmediatePropagation = ($__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__}).stopImmediatePropagation; +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 $__3 = 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() { + $__3.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; + var nativeStopImmediatePropagation; + event.isTargetWebComponent = false; + event.realTarget = event.target; + nativeStopImmediatePropagation = event.stopImmediatePropagation; + event.stopImmediatePropagation = function() { + nativeStopImmediatePropagation.apply(this); + _stopImmediatePropagation(this); + }; + 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/dom/element":45,"helpers/dom/event":46,"helpers/feature":47}],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; + }}, + __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)); +} + +//# +},{}],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":51}],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; + }}, + __esModule: {value: true} +}); +var $___46__46__47_browser__, + $___46__46__47_feature__; +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; +var hasCaptionProblem = ($___46__46__47_feature__ = require("../feature"), $___46__46__47_feature__ && $___46__46__47_feature__.__esModule && $___46__46__47_feature__ || {default: $___46__46__47_feature__}).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.style.transform && element.style.transform !== '') { + element.style.transform = ''; + } else if (element.style['-webkit-transform'] && element.style['-webkit-transform'] !== '') { + element.style['-webkit-transform'] = ''; + } +} +function isInput(element) { + var inputs = ['INPUT', 'SELECT', 'TEXTAREA']; + return element && (inputs.indexOf(element.nodeName) > -1 || element.contentEditable === 'true'); +} +function isOutsideInput(element) { + return isInput(element) && element.className.indexOf('handsontableInput') == -1 && element.className.indexOf('copyPaste') == -1; +} + +//# +},{"../browser":43,"../feature":47}],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, { + requestAnimationFrame: {get: function() { + return requestAnimationFrame; + }}, + cancelAnimationFrame: {get: function() { + return cancelAnimationFrame; + }}, + isTouchSupported: {get: function() { + return isTouchSupported; + }}, + isWebComponentSupportedNatively: {get: function() { + return isWebComponentSupportedNatively; + }}, + hasCaptionProblem: {get: function() { + return hasCaptionProblem; + }}, + getComparisonFunction: {get: function() { + return getComparisonFunction; + }}, + __esModule: {value: true} +}); +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); +} +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 = 't
    t'; + var CAPTION = document.createElement('CAPTION'); + CAPTION.innerHTML = 'c
    c
    c
    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; +} +var comparisonFunction; +function getComparisonFunction(language) { + var options = arguments[1] !== (void 0) ? arguments[1] : {}; + if (comparisonFunction) { + return comparisonFunction; + } + if (typeof Intl === 'object') { + comparisonFunction = new Intl.Collator(language, options).compare; + } else if (typeof String.prototype.localeCompare === 'function') { + comparisonFunction = (function(a, b) { + return (a + '').localeCompare(b); + }); + } else { + comparisonFunction = (function(a, b) { + if (a === b) { + return 0; + } + return a > b ? -1 : 1; + }); + } + return comparisonFunction; +} + +//# +},{}],48:[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; + }}, + pipe: {get: function() { + return pipe; + }}, + partial: {get: function() { + return partial; + }}, + curry: {get: function() { + return curry; + }}, + curryRight: {get: function() { + return curryRight; + }}, + __esModule: {value: true} +}); +var $__array__; +var arrayReduce = ($__array__ = require("array"), $__array__ && $__array__.__esModule && $__array__ || {default: $__array__}).arrayReduce; +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 $__1 = 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($__1, 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 lastTimer = null; + var result; + function _debounce() { + var $__1 = this; + var args = arguments; + if (lastTimer) { + clearTimeout(lastTimer); + } + lastTimer = setTimeout((function() { + result = func.apply($__1, args); + }), wait); + return result; + } + return _debounce; +} +function pipe() { + for (var functions = [], + $__2 = 0; $__2 < arguments.length; $__2++) + functions[$__2] = arguments[$__2]; + var $__5 = functions, + firstFunc = $__5[0], + restFunc = Array.prototype.slice.call($__5, 1); + return function _pipe() { + return arrayReduce(restFunc, (function(acc, fn) { + return fn(acc); + }), firstFunc.apply(this, arguments)); + }; +} +function partial(func) { + for (var params = [], + $__3 = 1; $__3 < arguments.length; $__3++) + params[$__3 - 1] = arguments[$__3]; + return function _partial() { + for (var restParams = [], + $__4 = 0; $__4 < arguments.length; $__4++) + restParams[$__4] = arguments[$__4]; + return func.apply(this, params.concat(restParams)); + }; +} +function curry(func) { + var argsLength = func.length; + function given(argsSoFar) { + return function _curry() { + for (var params = [], + $__4 = 0; $__4 < arguments.length; $__4++) + params[$__4] = arguments[$__4]; + var passedArgsSoFar = argsSoFar.concat(params); + var result; + if (passedArgsSoFar.length >= argsLength) { + result = func.apply(this, passedArgsSoFar); + } else { + result = given(passedArgsSoFar); + } + return result; + }; + } + return given([]); +} +function curryRight(func) { + var argsLength = func.length; + function given(argsSoFar) { + return function _curry() { + for (var params = [], + $__4 = 0; $__4 < arguments.length; $__4++) + params[$__4] = arguments[$__4]; + var passedArgsSoFar = argsSoFar.concat(params.reverse()); + var result; + if (passedArgsSoFar.length >= argsLength) { + result = func.apply(this, passedArgsSoFar); + } else { + result = given(passedArgsSoFar); + } + return result; + }; + } + return given([]); +} + +//# +},{"array":42}],49:[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(); + } +} + +//# +},{}],50:[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; +} + +//# +},{}],51:[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 if (Object.prototype.toString.call(extension[key]) === '[object Date]') { + target[key] = extension[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}],52:[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":51}],53:[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":49,"number":50}],54:[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}],55:[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":51}],56:[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; + } +} + +//# +},{}],57:[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', 'unmodifyCol', '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":51}],58:[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":51,"helpers/string":53}],59:[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":51,"plugins":58}],60:[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_feature__, + $___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_feature__ = require("helpers/feature"), $___46__46__47__46__46__47_helpers_47_feature__ && $___46__46__47__46__46__47_helpers_47_feature__.__esModule && $___46__46__47__46__46__47_helpers_47_feature__ || {default: $___46__46__47__46__46__47_helpers_47_feature__}), + cancelAnimationFrame = $__2.cancelAnimationFrame, + requestAnimationFrame = $__2.requestAnimationFrame; +var isVisible = ($___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__}).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 $__5 = ($___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 = $__5.isObject, + objectEach = $__5.objectEach; +var $__6 = ($___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 = $__6.valueAccordingPercent, + rangeEach = $__6.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 $__11 = this; + $traceurRuntime.superConstructor($AutoColumnSize).call(this, hotInstance); + this.widths = []; + this.ghostTable = new GhostTable(this.hot); + this.samplesGenerator = new SamplesGenerator((function(row, col) { + return $__11.hot.getDataAtCell(row, col); + })); + this.firstCalculation = true; + this.inProgress = false; + this.addHook('beforeColumnResize', (function(col, size, isDblClick) { + return $__11.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 $__11 = 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 $__11.onAfterLoadData(); + })); + this.addHook('beforeChange', (function(changes) { + return $__11.onBeforeChange(changes); + })); + this.addHook('beforeRender', (function(force) { + return $__11.onBeforeRender(force); + })); + this.addHook('modifyColWidth', (function(width, col) { + return $__11.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 $__11 = 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 || ($__11.widths[col] === void 0 && !$__11.hot._getColWidthFromSettings(col))) { + var samples = $__11.samplesGenerator.generateColumnSamples(col, rowRange); + samples.forEach((function(sample, col) { + return $__11.ghostTable.addColumn(col, sample); + })); + } + })); + if (this.ghostTable.columns.length) { + this.ghostTable.getWidths((function(col, width) { + return $__11.widths[col] = width; + })); + this.ghostTable.clean(); + } + }, + calculateAllColumnsWidth: function() { + var rowRange = arguments[0] !== (void 0) ? arguments[0] : { + from: 0, + to: this.hot.countRows() - 1 + }; + var $__11 = this; + var current = 0; + var length = this.hot.countCols() - 1; + var timer = null; + this.inProgress = true; + var loop = (function() { + if (!$__11.hot) { + cancelAnimationFrame(timer); + $__11.inProgress = false; + return; + } + $__11.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); + $__11.inProgress = false; + $__11.hot.view.wt.wtOverlays.adjustElementsSize(true); + if ($__11.hot.view.wt.wtOverlays.leftOverlay.needFullRender) { + $__11.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; + var rowsCount = this.hot.countRows(); + if (!rowsCount) { + return; + } + this.calculateColumnsWidth({ + from: this.getFirstVisibleColumn(), + to: this.getLastVisibleColumn() + }, void 0, force); + if (this.isNeedRecalculate() && !this.inProgress) { + this.calculateAllColumnsWidth(); + } + }, + onAfterLoadData: function() { + var $__11 = this; + if (this.hot.view) { + this.recalculateAllColumnsWidth(); + } else { + setTimeout((function() { + if ($__11.hot) { + $__11.recalculateAllColumnsWidth(); + } + }), 0); + } + }, + onBeforeChange: function(changes) { + var $__11 = this; + arrayEach(changes, (function(data) { + return $__11.widths[$__11.hot.propToCol(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":59,"helpers/array":42,"helpers/dom/element":45,"helpers/feature":47,"helpers/number":50,"helpers/object":51,"helpers/string":53,"plugins":58,"utils/ghostTable":101,"utils/samplesGenerator":103}],61:[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_feature__, + $___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_feature__ = require("helpers/feature"), $___46__46__47__46__46__47_helpers_47_feature__ && $___46__46__47__46__46__47_helpers_47_feature__.__esModule && $___46__46__47__46__46__47_helpers_47_feature__ || {default: $___46__46__47__46__46__47_helpers_47_feature__}), + cancelAnimationFrame = $__2.cancelAnimationFrame, + requestAnimationFrame = $__2.requestAnimationFrame; +var isVisible = ($___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__}).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 $__5 = ($___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 = $__5.isObject, + objectEach = $__5.objectEach; +var $__6 = ($___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 = $__6.valueAccordingPercent, + rangeEach = $__6.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 $__10 = this; + $traceurRuntime.superConstructor($AutoRowSize).call(this, hotInstance); + this.heights = []; + 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('beforeRowResize', (function(row, size, isDblClick) { + return $__10.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 $__10 = 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 $__10.onAfterLoadData(); + })); + this.addHook('beforeChange', (function(changes) { + return $__10.onBeforeChange(changes); + })); + this.addHook('beforeColumnMove', (function() { + return $__10.recalculateAllRowsHeight(); + })); + this.addHook('beforeColumnResize', (function() { + return $__10.recalculateAllRowsHeight(); + })); + this.addHook('beforeColumnSort', (function() { + return $__10.clearCache(); + })); + this.addHook('beforeRender', (function(force) { + return $__10.onBeforeRender(force); + })); + this.addHook('beforeRowMove', (function(rowStart, rowEnd) { + return $__10.onBeforeRowMove(rowStart, rowEnd); + })); + this.addHook('modifyRowHeight', (function(height, row) { + return $__10.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 $__10 = 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 || $__10.heights[row] === void 0) { + var samples = $__10.samplesGenerator.generateRowSamples(row, colRange); + samples.forEach((function(sample, row) { + return $__10.ghostTable.addRow(row, sample); + })); + } + })); + if (this.ghostTable.rows.length) { + this.ghostTable.getHeights((function(row, height) { + return $__10.heights[row] = height; + })); + this.ghostTable.clean(); + } + }, + calculateAllRowsHeight: function() { + var colRange = arguments[0] !== (void 0) ? arguments[0] : { + from: 0, + to: this.hot.countCols() - 1 + }; + var $__10 = this; + var current = 0; + var length = this.hot.countRows() - 1; + var timer = null; + this.inProgress = true; + var loop = (function() { + if (!$__10.hot) { + cancelAnimationFrame(timer); + $__10.inProgress = false; + return; + } + $__10.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); + $__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.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 $__10 = 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 $__10.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 $__10 = this; + if (this.hot.view) { + this.recalculateAllRowsHeight(); + } else { + setTimeout((function() { + if ($__10.hot) { + $__10.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":59,"helpers/array":42,"helpers/dom/element":45,"helpers/feature":47,"helpers/number":50,"helpers/object":51,"helpers/string":53,"plugins":58,"utils/ghostTable":101,"utils/samplesGenerator":103}],62:[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 && settings('autoInsertRow')) { + 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 (settings('direction') !== 'horizontal' && (bottomRight.row < coords.row || topLeft.row > coords.row)) { + coords = new WalkontableCellCoords(coords.row, bottomRight.col); + } else if (settings('direction') !== '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 && settings('autoInsertRow')) { + 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); + settings = settingsFactory(this.getSettings().fillHandle); + if (settings('fillHandle') !== void 0) { + if (autofill.handle && settings('fillHandle') === false) { + autofill.disable(); + } else if (!autofill.handle && settings('fillHandle') !== false) { + this.autofill = autofill; + this.autofill.init(); + } + } +}); +var settings; +function settingsFactory(settings) { + return function(key) { + var result; + if (key === 'direction') { + if (typeof settings === 'string') { + result = settings; + } else if (typeof settings === 'object' && settings[key] !== void 0) { + result = settings[key]; + } else { + result = true; + } + } else if (key === 'autoInsertRow') { + if (typeof settings === 'object' && settings[key] !== void 0) { + result = settings[key]; + } else { + result = true; + } + } else if (key === 'fillHandle') { + result = settings ? true : false; + } + return result; + }; +} +Handsontable.Autofill = Autofill; + +//# +},{"3rdparty/walkontable/src/cell/coords":5,"eventManager":41,"helpers/dom/element":45,"plugins":58}],63:[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 = []; + this.lastSortedColumn = null; +}; +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.lastSortedColumn = sortingColumn; + 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.updateOrderClass(); + 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; + }, + updateOrderClass: function() { + var orderClass; + if (this.hot.sortOrder === true) { + orderClass = 'ascending'; + } else if (this.hot.sortOrder === false) { + orderClass = 'descending'; + } + this.sortOrderClass = orderClass; + }, + bindColumnSortingAfterClick: function() { + var $__5 = this; + 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 !== $__5.lastSortedColumn) { + $__5.hot.sortOrder = true; + } + $__5.lastSortedColumn = col; + $__5.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; + }; + }, + numericSort: function(sortOrder) { + return function(a, b) { + var parsedA = parseFloat(a[1]); + var parsedB = parseFloat(b[1]); + if (parsedA === parsedB || (isNaN(parsedA) && isNaN(parsedB))) { + return 0; + } + if (isNaN(parsedA)) { + return 1; + } + if (isNaN(parsedB)) { + return -1; + } + if (parsedA < parsedB) { + return sortOrder ? -1 : 1; + } else if (parsedA > parsedB) { + 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); + if (colMeta.sortFunction) { + sortFunction = colMeta.sortFunction; + } else { + switch (colMeta.type) { + case 'date': + sortFunction = this.dateSort; + break; + case 'numeric': + sortFunction = this.numericSort; + 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":59,"eventManager":41,"helpers/array":42,"helpers/dom/element":45,"plugins":58}],64:[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}],65:[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":59,"commentEditor":64,"eventManager":41,"helpers/dom/element":45,"plugins":58}],66:[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}],67:[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); + })); + })); + }, + updatePlugin: function() { + this.disablePlugin(); + this.enablePlugin(); + $traceurRuntime.superGet(this, $ContextMenu.prototype, "updatePlugin").call(this); + }, + 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":59,"commandExecutor":66,"eventManager":41,"helpers/array":42,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/object":51,"itemsFactory":69,"menu":70,"plugins":58,"predefinedItems":71}],68:[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}],69:[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":51,"predefinedItems":71}],70:[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 $__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, + arrayReduce = $__1.arrayReduce; +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, options) { + this.hot = hotInstance; + this.options = options || { + parent: null, + name: null, + className: '', + keepInViewport: true, + standalone: false + }; + 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', + disableVisualSelection: 'area', + beforeKeyDown: (function(event) { + return $__11.onBeforeKeyDown(event); + }), + afterOnCellMouseOver: (function(event, coords, TD) { + 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 false; + } + 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 || selectedItem.name === SEPARATOR) { + 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); + } + if (!(selectedItem.disabled === true || typeof selectedItem.disabled === 'function' && selectedItem.disabled.call(this.hot) === true || selectedItem.submenu)) { + 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(TD, 'mouseenter', (function() { + return hot.deselectCell(); + })); + } else if (itemIsSelectionDisabled(item)) { + addClass(TD, 'htSelectionDisabled'); + this.eventManager.addEventListener(TD, 'mouseenter', (function() { + return hot.deselectCell(); + })); + } else if (isSubMenu(item)) { + addClass(TD, 'htSubmenu'); + if (itemIsSelectionDisabled(item)) { + this.eventManager.addEventListener(TD, 'mouseenter', (function() { + return hot.deselectCell(); + })); + } else { + this.eventManager.addEventListener(TD, '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(TD, 'mouseenter', (function() { + return hot.deselectCell(); + })); + } else { + this.eventManager.addEventListener(TD, '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 = arrayReduce(data, (function(accumulator, value) { + return accumulator + (value.name === SEPARATOR ? 1 : 26); + }), 0); + 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.options.standalone && this.hotMenu && !isChildOf(event.target, this.hotMenu.rootElement)) { + this.close(true); + } else if ((this.isAllSubMenusClosed() || this.isSubMenu()) && (!isChildOf(event.target, '.htMenu') && isChildOf(event.target, document))) { + this.close(true); + } + } +}, {}); +mixin(Menu, localHooks); +; + +//# +},{"cursor":68,"eventManager":41,"helpers/array":42,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/function":48,"helpers/object":51,"helpers/unicode":54,"mixins/localHooks":55,"predefinedItems":71,"utils":72}],71:[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(','); + var onlyOneColumn = this.countCols() == 1; + return selected[1] < 0 || this.countCols() >= this.getSettings().maxCols || (!onlyOneColumn && 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(','); + var onlyOneColumn = this.countCols() == 1; + return selected[1] < 0 || this.countCols() >= this.getSettings().maxCols || (!onlyOneColumn && 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":50,"helpers/object":51,"utils":72}],72:[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 '' + String.fromCharCode(10003) + '' + label; +} + +//# +},{"helpers/dom/element":45}],73:[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":59,"eventManager":41,"helpers/array":42,"helpers/dom/element":45,"plugins":58,"zeroclipboard":"zeroclipboard"}],74:[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":48,"helpers/number":50,"helpers/unicode":54,"plugins":58}],75:[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 '' + String.fromCharCode(10003) + '' + 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":58}],76:[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":58}],77:[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); + this.manualColumnMovePlugin = null; + this.frozenColumnsBasePositions = []; +}; +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); + }, + init: function() { + $traceurRuntime.superGet(this, $ManualColumnFreeze.prototype, "init").call(this); + this.fixedColumnsCount = this.hot.getSettings().fixedColumnsLeft; + }, + getManualColumnMovePlugin: function() { + if (!this.manualColumnMovePlugin) { + this.manualColumnMovePlugin = this.hot.getPlugin('manualColumnMove'); + } + return this.manualColumnMovePlugin; + }, + onModifyCol: function(column) { + if (this.getManualColumnMovePlugin().isEnabled()) { + return column; + } + return this.getLogicalColumnIndex(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; + } + if (column !== this.getLogicalColumnIndex(column)) { + this.frozenColumnsBasePositions[this.fixedColumnsCount] = column; + } + this.changeColumnPositions(column, this.fixedColumnsCount); + 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); + this.changeColumnPositions(column, returnCol); + 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--; + }, + getBestColumnReturnPosition: function(column) { + var i = this.fixedColumnsCount; + var j = this.getLogicalColumnIndex(i); + var initialCol; + if (this.frozenColumnsBasePositions[column] == null) { + initialCol = this.getLogicalColumnIndex(column); + while (j < initialCol) { + i++; + j = this.getLogicalColumnIndex(i); + } + } else { + initialCol = this.frozenColumnsBasePositions[column]; + this.frozenColumnsBasePositions[column] = void 0; + while (j <= initialCol) { + i++; + j = this.getLogicalColumnIndex(i); + } + i = j; + } + return i - 1; + }, + getVisibleColumnIndex: function(column) { + return this.getManualColumnMovePlugin().getVisibleColumnIndex(column); + }, + getLogicalColumnIndex: function(column) { + return this.getManualColumnMovePlugin().getLogicalColumnIndex(column); + }, + changeColumnPositions: function(sourceColumn, destinationColumn) { + this.getManualColumnMovePlugin().changeColumnPositions(sourceColumn, destinationColumn); + } +}, {}, BasePlugin); +; +registerPlugin('manualColumnFreeze', ManualColumnFreeze); + +//# +},{"_base":59,"plugins":58}],78:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + ManualColumnMove: {get: function() { + return ManualColumnMove; + }}, + __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_helpers_47_array__, + $___46__46__47__46__46__47_helpers_47_number__, + $___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 $__2 = ($___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 = $__2.arrayEach, + arrayMap = $__2.arrayMap; +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 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 $__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__}), + pageX = $__5.pageX, + pageY = $__5.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 privatePool = new WeakMap(); +var ManualColumnMove = function ManualColumnMove(hotInstance) { + var $__7 = this; + $traceurRuntime.superConstructor($ManualColumnMove).call(this, hotInstance); + privatePool.set(this, { + guideClassName: 'manualColumnMoverGuide', + handleClassName: 'manualColumnMover', + startOffset: null, + pressed: null, + startCol: null, + endCol: null, + currentCol: null, + startX: null, + startY: null + }); + this.guideElement = null; + this.handleElement = null; + this.currentTH = null; + this.columnPositions = []; + this.eventManager = eventManagerObject(this); + this.addHook('init', (function() { + return $__7.onInit(); + })); +}; +var $ManualColumnMove = ManualColumnMove; +($traceurRuntime.createClass)(ManualColumnMove, { + isEnabled: function() { + return !!this.hot.getSettings().manualColumnMove; + }, + enablePlugin: function() { + var $__7 = this; + var priv = privatePool.get(this); + var initialSettings = this.hot.getSettings().manualColumnMove; + var loadedManualColumnPositions = this.loadManualColumnPositions(); + this.handleElement = document.createElement('DIV'); + this.handleElement.className = priv.handleClassName; + this.guideElement = document.createElement('DIV'); + this.guideElement.className = priv.guideClassName; + this.addHook('modifyCol', (function(col) { + return $__7.onModifyCol(col); + })); + this.addHook('unmodifyCol', (function(col) { + return $__7.onUnmodifyCol(col); + })); + this.addHook('afterRemoveCol', (function(index, amount) { + return $__7.onAfterRemoveCol(index, amount); + })); + this.addHook('afterCreateCol', (function(index, amount) { + return $__7.onAfterCreateCol(index, amount); + })); + this.registerEvents(); + if (typeof loadedManualColumnPositions != 'undefined') { + this.columnPositions = loadedManualColumnPositions; + } else if (Array.isArray(initialSettings)) { + this.columnPositions = initialSettings; + } else if (!initialSettings || this.columnPositions === void 0) { + this.columnPositions = []; + } + $traceurRuntime.superGet(this, $ManualColumnMove.prototype, "enablePlugin").call(this); + }, + updatePlugin: function() { + this.disablePlugin(); + this.enablePlugin(); + $traceurRuntime.superGet(this, $ManualColumnMove.prototype, "updatePlugin").call(this); + }, + disablePlugin: function() { + var pluginSetting = this.hot.getSettings().manualColumnMove; + if (Array.isArray(pluginSetting)) { + this.unregisterEvents(); + this.columnPositions = []; + } + $traceurRuntime.superGet(this, $ManualColumnMove.prototype, "disablePlugin").call(this); + }, + registerEvents: function() { + var $__7 = this; + this.eventManager.addEventListener(this.hot.rootElement, 'mouseover', (function(event) { + return $__7.onMouseOver(event); + })); + this.eventManager.addEventListener(this.hot.rootElement, 'mousedown', (function(event) { + return $__7.onMouseDown(event); + })); + this.eventManager.addEventListener(window, 'mousemove', (function(event) { + return $__7.onMouseMove(event); + })); + this.eventManager.addEventListener(window, 'mouseup', (function(event) { + return $__7.onMouseUp(event); + })); + }, + unregisterEvents: function() { + this.eventManager.clear(); + }, + saveManualColumnPositions: function() { + Handsontable.hooks.run(this.hot, 'persistentStateSave', 'manualColumnPositions', this.columnPositions); + }, + loadManualColumnPositions: function() { + var storedState = {}; + Handsontable.hooks.run(this.hot, 'persistentStateLoad', 'manualColumnPositions', storedState); + return storedState.value; + }, + completeSettingsArray: function() { + var $__7 = this; + var columnCount = this.hot.countCols(); + if (this.columnPositions.length === columnCount) { + return; + } + rangeEach(0, columnCount - 1, (function(i) { + if ($__7.columnPositions.indexOf(i) === -1) { + $__7.columnPositions.push(i); + } + })); + }, + setupHandlePosition: function(TH) { + var priv = privatePool.get(this); + var col = this.hot.view.wt.wtTable.getCoords(TH).col; + this.currentTH = TH; + if (col >= 0) { + var box = this.currentTH.getBoundingClientRect(); + priv.currentCol = col; + priv.startOffset = box.left; + this.handleElement.style.top = box.top + 'px'; + this.handleElement.style.left = priv.startOffset + 'px'; + this.hot.rootElement.appendChild(this.handleElement); + } + }, + refreshHandlePosition: function(TH, delta) { + var box = TH.getBoundingClientRect(); + var handleWidth = 6; + if (delta > 0) { + this.handleElement.style.left = (box.left + box.width - handleWidth) + 'px'; + } else { + this.handleElement.style.left = box.left + 'px'; + } + }, + setupGuidePosition: function() { + var box = this.currentTH.getBoundingClientRect(); + var priv = privatePool.get(this); + addClass(this.handleElement, 'active'); + addClass(this.guideElement, 'active'); + this.guideElement.style.width = box.width + 'px'; + this.guideElement.style.height = this.hot.view.maximumVisibleElementHeight(0) + 'px'; + this.guideElement.style.top = this.handleElement.style.top; + this.guideElement.style.left = priv.startOffset + 'px'; + this.hot.rootElement.appendChild(this.guideElement); + }, + refreshGuidePosition: function(diff) { + var priv = privatePool.get(this); + this.guideElement.style.left = priv.startOffset + diff + 'px'; + }, + hideHandleAndGuide: function() { + removeClass(this.handleElement, 'active'); + removeClass(this.guideElement, 'active'); + }, + checkColumnHeader: function(element) { + if (element != this.hot.rootElement) { + var parent = element.parentNode; + if (parent.tagName === 'THEAD') { + return true; + } + return this.checkColumnHeader(parent); + } + return false; + }, + createPositionData: function(len) { + var positionArr = this.columnPositions; + if (positionArr.length < len) { + rangeEach(positionArr.length, len - 1, (function(i) { + positionArr[i] = i; + })); + } + }, + getTHFromTargetElement: function(element) { + if (element.tagName != 'TABLE') { + if (element.tagName == 'TH') { + return element; + } else { + return this.getTHFromTargetElement(element.parentNode); + } + } + return null; + }, + changeColumnPositions: function(columnIndex, destinationIndex) { + var maxLength = Math.max(columnIndex, destinationIndex); + if (maxLength > this.columnPositions.length - 1) { + this.createPositionData(maxLength + 1); + } + this.columnPositions.splice(destinationIndex, 0, this.columnPositions.splice(columnIndex, 1)[0]); + }, + getVisibleColumnIndex: function(column) { + if (column > this.columnPositions.length - 1) { + this.createPositionData(column); + } + return this.columnPositions.indexOf(column); + }, + getLogicalColumnIndex: function(column) { + return this.columnPositions[column]; + }, + onMouseOver: function(event) { + var priv = privatePool.get(this); + if (this.checkColumnHeader(event.target)) { + var th = this.getTHFromTargetElement(event.target); + if (th) { + if (priv.pressed) { + var col = this.hot.view.wt.wtTable.getCoords(th).col; + if (col >= 0) { + priv.endCol = col; + this.refreshHandlePosition(th, priv.endCol - priv.startCol); + } + } else { + this.setupHandlePosition(th); + } + } + } + }, + onMouseDown: function(event) { + var priv = privatePool.get(this); + if (hasClass(event.target, priv.handleClassName)) { + priv.startX = pageX(event); + this.setupGuidePosition(); + priv.pressed = this.hot; + priv.startCol = priv.currentCol; + priv.endCol = priv.currentCol; + } + }, + onMouseMove: function(event) { + var priv = privatePool.get(this); + if (priv.pressed) { + this.refreshGuidePosition(pageX(event) - priv.startX); + } + }, + onMouseUp: function(event) { + var priv = privatePool.get(this); + if (priv.pressed) { + this.hideHandleAndGuide(); + priv.pressed = false; + this.createPositionData(this.hot.countCols()); + this.changeColumnPositions(priv.startCol, priv.endCol); + Handsontable.hooks.run(this.hot, 'beforeColumnMove', priv.startCol, priv.endCol); + this.hot.forceFullRender = true; + this.hot.view.render(); + this.saveManualColumnPositions(); + Handsontable.hooks.run(this.hot, 'afterColumnMove', priv.startCol, priv.endCol); + this.setupHandlePosition(this.currentTH); + } + }, + onModifyCol: function(col) { + if (typeof this.getVisibleColumnIndex(col) == -1) { + this.createPositionData(col + 1); + } + return this.getLogicalColumnIndex(col); + }, + onUnmodifyCol: function(col) { + if (typeof this.getVisibleColumnIndex(col) == -1) { + this.createPositionData(col + 1); + } + return this.getVisibleColumnIndex(col); + }, + onAfterRemoveCol: function(index, amount) { + if (!this.isEnabled()) { + return; + } + var rmindx; + var colpos = this.columnPositions; + rmindx = colpos.splice(index, amount); + colpos = arrayMap(colpos, function(value, index) { + var i, + newpos = value; + arrayEach(rmindx, (function(elem, index) { + if (value > elem) { + newpos--; + } + })); + return newpos; + }); + this.columnPositions = colpos; + }, + onAfterCreateCol: function(index, amount) { + if (!this.isEnabled()) { + return; + } + var colpos = this.columnPositions; + if (!colpos.length) { + return; + } + var addindx = []; + rangeEach(0, amount - 1, (function(i) { + addindx.push(index + i); + })); + if (index >= colpos.length) { + colpos.concat(addindx); + } else { + colpos = arrayMap(colpos, function(value, ind) { + return (value >= index) ? (value + amount) : value; + }); + colpos.splice.apply(colpos, [index, 0].concat(addindx)); + } + this.columnPositions = colpos; + }, + onInit: function() { + this.completeSettingsArray(); + } +}, {}, BasePlugin); +; +registerPlugin('manualColumnMove', ManualColumnMove); +Handsontable.hooks.register('beforeColumnMove'); +Handsontable.hooks.register('afterColumnMove'); +Handsontable.hooks.register('unmodifyCol'); + +//# +},{"_base.js":59,"eventManager":41,"helpers/array":42,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/number":50,"plugins":58}],79:[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":59,"eventManager":41,"helpers/dom/element":45,"helpers/dom/event":46,"plugins":58}],80:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + ManualRowMove: {get: function() { + return ManualRowMove; + }}, + __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_helpers_47_array__, + $___46__46__47__46__46__47_helpers_47_number__, + $___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 $__2 = ($___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 = $__2.arrayEach, + arrayMap = $__2.arrayMap; +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 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 $__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__}), + pageX = $__5.pageX, + pageY = $__5.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 privatePool = new WeakMap(); +var ManualRowMove = function ManualRowMove(hotInstance) { + $traceurRuntime.superConstructor($ManualRowMove).call(this, hotInstance); + privatePool.set(this, { + guideClassName: 'manualRowMoverGuide', + handleClassName: 'manualRowMover', + startOffset: null, + pressed: null, + startRow: null, + endRow: null, + currentRow: null, + startX: null, + startY: null + }); + this.guideElement = null; + this.handleElement = null; + this.currentTH = null; + this.rowPositions = []; + this.eventManager = eventManagerObject(this); +}; +var $ManualRowMove = ManualRowMove; +($traceurRuntime.createClass)(ManualRowMove, { + isEnabled: function() { + return !!this.hot.getSettings().manualRowMove; + }, + enablePlugin: function() { + var $__7 = this; + var priv = privatePool.get(this); + var initialSettings = this.hot.getSettings().manualRowMove; + var loadedManualRowPositions = this.loadManualRowPositions(); + this.handleElement = document.createElement('DIV'); + this.handleElement.className = priv.handleClassName; + this.guideElement = document.createElement('DIV'); + this.guideElement.className = priv.guideClassName; + this.addHook('modifyRow', (function(row) { + return $__7.onModifyRow(row); + })); + this.addHook('afterRemoveRow', (function(index, amount) { + return $__7.onAfterRemoveRow(index, amount); + })); + this.addHook('afterCreateRow', (function(index, amount) { + return $__7.onAfterCreateRow(index, amount); + })); + this.addHook('init', (function() { + return $__7.onInit(); + })); + this.registerEvents(); + if (typeof loadedManualRowPositions != 'undefined') { + this.rowPositions = loadedManualRowPositions; + } else if (Array.isArray(initialSettings)) { + this.rowPositions = initialSettings; + } else if (!initialSettings || this.rowPositions === void 0) { + this.rowPositions = []; + } + $traceurRuntime.superGet(this, $ManualRowMove.prototype, "enablePlugin").call(this); + }, + updatePlugin: function() { + this.disablePlugin(); + this.enablePlugin(); + $traceurRuntime.superGet(this, $ManualRowMove.prototype, "updatePlugin").call(this); + }, + disablePlugin: function() { + var pluginSetting = this.hot.getSettings().manualRowMove; + if (Array.isArray(pluginSetting)) { + this.unregisterEvents(); + this.rowPositions = []; + } + $traceurRuntime.superGet(this, $ManualRowMove.prototype, "disablePlugin").call(this); + }, + registerEvents: function() { + var $__7 = this; + this.eventManager.addEventListener(this.hot.rootElement, 'mouseover', (function(event) { + return $__7.onMouseOver(event); + })); + this.eventManager.addEventListener(this.hot.rootElement, 'mousedown', (function(event) { + return $__7.onMouseDown(event); + })); + this.eventManager.addEventListener(window, 'mousemove', (function(event) { + return $__7.onMouseMove(event); + })); + this.eventManager.addEventListener(window, 'mouseup', (function(event) { + return $__7.onMouseUp(event); + })); + }, + unregisterEvents: function() { + this.eventManager.clear(); + }, + saveManualRowPositions: function() { + Handsontable.hooks.run(this.hot, 'persistentStateSave', 'manualRowPositions', this.rowPositions); + }, + loadManualRowPositions: function() { + var storedState = {}; + Handsontable.hooks.run(this.hot, 'persistentStateLoad', 'manualRowPositions', storedState); + return storedState.value; + }, + completeSettingsArray: function() { + var $__7 = this; + var rowCount = this.hot.countRows(); + if (this.rowPositions.length === rowCount) { + return; + } + rangeEach(0, rowCount - 1, (function(i) { + if ($__7.rowPositions.indexOf(i) === -1) { + $__7.rowPositions.push(i); + } + })); + }, + setupHandlePosition: function(TH) { + var priv = privatePool.get(this); + var row = this.hot.view.wt.wtTable.getCoords(TH).row; + this.currentTH = TH; + if (row >= 0) { + var box = this.currentTH.getBoundingClientRect(); + priv.currentRow = row; + priv.startOffset = box.top; + this.handleElement.style.top = priv.startOffset + 'px'; + this.handleElement.style.left = box.left + 'px'; + this.hot.rootElement.appendChild(this.handleElement); + } + }, + refreshHandlePosition: function(TH, delta) { + var box = TH.getBoundingClientRect(); + var handleHeight = 6; + if (delta > 0) { + this.handleElement.style.top = (box.top + box.height - handleHeight) + 'px'; + } else { + this.handleElement.style.top = box.top + 'px'; + } + }, + setupGuidePosition: function() { + var box = this.currentTH.getBoundingClientRect(); + var priv = privatePool.get(this); + addClass(this.handleElement, 'active'); + addClass(this.guideElement, 'active'); + this.guideElement.style.height = box.height + 'px'; + this.guideElement.style.width = this.hot.view.maximumVisibleElementWidth(0) + 'px'; + this.guideElement.style.top = priv.startOffset + 'px'; + this.guideElement.style.left = this.handleElement.style.left; + this.hot.rootElement.appendChild(this.guideElement); + }, + refreshGuidePosition: function(diff) { + var priv = privatePool.get(this); + this.guideElement.style.top = priv.startOffset + diff + 'px'; + }, + hideHandleAndGuide: function() { + removeClass(this.handleElement, 'active'); + removeClass(this.guideElement, 'active'); + }, + checkRowHeader: function(element) { + if (element != this.hot.rootElement) { + var parent = element.parentNode; + if (parent.tagName === 'TBODY') { + return true; + } + return this.checkRowHeader(parent); + } + return false; + }, + createPositionData: function(len) { + var positionArr = this.rowPositions; + if (positionArr.length < len) { + rangeEach(positionArr.length, len - 1, (function(i) { + positionArr[i] = i; + })); + } + }, + getTHFromTargetElement: function(element) { + if (element.tagName != 'TABLE') { + if (element.tagName == 'TH') { + return element; + } else { + return this.getTHFromTargetElement(element.parentNode); + } + } + return null; + }, + changeRowPositions: function(rowIndex, destinationIndex) { + var maxLength = Math.max(rowIndex, destinationIndex); + if (maxLength > this.rowPositions.length - 1) { + this.createPositionData(maxLength + 1); + } + this.rowPositions.splice(destinationIndex, 0, this.rowPositions.splice(rowIndex, 1)[0]); + }, + getVisibleRowIndex: function(row) { + if (row > this.rowPositions.length - 1) { + this.createPositionData(row); + } + return this.rowPositions.indexOf(row); + }, + getLogicalRowIndex: function(row) { + return this.rowPositions[row]; + }, + onMouseOver: function(event) { + var priv = privatePool.get(this); + if (this.checkRowHeader(event.target)) { + var th = this.getTHFromTargetElement(event.target); + if (th) { + if (priv.pressed) { + priv.endRow = this.hot.view.wt.wtTable.getCoords(th).row; + this.refreshHandlePosition(th, priv.endRow - priv.startRow); + } else { + this.setupHandlePosition(th); + } + } + } + }, + onMouseDown: function(event) { + var priv = privatePool.get(this); + if (hasClass(event.target, priv.handleClassName)) { + priv.startY = pageY(event); + this.setupGuidePosition(); + priv.pressed = this.hot; + priv.startRow = priv.currentRow; + priv.endRow = priv.currentRow; + } + }, + onMouseMove: function(event) { + var priv = privatePool.get(this); + if (priv.pressed) { + this.refreshGuidePosition(pageY(event) - priv.startY); + } + }, + onMouseUp: function(event) { + var priv = privatePool.get(this); + if (priv.pressed) { + this.hideHandleAndGuide(); + priv.pressed = false; + this.createPositionData(this.hot.countRows()); + this.changeRowPositions(priv.startRow, priv.endRow); + Handsontable.hooks.run(this.hot, 'beforeRowMove', priv.startRow, priv.endRow); + this.hot.forceFullRender = true; + this.hot.view.render(); + this.saveManualRowPositions(); + Handsontable.hooks.run(this.hot, 'afterRowMove', priv.startRow, priv.endRow); + this.setupHandlePosition(this.currentTH); + } + }, + onModifyRow: function(row) { + if (typeof this.getVisibleRowIndex(row) === 'undefined') { + this.createPositionData(row + 1); + } + return this.getLogicalRowIndex(row); + }, + onAfterRemoveRow: function(index, amount) { + if (!this.isEnabled()) { + return; + } + var rmindx; + var rowpos = this.rowPositions; + rmindx = rowpos.splice(index, amount); + rowpos = arrayMap(rowpos, function(value, index) { + var newpos = value; + arrayEach(rmindx, (function(elem, index) { + if (value > elem) { + newpos--; + } + })); + return newpos; + }); + this.rowPositions = rowpos; + }, + onAfterCreateRow: function(index, amount) { + if (!this.isEnabled()) { + return; + } + var rowpos = this.rowPositions; + if (!rowpos.length) { + return; + } + var addindx = []; + for (var i = 0; i < amount; i++) { + addindx.push(index + i); + } + if (index >= rowpos.length) { + rowpos.concat(addindx); + } else { + rowpos = arrayMap(rowpos, function(value, ind) { + return (value >= index) ? (value + amount) : value; + }); + rowpos.splice.apply(rowpos, [index, 0].concat(addindx)); + } + this.rowPositions = rowpos; + }, + onInit: function() { + this.completeSettingsArray(); + } +}, {}, BasePlugin); +; +registerPlugin('ManualRowMove', ManualRowMove); +Handsontable.hooks.register('beforeRowMove'); +Handsontable.hooks.register('afterRowMove'); + +//# +},{"_base.js":59,"eventManager":41,"helpers/array":42,"helpers/dom/element":45,"helpers/dom/event":46,"helpers/number":50,"plugins":58}],81:[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":59,"eventManager":41,"helpers/dom/element":45,"helpers/dom/event":46,"plugins":58}],82:[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":58}],83:[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":59,"eventManager":41,"helpers/dom/element":45,"plugins":58}],84:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + DataObserver: {get: function() { + return DataObserver; + }}, + __esModule: {value: true} +}); +var $__jsonpatch__, + $___46__46__47__46__46__47_mixins_47_localHooks__, + $___46__46__47__46__46__47_helpers_47_object__, + $__utils__; +var jsonpatch = ($__jsonpatch__ = require("jsonpatch"), $__jsonpatch__ && $__jsonpatch__.__esModule && $__jsonpatch__ || {default: $__jsonpatch__}).default; +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 mixin = ($___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__}).mixin; +var cleanPatches = ($__utils__ = require("utils"), $__utils__ && $__utils__.__esModule && $__utils__ || {default: $__utils__}).cleanPatches; +var DataObserver = function DataObserver(observedData) { + this.observedData = null; + this.observer = null; + this.paused = false; + this.setObservedData(observedData); +}; +($traceurRuntime.createClass)(DataObserver, { + setObservedData: function(observedData) { + var $__4 = this; + if (this.observer) { + jsonpatch.unobserve(this.observedData, this.observer); + } + this.observedData = observedData; + this.observer = jsonpatch.observe(this.observedData, (function(patches) { + return $__4.onChange(patches); + })); + }, + isPaused: function() { + return this.paused; + }, + pause: function() { + this.paused = true; + }, + resume: function() { + this.paused = false; + }, + onChange: function(patches) { + this.runLocalHooks('change', cleanPatches(patches)); + }, + destroy: function() { + jsonpatch.unobserve(this.observedData, this.observer); + this.observedData = null; + this.observer = null; + } +}, {}); +mixin(DataObserver, localHooks); +; + +//# +},{"../../helpers/object":51,"../../mixins/localHooks":55,"jsonpatch":"jsonpatch","utils":86}],85:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + ObserveChanges: {get: function() { + return ObserveChanges; + }}, + __esModule: {value: true} +}); +var $___46__46__47__95_base__, + $__jsonpatch__, + $__dataObserver__, + $___46__46__47__46__46__47_helpers_47_array__, + $___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 jsonpatch = ($__jsonpatch__ = require("jsonpatch"), $__jsonpatch__ && $__jsonpatch__.__esModule && $__jsonpatch__ || {default: $__jsonpatch__}).default; +var DataObserver = ($__dataObserver__ = require("dataObserver"), $__dataObserver__ && $__dataObserver__.__esModule && $__dataObserver__ || {default: $__dataObserver__}).DataObserver; +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 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('afterChangesObserved'); +var ObserveChanges = function ObserveChanges(hotInstance) { + $traceurRuntime.superConstructor($ObserveChanges).call(this, hotInstance); + this.observer = null; +}; +var $ObserveChanges = ObserveChanges; +($traceurRuntime.createClass)(ObserveChanges, { + isEnabled: function() { + return this.hot.getSettings().observeChanges; + }, + enablePlugin: function() { + var $__5 = this; + if (this.enabled) { + return; + } + if (!this.observer) { + this.observer = new DataObserver(this.hot.getSourceData()); + this._exposePublicApi(); + } + this.observer.addLocalHook('change', (function(patches) { + return $__5.onDataChange(patches); + })); + this.addHook('afterCreateRow', (function() { + return $__5.onAfterTableAlter(); + })); + this.addHook('afterRemoveRow', (function() { + return $__5.onAfterTableAlter(); + })); + this.addHook('afterCreateCol', (function() { + return $__5.onAfterTableAlter(); + })); + this.addHook('afterRemoveCol', (function() { + return $__5.onAfterTableAlter(); + })); + this.addHook('afterChange', (function(changes, source) { + return $__5.onAfterTableAlter(source); + })); + this.addHook('afterLoadData', (function(firstRun) { + return $__5.onAfterLoadData(firstRun); + })); + $traceurRuntime.superGet(this, $ObserveChanges.prototype, "enablePlugin").call(this); + }, + disablePlugin: function() { + if (this.observer) { + this.observer.destroy(); + this.observer = null; + this._deletePublicApi(); + } + $traceurRuntime.superGet(this, $ObserveChanges.prototype, "disablePlugin").call(this); + }, + onDataChange: function(patches) { + var $__5 = this; + if (!this.observer.isPaused()) { + var actions = { + add: (function(patch) { + if (isNaN(patch.col)) { + $__5.hot.runHooks('afterCreateRow', patch.row); + } else { + $__5.hot.runHooks('afterCreateCol', patch.col); + } + }), + remove: (function(patch) { + if (isNaN(patch.col)) { + $__5.hot.runHooks('afterRemoveRow', patch.row, 1); + } else { + $__5.hot.runHooks('afterRemoveCol', patch.col, 1); + } + }), + replace: (function(patch) { + $__5.hot.runHooks('afterChange', [patch.row, patch.col, null, patch.value], 'external'); + }) + }; + arrayEach(patches, (function(patch) { + if (actions[patch.op]) { + actions[patch.op](patch); + } + })); + this.hot.render(); + } + this.hot.runHooks('afterChangesObserved'); + }, + onAfterTableAlter: function(source) { + var $__5 = this; + if (source !== 'loadData') { + this.observer.pause(); + this.hot.addHookOnce('afterChangesObserved', (function() { + return $__5.observer.resume(); + })); + } + }, + onAfterLoadData: function(firstRun) { + if (!firstRun) { + this.observer.setObservedData(this.hot.getSourceData()); + } + }, + destroy: function() { + if (this.observer) { + this.observer.destroy(); + this._deletePublicApi(); + } + $traceurRuntime.superGet(this, $ObserveChanges.prototype, "destroy").call(this); + }, + _exposePublicApi: function() { + var $__5 = this; + var hot = this.hot; + hot.pauseObservingChanges = (function() { + return $__5.observer.pause(); + }); + hot.resumeObservingChanges = (function() { + return $__5.observer.resume(); + }); + hot.isPausedObservingChanges = (function() { + return $__5.observer.isPaused(); + }); + }, + _deletePublicApi: function() { + var hot = this.hot; + delete hot.pauseObservingChanges; + delete hot.resumeObservingChanges; + delete hot.isPausedObservingChanges; + } +}, {}, BasePlugin); +; +registerPlugin('observeChanges', ObserveChanges); + +//# +},{"_base":59,"dataObserver":84,"helpers/array":42,"jsonpatch":"jsonpatch","plugins":58}],86:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + cleanPatches: {get: function() { + return cleanPatches; + }}, + parsePath: {get: function() { + return parsePath; + }}, + __esModule: {value: true} +}); +var $___46__46__47__46__46__47_helpers_47_array__; +var $__0 = ($___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__}), + arrayFilter = $__0.arrayFilter, + arrayMap = $__0.arrayMap; +function cleanPatches(patches) { + var newOrRemovedColumns = []; + patches = arrayFilter(patches, (function(patch) { + if (/[/]length/ig.test(patch.path)) { + return false; + } + if (!parsePath(patch.path)) { + return false; + } + return true; + })); + patches = arrayMap(patches, (function(patch) { + var coords = parsePath(patch.path); + patch.row = coords.row; + patch.col = coords.col; + return patch; + })); + patches = arrayFilter(patches, function(patch) { + if (['add', 'remove'].indexOf(patch.op) !== -1 && !isNaN(patch.col)) { + if (newOrRemovedColumns.indexOf(patch.col) !== -1) { + return false; + } + newOrRemovedColumns.push(patch.col); + } + return true; + }); + newOrRemovedColumns.length = 0; + return patches; +} +function parsePath(path) { + var match = path.match(/^\/(\d+)\/?(.*)?$/); + if (!match) { + return null; + } + var $__1 = match, + row = $__1[1], + column = $__1[2]; + return { + row: parseInt(row, 10), + col: /^\d*$/.test(column) ? parseInt(column, 10) : column + }; +} + +//# +},{"../../helpers/array":42}],87:[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":58}],88:[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":91}],89:[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":59,"helpers/dom/element":45,"plugins":58}],90:[function(require,module,exports){ +"use strict"; +var $___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_object__, + $___46__46__47__46__46__47_helpers_47_dom_47_event__; +var arrayMap = ($___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__}).arrayMap; +var $__1 = ($___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 = $__1.rangeEach, + rangeEachReverse = $__1.rangeEachReverse; +var $__2 = ($___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 = $__2.inherit, + deepClone = $__2.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.getData(); + index = (plugin.instance.countCols() + index) % plugin.instance.countCols(); + var removedData = []; + var headers = []; + var indexes = []; + rangeEach(0, originalData.length - 1, (function(i) { + removedData[i] = originalData[i].slice(index, index + amount); + })); + rangeEach(0, amount - 1, (function(i) { + indexes.push(instance.runHooks('modifyCol', index + i)); + })); + if (Array.isArray(instance.getSettings().colHeaders)) { + rangeEach(0, amount - 1, (function(i) { + headers.push(instance.getSettings().colHeaders[instance.runHooks('modifyCol', index + i)] || null); + })); + } + var manualColumnMovePlugin = plugin.instance.getPlugin('manualColumnMove'); + var action = new Handsontable.UndoRedo.RemoveColumnAction(indexes, removedData, headers, manualColumnMovePlugin ? manualColumnMovePlugin.columnPositions : []); + plugin.done(action); + }); + instance.addHook('beforeCellAlignment', function(stateBefore, range, type, alignment) { + var action = new Handsontable.UndoRedo.CellAlignmentAction(stateBefore, range, type, alignment); + plugin.done(action); + }); + instance.addHook('beforeFilter', function(formulaStacks) { + plugin.done(new Handsontable.UndoRedo.FiltersAction(formulaStacks)); + }); +}; +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(indexes, data, headers, columnPositions) { + this.indexes = indexes; + this.data = data; + this.amount = this.data[0].length; + this.headers = headers; + this.columnPositions = columnPositions.slice(0); +}; +inherit(Handsontable.UndoRedo.RemoveColumnAction, Handsontable.UndoRedo.Action); +Handsontable.UndoRedo.RemoveColumnAction.prototype.undo = function(instance, undoneCallback) { + var $__4 = this; + var row; + var ascendingIndexes = this.indexes.slice(0).sort(); + var sortByIndexes = (function(elem, j, arr) { + return arr[$__4.indexes.indexOf(ascendingIndexes[j])]; + }); + var sortedData = []; + rangeEach(0, this.data.length - 1, (function(i) { + sortedData[i] = arrayMap($__4.data[i], sortByIndexes); + })); + var sortedHeaders = []; + sortedHeaders = arrayMap(this.headers, sortByIndexes); + rangeEach(0, this.data.length - 1, (function(i) { + row = instance.getSourceDataAtRow(i); + rangeEach(0, ascendingIndexes.length - 1, (function(j) { + row.splice(ascendingIndexes[j], 0, sortedData[i][j]); + })); + })); + if (typeof this.headers != 'undefined') { + rangeEach(0, sortedHeaders.length - 1, (function(j) { + instance.getSettings().colHeaders.splice(ascendingIndexes[j], 0, sortedHeaders[j]); + })); + } + if (instance.getPlugin('manualColumnMove')) { + instance.getPlugin('manualColumnMove').columnPositions = this.columnPositions; + } + instance.addHookOnce('afterRender', undoneCallback); + instance.render(); +}; +Handsontable.UndoRedo.RemoveColumnAction.prototype.redo = function(instance, redoneCallback) { + instance.addHookOnce('afterRemoveCol', redoneCallback); + instance.alter('remove_col', instance.runHooks('unmodifyCol', this.indexes[0]), this.amount); +}; +Handsontable.UndoRedo.FiltersAction = function(formulaStacks) { + this.formulaStacks = formulaStacks; +}; +inherit(Handsontable.UndoRedo.FiltersAction, Handsontable.UndoRedo.Action); +Handsontable.UndoRedo.FiltersAction.prototype.undo = function(instance, undoneCallback) { + var filters = instance.getPlugin('filters'); + instance.addHookOnce('afterRender', undoneCallback); + filters.formulaCollection.importAllFormulas(this.formulaStacks.slice(0, this.formulaStacks.length - 1)); + filters.filter(); +}; +Handsontable.UndoRedo.FiltersAction.prototype.redo = function(instance, redoneCallback) { + var filters = instance.getPlugin('filters'); + instance.addHookOnce('afterRender', redoneCallback); + filters.formulaCollection.importAllFormulas(this.formulaStacks); + filters.filter(); +}; +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/array":42,"helpers/dom/event":46,"helpers/number":50,"helpers/object":51}],91:[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":53}],92:[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":91}],93:[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":91}],94:[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, 'mouseup', (function() { + return setTimeout(instance.listen, 10); + })); + 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'); + input.setAttribute('tabindex', '-1'); + 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":53,"helpers/unicode":54,"renderers":91}],95:[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":91}],96:[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":50,"numeral":"numeral","renderers":91}],97:[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":91}],98:[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":49,"renderers":91}],99:[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') { + valueToSpread[$toProperty(Symbol.iterator)] = function() { + var value = this; + var length = value.length; + var index = 0; + return {next: function() { + var result = {done: true}; + if (index < length) { + result.done = false; + result.value = value[index]; + ++index; + } + return result; + }}; + }; + } + 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; +})(); + +//# +},{}],100:[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: function() { + return that.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}],101:[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":49,"helpers/number":50,"helpers/object":51}],102:[function(require,module,exports){ +"use strict"; +Object.defineProperties(exports, { + Interval: {get: function() { + return Interval; + }}, + __esModule: {value: true} +}); +var $___46__46__47_helpers_47_feature__, + $___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_feature__ = require("helpers/feature"), $___46__46__47_helpers_47_feature__ && $___46__46__47_helpers_47_feature__.__esModule && $___46__46__47_helpers_47_feature__ || {default: $___46__46__47_helpers_47_feature__}), + requestAnimationFrame = $__0.requestAnimationFrame, + cancelAnimationFrame = $__0.cancelAnimationFrame; +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 Interval = function Interval(func, delay) { + var $__5 = this; + this.timer = null; + this.func = func; + this.delay = parseDelay(delay); + this.stopped = true; + this._then = null; + this._callback = (function() { + return $__5.__callback(); + }); +}; +var $Interval = Interval; +($traceurRuntime.createClass)(Interval, { + start: function() { + if (this.stopped) { + this._then = Date.now(); + this.stopped = false; + this.timer = requestAnimationFrame(this._callback); + } + return this; + }, + stop: function() { + if (!this.stopped) { + this.stopped = true; + cancelAnimationFrame(this.timer); + this.timer = null; + } + return this; + }, + __callback: function() { + this.timer = requestAnimationFrame(this._callback); + if (this.delay) { + var now = Date.now(); + var elapsed = now - this._then; + if (elapsed > this.delay) { + this._then = now - (elapsed % this.delay); + this.func(); + } + } else { + this.func(); + } + } +}, {create: function(func, delay) { + return new $Interval(func, delay); + }}); +; +function parseDelay(delay) { + if (typeof delay === 'string' && /fps$/.test(delay)) { + delay = 1000 / parseInt(delay.replace('fps', '') || 0, 10); + } + return delay; +} +Handsontable.utils = Handsontable.utils || {}; +Handsontable.utils.Interval = Interval; + +//# +},{"helpers/array":42,"helpers/feature":47,"helpers/mixed":49,"helpers/number":50,"helpers/object":51}],103:[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 $__2 = ($___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 = $__2.objectEach, + isObject = $__2.isObject; +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 = []; + var length; + 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 (isObject(value)) { + length = Object.keys(value).length; + } else if (Array.isArray(value)) { + length = value.length; + } else { + length = stringify(value).length; + } + if (!samples.has(length)) { + samples.set(length, { + needed: $__5.getSampleCount(), + strings: [] + }); + } + var sample = samples.get(length); + 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":49,"helpers/number":50,"helpers/object":51}],104:[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":49}],105:[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 (this.allowEmpty && value === '') { + isValidDate = true; + isValidFormat = true; + } + 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"}],106:[function(require,module,exports){ +"use strict"; +Handsontable.NumericValidator = function(value, callback) { + if (value == null) { + value = ''; + } + if (this.allowEmpty && value === '') { + callback(true); + } else if (value === '') { + callback(false); + } else { + callback(/^-?\d*(\.|\,)?\d*$/.test(value)); + } +}; + +//# +},{}],107:[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; +var STRICT_FORMATS = ['YYYY-MM-DDTHH:mm:ss.SSSZ']; +Handsontable.TimeValidator = function(value, callback) { + var valid = true; + var timeFormat = this.timeFormat || 'h:mm:ss a'; + if (value === null) { + value = ''; + } + if (typeof value === 'number') { + value = ("" + value); + } + if (/^\d{9,10}$/.test(value)) { + value = new Date(parseInt((value + "000"), 10)); + } else if (/^\d{13}$/.test(value)) { + value = new Date(parseInt(value, 10)); + } + var date = moment(value, STRICT_FORMATS, true).isValid() ? moment(new Date(value)) : moment(value, timeFormat); + var isValidTime = date.isValid(); + var isValidFormat = moment(value, timeFormat, true).isValid(); + if (this.allowEmpty && value === '') { + isValidTime = true; + isValidFormat = true; + } + if (!isValidTime) { + valid = false; + } + if (!isValidTime && isValidFormat) { + valid = true; + } + if (isValidTime && !isValidFormat) { + if (this.correctFormat === true) { + var correctedValue = date.format(timeFormat); + this.instance.setDataAtCell(this.row, this.col, correctedValue, 'timeValidator'); + valid = true; + } else { + valid = false; + } + } + callback(valid); +}; + +//# +},{"editors":29,"moment":"moment"}],"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; + event.preventDefault(); + } + }; + 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.11.2 +//! 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; + } + + function isUndefined(input) { + return input === void 0; + } + + // Plugins that add properties should also add the key here (null value), + // so we can properly clone ourselves. + var momentProperties = utils_hooks__hooks.momentProperties = []; + + function copyConfig(to, from) { + var i, prop, val; + + if (!isUndefined(from._isAMomentObject)) { + to._isAMomentObject = from._isAMomentObject; + } + if (!isUndefined(from._i)) { + to._i = from._i; + } + if (!isUndefined(from._f)) { + to._f = from._f; + } + if (!isUndefined(from._l)) { + to._l = from._l; + } + if (!isUndefined(from._strict)) { + to._strict = from._strict; + } + if (!isUndefined(from._tzm)) { + to._tzm = from._tzm; + } + if (!isUndefined(from._isUTC)) { + to._isUTC = from._isUTC; + } + if (!isUndefined(from._offset)) { + to._offset = from._offset; + } + if (!isUndefined(from._pf)) { + to._pf = getParsingFlags(from); + } + if (!isUndefined(from._locale)) { + to._locale = from._locale; + } + + if (momentProperties.length > 0) { + for (i in momentProperties) { + prop = momentProperties[i]; + val = from[prop]; + if (!isUndefined(val)) { + 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; + } + + // compare two arrays, return the number of differences + 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() { + } + + // internal storage for locale config files + 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 (isUndefined(values)) { + 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 isFunction(input) { + return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]'; + } + + 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.isValid() ? + mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]() : NaN; + } + + function get_set__set (mom, unit, value) { + if (mom.isValid()) { + 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 (isFunction(this[units])) { + 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 = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|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 match3to4 = /\d\d\d\d?/; // 999 - 9999 + var match5to6 = /\d\d\d\d\d\d?/; // 99999 - 999999 + 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 matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi; // +00 -00 +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. + // includes scottish gaelic two word and hyphenated months + 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 addRegexToken (token, regex, strictRegex) { + regexes[token] = isFunction(regex) ? regex : function (isStrict, localeData) { + 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 regexEscape(s.replace('\\', '').replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) { + return p1 || p2 || p3 || p4; + })); + } + + function regexEscape(s) { + return s.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; + var WEEK = 7; + var WEEKDAY = 8; + + 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', function (isStrict, locale) { + return locale.monthsShortRegex(isStrict); + }); + addRegexToken('MMMM', function (isStrict, locale) { + return locale.monthsRegex(isStrict); + }); + + 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 MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/; + var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'); + function localeMonths (m, format) { + return isArray(this._months) ? this._months[m.month()] : + this._months[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()]; + } + + var defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'); + function localeMonthsShort (m, format) { + return isArray(this._monthsShort) ? this._monthsShort[m.month()] : + this._monthsShort[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][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; + + if (!mom.isValid()) { + // No op + return mom; + } + + // 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()); + } + + var defaultMonthsShortRegex = matchWord; + function monthsShortRegex (isStrict) { + if (this._monthsParseExact) { + if (!hasOwnProp(this, '_monthsRegex')) { + computeMonthsParse.call(this); + } + if (isStrict) { + return this._monthsShortStrictRegex; + } else { + return this._monthsShortRegex; + } + } else { + return this._monthsShortStrictRegex && isStrict ? + this._monthsShortStrictRegex : this._monthsShortRegex; + } + } + + var defaultMonthsRegex = matchWord; + function monthsRegex (isStrict) { + if (this._monthsParseExact) { + if (!hasOwnProp(this, '_monthsRegex')) { + computeMonthsParse.call(this); + } + if (isStrict) { + return this._monthsStrictRegex; + } else { + return this._monthsRegex; + } + } else { + return this._monthsStrictRegex && isStrict ? + this._monthsStrictRegex : this._monthsRegex; + } + } + + function computeMonthsParse () { + function cmpLenRev(a, b) { + return b.length - a.length; + } + + var shortPieces = [], longPieces = [], mixedPieces = [], + i, mom; + for (i = 0; i < 12; i++) { + // make the regex if we don't have it already + mom = create_utc__createUTC([2000, i]); + shortPieces.push(this.monthsShort(mom, '')); + longPieces.push(this.months(mom, '')); + mixedPieces.push(this.months(mom, '')); + mixedPieces.push(this.monthsShort(mom, '')); + } + // Sorting makes sure if one month (or abbr) is a prefix of another it + // will match the longer piece. + shortPieces.sort(cmpLenRev); + longPieces.sort(cmpLenRev); + mixedPieces.sort(cmpLenRev); + for (i = 0; i < 12; i++) { + shortPieces[i] = regexEscape(shortPieces[i]); + longPieces[i] = regexEscape(longPieces[i]); + mixedPieces[i] = regexEscape(mixedPieces[i]); + } + + this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i'); + this._monthsShortRegex = this._monthsRegex; + this._monthsStrictRegex = new RegExp('^(' + longPieces.join('|') + ')$', 'i'); + this._monthsShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')$', 'i'); + } + + 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; + } + if (getParsingFlags(m)._overflowWeeks && overflow === -1) { + overflow = WEEK; + } + if (getParsingFlags(m)._overflowWeekday && overflow === -1) { + overflow = WEEKDAY; + } + + 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 + '\nArguments: ' + Array.prototype.slice.call(arguments).join(', ') + '\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; + + // iso 8601 regex + // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00) + var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/; + var basicIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/; + + var tzRegex = /Z|[+-]\d\d(?::?\d\d)?/; + + var isoDates = [ + ['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/], + ['YYYY-MM-DD', /\d{4}-\d\d-\d\d/], + ['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/], + ['GGGG-[W]WW', /\d{4}-W\d\d/, false], + ['YYYY-DDD', /\d{4}-\d{3}/], + ['YYYY-MM', /\d{4}-\d\d/, false], + ['YYYYYYMMDD', /[+-]\d{10}/], + ['YYYYMMDD', /\d{8}/], + // YYYYMM is NOT allowed by the standard + ['GGGG[W]WWE', /\d{4}W\d{3}/], + ['GGGG[W]WW', /\d{4}W\d{2}/, false], + ['YYYYDDD', /\d{7}/] + ]; + + // iso time formats and regexes + var isoTimes = [ + ['HH:mm:ss.SSSS', /\d\d:\d\d:\d\d\.\d+/], + ['HH:mm:ss,SSSS', /\d\d:\d\d:\d\d,\d+/], + ['HH:mm:ss', /\d\d:\d\d:\d\d/], + ['HH:mm', /\d\d:\d\d/], + ['HHmmss.SSSS', /\d\d\d\d\d\d\.\d+/], + ['HHmmss,SSSS', /\d\d\d\d\d\d,\d+/], + ['HHmmss', /\d\d\d\d\d\d/], + ['HHmm', /\d\d\d\d/], + ['HH', /\d\d/] + ]; + + var aspNetJsonRegex = /^\/?Date\((\-?\d+)/i; + + // date from iso format + function configFromISO(config) { + var i, l, + string = config._i, + match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string), + allowTime, dateFormat, timeFormat, tzFormat; + + if (match) { + getParsingFlags(config).iso = true; + + for (i = 0, l = isoDates.length; i < l; i++) { + if (isoDates[i][1].exec(match[1])) { + dateFormat = isoDates[i][0]; + allowTime = isoDates[i][2] !== false; + break; + } + } + if (dateFormat == null) { + config._isValid = false; + return; + } + if (match[3]) { + for (i = 0, l = isoTimes.length; i < l; i++) { + if (isoTimes[i][1].exec(match[3])) { + // match[2] should be 'T' or space + timeFormat = (match[2] || ' ') + isoTimes[i][0]; + break; + } + } + if (timeFormat == null) { + config._isValid = false; + return; + } + } + if (!allowTime && timeFormat != null) { + config._isValid = false; + return; + } + if (match[4]) { + if (tzRegex.exec(match[4])) { + tzFormat = 'Z'; + } else { + config._isValid = false; + return; + } + } + config._f = dateFormat + (timeFormat || '') + (tzFormat || ''); + 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 remaps years 0-99 to 1900-1999 + if (y < 100 && y >= 0 && isFinite(date.getFullYear())) { + date.setFullYear(y); + } + return date; + } + + function createUTCDate (y) { + var date = new Date(Date.UTC.apply(null, arguments)); + + //the Date.UTC function remaps years 0-99 to 1900-1999 + if (y < 100 && y >= 0 && isFinite(date.getUTCFullYear())) { + date.setUTCFullYear(y); + } + return date; + } + + // FORMATTING + + addFormatToken('Y', 0, 0, function () { + var y = this.year(); + return y <= 9999 ? '' + y : '+' + y; + }); + + 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); + }); + addParseToken('Y', function (input, array) { + array[YEAR] = parseInt(input, 10); + }); + + // 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()); + } + + // start-of-first-week - start-of-year + function firstWeekOffset(year, dow, doy) { + var // first-week day -- which january is always in the first week (4 for iso, 1 for other) + fwd = 7 + dow - doy, + // first-week day local weekday -- which local weekday is fwd + fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7; + + return -fwdlw + fwd - 1; + } + + //http://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday + function dayOfYearFromWeeks(year, week, weekday, dow, doy) { + var localWeekday = (7 + weekday - dow) % 7, + weekOffset = firstWeekOffset(year, dow, doy), + dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset, + resYear, resDayOfYear; + + if (dayOfYear <= 0) { + resYear = year - 1; + resDayOfYear = daysInYear(resYear) + dayOfYear; + } else if (dayOfYear > daysInYear(year)) { + resYear = year + 1; + resDayOfYear = dayOfYear - daysInYear(year); + } else { + resYear = year; + resDayOfYear = dayOfYear; + } + + return { + year: resYear, + dayOfYear: resDayOfYear + }; + } + + function weekOfYear(mom, dow, doy) { + var weekOffset = firstWeekOffset(mom.year(), dow, doy), + week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1, + resWeek, resYear; + + if (week < 1) { + resYear = mom.year() - 1; + resWeek = week + weeksInYear(resYear, dow, doy); + } else if (week > weeksInYear(mom.year(), dow, doy)) { + resWeek = week - weeksInYear(mom.year(), dow, doy); + resYear = mom.year() + 1; + } else { + resYear = mom.year(); + resWeek = week; + } + + return { + week: resWeek, + year: resYear + }; + } + + function weeksInYear(year, dow, doy) { + var weekOffset = firstWeekOffset(year, dow, doy), + weekOffsetNext = firstWeekOffset(year + 1, dow, doy); + return (daysInYear(year) - weekOffset + weekOffsetNext) / 7; + } + + // 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) { + // hooks is actually the exported moment object + var nowValue = new Date(utils_hooks__hooks.now()); + if (config._useUTC) { + return [nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate()]; + } + return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.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, weekdayOverflow; + + 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); + if (weekday < 1 || weekday > 7) { + weekdayOverflow = true; + } + } 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 < 0 || weekday > 6) { + weekdayOverflow = true; + } + } else if (w.e != null) { + // local weekday -- counting starts from begining of week + weekday = w.e + dow; + if (w.e < 0 || w.e > 6) { + weekdayOverflow = true; + } + } else { + // default to begining of week + weekday = dow; + } + } + if (week < 1 || week > weeksInYear(weekYear, dow, doy)) { + getParsingFlags(config)._overflowWeeks = true; + } else if (weekdayOverflow != null) { + getParsingFlags(config)._overflowWeekday = true; + } else { + temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy); + config._a[YEAR] = temp.year; + config._dayOfYear = temp.dayOfYear; + } + } + + // constant that refers to the ISO standard + 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]; + // console.log('token', token, 'parsedInput', parsedInput, + // 'regex', getParseRegexForToken(token, config)); + 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; + } + } + + // date from string and array of format strings + 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 = map([i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond], function (obj) { + return obj && parseInt(obj, 10); + }); + + 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); + } + + if (!valid__isValid(config)) { + config._d = null; + } + + return config; + } + + function configFromInput(config) { + var input = config._i; + if (input === undefined) { + config._d = new Date(utils_hooks__hooks.now()); + } 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); + if (this.isValid() && other.isValid()) { + return other < this ? this : other; + } else { + return valid__createInvalid(); + } + } + ); + + 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); + if (this.isValid() && other.isValid()) { + return other > this ? this : other; + } else { + return valid__createInvalid(); + } + } + ); + + // 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); + } + + var now = function () { + return Date.now ? Date.now() : +(new Date()); + }; + + 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; + } + + // FORMATTING + + 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', matchShortOffset); + addRegexToken('ZZ', matchShortOffset); + addParseToken(['Z', 'ZZ'], function (input, array, config) { + config._useUTC = true; + config._tzm = offsetFromString(matchShortOffset, input); + }); + + // HELPERS + + // timezone chunker + // '+10:00' > ['10', '00'] + // '-1530' > ['-15', '30'] + var chunkOffset = /([\+\-]|\d\d)/gi; + + function offsetFromString(matcher, string) { + var matches = ((string || '').match(matcher) || []); + 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 (!this.isValid()) { + return input != null ? this : NaN; + } + if (input != null) { + if (typeof input === 'string') { + input = offsetFromString(matchShortOffset, input); + } else 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(matchOffset, this._i)); + } + return this; + } + + function hasAlignedHourOffset (input) { + if (!this.isValid()) { + return false; + } + 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 (!isUndefined(this._isDSTShifted)) { + 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.isValid() ? !this._isUTC : false; + } + + function isUtcOffset () { + return this.isValid() ? this._isUTC : false; + } + + function isUtc () { + return this.isValid() ? this._isUTC && this._offset === 0 : false; + } + + // ASP.NET json date format regex + var aspNetRegex = /^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?\d*)?$/; + + // 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 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 = 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; + if (!(base.isValid() && other.isValid())) { + return {milliseconds: 0, months: 0}; + } + + 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; + } + + // TODO: remove 'name' arg after deprecation is removed + 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; + + if (!mom.isValid()) { + // No op + return; + } + + 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'; + + var output = formats && (isFunction(formats[format]) ? formats[format]() : formats[format]); + + return this.format(output || this.localeData().calendar(format, this, local__createLocal(now))); + } + + function clone () { + return new Moment(this); + } + + function isAfter (input, units) { + var localInput = isMoment(input) ? input : local__createLocal(input); + if (!(this.isValid() && localInput.isValid())) { + return false; + } + units = normalizeUnits(!isUndefined(units) ? units : 'millisecond'); + if (units === 'millisecond') { + return +this > +localInput; + } else { + return +localInput < +this.clone().startOf(units); + } + } + + function isBefore (input, units) { + var localInput = isMoment(input) ? input : local__createLocal(input); + if (!(this.isValid() && localInput.isValid())) { + return false; + } + units = normalizeUnits(!isUndefined(units) ? units : 'millisecond'); + if (units === 'millisecond') { + return +this < +localInput; + } else { + return +this.clone().endOf(units) < +localInput; + } + } + + function isBetween (from, to, units) { + return this.isAfter(from, units) && this.isBefore(to, units); + } + + function isSame (input, units) { + var localInput = isMoment(input) ? input : local__createLocal(input), + inputMs; + if (!(this.isValid() && localInput.isValid())) { + return false; + } + units = normalizeUnits(units || 'millisecond'); + if (units === 'millisecond') { + return +this === +localInput; + } else { + inputMs = +localInput; + return +(this.clone().startOf(units)) <= inputMs && inputMs <= +(this.clone().endOf(units)); + } + } + + function isSameOrAfter (input, units) { + return this.isSame(input, units) || this.isAfter(input,units); + } + + function isSameOrBefore (input, units) { + return this.isSame(input, units) || this.isBefore(input,units); + } + + function diff (input, units, asFloat) { + var that, + zoneDelta, + delta, output; + + if (!this.isValid()) { + return NaN; + } + + that = cloneWithOffset(input, this); + + if (!that.isValid()) { + return NaN; + } + + zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4; + + 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 (isFunction(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() && + ((isMoment(time) && time.isValid()) || + local__createLocal(time).isValid())) { + return create__createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix); + } else { + return this.localeData().invalidDate(); + } + } + + function fromNow (withoutSuffix) { + return this.from(local__createLocal(), withoutSuffix); + } + + function to (time, withoutSuffix) { + if (this.isValid() && + ((isMoment(time) && time.isValid()) || + local__createLocal(time).isValid())) { + return create__createDuration({from: this, to: time}).locale(this.locale()).humanize(!withoutSuffix); + } else { + return this.localeData().invalidDate(); + } + } + + function toNow (withoutSuffix) { + return this.to(local__createLocal(), withoutSuffix); + } + + // If passed a locale key, it will set the locale for this + // instance. Otherwise, it will return the locale configuration + // variables for this instance. + 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 toJSON () { + // JSON.stringify(new Date(NaN)) === 'null' + return this.isValid() ? this.toISOString() : 'null'; + } + + function moment_valid__isValid () { + return valid__isValid(this); + } + + function parsingFlags () { + return extend({}, getParsingFlags(this)); + } + + function invalidAt () { + return getParsingFlags(this).overflow; + } + + function creationData() { + return { + input: this._i, + format: this._f, + locale: this._locale, + isUTC: this._isUTC, + strict: this._strict + }; + } + + // FORMATTING + + 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); + }); + + // MOMENTS + + function getSetWeekYear (input) { + return getSetWeekYearHelper.call(this, + input, + this.week(), + this.weekday(), + this.localeData()._week.dow, + this.localeData()._week.doy); + } + + function getSetISOWeekYear (input) { + return getSetWeekYearHelper.call(this, + input, this.isoWeek(), this.isoWeekday(), 1, 4); + } + + function getISOWeeksInYear () { + return weeksInYear(this.year(), 1, 4); + } + + function getWeeksInYear () { + var weekInfo = this.localeData()._week; + return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy); + } + + function getSetWeekYearHelper(input, week, weekday, dow, doy) { + var weeksTarget; + if (input == null) { + return weekOfYear(this, dow, doy).year; + } else { + weeksTarget = weeksInYear(input, dow, doy); + if (week > weeksTarget) { + week = weeksTarget; + } + return setWeekAll.call(this, input, week, weekday, dow, doy); + } + } + + function setWeekAll(weekYear, week, weekday, dow, doy) { + var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy), + date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear); + + // console.log("got", weekYear, week, weekday, "set", date.toISOString()); + this.year(date.getUTCFullYear()); + this.month(date.getUTCMonth()); + this.date(date.getUTCDate()); + return this; + } + + // FORMATTING + + addFormatToken('Q', 0, 'Qo', '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); + } + + // FORMATTING + + 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 + + // 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'); + } + + // FORMATTING + + 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); + + // FORMATTING + + 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, token) { + var weekday = config._locale.weekdaysParse(input, token, config._strict); + // 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, format) { + return isArray(this._weekdays) ? this._weekdays[m.day()] : + this._weekdays[this._weekdays.isFormat.test(format) ? 'format' : 'standalone'][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, format, strict) { + var i, mom, regex; + + if (!this._weekdaysParse) { + this._weekdaysParse = []; + this._minWeekdaysParse = []; + this._shortWeekdaysParse = []; + this._fullWeekdaysParse = []; + } + + for (i = 0; i < 7; i++) { + // make the regex if we don't have it already + + mom = local__createLocal([2000, 1]).day(i); + if (strict && !this._fullWeekdaysParse[i]) { + this._fullWeekdaysParse[i] = new RegExp('^' + this.weekdays(mom, '').replace('.', '\.?') + '$', 'i'); + this._shortWeekdaysParse[i] = new RegExp('^' + this.weekdaysShort(mom, '').replace('.', '\.?') + '$', 'i'); + this._minWeekdaysParse[i] = new RegExp('^' + this.weekdaysMin(mom, '').replace('.', '\.?') + '$', 'i'); + } + if (!this._weekdaysParse[i]) { + regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, ''); + this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i'); + } + // test the regex + if (strict && format === 'dddd' && this._fullWeekdaysParse[i].test(weekdayName)) { + return i; + } else if (strict && format === 'ddd' && this._shortWeekdaysParse[i].test(weekdayName)) { + return i; + } else if (strict && format === 'dd' && this._minWeekdaysParse[i].test(weekdayName)) { + return i; + } else if (!strict && this._weekdaysParse[i].test(weekdayName)) { + return i; + } + } + } + + // MOMENTS + + function getSetDayOfWeek (input) { + if (!this.isValid()) { + return input != null ? this : NaN; + } + 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) { + if (!this.isValid()) { + return input != null ? this : NaN; + } + var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7; + return input == null ? weekday : this.add(input - weekday, 'd'); + } + + function getSetISODayOfWeek (input) { + if (!this.isValid()) { + return input != null ? this : NaN; + } + // 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); + } + + // FORMATTING + + 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 + + // 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'); + } + + // FORMATTING + + function hFormat() { + return this.hours() % 12 || 12; + } + + addFormatToken('H', ['HH', 2], 0, 'hour'); + addFormatToken('h', ['hh', 2], 0, hFormat); + + addFormatToken('hmm', 0, 0, function () { + return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2); + }); + + addFormatToken('hmmss', 0, 0, function () { + return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2) + + zeroFill(this.seconds(), 2); + }); + + addFormatToken('Hmm', 0, 0, function () { + return '' + this.hours() + zeroFill(this.minutes(), 2); + }); + + addFormatToken('Hmmss', 0, 0, function () { + return '' + this.hours() + zeroFill(this.minutes(), 2) + + zeroFill(this.seconds(), 2); + }); + + 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); + + addRegexToken('hmm', match3to4); + addRegexToken('hmmss', match5to6); + addRegexToken('Hmm', match3to4); + addRegexToken('Hmmss', match5to6); + + 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; + }); + addParseToken('hmm', function (input, array, config) { + var pos = input.length - 2; + array[HOUR] = toInt(input.substr(0, pos)); + array[MINUTE] = toInt(input.substr(pos)); + getParsingFlags(config).bigHour = true; + }); + addParseToken('hmmss', function (input, array, config) { + var pos1 = input.length - 4; + var pos2 = input.length - 2; + array[HOUR] = toInt(input.substr(0, pos1)); + array[MINUTE] = toInt(input.substr(pos1, 2)); + array[SECOND] = toInt(input.substr(pos2)); + getParsingFlags(config).bigHour = true; + }); + addParseToken('Hmm', function (input, array, config) { + var pos = input.length - 2; + array[HOUR] = toInt(input.substr(0, pos)); + array[MINUTE] = toInt(input.substr(pos)); + }); + addParseToken('Hmmss', function (input, array, config) { + var pos1 = input.length - 4; + var pos2 = input.length - 2; + array[HOUR] = toInt(input.substr(0, pos1)); + array[MINUTE] = toInt(input.substr(pos1, 2)); + array[SECOND] = toInt(input.substr(pos2)); + }); + + // 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); + + // FORMATTING + + 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); + + // FORMATTING + + 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); + + // FORMATTING + + 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); + + // FORMATTING + + 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.isSameOrAfter = isSameOrAfter; + momentPrototype__proto.isSameOrBefore = isSameOrBefore; + 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 = toJSON; + momentPrototype__proto.toString = toString; + momentPrototype__proto.unix = unix; + momentPrototype__proto.valueOf = to_type__valueOf; + momentPrototype__proto.creationData = creationData; + + // 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 isFunction(output) ? 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 (isFunction(output)) ? + output(number, withoutSuffix, string, isFuture) : + output.replace(/%d/i, number); + } + + function pastFuture (diff, output) { + var format = this._relativeTime[diff > 0 ? 'future' : 'past']; + return isFunction(format) ? format(output) : format.replace(/%s/i, output); + } + + function locale_set__set (config) { + var prop, i; + for (i in config) { + prop = config[i]; + if (isFunction(prop)) { + 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; + prototype__proto._monthsRegex = defaultMonthsRegex; + prototype__proto.monthsRegex = monthsRegex; + prototype__proto._monthsShortRegex = defaultMonthsShortRegex; + prototype__proto.monthsShortRegex = monthsShortRegex; + + // 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 + + // FORMATTING + + 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.11.2'; + + setHookCallback(local__createLocal); + + utils_hooks__hooks.fn = momentPrototype; + utils_hooks__hooks.min = min; + utils_hooks__hooks.max = max; + utils_hooks__hooks.now = now; + 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; + utils_hooks__hooks.prototype = momentPrototype; + + 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 ''; + } + 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 '' + + '' + + ''; + }, + + 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 '' + weekNum + ''; + }, + + renderRow = function(days, isRTL) + { + return '' + (isRTL ? days.reverse() : days).join('') + ''; + }, + + renderBody = function(rows) + { + return '' + rows.join('') + ''; + }, + + renderHead = function(opts) + { + var i, arr = []; + if (opts.showWeekNumber) { + arr.push(''); + } + for (i = 0; i < 7; i++) { + arr.push('' + renderDayName(opts, i, true) + ''); + } + return '' + (opts.isRTL ? arr.reverse() : arr).join('') + ''; + }, + + renderTitle = function(instance, c, year, month, refYear) + { + var i, j, arr, + opts = instance._o, + isMinYear = year === opts.minYear, + isMaxYear = year === opts.maxYear, + html = '
    ', + monthHtml, + yearHtml, + prev = true, + next = true; + + for (arr = [], i = 0; i < 12; i++) { + arr.push(''); + } + monthHtml = '
    ' + opts.i18n.months[month] + '
    '; + + 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(''); + } + } + yearHtml = '
    ' + year + opts.yearSuffix + '
    '; + + 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 += ''; + } + if (c === (instance._o.numberOfMonths - 1) ) { + html += ''; + } + + return html += '
    '; + }, + + renderTable = function(opts, data) + { + return '' + renderHead(opts) + renderBody(data) + '
    '; + }, + + + /** + * 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 += '
    ' + 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) + '
    '; + } + + 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 = '" + (usingActiveX ? '' : "") + '' + '' + '' + '' + '' + '
     
    ' + "
    "; + 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,60,62,61,63,84,85,86,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,87,88,89,90,104,105,106,107,93,94,95,96,97,98,31,35,32,33,40,34,36,37,38,39])("zeroclipboard") +}); diff --git a/package.js b/package.js index 2119488..b021eb0 100644 --- a/package.js +++ b/package.js @@ -1,6 +1,6 @@ Package.describe({ name: 'awsp:handsontable', - version: '0.15.0', + version: '0.16.1', summary: 'Handsontable is a data grid component with an Excel-like appearance. Built in JavaScript.', git: 'https://github.com/awsp/handsontable-meteor', documentation: 'README.md' @@ -12,10 +12,10 @@ Package.onUse(function(api) { api.addFiles([ 'bower_components/pikaday/css/pikaday.css', - 'lib/handsontable.meteor.0.23.0.css', + 'lib/handsontable.meteor.0.24.1.css', 'lib/handsontable-ruleJS/src/handsontable.formula.css', 'lib/rulejs/ruleJS.all.full.js', - 'lib/handsontable.meteor.0.23.0.js', + 'lib/handsontable.meteor.0.24.1.js', 'lib/rulejs/handsontable.formula.js', 'lib/handsontable-ruleJS/lib/highlight/styles/github.css', 'lib/rulejs/highlight.pack.js',