1 |
- {"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap db0a363ab92eaa28636e","webpack:///./src/helpers/dom/element.js","webpack:///./src/helpers/array.js","webpack:///./src/helpers/object.js","webpack:///./node_modules/core-js/modules/_export.js","webpack:///./src/3rdparty/walkontable/src/index.js","webpack:///./src/helpers/number.js","webpack:///./src/eventManager.js","webpack:///./src/i18n/constants.js","webpack:///./src/plugins.js","webpack:///./node_modules/core-js/modules/_is-object.js","webpack:///./src/plugins/_base.js","webpack:///./node_modules/core-js/modules/_wks.js","webpack:///./src/helpers/dom/event.js","webpack:///./src/renderers/index.js","webpack:///./node_modules/core-js/modules/_global.js","webpack:///./src/pluginHooks.js","webpack:///./src/helpers/mixed.js","webpack:///./src/editors/index.js","webpack:///./node_modules/core-js/modules/_an-object.js","webpack:///./src/plugins/contextMenu/utils.js","webpack:///./node_modules/core-js/modules/_object-dp.js","webpack:///./src/helpers/unicode.js","webpack:///./node_modules/core-js/modules/_descriptors.js","webpack:///./node_modules/core-js/modules/_fails.js","webpack:///./node_modules/core-js/modules/_to-iobject.js","webpack:///./node_modules/core-js/modules/_to-length.js","webpack:///./node_modules/core-js/modules/_object-sap.js","webpack:///./src/helpers/browser.js","webpack:///./src/validators/index.js","webpack:///./node_modules/core-js/modules/_has.js","webpack:///./node_modules/core-js/modules/_redefine.js","webpack:///./node_modules/core-js/modules/_hide.js","webpack:///./node_modules/core-js/modules/_ctx.js","webpack:///./node_modules/core-js/modules/_to-object.js","webpack:///./node_modules/core-js/modules/_meta.js","webpack:///./src/3rdparty/walkontable/src/overlay/_base.js","webpack:///./src/helpers/string.js","webpack:///./node_modules/core-js/modules/_object-keys.js","webpack:///./node_modules/core-js/modules/_defined.js","webpack:///./src/utils/staticRegister.js","webpack:///./src/helpers/feature.js","webpack:///./src/helpers/templateLiteralTag.js","webpack:///./src/helpers/function.js","webpack:///./node_modules/core-js/modules/_cof.js","webpack:///./node_modules/core-js/modules/_core.js","webpack:///./node_modules/core-js/modules/_validate-collection.js","webpack:///./node_modules/core-js/modules/_add-to-unscopables.js","webpack:///./src/plugins/customBorders/utils.js","webpack:///./node_modules/core-js/modules/_uid.js","webpack:///./node_modules/core-js/modules/_property-desc.js","webpack:///./node_modules/core-js/modules/_iterators.js","webpack:///./node_modules/core-js/modules/_set-to-string-tag.js","webpack:///./node_modules/core-js/modules/_object-pie.js","webpack:///./src/editors/_baseEditor.js","webpack:///./src/3rdparty/walkontable/src/cell/coords.js","webpack:///external {\"root\":\"moment\",\"commonjs2\":\"moment\",\"commonjs\":\"moment\",\"amd\":\"moment\"}","webpack:///./src/helpers/console.js","webpack:///./src/editors/textEditor.js","webpack:///./src/mixins/localHooks.js","webpack:///./node_modules/core-js/modules/_to-integer.js","webpack:///./node_modules/core-js/modules/_to-absolute-index.js","webpack:///./node_modules/core-js/modules/_redefine-all.js","webpack:///./node_modules/core-js/modules/_a-function.js","webpack:///./node_modules/core-js/modules/_an-instance.js","webpack:///./node_modules/core-js/modules/_for-of.js","webpack:///./node_modules/core-js/modules/_library.js","webpack:///./node_modules/core-js/modules/_collection.js","webpack:///./node_modules/core-js/modules/_object-gopd.js","webpack:///./node_modules/core-js/modules/_array-methods.js","webpack:///./node_modules/core-js/modules/_object-gops.js","webpack:///./node_modules/core-js/modules/_fix-re-wks.js","webpack:///./src/i18n/dictionariesManager.js","webpack:///./node_modules/core-js/modules/_dom-create.js","webpack:///./node_modules/core-js/modules/_to-primitive.js","webpack:///./node_modules/core-js/modules/_object-create.js","webpack:///./node_modules/core-js/modules/_iobject.js","webpack:///./node_modules/core-js/modules/_shared-key.js","webpack:///./node_modules/core-js/modules/_shared.js","webpack:///./node_modules/core-js/modules/_enum-bug-keys.js","webpack:///./node_modules/core-js/modules/_iter-detect.js","webpack:///./node_modules/core-js/modules/_task.js","webpack:///./node_modules/core-js/modules/_object-gopn.js","webpack:///./node_modules/core-js/modules/_string-context.js","webpack:///./node_modules/core-js/modules/_fails-is-regexp.js","webpack:///./node_modules/core-js/modules/_create-property.js","webpack:///./node_modules/core-js/modules/es6.array.iterator.js","webpack:///./src/3rdparty/walkontable/src/cell/range.js","webpack:///./src/cellTypes/index.js","webpack:///./src/core.js","webpack:///./src/helpers/setting.js","webpack:///./src/helpers/data.js","webpack:///./src/selection/utils.js","webpack:///./src/utils/ghostTable.js","webpack:///./src/plugins/contextMenu/predefinedItems/separator.js","webpack:///./src/plugins/contextMenu/predefinedItems.js","webpack:///./src/plugins/mergeCells/cellCoords.js","webpack:///./node_modules/core-js/modules/es6.map.js","webpack:///./node_modules/core-js/modules/_collection-strong.js","webpack:///./node_modules/core-js/modules/_ie8-dom-define.js","webpack:///./node_modules/core-js/modules/_object-keys-internal.js","webpack:///./node_modules/core-js/modules/_array-includes.js","webpack:///./node_modules/core-js/modules/_html.js","webpack:///./node_modules/core-js/modules/_iter-call.js","webpack:///./node_modules/core-js/modules/_is-array-iter.js","webpack:///./node_modules/core-js/modules/core.get-iterator-method.js","webpack:///./node_modules/core-js/modules/_classof.js","webpack:///./node_modules/core-js/modules/_iter-define.js","webpack:///./node_modules/core-js/modules/_object-gpo.js","webpack:///./node_modules/core-js/modules/_iter-step.js","webpack:///./node_modules/core-js/modules/_set-species.js","webpack:///./node_modules/core-js/modules/_set-proto.js","webpack:///./node_modules/core-js/modules/es6.set.js","webpack:///./node_modules/core-js/modules/es6.weak-map.js","webpack:///./node_modules/core-js/modules/_is-array.js","webpack:///./node_modules/core-js/modules/_object-assign.js","webpack:///./node_modules/core-js/modules/_collection-weak.js","webpack:///./node_modules/core-js/modules/es6.weak-set.js","webpack:///./node_modules/core-js/modules/es6.promise.js","webpack:///./node_modules/core-js/modules/_new-promise-capability.js","webpack:///./node_modules/core-js/modules/es6.symbol.js","webpack:///./node_modules/core-js/modules/_wks-ext.js","webpack:///./node_modules/core-js/modules/_object-gopn-ext.js","webpack:///./node_modules/core-js/modules/es6.object.freeze.js","webpack:///./node_modules/core-js/modules/es6.object.seal.js","webpack:///./node_modules/core-js/modules/es6.object.prevent-extensions.js","webpack:///./node_modules/core-js/modules/es6.object.is-frozen.js","webpack:///./node_modules/core-js/modules/es6.object.is-sealed.js","webpack:///./node_modules/core-js/modules/es6.object.is-extensible.js","webpack:///./node_modules/core-js/modules/es6.object.get-own-property-descriptor.js","webpack:///./node_modules/core-js/modules/es6.object.get-prototype-of.js","webpack:///./node_modules/core-js/modules/es6.object.keys.js","webpack:///./node_modules/core-js/modules/es6.object.get-own-property-names.js","webpack:///./node_modules/core-js/modules/es6.object.assign.js","webpack:///./node_modules/core-js/modules/es6.object.is.js","webpack:///./node_modules/core-js/modules/es6.object.set-prototype-of.js","webpack:///./node_modules/core-js/modules/es6.function.name.js","webpack:///./node_modules/core-js/modules/es6.string.raw.js","webpack:///./node_modules/core-js/modules/es6.string.from-code-point.js","webpack:///./node_modules/core-js/modules/es6.string.code-point-at.js","webpack:///./node_modules/core-js/modules/es6.string.repeat.js","webpack:///./node_modules/core-js/modules/_string-repeat.js","webpack:///./node_modules/core-js/modules/es6.string.starts-with.js","webpack:///./node_modules/core-js/modules/_is-regexp.js","webpack:///./node_modules/core-js/modules/es6.string.ends-with.js","webpack:///./node_modules/core-js/modules/es6.string.includes.js","webpack:///./node_modules/core-js/modules/es6.regexp.flags.js","webpack:///./node_modules/core-js/modules/es6.regexp.match.js","webpack:///./node_modules/core-js/modules/es6.regexp.replace.js","webpack:///./node_modules/core-js/modules/es6.regexp.split.js","webpack:///./node_modules/core-js/modules/es6.regexp.search.js","webpack:///./node_modules/core-js/modules/es6.array.from.js","webpack:///./node_modules/core-js/modules/es6.array.of.js","webpack:///./node_modules/core-js/modules/es6.array.copy-within.js","webpack:///./node_modules/core-js/modules/es6.array.find.js","webpack:///./node_modules/core-js/modules/es6.array.find-index.js","webpack:///./node_modules/core-js/modules/es6.array.fill.js","webpack:///./node_modules/core-js/modules/es6.number.is-finite.js","webpack:///./node_modules/core-js/modules/es6.number.is-integer.js","webpack:///./node_modules/core-js/modules/_is-integer.js","webpack:///./node_modules/core-js/modules/es6.number.is-safe-integer.js","webpack:///./node_modules/core-js/modules/es6.number.is-nan.js","webpack:///./node_modules/core-js/modules/es6.number.epsilon.js","webpack:///./node_modules/core-js/modules/es6.number.min-safe-integer.js","webpack:///./node_modules/core-js/modules/es6.number.max-safe-integer.js","webpack:///./node_modules/core-js/modules/es7.array.includes.js","webpack:///./node_modules/core-js/modules/es7.object.values.js","webpack:///./node_modules/core-js/modules/_object-to-array.js","webpack:///./node_modules/core-js/modules/es7.object.entries.js","webpack:///./node_modules/core-js/modules/es7.object.get-own-property-descriptors.js","webpack:///./node_modules/core-js/modules/es7.string.pad-start.js","webpack:///./node_modules/core-js/modules/_string-pad.js","webpack:///./node_modules/core-js/modules/_user-agent.js","webpack:///./node_modules/core-js/modules/es7.string.pad-end.js","webpack:///./node_modules/core-js/modules/web.immediate.js","webpack:///./node_modules/core-js/modules/web.dom.iterable.js","webpack:///./src/3rdparty/walkontable/src/calculator/viewportColumns.js","webpack:///./src/3rdparty/walkontable/src/calculator/viewportRows.js","webpack:///./src/3rdparty/walkontable/src/filter/column.js","webpack:///./src/3rdparty/walkontable/src/filter/row.js","webpack:///./src/3rdparty/walkontable/src/core.js","webpack:///./src/3rdparty/walkontable/src/event.js","webpack:///./src/3rdparty/walkontable/src/overlays.js","webpack:///./src/3rdparty/walkontable/src/scroll.js","webpack:///./src/3rdparty/walkontable/src/settings.js","webpack:///./src/3rdparty/walkontable/src/table.js","webpack:///./src/3rdparty/walkontable/src/tableRenderer.js","webpack:///./src/3rdparty/walkontable/src/viewport.js","webpack:///./src/3rdparty/walkontable/src/border.js","webpack:///./src/editors/autocompleteEditor.js","webpack:///./src/editors/handsontableEditor.js","webpack:///./src/helpers/date.js","webpack:///./lib/SheetClip/SheetClip.js","webpack:///./src/selection/mouseEventHandler.js","webpack:///./src/utils/recordTranslator.js","webpack:///./src/utils/rootInstance.js","webpack:///./src/defaultSettings.js","webpack:///./src/i18n/index.js","webpack:///./src/i18n/utils.js","webpack:///./src/utils/keyStateObserver.js","webpack:///./src/selection/highlight/highlight.js","webpack:///./src/utils/samplesGenerator.js","webpack:///./src/mixins/arrayMapper.js","webpack:///./src/plugins/manualColumnMove/ui/_base.js","webpack:///./src/plugins/manualRowMove/ui/_base.js","webpack:///./src/plugins/mergeCells/utils.js","webpack:///./lib/jsonpatch/json-patch-duplex.js","webpack:///./src/index.js","webpack:///./node_modules/core-js/modules/_object-dps.js","webpack:///./node_modules/core-js/modules/_iter-create.js","webpack:///./node_modules/core-js/modules/_inherit-if-required.js","webpack:///./node_modules/core-js/modules/_array-species-create.js","webpack:///./node_modules/core-js/modules/_array-species-constructor.js","webpack:///./node_modules/core-js/modules/_species-constructor.js","webpack:///./node_modules/core-js/modules/_invoke.js","webpack:///./node_modules/core-js/modules/_microtask.js","webpack:///./node_modules/core-js/modules/_perform.js","webpack:///./node_modules/core-js/modules/_promise-resolve.js","webpack:///./node_modules/core-js/modules/_wks-define.js","webpack:///./node_modules/core-js/modules/_enum-keys.js","webpack:///./node_modules/core-js/modules/_same-value.js","webpack:///./node_modules/core-js/modules/_string-at.js","webpack:///./node_modules/core-js/modules/_flags.js","webpack:///./node_modules/core-js/modules/_array-copy-within.js","webpack:///./node_modules/core-js/modules/_array-fill.js","webpack:///./node_modules/core-js/modules/_own-keys.js","webpack:///./src/css/bootstrap.css","webpack:///./src/css/handsontable.css","webpack:///./src/css/mobile.handsontable.css","webpack:///./src/3rdparty/walkontable/src/overlay/debug.js","webpack:///./src/3rdparty/walkontable/src/overlay/left.js","webpack:///./src/3rdparty/walkontable/src/overlay/top.js","webpack:///./src/3rdparty/walkontable/src/overlay/topLeftCorner.js","webpack:///./src/3rdparty/walkontable/src/selection.js","webpack:///./lib/autoResize/autoResize.js","webpack:///./src/editors/checkboxEditor.js","webpack:///./src/editors/dateEditor.js","webpack:///external {\"root\":\"Pikaday\",\"commonjs2\":\"pikaday\",\"commonjs\":\"pikaday\",\"amd\":\"pikaday\"}","webpack:///./src/editors/dropdownEditor.js","webpack:///./src/editors/numericEditor.js","webpack:///./src/editors/passwordEditor.js","webpack:///./src/editors/selectEditor.js","webpack:///./src/renderers/_cellDecorator.js","webpack:///./src/renderers/autocompleteRenderer.js","webpack:///./src/renderers/checkboxRenderer.js","webpack:///./src/renderers/htmlRenderer.js","webpack:///./src/renderers/numericRenderer.js","webpack:///external {\"root\":\"numbro\",\"commonjs2\":\"numbro\",\"commonjs\":\"numbro\",\"amd\":\"numbro\"}","webpack:///./src/renderers/passwordRenderer.js","webpack:///./src/renderers/textRenderer.js","webpack:///./src/validators/autocompleteValidator.js","webpack:///./src/validators/dateValidator.js","webpack:///./src/validators/numericValidator.js","webpack:///./src/validators/timeValidator.js","webpack:///./src/cellTypes/autocompleteType.js","webpack:///./src/cellTypes/checkboxType.js","webpack:///./src/cellTypes/dateType.js","webpack:///./src/cellTypes/dropdownType.js","webpack:///./src/cellTypes/handsontableType.js","webpack:///./src/cellTypes/numericType.js","webpack:///./src/cellTypes/passwordType.js","webpack:///./src/cellTypes/textType.js","webpack:///./src/cellTypes/timeType.js","webpack:///./src/dataMap.js","webpack:///./src/utils/interval.js","webpack:///./src/multiMap.js","webpack:///./src/editorManager.js","webpack:///./src/tableView.js","webpack:///./src/dataSource.js","webpack:///./src/i18n/languages/en-US.js","webpack:///./src/i18n/phraseFormatters/index.js","webpack:///./src/i18n/phraseFormatters/pluralize.js","webpack:///./src/selection/index.js","webpack:///./src/selection/highlight/types/index.js","webpack:///./src/selection/highlight/types/activeHeader.js","webpack:///./src/selection/highlight/types/area.js","webpack:///./src/selection/highlight/types/cell.js","webpack:///./src/selection/highlight/types/fill.js","webpack:///./src/selection/highlight/types/header.js","webpack:///./src/selection/selection.js","webpack:///./src/selection/range.js","webpack:///./src/selection/transformation.js","webpack:///./src/helpers/wrappers/jquery.js","webpack:///./src/plugins/index.js","webpack:///./src/plugins/persistentState/persistentState.js","webpack:///./src/plugins/persistentState/storage.js","webpack:///./src/plugins/autoColumnSize/autoColumnSize.js","webpack:///./src/plugins/autofill/autofill.js","webpack:///./src/plugins/autofill/utils.js","webpack:///./src/plugins/autoRowSize/autoRowSize.js","webpack:///./src/plugins/columnSorting/columnSorting.js","webpack:///./src/utils/sortingAlgorithms/mergeSort.js","webpack:///./src/utils/dataStructures/linkedList.js","webpack:///./src/plugins/comments/comments.js","webpack:///./src/plugins/comments/commentEditor.js","webpack:///./src/plugins/comments/displaySwitch.js","webpack:///./src/plugins/comments/comments.css","webpack:///./src/plugins/contextMenu/contextMenu.js","webpack:///./src/plugins/contextMenu/commandExecutor.js","webpack:///./src/plugins/contextMenu/itemsFactory.js","webpack:///./src/plugins/contextMenu/predefinedItems/alignment.js","webpack:///./src/plugins/contextMenu/predefinedItems/clearColumn.js","webpack:///./src/plugins/contextMenu/predefinedItems/columnLeft.js","webpack:///./src/plugins/contextMenu/predefinedItems/columnRight.js","webpack:///./src/plugins/contextMenu/predefinedItems/readOnly.js","webpack:///./src/plugins/contextMenu/predefinedItems/redo.js","webpack:///./src/plugins/contextMenu/predefinedItems/removeColumn.js","webpack:///./src/plugins/contextMenu/predefinedItems/removeRow.js","webpack:///./src/plugins/contextMenu/predefinedItems/rowAbove.js","webpack:///./src/plugins/contextMenu/predefinedItems/rowBelow.js","webpack:///./src/plugins/contextMenu/predefinedItems/undo.js","webpack:///./src/plugins/contextMenu/menu.js","webpack:///./src/plugins/contextMenu/cursor.js","webpack:///./src/plugins/contextMenu/contextMenu.css","webpack:///./src/plugins/copyPaste/copyPaste.js","webpack:///./src/plugins/copyPaste/textarea.js","webpack:///./src/plugins/copyPaste/contextMenuItem/copy.js","webpack:///./src/plugins/copyPaste/contextMenuItem/cut.js","webpack:///./src/plugins/copyPaste/pasteEvent.js","webpack:///./src/plugins/copyPaste/clipboardData.js","webpack:///./src/plugins/copyPaste/copyPaste.css","webpack:///./src/plugins/customBorders/customBorders.js","webpack:///./src/plugins/customBorders/contextMenuItem/bottom.js","webpack:///./src/plugins/customBorders/contextMenuItem/left.js","webpack:///./src/plugins/customBorders/contextMenuItem/noBorders.js","webpack:///./src/plugins/customBorders/contextMenuItem/right.js","webpack:///./src/plugins/customBorders/contextMenuItem/top.js","webpack:///./src/plugins/dragToScroll/dragToScroll.js","webpack:///./src/plugins/manualColumnFreeze/manualColumnFreeze.js","webpack:///./src/plugins/manualColumnFreeze/contextMenuItem/freezeColumn.js","webpack:///./src/plugins/manualColumnFreeze/contextMenuItem/unfreezeColumn.js","webpack:///./src/plugins/manualColumnFreeze/manualColumnFreeze.css","webpack:///./src/plugins/manualColumnMove/manualColumnMove.js","webpack:///./src/plugins/manualColumnMove/columnsMapper.js","webpack:///./src/plugins/manualColumnMove/ui/backlight.js","webpack:///./src/plugins/manualColumnMove/ui/guideline.js","webpack:///./src/plugins/manualColumnMove/manualColumnMove.css","webpack:///./src/plugins/manualColumnResize/manualColumnResize.js","webpack:///./src/plugins/manualRowMove/manualRowMove.js","webpack:///./src/plugins/manualRowMove/rowsMapper.js","webpack:///./src/plugins/manualRowMove/ui/backlight.js","webpack:///./src/plugins/manualRowMove/ui/guideline.js","webpack:///./src/plugins/manualRowMove/manualRowMove.css","webpack:///./src/plugins/manualRowResize/manualRowResize.js","webpack:///./src/plugins/mergeCells/mergeCells.js","webpack:///./src/plugins/mergeCells/cellsCollection.js","webpack:///./src/plugins/mergeCells/calculations/autofill.js","webpack:///./src/plugins/mergeCells/calculations/selection.js","webpack:///./src/plugins/mergeCells/contextMenuItem/toggleMerge.js","webpack:///./src/plugins/mergeCells/mergeCells.css","webpack:///./src/plugins/multipleSelectionHandles/multipleSelectionHandles.js","webpack:///./src/plugins/observeChanges/observeChanges.js","webpack:///./src/plugins/observeChanges/dataObserver.js","webpack:///./src/plugins/observeChanges/utils.js","webpack:///./src/plugins/search/search.js","webpack:///./src/plugins/touchScroll/touchScroll.js","webpack:///./src/plugins/undoRedo/undoRedo.js"],"names":["getParent","closest","closestDown","isChildOf","isChildOfWebComponentTable","polymerWrap","polymerUnwrap","index","overlayContainsElement","hasClass","addClass","removeClass","removeTextNodes","empty","fastInnerHTML","fastInnerText","isVisible","offset","getWindowScrollTop","getWindowScrollLeft","getScrollTop","getScrollLeft","getScrollableElement","getTrimmingContainer","getStyle","getComputedStyle","outerWidth","outerHeight","innerHeight","innerWidth","addEvent","removeEvent","getCaretPosition","getSelectionEndPosition","getSelectionText","setCaretPosition","getScrollbarWidth","hasVerticalScrollbar","hasHorizontalScrollbar","setOverlayPosition","getCssTransform","resetCssTransform","isInput","isOutsideInput","element","level","iteration","parent","host","nodeType","Node","DOCUMENT_FRAGMENT_NODE","parentNode","nodes","until","ELEMENT_NODE","indexOf","nodeName","matched","contains","push","length","child","node","queriedParents","Array","prototype","slice","call","document","querySelectorAll","hotTableName","result","isHotTable","toUpperCase","Polymer","wrap","unwrap","i","previousSibling","overlayType","overlayElement","querySelector","classListSupport","documentElement","classList","_hasClass","_addClass","_removeClass","filterEmptyClassNames","classNames","len","isSupportMultipleClassesArg","createElement","add","className","split","apply","remove","createClassNameRegExp","RegExp","test","_className","join","replace","trim","removeChild","childs","childNodes","lastChild","HTML_CHARACTERS","content","innerHTML","textContextSupport","createTextNode","textContent","firstChild","nextSibling","data","appendChild","elem","next","impl","Error","style","display","offsetLeft","offsetTop","lastElem","docElem","box","getBoundingClientRect","top","window","pageYOffset","scrollTop","clientTop","left","pageXOffset","scrollLeft","clientLeft","offsetParent","body","position","res","scrollY","scrollX","el","props","overflow","overflowX","overflowY","computedStyle","computedOverflow","computedOverflowY","computedOverflowX","getPropertyValue","clientHeight","scrollHeight","clientWidth","scrollWidth","base","prop","styleProp","currentStyle","defaultView","offsetWidth","offsetHeight","event","callback","addEventListener","attachEvent","removeEventListener","detachEvent","selectionStart","selection","focus","r","createRange","re","createTextRange","rc","duplicate","moveToBookmark","getBookmark","setEndPoint","text","selectionEnd","getSelection","toString","type","pos","endPos","setSelectionRange","err","elementParent","parentDisplayValue","range","collapse","moveEnd","moveStart","select","cachedScrollbarWidth","walkontableCalculateScrollbarWidth","inner","height","width","outer","boxSizing","visibility","w1","w2","overlayElem","transform","inputs","contentEditable","to2dArray","extendArray","pivot","arrayReduce","arrayFilter","arrayMap","arrayEach","arraySum","arrayMax","arrayMin","arrayAvg","arrayFlatten","arrayUnique","arr","ilen","extension","pivotedArr","rowCount","colCount","j","array","iteratee","accumulator","initFromArray","iterable","isArray","from","predicate","resIndex","value","a","b","initial","concat","unique","duckSchema","inherit","extend","deepExtend","deepClone","clone","mixin","isObjectEqual","isObject","defineGetter","objectEach","getProperty","deepObjectSize","createObjectPropListener","hasOwnProperty","object","schema","key","Child","Parent","constructor","target","Object","obj","JSON","parse","stringify","Base","MIXINS","mixins","MIXIN_NAME","getter","_getter","propertyName","initialValue","initValue","setter","_setter","defineProperty","get","set","configurable","object1","object2","property","options","writable","enumerable","name","names","recursObjLen","defaultValue","propertyToListen","privateProperty","holder","_touched","ViewportColumnsCalculator","ViewportRowsCalculator","CellCoords","CellRange","ColumnFilter","RowFilter","DebugOverlay","LeftOverlay","TopOverlay","TopLeftCornerOverlay","Border","default","Core","Event","Overlays","Scroll","Selection","Settings","Table","TableRenderer","Viewport","isNumeric","rangeEach","rangeEachReverse","valueAccordingPercent","n","t","isNaN","isFinite","valueOf","Date","rangeFrom","rangeTo","percent","parseInt","getListenersCounter","listenersCounter","EventManager","context","eventListeners","eventName","callbackProxy","extendEvent","tmpEvent","splice","clearEvents","bubbles","cancelable","view","detail","screenX","screenY","clientX","clientY","ctrlKey","altKey","shiftKey","metaKey","button","relatedTarget","undefined","createEvent","initMouseEvent","createEventObject","dispatchEvent","fireEvent","componentName","isHotTableSpotted","fromElement","realTarget","nativeStopImmediatePropagation","isTargetWebComponent","stopImmediatePropagation","isHotTableEnv","path","shadowRoot","srcElement","toElement","wtTable","hot","wt","TABLE","activeWt","CONTEXT_MENU_ITEMS_NAMESPACE","CONTEXTMENU_ITEMS_ROW_ABOVE","CONTEXTMENU_ITEMS_ROW_BELOW","CONTEXTMENU_ITEMS_INSERT_LEFT","CONTEXTMENU_ITEMS_INSERT_RIGHT","CONTEXTMENU_ITEMS_REMOVE_ROW","CONTEXTMENU_ITEMS_REMOVE_COLUMN","CONTEXTMENU_ITEMS_UNDO","CONTEXTMENU_ITEMS_REDO","CONTEXTMENU_ITEMS_READ_ONLY","CONTEXTMENU_ITEMS_CLEAR_COLUMN","CONTEXTMENU_ITEMS_COPY","CONTEXTMENU_ITEMS_CUT","CONTEXTMENU_ITEMS_FREEZE_COLUMN","CONTEXTMENU_ITEMS_UNFREEZE_COLUMN","CONTEXTMENU_ITEMS_MERGE_CELLS","CONTEXTMENU_ITEMS_UNMERGE_CELLS","CONTEXTMENU_ITEMS_ADD_COMMENT","CONTEXTMENU_ITEMS_EDIT_COMMENT","CONTEXTMENU_ITEMS_REMOVE_COMMENT","CONTEXTMENU_ITEMS_READ_ONLY_COMMENT","CONTEXTMENU_ITEMS_ALIGNMENT","CONTEXTMENU_ITEMS_ALIGNMENT_LEFT","CONTEXTMENU_ITEMS_ALIGNMENT_CENTER","CONTEXTMENU_ITEMS_ALIGNMENT_RIGHT","CONTEXTMENU_ITEMS_ALIGNMENT_JUSTIFY","CONTEXTMENU_ITEMS_ALIGNMENT_TOP","CONTEXTMENU_ITEMS_ALIGNMENT_MIDDLE","CONTEXTMENU_ITEMS_ALIGNMENT_BOTTOM","CONTEXTMENU_ITEMS_BORDERS","CONTEXTMENU_ITEMS_BORDERS_TOP","CONTEXTMENU_ITEMS_BORDERS_RIGHT","CONTEXTMENU_ITEMS_BORDERS_BOTTOM","CONTEXTMENU_ITEMS_BORDERS_LEFT","CONTEXTMENU_ITEMS_REMOVE_BORDERS","CONTEXTMENU_ITEMS_NESTED_ROWS_INSERT_CHILD","CONTEXTMENU_ITEMS_NESTED_ROWS_DETACH_CHILD","CONTEXTMENU_ITEMS_HIDE_COLUMN","CONTEXTMENU_ITEMS_SHOW_COLUMN","CONTEXTMENU_ITEMS_HIDE_ROW","CONTEXTMENU_ITEMS_SHOW_ROW","FILTERS_NAMESPACE","FILTERS_CONDITIONS_NAMESPACE","FILTERS_CONDITIONS_NONE","FILTERS_CONDITIONS_EMPTY","FILTERS_CONDITIONS_NOT_EMPTY","FILTERS_CONDITIONS_EQUAL","FILTERS_CONDITIONS_NOT_EQUAL","FILTERS_CONDITIONS_BEGINS_WITH","FILTERS_CONDITIONS_ENDS_WITH","FILTERS_CONDITIONS_CONTAINS","FILTERS_CONDITIONS_NOT_CONTAIN","FILTERS_CONDITIONS_BY_VALUE","FILTERS_CONDITIONS_GREATER_THAN","FILTERS_CONDITIONS_GREATER_THAN_OR_EQUAL","FILTERS_CONDITIONS_LESS_THAN","FILTERS_CONDITIONS_LESS_THAN_OR_EQUAL","FILTERS_CONDITIONS_BETWEEN","FILTERS_CONDITIONS_NOT_BETWEEN","FILTERS_CONDITIONS_AFTER","FILTERS_CONDITIONS_BEFORE","FILTERS_CONDITIONS_TODAY","FILTERS_CONDITIONS_TOMORROW","FILTERS_CONDITIONS_YESTERDAY","FILTERS_DIVS_FILTER_BY_CONDITION","FILTERS_DIVS_FILTER_BY_VALUE","FILTERS_LABELS_CONJUNCTION","FILTERS_LABELS_DISJUNCTION","FILTERS_VALUES_BLANK_CELLS","FILTERS_BUTTONS_SELECT_ALL","FILTERS_BUTTONS_CLEAR","FILTERS_BUTTONS_OK","FILTERS_BUTTONS_CANCEL","FILTERS_BUTTONS_PLACEHOLDER_SEARCH","FILTERS_BUTTONS_PLACEHOLDER_VALUE","FILTERS_BUTTONS_PLACEHOLDER_SECOND_VALUE","registeredPlugins","WeakMap","registerPlugin","pluginName","PluginClass","getSingleton","has","pluginsHolder","plugin","destroy","delete","getPlugin","instance","_pluginName","getRegistredPluginNames","hotInstance","keys","getPluginName","pluginInstance","privatePool","initializedPlugins","BasePlugin","hooks","pluginsInitializedCallbacks","isPluginsReady","enabled","initialized","addHook","onAfterPluginsInitialized","onUpdateSettings","init","isEnabled","enablePlugin","runHooks","eventManager","clear","clearHooks","removeHook","callbacks","removeHooks","disablePlugin","updatePlugin","isImmediatePropagationStopped","stopPropagation","pageX","pageY","isRightClick","isLeftClick","isImmediatePropagationEnabled","cancelBubble","register","getItem","hasItem","getNames","getValues","_getItem","registerRenderer","getRenderer","hasRenderer","getRegisteredRendererNames","getRegisteredRenderers","REGISTERED_HOOKS","Hooks","globalSingleton","globalBucket","createEmptyBucket","bucket","create","hook","pluginHookBucket","c","getBucket","skip","foundInitialHook","initialHook","cb","once","runOnce","p1","p2","p3","p4","p5","p6","globalHandlers","localHandlers","isRegistered","isDefined","isUndefined","isEmpty","isRegExp","_injectProductInfo","variable","_m","_hd","v","_pi","_ss","s","l","_cp","_norm","_extractTime","_ignored","location","_notified","warningMessage","showDomMessage","schemaValidity","_checkKeySchema","ignored","trial","releaseTime","Math","floor","toDate","getTime","keyGenTime","console","message","id","insertBefore","z","p","shift","abs","padStart","RegisteredEditor","_getEditorInstance","registeredEditorClasses","_register","editorClass","instances","Clazz","getConstructor","getInstance","guid","editor","editorWrapper","registerEditor","getEditor","getEditorInstance","hasEditor","getRegisteredEditorNames","getRegisteredEditors","normalizeSelection","isSeparator","hasSubMenu","isDisabled","isSelectionDisabled","getValidSelection","prepareVerticalAlignClass","prepareHorizontalAlignClass","getAlignmentClasses","align","checkSelectionConsistency","markLabelAsSelected","isItemHidden","filterSeparators","selRanges","start","getTopLeftCorner","end","getBottomRightCorner","cell","selected","getSelected","alignment","ranges","classes","to","row","col","cellDescriptor","propertySetter","applyAlignClassName","cellMeta","comparator","forAll","label","String","fromCharCode","item","hidden","shiftSeparators","items","separator","popSeparators","reverse","removeDuplicatedSeparators","isPrintableChar","isMetaKey","isCtrlKey","isCtrlMetaKey","isKey","KEY_CODES","MOUSE_LEFT","MOUSE_RIGHT","MOUSE_MIDDLE","BACKSPACE","COMMA","INSERT","DELETE","END","ENTER","ESCAPE","CONTROL","COMMAND_LEFT","COMMAND_RIGHT","COMMAND_FIREFOX","ALT","HOME","PAGE_DOWN","PAGE_UP","PERIOD","SPACE","SHIFT","CAPS_LOCK","TAB","ARROW_RIGHT","ARROW_LEFT","ARROW_UP","ARROW_DOWN","F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12","A","X","C","V","keyCode","metaKeys","navigator","platform","includes","baseCode","isIE8","isIE9","isSafari","isChrome","isMobileBrowser","_isIE8","_isIE9","documentMode","_isSafari","userAgent","vendor","_isChrome","registerValidator","getValidator","hasValidator","getRegisteredValidatorNames","getRegisteredValidators","registeredOverlays","Overlay","overlayClass","CLONE_TYPES","wot","overlay","CLONE_TOP","CLONE_BOTTOM","CLONE_LEFT","CLONE_TOP_LEFT_CORNER","CLONE_BOTTOM_LEFT_CORNER","CLONE_DEBUG","wotInstance","mainTableScrollableElement","hider","spreader","wtRootElement","trimmingContainer","areElementSizesAdjusted","updateStateOfRendering","previousState","needFullRender","shouldBeRendered","changed","reset","direction","clonedTable","preventOverflow","getSetting","cloneSource","cloneOverlay","table","fastDraw","nextCycleRenderFlag","draw","holderStyle","hidderStyle","rootStyle","toUpperCaseFirst","equalsIgnoreCase","randomString","isPercentValue","substitute","stripTags","string","substr","strings","toLowerCase","s4","random","substring","template","variables","match","charAt","STRIP_TAGS_REGEX","staticRegister","collection","Map","namespace","subCollection","values","requestAnimationFrame","cancelAnimationFrame","isTouchSupported","isWebComponentSupportedNatively","hasCaptionProblem","getComparisonFunction","lastTime","vendors","_requestAnimationFrame","_cancelAnimationFrame","x","currTime","timeToCall","max","setTimeout","clearTimeout","createShadowRoot","_hasCaptionProblem","detectCaptionProblem","borderSpacing","borderWidth","padding","TBODY","CAPTION","margin","comparisonFunction","language","Intl","Collator","compare","localeCompare","toSingleLine","expressions","previousValue","currentValue","valueWithoutWhiteSpaces","expressionForIndex","isFunction","throttle","throttleAfterHits","debounce","pipe","partial","curry","curryRight","func","wait","lastCalled","lastCallThrottled","lastTimer","_throttle","args","arguments","stamp","now","needCall","remaining","hits","funcThrottle","remainHits","_clearHits","_throttleAfterHits","clearHits","_debounce","functions","firstFunc","restFunc","_pipe","acc","fn","params","_partial","restParams","argsLength","given","argsSoFar","_curry","passedArgsSoFar","createClassName","createDefaultCustomBorder","createSingleEmptyBorder","createDefaultHtBorder","createEmptyBorders","extendDefaultBorder","checkSelectionBorders","markSelected","color","hide","cornerVisible","border","right","bottom","defaultBorder","customBorder","atLeastOneHasBorder","getSelectedRange","metaBorders","getCellMeta","borders","EditorState","VIRGIN","EDITING","WAITING","FINISHED","BaseEditor","state","_opened","_fullEditMode","_closeCallback","_fireCallbacks","getValue","setValue","newValue","open","close","prepare","td","originalValue","cellProperties","TD","baseClass","Editor","Bridge","saveValue","ctrlDown","tmp","getSelectedLast","populateFromArray","beginEditing","newInitialValue","scrollViewport","render","finishEditing","restoreOriginalValue","_this","val","previousCloseCallback","isWaiting","_registerTimeout","cancelChanges","getSettings","trimWhitespace","getCellValidator","addHookOnce","discardEditor","allowInvalid","selectCell","enableFullEditMode","isInFullEditMode","isOpened","checkEditorSection","totalRows","countRows","section","fixedRowsTop","fixedColumnsLeft","fixedRowsBottom","cellCoords","testedCoords","log","warn","info","error","TextEditor","that","createElements","bindEvents","autoResize","TEXTAREA","onBeforeKeyDown","getActiveEditor","allowKeyEventPropagation","isMultipleSelection","isMultiple","caretPosition","preventDefault","resize","refreshDimensions","tdOutside","textareaParentStyle","unObserve","activeElement","listen","textareaStyle","TEXTAREA_PARENT","rootElement","getEditedCell","editorSection","editedCell","wtOverlays","topOverlay","getCell","zIndex","topLeftCornerOverlay","bottomLeftCornerOverlay","leftOverlay","bottomOverlay","refreshValue","sourceData","getSourceDataAtCell","currentOffset","containerOffset","scrollableContainer","totalRowsCount","containerScrollTop","containerScrollLeft","editTopModifier","settings","rowHeadersCount","hasRowHeaders","colHeadersCount","hasColHeaders","backgroundColor","editTop","editLeft","cssTransformOffset","firstRowOffset","wtViewport","rowsRenderCalculator","startPosition","firstColumnOffset","columnsRenderCalculator","horizontalScrollPosition","getScrollPosition","verticalScrollPosition","scrollbarWidth","cellTopOffset","cellLeftOffset","actualVerticalScrollbarWidth","actualHorizontalScrollbarWidth","maxWidth","maximumVisibleElementWidth","maxHeight","maximumVisibleElementHeight","cellComputedStyle","fontSize","fontFamily","minHeight","min","minWidth","localHooks","_localHooks","addLocalHook","runLocalHooks","clearLocalHooks","DEFAULT_LANGUAGE_CODE","languageCode","registerGloballyLanguageDictionary","getGlobalLanguageDictionary","hasGlobalLanguageDictionary","getGlobalLanguagesDictionaries","registerLanguage","languageCodeOrDictionary","dictionary","extendLanguageDictionary","getLanguage","hasLanguage","getDefaultLanguage","getLanguages","registerLanguageDictionary","getLanguageDictionary","hasLanguageDictionary","getDefaultLanguageDictionary","getLanguagesDictionaries","highlight","coords","isValid","topLeft","bottomRight","testedRange","isSouthEastOf","isNorthWestOf","getTopRightCorner","expandingRange","includesRange","overlaps","initialDirection","getDirection","expandingTopLeft","expandingBottomRight","resultTopRow","resultTopCol","resultBottomRow","resultBottomCol","finalFrom","finalTo","setDirection","getVerticalDirection","flipDirectionVertically","getHorizontalDirection","flipDirectionHorizontally","isNorthEastOf","isSouthWestOf","getBottomLeftCorner","expandedRange","isEqual","thisBorders","rangeBorders","out","breakIteration","toObject","renderer","validator","registerCellType","getCellType","hasCellType","getRegisteredCellTypeNames","getRegisteredCellTypes","activeGuid","userSettings","rootInstanceSymbol","priv","datamap","dataSource","grid","editorManager","preventScrollingToCell","GridSettings","expandType","container","renderCall","licenseKey","recordTranslator","cellSettings","columnSettings","columnsSettingConflicts","selRange","isPopulated","scrollable","firstRun","countCols","propToCol","isEditorOpened","getFirstVisibleRow","getFirstVisibleColumn","preventScrolling","selectionRange","current","selectionLayerLevel","size","colToProp","isSelectedByAnyHeader","currentSelectedRange","selectedRange","scrollToCell","isTouched","isSelectedByRowHeader","isSelectedByColumnHeader","_refreshBorders","cellRanges","changedIsMultiple","cellCoordsDelta","rowTransformDir","colTransformDir","destroyEditor","alter","totalCols","action","amount","source","keepEmptyRows","delta","spliceWith","count","toInject","valueFactory","spliceArgs","unshift","normalizeIndexesGroup","indexes","sortedIndexes","sort","indexA","indexB","normalizedIndexes","previousItem","prevIndex","prevAmount","prevLastIndex","amountToAdd","numberOfSourceRows","countSourceRows","maxRows","createRow","isSelected","transformEnd","createCol","colHeaders","spliceArray","removeRow","calcIndex","Number","isInteger","adjustRowsAndCols","removeCol","visualColumnIndex","toPhysicalColumn","minRows","rows","minSpareRows","emptyRows","countEmptyRows","emptyCols","minCols","minSpareCols","countEmptyCols","columns","dataType","maxCols","deselect","selectionChanged","fromRow","fromCol","toRow","toCol","adjustElementsSize","input","method","deltas","rlen","clen","setData","repeatCol","repeatRow","cmax","rmax","baseEnd","spliceCol","spliceRow","skippedRow","skippedColumn","pushData","getInputValue","rowValue","rowInputLength","rowSelectionLength","allowInsertRow","visualRow","colInputLength","colSelectionLength","skipRowOnPaste","allowInsertColumn","skipColumnOnPaste","readOnly","visualColumn","orgValue","getDataAtCell","orgValueSchema","valueSchema","setDataAtCell","setLanguage","normalizedLanguageCode","updateSettings","forceFullRender","ValidatorsQueue","resolved","validatorsInQueue","valid","addValidatorToQueue","removeValidatorFormQueue","checkIfQueueIsEmpty","onQueueEmpty","getParsedNumber","numericData","unifiedNumericData","parseFloat","validateChanges","changes","waitingForValidator","isNumericData","resolve","validateCell","visualCol","invalidCellClassName","beforeChangeResult","applyChanges","skipThisChange","numberOfCreatedRows","lockEditor","unlockEditor","activeEditor","done","canBeValidated","wtSettings","cellRenderer","setDataInputToArray","propOrCol","getAtCell","toPhysicalRow","setDataAtRowProp","modifyDocumentFocus","invalidActiveElement","blur","isListening","unlisten","revertOriginal","endRow","endCol","getSelectedRangeLast","emptySelectedCells","cellRange","column","loadData","dataSchema","getSchema","startRows","startCols","bind","clearCellSettingCache","getData","r2","c2","getAll","getRange","DESTINATION_RENDERER","getCopyableText","startRow","startCol","getCopyableData","getCopyable","columnsAsFunc","cols","getRegistered","createMap","columnSetting","countSourceCols","cells","proto","setCellMetaObject","currentHeight","initialStyle","getAttribute","setAttribute","clearLengthCache","resetHasOversizedColumnHeadersMarked","updateMainScrollableElements","sel","expandedType","selectAll","topmost","getCellAtCoords","getCoords","toVisualRow","toVisualColumn","getDataAtRowProp","getDataAtCol","getDataAtProp","getSourceData","getByRange","getSourceDataArray","getSourceDataAtCol","getAtColumn","getSourceDataAtRow","getAtRow","getDataAtRow","getDataType","rowFrom","columnFrom","rowTo","columnTo","previousType","currentType","isTypeEqual","cellType","removeCellMeta","toPhysical","physicalRow","physicalColumn","cachedValue","hookResult","spliceCellsMeta","deleteAmount","setCellMeta","getCellsMeta","getCellMetaAtRow","isColumnModificationAllowed","rendererLookup","getCellRenderer","getCellEditor","validatorLookup","validateCells","_validateCells","validateRows","validateColumns","getRowHeader","rowHeader","rowHeaders","getColHeader","translateVisualIndexToColumns","columnsLen","baseCol","title","_getColWidthFromSettings","colWidths","getColWidth","DEFAULT_WIDTH","_getRowHeightFromSettings","rowHeights","getRowHeight","sourceLength","getLength","dataHasLength","dataLen","columnsIsFunction","columnLen","colToPropCache","rowOffset","getFirstRenderedRow","colOffset","getFirstRenderedColumn","countRenderedRows","drawn","getRenderedRowsCount","countVisibleRows","getVisibleRowsCount","countRenderedCols","getRenderedColumnsCount","countVisibleCols","getVisibleColumnsCount","ending","visualIndex","isEmptyRow","emptyColumns","isEmptyCol","endColumn","changeListener","selectCells","wasSelected","selectCellByProp","endProp","selectColumns","startColumn","selectRows","deselectCell","scrollViewportTo","snapToBottom","snapToRight","scrollTo","_clearTimeouts","licenseInfo","postMortem","hasHook","run","getTranslatedPhrase","dictionaryKey","extraArguments","timeouts","handle","prepareEditor","columnFactory","conflictList","ColumnSettings","spreadsheetColumnLabel","spreadsheetColumnIndex","createSpreadsheetData","createSpreadsheetObjectData","createEmptySpreadsheetData","translateRowsToColumns","cellMethodLookupFactory","COLUMN_LABEL_BASE","COLUMN_LABEL_BASE_LENGTH","dividend","columnLabel","modulo","pow","_rows","jlen","output","olen","methodName","allowUndefined","cellMethodLookup","getMethodFromProperties","properties","getPrototypeOf","detectSelectionType","normalizeSelectionFactory","transformSelectionToColumnDistance","transformSelectionToRowDistance","isValidCoord","SELECTION_TYPE_UNRECOGNIZED","SELECTION_TYPE_EMPTY","SELECTION_TYPE_ARRAY","SELECTION_TYPE_OBJECT","SELECTION_TYPES","ARRAY_TYPE_PATTERN","rootCall","Symbol","childCall","selectionRanges","_callSymbol","isRootCall","firstItem","isArrayType","some","keepDirection","isObjectType","rowStart","columnStart","rowEnd","columnEnd","origRowStart","origColumnStart","origRowEnd","origColumnEnd","selectionType","selectionSchemaNormalizer","unorderedIndexes","Set","_","orderedIndexes","normalizedColumnRanges","normalizedRowRanges","rowIndex","coord","maxTableItemsCount","Infinity","GhostTable","injected","samples","useHeaders","createContainer","rowObject","createTable","colGroup","createColGroupsCol","tr","fragment","tHead","createColumnHeadersRow","columnObject","appendColHeader","th","tBody","injectTable","d","createDocumentFragment","createColElement","forEach","sample","appendRowHeader","removeTable","getStretchedColumnWidth","isVertical","isHorizontal","tableLayout","separatorItem","KEY","predefinedItems","addItem","ITEMS","_predefinedItems","itemFactory","MergedCellCoords","rowspan","colspan","removed","totalColumns","shiftVector","indexOfChange","shiftValue","shiftedIndex","span","changeStart","changeEnd","mergeStart","mergeEnd","removedOffset","preRemovedOffset","removedPart","mergedCell","getLastRow","getLastColumn","newMergedCell","mergedCellInfo","mergeCell","columnCount","viewportWidth","scrollOffset","columnWidthFn","overrideFn","onlyFullyVisible","stretchH","stretchingColumnWidthFn","stretchAllRatio","stretchLastWidth","stretch","totalTargetWidth","needVerifyLastColumnWidth","stretchAllColumnsWidth","calculate","sum","needReverse","startPositions","columnWidth","_getColumnWidth","compensatedViewportWidth","viewportSum","totalWidth","sumAll","permanentColumnWidth","remainingSize","lastColumnWidth","baseWidth","_getStretchedAllColumnWidth","_getStretchedLastColumnWidth","sumRatioWidth","stretchedWidth","round","newStretchedWidth","viewportHeight","rowHeightFn","horizontalScrollbarHeight","rowHeight","DEFAULT_HEIGHT","total","countTH","offsetted","unOffsetted","renderedToSource","offsettedTH","unOffsettedTH","sourceToRendered","Walkontable","originalHeaders","wtScroll","wtEvent","selections","exportSettingsAsClassNames","THEAD","update","TH","drawInterrupted","fixedColumns","getLastVisibleRow","getLastVisibleColumn","toExport","columnHeaders","allClassNames","newClassNames","optionType","param1","param2","param3","param4","selectedCellBeforeTouchEnd","dblClickOrigin","dblClickTimeout","onMouseDown","getParentNode","parentCell","hasSetting","onTouchMove","touchMoving","onTouchStart","checkIfTouchMove","onMouseOver","mainWOT","lastMouseOver","onMouseOut","lastTD","nextTD","onMouseUp","selectedCellWasTouched","touchTarget","cellUnderFinger","coordsOfCellUnderFinger","rowTouched","rowSelected","colTouched","colSelected","onTouchEnd","excludeTags","tagName","isWorkingOnClone","classSelector","touchApplied","momentumScrolling","_timeout","ongoing","createOrGetArea","BODY_LINE_HEIGHT","lineHeight","FALLBACK_BODY_LINE_HEIGHT","scrollableElement","prepareOverlays","destroyed","keyPressed","spreaderLastSize","overlayScrollPositions","master","pendingScrollCallbacks","verticalScrolling","horizontalScrolling","delegatedScrollCallback","registeredListeners","browserLineHeight","registerListeners","syncScroll","createOverlay","hasOverlay","debug","onScroll","topOverlayScrollable","leftOverlayScrollable","listenersToRegister","onKeyDown","onKeyUp","onTableScroll","isHighPixelRatio","devicePixelRatio","onCloneWheel","deltaY","wheelDeltaY","deltaX","wheelDeltaX","listener","pop","masterHorizontal","masterVertical","syncScrollPositions","shouldNotWheelVertically","shouldNotWheelHorizontally","translateMouseWheelToScroll","deltaMode","scrollVertically","scrollHorizontally","distance","topHolder","leftHolder","refreshAll","deregisterListeners","updateMainScrollableElement","refresh","force","headerRowSize","getRowHeaderWidth","headerColumnSize","getColumnHeaderHeight","hiderStyle","sumCellSizes","applyToDOM","overlays","_getVariables","firstVisibleRow","rootElementOffset","totalTableHeight","windowHeight","windowScrollTop","rowsHeight","lastVisibleRow","firstVisibleColumn","totalTableWidth","windowWidth","windowScrollLeft","columnsWidth","lastVisibleColumn","defaults","externalRowCalculator","currentRowClassName","currentColumnClassName","freezeOverlays","cellData","defaultRowHeight","defaultColumnWidth","hideBorderOnMouseDownOver","viewportRowCalculatorOverride","viewportColumnCalculatorOverride","onCellMouseDown","onCellMouseOver","onCellMouseOut","onCellMouseUp","onCellDblClick","onCellCornerMouseDown","onCellCornerDblClick","beforeDraw","onDraw","onBeforeRemoveCellClassNames","onAfterDrawSelection","onBeforeDrawBorders","onScrollVertically","onScrollHorizontally","onBeforeTouchScroll","onAfterMomentumScroll","onBeforeStretchingColumnWidth","onModifyRowHeaderWidth","onModifyGetCellCoords","scrollbarHeight","renderAllRows","groups","rowHeaderWidth","columnHeaderHeight","headerClassName","COLGROUP","tableOffset","holderOffset","createSpreader","createHider","createHolder","alignOverlaysWithTrimmingContainer","fixTableDomTree","colgroupChildrenLength","theadChildrenLength","tbodyChildrenLength","rowFilter","columnFilter","correctHeaderWidth","origRowHeaderWidth","_modifyRowHeaderWidth","trimmingElement","createRenderCalculators","leftScrollPos","createVisibleCalculators","isOverlayTypeOf","_doDraw","refreshSelections","resetFixedPosition","syncScrollWithMaster","wtRenderer","highlights","classesToRemove","highlightHeaderClassName","highlightRowClassName","highlightColumnClassName","classNamesLength","additionalClassesToRemove","classesToRemoveLength","removeClassFromCells","isRowBeforeRenderedRows","isRowAfterRenderedRows","TR","sourceColumnToVisibleRowHeadedColumn","CONTAINER","cellIndex","visibleColHeadedRowToSourceRow","visibleRowHeadedColumnToSourceColumn","rowsVisibleCalculator","columnsVisibleCalculator","getLastRenderedRow","getLastRenderedColumn","columnsCount","isOverlayName","rowsCount","sourceRow","oversizedHeight","oversizedRows","oversizedColumnHeaders","sourceColumn","getColumnWidth","calculator","rowHeaderWidthFactory","widths","_correctRowHeaderWidth","performanceWarningAppeared","rowHeaderCount","columnHeaderCount","skipRender","columnsToRender","rowsToRender","workspaceWidth","adjusted","adjustAvailableNodes","renderColumnHeaders","renderRows","getWorkspaceWidth","containerWidth","adjustColumnWidths","markOversizedColumnHeaders","adjustColumnHeaderHeights","removeRedundantRows","markOversizedRows","hiderWidth","tableWidth","firstRendered","lastRendered","rowHeaderWidthSetting","renderedIndex","renderedRowsCount","visibleRowIndex","sourceRowIndex","getOrCreateTrForRow","renderRowHeaders","adjustColumns","renderCells","resetOversizedRow","expectedTableHeight","actualTableHeight","previousRowHeight","rowInnerHeight","currentTr","getTrForRow","overlayName","getOverlayName","hasOversizedColumnHeadersMarked","renderedColumnIndex","markIfOversizedColumnHeader","children","sourceColIndex","previousColHeaderHeight","currentHeader","currentHeaderHeight","columnHeaderHeightSetting","getColumnHeader","visibleColIndex","replaceThWithTd","removeAttribute","scrollbarCompensation","sourceInstance","mainHolder","refreshStretching","getViewportWidth","renderedColIndex","appendToTbody","replaceTdWithTh","renderRowHeader","adjustColGroups","adjustThead","getTrForColumnHeaders","sourceCol","renderColumnHeader","desiredCount","NaN","getWorkspaceHeight","elemHeight","stretchSetting","docOffsetWidth","getWorkspaceOffset","getContainerFillWidth","sumColumnWidths","getWorkspaceActualHeight","getWorkspaceActualWidth","mainContainer","fillWidth","dummyElement","containerHeight","rowHeadersHeightSetting","visible","fixedRowsHeight","getViewportHeight","getTableParentOffset","fixedColumnsWidth","proposedRowsVisibleCalculator","createRowsCalculator","proposedColumnsVisibleCalculator","createColumnsCalculator","areAllProposedVisibleRowsAlreadyRendered","areAllProposedVisibleColumnsAlreadyRendered","mouseDown","main","topStyle","leftStyle","bottomStyle","rightStyle","cornerDefaultStyle","borderStyle","borderColor","corner","cornerStyle","createBorders","onMouseEnter","parentElement","bounds","isOutside","ceil","handler","borderDivs","div","createMultipleSelectorHandles","disappear","bordersHolder","selectionHandles","topLeftHitArea","bottomRightHitArea","hitAreaWidth","styles","hitAreaStyle","handleStyle","background","areaSelection","handleWidth","isPartRange","corners","disabled","fromColumn","toColumn","fromTD","toTD","fromOffset","toOffset","minTop","minLeft","isEntireColumnSelected","modifiedValues","getDimensionsFromHeader","fromTH","isEntireRowSelected","borderTopWidth","borderLeftWidth","cornerVisibleSetting","layerLevel","checkRow","checkCol","borderRightWidth","cornerOverlappingContainer","borderBottomWidth","updateMultipleSelectionHandlesPosition","startRowIndex","endRowIndex","startColumnIndex","endColumnIndex","fromIndex","toIndex","rootHotElement","getHeaderFn","dimensionFn","entireSelectionClassname","dimension","dimensionProperty","startHeader","endHeader","columnHeaderLevelCount","startHeaderOffset","endOffset","AutocompleteEditor","query","strippedChoices","rawChoices","selectedValue","find","strippedValue","stripValueIfNeeded","htContainer","skipOne","timeOffset","htEditor","queryChoices","choicesListHot","trimDropdown","afterRenderer","filteringCaseSensitive","allowHtml","indexOfMatch","autoColumnSize","modifyColWidth","autoWidths","choices","updateChoicesList","stripValuesIfNeeded","sortByRelevanceSetting","sortByRelevance","filterSetting","filter","orderByRelevance","highlightIndex","orderByRelevanceLength","sorted","choicesCount","updateDropdownHeight","flipDropdownIfNeeded","strict","highlightBestMatchingChoice","textareaOffset","textareaHeight","dropdownHeight","getDropdownHeight","trimmingContainerScrollTop","headersHeight","spaceAbove","spaceBelow","flipNeeded","flipDropdown","unflipDropdown","limitDropdownIfNeeded","spaceAvailable","tempHeight","lastRowHeight","flipped","setDropdownHeight","dropdownStyle","currentDropdownWidth","caseSensitive","choicesRelevance","currentItem","valueLength","valueIndex","charsLeft","baseIndex","firstRowHeight","visibleRows","stringifiedValues","strippedValues","allowed","HandsontableEditor","DIV","assignHooks","copyPaste","autoRowSize","fillHandle","afterOnCellMouseDown","handsontable","htOptions","innerHOT","rowToSelect","selectedRow","lastRow","onBeginEditing","isCancelled","getNormalizedDate","dateString","nativeDate","getDate","getTimezoneOffset","global","countQuotes","str","SheetClip","rLen","cLen","multiline","last","exports","mouseOver","handleMouseEvent","isShiftKey","controller","currentSelection","selectedCorner","isSelectedByCorner","selectedColumn","setRangeEnd","newCoord","allowRightClickSelection","inInSelection","performSelection","setRangeStart","tableProps","handlers","registerIdentity","getTranslator","RecordTranslator","identities","translatorSingletons","identity","singleton","registerAsRootInstance","hasValidParameter","isRootInstance","rootSymbol","DefaultSettings","comments","customBorders","allowRemoveRow","allowRemoveColumn","selectionMode","outsideClickDeselects","enterBeginsEditing","enterMoves","tabMoves","autoWrapRow","autoWrapCol","persistentState","currentColClassName","currentHeaderClassName","activeHeaderClassName","tableClassName","colLen","meta","rowLen","observeDOMVisibility","allowEmpty","placeholder","placeholderCellClassName","readOnlyCellClassName","commentedCellClassName","fragmentSelection","search","copyable","autoComplete","wordWrap","noWordWrapClassName","contextMenu","undo","columnSorting","manualColumnMove","manualColumnResize","manualRowMove","manualRowResize","mergeCells","viewportRowRenderingOffset","viewportColumnRenderingOffset","disableVisualSelection","sortIndicator","manualColumnFreeze","checkedTemplate","uncheckedTemplate","numericFormat","selectOptions","dateFormat","correctFormat","defaultDate","bindRowsWithHeaders","collapsibleColumns","columnSummary","dropdownMenu","filters","formulas","ganttChart","headerTooltips","hiddenColumns","hiddenRows","nestedHeaders","trimRows","observeChanges","sortFunction","dragToScroll","argumentsForFormatters","languageDictionary","phrasePropositions","formattedPhrase","getFormattedPhrase","formattedPhrasePropositions","formatter","extendNotExistingKeys","createCellHeadersRange","normalizeLanguageCode","applyLanguageSetting","warnUserAboutLanguageRegistration","firstRowIndex","nextRowIndex","fromValue","toValue","languageCodePattern","partsOfLanguageCode","exec","pressedKeys","refCount","startObserving","stopObserving","_resetState","isPressed","keyCodes","_keyCode","isPressedCtrlKey","_getRefCount","ACTIVE_HEADER_TYPE","AREA_TYPE","CELL_TYPE","FILL_TYPE","HEADER_TYPE","Highlight","fill","areas","headers","activeHeaders","highlightType","disableHighlight","area","header","iterator","SamplesGenerator","dataFactory","customSampleCount","allowDuplicates","SAMPLE_COUNT","sampleCount","rowRange","colRange","generateSamples","specifierRange","generateSample","specifierValue","sampledValues","needed","getSampleCount","computedKey","arrayMapper","_arrayMap","getValueByIndex","physicalIndex","translatedIndex","getIndexByValue","insertItems","newIndex","addedItems","removeItems","removedItems","mapCopy","unshiftItems","countRowShift","logicalRow","removedLogicalRow","rowShift","shiftItems","swapIndexes","physicalIndexFrom","physicalIndexTo","clearMap","STATE_INITIALIZED","STATE_BUILT","STATE_APPENDED","UNIT","BaseUI","_element","wrapper","isAppended","marginTop","marginLeft","applySpanProperties","__extends","__","OriginalError","jsonpatch","_objectKeys","_isArray","k","_equals","bKeys","bLength","objOps","move","tree","temp","op","copy","_get","arrOps","rootOps","observeOps","patches","patch","escapePathComponent","_getPathRecursive","root","found","getPath","beforeDict","Mirror","observers","ObserverInfo","observer","getMirror","getObserverFromMirror","mirror","removeObserverFromMirror","unobserve","observe","intervals","currentInterval","dirtyCheck","generate","fastCheck","slowCheck","_generate","newKeys","oldKeys","deleted","oldVal","newVal","charCode","charCodeAt","validate","plen","existingPathFragment","JsonPatchError","tree1","tree2","_super","operation","hasUndefined","pathLen","existingPathLen","existingValue","sequence","e","arrayHelpers","browserHelpers","dataHelpers","dateHelpers","featureHelpers","functionHelpers","mixedHelpers","numberHelpers","objectHelpers","settingHelpers","stringHelpers","unicodeHelpers","domHelpers","domEventHelpers","plugins","constants","Handsontable","_getListenersCounter","buildDate","packageName","version","baseVersion","__GhostTable","HELPERS","DOM","helper","dom","getOwnPropertyNames","cellTypes","cellTypeName","editors","editorName","renderers","rendererName","cellDecorator","validators","validatorName","languages","dictionaryKeys","makeClone","opacity","textShadow","registerOverlay","overlayRoot","headerPosition","finalLeft","finalTop","adjustHeaderBordersPosition","updateTrimmingContainer","adjustRootElementSize","adjustRootChildrenSize","masterHolder","overlayRootStyle","syncOverlayOffset","beyondRendered","newX","setScrollPosition","masterParent","tableHeight","bottomEdge","newY","getBorder","getCorners","appear","redrawSelectionBorders","getAreas","getFill","redrawAllSelectionsBorders","secondHeaderCell","instanceBorders","classNameGenerator","linearClassNameGenerator","expand","oldCoords","newCoords","markIntersections","baseClassName","layerLevelOwner","calcClassName","previousIndex","previousClassName","currentLayer","renderedRows","renderedColumns","topRow","topColumn","bottomRow","bottomColumn","newClasses","addClassAtCoords","additionalSelectionClass","newChar","whiteSpace","delayedResize","extendDefaults","config","el_","doObserve","module","CheckboxEditor","checkbox","click","DateEditor","defaultDateFormat","isCellEdited","parentDestroyed","destroyElements","datePicker","datePickerStyle","$datePicker","getDatePickerConfig","hideDatepicker","showDatepicker","datePickerConfig","dateStr","isMouseDown","isMeta","_onInputFocus","format","setMoment","gotoToday","show","htInput","origOnSelect","onSelect","origOnClose","onClose","field","trigger","bound","reposition","DropdownEditor","NumericEditor","PasswordEditor","SelectEditor","registerHooks","prepareOptions","option","optionElement","optionsToPrepare","preparedOptions","previousOptionIndex","selectedIndex","nextOptionIndex","selectStyle","classesToAdd","clonableWRAPPER","clonableARROW","wrapTdContentWithWrapper","WRAPPER","autocompleteRenderer","cloneNode","ARROW","acArrowListener","isListeningKeyDownEvent","isCheckboxListenerAdded","BAD_VALUE_CLASS","checkboxRenderer","registerEvents","createInput","labelOptions","badValue","checked","labelText","createLabel","toggleKeys","switchOffKeys","isKeyCode","eachSelectedCheckboxCell","changeSelectedCheckboxesState","uncheckCheckbox","dataAtCell","checkboxes","onClick","onChange","isCheckboxInput","newCheckboxValue","htmlRenderer","numericRenderer","cellCulture","culture","cellFormatPattern","pattern","classArr","passwordRenderer","hashLength","hashSymbol","hash","textRenderer","escaped","rendererTemplate","TEMPLATE","HTMLTemplateElement","decorate","model","autocompleteValidator","process","originalVal","slen","dateValidator","dateEditor","isValidDate","isValidFormat","correctedValue","dateFromDate","dateFromMoment","isAlphanumeric","date","numericValidator","timeValidator","STRICT_FORMATS","timeFormat","twoDigitValue","isValidTime","DataMap","cachedLength","skipCache","latestSourceRowsCount","recursiveDuckSchema","interval","delay","onSkipLengthCache","DESTINATION_CLIPBOARD_GENERATOR","recursiveDuckColumns","lastCol","propToColCache","filteredIndex","schemaLen","continueProcess","spliceData","numberOfCreatedCols","currentIndex","logicRows","visualRowsToPhysical","actionWasNotCancelled","newData","filterData","logicColumns","visualColumnsToPhysical","descendingLogicColumns","isTableUniform","removedColumnsCount","elements","colData","after","rowData","continueSplicing","physicalRows","dataRow","modifiedRowData","sliced","valueHolder","copyableLookup","physicRow","rowsToRemove","physicalCol","visualCols","colsToRemove","maxRowsFromSettings","reValidate","stop","destination","getFn","getText","parseDelay","Interval","timer","stopped","_then","_callback","__callback","elapsed","MultiMap","map","weakMap","canBeAnArrayMapKey","canBeAWeakMapKey","isNaNSymbol","EditorManager","lock","moveSelectionAfterEnter","transformStart","moveSelectionUp","moveSelectionDown","moveSelectionRight","moveSelectionLeft","lastKeyCode","openEditor","rangeModifier","closeEditorAndSaveChanges","closeEditorAndRestoreOriginalValue","onDblClick","closeEditor","dataSaved","hotSettings","TableView","selectionMouseDown","originalStyle","isTextSelectionAllowed","clearTextSelection","isInProgress","finish","originalTarget","eventX","eventY","y","elementFromPoint","removeAllRanges","walkontableConfig","headerRenderers","blockCalculations","beforeRender","currentRow","currentColumn","cornersOfSelection","borderClassName","calc","viewportOffset","center","which","isChildOfTableBody","isSelectedOnlyCell","colEnd","updateCellHeader","parentOverlay","getParentOverlay","leftOffset","topOffset","workspaceHeight","mainViewIsActive","DataSource","toArray","countColumns","modifyRowData","newRow","registerGloballyPhraseFormatter","getGlobalPhraseFormatters","formatterFn","registerPhraseFormatter","getPhraseFormatters","pluralize","pluralForm","isPluralizable","createHighlight","areaCornerVisible","cellCornerVisible","rowClassName","columnClassName","inProgress","selectedByCorner","selectedByRowHeader","selectedByColumnHeader","isCellCornerVisible","isAreaCornerVisible","transformation","multipleSelection","isMultipleMode","isRowNegative","isColumnNegative","getLayerLevel","begin","setTo","isEnabledFor","getHeaders","getActiveHeaders","useLayerLevel","areaHighlight","headerHighlight","createOrGetHeader","activeHeaderHighlight","createOrGetActiveHeader","previous","isRowSelected","getWidth","isColumnSelected","getHeight","isMultipleListener","isSingle","rowDelta","colDelta","_isValid","setRangeStartOnly","SelectionRange","peekByIndex","rangeIndex","Transformation","highlightCoords","jQueryWrapper","jQuery","$this","first","removeData","AutoColumnSize","AutoFill","AutoRowSize","ColumnSorting","Comments","ContextMenu","CopyPaste","CustomBorders","DragToScroll","ManualColumnFreeze","ManualColumnMove","ManualColumnResize","ManualRowMove","ManualRowResize","MergeCells","MultipleSelectionHandles","ObserveChanges","PersistentState","Search","TouchScroll","UndoRedo","storage","saveTo","loadValue","resetValue","resetAll","Storage","prefix","savedKeys","loadSavedKeys","localStorage","setItem","saveSavedKeys","removeItem","clearSavedKeys","keysJSON","cachedColumnHeaders","ghostTable","samplesGenerator","spanned","firstCalculation","isDblClick","onBeforeColumnResize","setting","setSetting","onAfterLoadData","onBeforeChange","onBeforeRender","onAfterInit","changedColumns","findColumnsWhereHeaderWasChanged","clearCache","generateColumnSamples","addColumn","getWidths","clean","loop","calculateColumnsWidth","CALCULATION_STEP","getSyncCalculationLimit","samplingRatio","allowSampleDuplicates","setSampleCount","setAllowDuplicates","calculateAllColumnsWidth","limit","SYNC_CALCULATION_LIMIT","colsLimit","syncLimit","defaultWidth","keepMinimum","columnTitle","cachedColumnsLength","isNeedRecalculate","recalculateAllColumnsWidth","INSERT_ROW_ALTER_ACTION_NAME","INTERVAL_FOR_ADDING_ROW","Autofill","addingStarted","mouseDownOnCellCorner","mouseDragOutside","handleDraggedCells","directions","autoInsertRow","mapSettings","onAfterCellCornerMouseDown","onBeforeCellMouseOver","clearMappedSettings","cornersOfSelectionAndDragAreas","resetSelectionOfDraggedArea","cornersOfSelectedCells","getCornersOfSelectedCells","directionOfDrag","startOfDragCoords","endOfDragCoords","selectionData","getSelectionData","fillData","dragLength","fillOffset","setSelection","coordsOfSelection","topLeftCorner","bottomRightCorner","vertical","horizontal","reduceSelectionAreaIfNeeded","coordsOfDragAndDropBorders","getCoordsOfDragAndDropBorders","redrawBorders","cornersOfSelectedDragArea","nrOfTableRows","addRow","lastFilledInRowIndex","columnIndex","dataInCell","dataInNextLeftCell","dataInNextRightCell","selectStartArea","cornersOfArea","getIndexOfLastAdjacentFilledInRow","addSelectionFromStartAreaToSpecificRowIndex","tableBottom","tableRight","onMouseMove","selectionApplied","selectAdjacent","fillIn","showBorder","addNewRowIfNeeded","mouseWasDraggedOutside","getIfMouseWasDraggedOutside","mappedSettings","getDeltas","getDragDirectionAndRange","getMappedFillHandleSetting","DIRECTIONS","rowsLength","columnsLength","diffRow","diffCol","startValue","endValue","startSelection","endSelection","heights","onBeforeRowResize","setSamplingOptions","recalculateAllRowsHeight","onBeforeRowMove","generateRowSamples","addColumnHeadersRow","getHeights","calculateRowsHeight","calculateAllRowsHeight","rowsLimit","defaultHeight","clearCacheByRange","sortIndicators","lastSortedColumn","sortEmptyCells","setPluginOptions","sortIndex","sortByColumn","enableObserveChangesPlugin","translateRow","untranslateRow","onAfterUpdateSettings","onAfterOnCellMouseDown","afterCreateRow","afterRemoveRow","sortBySettings","sortingSettings","loadedSortingState","loadSortingState","sortingColumn","sortingOrder","sortOrder","sortColumn","order","setSortingColumn","allowSorting","updateOrderClass","updateSortIndicator","saveSortingState","sortingState","storedState","orderClass","sortOrderClass","columnMeta","aDate","bDate","isAfter","isBefore","parsedA","parsedB","colMeta","nrOfRows","sortingEnabled","POSITIVE_INFINITY","dateSort","numericSort","defaultSort","headerLink","TRs","headerLevel","isSorted","removedRows","mergeSort","merge","defaultCompareFunction","firstValue","secondValue","compareFunction","startIndex","endIndex","middleIndex","leftElements","rightElements","leftSize","rightSize","maxSize","NodeStructure","prev","LinkedList","fast","slow","inverse","META_COMMENT","META_COMMENT_VALUE","META_STYLE","META_READONLY","displaySwitch","contextMenuEvent","tempEditorDimensions","cellBelowCursor","getDisplayDelaySetting","addToContextMenu","onAfterRenderer","onAfterBeginEditing","showAtCell","updateDelay","getInputElement","onEditorBlur","onEditorMouseDown","onEditorMouseUp","closestCell","editorValue","comment","updateCommentMeta","setRange","setComment","forceRender","removeComment","getCommentMeta","refreshEditor","cellOffset","lastColWidth","hasVerticalScroll","hasHorizontalScroll","commentStyle","setSize","resetSize","setReadOnlyState","setPosition","hasComment","metaObject","oldComment","newComment","targetIsCommentTextArea","eventCell","coordinates","isFocused","targetIsCellWithComment","currentWidth","cancelHiding","removeCommentAtCell","currentState","defaultOptions","checkSelectionCommentsConsistency","onContextMenuAddComment","onContextMenuRemoveComment","hasProperty","readOnlyProperty","onContextMenuMakeReadOnly","commentSetting","displayDelay","CommentEditor","createEditor","editorStyle","CLASS_EDITOR_CONTAINER","textArea","CLASS_EDITOR","CLASS_INPUT","DEFAULT_DISPLAY_DELAY","DEFAULT_HIDE_DELAY","DisplaySwitch","wasLastActionShow","showDebounced","hidingTimer","commandExecutor","itemsFactory","menu","DEFAULT_ITEMS","getItems","setCommonCallback","delayedInitialization","setPredefinedItems","menuItems","keepInViewport","setMenuItems","onMenuBeforeOpen","onMenuAfterOpen","onMenuAfterClose","executeCommand","command","registerCommand","callOnPluginsReady","onContextMenu","hotMenu","execute","showRowHeaders","showColHeaders","isValidElement","SEPARATOR","CommandExecutor","commands","commonCallback","commandDescriptor","commandName","commandSplit","subCommandName","submenu","findSubCommand","subCommands","cmd","cmds","ItemsFactory","orderPattern","defaultOrderPattern","menuItemKey","defaultPattern","alignmentItem","stateBefore","clearColumnItem","entireRowSelection","columnLeftItem","normalizedSelection","latestSelection","onlyOneColumn","columnRightItem","readOnlyItem","atLeastOneReadOnly","redoItem","redo","undoRedo","isRedoAvailable","removeColumnItem","removeRowItem","rowAboveItem","rowBelowItem","undoItem","isUndoAvailable","MIN_WIDTH","Menu","standalone","hotSubMenus","parentMenu","origOutsideClickDeselects","keyEvent","above","below","_afterScrollCallback","onDocumentMouseDown","delayedOpenSubMenu","openSubMenu","minWidthOfMenu","filteredItems","menuItemRenderer","beforeKeyDown","afterOnCellMouseOver","isAllSubMenusClosed","onAfterSelection","blockMainTableCallbacks","closeParent","closeAllSubMenus","releaseMainTableCallbacks","dataItem","subMenu","menus","closeSubMenu","selectedItem","isCommand","autoClose","isSubMenu","cursor","fitsBelow","setPositionBelowCursor","fitsAbove","setPositionAboveCursor","fitsOnRight","setPositionOnRightOfCursor","setPositionOnLeftOfCursor","cellHeight","cellWidth","selectNextCell","selectPrevCell","nextRow","prevRow","itemIsSeparator","itemIsDisabled","itemIsSelectionDisabled","disableSelection","getElementsByTagName","stopEvent","selectFirstCell","selectLastCell","currentHiderWidth","realHeight","Cursor","topRelative","leftRelative","getSourceType","ROWS_LIMIT","COLUMNS_LIMIT","columnsLimit","copyableRanges","pasteMode","textarea","isTriggeredByCopy","isTriggeredByCut","isBeginEditing","isFragmentSelectionEnabled","onAfterContextMenuDefaultOptions","onAfterSelectionEnd","finalEndRow","finalEndCol","dataSet","copyableRows","copyableColumns","rowSet","execCommand","pasteData","clipboardData","onPaste","onCut","onCopy","setCopyableText","rangedData","getRangedData","allowCopying","ClipboardEvent","allowCuttingOut","inputArray","allowPasting","coordsFrom","coordsTo","areaStart","areaEnd","isSelRowAreaCoverInputValue","isSelColAreaCoverInputValue","changesLength","highestColumnIndex","change","nextChange","isActive","Textarea","append","refCounter","hasBeenDestroyed","tabIndex","autocomplete","copyItem","copyPastePlugin","cutItem","cut","PasteEvent","ClipboardData","savedBorderSettings","clearBorders","changeBorderSettings","getSettingIndex","borderObj","insertBorderIntoSettings","rowObj","colIndex","removeBordersFromDom","place","bordersMeta","removeAllBorders","setBorder","topCol","rowRight","bottomCol","rowLeft","prepareBorderFromCustomAddedRange","prepareBorderFromCustomAdded","bordersFromTable","createCustomBorders","customBordersPlugin","hasBorder","prepareBorder","noBorders","boundaries","listening","setupListening","unregisterEvents","diffX","diffY","scrollHandler","setBoundaries","setCallback","check","moveByFreeze","afterFirstUse","frozenColumnsBasePositions","manualColumnMovePlugin","addContextMenuEntry","onBeforeColumnMove","getMovePlugin","columnsMapper","moveColumn","returnCol","getBestColumnReturnPosition","movePlugin","initialCol","frozenLen","disallowMoving","freezeColumnItem","manualColumnFreezePlugin","freezeColumn","unfreezeColumnItem","unfreezeColumn","CSS_PLUGIN","CSS_SHOW_UI","CSS_ON_MOVING","CSS_AFTER_SELECTION","columnsToMove","pressed","eventPageX","removedColumns","backlight","guideline","onBeforeOnCellMouseDown","onBeforeOnCellMouseOver","onAfterScrollVertically","onModifyCol","onBeforeRemoveCol","onAfterRemoveCol","onAfterCreateCol","onUnmodifyCol","pluginSettings","moveColumns","visualColumns","beforeColumnHook","actualPosition","clearNull","persistentStateLoad","selectedColumns","firstVisible","lastVisible","tdOffsetLeft","getColumnsWidth","coordsColumn","mouseOffsetLeft","tbodyOffsetLeft","backlightElemMarginLeft","getOffset","backlightElemWidth","getSize","isFixedColumnsLeft","newCoordsCol","backlightLeft","guidelineLeft","columnsMapperLen","diff","maxIndex","columnsToRemove","isHeaderSelection","isSortingElement","guidelineIsNotReady","isBuilt","backlightIsNotReady","appendTo","prepareColumnsToMoving","countColumnsFrom","topPos","wrapperIsWindow","mouseOffset","layerX","setOffset","refreshPositions","backlightWidth","persistentStateSave","changeSelection","headerHeight","posTop","removedIndex","updateColumnsMapper","columnInMapper","indexInMapper","initialSettings","build","ColumnsMapper","originLength","itemIndex","indexToMove","CSS_CLASSNAME","BacklightUI","GuidelineUI","currentTH","currentCol","selectedCols","newSize","startY","startWidth","startOffset","guide","dblclick","autoresizeTimeout","manualColumnWidths","initialColumnWidth","loadedManualColumnWidths","loadManualColumnWidths","onModifyColWidth","isDoubleClick","handleHeight","handleBottomPosition","checkIfColumnHeader","getTHFromTargetElement","setupHandlePosition","selectedCol","hookNewSize","clearManualSize","setManualSize","saveManualColumnWidths","selectedColsLength","setupGuidePosition","afterMouseDownTimeout","startX","refreshHandlePosition","refreshGuidePosition","hideHandleAndGuide","rowsToMove","eventPageY","rowsMapper","onAfterScrollHorizontally","onModifyRow","onBeforeRemoveRow","onAfterRemoveRow","onAfterCreateRow","onBeforeColumnSort","onUnmodifyRow","moveRows","visualRows","beforeMoveHook","moveRow","selectedRows","fixedRows","tdOffsetTop","getRowsHeight","mouseOffsetTop","hiderHeight","tbodyOffsetTop","backlightElemMarginTop","backlightElemHeight","isFixedRowTop","backlightTop","guidelineTop","topOverlayHeight","rowsMapperLen","prepareRowsToMoving","leftPos","layerY","rowsLen","backlightHeight","headerWidth","posLeft","updateRowsMapper","rowInMapper","RowsMapper","startHeight","manualRowHeights","initialRowHeights","loadedManualRowHeights","loadManualRowHeights","onModifyRowHeight","handleRightPosition","checkIfRowHeader","selectedRowsLength","saveManualRowHeights","autoRowSizePlugin","autoRowHeightResult","manualRowHeight","lastDesiredCoords","mergedCellsCollection","autofillCalculations","selectionCalculations","onModifyTransformStart","onAfterModifyTransformStart","onModifyTransformEnd","onBeforeSetRangeEnd","onAfterIsMultipleSelection","addMergeActionsToContextMenu","onAfterGetCellMeta","onAfterViewportRowCalculatorOverride","onAfterViewportColumnCalculatorOverride","onModifyAutofillRange","onAfterChange","onBeforeDrawAreaBorders","clearCollections","generateFromSettings","containsNegativeValues","NEGATIVE_VALUES_WARNING","isOutOfBounds","IS_OUT_OF_BOUNDS_WARNING","isSingleCell","IS_SINGLE_CELL","containsZeroSpan","ZERO_SPAN_WARNING","populationArgumentsList","validateSetting","rangeEnd","mergeRange","bulkPopulationData","getBulkCollectionData","populationDataRange","getBulkCollectionDataRange","dataAtRange","newDataAtRange","mergedCellArguments","mergedCellRowIndex","mergedCellColumnIndex","mergedCellData","mergedCellRow","mergedCellElement","mergedCellColumn","newMergedCellInfo","auto","currentRange","toggleMerge","unmergeRange","preventPopulation","mergeParent","clearedData","populationInfo","canMergeRange","clearedValue","mergedCellAdded","mergedCells","getWithinRange","currentCollection","mergedCellCoversWholeRange","mergeSelection","group","currentlySelectedRange","newDelta","nextPosition","currentPosition","mergedParent","mergeTopLeft","mergeBottomRight","nextParentIsMerged","currentSelectionRange","newSelectionRange","getUpdatedSelectionRange","tempDelta","mergedCellsWithinRange","snapDelta","rangeExpanded","cellInfo","mergedCellRange","expandByRange","drag","correctSelectionAreaSize","dragDirection","dragAreaOverlapsCollections","mergedCellsWithinSelectionArea","snapDragArea","shiftCollections","recreateAfterDataPopulation","mergedCellAtCoords","goingDown","goingUp","goingLeft","goingRight","mergedCellOnBottomEdge","mergedCellOnTopEdge","mergedCellOnRightEdge","mergedCellOnLeftEdge","getSelectedMergedCellClassName","getSelectedMergedCellClassNameToRemove","MergedCellsCollection","countPartials","foundMergedCells","mergedCellTopLeft","mergedCellBottomRight","alreadyExists","isOverlapping","normalize","IS_OVERLAPPING_WARNING","wantedCollection","wantedCollectionIndex","mergedCellParentsToClear","hiddenCollectionElements","mergedCellParents","hiddenCollectionElement","currentMerge","AutofillCalculations","currentFillData","selectionArea","finalArea","baseArea","dragArea","newDragArea","fillSize","getAutofillSize","baseAreaStartRow","baseAreaStartColumn","baseAreaEndRow","baseAreaEndColumn","verticalDirection","fullCycle","fulls","partials","farthestCollection","getFarthestCollection","newLimit","updateCurrentFillCache","cycleLength","updateObject","dragAreaStartRow","dragAreaStartColumn","dragAreaEndRow","dragAreaEndColumn","mergedCellArray","baseStart","inclusionFunctionName","endOfDragRecreationIndex","isFarther","fillRange","getRangeFromChanges","inBounds","multiplier","fullArea","getDragArea","dragRange","SelectionCalculations","fullySelectedMergedCellClassName","newColumn","jumpOverMergedCell","flatDelta","includesIndex","firstIndex","lastIndex","includesVertically","includesHorizontally","oldSelectionRange","isMergedCellParent","isMergedParent","isMergeCellFullySelected","selectionRangesArray","mergedCellIndividualCoords","insideSelections","toggleMergeItem","toggleMergeOnSelection","dragged","lastSetCell","removeFromDragged","entryPosition","touchStartRange","endTarget","targetCoords","rangeWidth","rangeHeight","rangeDirection","newRangeCoords","touches","getCurrentRangeCoords","currentTouch","touchStartDirection","currentDirection","draggedHandle","bottomLeftCorner","topRightCorner","_exposePublicApi","onDataChange","onAfterTableAlter","_deletePublicApi","isPaused","sourceName","actions","pause","resume","setObservedData","pauseObservingChanges","resumeObservingChanges","isPausedObservingChanges","DataObserver","observedData","paused","cleanPatches","parsePath","newOrRemovedColumns","DEFAULT_SEARCH_RESULT_CLASS","DEFAULT_CALLBACK","testResult","isSearchResult","DEFAULT_QUERY_METHOD","queryMethod","searchResultClass","searchSettings","updatePluginSettings","onBeforeRenderer","beforeRendererCallback","queryStr","getCallback","getQueryMethod","queryResult","cellCallback","cellQueryMethod","singleResult","newCallback","newQueryMethod","newElementClass","setSearchResultClass","setQueryMethod","classArray","scrollbars","clones","lockedCollection","onAfterRender","scrollbar","doneActions","undoneActions","ignoreNewActions","ChangeAction","CreateRowAction","originalData","removedData","RemoveRowAction","CreateColumnAction","origRow","columnsMap","__arrayMap","RemoveColumnAction","CellAlignmentAction","conditionsStack","FiltersAction","movedRows","RowMoveAction","MergeCellsAction","UnmergeCellsAction","actionClone","continueAction","Action","actionType","undoneCallback","emptyRowsAtTheEnd","emptyColsAtTheEnd","onFinishCallback","redoneCallback","columnPositions","ascendingIndexes","sortByIndexes","sortedData","sortedHeaders","onAfterSetDataAtCell","recalculateFull","conditionCollection","importAllConditions","rangeData","mergeCellsPlugin","mod","newTarget","newRows","pluginEnabled","exposeUndoRedoMethods","removeExposedUndoRedoMethods","clearUndo"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA;;;;;;;;;;;;QCnDgBA,S,GAAAA,S;QA+BAC,O,GAAAA,O;QAwBAC,W,GAAAA,W;QA+BAC,S,GAAAA,S;QA0BAC,0B,GAAAA,0B;QAmCAC,W,GAAAA,W;QAWAC,a,GAAAA,a;QAcAC,K,GAAAA,K;QAoBAC,sB,GAAAA,sB;QAgJAC,Q,GAAAA,Q;QAUAC,Q,GAAAA,Q;QAUAC,W,GAAAA,W;QAIAC,e,GAAAA,e;QAsBAC,K,GAAAA,K;QAcAC,a,GAAAA,a;QAeAC,a,GAA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,SAAS,MAAT;AACAA,SAAS,SAAT;AACAA,SAAS,MAAT;;AAEA;;;;;;AAMA,SAASK,QAAT,CAAkB9N,IAAlB,EAAwB;AACtB,MAAI,OAAOA,IAAP,KAAgB,UAApB,EAAgC;AAC9B,WAAOA,IAAP;AACD;AACD,MAAI,CAAC2N,QAAQ3N,IAAR,CAAL,EAAoB;AAClB,UAAMhL,gDAA8CgL,IAA9C,YAAN;AACD;;AAED,SAAO0N,QAAQ1N,IAAR,CAAP;AACD;;QAGawa,iB,GAAZ/M,Q;QACYgN,Y,GAAZ3M,Q;QACW4M,Y,GAAX/M,O;QACYgN,2B,GAAZ/M,Q;QACagN,uB,GAAb/M,S;;;;;;AC1CF,uBAAuB;AACvB;AACA;AACA;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;AACA,CAAC;AACD;AACA,CAAC;;;;;;;AC9BD;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACnBA;AACA;AACA;AACA;AACA;;;;;;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD;AACjD,CAAC;AACD;AACA,qBAAqB;AACrB;AACA,SAAS;AACT,GAAG,EAAE;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;ACpDA;;AAIA;;AACA;;AACA;;;;AACA;;;;;;;;AAEA,IAAMgN,qBA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,GA7BgB;;;AA+BjB;;;AAGA8K,iBAlCiB,6BAkCC;AAChB,SAAKH,WAAL,GAAmB,EAAnB;AACD;AApCgB,CAAnB;;AAuCA,0BAAaD,UAAb,EAAyB,YAAzB,EAAuC7uB,UAAvC,EAAmD;AACjDgB,YAAU,KADuC;AAEjDC,cAAY;AAFqC,CAAnD;;kBAKe4tB,U;;;;;;ACtDf;AACA;AACA;AACA;AACA;AACA;;;;;;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACNA;AACA;AACA;AACA;AACA;;;;;;;ACJA;AACA;AACA;AACA;;;;;;;ACHA;AACA;AACA;AACA,GAAG;AACH;;;;;;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,iBAAiB,EAAE;AAC1D;AACA;AACA;AACA;AACA;AACA,mEAAmE,gBAAgB;AACnF;AACA;AACA,GAAG,4CAA4C,gCAAgC;AAC/E;AACA;AACA;AACA;AACA;AACA;;;;;;;ACxBA;;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA,OAAO,mCAAmC,gCAAgC,aAAa;AACvF,8BAA8B,mCAAmC,aAAa;AAC9E;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,qDAAqD;AACrD;AACA,kDAAkD,iBAAiB,EAAE;AACrE;AACA,wDAAwD,aAAa,EAAE,EAAE;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;;;;;;;ACpFA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA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ACD;;AAED,SAAO,uBAAUE,4BAA4BF,YAA5B,CAAV,CAAP;AACD;;AAED;;;;;;;AAOA,SAASU,WAAT,CAAqBV,YAArB,EAAmC;AACjC,SAAOG,4BAA4BH,YAA5B,CAAP;AACD;;AAED;;;;;AAKA,SAASW,kBAAT,GAA8B;AAC5B;AACD;;AAED;;;;;;;AAOA,SAASH,wBAAT,CAAkCR,YAAlC,EAAgDO,UAAhD,EAA4D;AAC1D,MAAIP,iBAAiBD,qBAArB,EAA4C;AAC1C,sCAAsBQ,UAAtB,EAAkCL,4BAA4BH,qBAA5B,CAAlC;AACD;AACF;;AAED;;;;;AAKA,SAASa,YAAT,GAAwB;AACtB,SAAOR,gCAAP;AACD;;QAGqBS,0B,GAApBR,gB;QACeS,qB,GAAfL,W;QACeM,qB,GAAfL,W;QACsBM,4B,GAAtBL,kB;QACgBM,wB,GAAhBL,Y;QACAb,qB,GAAAA,qB;;AAGF;;;;AAGAM,iC;;;;;;ACxGA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACXA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;;;;;;ACxCA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACLA;AACA;AACA;AACA;AACA;;;;;;;ACJA;AACA;AACA,kDAAkD;AAClD;AACA,uCAAuC;AACvC;;;;;;;ACLA;AACA;AACA;AACA;;;;;;;ACHA;AACA;;AAEA;AACA;AACA,iCAAiC,qBAAqB;AACtD;AACA,iCAAiC,SAAS,EAAE;AAC5C,CAAC,YAAY;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,SAAS,qBAAqB;AAC3D,iCAAiC,aAAa;AAC9C;AACA,GAAG,YAAY;AACf;AACA;;;;;;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACnFA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;ACNA,sBAAsB;AACtB;AACA;;AAEA;AACA;AACA;AACA;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,KAAK,YAAY;AACjB,GAAG;AACH;;;;;;;;ACXA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;ACPA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC,cAAc;AACd,iBAAiB;AACjB;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;;AAEA;AACA;AACA;;;;;;;;;;;;;;ACjCA;;;;;;;;AAEA;;;;;IAKM3tB,S;AACJ;;;;;;;AAOA,qBAAYwuB,SAAZ,EAAyD;AAAA,QAAlC5yB,IAAkC,uEAA3B4yB,SAA2B;AAAA,QAAhBla,EAAgB,uEAAXka,SAAW;;AAAA;;AACvD,SAAKA,SAAL,GAAiBA,SAAjB;AACA,SAAK5yB,IAAL,GAAYA,IAAZ;AACA,SAAK0Y,EAAL,GAAUA,EAA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;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC,qBAAqB;AACrB,0BAA0B;AAC1B,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;;;;;;AC/IA;AACA,qEAAsE,mBAAmB,UAAU,EAAE,EAAE;AACvG,CAAC;;;;;;;ACFD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AChBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,YAAY,eAAe;AAChC;AACA,KAAK;AACL;AACA;;;;;;;ACtBA;AACA;;;;;;;ACDA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;;;;;;ACXA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACPA;AACA;AACA;AACA;AACA,2BAA2B,kBAAkB,EAAE;;AAE/C;AACA;AACA;AACA;AACA,GAAG,YAAY;AACf;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C;AAC9C;AACA;AACA;;AAEA,8BAA8B,aAAa;;AAE3C;AACA;AACA;AACA;AACA;AACA,yCAAyC,oCAAoC;AAC7E,6CAA6C,oCAAoC;AACjF,KAAK,4BAA4B,oCAAoC;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,mBAAmB;AACnC;AACA;AACA,kCAAkC,2BAA2B;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;;;;;;ACpEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;;;;;ACZA;AACA,UAAU;AACV;;;;;;;;ACFA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,sBAAsB,aAAa;AACnC,GAAG;AACH;;;;;;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD;AAClD;AACA;AACA;AACA;AACA;AACA,OAAO,YAAY,cAAc;AACjC;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,GAAG;AACR;AACA;;;;;;;;ACxBA;AACA;AACA;AACA;;AAEA;AACA;AACA,yBAAyB,mEAAmE;AAC5F,CAAC;AACD;AACA;AACA;AACA;AACA,CAAC;;;;;;;;ACbD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,uBAAuB,4EAA4E,EAAE;AACrG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL,GAAG;AACH;;;;;;;AC1DA;AACA;AACA;AACA;AACA;;;;;;;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,UAAU,EAAE;AAChD,mBAAmB,sCAAsC;AACzD,CAAC,qCAAqC;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,CAAC;;;;;;;;ACjCD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,qBAAqB;AACrB,0BAA0B;AAC1B;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;;;;;;;ACpFA;AACA;AACA;AACA;;AAEA;AACA;AACA,6BAA6B,mEAAmE;AAChG,CAAC;AACD;AACA;AACA;AACA;AACA,CAAC;;;;;;;;ACbD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;;AAEA;AACA;AACA;AACA;AACA,+CAA+C;AAC/C;AACA;AACA;AACA;AACA,GAAG,YAAY;AACf,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,WAAW;AACX,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA,6CAA6C;AAC7C;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,mBAAmB,kCAAkC;AACrD,SAAS;AACT;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,eAAe,uCAAuC;AACtD;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA,uBAAuB,0BAA0B;AACjD;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA;AACA,GAAG;AACH,kBAAkB,yBAAyB,KAAK;AAChD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,wBAAwB;AACxB,gBAAgB;AAChB,oBAAoB;AACpB,wBAAwB;AACxB,gBAAgB;AAChB,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,0DAA0D,oBAAoB;AAC9E;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA,CAAC;;;;;;;;ACpRD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,sBAAsB;AACtB,sBAAsB,uBAAuB,WAAW,IAAI;AAC5D,GAAG;AACH,CAAC;AACD;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;AACD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D;AAC3D;AACA,KAAK;AACL;AACA,sBAAsB,mCAAmC;AACzD,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gEAAgE,gCAAgC;AAChG;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,0DAA0D,kBAAkB;;AAE5E;AACA;AACA;AACA,oBAAoB,uBAAuB;;AAE3C,oDAAoD,6BAA6B;;AAEjF;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH,0BAA0B,eAAe,EAAE;AAC3C,0BAA0B,gBAAgB;AAC1C,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,OAAO,QAAQ,iCAAiC;AACpG,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,wEAAwE;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACzOA;;;;;;;ACAA;AACA;AACA;AACA,iBAAiB;;AAEjB;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;;;;;;AClBA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;;;;;;ACRD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;;;;;;ACRD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;;;;;;ACRD;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;;;;;;ACPD;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;;;;;;ACPD;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;;;;;;ACPD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;;;;;;ACRD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;;;;;;ACRD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;;;;;;ACRD;AACA;AACA;AACA,CAAC;;;;;;;ACHD;AACA;;AAEA,0CAA0C,mCAAsC;;;;;;;ACHhF;AACA;AACA,8BAA8B,+BAA+B;;;;;;;ACF7D;AACA;AACA,8BAA8B,+CAA8C;;;;;;;ACF5E;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,CAAC;;;;;;;ACfD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC;;;;;;;ACjBD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,4CAA4C;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC;;;;;;;;ACtBD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;ACRD;;AAEA;AACA;AACA;AACA,CAAC;;;;;;;;ACLD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,QAAQ,MAAM;AACd;AACA;;;;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;ACjBD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;ACnBD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;ACXD;AACA;AACA;AACA;AACA,CAAC;;;;;;;ACJD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,CAAC;;;;;;;ACTD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,CAAC;;;;;;;ACXD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,2BAA2B;AAClD,WAAW;AACX;AACA;AACA;AACA;AACA;AACA,mFAAmF;AACnF;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,CAAC;;;;;;;ACtED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,CAAC;;;;;;;;ACTD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,0EAA4E,kBAAkB,EAAE;AAChG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,gCAAgC;AACvF;AACA;AACA,KAAK;AACL;AACA,kCAAkC,gBAAgB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;ACpCD;AACA;AACA;;AAEA;AACA;AACA,gBAAgB;AAChB;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;AClBD;AACA;;AAEA,6BAA6B,uCAA8C;;AAE3E;;;;;;;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,gBAAgB,EAAE;AAC5D;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,gBAAgB,EAAE;AAC5D;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;ACbA;AACA;;AAEA,6BAA6B,iCAAiC;;AAE9D;;;;;;;ACLA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;;;;;;ACRD;AACA;;AAEA,8BAA8B,sCAAsC;;;;;;;ACHpE;AACA;AACA;AACA;AACA;AACA;;;;;;;ACLA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;;;;;;ACTD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;ACRD;AACA;;AAEA,8BAA8B,4BAA4B;;;;;;;ACH1D;AACA;;AAEA,8BAA8B,sCAAsC;;;;;;;ACHpE;AACA;;AAEA,8BAA8B,qCAAqC;;;;;;;;ACHnE;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;AAED;;;;;;;ACXA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;;;;;;ACRD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;;;;;;ACfA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;;;;;;ACRD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;ACrBD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;ACXD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACfA;AACA;;AAEA;;;;;;;;ACHA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;ACXD;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;ACLD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,oDAAoD,wBAAwB;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;ACzDA,IAAMliC,cAAc,IAAIlB,OAAJ,EAApB;;AAEA;;;;;;;IAMMhK,yB;;;;AACJ;;;;;wBAK2B;AACzB,aAAO,EAAP;AACD;;AAED;;;;;;;;;;;;;AAUA,qCAAY4uC,aAAZ,EAA2BC,YAA3B,EAAyCrB,YAAzC,EAAuDsB,aAAvD,EAAsEC,UAAtE,EAAkFC,gBAAlF,EAAoGC,Q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Ab,CAAqBr3D,UAArB,IAAmCK,MAAnC;AACD;AACF,CARD;;AAUAk3D,aAAaF,OAAb,CAAqBt3D,cAArB;;AAEAw3D,aAAaqB,SAAb,GAAyB,EAAzB;AACArB,aAAaqB,SAAb,CAAuBC,cAAvB,GAAwCvB,SAAxC;AACAC,aAAaqB,SAAb,CAAuBv0C,qBAAvB;AACAkzC,aAAaqB,SAAb,CAAuBp0C,wBAAvB;AACA+yC,aAAaqB,SAAb,CAAuBx0C,0BAAvB;;AAEA;AACAmzC,aAAaqB,SAAb,CAAuBx8B,mBAAvB,GAA6C;AAAA,SAAa,qDAAb;AAAA,CAA7C;;kBAEem7B,Y;;;;;;ACpLf;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACZA;AACA;AACA;AACA;AACA;;AAEA;AACA,6FAAkF,aAAa,EAAE;;AAEjG;AACA,qDAAqD,4BAA4B;AACjF;AACA;;;;;;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;;;;;ACRA;AACA;;AAEA;AACA;AACA;;;;;;;ACLA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;;;;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;;;;;ACfA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,uCAAuC,sBAAsB,EAAE;AAC/D;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;;;;;;ACnEA;AACA;AACA,YAAY;AACZ,GAAG;AACH,YAAY;AACZ;AACA;;;;;;;ACNA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D,sBAAsB;AAChF,kFAAkF,wBAAwB;AAC1G;;;;;;;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;;;;;ACdA;AACA;AACA;AACA;AACA;;;;;;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACZA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;;;;;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACTA,yC;;;;;;ACAA,yC;;;;;;ACAA,yC;;;;;;;;;;;ACAA;;AACA;;;;;;;;;;;;AAEA;;;;;;IAMMnhE,Y;;;AACJ;;;AAGA,wBAAY2a,WAAZ,EAAyB;AAAA;;AAAA,4HACjBA,WADiB;;AAGvB,UAAKpe,KAAL,GAAa,MAAKmmE,SAAL,CAAe,eAAQhoD,WAAvB,CAAb;AACA,UAAKne,KAAL,CAAWiI,OAAX,CAAmBhF,MAAnB,CAA0BrL,KAA1B,CAAgCwuE,OAAhC,GAA0C,GAA1C;AACA,UAAKpmE,KAAL,CAAWiI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,IAAtB;AACAsC,KAAKxb,GAAL,CAAS,qBAAT,EAAgCkZ,IAAhC;;AAEAsC,KAAKlB,QAAL,CAAc,YAAd;AACAkB,KAAKlB,QAAL,CAAc,WAAd;AACAkB,KAAKlB,QAAL,CAAc,YAAd;AACAkB,KAAKlB,QAAL,CAAc,WAAd;;kBAEeotE,Q","file":"handsontable.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"moment\"), require(\"numbro\"), require(\"pikaday\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"Handsontable\", [\"moment\", \"numbro\", \"pikaday\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Handsontable\"] = factory(require(\"moment\"), require(\"numbro\"), require(\"pikaday\"));\n\telse\n\t\troot[\"Handsontable\"] = factory(root[\"moment\"], root[\"numbro\"], root[\"Pikaday\"]);\n})(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE_55__, __WEBPACK_EXTERNAL_MODULE_247__, __WEBPACK_EXTERNAL_MODULE_236__) {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 206);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap db0a363ab92eaa28636e","import {isIE8, isIE9, isSafari} from '../browser';\nimport {hasCaptionProblem} from '../feature';\n\n/**\n * Get the parent of the specified node in the DOM tree.\n *\n * @param {HTMLElement} element Element from which traversing is started.\n * @param {Number} [level=0] Traversing deep level.\n * @return {HTMLElement|null}\n */\nexport function getParent(element, level = 0) {\n let iteration = -1;\n let parent = null;\n\n while (element != null) {\n if (iteration === level) {\n parent = element;\n break;\n }\n\n if (element.host && element.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n element = element.host;\n\n } else {\n iteration++;\n element = element.parentNode;\n }\n }\n\n return parent;\n}\n\n/**\n * Goes up the DOM tree (including given element) until it finds an element that matches the nodes or nodes name.\n * This method goes up through web components.\n *\n * @param {HTMLElement} element Element from which traversing is started\n * @param {Array} nodes Array of elements or Array of elements name\n * @param {HTMLElement} [until]\n * @returns {HTMLElement|null}\n */\nexport function closest(element, nodes, until) {\n while (element != null && element !== until) {\n if (element.nodeType === Node.ELEMENT_NODE && (nodes.indexOf(element.nodeName) > -1 || nodes.indexOf(element) > -1)) {\n return element;\n }\n if (element.host && element.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n element = element.host;\n\n } else {\n element = element.parentNode;\n }\n }\n\n return null;\n}\n\n/**\n * Goes \"down\" the DOM tree (including given element) until it finds an element that matches the nodes or nodes name.\n *\n * @param {HTMLElement} element Element from which traversing is started\n * @param {Array} nodes Array of elements or Array of elements name\n * @param {HTMLElement} [until]\n * @returns {HTMLElement|null}\n */\nexport function closestDown(element, nodes, until) {\n const matched = [];\n\n while (element) {\n element = closest(element, nodes, until);\n\n if (!element || (until && !until.contains(element))) {\n break;\n }\n matched.push(element);\n\n if (element.host && element.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n element = element.host;\n\n } else {\n element = element.parentNode;\n }\n }\n const length = matched.length;\n\n return length ? matched[length - 1] : null;\n}\n\n/**\n * Goes up the DOM tree and checks if element is child of another element.\n *\n * @param child Child element\n * @param {Object|String} parent Parent element OR selector of the parent element.\n * If string provided, function returns `true` for the first occurrence of element with that class.\n * @returns {Boolean}\n */\nexport function isChildOf(child, parent) {\n var node = child.parentNode;\n var queriedParents = [];\n\n if (typeof parent === 'string') {\n queriedParents = Array.prototype.slice.call(document.querySelectorAll(parent), 0);\n } else {\n queriedParents.push(parent);\n }\n\n while (node != null) {\n if (queriedParents.indexOf(node) > -1) {\n return true;\n }\n node = node.parentNode;\n }\n\n return false;\n}\n\n/**\n * Check if an element is part of `hot-table` web component.\n *\n * @param {Element} element\n * @returns {Boolean}\n */\nexport function isChildOfWebComponentTable(element) {\n var hotTableName = 'hot-table',\n result = false,\n parentNode;\n\n parentNode = polymerWrap(element);\n\n function isHotTable(element) {\n return element.nodeType === Node.ELEMENT_NODE && element.nodeName === hotTableName.toUpperCase();\n }\n\n while (parentNode != null) {\n if (isHotTable(parentNode)) {\n result = true;\n break;\n } else if (parentNode.host && parentNode.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n result = isHotTable(parentNode.host);\n\n if (result) {\n break;\n }\n parentNode = parentNode.host;\n }\n parentNode = parentNode.parentNode;\n }\n\n return result;\n}\n\n/**\n * Wrap element into polymer/webcomponent container if exists\n *\n * @param element\n * @returns {*}\n */\nexport function polymerWrap(element) {\n /* global Polymer */\n return typeof Polymer !== 'undefined' && typeof wrap === 'function' ? wrap(element) : element;\n}\n\n/**\n * Unwrap element from polymer/webcomponent container if exists\n *\n * @param element\n * @returns {*}\n */\nexport function polymerUnwrap(element) {\n /* global Polymer */\n return typeof Polymer !== 'undefined' && typeof unwrap === 'function' ? unwrap(element) : element;\n}\n\n/**\n * Counts index of element within its parent\n * WARNING: for performance reasons, assumes there are only element nodes (no text nodes). This is true for Walkotnable\n * Otherwise would need to check for nodeType or use previousElementSibling\n *\n * @see http://jsperf.com/sibling-index/10\n * @param {Element} element\n * @return {Number}\n */\nexport function index(element) {\n var i = 0;\n\n if (element.previousSibling) {\n /* eslint-disable no-cond-assign */\n while (element = element.previousSibling) {\n ++i;\n }\n }\n\n return i;\n}\n\n/**\n * Check if the provided overlay contains the provided element\n *\n * @param {String} overlay\n * @param {HTMLElement} element\n * @returns {boolean}\n */\nexport function overlayContainsElement(overlayType, element) {\n let overlayElement = document.querySelector(`.ht_clone_${overlayType}`);\n return overlayElement ? overlayElement.contains(element) : null;\n}\n\nvar classListSupport = !!document.documentElement.classList;\nvar _hasClass,\n _addClass,\n _removeClass;\n\nfunction filterEmptyClassNames(classNames) {\n const result = [];\n\n if (!classNames || !classNames.length) {\n return result;\n }\n\n let len = 0;\n\n while (classNames[len]) {\n result.push(classNames[len]);\n len++;\n }\n\n return result;\n}\n\nif (classListSupport) {\n var isSupportMultipleClassesArg = (function() {\n var element = document.createElement('div');\n\n element.classList.add('test', 'test2');\n\n return element.classList.contains('test2');\n }());\n\n _hasClass = function _hasClass(element, className) {\n if (element.classList === void 0 || typeof className !== 'string' || className === '') {\n return false;\n }\n\n return element.classList.contains(className);\n };\n\n _addClass = function _addClass(element, className) {\n if (typeof className === 'string') {\n className = className.split(' ');\n }\n\n className = filterEmptyClassNames(className);\n\n if (className.length > 0) {\n if (isSupportMultipleClassesArg) {\n element.classList.add.apply(element.classList, className);\n\n } else {\n let len = 0;\n\n while (className && className[len]) {\n element.classList.add(className[len]);\n len++;\n }\n }\n }\n };\n\n _removeClass = function _removeClass(element, className) {\n if (typeof className === 'string') {\n className = className.split(' ');\n }\n\n className = filterEmptyClassNames(className);\n\n if (className.length > 0) {\n if (isSupportMultipleClassesArg) {\n element.classList.remove.apply(element.classList, className);\n\n } else {\n let len = 0;\n\n while (className && className[len]) {\n element.classList.remove(className[len]);\n len++;\n }\n }\n }\n };\n\n} else {\n var createClassNameRegExp = function createClassNameRegExp(className) {\n return new RegExp(`(\\\\s|^)${className}(\\\\s|$)`);\n };\n\n _hasClass = function _hasClass(element, className) {\n // http://snipplr.com/view/3561/addclass-removeclass-hasclass/\n return element.className !== void 0 && createClassNameRegExp(className).test(element.className);\n };\n\n _addClass = function _addClass(element, className) {\n var len = 0,\n _className = element.className;\n\n if (typeof className === 'string') {\n className = className.split(' ');\n }\n if (_className === '') {\n _className = className.join(' ');\n\n } else {\n while (className && className[len]) {\n if (!createClassNameRegExp(className[len]).test(_className)) {\n _className += ` ${className[len]}`;\n }\n len++;\n }\n }\n element.className = _className;\n };\n\n _removeClass = function _removeClass(element, className) {\n var len = 0,\n _className = element.className;\n\n if (typeof className === 'string') {\n className = className.split(' ');\n }\n while (className && className[len]) {\n // String.prototype.trim is defined in polyfill.js\n _className = _className.replace(createClassNameRegExp(className[len]), ' ').trim();\n len++;\n }\n if (element.className !== _className) {\n element.className = _className;\n }\n };\n}\n\n/**\n * Checks if element has class name\n *\n * @param {HTMLElement} element\n * @param {String} className Class name to check\n * @returns {Boolean}\n */\nexport function hasClass(element, className) {\n return _hasClass(element, className);\n}\n\n/**\n * Add class name to an element\n *\n * @param {HTMLElement} element\n * @param {String|Array} className Class name as string or array of strings\n */\nexport function addClass(element, className) {\n return _addClass(element, className);\n}\n\n/**\n * Remove class name from an element\n *\n * @param {HTMLElement} element\n * @param {String|Array} className Class name as string or array of strings\n */\nexport function removeClass(element, className) {\n return _removeClass(element, className);\n}\n\nexport function removeTextNodes(element, parent) {\n if (element.nodeType === 3) {\n parent.removeChild(element); // bye text nodes!\n\n } else if (['TABLE', 'THEAD', 'TBODY', 'TFOOT', 'TR'].indexOf(element.nodeName) > -1) {\n var childs = element.childNodes;\n for (var i = childs.length - 1; i >= 0; i--) {\n removeTextNodes(childs[i], element);\n }\n }\n}\n\n/**\n * Remove childs function\n * WARNING - this doesn't unload events and data attached by jQuery\n * http://jsperf.com/jquery-html-vs-empty-vs-innerhtml/9\n * http://jsperf.com/jquery-html-vs-empty-vs-innerhtml/11 - no siginificant improvement with Chrome remove() method\n *\n * @param element\n * @returns {void}\n */\n//\nexport function empty(element) {\n var child;\n /* eslint-disable no-cond-assign */\n while (child = element.lastChild) {\n element.removeChild(child);\n }\n}\n\nexport const HTML_CHARACTERS = /(<(.*)>|&(.*);)/;\n\n/**\n * Insert content into element trying avoid innerHTML method.\n * @return {void}\n */\nexport function fastInnerHTML(element, content) {\n if (HTML_CHARACTERS.test(content)) {\n element.innerHTML = content;\n } else {\n fastInnerText(element, content);\n }\n}\n\n/**\n * Insert text content into element\n * @return {void}\n */\n\nvar textContextSupport = !!document.createTextNode('test').textContent;\n\nexport function fastInnerText(element, content) {\n var child = element.firstChild;\n\n if (child && child.nodeType === 3 && child.nextSibling === null) {\n // fast lane - replace existing text node\n\n if (textContextSupport) {\n // http://jsperf.com/replace-text-vs-reuse\n child.textContent = content;\n } else {\n // http://jsperf.com/replace-text-vs-reuse\n child.data = content;\n }\n } else {\n // slow lane - empty element and insert a text node\n empty(element);\n element.appendChild(document.createTextNode(content));\n }\n}\n\n/**\n * Returns true if element is attached to the DOM and visible, false otherwise\n * @param elem\n * @returns {boolean}\n */\nexport function isVisible(elem) {\n var next = elem;\n\n while (polymerUnwrap(next) !== document.documentElement) { // until <html> reached\n if (next === null) { // parent detached from DOM\n return false;\n } else if (next.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n if (next.host) { // this is Web Components Shadow DOM\n // see: http://w3c.github.io/webcomponents/spec/shadow/#encapsulation\n // according to spec, should be if (next.ownerDocument !== window.document), but that doesn't work yet\n if (next.host.impl) { // Chrome 33.0.1723.0 canary (2013-11-29) Web Platform features disabled\n return isVisible(next.host.impl);\n\n } else if (next.host) { // Chrome 33.0.1723.0 canary (2013-11-29) Web Platform features enabled\n return isVisible(next.host);\n\n }\n throw new Error('Lost in Web Components world');\n\n } else {\n return false; // this is a node detached from document in IE8\n }\n } else if (next.style.display === 'none') {\n return false;\n }\n next = next.parentNode;\n }\n\n return true;\n}\n\n/**\n * Returns elements top and left offset relative to the document. Function is not compatible with jQuery offset.\n *\n * @param {HTMLElement} elem\n * @return {Object} Returns object with `top` and `left` props\n */\nexport function offset(elem) {\n var offsetLeft,\n offsetTop,\n lastElem,\n docElem,\n box;\n\n docElem = document.documentElement;\n\n if (hasCaptionProblem() && elem.firstChild && elem.firstChild.nodeName === 'CAPTION') {\n // fixes problem with Firefox ignoring <caption> in TABLE offset (see also export outerHeight)\n // http://jsperf.com/offset-vs-getboundingclientrect/8\n box = elem.getBoundingClientRect();\n\n return {\n top: box.top + (window.pageYOffset || docElem.scrollTop) - (docElem.clientTop || 0),\n left: box.left + (window.pageXOffset || docElem.scrollLeft) - (docElem.clientLeft || 0)\n };\n }\n offsetLeft = elem.offsetLeft;\n offsetTop = elem.offsetTop;\n lastElem = elem;\n\n /* eslint-disable no-cond-assign */\n while (elem = elem.offsetParent) {\n // from my observation, document.body always has scrollLeft/scrollTop == 0\n if (elem === document.body) {\n break;\n }\n offsetLeft += elem.offsetLeft;\n offsetTop += elem.offsetTop;\n lastElem = elem;\n }\n\n // slow - http://jsperf.com/offset-vs-getboundingclientrect/6\n if (lastElem && lastElem.style.position === 'fixed') {\n // if(lastElem !== document.body) { //faster but does gives false positive in Firefox\n offsetLeft += window.pageXOffset || docElem.scrollLeft;\n offsetTop += window.pageYOffset || docElem.scrollTop;\n }\n\n return {\n left: offsetLeft,\n top: offsetTop\n };\n}\n\n/**\n * Returns the document's scrollTop property.\n *\n * @returns {Number}\n */\nexport function getWindowScrollTop() {\n var res = window.scrollY;\n\n if (res === void 0) { // IE8-11\n res = document.documentElement.scrollTop;\n }\n\n return res;\n}\n\n/**\n * Returns the document's scrollLeft property.\n *\n * @returns {Number}\n */\nexport function getWindowScrollLeft() {\n var res = window.scrollX;\n\n if (res === void 0) { // IE8-11\n res = document.documentElement.scrollLeft;\n }\n\n return res;\n}\n\n/**\n * Returns the provided element's scrollTop property.\n *\n * @param element\n * @returns {Number}\n */\nexport function getScrollTop(element) {\n if (element === window) {\n return getWindowScrollTop();\n }\n return element.scrollTop;\n\n}\n\n/**\n * Returns the provided element's scrollLeft property.\n *\n * @param element\n * @returns {Number}\n */\nexport function getScrollLeft(element) {\n if (element === window) {\n return getWindowScrollLeft();\n }\n return element.scrollLeft;\n}\n\n/**\n * Returns a DOM element responsible for scrolling of the provided element.\n *\n * @param {HTMLElement} element\n * @returns {HTMLElement} Element's scrollable parent\n */\nexport function getScrollableElement(element) {\n var el = element.parentNode,\n props = ['auto', 'scroll'],\n overflow,\n overflowX,\n overflowY,\n computedStyle = '',\n computedOverflow = '',\n computedOverflowY = '',\n computedOverflowX = '';\n\n while (el && el.style && document.body !== el) {\n overflow = el.style.overflow;\n overflowX = el.style.overflowX;\n overflowY = el.style.overflowY;\n\n if (overflow == 'scroll' || overflowX == 'scroll' || overflowY == 'scroll') {\n return el;\n\n } else if (window.getComputedStyle) {\n computedStyle = window.getComputedStyle(el);\n computedOverflow = computedStyle.getPropertyValue('overflow');\n computedOverflowY = computedStyle.getPropertyValue('overflow-y');\n computedOverflowX = computedStyle.getPropertyValue('overflow-x');\n\n if (computedOverflow === 'scroll' || computedOverflowX === 'scroll' || computedOverflowY === 'scroll') {\n return el;\n }\n }\n\n // The '+ 1' after the scrollHeight/scrollWidth is to prevent problems with zoomed out Chrome.\n if (el.clientHeight <= el.scrollHeight + 1 && (props.indexOf(overflowY) !== -1 || props.indexOf(overflow) !== -1 ||\n props.indexOf(computedOverflow) !== -1 || props.indexOf(computedOverflowY) !== -1)) {\n return el;\n }\n if (el.clientWidth <= el.scrollWidth + 1 && (props.indexOf(overflowX) !== -1 || props.indexOf(overflow) !== -1 ||\n props.indexOf(computedOverflow) !== -1 || props.indexOf(computedOverflowX) !== -1)) {\n return el;\n }\n el = el.parentNode;\n }\n\n return window;\n}\n\n/**\n * Returns a DOM element responsible for trimming the provided element.\n *\n * @param {HTMLElement} base Base element\n * @returns {HTMLElement} Base element's trimming parent\n */\nexport function getTrimmingContainer(base) {\n var el = base.parentNode;\n\n while (el && el.style && document.body !== el) {\n if (el.style.overflow !== 'visible' && el.style.overflow !== '') {\n return el;\n\n } else if (window.getComputedStyle) {\n var computedStyle = window.getComputedStyle(el);\n\n if (computedStyle.getPropertyValue('overflow') !== 'visible' && computedStyle.getPropertyValue('overflow') !== '') {\n return el;\n }\n }\n\n el = el.parentNode;\n }\n\n return window;\n}\n\n/**\n * Returns a style property for the provided element. (Be it an inline or external style).\n *\n * @param {HTMLElement} element\n * @param {String} prop Wanted property\n * @returns {String|undefined} Element's style property\n */\nexport function getStyle(element, prop) {\n /* eslint-disable */\n if (!element) {\n return;\n\n } else if (element === window) {\n if (prop === 'width') {\n return window.innerWidth + 'px';\n\n } else if (prop === 'height') {\n return window.innerHeight + 'px';\n }\n\n return;\n }\n\n var\n styleProp = element.style[prop],\n computedStyle;\n\n if (styleProp !== '' && styleProp !== void 0) {\n return styleProp;\n\n } else {\n computedStyle = getComputedStyle(element);\n\n if (computedStyle[prop] !== '' && computedStyle[prop] !== void 0) {\n return computedStyle[prop];\n }\n }\n}\n\n/**\n * Returns a computed style object for the provided element. (Needed if style is declared in external stylesheet).\n *\n * @param element\n * @returns {IEElementStyle|CssStyle} Elements computed style object\n */\nexport function getComputedStyle(element) {\n return element.currentStyle || document.defaultView.getComputedStyle(element);\n}\n\n/**\n * Returns the element's outer width.\n *\n * @param element\n * @returns {number} Element's outer width\n */\nexport function outerWidth(element) {\n return element.offsetWidth;\n}\n\n/**\n * Returns the element's outer height\n *\n * @param elem\n * @returns {number} Element's outer height\n */\nexport function outerHeight(elem) {\n if (hasCaptionProblem() && elem.firstChild && elem.firstChild.nodeName === 'CAPTION') {\n // fixes problem with Firefox ignoring <caption> in TABLE.offsetHeight\n // jQuery (1.10.1) still has this unsolved\n // may be better to just switch to getBoundingClientRect\n // http://bililite.com/blog/2009/03/27/finding-the-size-of-a-table/\n // http://lists.w3.org/Archives/Public/www-style/2009Oct/0089.html\n // http://bugs.jquery.com/ticket/2196\n // http://lists.w3.org/Archives/Public/www-style/2009Oct/0140.html#start140\n return elem.offsetHeight + elem.firstChild.offsetHeight;\n }\n\n return elem.offsetHeight;\n}\n\n/**\n * Returns the element's inner height.\n *\n * @param element\n * @returns {number} Element's inner height\n */\nexport function innerHeight(element) {\n return element.clientHeight || element.innerHeight;\n}\n\n/**\n * Returns the element's inner width.\n *\n * @param element\n * @returns {number} Element's inner width\n */\nexport function innerWidth(element) {\n return element.clientWidth || element.innerWidth;\n}\n\nexport function addEvent(element, event, callback) {\n if (window.addEventListener) {\n element.addEventListener(event, callback, false);\n } else {\n element.attachEvent('on' + event, callback);\n }\n}\n\nexport function removeEvent(element, event, callback) {\n if (window.removeEventListener) {\n element.removeEventListener(event, callback, false);\n } else {\n element.detachEvent('on' + event, callback);\n }\n}\n\n/**\n * Returns caret position in text input\n *\n * @author http://stackoverflow.com/questions/263743/how-to-get-caret-position-in-textarea\n * @return {Number}\n */\nexport function getCaretPosition(el) {\n if (el.selectionStart) {\n return el.selectionStart;\n\n } else if (document.selection) { // IE8\n el.focus();\n\n let r = document.selection.createRange();\n\n if (r == null) {\n return 0;\n }\n let re = el.createTextRange();\n let rc = re.duplicate();\n\n re.moveToBookmark(r.getBookmark());\n rc.setEndPoint('EndToStart', re);\n\n return rc.text.length;\n }\n\n return 0;\n}\n\n/**\n * Returns end of the selection in text input\n *\n * @return {Number}\n */\nexport function getSelectionEndPosition(el) {\n if (el.selectionEnd) {\n return el.selectionEnd;\n\n } else if (document.selection) { // IE8\n let r = document.selection.createRange();\n\n if (r == null) {\n return 0;\n }\n let re = el.createTextRange();\n\n return re.text.indexOf(r.text) + r.text.length;\n }\n\n return 0;\n}\n\n/**\n * Returns text under selection.\n *\n * @returns {String}\n */\nexport function getSelectionText() {\n let text = '';\n\n if (window.getSelection) {\n text = window.getSelection().toString();\n } else if (document.selection && document.selection.type !== 'Control') {\n text = document.selection.createRange().text;\n }\n\n return text;\n}\n\n/**\n * Sets caret position in text input.\n *\n * @author http://blog.vishalon.net/index.php/javascript-getting-and-setting-caret-position-in-textarea/\n * @param {Element} element\n * @param {Number} pos\n * @param {Number} endPos\n */\nexport function setCaretPosition(element, pos, endPos) {\n if (endPos === void 0) {\n endPos = pos;\n }\n if (element.setSelectionRange) {\n element.focus();\n\n try {\n element.setSelectionRange(pos, endPos);\n } catch (err) {\n var elementParent = element.parentNode;\n var parentDisplayValue = elementParent.style.display;\n elementParent.style.display = 'block';\n element.setSelectionRange(pos, endPos);\n elementParent.style.display = parentDisplayValue;\n }\n } else if (element.createTextRange) { // IE8\n var range = element.createTextRange();\n range.collapse(true);\n range.moveEnd('character', endPos);\n range.moveStart('character', pos);\n range.select();\n }\n}\n\nvar cachedScrollbarWidth;\n\n// http://stackoverflow.com/questions/986937/how-can-i-get-the-browsers-scrollbar-sizes\nfunction walkontableCalculateScrollbarWidth() {\n var inner = document.createElement('div');\n inner.style.height = '200px';\n inner.style.width = '100%';\n\n var outer = document.createElement('div');\n outer.style.boxSizing = 'content-box';\n outer.style.height = '150px';\n outer.style.left = '0px';\n outer.style.overflow = 'hidden';\n outer.style.position = 'absolute';\n outer.style.top = '0px';\n outer.style.width = '200px';\n outer.style.visibility = 'hidden';\n outer.appendChild(inner);\n\n (document.body || document.documentElement).appendChild(outer);\n var w1 = inner.offsetWidth;\n outer.style.overflow = 'scroll';\n var w2 = inner.offsetWidth;\n if (w1 == w2) {\n w2 = outer.clientWidth;\n }\n\n (document.body || document.documentElement).removeChild(outer);\n\n return (w1 - w2);\n}\n\n/**\n * Returns the computed width of the native browser scroll bar.\n *\n * @return {Number} width\n */\nexport function getScrollbarWidth() {\n if (cachedScrollbarWidth === void 0) {\n cachedScrollbarWidth = walkontableCalculateScrollbarWidth();\n }\n\n return cachedScrollbarWidth;\n}\n\n/**\n * Checks if the provided element has a vertical scrollbar.\n *\n * @param {HTMLElement} element\n * @returns {Boolean}\n */\nexport function hasVerticalScrollbar(element) {\n return element.offsetWidth !== element.clientWidth;\n}\n\n/**\n * Checks if the provided element has a vertical scrollbar.\n *\n * @param {HTMLElement} element\n * @returns {Boolean}\n */\nexport function hasHorizontalScrollbar(element) {\n return element.offsetHeight !== element.clientHeight;\n}\n\n/**\n * Sets overlay position depending on it's type and used browser\n */\nexport function setOverlayPosition(overlayElem, left, top) {\n if (isIE8() || isIE9()) {\n overlayElem.style.top = top;\n overlayElem.style.left = left;\n } else if (isSafari()) {\n overlayElem.style['-webkit-transform'] = 'translate3d(' + left + ',' + top + ',0)';\n } else {\n overlayElem.style.transform = 'translate3d(' + left + ',' + top + ',0)';\n }\n}\n\nexport function getCssTransform(element) {\n var transform;\n\n if (element.style.transform && (transform = element.style.transform) !== '') {\n return ['transform', transform];\n\n } else if (element.style['-webkit-transform'] && (transform = element.style['-webkit-transform']) !== '') {\n\n return ['-webkit-transform', transform];\n }\n\n return -1;\n}\n\nexport function resetCssTransform(element) {\n if (element.style.transform && element.style.transform !== '') {\n element.style.transform = '';\n } else if (element.style['-webkit-transform'] && element.style['-webkit-transform'] !== '') {\n element.style['-webkit-transform'] = '';\n }\n}\n\n/**\n * Determines if the given DOM element is an input field.\n * Notice: By 'input' we mean input, textarea and select nodes\n *\n * @param {HTMLElement} element - DOM element\n * @returns {Boolean}\n */\nexport function isInput(element) {\n var inputs = ['INPUT', 'SELECT', 'TEXTAREA'];\n\n return element && (inputs.indexOf(element.nodeName) > -1 || element.contentEditable === 'true');\n}\n\n/**\n * Determines if the given DOM element is an input field placed OUTSIDE of HOT.\n * Notice: By 'input' we mean input, textarea and select nodes\n *\n * @param {HTMLElement} element - DOM element\n * @returns {Boolean}\n */\nexport function isOutsideInput(element) {\n return isInput(element) && element.className.indexOf('handsontableInput') == -1 && element.className.indexOf('copyPaste') == -1;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/helpers/dom/element.js","export function to2dArray(arr) {\n var i = 0,\n ilen = arr.length;\n\n while (i < ilen) {\n arr[i] = [arr[i]];\n i++;\n }\n}\n\nexport function extendArray(arr, extension) {\n var i = 0,\n ilen = extension.length;\n\n while (i < ilen) {\n arr.push(extension[i]);\n i++;\n }\n}\n\nexport function pivot(arr) {\n var pivotedArr = [];\n\n if (!arr || arr.length === 0 || !arr[0] || arr[0].length === 0) {\n return pivotedArr;\n }\n\n var rowCount = arr.length;\n var colCount = arr[0].length;\n\n for (var i = 0; i < rowCount; i++) {\n for (var j = 0; j < colCount; j++) {\n if (!pivotedArr[j]) {\n pivotedArr[j] = [];\n }\n\n pivotedArr[j][i] = arr[i][j];\n }\n }\n\n return pivotedArr;\n}\n\n/**\n * A specialized version of `.reduce` for arrays without support for callback\n * shorthands and `this` binding.\n *\n * {@link https://github.com/lodash/lodash/blob/master/lodash.js}\n *\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {Boolean} [initFromArray] Specify using the first element of `array` as the initial value.\n * @returns {*} Returns the accumulated value.\n */\nexport function arrayReduce(array, iteratee, accumulator, initFromArray) {\n let index = -1;\n let iterable = array;\n\n if (!Array.isArray(array)) {\n iterable = Array.from(array);\n }\n const length = iterable.length;\n\n if (initFromArray && length) {\n accumulator = iterable[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, iterable[index], index, iterable);\n }\n\n return accumulator;\n}\n\n/**\n * A specialized version of `.filter` for arrays without support for callback\n * shorthands and `this` binding.\n *\n * {@link https://github.com/lodash/lodash/blob/master/lodash.js}\n *\n * @param {Array} array The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nexport function arrayFilter(array, predicate) {\n let index = -1;\n let iterable = array;\n\n if (!Array.isArray(array)) {\n iterable = Array.from(array);\n }\n\n const length = iterable.length;\n const result = [];\n let resIndex = -1;\n\n while (++index < length) {\n const value = iterable[index];\n\n if (predicate(value, index, iterable)) {\n result[++resIndex] = value;\n }\n }\n\n return result;\n}\n\n/**\n * A specialized version of `.map` for arrays without support for callback\n * shorthands and `this` binding.\n *\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nexport function arrayMap(array, iteratee) {\n let index = -1;\n let iterable = array;\n\n if (!Array.isArray(array)) {\n iterable = Array.from(array);\n }\n\n const length = iterable.length;\n const result = [];\n let resIndex = -1;\n\n while (++index < length) {\n const value = iterable[index];\n\n result[++resIndex] = iteratee(value, index, iterable);\n }\n\n return result;\n}\n\n/**\n * A specialized version of `.forEach` for arrays without support for callback\n * shorthands and `this` binding.\n *\n * {@link https://github.com/lodash/lodash/blob/master/lodash.js}\n *\n * @param {Array|*} array The array to iterate over or an any element with implemented iterator protocol.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nexport function arrayEach(array, iteratee) {\n let index = -1;\n let iterable = array;\n\n if (!Array.isArray(array)) {\n iterable = Array.from(array);\n }\n\n const length = iterable.length;\n\n while (++index < length) {\n if (iteratee(iterable[index], index, iterable) === false) {\n break;\n }\n }\n\n return array;\n}\n\n/**\n * Calculate sum value for each item of the array.\n *\n * @param {Array} array The array to process.\n * @returns {Number} Returns calculated sum value.\n */\nexport function arraySum(array) {\n return arrayReduce(array, (a, b) => (a + b), 0);\n}\n\n/**\n * Returns the highest value from an array. Can be array of numbers or array of strings.\n * NOTICE: Mixed values is not supported.\n *\n * @param {Array} array The array to process.\n * @returns {Number} Returns the highest value from an array.\n */\nexport function arrayMax(array) {\n return arrayReduce(array, (a, b) => (a > b ? a : b), Array.isArray(array) ? array[0] : void 0);\n}\n\n/**\n * Returns the lowest value from an array. Can be array of numbers or array of strings.\n * NOTICE: Mixed values is not supported.\n *\n * @param {Array} array The array to process.\n * @returns {Number} Returns the lowest value from an array.\n */\nexport function arrayMin(array) {\n return arrayReduce(array, (a, b) => (a < b ? a : b), Array.isArray(array) ? array[0] : void 0);\n}\n\n/**\n * Calculate average value for each item of the array.\n *\n * @param {Array} array The array to process.\n * @returns {Number} Returns calculated average value.\n */\nexport function arrayAvg(array) {\n if (!array.length) {\n return 0;\n }\n\n return arraySum(array) / array.length;\n}\n\n/**\n * Flatten multidimensional array.\n *\n * @param {Array} array Array of Arrays\n * @returns {Array}\n */\nexport function arrayFlatten(array) {\n return arrayReduce(array, (initial, value) => initial.concat(Array.isArray(value) ? arrayFlatten(value) : value), []);\n}\n\n/**\n * Unique values in the array.\n *\n * @param {Array} array The array to process.\n * @returns {Array}\n */\nexport function arrayUnique(array) {\n let unique = [];\n\n arrayEach(array, (value) => {\n if (unique.indexOf(value) === -1) {\n unique.push(value);\n }\n });\n\n return unique;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/helpers/array.js","import {arrayEach} from './array';\n\n/**\n * Generate schema for passed object.\n *\n * @param {Array|Object} object\n * @returns {Array|Object}\n */\nexport function duckSchema(object) {\n var schema;\n\n if (Array.isArray(object)) {\n schema = [];\n } else {\n schema = {};\n\n objectEach(object, (value, key) => {\n if (key === '__children') {\n return;\n }\n\n if (value && typeof value === 'object' && !Array.isArray(value)) {\n schema[key] = duckSchema(value);\n\n } else if (Array.isArray(value)) {\n if (value.length && typeof value[0] === 'object' && !Array.isArray(value[0])) {\n schema[key] = [duckSchema(value[0])];\n } else {\n schema[key] = [];\n }\n\n } else {\n schema[key] = null;\n }\n });\n }\n\n return schema;\n}\n\n/**\n * Inherit without without calling parent constructor, and setting `Child.prototype.constructor` to `Child` instead of `Parent`.\n * Creates temporary dummy function to call it as constructor.\n * Described in ticket: https://github.com/handsontable/handsontable/pull/516\n *\n * @param {Object} Child child class\n * @param {Object} Parent parent class\n * @return {Object} extended Child\n */\nexport function inherit(Child, Parent) {\n Parent.prototype.constructor = Parent;\n Child.prototype = new Parent();\n Child.prototype.constructor = Child;\n\n return Child;\n}\n\n/**\n * Perform shallow extend of a target object with extension's own properties.\n *\n * @param {Object} target An object that will receive the new properties.\n * @param {Object} extension An object containing additional properties to merge into the target.\n */\nexport function extend(target, extension) {\n objectEach(extension, (value, key) => {\n target[key] = value;\n });\n\n return target;\n}\n\n/**\n * Perform deep extend of a target object with extension's own properties.\n *\n * @param {Object} target An object that will receive the new properties.\n * @param {Object} extension An object containing additional properties to merge into the target.\n */\nexport function deepExtend(target, extension) {\n objectEach(extension, (value, key) => {\n if (extension[key] && typeof extension[key] === 'object') {\n if (!target[key]) {\n if (Array.isArray(extension[key])) {\n target[key] = [];\n } else if (Object.prototype.toString.call(extension[key]) === '[object Date]') {\n target[key] = extension[key];\n } else {\n target[key] = {};\n }\n }\n deepExtend(target[key], extension[key]);\n\n } else {\n target[key] = extension[key];\n }\n });\n}\n\n/**\n * Perform deep clone of an object.\n * WARNING! Only clones JSON properties. Will cause error when `obj` contains a function, Date, etc.\n *\n * @param {Object} obj An object that will be cloned\n * @return {Object}\n */\nexport function deepClone(obj) {\n if (typeof obj === 'object') {\n return JSON.parse(JSON.stringify(obj));\n }\n\n return obj;\n}\n\n/**\n * Shallow clone object.\n *\n * @param {Object} object\n * @returns {Object}\n */\nexport function clone(object) {\n let result = {};\n\n objectEach(object, (value, key) => {\n result[key] = value;\n });\n\n return result;\n}\n\n/**\n * Extend the Base object (usually prototype) of the functionality the `mixins` objects.\n *\n * @param {Object} Base Base object which will be extended.\n * @param {Object} mixins The object of the functionality will be \"copied\".\n * @returns {Object}\n */\nexport function mixin(Base, ...mixins) {\n if (!Base.MIXINS) {\n Base.MIXINS = [];\n }\n arrayEach(mixins, (mixin) => {\n Base.MIXINS.push(mixin.MIXIN_NAME);\n\n objectEach(mixin, (value, key) => {\n if (Base.prototype[key] !== void 0) {\n throw new Error(`Mixin conflict. Property '${key}' already exist and cannot be overwritten.`);\n }\n if (typeof value === 'function') {\n Base.prototype[key] = value;\n\n } else {\n let getter = function _getter(propertyName, initialValue) {\n propertyName = `_${propertyName}`;\n\n let initValue = (value) => {\n if (Array.isArray(value) || isObject(value)) {\n value = deepClone(value);\n }\n\n return value;\n };\n\n return function() {\n if (this[propertyName] === void 0) {\n this[propertyName] = initValue(initialValue);\n }\n\n return this[propertyName];\n };\n };\n let setter = function _setter(propertyName) {\n propertyName = `_${propertyName}`;\n\n return function(value) {\n this[propertyName] = value;\n };\n };\n Object.defineProperty(Base.prototype, key, {\n get: getter(key, value),\n set: setter(key),\n configurable: true,\n });\n }\n });\n });\n\n return Base;\n}\n\n/**\n * Checks if two objects or arrays are (deep) equal\n *\n * @param {Object|Array} object1\n * @param {Object|Array} object2\n * @returns {Boolean}\n */\nexport function isObjectEqual(object1, object2) {\n return JSON.stringify(object1) === JSON.stringify(object2);\n}\n\n/**\n * Determines whether given object is a plain Object.\n * Note: String and Array are not plain Objects\n * @param {*} obj\n * @returns {boolean}\n */\nexport function isObject(obj) {\n return Object.prototype.toString.call(obj) == '[object Object]';\n}\n\nexport function defineGetter(object, property, value, options) {\n options.value = value;\n options.writable = options.writable !== false;\n options.enumerable = options.enumerable !== false;\n options.configurable = options.configurable !== false;\n\n Object.defineProperty(object, property, options);\n}\n\n/**\n * A specialized version of `.forEach` for objects.\n *\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\nexport function objectEach(object, iteratee) {\n for (let key in object) {\n if (!object.hasOwnProperty || (object.hasOwnProperty && Object.prototype.hasOwnProperty.call(object, key))) {\n if (iteratee(object[key], key, object) === false) {\n break;\n }\n }\n }\n\n return object;\n}\n\n/**\n * Get object property by its name. Access to sub properties can be achieved by dot notation (e.q. `'foo.bar.baz'`).\n *\n * @param {Object} object Object which value will be exported.\n * @param {String} name Object property name.\n * @returns {*}\n */\nexport function getProperty(object, name) {\n let names = name.split('.');\n let result = object;\n\n objectEach(names, (name) => {\n result = result[name];\n\n if (result === void 0) {\n result = void 0;\n\n return false;\n }\n });\n\n return result;\n}\n\n/**\n * Return object length (recursively).\n *\n * @param {*} object Object for which we want get length.\n * @returns {Number}\n */\nexport function deepObjectSize(object) {\n if (!isObject(object)) {\n return 0;\n }\n let recursObjLen = function(obj) {\n let result = 0;\n\n if (isObject(obj)) {\n objectEach(obj, (key) => {\n result += recursObjLen(key);\n });\n } else {\n result++;\n }\n\n return result;\n };\n\n return recursObjLen(object);\n}\n\n/**\n * Create object with property where its value change will be observed.\n *\n * @param {*} [defaultValue=undefined] Default value.\n * @param {String} [propertyToListen='value'] Property to listen.\n * @returns {Object}\n */\nexport function createObjectPropListener(defaultValue, propertyToListen = 'value') {\n const privateProperty = `_${propertyToListen}`;\n const holder = {\n _touched: false,\n [privateProperty]: defaultValue,\n isTouched() {\n return this._touched;\n }\n };\n\n Object.defineProperty(holder, propertyToListen, {\n get() {\n return this[privateProperty];\n },\n set(value) {\n this._touched = true;\n this[privateProperty] = value;\n },\n enumerable: true,\n configurable: true\n });\n\n return holder;\n}\n\n/**\n * Check if at specified `key` there is any value for `object`.\n *\n * @param {Object} object Object to search value at specyfic key.\n * @param {String} key String key to check.\n */\nexport function hasOwnProperty(object, key) {\n return Object.prototype.hasOwnProperty.call(object, key);\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/helpers/object.js","var global = require('./_global');\nvar core = require('./_core');\nvar hide = require('./_hide');\nvar redefine = require('./_redefine');\nvar ctx = require('./_ctx');\nvar PROTOTYPE = 'prototype';\n\nvar $export = function (type, name, source) {\n var IS_FORCED = type & $export.F;\n var IS_GLOBAL = type & $export.G;\n var IS_STATIC = type & $export.S;\n var IS_PROTO = type & $export.P;\n var IS_BIND = type & $export.B;\n var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE];\n var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});\n var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {});\n var key, own, out, exp;\n if (IS_GLOBAL) source = name;\n for (key in source) {\n // contains in native\n own = !IS_FORCED && target && target[key] !== undefined;\n // export native or passed\n out = (own ? target : source)[key];\n // bind timers to global for call from export context\n exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;\n // extend global\n if (target) redefine(target, key, out, type & $export.U);\n // export\n if (exports[key] != out) hide(exports, key, exp);\n if (IS_PROTO && expProto[key] != out) expProto[key] = out;\n }\n};\nglobal.core = core;\n// type bitmap\n$export.F = 1; // forced\n$export.G = 2; // global\n$export.S = 4; // static\n$export.P = 8; // proto\n$export.B = 16; // bind\n$export.W = 32; // wrap\n$export.U = 64; // safe\n$export.R = 128; // real proto method for `library`\nmodule.exports = $export;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_export.js\n// module id = 3\n// module chunks = 0","import 'babel-polyfill';\n\nimport ViewportColumnsCalculator from './calculator/viewportColumns';\nimport ViewportRowsCalculator from './calculator/viewportRows';\n\nimport CellCoords from './cell/coords';\nimport CellRange from './cell/range';\n\nimport ColumnFilter from './filter/column';\nimport RowFilter from './filter/row';\n\nimport DebugOverlay from './overlay/debug';\nimport LeftOverlay from './overlay/left';\nimport TopOverlay from './overlay/top';\nimport TopLeftCornerOverlay from './overlay/topLeftCorner';\n\nimport Border from './border';\nimport Walkontable from './core';\nimport Event from './event';\nimport Overlays from './overlays';\nimport Scroll from './scroll';\nimport Selection from './selection';\nimport Settings from './settings';\nimport Table from './table';\nimport TableRenderer from './tableRenderer';\nimport Viewport from './viewport';\n\nexport {\n ViewportColumnsCalculator,\n ViewportRowsCalculator,\n\n CellCoords,\n CellRange,\n\n ColumnFilter,\n RowFilter,\n\n DebugOverlay,\n LeftOverlay,\n TopOverlay,\n TopLeftCornerOverlay,\n\n Border,\n Walkontable as default,\n Walkontable as Core,\n Event,\n Overlays,\n Scroll,\n Selection,\n Settings,\n Table,\n TableRenderer,\n Viewport,\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/3rdparty/walkontable/src/index.js","/**\n * Checks if value of n is a numeric one\n * http://jsperf.com/isnan-vs-isnumeric/4\n * @param n\n * @returns {boolean}\n */\nexport function isNumeric(n) {\n /* eslint-disable */\n var t = typeof n;\n\n return t == 'number' ? !isNaN(n) && isFinite(n) :\n t == 'string' ? !n.length ? false :\n n.length == 1 ? /\\d/.test(n) :\n /^\\s*[+-]?\\s*(?:(?:\\d+(?:\\.\\d+)?(?:e[+-]?\\d+)?)|(?:0x[a-f\\d]+))\\s*$/i.test(n) :\n t == 'object' ? !!n && typeof n.valueOf() == 'number' && !(n instanceof Date) : false;\n}\n\n/**\n * A specialized version of `.forEach` defined by ranges.\n *\n * @param {Number} rangeFrom The number from start iterate.\n * @param {Number|Function} rangeTo The number where finish iterate or function as a iteratee.\n * @param {Function} [iteratee] The function invoked per iteration.\n */\nexport function rangeEach(rangeFrom, rangeTo, iteratee) {\n let index = -1;\n\n if (typeof rangeTo === 'function') {\n iteratee = rangeTo;\n rangeTo = rangeFrom;\n } else {\n index = rangeFrom - 1;\n }\n while (++index <= rangeTo) {\n if (iteratee(index) === false) {\n break;\n }\n }\n}\n\n/**\n * A specialized version of `.forEach` defined by ranges iterable in reverse order.\n *\n * @param {Number} rangeFrom The number from start iterate.\n * @param {Number|Function} rangeTo The number where finish iterate or function as a iteratee.\n * @param {Function} [iteratee] The function invoked per iteration.\n */\nexport function rangeEachReverse(rangeFrom, rangeTo, iteratee) {\n let index = rangeFrom + 1;\n\n if (typeof rangeTo === 'function') {\n iteratee = rangeTo;\n rangeTo = 0;\n }\n while (--index >= rangeTo) {\n if (iteratee(index) === false) {\n break;\n }\n }\n}\n\n/**\n * Calculate value from percent.\n *\n * @param {Number} value Base value from percent will be calculated.\n * @param {String|Number} percent Can be Number or String (eq. `'33%'`).\n * @returns {Number}\n */\nexport function valueAccordingPercent(value, percent) {\n percent = parseInt(percent.toString().replace('%', ''), 10);\n percent = parseInt(value * percent / 100, 10);\n\n return percent;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/helpers/number.js","import {polymerWrap, closest} from './helpers/dom/element';\nimport {hasOwnProperty} from './helpers/object';\nimport {isWebComponentSupportedNatively} from './helpers/feature';\nimport {stopImmediatePropagation as _stopImmediatePropagation} from './helpers/dom/event';\n\n/**\n * Counter which tracks unregistered listeners (useful for detecting memory leaks).\n *\n * @type {Number}\n */\nlet listenersCounter = 0;\n\n/**\n * Event DOM manager for internal use in Handsontable.\n *\n * @class EventManager\n * @util\n */\nclass EventManager {\n /**\n * @param {Object} [context=null]\n * @private\n */\n constructor(context = null) {\n this.context = context || this;\n\n if (!this.context.eventListeners) {\n this.context.eventListeners = [];\n }\n }\n\n /**\n * Register specified listener (`eventName`) to the element.\n *\n * @param {Element} element Target element.\n * @param {String} eventName Event name.\n * @param {Function} callback Function which will be called after event occur.\n * @returns {Function} Returns function which you can easily call to remove that event\n */\n addEventListener(element, eventName, callback) {\n let context = this.context;\n\n function callbackProxy(event) {\n event = extendEvent(context, event);\n\n callback.call(this, event);\n }\n this.context.eventListeners.push({\n element,\n event: eventName,\n callback,\n callbackProxy,\n });\n\n if (window.addEventListener) {\n element.addEventListener(eventName, callbackProxy, false);\n } else {\n element.attachEvent(`on${eventName}`, callbackProxy);\n }\n listenersCounter++;\n\n return () => {\n this.removeEventListener(element, eventName, callback);\n };\n }\n\n /**\n * Remove the event listener previously registered.\n *\n * @param {Element} element Target element.\n * @param {String} eventName Event name.\n * @param {Function} callback Function to remove from the event target. It must be the same as during registration listener.\n */\n removeEventListener(element, eventName, callback) {\n let len = this.context.eventListeners.length;\n let tmpEvent;\n\n while (len--) {\n tmpEvent = this.context.eventListeners[len];\n\n if (tmpEvent.event == eventName && tmpEvent.element == element) {\n if (callback && callback != tmpEvent.callback) {\n /* eslint-disable no-continue */\n continue;\n }\n this.context.eventListeners.splice(len, 1);\n\n if (tmpEvent.element.removeEventListener) {\n tmpEvent.element.removeEventListener(tmpEvent.event, tmpEvent.callbackProxy, false);\n } else {\n tmpEvent.element.detachEvent(`on${tmpEvent.event}`, tmpEvent.callbackProxy);\n }\n listenersCounter--;\n }\n }\n }\n\n /**\n * Clear all previously registered events.\n *\n * @private\n * @since 0.15.0-beta3\n */\n clearEvents() {\n if (!this.context) {\n return;\n }\n let len = this.context.eventListeners.length;\n\n while (len--) {\n let event = this.context.eventListeners[len];\n\n if (event) {\n this.removeEventListener(event.element, event.event, event.callback);\n }\n }\n }\n\n /**\n * Clear all previously registered events.\n */\n clear() {\n this.clearEvents();\n }\n\n /**\n * Destroy instance of EventManager.\n */\n destroy() {\n this.clearEvents();\n this.context = null;\n }\n\n /**\n * Trigger event at the specified target element.\n *\n * @param {Element} element Target element.\n * @param {String} eventName Event name.\n */\n fireEvent(element, eventName) {\n let options = {\n bubbles: true,\n cancelable: (eventName !== 'mousemove'),\n view: window,\n detail: 0,\n screenX: 0,\n screenY: 0,\n clientX: 1,\n clientY: 1,\n ctrlKey: false,\n altKey: false,\n shiftKey: false,\n metaKey: false,\n button: 0,\n relatedTarget: undefined,\n };\n var event;\n\n if (document.createEvent) {\n event = document.createEvent('MouseEvents');\n event.initMouseEvent(eventName, options.bubbles, options.cancelable,\n options.view, options.detail,\n options.screenX, options.screenY, options.clientX, options.clientY,\n options.ctrlKey, options.altKey, options.shiftKey, options.metaKey,\n options.button, options.relatedTarget || document.body.parentNode);\n\n } else {\n event = document.createEventObject();\n }\n\n if (element.dispatchEvent) {\n element.dispatchEvent(event);\n } else {\n element.fireEvent(`on${eventName}`, event);\n }\n }\n}\n\n/**\n * @param {Object} context\n * @param {Event} event\n * @private\n * @returns {*}\n */\nfunction extendEvent(context, event) {\n let componentName = 'HOT-TABLE';\n let isHotTableSpotted;\n let fromElement;\n let realTarget;\n let target;\n let len;\n let nativeStopImmediatePropagation;\n\n event.isTargetWebComponent = false;\n event.realTarget = event.target;\n\n nativeStopImmediatePropagation = event.stopImmediatePropagation;\n event.stopImmediatePropagation = function() {\n nativeStopImmediatePropagation.apply(this);\n _stopImmediatePropagation(this);\n };\n\n if (!EventManager.isHotTableEnv) {\n return event;\n }\n event = polymerWrap(event);\n len = event.path ? event.path.length : 0;\n\n while (len--) {\n if (event.path[len].nodeName === componentName) {\n isHotTableSpotted = true;\n\n } else if (isHotTableSpotted && event.path[len].shadowRoot) {\n target = event.path[len];\n\n break;\n }\n if (len === 0 && !target) {\n target = event.path[len];\n }\n }\n if (!target) {\n target = event.target;\n }\n event.isTargetWebComponent = true;\n\n if (isWebComponentSupportedNatively()) {\n event.realTarget = event.srcElement || event.toElement;\n\n } else if (hasOwnProperty(context, 'hot') || context.isHotTableEnv || context.wtTable) {\n // Polymer doesn't support `event.target` property properly we must emulate it ourselves\n if (hasOwnProperty(context, 'hot')) {\n // Custom element\n fromElement = context.hot ? context.hot.view.wt.wtTable.TABLE : null;\n\n } else if (context.isHotTableEnv) {\n // Handsontable.Core\n fromElement = context.view.activeWt.wtTable.TABLE.parentNode.parentNode;\n\n } else if (context.wtTable) {\n // Walkontable\n fromElement = context.wtTable.TABLE.parentNode.parentNode;\n }\n realTarget = closest(event.target, [componentName], fromElement);\n\n if (realTarget) {\n event.realTarget = fromElement.querySelector(componentName) || event.target;\n } else {\n event.realTarget = event.target;\n }\n }\n\n Object.defineProperty(event, 'target', {\n get() {\n return polymerWrap(target);\n },\n enumerable: true,\n configurable: true,\n });\n\n return event;\n}\n\nexport default EventManager;\n\nexport function getListenersCounter() {\n return listenersCounter;\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/eventManager.js","/**\n * Constants for parts of translation.\n */\n\nexport const CONTEXT_MENU_ITEMS_NAMESPACE = 'ContextMenu:items';\nexport const CONTEXTMENU_ITEMS_ROW_ABOVE = `${CONTEXT_MENU_ITEMS_NAMESPACE}.insertRowAbove`;\nexport const CONTEXTMENU_ITEMS_ROW_BELOW = `${CONTEXT_MENU_ITEMS_NAMESPACE}.insertRowBelow`;\nexport const CONTEXTMENU_ITEMS_INSERT_LEFT = `${CONTEXT_MENU_ITEMS_NAMESPACE}.insertColumnOnTheLeft`;\nexport const CONTEXTMENU_ITEMS_INSERT_RIGHT = `${CONTEXT_MENU_ITEMS_NAMESPACE}.insertColumnOnTheRight`;\nexport const CONTEXTMENU_ITEMS_REMOVE_ROW = `${CONTEXT_MENU_ITEMS_NAMESPACE}.removeRow`;\nexport const CONTEXTMENU_ITEMS_REMOVE_COLUMN = `${CONTEXT_MENU_ITEMS_NAMESPACE}.removeColumn`;\nexport const CONTEXTMENU_ITEMS_UNDO = `${CONTEXT_MENU_ITEMS_NAMESPACE}.undo`;\nexport const CONTEXTMENU_ITEMS_REDO = `${CONTEXT_MENU_ITEMS_NAMESPACE}.redo`;\nexport const CONTEXTMENU_ITEMS_READ_ONLY = `${CONTEXT_MENU_ITEMS_NAMESPACE}.readOnly`;\nexport const CONTEXTMENU_ITEMS_CLEAR_COLUMN = `${CONTEXT_MENU_ITEMS_NAMESPACE}.clearColumn`;\n\nexport const CONTEXTMENU_ITEMS_COPY = `${CONTEXT_MENU_ITEMS_NAMESPACE}.copy`;\nexport const CONTEXTMENU_ITEMS_CUT = `${CONTEXT_MENU_ITEMS_NAMESPACE}.cut`;\n\nexport const CONTEXTMENU_ITEMS_FREEZE_COLUMN = `${CONTEXT_MENU_ITEMS_NAMESPACE}.freezeColumn`;\nexport const CONTEXTMENU_ITEMS_UNFREEZE_COLUMN = `${CONTEXT_MENU_ITEMS_NAMESPACE}.unfreezeColumn`;\n\nexport const CONTEXTMENU_ITEMS_MERGE_CELLS = `${CONTEXT_MENU_ITEMS_NAMESPACE}.mergeCells`;\nexport const CONTEXTMENU_ITEMS_UNMERGE_CELLS = `${CONTEXT_MENU_ITEMS_NAMESPACE}.unmergeCells`;\n\nexport const CONTEXTMENU_ITEMS_ADD_COMMENT = `${CONTEXT_MENU_ITEMS_NAMESPACE}.addComment`;\nexport const CONTEXTMENU_ITEMS_EDIT_COMMENT = `${CONTEXT_MENU_ITEMS_NAMESPACE}.editComment`;\nexport const CONTEXTMENU_ITEMS_REMOVE_COMMENT = `${CONTEXT_MENU_ITEMS_NAMESPACE}.removeComment`;\nexport const CONTEXTMENU_ITEMS_READ_ONLY_COMMENT = `${CONTEXT_MENU_ITEMS_NAMESPACE}.readOnlyComment`;\n\nexport const CONTEXTMENU_ITEMS_ALIGNMENT = `${CONTEXT_MENU_ITEMS_NAMESPACE}.align`;\nexport const CONTEXTMENU_ITEMS_ALIGNMENT_LEFT = `${CONTEXT_MENU_ITEMS_NAMESPACE}.align.left`;\nexport const CONTEXTMENU_ITEMS_ALIGNMENT_CENTER = `${CONTEXT_MENU_ITEMS_NAMESPACE}.align.center`;\nexport const CONTEXTMENU_ITEMS_ALIGNMENT_RIGHT = `${CONTEXT_MENU_ITEMS_NAMESPACE}.align.right`;\nexport const CONTEXTMENU_ITEMS_ALIGNMENT_JUSTIFY = `${CONTEXT_MENU_ITEMS_NAMESPACE}.align.justify`;\nexport const CONTEXTMENU_ITEMS_ALIGNMENT_TOP = `${CONTEXT_MENU_ITEMS_NAMESPACE}.align.top`;\nexport const CONTEXTMENU_ITEMS_ALIGNMENT_MIDDLE = `${CONTEXT_MENU_ITEMS_NAMESPACE}.align.middle`;\nexport const CONTEXTMENU_ITEMS_ALIGNMENT_BOTTOM = `${CONTEXT_MENU_ITEMS_NAMESPACE}.align.bottom`;\n\nexport const CONTEXTMENU_ITEMS_BORDERS = `${CONTEXT_MENU_ITEMS_NAMESPACE}.borders`;\nexport const CONTEXTMENU_ITEMS_BORDERS_TOP = `${CONTEXT_MENU_ITEMS_NAMESPACE}.borders.top`;\nexport const CONTEXTMENU_ITEMS_BORDERS_RIGHT = `${CONTEXT_MENU_ITEMS_NAMESPACE}.borders.right`;\nexport const CONTEXTMENU_ITEMS_BORDERS_BOTTOM = `${CONTEXT_MENU_ITEMS_NAMESPACE}.borders.bottom`;\nexport const CONTEXTMENU_ITEMS_BORDERS_LEFT = `${CONTEXT_MENU_ITEMS_NAMESPACE}.borders.left`;\nexport const CONTEXTMENU_ITEMS_REMOVE_BORDERS = `${CONTEXT_MENU_ITEMS_NAMESPACE}.borders.remove`;\n\nexport const CONTEXTMENU_ITEMS_NESTED_ROWS_INSERT_CHILD = `${CONTEXT_MENU_ITEMS_NAMESPACE}.nestedHeaders.insertChildRow`;\nexport const CONTEXTMENU_ITEMS_NESTED_ROWS_DETACH_CHILD = `${CONTEXT_MENU_ITEMS_NAMESPACE}.nestedHeaders.detachFromParent`;\n\nexport const CONTEXTMENU_ITEMS_HIDE_COLUMN = `${CONTEXT_MENU_ITEMS_NAMESPACE}.hideColumn`;\nexport const CONTEXTMENU_ITEMS_SHOW_COLUMN = `${CONTEXT_MENU_ITEMS_NAMESPACE}.showColumn`;\n\nexport const CONTEXTMENU_ITEMS_HIDE_ROW = `${CONTEXT_MENU_ITEMS_NAMESPACE}.hideRow`;\nexport const CONTEXTMENU_ITEMS_SHOW_ROW = `${CONTEXT_MENU_ITEMS_NAMESPACE}.showRow`;\n\nexport const FILTERS_NAMESPACE = 'Filters:';\nexport const FILTERS_CONDITIONS_NAMESPACE = `${FILTERS_NAMESPACE}conditions`;\nexport const FILTERS_CONDITIONS_NONE = `${FILTERS_CONDITIONS_NAMESPACE}.none`;\nexport const FILTERS_CONDITIONS_EMPTY = `${FILTERS_CONDITIONS_NAMESPACE}.isEmpty`;\nexport const FILTERS_CONDITIONS_NOT_EMPTY = `${FILTERS_CONDITIONS_NAMESPACE}.isNotEmpty`;\nexport const FILTERS_CONDITIONS_EQUAL = `${FILTERS_CONDITIONS_NAMESPACE}.isEqualTo`;\nexport const FILTERS_CONDITIONS_NOT_EQUAL = `${FILTERS_CONDITIONS_NAMESPACE}.isNotEqualTo`;\nexport const FILTERS_CONDITIONS_BEGINS_WITH = `${FILTERS_CONDITIONS_NAMESPACE}.beginsWith`;\nexport const FILTERS_CONDITIONS_ENDS_WITH = `${FILTERS_CONDITIONS_NAMESPACE}.endsWith`;\nexport const FILTERS_CONDITIONS_CONTAINS = `${FILTERS_CONDITIONS_NAMESPACE}.contains`;\nexport const FILTERS_CONDITIONS_NOT_CONTAIN = `${FILTERS_CONDITIONS_NAMESPACE}.doesNotContain`;\nexport const FILTERS_CONDITIONS_BY_VALUE = `${FILTERS_CONDITIONS_NAMESPACE}.byValue`;\nexport const FILTERS_CONDITIONS_GREATER_THAN = `${FILTERS_CONDITIONS_NAMESPACE}.greaterThan`;\nexport const FILTERS_CONDITIONS_GREATER_THAN_OR_EQUAL = `${FILTERS_CONDITIONS_NAMESPACE}.greaterThanOrEqualTo`;\nexport const FILTERS_CONDITIONS_LESS_THAN = `${FILTERS_CONDITIONS_NAMESPACE}.lessThan`;\nexport const FILTERS_CONDITIONS_LESS_THAN_OR_EQUAL = `${FILTERS_CONDITIONS_NAMESPACE}.lessThanOrEqualTo`;\nexport const FILTERS_CONDITIONS_BETWEEN = `${FILTERS_CONDITIONS_NAMESPACE}.isBetween`;\nexport const FILTERS_CONDITIONS_NOT_BETWEEN = `${FILTERS_CONDITIONS_NAMESPACE}.isNotBetween`;\nexport const FILTERS_CONDITIONS_AFTER = `${FILTERS_CONDITIONS_NAMESPACE}.after`;\nexport const FILTERS_CONDITIONS_BEFORE = `${FILTERS_CONDITIONS_NAMESPACE}.before`;\nexport const FILTERS_CONDITIONS_TODAY = `${FILTERS_CONDITIONS_NAMESPACE}.today`;\nexport const FILTERS_CONDITIONS_TOMORROW = `${FILTERS_CONDITIONS_NAMESPACE}.tomorrow`;\nexport const FILTERS_CONDITIONS_YESTERDAY = `${FILTERS_CONDITIONS_NAMESPACE}.yesterday`;\n\nexport const FILTERS_DIVS_FILTER_BY_CONDITION = `${FILTERS_NAMESPACE}labels.filterByCondition`;\nexport const FILTERS_DIVS_FILTER_BY_VALUE = `${FILTERS_NAMESPACE}labels.filterByValue`;\n\nexport const FILTERS_LABELS_CONJUNCTION = `${FILTERS_NAMESPACE}labels.conjunction`;\nexport const FILTERS_LABELS_DISJUNCTION = `${FILTERS_NAMESPACE}labels.disjunction`;\n\nexport const FILTERS_VALUES_BLANK_CELLS = `${FILTERS_NAMESPACE}values.blankCells`;\n\nexport const FILTERS_BUTTONS_SELECT_ALL = `${FILTERS_NAMESPACE}buttons.selectAll`;\nexport const FILTERS_BUTTONS_CLEAR = `${FILTERS_NAMESPACE}buttons.clear`;\nexport const FILTERS_BUTTONS_OK = `${FILTERS_NAMESPACE}buttons.ok`;\nexport const FILTERS_BUTTONS_CANCEL = `${FILTERS_NAMESPACE}buttons.cancel`;\n\nexport const FILTERS_BUTTONS_PLACEHOLDER_SEARCH = `${FILTERS_NAMESPACE}buttons.placeholder.search`;\nexport const FILTERS_BUTTONS_PLACEHOLDER_VALUE = `${FILTERS_NAMESPACE}buttons.placeholder.value`;\nexport const FILTERS_BUTTONS_PLACEHOLDER_SECOND_VALUE = `${FILTERS_NAMESPACE}buttons.placeholder.secondValue`;\n\n\n\n// WEBPACK FOOTER //\n// ./src/i18n/constants.js","/**\n * Utility to register plugins and common namespace for keeping reference to all plugins classes\n */\nimport Hooks from './pluginHooks';\nimport {objectEach} from './helpers/object';\nimport {toUpperCaseFirst} from './helpers/string';\n\nconst registeredPlugins = new WeakMap();\n\n/**\n * Registers plugin under given name\n *\n * @param {String} pluginName\n * @param {Function} PluginClass\n */\nfunction registerPlugin(pluginName, PluginClass) {\n pluginName = toUpperCaseFirst(pluginName);\n\n Hooks.getSingleton().add('construct', function() {\n let holder;\n\n if (!registeredPlugins.has(this)) {\n registeredPlugins.set(this, {});\n }\n holder = registeredPlugins.get(this);\n\n if (!holder[pluginName]) {\n holder[pluginName] = new PluginClass(this);\n }\n });\n Hooks.getSingleton().add('afterDestroy', function() {\n if (registeredPlugins.has(this)) {\n let pluginsHolder = registeredPlugins.get(this);\n\n objectEach(pluginsHolder, (plugin) => plugin.destroy());\n registeredPlugins.delete(this);\n }\n });\n}\n\n/**\n * @param {Object} instance\n * @param {String|Function} pluginName\n * @returns {Function} pluginClass Returns plugin instance if exists or `undefined` if not exists.\n */\nfunction getPlugin(instance, pluginName) {\n if (typeof pluginName != 'string') {\n throw Error('Only strings can be passed as \"plugin\" parameter');\n }\n let _pluginName = toUpperCaseFirst(pluginName);\n\n if (!registeredPlugins.has(instance) || !registeredPlugins.get(instance)[_pluginName]) {\n return void 0;\n }\n\n return registeredPlugins.get(instance)[_pluginName];\n}\n\n/**\n * Get all registred plugins names for concrete Handsontable instance.\n *\n * @param {Object} hotInstance\n * @returns {Array}\n */\nfunction getRegistredPluginNames(hotInstance) {\n return registeredPlugins.has(hotInstance) ? Object.keys(registeredPlugins.get(hotInstance)) : [];\n}\n\n/**\n * Get plugin name.\n *\n * @param {Object} hotInstance\n * @param {Object} plugin\n * @returns {String|null}\n */\nfunction getPluginName(hotInstance, plugin) {\n let pluginName = null;\n\n if (registeredPlugins.has(hotInstance)) {\n objectEach(registeredPlugins.get(hotInstance), (pluginInstance, name) => {\n if (pluginInstance === plugin) {\n pluginName = name;\n }\n });\n }\n\n return pluginName;\n}\n\nexport {registerPlugin, getPlugin, getRegistredPluginNames, getPluginName};\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins.js","module.exports = function (it) {\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_is-object.js\n// module id = 9\n// module chunks = 0","import {defineGetter, objectEach} from './../helpers/object';\nimport {arrayEach} from './../helpers/array';\nimport {registerIdentity, getTranslator} from './../utils/recordTranslator';\nimport {getRegistredPluginNames, getPluginName} from './../plugins';\n\nconst privatePool = new WeakMap();\nlet initializedPlugins = null;\n\n/**\n * @private\n */\nclass BasePlugin {\n /**\n * @param {Object} hotInstance Handsontable instance.\n */\n constructor(hotInstance) {\n /**\n * Handsontable instance.\n *\n * @type {Core}\n */\n defineGetter(this, 'hot', hotInstance, {\n writable: false\n });\n defineGetter(this, 't', getTranslator(hotInstance), {\n writable: false\n });\n\n privatePool.set(this, {hooks: {}});\n initializedPlugins = null;\n\n this.pluginName = null;\n this.pluginsInitializedCallbacks = [];\n this.isPluginsReady = false;\n this.enabled = false;\n this.initialized = false;\n\n this.hot.addHook('afterPluginsInitialized', () => this.onAfterPluginsInitialized());\n this.hot.addHook('afterUpdateSettings', () => this.onUpdateSettings());\n this.hot.addHook('beforeInit', () => this.init());\n }\n\n init() {\n this.pluginName = getPluginName(this.hot, this);\n\n if (this.isEnabled && this.isEnabled()) {\n this.enablePlugin();\n }\n if (!initializedPlugins) {\n initializedPlugins = getRegistredPluginNames(this.hot);\n }\n if (initializedPlugins.indexOf(this.pluginName) >= 0) {\n initializedPlugins.splice(initializedPlugins.indexOf(this.pluginName), 1);\n }\n if (!initializedPlugins.length) {\n this.hot.runHooks('afterPluginsInitialized');\n }\n this.initialized = true;\n }\n\n /**\n * Enable plugin for this Handsontable instance.\n */\n enablePlugin() {\n this.enabled = true;\n }\n\n /**\n * Disable plugin for this Handsontable instance.\n */\n disablePlugin() {\n if (this.eventManager) {\n this.eventManager.clear();\n }\n this.clearHooks();\n this.enabled = false;\n }\n\n /**\n * Add listener to plugin hooks system.\n *\n * @param {String} name\n * @param {Function} callback\n */\n addHook(name, callback) {\n privatePool.get(this).hooks[name] = (privatePool.get(this).hooks[name] || []);\n\n const hooks = privatePool.get(this).hooks[name];\n\n this.hot.addHook(name, callback);\n hooks.push(callback);\n privatePool.get(this).hooks[name] = hooks;\n }\n\n /**\n * Remove all hooks listeners by hook name.\n *\n * @param {String} name\n */\n removeHooks(name) {\n arrayEach(privatePool.get(this).hooks[name] || [], (callback) => {\n this.hot.removeHook(name, callback);\n });\n }\n\n /**\n * Clear all hooks.\n */\n clearHooks() {\n const hooks = privatePool.get(this).hooks;\n\n objectEach(hooks, (callbacks, name) => this.removeHooks(name));\n hooks.length = 0;\n }\n\n /**\n * Register function which will be immediately called after all plugins initialized.\n *\n * @param {Function} callback\n */\n callOnPluginsReady(callback) {\n if (this.isPluginsReady) {\n callback();\n } else {\n this.pluginsInitializedCallbacks.push(callback);\n }\n }\n\n /**\n * On after plugins initialized listener.\n *\n * @private\n */\n onAfterPluginsInitialized() {\n arrayEach(this.pluginsInitializedCallbacks, (callback) => callback());\n this.pluginsInitializedCallbacks.length = 0;\n this.isPluginsReady = true;\n }\n\n /**\n * On update settings listener.\n *\n * @private\n */\n onUpdateSettings() {\n if (this.isEnabled) {\n if (this.enabled && !this.isEnabled()) {\n this.disablePlugin();\n }\n if (!this.enabled && this.isEnabled()) {\n this.enablePlugin();\n }\n if (this.enabled && this.isEnabled()) {\n this.updatePlugin();\n }\n }\n }\n\n /**\n * Updates the plugin to use the latest options you have specified.\n *\n * @private\n */\n updatePlugin() {\n\n }\n\n /**\n * Destroy plugin.\n */\n destroy() {\n if (this.eventManager) {\n this.eventManager.destroy();\n }\n this.clearHooks();\n\n objectEach(this, (value, property) => {\n if (property !== 'hot' && property !== 't') {\n this[property] = null;\n }\n });\n delete this.t;\n delete this.hot;\n }\n}\n\nexport default BasePlugin;\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/_base.js","var store = require('./_shared')('wks');\nvar uid = require('./_uid');\nvar Symbol = require('./_global').Symbol;\nvar USE_SYMBOL = typeof Symbol == 'function';\n\nvar $exports = module.exports = function (name) {\n return store[name] || (store[name] =\n USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));\n};\n\n$exports.store = store;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_wks.js\n// module id = 11\n// module chunks = 0","import {getWindowScrollTop, getWindowScrollLeft} from './element';\n\n/**\n * Prevent other listeners of the same event from being called.\n *\n * @param {Event} event\n */\nexport function stopImmediatePropagation(event) {\n event.isImmediatePropagationEnabled = false;\n event.cancelBubble = true;\n}\n\n/**\n * Check if event was stopped by `stopImmediatePropagation`.\n *\n * @param event {Event}\n * @returns {Boolean}\n */\nexport function isImmediatePropagationStopped(event) {\n return event.isImmediatePropagationEnabled === false;\n}\n\n/**\n * Prevent further propagation of the current event (prevent bubbling).\n *\n * @param event {Event}\n */\nexport function stopPropagation(event) {\n // ie8\n // http://msdn.microsoft.com/en-us/library/ie/ff975462(v=vs.85).aspx\n if (typeof event.stopPropagation === 'function') {\n event.stopPropagation();\n } else {\n event.cancelBubble = true;\n }\n}\n\n/**\n * Get horizontal coordinate of the event object relative to the whole document.\n *\n * @param {Event} event\n * @returns {Number}\n */\nexport function pageX(event) {\n if (event.pageX) {\n return event.pageX;\n }\n\n return event.clientX + getWindowScrollLeft();\n}\n\n/**\n * Get vertical coordinate of the event object relative to the whole document.\n *\n * @param {Event} event\n * @returns {Number}\n */\nexport function pageY(event) {\n if (event.pageY) {\n return event.pageY;\n }\n\n return event.clientY + getWindowScrollTop();\n}\n\n/**\n * Check if provided event was triggered by clicking the right mouse button.\n *\n * @param {Event} event DOM Event.\n * @returns {Boolean}\n */\nexport function isRightClick(event) {\n return event.button === 2;\n}\n\n/**\n * Check if provided event was triggered by clicking the left mouse button.\n *\n * @param {Event} event DOM Event.\n * @returns {Boolean}\n */\nexport function isLeftClick(event) {\n return event.button === 0;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/helpers/dom/event.js","import staticRegister from './../utils/staticRegister';\n\nimport baseRenderer from './_cellDecorator';\nimport autocompleteRenderer from './autocompleteRenderer';\nimport checkboxRenderer from './checkboxRenderer';\nimport htmlRenderer from './htmlRenderer';\nimport numericRenderer from './numericRenderer';\nimport passwordRenderer from './passwordRenderer';\nimport textRenderer from './textRenderer';\n\nconst {\n register,\n getItem,\n hasItem,\n getNames,\n getValues,\n} = staticRegister('renderers');\n\nregister('base', baseRenderer);\nregister('autocomplete', autocompleteRenderer);\nregister('checkbox', checkboxRenderer);\nregister('html', htmlRenderer);\nregister('numeric', numericRenderer);\nregister('password', passwordRenderer);\nregister('text', textRenderer);\n\n/**\n * Retrieve renderer function.\n *\n * @param {String} name Renderer identification.\n * @returns {Function} Returns renderer function.\n */\nfunction _getItem(name) {\n if (typeof name === 'function') {\n return name;\n }\n if (!hasItem(name)) {\n throw Error(`No registered renderer found under \"${name}\" name`);\n }\n\n return getItem(name);\n}\n\nexport {\n register as registerRenderer,\n _getItem as getRenderer,\n hasItem as hasRenderer,\n getNames as getRegisteredRendererNames,\n getValues as getRegisteredRenderers,\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/renderers/index.js","// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self\n // eslint-disable-next-line no-new-func\n : Function('return this')();\nif (typeof __g == 'number') __g = global; // eslint-disable-line no-undef\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_global.js\n// module id = 14\n// module chunks = 0","import {arrayEach} from './helpers/array';\nimport {objectEach} from './helpers/object';\n\n/**\n * @description\n * Handsontable events are the common interface that function in 2 ways: as __callbacks__ and as __hooks__.\n *\n * @example\n *\n * ```js\n * // Using events as callbacks:\n * ...\n * var hot1 = new Handsontable(document.getElementById('example1'), {\n * afterChange: function(changes, source) {\n * $.ajax({\n * url: \"save.php',\n * data: change\n * });\n * }\n * });\n * ...\n * ```\n *\n * ```js\n * // Using events as plugin hooks:\n * ...\n * var hot1 = new Handsontable(document.getElementById('example1'), {\n * myPlugin: true\n * });\n *\n * var hot2 = new Handsontable(document.getElementById('example2'), {\n * myPlugin: false\n * });\n *\n * // global hook\n * Handsontable.hooks.add('afterChange', function() {\n * // Fired twice - for hot1 and hot2\n * if (this.getSettings().myPlugin) {\n * // function body - will only run for hot1\n * }\n * });\n *\n * // local hook (has same effect as a callback)\n * hot2.addHook('afterChange', function() {\n * // function body - will only run in #example2\n * });\n * ```\n * ...\n */\n\n// @TODO: Move plugin description hooks to plugin?\nconst REGISTERED_HOOKS = [\n /**\n * Callback fired after resetting a cell's meta.\n *\n * @event Hooks#afterCellMetaReset\n * @since 0.11\n */\n 'afterCellMetaReset',\n\n /**\n * @description\n * Callback fired after one or more cells has been changed. Its main use case is to save the input.\n *\n * __Note:__ For performance reasons, the `changes` array is null for `\"loadData\"` source.\n *\n * @event Hooks#afterChange\n * @param {Array} changes 2D array containing information about each of the edited cells `[[row, prop, oldVal, newVal], ...]`.\n * @param {String} [source] String that identifies source of hook call\n * ([list of all available sources]{@link http://docs.handsontable.com/tutorial-using-callbacks.html#page-source-definition}).\n */\n 'afterChange',\n\n /**\n * @description\n * Fired after observing changes.\n *\n * @event Hooks#afterChangesObserved\n */\n 'afterChangesObserved',\n\n /**\n * @description\n * Fired after setting up the Context Menu's default options. These options are a collection which user can select by setting\n * an array of keys or an array of objects in `contextMenu` option.\n *\n * @event Hooks#afterContextMenuDefaultOptions\n * @param {Array} predefinedItems Array of objects containing information about the pre-defined Context Menu items.\n */\n 'afterContextMenuDefaultOptions',\n\n /**\n * @description\n * Fired before setting up the Context Menu's items but after filtering these options by user (`contextMenu` option). This hook\n * can by helpful to determine if user use specified menu item or to set up one of the menu item to by always visible.\n *\n * @event Hooks#beforeContextMenuSetItems\n * @param {Array} menuItems Array of objects containing information about to generated Context Menu items.\n */\n 'beforeContextMenuSetItems',\n\n /**\n * @description\n * Fired after setting up the Context Menu's default options. These options are a collection which user can select by setting\n * an array of keys or an array of objects in `contextMenu` option.\n *\n * @pro\n * @event Hooks#afterDropdownMenuDefaultOptions\n * @param {Array} predefinedItems Array of objects containing information about the pre-defined Context Menu items.\n */\n 'afterDropdownMenuDefaultOptions',\n\n /**\n * @description\n * Fired before setting up the Dropdown Menu's items but after filtering these options by user (`dropdownMenu` option). This hook\n * can by helpful to determine if user use specified menu item or to set up one of the menu item to by always visible.\n *\n * @pro\n * @event Hooks#beforeDropdownMenuSetItems\n * @param {Array} menuItems Array of objects containing information about to generated Dropdown Menu items.\n */\n 'beforeDropdownMenuSetItems',\n\n /**\n * @description\n * Fired after hiding the Context Menu.\n *\n * @event Hooks#afterContextMenuHide\n * @param {Object} context The Context menu instance.\n */\n 'afterContextMenuHide',\n\n /**\n * @description\n * Fired before opening the Context Menu.\n *\n * @event Hooks#beforeContextMenuShow\n * @param {Object} context The Context Menu instance.\n */\n 'beforeContextMenuShow',\n\n /**\n * @description\n * Fired after opening the Context Menu.\n *\n * @event Hooks#afterContextMenuShow\n * @param {Object} context The Context Menu instance.\n */\n 'afterContextMenuShow',\n\n /**\n * @description\n * Fired after reaching the copy limit while copying data.\n *\n * @event Hooks#afterCopyLimit\n * @param {Number} selectedRows Count of selected copyable rows.\n * @param {Number} selectedColumns Count of selected copyable columns.\n * @param {Number} copyRowsLimit Current copy rows limit.\n * @param {Number} copyColumnsLimit Current copy columns limit.\n */\n 'afterCopyLimit',\n\n /**\n * Callback is fired before a new column was created.\n *\n * @since 0.28.0\n * @event Hooks#beforeCreateCol\n * @param {Number} index Represents the visual index of first newly created column in the data source array.\n * @param {Number} amount Number of newly created columns in the data source array.\n * @param {String} [source] String that identifies source of hook call\n * ([list of all available sources]{@link http://docs.handsontable.com/tutorial-using-callbacks.html#page-source-definition}).\n */\n 'beforeCreateCol',\n\n /**\n * Callback is fired after a new column was created.\n *\n * @event Hooks#afterCreateCol\n * @param {Number} index Represents the visual index of first newly created column in the data source array.\n * @param {Number} amount Number of newly created columns in the data source array.\n * @param {String} [source] String that identifies source of hook call\n * ([list of all available sources]{@link http://docs.handsontable.com/tutorial-using-callbacks.html#page-source-definition}).\n */\n 'afterCreateCol',\n\n /**\n * Callback is fired before a new row was created.\n *\n * @since 0.28.0\n * @event Hooks#beforeCreateRow\n * @param {Number} index Represents the visual index of first newly created row in the data source array.\n * @param {Number} amount Number of newly created rows in the data source array.\n * @param {String} [source] String that identifies source of hook call\n * ([list of all available sources]{@link http://docs.handsontable.com/tutorial-using-callbacks.html#page-source-definition}).\n */\n 'beforeCreateRow',\n\n /**\n * Callback is fired after a new row was created.\n *\n * @event Hooks#afterCreateRow\n * @param {Number} index Represents the visual index of first newly created row in the data source array.\n * @param {Number} amount Number of newly created rows in the data source array.\n * @param {String} [source] String that identifies source of hook call\n * ([list of all available sources]{@link http://docs.handsontable.com/tutorial-using-callbacks.html#page-source-definition}).\n */\n 'afterCreateRow',\n\n /**\n * Fired after the current cell is deselected.\n *\n * @event Hooks#afterDeselect\n */\n 'afterDeselect',\n\n /**\n * Fired after destroying the Handsontable instance.\n *\n * @event Hooks#afterDestroy\n */\n 'afterDestroy',\n\n /**\n * Fired on a `keydown` event on the document body.\n *\n * @event Hooks#afterDocumentKeyDown\n * @param {Event} event A `keydown` event.\n */\n 'afterDocumentKeyDown',\n\n /**\n * Fired inside the Walkontable's selection `draw` method. Can be used to add additional class names to cells, depending on the current selection.\n *\n * @event Hooks#afterDrawSelection\n * @param {Number} currentRow Row index of the currently processed cell.\n * @param {Number} currentColumn Column index of the currently cell.\n * @param {Array} cornersOfSelection Array of the current selection in a form of `[startRow, startColumn, endRow, endColumn]`.\n * @param {Number|undefined} layerLevel Number indicating which layer of selection is currently processed.\n * @since 0.38.1\n * @returns {String|undefined} Can return a `String`, which will act as an additional `className` to be added to the currently processed cell.\n */\n 'afterDrawSelection',\n /**\n * Fired inside the Walkontable's `refreshSelections` method. Can be used to remove additional class names from all cells in the table.\n *\n * @event Hooks#beforeRemoveCellClassNames\n * @since 0.38.1\n * @returns {String[]|undefined} Can return an `Array` of `String`s. Each of these strings will act like class names to be removed from all the cells in the table.\n */\n 'beforeRemoveCellClassNames',\n /**\n * Callback fired after getting the cell settings.\n *\n * @event Hooks#afterGetCellMeta\n * @param {Number} row Visual row index.\n * @param {Number} col Visual column index.\n * @param {Object} cellProperties Object containing the cell properties.\n */\n 'afterGetCellMeta',\n\n /**\n * Callback fired after retrieving information about a column header and appending it to the table header.\n *\n * @event Hooks#afterGetColHeader\n * @param {Number} col Visual column index.\n * @param {Element} TH Header's TH element.\n */\n 'afterGetColHeader',\n\n /**\n * Callback fired after retrieving information about a column header and appending it to the table header.\n *\n * @event Hooks#afterGetRowHeader\n * @param {Number} row Visual row index.\n * @param {Element} TH Header's TH element.\n */\n 'afterGetRowHeader',\n\n /**\n * Callback fired after Handsontable instance is initiated.\n *\n * @event Hooks#afterInit\n */\n 'afterInit',\n\n /**\n * Callback fired after new data is loaded (by `loadData` method) into the data source array.\n *\n * @event Hooks#afterLoadData\n * @param {Boolean} firstTime flag that determines whether the data has been loaded during the initialization.\n */\n 'afterLoadData',\n\n /**\n * Fired after a scroll event, which is identified as a momentum scroll (e.g. on an iPad).\n *\n * @event Hooks#afterMomentumScroll\n */\n 'afterMomentumScroll',\n\n /**\n * Fired after a `mousedown` event is triggered on the cell corner (the drag handle).\n *\n * @event Hooks#afterOnCellCornerMouseDown\n * @since 0.11\n * @param {Object} event `mousedown` event object.\n */\n 'afterOnCellCornerMouseDown',\n\n /**\n * Fired after a `dblclick` event is triggered on the cell corner (the drag handle).\n *\n * @event Hooks#afterOnCellCornerDblClick\n * @since 0.30.0\n * @param {Object} event `dblclick` event object.\n */\n 'afterOnCellCornerDblClick',\n\n /**\n * Callback fired after clicking on a cell or row/column header.\n * In case the row/column header was clicked, the index is negative.\n * For example clicking on the row header of cell (0, 0) results with `afterOnCellMouseDown` called\n * with coords `{row: 0, col: -1}`.\n *\n * @event Hooks#afterOnCellMouseDown\n * @since 0.11\n * @param {Object} event `mousedown` event object.\n * @param {Object} coords Coordinates object containing the visual row and visual column indexes of the clicked cell.\n * @param {Element} TD Cell's TD (or TH) element.\n */\n 'afterOnCellMouseDown',\n\n /**\n * Callback fired after hovering a cell or row/column header with the mouse cursor.\n * In case the row/column header was hovered, the index is negative.\n * For example, hovering over the row header of cell (0, 0) results with `afterOnCellMouseOver` called\n * with coords `{row: 0, col: -1}`.\n *\n * @event Hooks#afterOnCellMouseOver\n * @since 0.11\n * @param {Object} event `mouseover` event object.\n * @param {Object} coords Hovered cell's visual coordinate object.\n * @param {Element} TD Cell's TD (or TH) element.\n */\n 'afterOnCellMouseOver',\n\n /**\n * Callback fired after leaving a cell or row/column header with the mouse cursor.\n *\n * @event Hooks#afterOnCellMouseOut\n * @since 0.31.1\n * @param {Object} event `mouseout` event object.\n * @param {Object} coords Leaved cell's visual coordinate object.\n * @param {Element} TD Cell's TD (or TH) element.\n */\n 'afterOnCellMouseOut',\n\n /**\n * Callback is fired when one or more columns are removed.\n *\n * @event Hooks#afterRemoveCol\n * @param {Number} index Is an visual index of starter column.\n * @param {Number} amount Is an amount of removed columns.\n */\n 'afterRemoveCol',\n\n /**\n * Callback is fired when one or more rows are removed.\n *\n * @event Hooks#afterRemoveRow\n * @param {Number} index Is an visual index of starter row.\n * @param {Number} amount Is an amount of removed rows.\n */\n 'afterRemoveRow',\n\n /**\n * Callback fired after the Handsontable table is rendered.\n *\n * @event Hooks#afterRender\n * @param {Boolean} isForced Is `true` if rendering was triggered by a change of settings or data; or `false` if\n * rendering was triggered by scrolling or moving selection.\n */\n 'afterRender',\n\n /**\n * Fired before starting rendering the cell.\n *\n * @event Hooks#beforeRenderer\n * @since 0.24.2\n * @param {Element} TD Currently rendered cell's TD element.\n * @param {Number} row Visual row index.\n * @param {Number} col Visual column index.\n * @param {String|Number} prop Column property name or a column index, if datasource is an array of arrays.\n * @param {String} value Value of the rendered cell.\n * @param {Object} cellProperties Object containing the cell's properties.\n */\n 'beforeRenderer',\n\n /**\n * Fired after finishing rendering the cell (after the renderer finishes).\n *\n * @event Hooks#afterRenderer\n * @since 0.11.0\n * @param {Element} TD Currently rendered cell's TD element.\n * @param {Number} row Visual row index.\n * @param {Number} col Visual column index.\n * @param {String|Number} prop Column property name or a column index, if datasource is an array of arrays.\n * @param {String} value Value of the rendered cell.\n * @param {Object} cellProperties Object containing the cell's properties.\n */\n 'afterRenderer',\n\n /**\n * Fired after the horizontal scroll event.\n *\n * @event Hooks#afterScrollHorizontally\n * @since 0.11\n */\n 'afterScrollHorizontally',\n\n /**\n * Fired after the vertical scroll event.\n *\n * @event Hooks#afterScrollVertically\n * @since 0.11\n */\n 'afterScrollVertically',\n\n /**\n * Callback fired after one or more cells are selected (e.g. during mouse move).\n *\n * @event Hooks#afterSelection\n * @param {Number} r Selection start visual row index.\n * @param {Number} c Selection start visual column index.\n * @param {Number} r2 Selection end visual row index.\n * @param {Number} c2 Selection end visual column index.\n * @param {Object} preventScrolling Object with `value` property where its value change will be observed.\n * @param {Number} selectionLayerLevel The number which indicates what selection layer is currently modified.\n * @example\n * ```js\n * handsontable({\n * afterSelection: function (r, c, r2, c2, preventScrolling, selectionLayerLevel) {\n * // setting if prevent scrolling after selection\n * preventScrolling.value = true;\n * }\n * })\n * ```\n */\n 'afterSelection',\n\n /**\n * Callback fired after one or more cells are selected. The `p` argument represents the source object property name instead of the column number.\n *\n * @event Hooks#afterSelectionByProp\n * @param {Number} r Selection start visual row index.\n * @param {String} p Selection start data source object property name.\n * @param {Number} r2 Selection end visual row index.\n * @param {String} p2 Selection end data source object property name.\n * @param {Object} preventScrolling Object with `value` property where its value change will be observed.\n * @param {Number} selectionLayerLevel The number which indicates what selection layer is currently modified.\n * @example\n * ```js\n * handsontable({\n * afterSelectionByProp: function (r, c, r2, c2, preventScrolling, selectionLayerLevel) {\n * // setting if prevent scrolling after selection\n * preventScrolling.value = true;\n * }\n * })\n * ```\n */\n 'afterSelectionByProp',\n\n /**\n * Callback fired after one or more cells are selected (e.g. on mouse up).\n *\n * @event Hooks#afterSelectionEnd\n * @param {Number} r Selection start visual row index.\n * @param {Number} c Selection start visual column index.\n * @param {Number} r2 Selection end visual row index.\n * @param {Number} c2 Selection end visual column index.\n * @param {Number} selectionLayerLevel The number which indicates what selection layer is currently modified.\n */\n 'afterSelectionEnd',\n\n /**\n * Callback fired after one or more cells are selected (e.g. on mouse up). The `p` argument represents the data source object\n * property name instead of the column number.\n *\n * @event Hooks#afterSelectionEndByProp\n * @param {Number} r Selection start visual row index.\n * @param {String} p Selection start data source object property index.\n * @param {Number} r2 Selection end visual row index.\n * @param {String} p2 Selection end data source object property index.\n * @param {Number} selectionLayerLevel The number which indicates what selection layer is currently modified.\n */\n 'afterSelectionEndByProp',\n\n /**\n * Called after cell meta is changed.\n *\n * @event Hooks#afterSetCellMeta\n * @since 0.11.0\n * @param {Number} row Visual row index.\n * @param {Number} col Visual column index.\n * @param {String} key The updated meta key.\n * @param {*} value The updated meta value.\n */\n 'afterSetCellMeta',\n\n /**\n * Called after cell meta is removed.\n *\n * @event Hooks#afterRemoveCellMeta\n * @since 0.33.1\n * @param {Number} row Visual row index.\n * @param {Number} col Visual column index.\n * @param {String} key The removed meta key.\n * @param {*} value Value which was under removed key of cell meta.\n */\n 'afterRemoveCellMeta',\n\n /**\n * Called after cell data was changed.\n *\n * @event Hooks#afterSetDataAtCell\n * @since 0.28.0\n * @param {Array} changes An array of changes in format `[[row, col, oldValue, value], ...]`.\n * @param {String} [source] String that identifies source of hook call\n * ([list of all available sources]{@link http://docs.handsontable.com/tutorial-using-callbacks.html#page-source-definition}).\n */\n 'afterSetDataAtCell',\n\n /**\n * Called after cell data was changed.\n *\n * @event Hooks#afterSetDataAtRowProp\n * @since 0.28.0\n * @param {Array} changes An array of changes in format `[[row, prop, oldValue, value], ...]`.\n * @param {String} [source] String that identifies source of hook call\n * ([list of all available sources]{@link http://docs.handsontable.com/tutorial-using-callbacks.html#page-source-definition}).\n */\n 'afterSetDataAtRowProp',\n\n /**\n * Fired after calling the `updateSettings` method.\n *\n * @event Hooks#afterUpdateSettings\n * @param {Object} settings New settings object.\n */\n 'afterUpdateSettings',\n\n /**\n * @description\n * A plugin hook executed after validator function, only if validator function is defined.\n * Validation result is the first parameter. This can be used to determinate if validation passed successfully or not.\n *\n * __Returning false from the callback will mark the cell as invalid.__\n *\n * @event Hooks#afterValidate\n * @since 0.9.5\n * @param {Boolean} isValid `true` if valid, `false` if not.\n * @param {*} value The value in question.\n * @param {Number} row Row index.\n * @param {String|Number} prop Property name / column index.\n * @param {String} [source] String that identifies source of hook call\n * ([list of all available sources]{@link http://docs.handsontable.com/tutorial-using-callbacks.html#page-source-definition}).\n */\n 'afterValidate',\n\n /**\n * Fired before successful change of language (when proper language code was set)\n *\n * @event Hooks#beforeLanguageChange\n * @since 0.35.0\n * @param {String} languageCode New language code.\n */\n 'beforeLanguageChange',\n\n /**\n * Fired after successful change of language (when proper language code was set)\n *\n * @event Hooks#afterLanguageChange\n * @since 0.35.0\n * @param {String} languageCode New language code.\n */\n 'afterLanguageChange',\n\n /**\n * Fired before populating the data in the autofill feature.\n *\n * @event Hooks#beforeAutofill\n * @param {Object} start Object containing information about first filled cell: `{row: 2, col: 0}`.\n * @param {Object} end Object containing information about last filled cell: `{row: 4, col: 1}`.\n * @param {Array} data 2D array containing information about fill pattern: `[[\"1\", \"Ted\"], [\"1\", \"John\"]]`.\n * @param {Array} baseRange The coordinates of the base area for autofill.\n */\n 'beforeAutofill',\n\n /**\n * Fired before aligning the cell contents.\n *\n * @event Hooks#beforeCellAlignment\n * @param stateBefore\n * @param range\n * @param {String} type Type of the alignment - either `horizontal` or `vertical`\n * @param {String} alignmentClass String defining the alignment class added to the cell.\n * Possible values:\n * * `htLeft`,\n * * `htCenter`,\n * * `htRight`,\n * * `htJustify`\n * for horizontal alignment,\n *\n *\n * * `htTop`,\n * * `htMiddle`,\n * * `htBottom`\n * for vertical alignment.\n */\n 'beforeCellAlignment',\n\n /**\n * Callback fired before one or more cells is changed. Its main purpose is to alter changes silently before input.\n *\n * @event Hooks#beforeChange\n * @param {Array} changes 2D array containing information about each of the edited cells.\n * @param {String} [source] String that identifies source of hook call\n * ([list of all available sources]{@link http://docs.handsontable.com/tutorial-using-callbacks.html#page-source-definition}).\n * @example\n * ```js\n * // To disregard a single change, set changes[i] to null or remove it from array using changes.splice(i, 1).\n * ...\n * new Handsontable(document.getElementById('example'), {\n * beforeChange: function(changes, source) {\n * // [[row, prop, oldVal, newVal], ...]\n * changes[0] = null;\n * }\n * });\n * ...\n *\n * // To alter a single change, overwrite the desired value to changes[i][3].\n * ...\n * new Handsontable(document.getElementById('example'), {\n * beforeChange: function(changes, source) {\n * // [[row, prop, oldVal, newVal], ...]\n * changes[0][3] = 10;\n * }\n * });\n * ...\n *\n * // To cancel all edit, return false from the callback or set array length to 0 (changes.length = 0).\n * ...\n * new Handsontable(document.getElementById('example'), {\n * beforeChange: function(changes, source) {\n * // [[row, prop, oldVal, newVal], ...]\n * return false;\n * }\n * });\n * ...\n * ```\n */\n 'beforeChange',\n\n /**\n * Fired right before rendering the changes.\n *\n * @event Hooks#beforeChangeRender\n * @since 0.11\n * @param {Array} changes Array in form of [row, prop, oldValue, newValue].\n * @param {String} [source] String that identifies source of hook call\n * ([list of all available sources]{@link http://docs.handsontable.com/tutorial-using-callbacks.html#page-source-definition}).\n */\n 'beforeChangeRender',\n\n /**\n * Fired before drawing the borders.\n *\n * @event Hooks#beforeDrawBorders\n * @param {Array} corners Array specifying the current selection borders.\n * @param {String} borderClassName Specifies the border class name.\n */\n 'beforeDrawBorders',\n\n /**\n * Callback fired before getting cell settings.\n *\n * @event Hooks#beforeGetCellMeta\n * @param {Number} row Visual row index.\n * @param {Number} col Visual column index.\n * @param {Object} cellProperties Object containing the cell's properties.\n */\n 'beforeGetCellMeta',\n\n /**\n * Called before cell meta is removed.\n *\n * @event Hooks#beforeRemoveCellMeta\n * @since 0.33.1\n * @param {Number} row Visual row index.\n * @param {Number} col Visual column index.\n * @param {String} key The removed meta key.\n * @param {*} value Value which is under removed key of cell meta.\n */\n 'beforeRemoveCellMeta',\n\n /**\n * @description\n * Callback fired before Handsontable instance is initiated.\n *\n * @event Hooks#beforeInit\n */\n 'beforeInit',\n\n /**\n * Callback fired before Walkontable instance is initiated.\n *\n * @since 0.11\n * @event Hooks#beforeInitWalkontable\n * @param {Object} walkontableConfig Walkontable configuration object.\n */\n 'beforeInitWalkontable',\n\n /**\n * Callback fired before keydown event is handled. It can be used to overwrite default key bindings.\n * Caution - in your `beforeKeyDown` handler you need to call `event.stopImmediatePropagation()` to prevent default key behavior.\n *\n * @event Hooks#beforeKeyDown\n * @since 0.9.0\n * @param {Event} event Original DOM event.\n */\n 'beforeKeyDown',\n\n /**\n * Fired after the user clicked a cell, but before all the calculations related with it.\n *\n * @event Hooks#beforeOnCellMouseDown\n * @param {Event} event The `mousedown` event object.\n * @param {CellCoords} coords Cell coords object containing the visual coordinates of the clicked cell.\n * @param {Element} TD TD element.\n */\n 'beforeOnCellMouseDown',\n\n /**\n * Fired after the user moved cursor over a cell, but before all the calculations related with it.\n *\n * @event Hooks#beforeOnCellMouseOver\n * @param {Event} event The `mouseover` event object.\n * @param {CellCoords} coords CellCoords object containing the visual coordinates of the clicked cell.\n * @param {Element} TD TD element.\n * @param {Object} blockCalculations Contain keys 'row' and 'column' with boolean value.\n */\n 'beforeOnCellMouseOver',\n\n /**\n * Fired after the user moved cursor out from a cell, but before all the calculations related with it.\n *\n * @event Hooks#beforeOnCellMouseOut\n * @since 0.31.1\n * @param {Event} event The `mouseout` event object.\n * @param {WalkontableCellCoords} coords WalkontableCellCoords object containing the visual coordinates of the leaved cell.\n * @param {Element} TD TD element.\n */\n 'beforeOnCellMouseOut',\n\n /**\n * Callback is fired when one or more columns are about to be removed.\n *\n * @event Hooks#beforeRemoveCol\n * @param {Number} index Visual index of starter column.\n * @param {Number} amount Amount of columns to be removed.\n * @param {Array} [visualCols] Consists of visual indexes of processed columns.\n */\n 'beforeRemoveCol',\n\n /**\n * Callback is fired when one or more rows are about to be removed.\n *\n * @event Hooks#beforeRemoveRow\n * @param {Number} index Visual index of starter column.\n * @param {Number} amount Amount of columns to be removed.\n * @param {Array} [visualRows] Consists of visual indexes of processed rows.\n */\n 'beforeRemoveRow',\n\n /**\n * Callback fired before Handsontable table is rendered.\n *\n * @event Hooks#beforeRender\n * @param {Boolean} isForced If `true` rendering was triggered by a change of settings or data; or `false` if\n * rendering was triggered by scrolling or moving selection.\n */\n 'beforeRender',\n\n /**\n * Callback fired before setting range is started but not finished yet.\n *\n * @event Hooks#beforeSetRangeStartOnly\n * @param {CellCoords} coords CellCoords instance.\n */\n 'beforeSetRangeStartOnly',\n\n /**\n * Callback fired before setting range is started.\n *\n * @event Hooks#beforeSetRangeStart\n * @param {CellCoords} coords CellCoords instance.\n */\n 'beforeSetRangeStart',\n\n /**\n * Callback fired before setting range is ended.\n *\n * @event Hooks#beforeSetRangeEnd\n * @param {CellCoords} coords CellCoords instance.\n */\n 'beforeSetRangeEnd',\n\n /**\n * Fired before the logic of handling a touch scroll, when user started scrolling on a touch-enabled device.\n *\n * @event Hooks#beforeTouchScroll\n */\n 'beforeTouchScroll',\n\n /**\n * @description\n * A plugin hook executed before validator function, only if validator function is defined.\n * This can be used to manipulate the value of changed cell before it is applied to the validator function.\n *\n * __Notice:__ this will not affect values of changes. This will change value ONLY for validation!\n *\n * @event Hooks#beforeValidate\n * @since 0.9.5\n * @param {*} value Value of the cell.\n * @param {Number} row Row index.\n * @param {String|Number} prop Property name / column index.\n * @param {String} [source] String that identifies source of hook call\n * ([list of all available sources]{@link http://docs.handsontable.com/tutorial-using-callbacks.html#page-source-definition}).\n */\n 'beforeValidate',\n\n /**\n * Callback fired before cell value is rendered into the DOM (through renderer function).\n *\n * @event Hooks#beforeValueRender\n * @since 0.29.0\n * @param {*} value Cell value to render.\n */\n 'beforeValueRender',\n\n /**\n * Callback fired after Handsontable instance is constructed (via `new` operator).\n *\n * @event Hooks#construct\n * @since 0.16.1\n */\n 'construct',\n\n /**\n * Callback fired after Handsontable instance is initiated but before table is rendered.\n *\n * @event Hooks#init\n * @since 0.16.1\n */\n 'init',\n\n /**\n * Fired when a column index is about to be modified by a callback function.\n *\n * @event Hooks#modifyCol\n * @since 0.11\n * @param {Number} col Visual column index.\n */\n 'modifyCol',\n\n /**\n * Fired when a column index is about to be de-modified by a callback function.\n *\n * @event Hooks#unmodifyCol\n * @since 0.23.0\n * @param {Number} col Physical column index.\n */\n 'unmodifyCol',\n\n /**\n * Fired when a physical row index is about to be de-modified by a callback function.\n *\n * @event Hooks#unmodifyRow\n * @since 0.26.2\n * @param {Number} row Physical row index.\n */\n 'unmodifyRow',\n /**\n * Fired when a column header index is about to be modified by a callback function.\n *\n * @event Hooks#modifyColHeader\n * @since 0.20.0\n * @param {Number} column Visual column header index.\n */\n 'modifyColHeader',\n\n /**\n * Fired when a column width is about to be modified by a callback function.\n *\n * @event Hooks#modifyColWidth\n * @since 0.11\n * @param {Number} width Current column width.\n * @param {Number} col Column index.\n */\n 'modifyColWidth',\n\n /**\n * Fired when a row index is about to be modified by a callback function.\n *\n * @event Hooks#modifyRow\n * @since 0.11\n * @param {Number} row Row index.\n */\n 'modifyRow',\n\n /**\n * Fired when a row header index is about to be modified by a callback function.\n *\n * @event Hooks#modifyRowHeader\n * @since 0.20.0\n * @param {Number} row Row header index.\n */\n 'modifyRowHeader',\n\n /**\n * Fired when a row height is about to be modified by a callback function.\n *\n * @event Hooks#modifyRowHeight\n * @since 0.11.0\n * @param {Number} height Row height.\n * @param {Number} row Row index.\n */\n 'modifyRowHeight',\n\n /**\n * Fired when a data was retrieved or modified.\n *\n * @event Hooks#modifyData\n * @since 0.28.0\n * @param {Number} row Row height.\n * @param {Number} column Column index.\n * @param {Object} valueHolder Object which contains original value which can be modified by overwriting `.value` property.\n * @param {String} ioMode String which indicates for what operation hook is fired (`get` or `set`).\n */\n 'modifyData',\n\n /**\n * Fired when a data was retrieved or modified.\n *\n * @event Hooks#modifyRowData\n * @since 0.28.0\n * @param {Number} row Physical row index.\n */\n 'modifyRowData',\n\n /**\n * Used to modify the cell coordinates when using the `getCell` method.\n *\n * @event Hooks#modifyGetCellCoords\n * @since 0.36.0\n * @param {Number} row Visual row index.\n * @param {Number} col Visual column index.\n * @param {Boolean} topmost If set to true, it returns the TD element from the topmost overlay. For example,\n * if the wanted cell is in the range of fixed rows, it will return a TD element from the `top` overlay.\n */\n 'modifyGetCellCoords',\n\n /**\n * Fired after loading data using the Persistent State plugin.\n *\n * @event Hooks#persistentStateLoad\n * @param {String} key Key string.\n * @param {Object} valuePlaceholder Object containing the loaded data.\n */\n 'persistentStateLoad',\n\n /**\n * Fired after resetting data using the Persistent State plugin.\n *\n * @event Hooks#persistentStateReset\n * @param {String} key Key string.\n */\n 'persistentStateReset',\n\n /**\n * Fired after resetting data using the Persistent State plugin.\n *\n * @event Hooks#persistentStateSave\n * @param {String} key Key string.\n * @param {Mixed} value Value to save.\n */\n 'persistentStateSave',\n\n /**\n * Fired before sorting the column. If you return `false` value then sorting will be not applied by\n * Handsontable (useful for server-side sorting).\n *\n * @event Hooks#beforeColumnSort\n * @param {Number} column Sorted visual column index.\n * @param {Boolean} order Soring order where:\n * * `true` means ascending order,\n * * `false` means descending order,\n * * `undefined` means original order.\n */\n 'beforeColumnSort',\n\n /**\n * Fired after sorting the column.\n *\n * @event Hooks#afterColumnSort\n * @param {Number} column Sorted visual column index.\n * @param {Boolean} order Soring order where:\n * * `true` means ascending order\n * * `false` means descending order\n * * `undefined` means original order\n */\n 'afterColumnSort',\n\n /**\n * @description\n * Fired after setting range of autofill.\n * Both arguments are provided in the following format:\n * ```js\n * [startRow, startColumn, endRow, endColumn]\n * ```\n *\n * @event Hooks#modifyAutofillRange\n * @param {Array} startArea Array of visual coordinates of the starting point for the drag-down operation.\n * @param {Array} entireArea Array of visual coordinates of the entire area of the drag-down operation.\n */\n 'modifyAutofillRange',\n\n /**\n * Fired to allow modifying the copyable range with a callback function.\n *\n * @since 0.19.0\n * @event Hooks#modifyCopyableRange\n * @param {Array} copyableRanges Array of objects defining copyable cells.\n */\n 'modifyCopyableRange',\n\n /**\n * Called before copying the values into clipboard and before clearing values of the selected cells.\n *\n * @event Hooks#beforeCut\n * @since 0.31.1\n * @param {Array} data An array of arrays which contains data to cut.\n * @param {Array} coords An array of objects with ranges of the visual indexes (`startRow`, `startCol`, `endRow`, `endCol`)\n * which will be cut out.\n * @returns {*} If returns `false` then operation of the cutting out is cancelled.\n *\n * @example\n * ```js\n * // To disregard a single row, remove it from array using data.splice(i, 1).\n * ...\n * new Handsontable(document.getElementById('example'), {\n * beforeCut: function(data, coords) {\n * // data -> [[1, 2, 3], [4, 5, 6]]\n * data.splice(0, 1);\n * // data -> [[4, 5, 6]]\n * // coords -> [{startRow: 0, startCol: 0, endRow: 1, endCol: 2}]\n * }\n * });\n * ...\n *\n * // To cancel cutting out, return false from the callback.\n * ...\n * new Handsontable(document.getElementById('example'), {\n * beforeCut: function(data, coords) {\n * return false;\n * }\n * });\n * ...\n * ```\n */\n 'beforeCut',\n\n /**\n * Fired after data are cutted out from the table.\n *\n * @event Hooks#afterCut\n * @since 0.31.1\n * @param {Array} data An array of arrays which contains the cutted out data.\n * @param {Array} coords An array of objects with ranges of the visual indexes (`startRow`, `startCol`, `endRow`, `endCol`)\n * which was cut out.\n */\n 'afterCut',\n\n /**\n * Fired before values are copied into clipboard.\n *\n * @event Hooks#beforeCopy\n * @since 0.31.1\n * @param {Array} data An array of arrays which contains data to copied.\n * @param {Array} coords An array of objects with ranges of the visual indexes (`startRow`, `startCol`, `endRow`, `endCol`)\n * which will copied.\n * @returns {*} If returns `false` then copying is cancelled.\n *\n * @example\n * ```js\n * // To disregard a single row, remove it from array using data.splice(i, 1).\n * ...\n * new Handsontable(document.getElementById('example'), {\n * beforeCopy: function(data, coords) {\n * // data -> [[1, 2, 3], [4, 5, 6]]\n * data.splice(0, 1);\n * // data -> [[4, 5, 6]]\n * // coords -> [{startRow: 0, startCol: 0, endRow: 1, endCol: 2}]\n * }\n * });\n * ...\n *\n * // To cancel copying, return false from the callback.\n * ...\n * new Handsontable(document.getElementById('example'), {\n * beforeCopy: function(data, coords) {\n * return false;\n * }\n * });\n * ...\n * ```\n */\n 'beforeCopy',\n\n /**\n * Fired after data are pasted into table.\n *\n * @event Hooks#afterCopy\n * @since 0.31.1\n * @param {Array} data An array of arrays which contains the copied data.\n * @param {Array} coords An array of objects with ranges of the visual indexes (`startRow`, `startCol`, `endRow`, `endCol`)\n * which was copied.\n */\n 'afterCopy',\n\n /**\n * Fired before values are pasted into table.\n *\n * @event Hooks#beforePaste\n * @since 0.31.1\n * @param {Array} data An array of arrays which contains data to paste.\n * @param {Array} coords An array of objects with ranges of the visual indexes (`startRow`, `startCol`, `endRow`, `endCol`)\n * that correspond to the previously selected area.\n * @returns {*} If returns `false` then pasting is cancelled.\n *\n * @example\n * ```js\n * // To disregard a single row, remove it from array using data.splice(i, 1).\n * ...\n * new Handsontable(document.getElementById('example'), {\n * beforePaste: function(data, coords) {\n * // data -> [[1, 2, 3], [4, 5, 6]]\n * data.splice(0, 1);\n * // data -> [[4, 5, 6]]\n * // coords -> [{startRow: 0, startCol: 0, endRow: 1, endCol: 2}]\n * }\n * });\n * ...\n *\n * // To cancel pasting, return false from the callback.\n * ...\n * new Handsontable(document.getElementById('example'), {\n * beforePaste: function(data, coords) {\n * return false;\n * }\n * });\n * ...\n * ```\n */\n 'beforePaste',\n\n /**\n * Fired after values are pasted into table.\n *\n * @event Hooks#afterPaste\n * @since 0.31.1\n * @param {Array} data An array of arrays which contains the pasted data.\n * @param {Array} coords An array of objects with ranges of the visual indexes (`startRow`, `startCol`, `endRow`, `endCol`)\n * that correspond to the previously selected area.\n */\n 'afterPaste',\n\n /**\n * Fired before change order of the visual indexes.\n *\n * @event Hooks#beforeColumnMove\n * @param {Array} columns Array of visual column indexes to be moved.\n * @param {Number} target Visual column index being a target for moved columns.\n */\n 'beforeColumnMove',\n\n /**\n * Fired after change order of the visual indexes.\n *\n * @event Hooks#afterColumnMove\n * @param {Array} columns Array of visual column indexes that were moved.\n * @param {Number} target Visual column index being a target for moved columns.\n */\n 'afterColumnMove',\n\n /**\n * Fired before change order of the visual indexes.\n *\n * @event Hooks#beforeRowMove\n * @param {Array} rows Array of visual row indexes to be moved.\n * @param {Number} target Visual row index being a target for moved rows.\n */\n 'beforeRowMove',\n\n /**\n * Fired after change order of the visual indexes.\n *\n * @event Hooks#afterRowMove\n * @param {Array} rows Array of visual row indexes that were moved.\n * @param {Number} target Visual row index being a target for moved rows.\n */\n 'afterRowMove',\n\n /**\n * Fired before rendering the table with modified column sizes.\n *\n * @event Hooks#beforeColumnResize\n * @param {Number} currentColumn Visual index of the resized column.\n * @param {Number} newSize Calculated new column width.\n * @param {Boolean} isDoubleClick Flag that determines whether there was a double-click.\n * @returns {Number} Returns a new column size or `undefined`, if column size should be calculated automatically.\n */\n 'beforeColumnResize',\n\n /**\n * Fired after rendering the table with modified column sizes.\n *\n * @event Hooks#afterColumnResize\n * @param {Number} currentColumn Visual index of the resized column.\n * @param {Number} newSize Calculated new column width.\n * @param {Boolean} isDoubleClick Flag that determines whether there was a double-click.\n */\n 'afterColumnResize',\n\n /**\n * Fired before rendering the table with modified row sizes.\n *\n * @event Hooks#beforeRowResize\n * @param {Number} currentRow Visual index of the resized row.\n * @param {Number} newSize Calculated new row height.\n * @param {Boolean} isDoubleClick Flag that determines whether there was a double-click.\n * @returns {Number} Returns the new row size or `undefined` if row size should be calculated automatically.\n */\n 'beforeRowResize',\n\n /**\n * Fired after rendering the table with modified row sizes.\n *\n * @event Hooks#afterRowResize\n * @param {Number} currentRow Visual index of the resized row.\n * @param {Number} newSize Calculated new row height.\n * @param {Boolean} isDoubleClick Flag that determines whether there was a double-click.\n */\n 'afterRowResize',\n\n /**\n * Fired after getting the column header renderers.\n *\n * @event Hooks#afterGetColumnHeaderRenderers\n * @param {Array} array Array of the column header renderers.\n */\n 'afterGetColumnHeaderRenderers',\n\n /**\n * Fired after getting the row header renderers.\n *\n * @event Hooks#afterGetRowHeaderRenderers\n * @param {Array} array Array of the row header renderers.\n */\n 'afterGetRowHeaderRenderers',\n\n /**\n * Fired before applying stretched column width to column.\n *\n * @event Hooks#beforeStretchingColumnWidth\n * @param {Number} stretchedWidth Calculated width.\n * @param {Number} column Visual column index.\n * @returns {Number} Returns new width which will be applied to the column element.\n */\n 'beforeStretchingColumnWidth',\n\n /**\n * Fired before applying [filtering]{@link http://docs.handsontable.com/pro/demo-filtering.html}.\n *\n * @pro\n * @event Hooks#beforeFilter\n * @param {Array} conditionsStack An array of objects with added formulas.\n * @returns {Boolean} If hook returns `false` value then filtering won't be applied on the UI side (server-side filtering).\n */\n 'beforeFilter',\n\n /**\n * Fired after applying [filtering]{@link http://docs.handsontable.com/pro/demo-filtering.html}.\n *\n * @pro\n * @event Hooks#afterFilter\n * @param {Array} conditionsStack An array of objects with added formulas.\n */\n 'afterFilter',\n\n /**\n * Used to modify the column header height.\n *\n * @event Hooks#modifyColumnHeaderHeight\n * @since 0.25.0\n * @param {Number} col Visual column index.\n */\n 'modifyColumnHeaderHeight',\n\n /**\n * Fired before the undo action. Contains information about the action that is being undone.\n *\n * @event Hooks#beforeUndo\n * @since 0.26.2\n * @param {Object} action The action object. Contains information about the action being undone. The `actionType`\n * property of the object specifies the type of the action in a String format. (e.g. `'remove_row'`).\n */\n 'beforeUndo',\n\n /**\n * Fired after the undo action. Contains information about the action that is being undone.\n *\n * @event Hooks#afterUndo\n * @since 0.26.2\n * @param {Object} action The action object. Contains information about the action being undone. The `actionType`\n * property of the object specifies the type of the action in a String format. (e.g. `'remove_row'`).\n */\n 'afterUndo',\n\n /**\n * Fired before the redo action. Contains information about the action that is being redone.\n *\n * @event Hooks#beforeRedo\n * @since 0.26.2\n * @param {Object} action The action object. Contains information about the action being redone. The `actionType`\n * property of the object specifies the type of the action in a String format. (e.g. `'remove_row'`).\n */\n 'beforeRedo',\n\n /**\n * Fired after the redo action. Contains information about the action that is being redone.\n *\n * @event Hooks#afterRedo\n * @since 0.26.2\n * @param {Object} action The action object. Contains information about the action being redone. The `actionType`\n * property of the object specifies the type of the action in a String format. (e.g. `'remove_row'`).\n */\n 'afterRedo',\n\n /**\n * Used to modify the row header width.\n *\n * @event Hooks#modifyRowHeaderWidth\n * @param {Number} rowHeaderWidth Row header width.\n */\n 'modifyRowHeaderWidth',\n\n /**\n * Fired from the `populateFromArray` method during the `autofill` process. Fired for each \"autofilled\" cell individually.\n *\n * @event Hooks#beforeAutofillInsidePopulate\n * @param {Object} index Object containing `row` and `col` properties, defining the number of rows/columns from the initial cell of the autofill.\n * @param {String} direction Declares the direction of the autofill. Possible values: `up`, `down`, `left`, `right`.\n * @param {Array} input Array of arrays. Contains an array of rows with data being used in the autofill.\n * @param {Array} deltas The deltas array passed to the `populateFromArray` method.\n */\n 'beforeAutofillInsidePopulate',\n\n /**\n * Fired when the start of the selection is being modified. (e.g. moving the selection with the arrow keys).\n *\n * @event Hooks#modifyTransformStart\n * @param {CellCoords} delta Cell coords object declaring the delta of the new selection relative to the previous one.\n */\n 'modifyTransformStart',\n\n /**\n * Fired when the end of the selection is being modified. (e.g. moving the selection with the arrow keys).\n *\n * @event Hooks#modifyTransformEnd\n * @param {CellCoords} delta Cell coords object declaring the delta of the new selection relative to the previous one.\n */\n 'modifyTransformEnd',\n\n /**\n * Fired after the start of the selection is being modified. (e.g. moving the selection with the arrow keys).\n *\n * @event Hooks#afterModifyTransformStart\n * @param {CellCoords} coords Coords of the freshly selected cell.\n * @param {Number} rowTransformDir `-1` if trying to select a cell with a negative row index. `0` otherwise.\n * @param {Number} colTransformDir `-1` if trying to select a cell with a negative column index. `0` otherwise.\n */\n 'afterModifyTransformStart',\n\n /**\n * Fired after the end of the selection is being modified. (e.g. moving the selection with the arrow keys).\n *\n * @event Hooks#afterModifyTransformEnd\n * @param {CellCoords} coords Visual coords of the freshly selected cell.\n * @param {Number} rowTransformDir `-1` if trying to select a cell with a negative row index. `0` otherwise.\n * @param {Number} colTransformDir `-1` if trying to select a cell with a negative column index. `0` otherwise.\n */\n 'afterModifyTransformEnd',\n\n /**\n * Fired inside the `viewportRowCalculatorOverride` method. Allows modifying the row calculator parameters.\n *\n * @event Hooks#afterViewportRowCalculatorOverride\n * @param {Object} calc The row calculator.\n */\n 'afterViewportRowCalculatorOverride',\n\n /**\n * Fired inside the `viewportColumnCalculatorOverride` method. Allows modifying the row calculator parameters.\n *\n * @event Hooks#afterViewportColumnCalculatorOverride\n * @param {Object} calc The row calculator.\n */\n 'afterViewportColumnCalculatorOverride',\n\n /**\n * Fired after initializing all the plugins.\n *\n * @event Hooks#afterPluginsInitialized\n */\n 'afterPluginsInitialized',\n\n /**\n * Used when saving/loading the manual row heights state.\n *\n * @event Hooks#manualRowHeights\n * @param {Array} state The current manual row heights state.\n */\n 'manualRowHeights',\n\n /**\n * Used to skip the length cache calculation for a defined period of time.\n *\n * @event Hooks#skipLengthCache\n * @param {Number} delay The delay in milliseconds.\n */\n 'skipLengthCache',\n\n /**\n * Fired after trimming rows in the TrimRows plugin.\n *\n * @pro\n * @event Hooks#afterTrimRow\n * @param {Array} rows Physical indexes of trimmed rows.\n */\n 'afterTrimRow',\n\n /**\n * Fired after untrimming rows in the TrimRows plugin.\n *\n * @pro\n * @event Hooks#afterUntrimRow\n * @param {Array} rows Physical indexes of untrimmed rows.\n */\n 'afterUntrimRow',\n\n /**\n * Fired before opening the dropdown menu.\n *\n * @pro\n * @event Hooks#beforeDropdownMenuShow\n * @param {DropdownMenu} instance The DropdownMenu instance.\n */\n 'beforeDropdownMenuShow',\n\n /**\n * Fired after opening the dropdown menu.\n *\n * @pro\n * @event Hooks#afterDropdownMenuShow\n * @param {DropdownMenu} instance The DropdownMenu instance.\n */\n 'afterDropdownMenuShow',\n\n /**\n * Fired after hiding the dropdown menu.\n *\n * @pro\n * @event Hooks#afterDropdownMenuHide\n * @param {DropdownMenu} instance The DropdownMenu instance.\n */\n 'afterDropdownMenuHide',\n\n /**\n * Used to check whether the provided row index is hidden.\n *\n * @pro\n * @event Hooks#hiddenRow\n * @param {Number} row The visual row index in question.\n */\n 'hiddenRow',\n\n /**\n * Used to check whether the provided column index is hidden.\n *\n * @pro\n * @event Hooks#hiddenColumn\n * @param {Number} column The visual column index in question.\n */\n 'hiddenColumn',\n\n /**\n * Fired before adding a children to the NestedRows structure.\n *\n * @pro\n * @event Hooks#beforeAddChild\n * @param {Object} parent The parent object.\n * @param {Object|undefined} element The element added as a child. If `undefined`, a blank child was added.\n * @param {Number|undefined} index The index within the parent where the new child was added. If `undefined`, the element was added as the last child.\n */\n 'beforeAddChild',\n\n /**\n * Fired after adding a children to the NestedRows structure.\n *\n * @pro\n * @event Hooks#afterAddChild\n * @param {Object} parent The parent object.\n * @param {Object|undefined} element The element added as a child. If `undefined`, a blank child was added.\n * @param {Number|undefined} index The index within the parent where the new child was added. If `undefined`, the element was added as the last child.\n */\n 'afterAddChild',\n\n /**\n * Fired before detaching a child from its parent in the NestedRows plugin.\n *\n * @pro\n * @event Hooks#beforeDetachChild\n * @param {Object} parent An object representing the parent from which the element is to be detached.\n * @param {Object} element The detached element.\n */\n 'beforeDetachChild',\n\n /**\n * Fired after detaching a child from its parent in the NestedRows plugin.\n *\n * @pro\n * @event Hooks#afterDetachChild\n * @param {Object} parent An object representing the parent from which the element was detached.\n * @param {Object} element The detached element.\n */\n 'afterDetachChild',\n\n /**\n * Fired after the editor is opened and rendered.\n *\n * @event Hooks#afterBeginEditing\n * @param {Number} row Row index of the edited cell.\n * @param {Number} column Column index of the edited cell.\n */\n 'afterBeginEditing',\n\n /**\n * Fired before cell merging.\n *\n * @event Hooks#beforeMergeCells\n * @param {CellRange} cellRange Selection cell range.\n * @param {Boolean} [auto=false] `true` if called automatically by the plugin.\n */\n 'beforeMergeCells',\n\n /**\n * Fired after cell merging.\n *\n * @event Hooks#afterMergeCells\n * @param {CellRange} cellRange Selection cell range.\n * @param {Object} mergeParent The parent collection of the provided cell range.\n * @param {Boolean} [auto=false] `true` if called automatically by the plugin.\n */\n 'afterMergeCells',\n\n /**\n * Fired before unmerging the cells.\n *\n * @event Hooks#beforeUnmergeCells\n * @param {CellRange} cellRange Selection cell range.\n * @param {Boolean} [auto=false] `true` if called automatically by the plugin.\n */\n 'beforeUnmergeCells',\n\n /**\n * Fired after unmerging the cells.\n *\n * @event Hooks#beforeUnmergeCells\n * @param {CellRange} cellRange Selection cell range.\n * @param {Boolean} [auto=false] `true` if called automatically by the plugin.\n */\n 'afterUnmergeCells',\n\n /**\n * Fired after the listening is turned on.\n *\n * @event Hooks#afterListen\n * @since 0.34.5\n */\n 'afterListen',\n\n /**\n * Fired after the listening is turned off.\n *\n * @event Hooks#afterUnlisten\n * @since 0.34.5\n */\n 'afterUnlisten',\n];\n\nclass Hooks {\n static getSingleton() {\n return globalSingleton;\n }\n\n /**\n *\n */\n constructor() {\n this.globalBucket = this.createEmptyBucket();\n }\n\n /**\n * Returns a new object with empty handlers related to every registered hook name.\n *\n * @returns {Object} The empty bucket object.\n *\n * @example\n * ```js\n * Handsontable.hooks.createEmptyBucket();\n * // Results:\n * {\n * ...\n * afterCreateCol: [],\n * afterCreateRow: [],\n * beforeInit: [],\n * ...\n * }\n * ```\n */\n createEmptyBucket() {\n const bucket = Object.create(null);\n\n // eslint-disable-next-line no-return-assign\n arrayEach(REGISTERED_HOOKS, (hook) => (bucket[hook] = []));\n\n return bucket;\n }\n\n /**\n * Get hook bucket based on the context of the object or if argument is `undefined`, get the global hook bucket.\n *\n * @param {Object} [context=null] A Handsontable instance.\n * @returns {Object} Returns a global or Handsontable instance bucket.\n */\n getBucket(context = null) {\n if (context) {\n if (!context.pluginHookBucket) {\n context.pluginHookBucket = this.createEmptyBucket();\n }\n\n return context.pluginHookBucket;\n }\n\n return this.globalBucket;\n }\n\n /**\n * Adds a listener (globally or locally) to a specified hook name.\n * If the `context` parameter is provided, the hook will be added only to the instance it references.\n * Otherwise, the callback will be used everytime the hook fires on any Handsontable instance.\n * You can provide an array of callback functions as the `callback` argument, this way they will all be fired\n * once the hook is triggered.\n *\n * @see Core#addHook\n * @param {String} key Hook name.\n * @param {Function|Array} callback Callback function or an array of functions.\n * @param {Object} [context=null] The context for the hook callback to be added - a Handsontable instance or leave empty.\n * @returns {Hooks} Instance of Hooks.\n *\n * @example\n * ```js\n * // single callback, added locally\n * Handsontable.hooks.add('beforeInit', myCallback, hotInstance);\n *\n * // single callback, added globally\n * Handsontable.hooks.add('beforeInit', myCallback);\n *\n * // multiple callbacks, added locally\n * Handsontable.hooks.add('beforeInit', [myCallback, anotherCallback], hotInstance);\n *\n * // multiple callbacks, added globally\n * Handsontable.hooks.add('beforeInit', [myCallback, anotherCallback]);\n * ```\n */\n add(key, callback, context = null) {\n if (Array.isArray(callback)) {\n arrayEach(callback, (c) => this.add(key, c, context));\n\n } else {\n const bucket = this.getBucket(context);\n\n if (typeof bucket[key] === 'undefined') {\n this.register(key);\n bucket[key] = [];\n }\n callback.skip = false;\n\n if (bucket[key].indexOf(callback) === -1) {\n // only add a hook if it has not already been added (adding the same hook twice is now silently ignored)\n let foundInitialHook = false;\n\n if (callback.initialHook) {\n arrayEach(bucket[key], (cb, i) => {\n if (cb.initialHook) {\n bucket[key][i] = callback;\n foundInitialHook = true;\n\n return false;\n }\n });\n }\n\n if (!foundInitialHook) {\n bucket[key].push(callback);\n }\n }\n }\n\n return this;\n }\n\n /**\n * Adds a listener to a specified hook. After the hook runs this listener will be automatically removed from the bucket.\n *\n * @see Core#addHookOnce\n * @param {String} key Hook/Event name.\n * @param {Function|Array} callback Callback function.\n * @param {Object} [context=null] A Handsontable instance.\n *\n * @example\n * ```js\n * Handsontable.hooks.once('beforeInit', myCallback, hotInstance);\n * ```\n */\n once(key, callback, context = null) {\n if (Array.isArray(callback)) {\n arrayEach(callback, (c) => this.once(key, c, context));\n\n } else {\n callback.runOnce = true;\n this.add(key, callback, context);\n }\n }\n\n /**\n * Removes a listener from a hook with a given name. If the `context` argument is provided, it removes a listener from a local hook assigned to the given Handsontable instance.\n *\n * @see Core#removeHook\n * @param {String} key Hook/Event name.\n * @param {Function} callback Callback function (needs the be the function that was previously added to the hook).\n * @param {Object} [context=null] Handsontable instance.\n * @return {Boolean} Returns `true` if hook was removed, `false` otherwise.\n *\n * @example\n * ```js\n * Handsontable.hooks.remove('beforeInit', myCallback);\n * ```\n */\n remove(key, callback, context = null) {\n let bucket = this.getBucket(context);\n\n if (typeof bucket[key] !== 'undefined') {\n if (bucket[key].indexOf(callback) >= 0) {\n callback.skip = true;\n\n return true;\n }\n }\n\n return false;\n }\n\n /**\n * Checks whether there are any registered listeners for the provided hook name.\n * If the `context` parameter is provided, it only checks for listeners assigned to the given Handsontable instance.\n *\n * @param {String} key Hook name.\n * @param {Object} [context=null] A Handsontable instance.\n * @returns {Boolean} `true` for success, `false` otherwise.\n */\n has(key, context = null) {\n let bucket = this.getBucket(context);\n\n return !!(bucket[key] !== void 0 && bucket[key].length);\n }\n\n /**\n * Runs all local and global callbacks assigned to the hook identified by the `key` parameter.\n * It returns either a return value from the last called callback or the first parameter (`p1`) passed to the `run` function.\n *\n * @see Core#runHooks\n * @param {Object} context Handsontable instance.\n * @param {String} key Hook/Event name.\n * @param {*} [p1] Parameter to be passed as an argument to the callback function.\n * @param {*} [p2] Parameter to be passed as an argument to the callback function.\n * @param {*} [p3] Parameter to be passed as an argument to the callback function.\n * @param {*} [p4] Parameter to be passed as an argument to the callback function.\n * @param {*} [p5] Parameter to be passed as an argument to the callback function.\n * @param {*} [p6] Parameter to be passed as an argument to the callback function.\n * @returns {*} Either a return value from the last called callback or `p1`.\n *\n * @example\n * ```js\n * Handsontable.hooks.run(hot, 'beforeInit');\n * ```\n */\n run(context, key, p1, p2, p3, p4, p5, p6) {\n {\n const globalHandlers = this.globalBucket[key];\n let index = -1;\n let length = globalHandlers ? globalHandlers.length : 0;\n\n if (length) {\n // Do not optimise this loop with arrayEach or arrow function! If you do You'll decrease perf because of GC.\n while (++index < length) {\n if (!globalHandlers[index] || globalHandlers[index].skip) {\n /* eslint-disable no-continue */\n continue;\n }\n // performance considerations - http://jsperf.com/call-vs-apply-for-a-plugin-architecture\n let res = globalHandlers[index].call(context, p1, p2, p3, p4, p5, p6);\n\n if (res !== void 0) {\n p1 = res;\n }\n if (globalHandlers[index] && globalHandlers[index].runOnce) {\n this.remove(key, globalHandlers[index]);\n }\n }\n }\n }\n {\n const localHandlers = this.getBucket(context)[key];\n let index = -1;\n let length = localHandlers ? localHandlers.length : 0;\n\n if (length) {\n // Do not optimise this loop with arrayEach or arrow function! If you do You'll decrease perf because of GC.\n while (++index < length) {\n if (!localHandlers[index] || localHandlers[index].skip) {\n /* eslint-disable no-continue */\n continue;\n }\n // performance considerations - http://jsperf.com/call-vs-apply-for-a-plugin-architecture\n let res = localHandlers[index].call(context, p1, p2, p3, p4, p5, p6);\n\n if (res !== void 0) {\n p1 = res;\n }\n if (localHandlers[index] && localHandlers[index].runOnce) {\n this.remove(key, localHandlers[index], context);\n }\n }\n }\n }\n\n return p1;\n }\n\n /**\n * Destroy all listeners connected to the context. If no context is provided, the global listeners will be destroyed.\n *\n * @param {Object} [context=null] A Handsontable instance.\n * @example\n * ```js\n * // destroy the global listeners\n * Handsontable.hooks.destroy();\n *\n * // destroy the local listeners\n * Handsontable.hooks.destroy(hotInstance);\n * ```\n */\n destroy(context = null) {\n // eslint-disable-next-line no-return-assign\n objectEach(this.getBucket(context), (value, key, bucket) => (bucket[key].length = 0));\n }\n\n /**\n * Registers a hook name (adds it to the list of the known hook names). Used by plugins.\n * It is not necessary to call register, but if you use it, your plugin hook will be used returned by\n * the `getRegistered` method. (which itself is used in the demo http://docs.handsontable.com/tutorial-callbacks.html).\n *\n * @param key {String} The hook name.\n *\n * @example\n * ```js\n * Handsontable.hooks.register('myHook');\n * ```\n */\n register(key) {\n if (!this.isRegistered(key)) {\n REGISTERED_HOOKS.push(key);\n }\n }\n\n /**\n * Deregisters a hook name (removes it from the list of known hook names).\n *\n * @param key {String} Hook name.\n *\n * @example\n * ```js\n * Handsontable.hooks.deregister('myHook');\n * ```\n */\n deregister(key) {\n if (this.isRegistered(key)) {\n REGISTERED_HOOKS.splice(REGISTERED_HOOKS.indexOf(key), 1);\n }\n }\n\n /**\n * Returns a boolean depending on if a hook by such name has been registered.\n *\n * @param key {String} Hook name.\n * @returns {Boolean} `true` for success, `false` otherwise.\n *\n * @example\n * ```js\n * Handsontable.hooks.isRegistered('beforeInit');\n *\n * // Results:\n * true\n * ```\n */\n isRegistered(key) {\n return REGISTERED_HOOKS.indexOf(key) >= 0;\n }\n\n /**\n * Returns an array of registered hooks.\n *\n * @returns {Array} An array of registered hooks.\n *\n * @example\n * ```js\n * Handsontable.hooks.getRegistered();\n *\n * // Results:\n * [\n * ...\n * 'beforeInit',\n * 'beforeRender',\n * 'beforeSetRangeEnd',\n * 'beforeDrawBorders',\n * 'beforeChange',\n * ...\n * ]\n * ```\n */\n getRegistered() {\n return REGISTERED_HOOKS;\n }\n}\n\nconst globalSingleton = new Hooks();\n\nexport default Hooks;\n\n\n\n// WEBPACK FOOTER //\n// ./src/pluginHooks.js","import moment from 'moment';\nimport {toSingleLine} from './templateLiteralTag';\n\n/**\n * Converts any value to string.\n *\n * @param {*} value\n * @returns {String}\n */\nexport function stringify(value) {\n let result;\n\n switch (typeof value) {\n case 'string':\n case 'number':\n result = `${value}`;\n break;\n\n case 'object':\n result = value === null ? '' : value.toString();\n break;\n case 'undefined':\n result = '';\n break;\n default:\n result = value.toString();\n break;\n }\n\n return result;\n}\n\n/**\n * Checks if given variable is defined.\n *\n * @param {*} variable Variable to check.\n * @returns {Boolean}\n */\nexport function isDefined(variable) {\n return typeof variable !== 'undefined';\n}\n\n/**\n * Checks if given variable is undefined.\n *\n * @param {*} variable Variable to check.\n * @returns {Boolean}\n */\nexport function isUndefined(variable) {\n return typeof variable === 'undefined';\n}\n\n/**\n * Check if given variable is null, empty string or undefined.\n *\n * @param {*} variable Variable to check.\n * @returns {Boolean}\n */\nexport function isEmpty(variable) {\n return variable === null || variable === '' || isUndefined(variable);\n}\n\n/**\n * Check if given variable is a regular expression.\n *\n * @param {*} variable Variable to check.\n * @returns {Boolean}\n */\nexport function isRegExp(variable) {\n return Object.prototype.toString.call(variable) === '[object RegExp]';\n}\n\n/* eslint-disable */\nconst _m = '\\x6C\\x65\\x6E\\x67\\x74\\x68';\nconst _hd = (v) => parseInt(v, 16);\nconst _pi = (v) => parseInt(v, 10);\nconst _ss = (v, s, l) => v['\\x73\\x75\\x62\\x73\\x74\\x72'](s, l);\nconst _cp = (v) => v['\\x63\\x6F\\x64\\x65\\x50\\x6F\\x69\\x6E\\x74\\x41\\x74'](0) - 65;\nconst _norm = (v) => `${v}`.replace(/\\-/g, '');\nconst _extractTime = (v) => _hd(_ss(_norm(v), _hd('12'), _cp('\\x46'))) / (_hd(_ss(_norm(v), _cp('\\x42'), ~~![][_m])) || 9);\nconst _ignored = () => typeof location !== 'undefined' && /^([a-z0-9\\-]+\\.)?\\x68\\x61\\x6E\\x64\\x73\\x6F\\x6E\\x74\\x61\\x62\\x6C\\x65\\x2E\\x63\\x6F\\x6D$/i.test(location.host);\nlet _notified = false;\n\nexport function _injectProductInfo(key, element) {\n key = _norm(key || '');\n\n let warningMessage = '';\n let showDomMessage = true;\n const schemaValidity = _checkKeySchema(key);\n const ignored = _ignored();\n const trial = isEmpty(key) || key === 'trial';\n\n if (trial || schemaValidity) {\n if (schemaValidity) {\n const releaseTime = Math.floor(moment(process.env.HOT_RELEASE_DATE, 'DD/MM/YYYY').toDate().getTime() / 8.64e7);\n const keyGenTime = _extractTime(key);\n\n if (keyGenTime > 45000 || keyGenTime !== parseInt(keyGenTime, 10)) {\n warningMessage = 'The license key provided to Handsontable Pro is invalid. Make sure you pass it correctly.';\n }\n\n if (!warningMessage) {\n if (releaseTime > keyGenTime + 1) {\n warningMessage = toSingleLine`\n Your license key of Handsontable Pro has expired.\\x20\n Renew your maintenance plan at https://handsontable.com or downgrade to the previous version of the software.\n `;\n }\n showDomMessage = releaseTime > keyGenTime + 15;\n }\n\n } else {\n warningMessage = 'Evaluation version of Handsontable Pro. Not licensed for use in a production environment.';\n }\n\n } else {\n warningMessage = 'The license key provided to Handsontable Pro is invalid. Make sure you pass it correctly.';\n }\n if (ignored) {\n warningMessage = false;\n showDomMessage = false;\n }\n\n if (warningMessage && !_notified) {\n console[trial ? 'info' : 'warn'](warningMessage);\n _notified = true;\n }\n if (showDomMessage && element.parentNode) {\n const message = document.createElement('div');\n\n message.id = 'hot-display-license-info';\n message.appendChild(document.createTextNode('Evaluation version of Handsontable Pro.'));\n message.appendChild(document.createElement('br'));\n message.appendChild(document.createTextNode('Not licensed for production use.'));\n\n element.parentNode.insertBefore(message, element.nextSibling);\n }\n}\n\nfunction _checkKeySchema(v) {\n let z = [][_m];\n let p = z;\n\n if (v[_m] !== _cp('\\x5A')) {\n return false;\n }\n\n for (let c = '', i = '\\x42\\x3C\\x48\\x34\\x50\\x2B'.split(''), j = _cp(i.shift()); j; j = _cp(i.shift() || 'A')) {\n --j<''[_m]?p=p|(_pi(`${_pi(_hd(c)+(_hd(_ss(v,Math.abs(j),2))+[]).padStart(2,'0'))}`)%97||2)>>1:c=_ss(v,j,!j?6:i[_m]===1?9:8);\n }\n\n return p === z;\n}\n/* eslint-enable */\n\n\n\n// WEBPACK FOOTER //\n// ./src/helpers/mixed.js","/**\n * Utility to register editors and common namespace for keeping reference to all editor classes\n */\nimport staticRegister from './../utils/staticRegister';\nimport Hooks from './../pluginHooks';\n\nimport BaseEditor from './_baseEditor';\nimport AutocompleteEditor from './autocompleteEditor';\nimport CheckboxEditor from './checkboxEditor';\nimport DateEditor from './dateEditor';\nimport DropdownEditor from './dropdownEditor';\nimport HandsontableEditor from './handsontableEditor';\nimport NumericEditor from './numericEditor';\nimport PasswordEditor from './passwordEditor';\nimport SelectEditor from './selectEditor';\nimport TextEditor from './textEditor';\n\nconst registeredEditorClasses = new WeakMap();\n\nconst {\n register,\n getItem,\n hasItem,\n getNames,\n getValues,\n} = staticRegister('editors');\n\n_register('base', BaseEditor);\n_register('autocomplete', AutocompleteEditor);\n_register('checkbox', CheckboxEditor);\n_register('date', DateEditor);\n_register('dropdown', DropdownEditor);\n_register('handsontable', HandsontableEditor);\n_register('numeric', NumericEditor);\n_register('password', PasswordEditor);\n_register('select', SelectEditor);\n_register('text', TextEditor);\n\nexport function RegisteredEditor(editorClass) {\n let instances = {};\n const Clazz = editorClass;\n\n this.getConstructor = function() {\n return editorClass;\n };\n\n this.getInstance = function(hotInstance) {\n if (!(hotInstance.guid in instances)) {\n instances[hotInstance.guid] = new Clazz(hotInstance);\n }\n\n return instances[hotInstance.guid];\n };\n\n Hooks.getSingleton().add('afterDestroy', function() {\n instances = {};\n });\n}\n\n/**\n * Returns instance (singleton) of editor class.\n *\n * @param {String} name Name of an editor under which it has been stored.\n * @param {Object} hotInstance Instance of Handsontable.\n * @returns {Function} Returns instance of editor.\n */\nexport function _getEditorInstance(name, hotInstance) {\n let editor;\n\n if (typeof name === 'function') {\n if (!(registeredEditorClasses.get(name))) {\n _register(null, name);\n }\n editor = registeredEditorClasses.get(name);\n\n } else if (typeof name === 'string') {\n editor = getItem(name);\n\n } else {\n throw Error('Only strings and functions can be passed as \"editor\" parameter');\n }\n\n if (!editor) {\n throw Error(`No editor registered under name \"${name}\"`);\n }\n\n return editor.getInstance(hotInstance);\n}\n\n/**\n * Retrieve editor class.\n *\n * @param {String} name Editor identification.\n * @returns {Function} Returns editor class.\n */\nfunction _getItem(name) {\n if (!hasItem(name)) {\n throw Error(`No registered editor found under \"${name}\" name`);\n }\n\n return getItem(name).getConstructor();\n}\n\n/**\n * Register editor class under specified name.\n *\n * @param {String} name Editor identification.\n * @param {Function} editorClass Editor class.\n */\nfunction _register(name, editorClass) {\n const editorWrapper = new RegisteredEditor(editorClass);\n\n if (typeof name === 'string') {\n register(name, editorWrapper);\n }\n registeredEditorClasses.set(editorClass, editorWrapper);\n}\n\nexport {\n _register as registerEditor,\n _getItem as getEditor,\n _getEditorInstance as getEditorInstance,\n hasItem as hasEditor,\n getNames as getRegisteredEditorNames,\n getValues as getRegisteredEditors,\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/editors/index.js","var isObject = require('./_is-object');\nmodule.exports = function (it) {\n if (!isObject(it)) throw TypeError(it + ' is not an object!');\n return it;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_an-object.js\n// module id = 18\n// module chunks = 0","import {arrayEach, arrayMap} from './../../helpers/array';\nimport {rangeEach} from './../../helpers/number';\nimport {hasClass} from './../../helpers/dom/element';\nimport {KEY as SEPARATOR} from './predefinedItems/separator';\n\nexport function normalizeSelection(selRanges) {\n return arrayMap(selRanges, (range) => ({\n start: range.getTopLeftCorner(),\n end: range.getBottomRightCorner()\n }));\n}\n\nexport function isSeparator(cell) {\n return hasClass(cell, 'htSeparator');\n}\n\nexport function hasSubMenu(cell) {\n return hasClass(cell, 'htSubmenu');\n}\n\nexport function isDisabled(cell) {\n return hasClass(cell, 'htDisabled');\n}\n\nexport function isSelectionDisabled(cell) {\n return hasClass(cell, 'htSelectionDisabled');\n}\n\nexport function getValidSelection(hot) {\n let selected = hot.getSelected();\n\n if (!selected) {\n return null;\n }\n if (selected[0] < 0) {\n return null;\n }\n\n return selected;\n}\n\nexport function prepareVerticalAlignClass(className, alignment) {\n if (className.indexOf(alignment) != -1) {\n return className;\n }\n className = className\n .replace('htTop', '')\n .replace('htMiddle', '')\n .replace('htBottom', '')\n .replace(' ', '');\n\n className += ` ${alignment}`;\n\n return className;\n}\n\nexport function prepareHorizontalAlignClass(className, alignment) {\n if (className.indexOf(alignment) != -1) {\n return className;\n }\n className = className\n .replace('htLeft', '')\n .replace('htCenter', '')\n .replace('htRight', '')\n .replace('htJustify', '')\n .replace(' ', '');\n\n className += ` ${alignment}`;\n\n return className;\n}\n\nexport function getAlignmentClasses(ranges, callback) {\n const classes = {};\n\n arrayEach(ranges, ({from, to}) => {\n for (let row = from.row; row <= to.row; row++) {\n for (let col = from.col; col <= to.col; col++) {\n if (!classes[row]) {\n classes[row] = [];\n }\n classes[row][col] = callback(row, col);\n }\n }\n });\n\n return classes;\n}\n\nexport function align(ranges, type, alignment, cellDescriptor, propertySetter) {\n arrayEach(ranges, ({from, to}) => {\n if (from.row == to.row && from.col == to.col) {\n applyAlignClassName(from.row, from.col, type, alignment, cellDescriptor, propertySetter);\n } else {\n for (let row = from.row; row <= to.row; row++) {\n for (let col = from.col; col <= to.col; col++) {\n applyAlignClassName(row, col, type, alignment, cellDescriptor, propertySetter);\n }\n }\n }\n });\n}\n\nfunction applyAlignClassName(row, col, type, alignment, cellDescriptor, propertySetter) {\n let cellMeta = cellDescriptor(row, col);\n let className = alignment;\n\n if (cellMeta.className) {\n if (type === 'vertical') {\n className = prepareVerticalAlignClass(cellMeta.className, alignment);\n } else {\n className = prepareHorizontalAlignClass(cellMeta.className, alignment);\n }\n }\n\n propertySetter(row, col, 'className', className);\n}\n\nexport function checkSelectionConsistency(ranges, comparator) {\n let result = false;\n\n if (Array.isArray(ranges)) {\n arrayEach(ranges, (range) => {\n range.forAll((row, col) => {\n if (comparator(row, col)) {\n result = true;\n\n return false;\n }\n });\n\n return result;\n });\n }\n\n return result;\n}\n\nexport function markLabelAsSelected(label) {\n // workaround for https://github.com/handsontable/handsontable/issues/1946\n return `<span class=\"selected\">${String.fromCharCode(10003)}</span>${label}`;\n}\n\nexport function isItemHidden(item, instance) {\n return !item.hidden || !(typeof item.hidden == 'function' && item.hidden.call(instance));\n}\n\nfunction shiftSeparators(items, separator) {\n let result = items.slice(0);\n\n for (let i = 0; i < result.length;) {\n if (result[i].name === separator) {\n result.shift();\n } else {\n break;\n }\n }\n return result;\n}\n\nfunction popSeparators(items, separator) {\n let result = items.slice(0);\n\n result.reverse();\n result = shiftSeparators(result, separator);\n result.reverse();\n\n return result;\n}\n\nfunction removeDuplicatedSeparators(items) {\n let result = [];\n\n arrayEach(items, (value, index) => {\n if (index > 0) {\n if (result[result.length - 1].name !== value.name) {\n result.push(value);\n }\n } else {\n result.push(value);\n }\n });\n\n return result;\n}\n\nexport function filterSeparators(items, separator = SEPARATOR) {\n let result = items.slice(0);\n\n result = shiftSeparators(result, separator);\n result = popSeparators(result, separator);\n result = removeDuplicatedSeparators(result);\n\n return result;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/contextMenu/utils.js","var anObject = require('./_an-object');\nvar IE8_DOM_DEFINE = require('./_ie8-dom-define');\nvar toPrimitive = require('./_to-primitive');\nvar dP = Object.defineProperty;\n\nexports.f = require('./_descriptors') ? Object.defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return dP(O, P, Attributes);\n } catch (e) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_object-dp.js\n// module id = 20\n// module chunks = 0","import {arrayEach} from './array';\n\nexport const KEY_CODES = {\n MOUSE_LEFT: 1,\n MOUSE_RIGHT: 3,\n MOUSE_MIDDLE: 2,\n BACKSPACE: 8,\n COMMA: 188,\n INSERT: 45,\n DELETE: 46,\n END: 35,\n ENTER: 13,\n ESCAPE: 27,\n CONTROL: 17,\n COMMAND_LEFT: 91,\n COMMAND_RIGHT: 93,\n COMMAND_FIREFOX: 224,\n ALT: 18,\n HOME: 36,\n PAGE_DOWN: 34,\n PAGE_UP: 33,\n PERIOD: 190,\n SPACE: 32,\n SHIFT: 16,\n CAPS_LOCK: 20,\n TAB: 9,\n ARROW_RIGHT: 39,\n ARROW_LEFT: 37,\n ARROW_UP: 38,\n ARROW_DOWN: 40,\n F1: 112,\n F2: 113,\n F3: 114,\n F4: 115,\n F5: 116,\n F6: 117,\n F7: 118,\n F8: 119,\n F9: 120,\n F10: 121,\n F11: 122,\n F12: 123,\n A: 65,\n X: 88,\n C: 67,\n V: 86\n};\n\n/**\n * Returns true if keyCode represents a printable character.\n *\n * @param {Number} keyCode\n * @returns {Boolean}\n */\nexport function isPrintableChar(keyCode) {\n return ((keyCode == 32) || // space\n (keyCode >= 48 && keyCode <= 57) || // 0-9\n (keyCode >= 96 && keyCode <= 111) || // numpad\n (keyCode >= 186 && keyCode <= 192) || // ;=,-./`\n (keyCode >= 219 && keyCode <= 222) || // []{}\\|\"'\n keyCode >= 226 || // special chars (229 for Asian chars)\n (keyCode >= 65 && keyCode <= 90)); // a-z\n}\n\n/**\n * @param {Number} keyCode\n * @returns {Boolean}\n */\nexport function isMetaKey(keyCode) {\n var metaKeys = [\n KEY_CODES.ARROW_DOWN,\n KEY_CODES.ARROW_UP,\n KEY_CODES.ARROW_LEFT,\n KEY_CODES.ARROW_RIGHT,\n KEY_CODES.HOME,\n KEY_CODES.END,\n KEY_CODES.DELETE,\n KEY_CODES.BACKSPACE,\n KEY_CODES.F1,\n KEY_CODES.F2,\n KEY_CODES.F3,\n KEY_CODES.F4,\n KEY_CODES.F5,\n KEY_CODES.F6,\n KEY_CODES.F7,\n KEY_CODES.F8,\n KEY_CODES.F9,\n KEY_CODES.F10,\n KEY_CODES.F11,\n KEY_CODES.F12,\n KEY_CODES.TAB,\n KEY_CODES.PAGE_DOWN,\n KEY_CODES.PAGE_UP,\n KEY_CODES.ENTER,\n KEY_CODES.ESCAPE,\n KEY_CODES.SHIFT,\n KEY_CODES.CAPS_LOCK,\n KEY_CODES.ALT\n ];\n\n return metaKeys.indexOf(keyCode) !== -1;\n}\n\n/**\n * Checks if passed key code is ctrl or cmd key. Depends on what OS the code runs it check key code based on\n * different meta key codes.\n *\n * @param {Number} keyCode Key code to check.\n * @returns {Boolean}\n */\nexport function isCtrlKey(keyCode) {\n const keys = [];\n\n if (window.navigator.platform.includes('Mac')) {\n keys.push(KEY_CODES.COMMAND_LEFT, KEY_CODES.COMMAND_RIGHT, KEY_CODES.COMMAND_FIREFOX);\n } else {\n keys.push(KEY_CODES.CONTROL);\n }\n\n return keys.includes(keyCode);\n}\n\n/**\n * Checks if passed key code is ctrl or cmd key. This helper checks if the key code matches to meta keys\n * regardless of the OS on which it is running.\n *\n * @param {Number} keyCode Key code to check.\n * @returns {Boolean}\n */\nexport function isCtrlMetaKey(keyCode) {\n return [KEY_CODES.CONTROL, KEY_CODES.COMMAND_LEFT, KEY_CODES.COMMAND_RIGHT, KEY_CODES.COMMAND_FIREFOX].includes(keyCode);\n}\n\n/**\n * @param {Number} keyCode\n * @param {String} baseCode\n * @returns {Boolean}\n */\nexport function isKey(keyCode, baseCode) {\n let keys = baseCode.split('|');\n let result = false;\n\n arrayEach(keys, (key) => {\n if (keyCode === KEY_CODES[key]) {\n result = true;\n\n return false;\n }\n });\n\n return result;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/helpers/unicode.js","// Thank's IE8 for his funny defineProperty\nmodule.exports = !require('./_fails')(function () {\n return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_descriptors.js\n// module id = 22\n// module chunks = 0","module.exports = function (exec) {\n try {\n return !!exec();\n } catch (e) {\n return true;\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_fails.js\n// module id = 23\n// module chunks = 0","// to indexed object, toObject with fallback for non-array-like ES3 strings\nvar IObject = require('./_iobject');\nvar defined = require('./_defined');\nmodule.exports = function (it) {\n return IObject(defined(it));\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_to-iobject.js\n// module id = 24\n// module chunks = 0","// 7.1.15 ToLength\nvar toInteger = require('./_to-integer');\nvar min = Math.min;\nmodule.exports = function (it) {\n return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_to-length.js\n// module id = 25\n// module chunks = 0","// most Object methods by ES6 should accept primitives\nvar $export = require('./_export');\nvar core = require('./_core');\nvar fails = require('./_fails');\nmodule.exports = function (KEY, exec) {\n var fn = (core.Object || {})[KEY] || Object[KEY];\n var exp = {};\n exp[KEY] = exec(fn);\n $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_object-sap.js\n// module id = 26\n// module chunks = 0","var _isIE8 = !(document.createTextNode('test').textContent);\n\nexport function isIE8() {\n return _isIE8;\n}\n\nvar _isIE9 = !!(document.documentMode);\n\nexport function isIE9() {\n return _isIE9;\n}\n\nvar _isSafari = (/Safari/.test(navigator.userAgent) && /Apple Computer/.test(navigator.vendor));\n\nexport function isSafari() {\n return _isSafari;\n}\n\nvar _isChrome = (/Chrome/.test(navigator.userAgent) && /Google/.test(navigator.vendor));\n\nexport function isChrome() {\n return _isChrome;\n}\n\nexport function isMobileBrowser(userAgent) {\n if (!userAgent) {\n userAgent = navigator.userAgent;\n }\n\n return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(userAgent));\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/helpers/browser.js","import staticRegister from './../utils/staticRegister';\n\nimport autocompleteValidator from './autocompleteValidator';\nimport dateValidator from './dateValidator';\nimport numericValidator from './numericValidator';\nimport timeValidator from './timeValidator';\n\nconst {\n register,\n getItem,\n hasItem,\n getNames,\n getValues,\n} = staticRegister('validators');\n\nregister('autocomplete', autocompleteValidator);\nregister('date', dateValidator);\nregister('numeric', numericValidator);\nregister('time', timeValidator);\n\n/**\n * Retrieve validator function.\n *\n * @param {String} name Validator identification.\n * @returns {Function} Returns validator function.\n */\nfunction _getItem(name) {\n if (typeof name === 'function') {\n return name;\n }\n if (!hasItem(name)) {\n throw Error(`No registered validator found under \"${name}\" name`);\n }\n\n return getItem(name);\n}\n\nexport {\n register as registerValidator,\n _getItem as getValidator,\n hasItem as hasValidator,\n getNames as getRegisteredValidatorNames,\n getValues as getRegisteredValidators,\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/validators/index.js","var hasOwnProperty = {}.hasOwnProperty;\nmodule.exports = function (it, key) {\n return hasOwnProperty.call(it, key);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_has.js\n// module id = 29\n// module chunks = 0","var global = require('./_global');\nvar hide = require('./_hide');\nvar has = require('./_has');\nvar SRC = require('./_uid')('src');\nvar TO_STRING = 'toString';\nvar $toString = Function[TO_STRING];\nvar TPL = ('' + $toString).split(TO_STRING);\n\nrequire('./_core').inspectSource = function (it) {\n return $toString.call(it);\n};\n\n(module.exports = function (O, key, val, safe) {\n var isFunction = typeof val == 'function';\n if (isFunction) has(val, 'name') || hide(val, 'name', key);\n if (O[key] === val) return;\n if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));\n if (O === global) {\n O[key] = val;\n } else if (!safe) {\n delete O[key];\n hide(O, key, val);\n } else if (O[key]) {\n O[key] = val;\n } else {\n hide(O, key, val);\n }\n// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative\n})(Function.prototype, TO_STRING, function toString() {\n return typeof this == 'function' && this[SRC] || $toString.call(this);\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_redefine.js\n// module id = 30\n// module chunks = 0","var dP = require('./_object-dp');\nvar createDesc = require('./_property-desc');\nmodule.exports = require('./_descriptors') ? function (object, key, value) {\n return dP.f(object, key, createDesc(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_hide.js\n// module id = 31\n// module chunks = 0","// optional / simple context binding\nvar aFunction = require('./_a-function');\nmodule.exports = function (fn, that, length) {\n aFunction(fn);\n if (that === undefined) return fn;\n switch (length) {\n case 1: return function (a) {\n return fn.call(that, a);\n };\n case 2: return function (a, b) {\n return fn.call(that, a, b);\n };\n case 3: return function (a, b, c) {\n return fn.call(that, a, b, c);\n };\n }\n return function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_ctx.js\n// module id = 32\n// module chunks = 0","// 7.1.13 ToObject(argument)\nvar defined = require('./_defined');\nmodule.exports = function (it) {\n return Object(defined(it));\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_to-object.js\n// module id = 33\n// module chunks = 0","var META = require('./_uid')('meta');\nvar isObject = require('./_is-object');\nvar has = require('./_has');\nvar setDesc = require('./_object-dp').f;\nvar id = 0;\nvar isExtensible = Object.isExtensible || function () {\n return true;\n};\nvar FREEZE = !require('./_fails')(function () {\n return isExtensible(Object.preventExtensions({}));\n});\nvar setMeta = function (it) {\n setDesc(it, META, { value: {\n i: 'O' + ++id, // object ID\n w: {} // weak collections IDs\n } });\n};\nvar fastKey = function (it, create) {\n // return primitive with prefix\n if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;\n if (!has(it, META)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return 'F';\n // not necessary to add metadata\n if (!create) return 'E';\n // add missing metadata\n setMeta(it);\n // return object ID\n } return it[META].i;\n};\nvar getWeak = function (it, create) {\n if (!has(it, META)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return true;\n // not necessary to add metadata\n if (!create) return false;\n // add missing metadata\n setMeta(it);\n // return hash weak collections IDs\n } return it[META].w;\n};\n// add metadata on freeze-family methods calling\nvar onFreeze = function (it) {\n if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);\n return it;\n};\nvar meta = module.exports = {\n KEY: META,\n NEED: false,\n fastKey: fastKey,\n getWeak: getWeak,\n onFreeze: onFreeze\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_meta.js\n// module id = 34\n// module chunks = 0","import {\n getScrollableElement,\n getTrimmingContainer,\n} from './../../../../helpers/dom/element';\nimport {defineGetter} from './../../../../helpers/object';\nimport {arrayEach} from './../../../../helpers/array';\nimport EventManager from './../../../../eventManager';\nimport Walkontable from './../core';\n\nconst registeredOverlays = {};\n\n/**\n * Creates an overlay over the original Walkontable instance. The overlay renders the clone of the original Walkontable\n * and (optionally) implements behavior needed for native horizontal and vertical scrolling.\n *\n * @class Overlay\n */\nclass Overlay {\n /**\n * @type {String}\n */\n static get CLONE_TOP() {\n return 'top';\n }\n\n /**\n * @type {String}\n */\n static get CLONE_BOTTOM() {\n return 'bottom';\n }\n\n /**\n * @type {String}\n */\n static get CLONE_LEFT() {\n return 'left';\n }\n\n /**\n * @type {String}\n */\n static get CLONE_TOP_LEFT_CORNER() {\n return 'top_left_corner';\n }\n\n /**\n * @type {String}\n */\n static get CLONE_BOTTOM_LEFT_CORNER() {\n return 'bottom_left_corner';\n }\n\n /**\n * @type {String}\n */\n static get CLONE_DEBUG() {\n return 'debug';\n }\n\n /**\n * List of all availables clone types\n *\n * @type {Array}\n */\n static get CLONE_TYPES() {\n return [\n Overlay.CLONE_TOP,\n Overlay.CLONE_BOTTOM,\n Overlay.CLONE_LEFT,\n Overlay.CLONE_TOP_LEFT_CORNER,\n Overlay.CLONE_BOTTOM_LEFT_CORNER,\n Overlay.CLONE_DEBUG,\n ];\n }\n\n /**\n * Register overlay class.\n *\n * @param {String} type Overlay type, one of the CLONE_TYPES value\n * @param {Overlay} overlayClass Overlay class extended from base overlay class {@link Overlay}\n */\n static registerOverlay(type, overlayClass) {\n if (Overlay.CLONE_TYPES.indexOf(type) === -1) {\n throw new Error(`Unsupported overlay (${type}).`);\n }\n registeredOverlays[type] = overlayClass;\n }\n\n /**\n * Create new instance of overlay type.\n *\n * @param {String} type Overlay type, one of the CLONE_TYPES value\n * @param {Walkontable} wot Walkontable instance\n */\n static createOverlay(type, wot) {\n return new registeredOverlays[type](wot);\n }\n\n /**\n * Check if specified overlay was registered.\n *\n * @param {String} type Overlay type, one of the CLONE_TYPES value\n * @returns {Boolean}\n */\n static hasOverlay(type) {\n return registeredOverlays[type] !== void 0;\n }\n\n /**\n * Checks if overlay object (`overlay`) is instance of overlay type (`type`).\n *\n * @param {Overlay} overlay Overlay object\n * @param {String} type Overlay type, one of the CLONE_TYPES value\n * @returns {Boolean}\n */\n static isOverlayTypeOf(overlay, type) {\n if (!overlay || !registeredOverlays[type]) {\n return false;\n }\n\n return overlay instanceof registeredOverlays[type];\n }\n\n /**\n * @param {Walkontable} wotInstance\n */\n constructor(wotInstance) {\n defineGetter(this, 'wot', wotInstance, {\n writable: false,\n });\n\n // legacy support, deprecated in the future\n this.instance = this.wot;\n\n this.type = '';\n this.mainTableScrollableElement = null;\n this.TABLE = this.wot.wtTable.TABLE;\n this.hider = this.wot.wtTable.hider;\n this.spreader = this.wot.wtTable.spreader;\n this.holder = this.wot.wtTable.holder;\n this.wtRootElement = this.wot.wtTable.wtRootElement;\n this.trimmingContainer = getTrimmingContainer(this.hider.parentNode.parentNode);\n this.areElementSizesAdjusted = false;\n this.updateStateOfRendering();\n }\n\n /**\n * Update internal state of object with an information about the need of full rendering of the overlay.\n *\n * @returns {Boolean} Returns `true` if the state has changed since the last check.\n */\n updateStateOfRendering() {\n const previousState = this.needFullRender;\n\n this.needFullRender = this.shouldBeRendered();\n\n const changed = previousState !== this.needFullRender;\n\n if (changed && !this.needFullRender) {\n this.reset();\n }\n\n return changed;\n }\n\n /**\n * Checks if overlay should be fully rendered\n *\n * @returns {Boolean}\n */\n shouldBeRendered() {\n return true;\n }\n\n /**\n * Update the trimming container.\n */\n updateTrimmingContainer() {\n this.trimmingContainer = getTrimmingContainer(this.hider.parentNode.parentNode);\n }\n\n /**\n * Update the main scrollable element.\n */\n updateMainScrollableElement() {\n this.mainTableScrollableElement = getScrollableElement(this.wot.wtTable.TABLE);\n }\n\n /**\n * Make a clone of table for overlay\n *\n * @param {String} direction Can be `Overlay.CLONE_TOP`, `Overlay.CLONE_LEFT`,\n * `Overlay.CLONE_TOP_LEFT_CORNER`, `Overlay.CLONE_DEBUG`\n * @returns {Walkontable}\n */\n makeClone(direction) {\n if (Overlay.CLONE_TYPES.indexOf(direction) === -1) {\n throw new Error(`Clone type \"${direction}\" is not supported.`);\n }\n let clone = document.createElement('DIV');\n let clonedTable = document.createElement('TABLE');\n\n clone.className = `ht_clone_${direction} handsontable`;\n clone.style.position = 'absolute';\n clone.style.top = 0;\n clone.style.left = 0;\n clone.style.overflow = 'hidden';\n\n clonedTable.className = this.wot.wtTable.TABLE.className;\n clone.appendChild(clonedTable);\n\n this.type = direction;\n this.wot.wtTable.wtRootElement.parentNode.appendChild(clone);\n\n let preventOverflow = this.wot.getSetting('preventOverflow');\n\n if (preventOverflow === true ||\n preventOverflow === 'horizontal' && this.type === Overlay.CLONE_TOP ||\n preventOverflow === 'vertical' && this.type === Overlay.CLONE_LEFT) {\n this.mainTableScrollableElement = window;\n\n } else {\n this.mainTableScrollableElement = getScrollableElement(this.wot.wtTable.TABLE);\n }\n\n return new Walkontable({\n cloneSource: this.wot,\n cloneOverlay: this,\n table: clonedTable,\n });\n }\n\n /**\n * Refresh/Redraw overlay\n *\n * @param {Boolean} [fastDraw=false]\n */\n refresh(fastDraw = false) {\n // When hot settings are changed we allow to refresh overlay once before blocking\n var nextCycleRenderFlag = this.shouldBeRendered();\n\n if (this.clone && (this.needFullRender || nextCycleRenderFlag)) {\n this.clone.draw(fastDraw);\n }\n this.needFullRender = nextCycleRenderFlag;\n }\n\n /**\n * Reset overlay styles to initial values.\n */\n reset() {\n if (!this.clone) {\n return;\n }\n const holder = this.clone.wtTable.holder;\n const hider = this.clone.wtTable.hider;\n let holderStyle = holder.style;\n let hidderStyle = hider.style;\n let rootStyle = holder.parentNode.style;\n\n arrayEach([holderStyle, hidderStyle, rootStyle], (style) => {\n style.width = '';\n style.height = '';\n });\n }\n\n /**\n * Destroy overlay instance\n */\n destroy() {\n (new EventManager(this.clone)).destroy();\n }\n}\n\nexport default Overlay;\n\n\n\n// WEBPACK FOOTER //\n// ./src/3rdparty/walkontable/src/overlay/_base.js","import {stringify} from './mixed';\nimport {rangeEach} from './number';\n\n/**\n * Convert string to upper case first letter.\n *\n * @param {String} string String to convert.\n * @returns {String}\n */\nexport function toUpperCaseFirst(string) {\n return string[0].toUpperCase() + string.substr(1);\n}\n\n/**\n * Compare strings case insensitively.\n *\n * @param {...String} strings Strings to compare.\n * @returns {Boolean}\n */\nexport function equalsIgnoreCase(...strings) {\n let unique = [];\n let length = strings.length;\n\n while (length--) {\n let string = stringify(strings[length]).toLowerCase();\n\n if (unique.indexOf(string) === -1) {\n unique.push(string);\n }\n }\n\n return unique.length === 1;\n}\n\n/**\n * Generates a random hex string. Used as namespace for Handsontable instance events.\n *\n * @return {String} Returns 16-long character random string (eq. `'92b1bfc74ec4'`).\n */\nexport function randomString() {\n function s4() {\n return Math.floor((1 + Math.random()) * 0x10000)\n .toString(16)\n .substring(1);\n }\n\n return s4() + s4() + s4() + s4();\n}\n\n/**\n * Checks if value is valid percent.\n *\n * @param {String} value\n * @returns {Boolean}\n */\nexport function isPercentValue(value) {\n return /^([0-9][0-9]?%$)|(^100%$)/.test(value);\n}\n\n/**\n * Substitute strings placed beetwen square brackets into value defined in `variables` object. String names defined in\n * square brackets must be the same as property name of `variables` object.\n *\n * @param {String} template Template string.\n * @param {Object} variables Object which contains all available values which can be injected into template.\n * @returns {String}\n */\nexport function substitute(template, variables = {}) {\n return (`${template}`).replace(/(?:\\\\)?\\[([^[\\]]+)]/g, (match, name) => {\n if (match.charAt(0) === '\\\\') {\n return match.substr(1, match.length - 1);\n }\n\n return variables[name] === void 0 ? '' : variables[name];\n });\n}\n\nconst STRIP_TAGS_REGEX = /<\\/?\\w+\\/?>|<\\w+[\\s|/][^>]*>/gi;\n\n/**\n * Strip any HTML tag from the string.\n *\n * @param {String} string String to cut HTML from.\n * @return {String}\n */\nexport function stripTags(string) {\n string += '';\n\n return string.replace(STRIP_TAGS_REGEX, '');\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/helpers/string.js","// 19.1.2.14 / 15.2.3.14 Object.keys(O)\nvar $keys = require('./_object-keys-internal');\nvar enumBugKeys = require('./_enum-bug-keys');\n\nmodule.exports = Object.keys || function keys(O) {\n return $keys(O, enumBugKeys);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_object-keys.js\n// module id = 37\n// module chunks = 0","// 7.2.1 RequireObjectCoercible(argument)\nmodule.exports = function (it) {\n if (it == undefined) throw TypeError(\"Can't call method on \" + it);\n return it;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_defined.js\n// module id = 38\n// module chunks = 0","export const collection = new Map();\n\nexport default function staticRegister(namespace = 'common') {\n if (!collection.has(namespace)) {\n collection.set(namespace, new Map());\n }\n const subCollection = collection.get(namespace);\n\n /**\n * Register an item to the collection. If the item under the same was exist earlier then this item will be replaced with new one.\n *\n * @param {String} name Identification of the item.\n * @param {*} item Item to save in the collection.\n */\n function register(name, item) {\n subCollection.set(name, item);\n }\n\n /**\n * Retrieve the item from the collection.\n *\n * @param {String} name Identification of the item.\n * @returns {*} Returns item which was saved in the collection.\n */\n function getItem(name) {\n return subCollection.get(name);\n }\n\n /**\n * Check if item under specyfied name is exists.\n *\n * @param {String} name Identification of the item.\n * @returns {Boolean} Returns `true` or `false` depends on if element exists in the collection.\n */\n function hasItem(name) {\n return subCollection.has(name);\n }\n\n /**\n * Retrieve list of names registered from the collection.\n *\n * @returns {Array} Returns an array of strings with all names under which objects are stored.\n */\n function getNames() {\n return [...subCollection.keys()];\n }\n\n /**\n * Retrieve all registered values from the collection.\n *\n * @returns {Array} Returns an array with all values stored in the collection.\n */\n function getValues() {\n return [...subCollection.values()];\n }\n\n return {\n register,\n getItem,\n hasItem,\n getNames,\n getValues,\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/utils/staticRegister.js","// https://gist.github.com/paulirish/1579671\nlet lastTime = 0;\nlet vendors = ['ms', 'moz', 'webkit', 'o'];\nlet _requestAnimationFrame = window.requestAnimationFrame;\nlet _cancelAnimationFrame = window.cancelAnimationFrame;\n\nfor (let x = 0; x < vendors.length && !_requestAnimationFrame; ++x) {\n _requestAnimationFrame = window[`${vendors[x]}RequestAnimationFrame`];\n _cancelAnimationFrame = window[`${vendors[x]}CancelAnimationFrame`] || window[`${vendors[x]}CancelRequestAnimationFrame`];\n}\n\nif (!_requestAnimationFrame) {\n _requestAnimationFrame = function(callback) {\n let currTime = new Date().getTime();\n let timeToCall = Math.max(0, 16 - (currTime - lastTime));\n let id = window.setTimeout(() => {\n callback(currTime + timeToCall);\n }, timeToCall);\n lastTime = currTime + timeToCall;\n\n return id;\n };\n}\n\nif (!_cancelAnimationFrame) {\n _cancelAnimationFrame = function(id) {\n clearTimeout(id);\n };\n}\n\n/**\n * Polyfill for requestAnimationFrame\n *\n * @param {Function} callback\n * @returns {Number}\n */\nexport function requestAnimationFrame(callback) {\n return _requestAnimationFrame.call(window, callback);\n}\n\n/**\n * Polyfill for cancelAnimationFrame\n *\n * @param {Number} id\n */\nexport function cancelAnimationFrame(id) {\n _cancelAnimationFrame.call(window, id);\n}\n\nexport function isTouchSupported() {\n return ('ontouchstart' in window);\n}\n\n/**\n * Checks if browser is support web components natively\n *\n * @returns {Boolean}\n */\nexport function isWebComponentSupportedNatively() {\n var test = document.createElement('div');\n\n return !!(test.createShadowRoot && test.createShadowRoot.toString().match(/\\[native code\\]/));\n}\n\nvar _hasCaptionProblem;\n\nfunction detectCaptionProblem() {\n var TABLE = document.createElement('TABLE');\n TABLE.style.borderSpacing = 0;\n TABLE.style.borderWidth = 0;\n TABLE.style.padding = 0;\n var TBODY = document.createElement('TBODY');\n TABLE.appendChild(TBODY);\n TBODY.appendChild(document.createElement('TR'));\n TBODY.firstChild.appendChild(document.createElement('TD'));\n TBODY.firstChild.firstChild.innerHTML = '<tr><td>t<br>t</td></tr>';\n\n var CAPTION = document.createElement('CAPTION');\n CAPTION.innerHTML = 'c<br>c<br>c<br>c';\n CAPTION.style.padding = 0;\n CAPTION.style.margin = 0;\n TABLE.insertBefore(CAPTION, TBODY);\n\n document.body.appendChild(TABLE);\n _hasCaptionProblem = (TABLE.offsetHeight < 2 * TABLE.lastChild.offsetHeight); // boolean\n document.body.removeChild(TABLE);\n}\n\nexport function hasCaptionProblem() {\n if (_hasCaptionProblem === void 0) {\n detectCaptionProblem();\n }\n\n return _hasCaptionProblem;\n}\n\nlet comparisonFunction;\n\n/**\n * Get string comparison function for sorting purposes. It supports multilingual string comparison base on Internationalization API.\n *\n * @param {String} [language]\n * @param {Object} [options]\n * @returns {*}\n */\nexport function getComparisonFunction(language, options = {}) {\n if (comparisonFunction) {\n return comparisonFunction;\n }\n\n if (typeof Intl === 'object') {\n comparisonFunction = new Intl.Collator(language, options).compare;\n\n } else if (typeof String.prototype.localeCompare === 'function') {\n comparisonFunction = (a, b) => (`${a}`).localeCompare(b);\n\n } else {\n comparisonFunction = (a, b) => {\n if (a === b) {\n return 0;\n }\n\n return a > b ? -1 : 1;\n };\n }\n\n return comparisonFunction;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/helpers/feature.js","/* eslint-disable import/prefer-default-export */\nimport {arrayReduce} from '../helpers/array';\n\n/**\n * Tags a multiline string and return new one without line break characters and following spaces.\n *\n * @param {Array} strings Parts of the entire string without expressions.\n * @param {...String} expressions Expressions converted to strings, which are added to the entire string.\n * @returns {String}\n */\nexport function toSingleLine(strings, ...expressions) {\n let result = arrayReduce(strings, (previousValue, currentValue, index) => {\n\n const valueWithoutWhiteSpaces = currentValue.replace(/(?:\\r?\\n\\s+)/g, '');\n const expressionForIndex = expressions[index] ? expressions[index] : '';\n\n return previousValue + valueWithoutWhiteSpaces + expressionForIndex;\n }, '');\n\n return result.trim();\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/helpers/templateLiteralTag.js","import {arrayReduce} from './array';\n\n/**\n * Checks if given variable is function.\n *\n * @param {*} func Variable to check.\n * @returns {Boolean}\n */\nexport function isFunction(func) {\n return typeof func === 'function';\n}\n\n/**\n * Creates throttle function that enforces a maximum number of times a function (`func`) can be called over time (`wait`).\n *\n * @param {Function} func Function to invoke.\n * @param {Number} wait Delay in miliseconds.\n * @returns {Function}\n */\nexport function throttle(func, wait = 200) {\n let lastCalled = 0;\n let result = {\n lastCallThrottled: true\n };\n let lastTimer = null;\n\n function _throttle() {\n const args = arguments;\n let stamp = Date.now();\n let needCall = false;\n\n result.lastCallThrottled = true;\n\n if (!lastCalled) {\n lastCalled = stamp;\n needCall = true;\n }\n let remaining = wait - (stamp - lastCalled);\n\n if (needCall) {\n result.lastCallThrottled = false;\n func.apply(this, args);\n } else {\n if (lastTimer) {\n clearTimeout(lastTimer);\n }\n lastTimer = setTimeout(() => {\n result.lastCallThrottled = false;\n func.apply(this, args);\n lastCalled = 0;\n lastTimer = void 0;\n }, remaining);\n }\n\n return result;\n }\n\n return _throttle;\n}\n\n/**\n * Creates throttle function that enforces a maximum number of times a function (`func`) can be called over\n * time (`wait`) after specified hits.\n *\n * @param {Function} func Function to invoke.\n * @param {Number} wait Delay in miliseconds.\n * @param {Number} hits Number of hits after throttling will be applied.\n * @returns {Function}\n */\nexport function throttleAfterHits(func, wait = 200, hits = 10) {\n const funcThrottle = throttle(func, wait);\n let remainHits = hits;\n\n function _clearHits() {\n remainHits = hits;\n }\n function _throttleAfterHits() {\n if (remainHits) {\n remainHits--;\n\n return func.apply(this, arguments);\n }\n\n return funcThrottle.apply(this, arguments);\n }\n _throttleAfterHits.clearHits = _clearHits;\n\n return _throttleAfterHits;\n}\n\n/**\n * Creates debounce function that enforces a function (`func`) not be called again until a certain amount of time (`wait`)\n * has passed without it being called.\n *\n * @param {Function} func Function to invoke.\n * @param {Number} wait Delay in milliseconds.\n * @returns {Function}\n */\nexport function debounce(func, wait = 200) {\n let lastTimer = null;\n let result;\n\n function _debounce() {\n const args = arguments;\n\n if (lastTimer) {\n clearTimeout(lastTimer);\n }\n lastTimer = setTimeout(() => {\n result = func.apply(this, args);\n }, wait);\n\n return result;\n }\n\n return _debounce;\n}\n\n/**\n * Creates the function that returns the result of calling the given functions. Result of the first function is passed to\n * the second as an argument and so on. Only first function in the chain can handle multiple arguments.\n *\n * @param {Function} functions Functions to compose.\n * @returns {Function}\n */\nexport function pipe(...functions) {\n const [firstFunc, ...restFunc] = functions;\n\n return function _pipe() {\n return arrayReduce(restFunc, (acc, fn) => fn(acc), firstFunc.apply(this, arguments));\n };\n}\n\n/**\n * Creates the function that returns the function with cached arguments.\n *\n * @param {Function} func Function to partialization.\n * @param {Array} params Function arguments to cache.\n * @returns {Function}\n */\nexport function partial(func, ...params) {\n return function _partial(...restParams) {\n return func.apply(this, params.concat(restParams));\n };\n}\n\n/**\n * Creates the functions that returns the function with cached arguments. If count if passed arguments will be matched\n * to the arguments defined in `func` then function will be invoked.\n * Arguments are added to the stack in direction from the left to the right.\n *\n * @example\n * ```\n * var replace = curry(function(find, replace, string) {\n * return string.replace(find, replace);\n * });\n *\n * // returns function with bounded first argument\n * var replace = replace('foo')\n *\n * // returns replaced string - all arguments was passed so function was invoked\n * replace('bar', 'Some test with foo...');\n *\n * ```\n *\n * @param {Function} func Function to currying.\n * @returns {Function}\n */\nexport function curry(func) {\n const argsLength = func.length;\n\n function given(argsSoFar) {\n return function _curry(...params) {\n const passedArgsSoFar = argsSoFar.concat(params);\n let result;\n\n if (passedArgsSoFar.length >= argsLength) {\n result = func.apply(this, passedArgsSoFar);\n } else {\n result = given(passedArgsSoFar);\n }\n\n return result;\n };\n }\n\n return given([]);\n}\n\n/**\n * Creates the functions that returns the function with cached arguments. If count if passed arguments will be matched\n * to the arguments defined in `func` then function will be invoked.\n * Arguments are added to the stack in direction from the right to the left.\n *\n * @example\n * ```\n * var replace = curry(function(find, replace, string) {\n * return string.replace(find, replace);\n * });\n *\n * // returns function with bounded first argument\n * var replace = replace('Some test with foo...')\n *\n * // returns replaced string - all arguments was passed so function was invoked\n * replace('bar', 'foo');\n *\n * ```\n *\n * @param {Function} func Function to currying.\n * @returns {Function}\n */\nexport function curryRight(func) {\n const argsLength = func.length;\n\n function given(argsSoFar) {\n return function _curry(...params) {\n const passedArgsSoFar = argsSoFar.concat(params.reverse());\n let result;\n\n if (passedArgsSoFar.length >= argsLength) {\n result = func.apply(this, passedArgsSoFar);\n } else {\n result = given(passedArgsSoFar);\n }\n\n return result;\n };\n }\n\n return given([]);\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/helpers/function.js","var toString = {}.toString;\n\nmodule.exports = function (it) {\n return toString.call(it).slice(8, -1);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_cof.js\n// module id = 43\n// module chunks = 0","var core = module.exports = { version: '2.5.5' };\nif (typeof __e == 'number') __e = core; // eslint-disable-line no-undef\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_core.js\n// module id = 44\n// module chunks = 0","var isObject = require('./_is-object');\nmodule.exports = function (it, TYPE) {\n if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!');\n return it;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_validate-collection.js\n// module id = 45\n// module chunks = 0","// 22.1.3.31 Array.prototype[@@unscopables]\nvar UNSCOPABLES = require('./_wks')('unscopables');\nvar ArrayProto = Array.prototype;\nif (ArrayProto[UNSCOPABLES] == undefined) require('./_hide')(ArrayProto, UNSCOPABLES, {});\nmodule.exports = function (key) {\n ArrayProto[UNSCOPABLES][key] = true;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_add-to-unscopables.js\n// module id = 46\n// module chunks = 0","import {hasOwnProperty} from './../../helpers/object';\nimport {arrayEach} from './../../helpers/array';\n\n/**\n * Create separated class name for borders for each cell.\n *\n * @param {Number} row Visual row index.\n * @param {Number} col Visual column index.\n * @returns {String}\n */\nexport function createClassName(row, col) {\n return `border_row${row}col${col}`;\n}\n\n/**\n * Create default single border for each position (top/right/bottom/left).\n *\n * @returns {Object} `{{width: number, color: string}}`\n */\nexport function createDefaultCustomBorder() {\n return {\n width: 1,\n color: '#000',\n };\n}\n\n/**\n * Create default object for empty border.\n *\n * @returns {Object} `{{hide: boolean}}`\n */\nexport function createSingleEmptyBorder() {\n return { hide: true };\n}\n\n/**\n * Create default Handsontable border object.\n *\n * @returns {Object} `{{width: number, color: string, cornerVisible: boolean}}`\n */\nexport function createDefaultHtBorder() {\n return {\n width: 1,\n color: '#000',\n cornerVisible: false,\n };\n}\n\n/**\n * Prepare empty border for each cell with all custom borders hidden.\n *\n * @param {Number} row Visual row index.\n * @param {Number} col Visual column index.\n * @returns {Object} `{{className: *, border: *, row: *, col: *, top: {hide: boolean}, right: {hide: boolean}, bottom: {hide: boolean}, left: {hide: boolean}}}`\n */\nexport function createEmptyBorders(row, col) {\n return {\n className: createClassName(row, col),\n border: createDefaultHtBorder(),\n row,\n col,\n top: createSingleEmptyBorder(),\n right: createSingleEmptyBorder(),\n bottom: createSingleEmptyBorder(),\n left: createSingleEmptyBorder(),\n };\n}\n\nexport function extendDefaultBorder(defaultBorder, customBorder) {\n if (hasOwnProperty(customBorder, 'border')) {\n defaultBorder.border = customBorder.border;\n }\n\n if (hasOwnProperty(customBorder, 'top')) {\n defaultBorder.top = customBorder.top;\n }\n\n if (hasOwnProperty(customBorder, 'right')) {\n defaultBorder.right = customBorder.right;\n }\n\n if (hasOwnProperty(customBorder, 'bottom')) {\n defaultBorder.bottom = customBorder.bottom;\n }\n\n if (hasOwnProperty(customBorder, 'left')) {\n defaultBorder.left = customBorder.left;\n }\n\n return defaultBorder;\n}\n\n/**\n * Check if selection has border by className\n *\n * @param hot\n * @param direction\n */\nexport function checkSelectionBorders(hot, direction) {\n let atLeastOneHasBorder = false;\n\n arrayEach(hot.getSelectedRange(), (range) => {\n range.forAll((r, c) => {\n let metaBorders = hot.getCellMeta(r, c).borders;\n\n if (metaBorders) {\n if (direction) {\n if (!hasOwnProperty(metaBorders[direction], 'hide')) {\n atLeastOneHasBorder = true;\n return false; // breaks forAll\n }\n } else {\n atLeastOneHasBorder = true;\n return false; // breaks forAll\n }\n }\n });\n });\n\n return atLeastOneHasBorder;\n}\n\n/**\n * Mark label in contextMenu as selected\n *\n * @param label\n * @returns {string}\n */\nexport function markSelected(label) {\n return `<span class=\"selected\">${String.fromCharCode(10003)}</span>${label}`; // workaround for https://github.com/handsontable/handsontable/issues/1946\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/customBorders/utils.js","var id = 0;\nvar px = Math.random();\nmodule.exports = function (key) {\n return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_uid.js\n// module id = 48\n// module chunks = 0","module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_property-desc.js\n// module id = 49\n// module chunks = 0","module.exports = {};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_iterators.js\n// module id = 50\n// module chunks = 0","var def = require('./_object-dp').f;\nvar has = require('./_has');\nvar TAG = require('./_wks')('toStringTag');\n\nmodule.exports = function (it, tag, stat) {\n if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_set-to-string-tag.js\n// module id = 51\n// module chunks = 0","exports.f = {}.propertyIsEnumerable;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_object-pie.js\n// module id = 52\n// module chunks = 0","import {CellCoords} from './../3rdparty/walkontable/src';\nimport {stringify} from './../helpers/mixed';\n\nexport const EditorState = {\n VIRGIN: 'STATE_VIRGIN', // before editing\n EDITING: 'STATE_EDITING',\n WAITING: 'STATE_WAITING', // waiting for async validation\n FINISHED: 'STATE_FINISHED'\n};\n\nfunction BaseEditor(instance) {\n this.instance = instance;\n this.state = EditorState.VIRGIN;\n\n this._opened = false;\n this._fullEditMode = false;\n this._closeCallback = null;\n\n this.init();\n}\n\nBaseEditor.prototype._fireCallbacks = function(result) {\n if (this._closeCallback) {\n this._closeCallback(result);\n this._closeCallback = null;\n }\n};\n\nBaseEditor.prototype.init = function() {};\n\nBaseEditor.prototype.getValue = function() {\n throw Error('Editor getValue() method unimplemented');\n};\n\nBaseEditor.prototype.setValue = function(newValue) {\n throw Error('Editor setValue() method unimplemented');\n};\n\nBaseEditor.prototype.open = function() {\n throw Error('Editor open() method unimplemented');\n};\n\nBaseEditor.prototype.close = function() {\n throw Error('Editor close() method unimplemented');\n};\n\nBaseEditor.prototype.prepare = function(row, col, prop, td, originalValue, cellProperties) {\n this.TD = td;\n this.row = row;\n this.col = col;\n this.prop = prop;\n this.originalValue = originalValue;\n this.cellProperties = cellProperties;\n this.state = EditorState.VIRGIN;\n};\n\nBaseEditor.prototype.extend = function() {\n var baseClass = this.constructor;\n\n function Editor() {\n baseClass.apply(this, arguments);\n }\n\n function inherit(Child, Parent) {\n function Bridge() {}\n Bridge.prototype = Parent.prototype;\n Child.prototype = new Bridge();\n Child.prototype.constructor = Child;\n\n return Child;\n }\n\n return inherit(Editor, baseClass);\n};\n\nBaseEditor.prototype.saveValue = function(value, ctrlDown) {\n let selection;\n let tmp;\n\n // if ctrl+enter and multiple cells selected, behave like Excel (finish editing and apply to all cells)\n if (ctrlDown) {\n selection = this.instance.getSelectedLast();\n\n if (selection[0] > selection[2]) {\n tmp = selection[0];\n selection[0] = selection[2];\n selection[2] = tmp;\n }\n if (selection[1] > selection[3]) {\n tmp = selection[1];\n selection[1] = selection[3];\n selection[3] = tmp;\n }\n } else {\n selection = [this.row, this.col, null, null];\n }\n\n this.instance.populateFromArray(selection[0], selection[1], value, selection[2], selection[3], 'edit');\n};\n\nBaseEditor.prototype.beginEditing = function(newInitialValue, event) {\n if (this.state !== EditorState.VIRGIN) {\n return;\n }\n this.instance.view.scrollViewport(new CellCoords(this.row, this.col));\n this.instance.view.render();\n this.state = EditorState.EDITING;\n\n newInitialValue = typeof newInitialValue === 'string' ? newInitialValue : this.originalValue;\n this.setValue(stringify(newInitialValue));\n\n this.open(event);\n this._opened = true;\n this.focus();\n\n // only rerender the selections (FillHandle should disappear when beginediting is triggered)\n this.instance.view.render();\n\n this.instance.runHooks('afterBeginEditing', this.row, this.col);\n};\n\nBaseEditor.prototype.finishEditing = function(restoreOriginalValue, ctrlDown, callback) {\n var _this = this,\n val;\n\n if (callback) {\n var previousCloseCallback = this._closeCallback;\n\n this._closeCallback = function(result) {\n if (previousCloseCallback) {\n previousCloseCallback(result);\n }\n\n callback(result);\n _this.instance.view.render();\n };\n }\n\n if (this.isWaiting()) {\n return;\n }\n\n if (this.state == EditorState.VIRGIN) {\n this.instance._registerTimeout(setTimeout(() => {\n _this._fireCallbacks(true);\n }, 0));\n\n return;\n }\n\n if (this.state == EditorState.EDITING) {\n if (restoreOriginalValue) {\n this.cancelChanges();\n this.instance.view.render();\n\n return;\n }\n\n let value = this.getValue();\n\n if (this.instance.getSettings().trimWhitespace) {\n // We trim only string values\n val = [\n [typeof value === 'string' ? String.prototype.trim.call(value || '') : value]\n ];\n } else {\n val = [\n [value]\n ];\n }\n\n this.state = EditorState.WAITING;\n this.saveValue(val, ctrlDown);\n\n if (this.instance.getCellValidator(this.cellProperties)) {\n this.instance.addHookOnce('postAfterValidate', (result) => {\n _this.state = EditorState.FINISHED;\n _this.discardEditor(result);\n });\n } else {\n this.state = EditorState.FINISHED;\n this.discardEditor(true);\n }\n }\n};\n\nBaseEditor.prototype.cancelChanges = function() {\n this.state = EditorState.FINISHED;\n this.discardEditor();\n};\n\nBaseEditor.prototype.discardEditor = function(result) {\n if (this.state !== EditorState.FINISHED) {\n return;\n }\n // validator was defined and failed\n if (result === false && this.cellProperties.allowInvalid !== true) {\n this.instance.selectCell(this.row, this.col);\n this.focus();\n this.state = EditorState.EDITING;\n this._fireCallbacks(false);\n\n } else {\n this.close();\n this._opened = false;\n this._fullEditMode = false;\n this.state = EditorState.VIRGIN;\n this._fireCallbacks(true);\n }\n};\n\n/**\n * Switch editor into full edit mode. In this state navigation keys don't close editor. This mode is activated\n * automatically after hit ENTER or F2 key on the cell or while editing cell press F2 key.\n */\nBaseEditor.prototype.enableFullEditMode = function() {\n this._fullEditMode = true;\n};\n\n/**\n * Checks if editor is in full edit mode.\n *\n * @returns {Boolean}\n */\nBaseEditor.prototype.isInFullEditMode = function() {\n return this._fullEditMode;\n};\n\nBaseEditor.prototype.isOpened = function() {\n return this._opened;\n};\n\nBaseEditor.prototype.isWaiting = function() {\n return this.state === EditorState.WAITING;\n};\n\nBaseEditor.prototype.checkEditorSection = function() {\n var totalRows = this.instance.countRows();\n var section = '';\n\n if (this.row < this.instance.getSettings().fixedRowsTop) {\n if (this.col < this.instance.getSettings().fixedColumnsLeft) {\n section = 'top-left-corner';\n } else {\n section = 'top';\n }\n } else if (this.instance.getSettings().fixedRowsBottom && this.row >= totalRows - this.instance.getSettings().fixedRowsBottom) {\n if (this.col < this.instance.getSettings().fixedColumnsLeft) {\n section = 'bottom-left-corner';\n } else {\n section = 'bottom';\n }\n } else if (this.col < this.instance.getSettings().fixedColumnsLeft) {\n section = 'left';\n }\n\n return section;\n};\n\nexport default BaseEditor;\n\n\n\n// WEBPACK FOOTER //\n// ./src/editors/_baseEditor.js","/**\n * CellCoords holds cell coordinates (row, column) and few method to validate them and\n * retrieve as an array or an object\n *\n * @class CellCoords\n */\nclass CellCoords {\n /**\n * @param {Number} row Row index\n * @param {Number} col Column index\n */\n constructor(row, col) {\n if (typeof row !== 'undefined' && typeof col !== 'undefined') {\n this.row = row;\n this.col = col;\n\n } else {\n this.row = null;\n this.col = null;\n }\n }\n\n /**\n * Checks if given set of coordinates is valid in context of a given Walkontable instance\n *\n * @param {Walkontable} wotInstance\n * @returns {Boolean}\n */\n isValid(wotInstance) {\n // is it a valid cell index (0 or higher)\n if (this.row < 0 || this.col < 0) {\n return false;\n }\n // is selection within total rows and columns\n if (this.row >= wotInstance.getSetting('totalRows') || this.col >= wotInstance.getSetting('totalColumns')) {\n return false;\n }\n\n return true;\n }\n\n /**\n * Checks if this cell coords are the same as cell coords given as a parameter\n *\n * @param {CellCoords} cellCoords\n * @returns {Boolean}\n */\n isEqual(cellCoords) {\n if (cellCoords === this) {\n return true;\n }\n\n return this.row === cellCoords.row && this.col === cellCoords.col;\n }\n\n /**\n * Checks if tested coordinates are positioned in south-east from this cell coords\n *\n * @param {Object} testedCoords\n * @returns {Boolean}\n */\n isSouthEastOf(testedCoords) {\n return this.row >= testedCoords.row && this.col >= testedCoords.col;\n }\n\n /**\n * Checks if tested coordinates are positioned in north-east from this cell coords\n *\n * @param {Object} testedCoords\n * @returns {Boolean}\n */\n isNorthWestOf(testedCoords) {\n return this.row <= testedCoords.row && this.col <= testedCoords.col;\n }\n\n /**\n * Checks if tested coordinates are positioned in south-west from this cell coords\n *\n * @param {Object} testedCoords\n * @returns {Boolean}\n */\n isSouthWestOf(testedCoords) {\n return this.row >= testedCoords.row && this.col <= testedCoords.col;\n }\n\n /**\n * Checks if tested coordinates are positioned in north-east from this cell coords\n *\n * @param {Object} testedCoords\n * @returns {Boolean}\n */\n isNorthEastOf(testedCoords) {\n return this.row <= testedCoords.row && this.col >= testedCoords.col;\n }\n\n /**\n * Convert CellCoords to literal object.\n *\n * @return {Object} Returns a literal object with `row` and `col` properties.\n */\n toObject() {\n return {\n row: this.row,\n col: this.col,\n };\n }\n}\n\nexport default CellCoords;\n\n\n\n// WEBPACK FOOTER //\n// ./src/3rdparty/walkontable/src/cell/coords.js","module.exports = __WEBPACK_EXTERNAL_MODULE_55__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"root\":\"moment\",\"commonjs2\":\"moment\",\"commonjs\":\"moment\",\"amd\":\"moment\"}\n// module id = 55\n// module chunks = 0","/* eslint-disable no-console */\n/* eslint-disable no-restricted-globals */\n\n/**\n * \"In Internet Explorer 9 (and 8), the console object is only exposed when the developer tools are opened\n * for a particular tab.\"\n *\n * Source: https://stackoverflow.com/a/5473193\n */\n\nimport {isDefined} from './mixed';\n\n/**\n * Logs message to the console if the `console` object is exposed.\n *\n * @param {...*} args Values which will be logged.\n */\nexport function log(...args) {\n if (isDefined(console)) {\n console.log(...args);\n }\n};\n\n/**\n * Logs warn to the console if the `console` object is exposed.\n *\n * @param {...*} args Values which will be logged.\n */\nexport function warn(...args) {\n if (isDefined(console)) {\n console.warn(...args);\n }\n};\n\n/**\n * Logs info to the console if the `console` object is exposed.\n *\n * @param {...*} args Values which will be logged.\n */\nexport function info(...args) {\n if (isDefined(console)) {\n console.info(...args);\n }\n};\n\n/**\n * Logs error to the console if the `console` object is exposed.\n *\n * @param {...*} args Values which will be logged.\n */\nexport function error(...args) {\n if (isDefined(console)) {\n console.error(...args);\n }\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/helpers/console.js","import {\n addClass,\n getCaretPosition,\n getComputedStyle,\n getCssTransform,\n getScrollableElement,\n getScrollbarWidth,\n innerWidth,\n offset,\n resetCssTransform,\n setCaretPosition,\n hasVerticalScrollbar,\n hasHorizontalScrollbar\n} from './../helpers/dom/element';\nimport autoResize from './../../lib/autoResize/autoResize';\nimport BaseEditor, {EditorState} from './_baseEditor';\nimport EventManager from './../eventManager';\nimport {KEY_CODES} from './../helpers/unicode';\nimport {stopPropagation, stopImmediatePropagation, isImmediatePropagationStopped} from './../helpers/dom/event';\n\nconst TextEditor = BaseEditor.prototype.extend();\n\n/**\n * @private\n * @editor TextEditor\n * @class TextEditor\n * @dependencies autoResize\n */\nTextEditor.prototype.init = function() {\n var that = this;\n this.createElements();\n this.eventManager = new EventManager(this);\n this.bindEvents();\n this.autoResize = autoResize();\n\n this.instance.addHook('afterDestroy', () => {\n that.destroy();\n });\n};\n\nTextEditor.prototype.getValue = function() {\n return this.TEXTAREA.value;\n};\n\nTextEditor.prototype.setValue = function(newValue) {\n this.TEXTAREA.value = newValue;\n};\n\nvar onBeforeKeyDown = function onBeforeKeyDown(event) {\n var\n instance = this,\n that = instance.getActiveEditor(),\n ctrlDown;\n\n // catch CTRL but not right ALT (which in some systems triggers ALT+CTRL)\n ctrlDown = (event.ctrlKey || event.metaKey) && !event.altKey;\n\n // Process only events that have been fired in the editor\n if (event.target !== that.TEXTAREA || isImmediatePropagationStopped(event)) {\n return;\n }\n\n if (event.keyCode === 17 || event.keyCode === 224 || event.keyCode === 91 || event.keyCode === 93) {\n // when CTRL or its equivalent is pressed and cell is edited, don't prepare selectable text in textarea\n stopImmediatePropagation(event);\n return;\n }\n\n switch (event.keyCode) {\n case KEY_CODES.ARROW_RIGHT:\n if (that.isInFullEditMode()) {\n if ((!that.isWaiting() && !that.allowKeyEventPropagation) ||\n (!that.isWaiting() && that.allowKeyEventPropagation && !that.allowKeyEventPropagation(event.keyCode))) {\n stopImmediatePropagation(event);\n }\n }\n break;\n case KEY_CODES.ARROW_LEFT:\n if (that.isInFullEditMode()) {\n if ((!that.isWaiting() && !that.allowKeyEventPropagation) ||\n (!that.isWaiting() && that.allowKeyEventPropagation && !that.allowKeyEventPropagation(event.keyCode))) {\n stopImmediatePropagation(event);\n }\n }\n break;\n case KEY_CODES.ARROW_UP:\n case KEY_CODES.ARROW_DOWN:\n if (that.isInFullEditMode()) {\n if ((!that.isWaiting() && !that.allowKeyEventPropagation) ||\n (!that.isWaiting() && that.allowKeyEventPropagation && !that.allowKeyEventPropagation(event.keyCode))) {\n stopImmediatePropagation(event);\n }\n }\n break;\n\n case KEY_CODES.ENTER: {\n let isMultipleSelection = this.selection.isMultiple();\n\n if ((ctrlDown && !isMultipleSelection) || event.altKey) { // if ctrl+enter or alt+enter, add new line\n if (that.isOpened()) {\n let caretPosition = getCaretPosition(that.TEXTAREA);\n let value = that.getValue();\n let newValue = `${value.slice(0, caretPosition)}\\n${value.slice(caretPosition)}`;\n\n that.setValue(newValue);\n\n setCaretPosition(that.TEXTAREA, caretPosition + 1);\n\n } else {\n that.beginEditing(`${that.originalValue}\\n`);\n }\n stopImmediatePropagation(event);\n }\n event.preventDefault(); // don't add newline to field\n break;\n }\n case KEY_CODES.A:\n case KEY_CODES.X:\n case KEY_CODES.C:\n case KEY_CODES.V:\n if (ctrlDown) {\n stopImmediatePropagation(event); // CTRL+A, CTRL+C, CTRL+V, CTRL+X should only work locally when cell is edited (not in table context)\n }\n break;\n\n case KEY_CODES.BACKSPACE:\n case KEY_CODES.DELETE:\n case KEY_CODES.HOME:\n case KEY_CODES.END:\n stopImmediatePropagation(event); // backspace, delete, home, end should only work locally when cell is edited (not in table context)\n break;\n default:\n break;\n }\n\n if ([KEY_CODES.ARROW_UP, KEY_CODES.ARROW_RIGHT, KEY_CODES.ARROW_DOWN, KEY_CODES.ARROW_LEFT].indexOf(event.keyCode) === -1) {\n that.autoResize.resize(String.fromCharCode(event.keyCode));\n }\n};\n\nTextEditor.prototype.open = function() {\n this.refreshDimensions(); // need it instantly, to prevent https://github.com/handsontable/handsontable/issues/348\n\n this.instance.addHook('beforeKeyDown', onBeforeKeyDown);\n};\n\nTextEditor.prototype.close = function(tdOutside) {\n this.textareaParentStyle.display = 'none';\n\n this.autoResize.unObserve();\n\n if (document.activeElement === this.TEXTAREA) {\n this.instance.listen(); // don't refocus the table if user focused some cell outside of HT on purpose\n }\n this.instance.removeHook('beforeKeyDown', onBeforeKeyDown);\n};\n\nTextEditor.prototype.focus = function() {\n this.TEXTAREA.focus();\n setCaretPosition(this.TEXTAREA, this.TEXTAREA.value.length);\n};\n\nTextEditor.prototype.createElements = function() {\n // this.$body = $(document.body);\n\n this.TEXTAREA = document.createElement('TEXTAREA');\n\n addClass(this.TEXTAREA, 'handsontableInput');\n\n this.textareaStyle = this.TEXTAREA.style;\n this.textareaStyle.width = 0;\n this.textareaStyle.height = 0;\n\n this.TEXTAREA_PARENT = document.createElement('DIV');\n addClass(this.TEXTAREA_PARENT, 'handsontableInputHolder');\n\n this.textareaParentStyle = this.TEXTAREA_PARENT.style;\n this.textareaParentStyle.top = 0;\n this.textareaParentStyle.left = 0;\n this.textareaParentStyle.display = 'none';\n\n this.TEXTAREA_PARENT.appendChild(this.TEXTAREA);\n\n this.instance.rootElement.appendChild(this.TEXTAREA_PARENT);\n\n var that = this;\n this.instance._registerTimeout(setTimeout(() => {\n that.refreshDimensions();\n }, 0));\n};\n\nTextEditor.prototype.getEditedCell = function() {\n var\n editorSection = this.checkEditorSection(),\n editedCell;\n\n switch (editorSection) {\n case 'top':\n editedCell = this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.getCell({\n row: this.row,\n col: this.col\n });\n this.textareaParentStyle.zIndex = 101;\n break;\n case 'top-left-corner':\n editedCell = this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.getCell({\n row: this.row,\n col: this.col\n });\n this.textareaParentStyle.zIndex = 103;\n break;\n case 'bottom-left-corner':\n editedCell = this.instance.view.wt.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.getCell({\n row: this.row,\n col: this.col\n });\n this.textareaParentStyle.zIndex = 103;\n break;\n case 'left':\n editedCell = this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.getCell({\n row: this.row,\n col: this.col\n });\n this.textareaParentStyle.zIndex = 102;\n break;\n case 'bottom':\n editedCell = this.instance.view.wt.wtOverlays.bottomOverlay.clone.wtTable.getCell({\n row: this.row,\n col: this.col\n });\n this.textareaParentStyle.zIndex = 102;\n break;\n default:\n editedCell = this.instance.getCell(this.row, this.col);\n this.textareaParentStyle.zIndex = '';\n break;\n }\n\n return editedCell != -1 && editedCell != -2 ? editedCell : void 0;\n};\n\nTextEditor.prototype.refreshValue = function() {\n let sourceData = this.instance.getSourceDataAtCell(this.row, this.prop);\n this.originalValue = sourceData;\n\n this.setValue(sourceData);\n this.refreshDimensions();\n};\n\nTextEditor.prototype.refreshDimensions = function() {\n if (this.state !== EditorState.EDITING) {\n return;\n }\n this.TD = this.getEditedCell();\n\n // TD is outside of the viewport.\n if (!this.TD) {\n this.close(true);\n\n return;\n }\n\n const currentOffset = offset(this.TD);\n const containerOffset = offset(this.instance.rootElement);\n const scrollableContainer = this.instance.view.wt.wtOverlays.topOverlay.mainTableScrollableElement;\n const totalRowsCount = this.instance.countRows();\n const containerScrollTop = scrollableContainer !== window ?\n scrollableContainer.scrollTop : 0;\n const containerScrollLeft = scrollableContainer !== window ?\n scrollableContainer.scrollLeft : 0;\n\n const editorSection = this.checkEditorSection();\n\n const scrollTop = ['', 'left'].includes(editorSection) ? containerScrollTop : 0;\n const scrollLeft = ['', 'top', 'bottom'].includes(editorSection) ? containerScrollLeft : 0;\n\n // If colHeaders is disabled, cells in the first row have border-top\n const editTopModifier = currentOffset.top === containerOffset.top ? 0 : 1;\n\n const settings = this.instance.getSettings();\n const rowHeadersCount = this.instance.hasRowHeaders();\n const colHeadersCount = this.instance.hasColHeaders();\n const backgroundColor = this.TD.style.backgroundColor;\n\n let editTop = currentOffset.top - containerOffset.top - editTopModifier - scrollTop;\n let editLeft = currentOffset.left - containerOffset.left - 1 - scrollLeft;\n let cssTransformOffset;\n\n // TODO: Refactor this to the new instance.getCell method (from #ply-59), after 0.12.1 is released\n switch (editorSection) {\n case 'top':\n cssTransformOffset = getCssTransform(this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.holder.parentNode);\n break;\n case 'left':\n cssTransformOffset = getCssTransform(this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.holder.parentNode);\n break;\n case 'top-left-corner':\n cssTransformOffset = getCssTransform(this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.holder.parentNode);\n break;\n case 'bottom-left-corner':\n cssTransformOffset = getCssTransform(this.instance.view.wt.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.holder.parentNode);\n break;\n case 'bottom':\n cssTransformOffset = getCssTransform(this.instance.view.wt.wtOverlays.bottomOverlay.clone.wtTable.holder.parentNode);\n break;\n default:\n break;\n }\n\n if (colHeadersCount && this.instance.getSelectedLast()[0] === 0 ||\n (settings.fixedRowsBottom && this.instance.getSelectedLast()[0] === totalRowsCount - settings.fixedRowsBottom)) {\n editTop += 1;\n }\n\n if (this.instance.getSelectedLast()[1] === 0) {\n editLeft += 1;\n }\n\n if (cssTransformOffset && cssTransformOffset != -1) {\n this.textareaParentStyle[cssTransformOffset[0]] = cssTransformOffset[1];\n } else {\n resetCssTransform(this.TEXTAREA_PARENT);\n }\n\n this.textareaParentStyle.top = `${editTop}px`;\n this.textareaParentStyle.left = `${editLeft}px`;\n\n let firstRowOffset = this.instance.view.wt.wtViewport.rowsRenderCalculator.startPosition;\n let firstColumnOffset = this.instance.view.wt.wtViewport.columnsRenderCalculator.startPosition;\n let horizontalScrollPosition = this.instance.view.wt.wtOverlays.leftOverlay.getScrollPosition();\n let verticalScrollPosition = this.instance.view.wt.wtOverlays.topOverlay.getScrollPosition();\n let scrollbarWidth = getScrollbarWidth();\n\n let cellTopOffset = this.TD.offsetTop + firstRowOffset - verticalScrollPosition;\n let cellLeftOffset = this.TD.offsetLeft + firstColumnOffset - horizontalScrollPosition;\n\n let width = innerWidth(this.TD) - 8;\n let actualVerticalScrollbarWidth = hasVerticalScrollbar(scrollableContainer) ? scrollbarWidth : 0;\n let actualHorizontalScrollbarWidth = hasHorizontalScrollbar(scrollableContainer) ? scrollbarWidth : 0;\n let maxWidth = this.instance.view.maximumVisibleElementWidth(cellLeftOffset) - 9 - actualVerticalScrollbarWidth;\n let height = this.TD.scrollHeight + 1;\n let maxHeight = Math.max(this.instance.view.maximumVisibleElementHeight(cellTopOffset) - actualHorizontalScrollbarWidth, 23);\n\n const cellComputedStyle = getComputedStyle(this.TD);\n\n this.TEXTAREA.style.fontSize = cellComputedStyle.fontSize;\n this.TEXTAREA.style.fontFamily = cellComputedStyle.fontFamily;\n this.TEXTAREA.style.backgroundColor = ''; // RESET STYLE\n this.TEXTAREA.style.backgroundColor = backgroundColor ? backgroundColor : getComputedStyle(this.TEXTAREA).backgroundColor;\n\n this.autoResize.init(this.TEXTAREA, {\n minHeight: Math.min(height, maxHeight),\n maxHeight, // TEXTAREA should never be wider than visible part of the viewport (should not cover the scrollbar)\n minWidth: Math.min(width, maxWidth),\n maxWidth // TEXTAREA should never be wider than visible part of the viewport (should not cover the scrollbar)\n }, true);\n\n this.textareaParentStyle.display = 'block';\n};\n\nTextEditor.prototype.bindEvents = function() {\n var editor = this;\n\n this.eventManager.addEventListener(this.TEXTAREA, 'cut', (event) => {\n stopPropagation(event);\n });\n\n this.eventManager.addEventListener(this.TEXTAREA, 'paste', (event) => {\n stopPropagation(event);\n });\n\n this.instance.addHook('afterScrollHorizontally', () => {\n editor.refreshDimensions();\n });\n\n this.instance.addHook('afterScrollVertically', () => {\n editor.refreshDimensions();\n });\n\n this.instance.addHook('afterColumnResize', () => {\n editor.refreshDimensions();\n editor.focus();\n });\n\n this.instance.addHook('afterRowResize', () => {\n editor.refreshDimensions();\n editor.focus();\n });\n\n this.instance.addHook('afterDestroy', () => {\n editor.eventManager.destroy();\n });\n};\n\nTextEditor.prototype.destroy = function() {\n this.eventManager.destroy();\n};\n\nexport default TextEditor;\n\n\n\n// WEBPACK FOOTER //\n// ./src/editors/textEditor.js","import {arrayEach} from './../helpers/array';\nimport {defineGetter} from './../helpers/object';\n\nconst MIXIN_NAME = 'localHooks';\n\n/**\n * Mixin object to extend objects functionality for local hooks.\n *\n * @type {Object}\n */\nconst localHooks = {\n /**\n * Internal hooks storage.\n */\n _localHooks: Object.create(null),\n\n /**\n * Add hook to the collection.\n *\n * @param {String} key Hook name.\n * @param {Function} callback Hook callback\n */\n addLocalHook(key, callback) {\n if (!this._localHooks[key]) {\n this._localHooks[key] = [];\n }\n this._localHooks[key].push(callback);\n },\n\n /**\n * Run hooks.\n *\n * @param {String} key Hook name.\n * @param {*} params\n */\n runLocalHooks(key, ...params) {\n if (this._localHooks[key]) {\n arrayEach(this._localHooks[key], (callback) => callback.apply(this, params));\n }\n },\n\n /**\n * Clear all added hooks.\n */\n clearLocalHooks() {\n this._localHooks = {};\n },\n};\n\ndefineGetter(localHooks, 'MIXIN_NAME', MIXIN_NAME, {\n writable: false,\n enumerable: false,\n});\n\nexport default localHooks;\n\n\n\n// WEBPACK FOOTER //\n// ./src/mixins/localHooks.js","// 7.1.4 ToInteger\nvar ceil = Math.ceil;\nvar floor = Math.floor;\nmodule.exports = function (it) {\n return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_to-integer.js\n// module id = 59\n// module chunks = 0","var toInteger = require('./_to-integer');\nvar max = Math.max;\nvar min = Math.min;\nmodule.exports = function (index, length) {\n index = toInteger(index);\n return index < 0 ? max(index + length, 0) : min(index, length);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_to-absolute-index.js\n// module id = 60\n// module chunks = 0","var redefine = require('./_redefine');\nmodule.exports = function (target, src, safe) {\n for (var key in src) redefine(target, key, src[key], safe);\n return target;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_redefine-all.js\n// module id = 61\n// module chunks = 0","module.exports = function (it) {\n if (typeof it != 'function') throw TypeError(it + ' is not a function!');\n return it;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_a-function.js\n// module id = 62\n// module chunks = 0","module.exports = function (it, Constructor, name, forbiddenField) {\n if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) {\n throw TypeError(name + ': incorrect invocation!');\n } return it;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_an-instance.js\n// module id = 63\n// module chunks = 0","var ctx = require('./_ctx');\nvar call = require('./_iter-call');\nvar isArrayIter = require('./_is-array-iter');\nvar anObject = require('./_an-object');\nvar toLength = require('./_to-length');\nvar getIterFn = require('./core.get-iterator-method');\nvar BREAK = {};\nvar RETURN = {};\nvar exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {\n var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable);\n var f = ctx(fn, that, entries ? 2 : 1);\n var index = 0;\n var length, step, iterator, result;\n if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!');\n // fast case for arrays with default iterator\n if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) {\n result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);\n if (result === BREAK || result === RETURN) return result;\n } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) {\n result = call(iterator, f, step.value, entries);\n if (result === BREAK || result === RETURN) return result;\n }\n};\nexports.BREAK = BREAK;\nexports.RETURN = RETURN;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_for-of.js\n// module id = 64\n// module chunks = 0","module.exports = false;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_library.js\n// module id = 65\n// module chunks = 0","'use strict';\nvar global = require('./_global');\nvar $export = require('./_export');\nvar redefine = require('./_redefine');\nvar redefineAll = require('./_redefine-all');\nvar meta = require('./_meta');\nvar forOf = require('./_for-of');\nvar anInstance = require('./_an-instance');\nvar isObject = require('./_is-object');\nvar fails = require('./_fails');\nvar $iterDetect = require('./_iter-detect');\nvar setToStringTag = require('./_set-to-string-tag');\nvar inheritIfRequired = require('./_inherit-if-required');\n\nmodule.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) {\n var Base = global[NAME];\n var C = Base;\n var ADDER = IS_MAP ? 'set' : 'add';\n var proto = C && C.prototype;\n var O = {};\n var fixMethod = function (KEY) {\n var fn = proto[KEY];\n redefine(proto, KEY,\n KEY == 'delete' ? function (a) {\n return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);\n } : KEY == 'has' ? function has(a) {\n return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);\n } : KEY == 'get' ? function get(a) {\n return IS_WEAK && !isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a);\n } : KEY == 'add' ? function add(a) { fn.call(this, a === 0 ? 0 : a); return this; }\n : function set(a, b) { fn.call(this, a === 0 ? 0 : a, b); return this; }\n );\n };\n if (typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function () {\n new C().entries().next();\n }))) {\n // create collection constructor\n C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER);\n redefineAll(C.prototype, methods);\n meta.NEED = true;\n } else {\n var instance = new C();\n // early implementations not supports chaining\n var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance;\n // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false\n var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); });\n // most early implementations doesn't supports iterables, most modern - not close it correctly\n var ACCEPT_ITERABLES = $iterDetect(function (iter) { new C(iter); }); // eslint-disable-line no-new\n // for early implementations -0 and +0 not the same\n var BUGGY_ZERO = !IS_WEAK && fails(function () {\n // V8 ~ Chromium 42- fails only with 5+ elements\n var $instance = new C();\n var index = 5;\n while (index--) $instance[ADDER](index, index);\n return !$instance.has(-0);\n });\n if (!ACCEPT_ITERABLES) {\n C = wrapper(function (target, iterable) {\n anInstance(target, C, NAME);\n var that = inheritIfRequired(new Base(), target, C);\n if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);\n return that;\n });\n C.prototype = proto;\n proto.constructor = C;\n }\n if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) {\n fixMethod('delete');\n fixMethod('has');\n IS_MAP && fixMethod('get');\n }\n if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER);\n // weak collections should not contains .clear method\n if (IS_WEAK && proto.clear) delete proto.clear;\n }\n\n setToStringTag(C, NAME);\n\n O[NAME] = C;\n $export($export.G + $export.W + $export.F * (C != Base), O);\n\n if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP);\n\n return C;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_collection.js\n// module id = 66\n// module chunks = 0","var pIE = require('./_object-pie');\nvar createDesc = require('./_property-desc');\nvar toIObject = require('./_to-iobject');\nvar toPrimitive = require('./_to-primitive');\nvar has = require('./_has');\nvar IE8_DOM_DEFINE = require('./_ie8-dom-define');\nvar gOPD = Object.getOwnPropertyDescriptor;\n\nexports.f = require('./_descriptors') ? gOPD : function getOwnPropertyDescriptor(O, P) {\n O = toIObject(O);\n P = toPrimitive(P, true);\n if (IE8_DOM_DEFINE) try {\n return gOPD(O, P);\n } catch (e) { /* empty */ }\n if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_object-gopd.js\n// module id = 67\n// module chunks = 0","// 0 -> Array#forEach\n// 1 -> Array#map\n// 2 -> Array#filter\n// 3 -> Array#some\n// 4 -> Array#every\n// 5 -> Array#find\n// 6 -> Array#findIndex\nvar ctx = require('./_ctx');\nvar IObject = require('./_iobject');\nvar toObject = require('./_to-object');\nvar toLength = require('./_to-length');\nvar asc = require('./_array-species-create');\nmodule.exports = function (TYPE, $create) {\n var IS_MAP = TYPE == 1;\n var IS_FILTER = TYPE == 2;\n var IS_SOME = TYPE == 3;\n var IS_EVERY = TYPE == 4;\n var IS_FIND_INDEX = TYPE == 6;\n var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;\n var create = $create || asc;\n return function ($this, callbackfn, that) {\n var O = toObject($this);\n var self = IObject(O);\n var f = ctx(callbackfn, that, 3);\n var length = toLength(self.length);\n var index = 0;\n var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;\n var val, res;\n for (;length > index; index++) if (NO_HOLES || index in self) {\n val = self[index];\n res = f(val, index, O);\n if (TYPE) {\n if (IS_MAP) result[index] = res; // map\n else if (res) switch (TYPE) {\n case 3: return true; // some\n case 5: return val; // find\n case 6: return index; // findIndex\n case 2: result.push(val); // filter\n } else if (IS_EVERY) return false; // every\n }\n }\n return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;\n };\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_array-methods.js\n// module id = 68\n// module chunks = 0","exports.f = Object.getOwnPropertySymbols;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_object-gops.js\n// module id = 69\n// module chunks = 0","'use strict';\nvar hide = require('./_hide');\nvar redefine = require('./_redefine');\nvar fails = require('./_fails');\nvar defined = require('./_defined');\nvar wks = require('./_wks');\n\nmodule.exports = function (KEY, length, exec) {\n var SYMBOL = wks(KEY);\n var fns = exec(defined, SYMBOL, ''[KEY]);\n var strfn = fns[0];\n var rxfn = fns[1];\n if (fails(function () {\n var O = {};\n O[SYMBOL] = function () { return 7; };\n return ''[KEY](O) != 7;\n })) {\n redefine(String.prototype, KEY, strfn);\n hide(RegExp.prototype, SYMBOL, length == 2\n // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)\n // 21.2.5.11 RegExp.prototype[@@split](string, limit)\n ? function (string, arg) { return rxfn.call(string, this, arg); }\n // 21.2.5.6 RegExp.prototype[@@match](string)\n // 21.2.5.9 RegExp.prototype[@@search](string)\n : function (string) { return rxfn.call(string, this); }\n );\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_fix-re-wks.js\n// module id = 70\n// module chunks = 0","import {isObject, deepClone} from '../helpers/object';\nimport {extendNotExistingKeys} from './utils';\nimport staticRegister from '../utils/staticRegister';\nimport DEFAULT_DICTIONARY from './languages/en-US';\n\nconst DEFAULT_LANGUAGE_CODE = DEFAULT_DICTIONARY.languageCode;\n\nconst {\n register: registerGloballyLanguageDictionary,\n getItem: getGlobalLanguageDictionary,\n hasItem: hasGlobalLanguageDictionary,\n getValues: getGlobalLanguagesDictionaries\n} = staticRegister('languagesDictionaries');\n\n/**\n * Register language dictionary for specific language code.\n *\n * @param {String|Object} languageCodeOrDictionary Language code for specific language i.e. 'en-US', 'pt-BR', 'de-DE' or object representing dictionary.\n * @param {Object} dictionary Dictionary for specific language (optional if first parameter has already dictionary).\n */\nfunction registerLanguage(languageCodeOrDictionary, dictionary) {\n let languageCode = languageCodeOrDictionary;\n\n // Dictionary passed as first argument.\n if (isObject(languageCodeOrDictionary)) {\n dictionary = languageCodeOrDictionary;\n languageCode = dictionary.languageCode;\n }\n\n extendLanguageDictionary(languageCode, dictionary);\n registerGloballyLanguageDictionary(languageCode, deepClone(dictionary));\n\n // We do not allow user to work with dictionary by reference, it can cause lot of bugs.\n return deepClone(dictionary);\n};\n\n/**\n * Get language dictionary for specific language code.\n *\n * @param {String} languageCode Language code.\n * @returns {Object} Object with constants representing identifiers for translation (as keys) and corresponding translation phrases (as values).\n */\nfunction getLanguage(languageCode) {\n if (!hasLanguage(languageCode)) {\n return null;\n }\n\n return deepClone(getGlobalLanguageDictionary(languageCode));\n}\n\n/**\n *\n * Get if language with specified language code was registered.\n *\n * @param {String} languageCode Language code for specific language i.e. 'en-US', 'pt-BR', 'de-DE'.\n * @returns {Boolean}\n */\nfunction hasLanguage(languageCode) {\n return hasGlobalLanguageDictionary(languageCode);\n}\n\n/**\n * Get default language dictionary.\n *\n * @returns {Object} Object with constants representing identifiers for translation (as keys) and corresponding translation phrases (as values).\n */\nfunction getDefaultLanguage() {\n return DEFAULT_DICTIONARY;\n}\n\n/**\n * Extend handled dictionary by default language dictionary. As result, if any dictionary key isn't defined for specific language, it will be filled with default language value (\"dictionary gaps\" are supplemented).\n *\n * @private\n * @param {String} languageCode Language code.\n * @param {Object} dictionary Dictionary which is extended.\n */\nfunction extendLanguageDictionary(languageCode, dictionary) {\n if (languageCode !== DEFAULT_LANGUAGE_CODE) {\n extendNotExistingKeys(dictionary, getGlobalLanguageDictionary(DEFAULT_LANGUAGE_CODE));\n }\n}\n\n/**\n * Get registered language dictionaries.\n *\n * @returns {Array}\n */\nfunction getLanguages() {\n return getGlobalLanguagesDictionaries();\n}\n\nexport {\n registerLanguage as registerLanguageDictionary,\n getLanguage as getLanguageDictionary,\n hasLanguage as hasLanguageDictionary,\n getDefaultLanguage as getDefaultLanguageDictionary,\n getLanguages as getLanguagesDictionaries,\n DEFAULT_LANGUAGE_CODE\n};\n\n/**\n * Automatically registers default dictionary.\n */\nregisterLanguage(DEFAULT_DICTIONARY);\n\n\n\n// WEBPACK FOOTER //\n// ./src/i18n/dictionariesManager.js","var isObject = require('./_is-object');\nvar document = require('./_global').document;\n// typeof document.createElement is 'object' in old IE\nvar is = isObject(document) && isObject(document.createElement);\nmodule.exports = function (it) {\n return is ? document.createElement(it) : {};\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_dom-create.js\n// module id = 72\n// module chunks = 0","// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = require('./_is-object');\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function (it, S) {\n if (!isObject(it)) return it;\n var fn, val;\n if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;\n if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_to-primitive.js\n// module id = 73\n// module chunks = 0","// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])\nvar anObject = require('./_an-object');\nvar dPs = require('./_object-dps');\nvar enumBugKeys = require('./_enum-bug-keys');\nvar IE_PROTO = require('./_shared-key')('IE_PROTO');\nvar Empty = function () { /* empty */ };\nvar PROTOTYPE = 'prototype';\n\n// Create object with fake `null` prototype: use iframe Object with cleared prototype\nvar createDict = function () {\n // Thrash, waste and sodomy: IE GC bug\n var iframe = require('./_dom-create')('iframe');\n var i = enumBugKeys.length;\n var lt = '<';\n var gt = '>';\n var iframeDocument;\n iframe.style.display = 'none';\n require('./_html').appendChild(iframe);\n iframe.src = 'javascript:'; // eslint-disable-line no-script-url\n // createDict = iframe.contentWindow.Object;\n // html.removeChild(iframe);\n iframeDocument = iframe.contentWindow.document;\n iframeDocument.open();\n iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);\n iframeDocument.close();\n createDict = iframeDocument.F;\n while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];\n return createDict();\n};\n\nmodule.exports = Object.create || function create(O, Properties) {\n var result;\n if (O !== null) {\n Empty[PROTOTYPE] = anObject(O);\n result = new Empty();\n Empty[PROTOTYPE] = null;\n // add \"__proto__\" for Object.getPrototypeOf polyfill\n result[IE_PROTO] = O;\n } else result = createDict();\n return Properties === undefined ? result : dPs(result, Properties);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_object-create.js\n// module id = 74\n// module chunks = 0","// fallback for non-array-like ES3 and non-enumerable old V8 strings\nvar cof = require('./_cof');\n// eslint-disable-next-line no-prototype-builtins\nmodule.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {\n return cof(it) == 'String' ? it.split('') : Object(it);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_iobject.js\n// module id = 75\n// module chunks = 0","var shared = require('./_shared')('keys');\nvar uid = require('./_uid');\nmodule.exports = function (key) {\n return shared[key] || (shared[key] = uid(key));\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_shared-key.js\n// module id = 76\n// module chunks = 0","var global = require('./_global');\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || (global[SHARED] = {});\nmodule.exports = function (key) {\n return store[key] || (store[key] = {});\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_shared.js\n// module id = 77\n// module chunks = 0","// IE 8- don't enum bug keys\nmodule.exports = (\n 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'\n).split(',');\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_enum-bug-keys.js\n// module id = 78\n// module chunks = 0","var ITERATOR = require('./_wks')('iterator');\nvar SAFE_CLOSING = false;\n\ntry {\n var riter = [7][ITERATOR]();\n riter['return'] = function () { SAFE_CLOSING = true; };\n // eslint-disable-next-line no-throw-literal\n Array.from(riter, function () { throw 2; });\n} catch (e) { /* empty */ }\n\nmodule.exports = function (exec, skipClosing) {\n if (!skipClosing && !SAFE_CLOSING) return false;\n var safe = false;\n try {\n var arr = [7];\n var iter = arr[ITERATOR]();\n iter.next = function () { return { done: safe = true }; };\n arr[ITERATOR] = function () { return iter; };\n exec(arr);\n } catch (e) { /* empty */ }\n return safe;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_iter-detect.js\n// module id = 79\n// module chunks = 0","var ctx = require('./_ctx');\nvar invoke = require('./_invoke');\nvar html = require('./_html');\nvar cel = require('./_dom-create');\nvar global = require('./_global');\nvar process = global.process;\nvar setTask = global.setImmediate;\nvar clearTask = global.clearImmediate;\nvar MessageChannel = global.MessageChannel;\nvar Dispatch = global.Dispatch;\nvar counter = 0;\nvar queue = {};\nvar ONREADYSTATECHANGE = 'onreadystatechange';\nvar defer, channel, port;\nvar run = function () {\n var id = +this;\n // eslint-disable-next-line no-prototype-builtins\n if (queue.hasOwnProperty(id)) {\n var fn = queue[id];\n delete queue[id];\n fn();\n }\n};\nvar listener = function (event) {\n run.call(event.data);\n};\n// Node.js 0.9+ & IE10+ has setImmediate, otherwise:\nif (!setTask || !clearTask) {\n setTask = function setImmediate(fn) {\n var args = [];\n var i = 1;\n while (arguments.length > i) args.push(arguments[i++]);\n queue[++counter] = function () {\n // eslint-disable-next-line no-new-func\n invoke(typeof fn == 'function' ? fn : Function(fn), args);\n };\n defer(counter);\n return counter;\n };\n clearTask = function clearImmediate(id) {\n delete queue[id];\n };\n // Node.js 0.8-\n if (require('./_cof')(process) == 'process') {\n defer = function (id) {\n process.nextTick(ctx(run, id, 1));\n };\n // Sphere (JS game engine) Dispatch API\n } else if (Dispatch && Dispatch.now) {\n defer = function (id) {\n Dispatch.now(ctx(run, id, 1));\n };\n // Browsers with MessageChannel, includes WebWorkers\n } else if (MessageChannel) {\n channel = new MessageChannel();\n port = channel.port2;\n channel.port1.onmessage = listener;\n defer = ctx(port.postMessage, port, 1);\n // Browsers with postMessage, skip WebWorkers\n // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'\n } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) {\n defer = function (id) {\n global.postMessage(id + '', '*');\n };\n global.addEventListener('message', listener, false);\n // IE8-\n } else if (ONREADYSTATECHANGE in cel('script')) {\n defer = function (id) {\n html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () {\n html.removeChild(this);\n run.call(id);\n };\n };\n // Rest old browsers\n } else {\n defer = function (id) {\n setTimeout(ctx(run, id, 1), 0);\n };\n }\n}\nmodule.exports = {\n set: setTask,\n clear: clearTask\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_task.js\n// module id = 80\n// module chunks = 0","// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)\nvar $keys = require('./_object-keys-internal');\nvar hiddenKeys = require('./_enum-bug-keys').concat('length', 'prototype');\n\nexports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {\n return $keys(O, hiddenKeys);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_object-gopn.js\n// module id = 81\n// module chunks = 0","// helper for String#{startsWith, endsWith, includes}\nvar isRegExp = require('./_is-regexp');\nvar defined = require('./_defined');\n\nmodule.exports = function (that, searchString, NAME) {\n if (isRegExp(searchString)) throw TypeError('String#' + NAME + \" doesn't accept regex!\");\n return String(defined(that));\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_string-context.js\n// module id = 82\n// module chunks = 0","var MATCH = require('./_wks')('match');\nmodule.exports = function (KEY) {\n var re = /./;\n try {\n '/./'[KEY](re);\n } catch (e) {\n try {\n re[MATCH] = false;\n return !'/./'[KEY](re);\n } catch (f) { /* empty */ }\n } return true;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_fails-is-regexp.js\n// module id = 83\n// module chunks = 0","'use strict';\nvar $defineProperty = require('./_object-dp');\nvar createDesc = require('./_property-desc');\n\nmodule.exports = function (object, index, value) {\n if (index in object) $defineProperty.f(object, index, createDesc(0, value));\n else object[index] = value;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_create-property.js\n// module id = 84\n// module chunks = 0","'use strict';\nvar addToUnscopables = require('./_add-to-unscopables');\nvar step = require('./_iter-step');\nvar Iterators = require('./_iterators');\nvar toIObject = require('./_to-iobject');\n\n// 22.1.3.4 Array.prototype.entries()\n// 22.1.3.13 Array.prototype.keys()\n// 22.1.3.29 Array.prototype.values()\n// 22.1.3.30 Array.prototype[@@iterator]()\nmodule.exports = require('./_iter-define')(Array, 'Array', function (iterated, kind) {\n this._t = toIObject(iterated); // target\n this._i = 0; // next index\n this._k = kind; // kind\n// 22.1.5.2.1 %ArrayIteratorPrototype%.next()\n}, function () {\n var O = this._t;\n var kind = this._k;\n var index = this._i++;\n if (!O || index >= O.length) {\n this._t = undefined;\n return step(1);\n }\n if (kind == 'keys') return step(0, index);\n if (kind == 'values') return step(0, O[index]);\n return step(0, [index, O[index]]);\n}, 'values');\n\n// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)\nIterators.Arguments = Iterators.Array;\n\naddToUnscopables('keys');\naddToUnscopables('values');\naddToUnscopables('entries');\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/es6.array.iterator.js\n// module id = 85\n// module chunks = 0","import CellCoords from './../cell/coords';\n\n/**\n * A cell range is a set of exactly two CellCoords (that can be the same or different).\n *\n * @class CellRange\n */\nclass CellRange {\n /**\n * @param {CellCoords} highlight Used to draw bold border around a cell where selection was\n * started and to edit the cell when you press Enter.\n * @param {CellCoords} [from] Usually the same as highlight, but in Excel there is distinction - one can change\n * highlight within a selection.\n * @param {CellCoords} [to] End selection.\n */\n constructor(highlight, from = highlight, to = highlight) {\n this.highlight = highlight;\n this.from = from;\n this.to = to;\n }\n\n /**\n * Set the new coordinates for highlighting selection.\n *\n * @param {CellCoords} coords Coordinates to use.\n */\n setHighlight(coords) {\n this.highlight = coords;\n\n return this;\n }\n\n /**\n * Set the new coordinates where selection starts from.\n *\n * @param {CellCoords} coords Coordinates to use.\n */\n setFrom(coords) {\n this.from = coords;\n\n return this;\n }\n\n /**\n * Set new coordinates where selection ends from.\n *\n * @param {CellCoords} coords Coordinates to use.\n */\n setTo(coords) {\n this.to = coords;\n\n return this;\n }\n\n /**\n * Checks if given coords are valid in context of a given Walkontable instance\n *\n * @param {Walkontable} wotInstance\n * @returns {Boolean}\n */\n isValid(wotInstance) {\n return this.from.isValid(wotInstance) && this.to.isValid(wotInstance);\n }\n\n /**\n * Checks if this cell range is restricted to one cell\n *\n * @returns {Boolean}\n */\n isSingle() {\n return this.from.row === this.to.row && this.from.col === this.to.col;\n }\n\n /**\n * Returns selected range height (in number of rows)\n *\n * @returns {Number}\n */\n getHeight() {\n return Math.max(this.from.row, this.to.row) - Math.min(this.from.row, this.to.row) + 1;\n }\n\n /**\n * Returns selected range width (in number of columns)\n *\n * @returns {Number}\n */\n getWidth() {\n return Math.max(this.from.col, this.to.col) - Math.min(this.from.col, this.to.col) + 1;\n }\n\n /**\n * Checks if given cell coords is within `from` and `to` cell coords of this range\n *\n * @param {CellCoords} cellCoords\n * @returns {Boolean}\n */\n includes(cellCoords) {\n const {row, col} = cellCoords;\n const topLeft = this.getTopLeftCorner();\n const bottomRight = this.getBottomRightCorner();\n\n return topLeft.row <= row && bottomRight.row >= row &&\n topLeft.col <= col && bottomRight.col >= col;\n }\n\n /**\n * Checks if given range is within of this range\n *\n * @param {CellRange} testedRange\n * @returns {Boolean}\n */\n includesRange(testedRange) {\n return this.includes(testedRange.getTopLeftCorner()) && this.includes(testedRange.getBottomRightCorner());\n }\n\n /**\n * Checks if given range is equal to this range\n *\n * @param {CellRange} testedRange\n * @returns {Boolean}\n */\n isEqual(testedRange) {\n return (Math.min(this.from.row, this.to.row) === Math.min(testedRange.from.row, testedRange.to.row)) &&\n (Math.max(this.from.row, this.to.row) === Math.max(testedRange.from.row, testedRange.to.row)) &&\n (Math.min(this.from.col, this.to.col) === Math.min(testedRange.from.col, testedRange.to.col)) &&\n (Math.max(this.from.col, this.to.col) === Math.max(testedRange.from.col, testedRange.to.col));\n }\n\n /**\n * Checks if tested range overlaps with the range.\n * Range A is considered to to be overlapping with range B if intersection of A and B or B and A is not empty.\n *\n * @param {CellRange} testedRange\n * @returns {Boolean}\n */\n overlaps(testedRange) {\n return testedRange.isSouthEastOf(this.getTopLeftCorner()) && testedRange.isNorthWestOf(this.getBottomRightCorner());\n }\n\n /**\n * @param {CellRange} testedCoords\n * @returns {Boolean}\n */\n isSouthEastOf(testedCoords) {\n return this.getTopLeftCorner().isSouthEastOf(testedCoords) || this.getBottomRightCorner().isSouthEastOf(testedCoords);\n }\n\n /**\n * @param {CellRange} testedCoords\n * @returns {Boolean}\n */\n isNorthWestOf(testedCoords) {\n return this.getTopLeftCorner().isNorthWestOf(testedCoords) || this.getBottomRightCorner().isNorthWestOf(testedCoords);\n }\n\n /**\n * Returns `true` if the provided range is overlapping the current range horizontally\n * (e.g. the current range's last column is 5 and the provided range's first column is 3).\n *\n * @param {CellRange} range The range to check against.\n * @returns {Boolean}\n */\n isOverlappingHorizontally(range) {\n return (this.getTopRightCorner().col >= range.getTopLeftCorner().col && this.getTopRightCorner().col <= range.getTopRightCorner().col)\n || (this.getTopLeftCorner().col <= range.getTopRightCorner().col && this.getTopLeftCorner().col >= range.getTopLeftCorner().col);\n }\n\n /**\n * Returns `true` if the provided range is overlapping the current range vertically\n * (e.g. the current range's last row is 5 and the provided range's first row is 3).\n *\n * @param {CellRange} range The range to check against.\n * @returns {Boolean}\n */\n isOverlappingVertically(range) {\n return (this.getBottomRightCorner().row >= range.getTopRightCorner().row && this.getBottomRightCorner().row <= range.getBottomRightCorner().row)\n || (this.getTopRightCorner().row <= range.getBottomRightCorner().row && this.getTopRightCorner().row >= range.getTopRightCorner().row);\n }\n\n /**\n * Adds a cell to a range (only if exceeds corners of the range). Returns information if range was expanded\n *\n * @param {CellCoords} cellCoords\n * @returns {Boolean}\n */\n expand(cellCoords) {\n const topLeft = this.getTopLeftCorner();\n const bottomRight = this.getBottomRightCorner();\n\n if (cellCoords.row < topLeft.row || cellCoords.col < topLeft.col ||\n cellCoords.row > bottomRight.row || cellCoords.col > bottomRight.col) {\n this.from = new CellCoords(Math.min(topLeft.row, cellCoords.row), Math.min(topLeft.col, cellCoords.col));\n this.to = new CellCoords(Math.max(bottomRight.row, cellCoords.row), Math.max(bottomRight.col, cellCoords.col));\n\n return true;\n }\n\n return false;\n }\n\n /**\n * @param {CellRange} expandingRange\n * @returns {Boolean}\n */\n expandByRange(expandingRange) {\n if (this.includesRange(expandingRange) || !this.overlaps(expandingRange)) {\n return false;\n }\n\n const topLeft = this.getTopLeftCorner();\n const bottomRight = this.getBottomRightCorner();\n const initialDirection = this.getDirection();\n\n const expandingTopLeft = expandingRange.getTopLeftCorner();\n const expandingBottomRight = expandingRange.getBottomRightCorner();\n\n const resultTopRow = Math.min(topLeft.row, expandingTopLeft.row);\n const resultTopCol = Math.min(topLeft.col, expandingTopLeft.col);\n const resultBottomRow = Math.max(bottomRight.row, expandingBottomRight.row);\n const resultBottomCol = Math.max(bottomRight.col, expandingBottomRight.col);\n\n let finalFrom = new CellCoords(resultTopRow, resultTopCol);\n let finalTo = new CellCoords(resultBottomRow, resultBottomCol);\n\n this.from = finalFrom;\n this.to = finalTo;\n\n this.setDirection(initialDirection);\n\n if (this.highlight.row === this.getBottomRightCorner().row && this.getVerticalDirection() === 'N-S') {\n this.flipDirectionVertically();\n }\n\n if (this.highlight.col === this.getTopRightCorner().col && this.getHorizontalDirection() === 'W-E') {\n this.flipDirectionHorizontally();\n }\n\n return true;\n }\n\n /**\n * @returns {String}\n */\n getDirection() {\n if (this.from.isNorthWestOf(this.to)) { // NorthWest - SouthEast\n return 'NW-SE';\n\n } else if (this.from.isNorthEastOf(this.to)) { // NorthEast - SouthWest\n return 'NE-SW';\n\n } else if (this.from.isSouthEastOf(this.to)) { // SouthEast - NorthWest\n return 'SE-NW';\n\n } else if (this.from.isSouthWestOf(this.to)) { // SouthWest - NorthEast\n return 'SW-NE';\n }\n }\n\n /**\n * Get the vertical direction of the range.\n *\n * @returns {String} Available options: `N-S` (north->south), `S-N` (south->north).\n */\n getVerticalDirection() {\n return ['NE-SW', 'NW-SE'].indexOf(this.getDirection()) > -1 ? 'N-S' : 'S-N';\n }\n\n /**\n * Get the horizontal direction of the range.\n *\n * @returns {String} Available options: `W-E` (west->east), `E-W` (east->west).\n */\n getHorizontalDirection() {\n return ['NW-SE', 'SW-NE'].indexOf(this.getDirection()) > -1 ? 'W-E' : 'E-W';\n }\n\n /**\n * @param {String} direction\n */\n setDirection(direction) {\n switch (direction) {\n case 'NW-SE':\n [this.from, this.to] = [this.getTopLeftCorner(), this.getBottomRightCorner()];\n break;\n case 'NE-SW':\n [this.from, this.to] = [this.getTopRightCorner(), this.getBottomLeftCorner()];\n break;\n case 'SE-NW':\n [this.from, this.to] = [this.getBottomRightCorner(), this.getTopLeftCorner()];\n break;\n case 'SW-NE':\n [this.from, this.to] = [this.getBottomLeftCorner(), this.getTopRightCorner()];\n break;\n default:\n break;\n }\n }\n\n /**\n * Flip the direction vertically. (e.g. `NW-SE` changes to `SW-NE`)\n */\n flipDirectionVertically() {\n const direction = this.getDirection();\n switch (direction) {\n case 'NW-SE':\n this.setDirection('SW-NE');\n break;\n case 'NE-SW':\n this.setDirection('SE-NW');\n break;\n case 'SE-NW':\n this.setDirection('NE-SW');\n break;\n case 'SW-NE':\n this.setDirection('NW-SE');\n break;\n default:\n break;\n }\n }\n\n /**\n * Flip the direction horizontally. (e.g. `NW-SE` changes to `NE-SW`)\n */\n flipDirectionHorizontally() {\n const direction = this.getDirection();\n switch (direction) {\n case 'NW-SE':\n this.setDirection('NE-SW');\n break;\n case 'NE-SW':\n this.setDirection('NW-SE');\n break;\n case 'SE-NW':\n this.setDirection('SW-NE');\n break;\n case 'SW-NE':\n this.setDirection('SE-NW');\n break;\n default:\n break;\n }\n }\n\n /**\n * Get top left corner of this range\n *\n * @returns {CellCoords}\n */\n getTopLeftCorner() {\n return new CellCoords(Math.min(this.from.row, this.to.row), Math.min(this.from.col, this.to.col));\n }\n\n /**\n * Get bottom right corner of this range\n *\n * @returns {CellCoords}\n */\n getBottomRightCorner() {\n return new CellCoords(Math.max(this.from.row, this.to.row), Math.max(this.from.col, this.to.col));\n }\n\n /**\n * Get top right corner of this range\n *\n * @returns {CellCoords}\n */\n getTopRightCorner() {\n return new CellCoords(Math.min(this.from.row, this.to.row), Math.max(this.from.col, this.to.col));\n }\n\n /**\n * Get bottom left corner of this range\n *\n * @returns {CellCoords}\n */\n getBottomLeftCorner() {\n return new CellCoords(Math.max(this.from.row, this.to.row), Math.min(this.from.col, this.to.col));\n }\n\n /**\n * @param {CellCoords} coords\n * @param {CellRange} expandedRange\n * @returns {*}\n */\n isCorner(coords, expandedRange) {\n if (expandedRange &&\n expandedRange.includes(coords) &&\n (this.getTopLeftCorner().isEqual(new CellCoords(expandedRange.from.row, expandedRange.from.col)) ||\n this.getTopRightCorner().isEqual(new CellCoords(expandedRange.from.row, expandedRange.to.col)) ||\n this.getBottomLeftCorner().isEqual(new CellCoords(expandedRange.to.row, expandedRange.from.col)) ||\n this.getBottomRightCorner().isEqual(new CellCoords(expandedRange.to.row, expandedRange.to.col)))) {\n return true;\n }\n\n return coords.isEqual(this.getTopLeftCorner()) || coords.isEqual(this.getTopRightCorner()) ||\n coords.isEqual(this.getBottomLeftCorner()) || coords.isEqual(this.getBottomRightCorner());\n }\n\n /**\n * @param {CellCoords} coords\n * @param {CellRange} expandedRange\n * @returns {CellCoords}\n */\n getOppositeCorner(coords, expandedRange) {\n if (!(coords instanceof CellCoords)) {\n return false;\n }\n\n if (expandedRange) {\n if (expandedRange.includes(coords)) {\n if (this.getTopLeftCorner().isEqual(new CellCoords(expandedRange.from.row, expandedRange.from.col))) {\n return this.getBottomRightCorner();\n }\n if (this.getTopRightCorner().isEqual(new CellCoords(expandedRange.from.row, expandedRange.to.col))) {\n return this.getBottomLeftCorner();\n }\n if (this.getBottomLeftCorner().isEqual(new CellCoords(expandedRange.to.row, expandedRange.from.col))) {\n return this.getTopRightCorner();\n }\n if (this.getBottomRightCorner().isEqual(new CellCoords(expandedRange.to.row, expandedRange.to.col))) {\n return this.getTopLeftCorner();\n }\n }\n }\n\n if (coords.isEqual(this.getBottomRightCorner())) {\n return this.getTopLeftCorner();\n\n } else if (coords.isEqual(this.getTopLeftCorner())) {\n return this.getBottomRightCorner();\n\n } else if (coords.isEqual(this.getTopRightCorner())) {\n return this.getBottomLeftCorner();\n\n } else if (coords.isEqual(this.getBottomLeftCorner())) {\n return this.getTopRightCorner();\n }\n }\n\n /**\n * @param {CellRange} range\n * @returns {Array}\n */\n getBordersSharedWith(range) {\n if (!this.includesRange(range)) {\n return [];\n }\n\n const thisBorders = {\n top: Math.min(this.from.row, this.to.row),\n bottom: Math.max(this.from.row, this.to.row),\n left: Math.min(this.from.col, this.to.col),\n right: Math.max(this.from.col, this.to.col)\n };\n const rangeBorders = {\n top: Math.min(range.from.row, range.to.row),\n bottom: Math.max(range.from.row, range.to.row),\n left: Math.min(range.from.col, range.to.col),\n right: Math.max(range.from.col, range.to.col)\n };\n const result = [];\n\n if (thisBorders.top == rangeBorders.top) {\n result.push('top');\n }\n if (thisBorders.right == rangeBorders.right) {\n result.push('right');\n }\n if (thisBorders.bottom == rangeBorders.bottom) {\n result.push('bottom');\n }\n if (thisBorders.left == rangeBorders.left) {\n result.push('left');\n }\n\n return result;\n }\n\n /**\n * Get inner selected cell coords defined by this range\n *\n * @returns {Array}\n */\n getInner() {\n let topLeft = this.getTopLeftCorner();\n let bottomRight = this.getBottomRightCorner();\n let out = [];\n\n for (let r = topLeft.row; r <= bottomRight.row; r++) {\n for (let c = topLeft.col; c <= bottomRight.col; c++) {\n if (!(this.from.row === r && this.from.col === c) && !(this.to.row === r && this.to.col === c)) {\n out.push(new CellCoords(r, c));\n }\n }\n }\n return out;\n }\n\n /**\n * Get all selected cell coords defined by this range\n *\n * @returns {Array}\n */\n getAll() {\n let topLeft = this.getTopLeftCorner();\n let bottomRight = this.getBottomRightCorner();\n let out = [];\n\n for (let r = topLeft.row; r <= bottomRight.row; r++) {\n for (let c = topLeft.col; c <= bottomRight.col; c++) {\n if (topLeft.row === r && topLeft.col === c) {\n out.push(topLeft);\n\n } else if (bottomRight.row === r && bottomRight.col === c) {\n out.push(bottomRight);\n\n } else {\n out.push(new CellCoords(r, c));\n }\n }\n }\n\n return out;\n }\n\n /**\n * Runs a callback function against all cells in the range. You can break the iteration by returning\n * `false` in the callback function\n *\n * @param callback {Function}\n */\n forAll(callback) {\n let topLeft = this.getTopLeftCorner();\n let bottomRight = this.getBottomRightCorner();\n\n for (let r = topLeft.row; r <= bottomRight.row; r++) {\n for (let c = topLeft.col; c <= bottomRight.col; c++) {\n let breakIteration = callback(r, c);\n\n if (breakIteration === false) {\n return;\n }\n }\n }\n }\n\n /**\n * Convert CellRange to literal object.\n *\n * @return {Object} Returns a literal object with `from` and `to` properties which each of that object\n * contains `row` and `col` keys.\n */\n toObject() {\n return {\n from: this.from.toObject(),\n to: this.to.toObject(),\n };\n }\n}\n\nexport default CellRange;\n\n\n\n// WEBPACK FOOTER //\n// ./src/3rdparty/walkontable/src/cell/range.js","import staticRegister from './../utils/staticRegister';\nimport {hasEditor, registerEditor} from './../editors';\nimport {hasRenderer, registerRenderer} from './../renderers';\nimport {hasValidator, registerValidator} from './../validators';\n\nimport autocompleteCellType from './autocompleteType';\nimport checkboxCellType from './checkboxType';\nimport dateCellType from './dateType';\nimport dropdownCellType from './dropdownType';\nimport handsontableCellType from './handsontableType';\nimport numericCellType from './numericType';\nimport passwordCellType from './passwordType';\nimport textCellType from './textType';\nimport timeCellType from './timeType';\n\nconst {\n register,\n getItem,\n hasItem,\n getNames,\n getValues,\n} = staticRegister('cellTypes');\n\n_register('autocomplete', autocompleteCellType);\n_register('checkbox', checkboxCellType);\n_register('date', dateCellType);\n_register('dropdown', dropdownCellType);\n_register('handsontable', handsontableCellType);\n_register('numeric', numericCellType);\n_register('password', passwordCellType);\n_register('text', textCellType);\n_register('time', timeCellType);\n\n/**\n * Retrieve cell type object.\n *\n * @param {String} name Cell type identification.\n * @returns {Object} Returns cell type object.\n */\nfunction _getItem(name) {\n if (!hasItem(name)) {\n throw Error(`You declared cell type \"${name}\" as a string that is not mapped to a known object.\n Cell type must be an object or a string mapped to an object registered by \"Handsontable.cellTypes.registerCellType\" method`);\n }\n\n return getItem(name);\n}\n\n/**\n * Register cell type under specified name.\n *\n * @param {String} name Cell type identification.\n * @param {Object} type An object with contains keys (eq: `editor`, `renderer`, `validator`) which describes specified behaviour of the cell.\n */\nfunction _register(name, type) {\n const {editor, renderer, validator} = type;\n\n if (editor) {\n registerEditor(name, editor);\n }\n if (renderer) {\n registerRenderer(name, renderer);\n }\n if (validator) {\n registerValidator(name, validator);\n }\n\n register(name, type);\n}\n\nexport {\n _register as registerCellType,\n _getItem as getCellType,\n hasItem as hasCellType,\n getNames as getRegisteredCellTypeNames,\n getValues as getRegisteredCellTypes,\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/cellTypes/index.js","import {addClass, empty, isChildOfWebComponentTable, removeClass} from './helpers/dom/element';\nimport {columnFactory} from './helpers/setting';\nimport {isFunction} from './helpers/function';\nimport {warn} from './helpers/console';\nimport {isDefined, isUndefined, isRegExp, _injectProductInfo, isEmpty} from './helpers/mixed';\nimport {isMobileBrowser} from './helpers/browser';\nimport DataMap from './dataMap';\nimport EditorManager from './editorManager';\nimport EventManager from './eventManager';\nimport {deepClone, duckSchema, extend, isObject, isObjectEqual, deepObjectSize, hasOwnProperty, createObjectPropListener} from './helpers/object';\nimport {arrayFlatten, arrayMap, arrayEach, arrayReduce} from './helpers/array';\nimport {toSingleLine} from './helpers/templateLiteralTag';\nimport {getPlugin} from './plugins';\nimport {getRenderer} from './renderers';\nimport {getValidator} from './validators';\nimport {randomString} from './helpers/string';\nimport {rangeEach, rangeEachReverse} from './helpers/number';\nimport TableView from './tableView';\nimport DataSource from './dataSource';\nimport {translateRowsToColumns, cellMethodLookupFactory, spreadsheetColumnLabel} from './helpers/data';\nimport {getTranslator} from './utils/recordTranslator';\nimport {registerAsRootInstance, hasValidParameter, isRootInstance} from './utils/rootInstance';\nimport {CellCoords, CellRange, ViewportColumnsCalculator} from './3rdparty/walkontable/src';\nimport Hooks from './pluginHooks';\nimport DefaultSettings from './defaultSettings';\nimport {getCellType} from './cellTypes';\nimport {getTranslatedPhrase} from './i18n';\nimport {hasLanguageDictionary} from './i18n/dictionariesManager';\nimport {warnUserAboutLanguageRegistration, applyLanguageSetting, normalizeLanguageCode} from './i18n/utils';\nimport {startObserving as keyStateStartObserving, stopObserving as keyStateStopObserving} from './utils/keyStateObserver';\nimport {Selection} from './selection';\n\nlet activeGuid = null;\n\n/**\n * Handsontable constructor\n *\n * @core\n * @constructor Core\n * @description\n *\n * After Handsontable is constructed, you can modify the grid behavior using the available public methods.\n *\n * ---\n * ## How to call methods\n *\n * These are 2 equal ways to call a Handsontable method:\n *\n * ```js\n * // all following examples assume that you constructed Handsontable like this\n * var ht = new Handsontable(document.getElementById('example1'), options);\n *\n * // now, to use setDataAtCell method, you can either:\n * ht.setDataAtCell(0, 0, 'new value');\n * ```\n *\n * Alternatively, you can call the method using jQuery wrapper (__obsolete__, requires initialization using our jQuery guide\n * ```js\n * $('#example1').handsontable('setDataAtCell', 0, 0, 'new value');\n * ```\n * ---\n */\nexport default function Core(rootElement, userSettings, rootInstanceSymbol = false) {\n var priv,\n datamap,\n dataSource,\n grid,\n editorManager,\n preventScrollingToCell = false,\n instance = this,\n GridSettings = function() {\n },\n eventManager = new EventManager(instance);\n\n extend(GridSettings.prototype, DefaultSettings.prototype); // create grid settings as a copy of default settings\n extend(GridSettings.prototype, userSettings); // overwrite defaults with user settings\n extend(GridSettings.prototype, expandType(userSettings));\n\n applyLanguageSetting(GridSettings.prototype, userSettings.language);\n\n if (hasValidParameter(rootInstanceSymbol)) {\n registerAsRootInstance(this);\n }\n\n keyStateStartObserving();\n\n this.rootElement = rootElement;\n this.isHotTableEnv = isChildOfWebComponentTable(this.rootElement);\n EventManager.isHotTableEnv = this.isHotTableEnv;\n\n this.container = document.createElement('div');\n this.renderCall = false;\n\n rootElement.insertBefore(this.container, rootElement.firstChild);\n\n if (process.env.HOT_PACKAGE_TYPE !== '\\x63\\x65' && isRootInstance(this)) {\n _injectProductInfo(userSettings.licenseKey, rootElement);\n }\n\n this.guid = `ht_${randomString()}`; // this is the namespace for global events\n\n const recordTranslator = getTranslator(instance);\n\n dataSource = new DataSource(instance);\n\n if (!this.rootElement.id || this.rootElement.id.substring(0, 3) === 'ht_') {\n this.rootElement.id = this.guid; // if root element does not have an id, assign a random id\n }\n priv = {\n cellSettings: [],\n columnSettings: [],\n columnsSettingConflicts: ['data', 'width', 'language'],\n settings: new GridSettings(), // current settings instance\n selRange: null, // exposed by public method `getSelectedRange`\n isPopulated: null,\n scrollable: null,\n firstRun: true\n };\n\n let selection = new Selection(priv.settings, {\n countCols: () => instance.countCols(),\n countRows: () => instance.countRows(),\n propToCol: (prop) => datamap.propToCol(prop),\n isEditorOpened: () => (instance.getActiveEditor() ? instance.getActiveEditor().isOpened() : false),\n });\n\n this.selection = selection;\n\n this.selection.addLocalHook('beforeSetRangeStart', (cellCoords) => {\n this.runHooks('beforeSetRangeStart', cellCoords);\n });\n\n this.selection.addLocalHook('beforeSetRangeStartOnly', (cellCoords) => {\n this.runHooks('beforeSetRangeStartOnly', cellCoords);\n });\n\n this.selection.addLocalHook('beforeSetRangeEnd', (cellCoords) => {\n this.runHooks('beforeSetRangeEnd', cellCoords);\n\n if (cellCoords.row < 0) {\n cellCoords.row = this.view.wt.wtTable.getFirstVisibleRow();\n }\n if (cellCoords.col < 0) {\n cellCoords.col = this.view.wt.wtTable.getFirstVisibleColumn();\n }\n });\n\n this.selection.addLocalHook('afterSetRangeEnd', (cellCoords) => {\n const preventScrolling = createObjectPropListener(false);\n const selectionRange = this.selection.getSelectedRange();\n const {from, to} = selectionRange.current();\n const selectionLayerLevel = selectionRange.size() - 1;\n\n this.runHooks('afterSelection',\n from.row, from.col, to.row, to.col, preventScrolling, selectionLayerLevel);\n this.runHooks('afterSelectionByProp',\n from.row, instance.colToProp(from.col), to.row, instance.colToProp(to.col), preventScrolling, selectionLayerLevel);\n\n const isSelectedByAnyHeader = this.selection.isSelectedByAnyHeader();\n const currentSelectedRange = this.selection.selectedRange.current();\n\n let scrollToCell = true;\n\n if (preventScrollingToCell) {\n scrollToCell = false;\n }\n\n if (preventScrolling.isTouched()) {\n scrollToCell = !preventScrolling.value;\n }\n\n if (scrollToCell !== false && !isSelectedByAnyHeader) {\n if (currentSelectedRange && !this.selection.isMultiple()) {\n this.view.scrollViewport(currentSelectedRange.from);\n } else {\n this.view.scrollViewport(cellCoords);\n }\n }\n\n const isSelectedByRowHeader = this.selection.isSelectedByRowHeader();\n const isSelectedByColumnHeader = this.selection.isSelectedByColumnHeader();\n\n // @TODO: These CSS classes are no longer needed anymore. They are used only as a indicator of the selected\n // rows/columns in the MergedCells plugin (via border.js#L520 in the walkontable module). After fixing\n // the Border class this should be removed.\n if (isSelectedByRowHeader && isSelectedByColumnHeader) {\n addClass(this.rootElement, ['ht__selection--rows', 'ht__selection--columns']);\n\n } else if (isSelectedByRowHeader) {\n removeClass(this.rootElement, 'ht__selection--columns');\n addClass(this.rootElement, 'ht__selection--rows');\n\n } else if (isSelectedByColumnHeader) {\n removeClass(this.rootElement, 'ht__selection--rows');\n addClass(this.rootElement, 'ht__selection--columns');\n\n } else {\n removeClass(this.rootElement, ['ht__selection--rows', 'ht__selection--columns']);\n }\n\n this._refreshBorders(null);\n });\n\n this.selection.addLocalHook('afterSelectionFinished', (cellRanges) => {\n const selectionLayerLevel = cellRanges.length - 1;\n const {from, to} = cellRanges[selectionLayerLevel];\n\n this.runHooks('afterSelectionEnd',\n from.row, from.col, to.row, to.col, selectionLayerLevel);\n this.runHooks('afterSelectionEndByProp',\n from.row, instance.colToProp(from.col), to.row, instance.colToProp(to.col), selectionLayerLevel);\n });\n\n this.selection.addLocalHook('afterIsMultipleSelection', (isMultiple) => {\n const changedIsMultiple = this.runHooks('afterIsMultipleSelection', isMultiple.value);\n\n if (isMultiple.value) {\n isMultiple.value = changedIsMultiple;\n }\n });\n\n this.selection.addLocalHook('beforeModifyTransformStart', (cellCoordsDelta) => {\n this.runHooks('modifyTransformStart', cellCoordsDelta);\n });\n this.selection.addLocalHook('afterModifyTransformStart', (coords, rowTransformDir, colTransformDir) => {\n this.runHooks('afterModifyTransformStart', coords, rowTransformDir, colTransformDir);\n });\n this.selection.addLocalHook('beforeModifyTransformEnd', (cellCoordsDelta) => {\n this.runHooks('modifyTransformEnd', cellCoordsDelta);\n });\n this.selection.addLocalHook('afterModifyTransformEnd', (coords, rowTransformDir, colTransformDir) => {\n this.runHooks('afterModifyTransformEnd', coords, rowTransformDir, colTransformDir);\n });\n this.selection.addLocalHook('afterDeselect', () => {\n editorManager.destroyEditor();\n\n this._refreshBorders();\n removeClass(this.rootElement, ['ht__selection--rows', 'ht__selection--columns']);\n\n this.runHooks('afterDeselect');\n });\n this.selection.addLocalHook('insertRowRequire', (totalRows) => {\n this.alter('insert_row', totalRows, 1, 'auto');\n });\n this.selection.addLocalHook('insertColRequire', (totalCols) => {\n this.alter('insert_col', totalCols, 1, 'auto');\n });\n\n grid = {\n /**\n * Inserts or removes rows and columns.\n *\n * @memberof Core#\n * @function alter\n * @private\n * @param {String} action Possible values: \"insert_row\", \"insert_col\", \"remove_row\", \"remove_col\".\n * @param {Number|Array} index Row or column visual index which from the alter action will be triggered.\n * Alter actions such as \"remove_row\" and \"remove_col\" support array indexes in the\n * format `[[index, amount], [index, amount]...]` this can be used to remove\n * non-consecutive columns or rows in one call.\n * @param {Number} amount Ammount rows or columns to remove.\n * @param {String} [source] Optional. Source of hook runner.\n * @param {Boolean} [keepEmptyRows] Optional. Flag for preventing deletion of empty rows.\n */\n alter(action, index, amount, source, keepEmptyRows) {\n var delta;\n\n amount = amount || 1;\n\n function spliceWith(data, index, count, toInject) {\n let valueFactory = () => {\n let result;\n\n if (toInject === 'array') {\n result = [];\n\n } else if (toInject === 'object') {\n result = {};\n }\n\n return result;\n };\n let spliceArgs = arrayMap(new Array(count), () => valueFactory());\n\n spliceArgs.unshift(index, 0);\n data.splice(...spliceArgs);\n }\n\n const normalizeIndexesGroup = (indexes) => {\n if (indexes.length === 0) {\n return [];\n }\n\n const sortedIndexes = [...indexes];\n\n // Sort the indexes in ascending order.\n sortedIndexes.sort(([indexA], [indexB]) => {\n if (indexA === indexB) {\n return 0;\n }\n\n return indexA > indexB ? 1 : -1;\n });\n\n // Normalize the {index, amount} groups into bigger groups.\n const normalizedIndexes = arrayReduce(sortedIndexes, (acc, [index, amount]) => {\n const previousItem = acc[acc.length - 1];\n const [prevIndex, prevAmount] = previousItem;\n const prevLastIndex = prevIndex + prevAmount;\n\n if (index <= prevLastIndex) {\n const amountToAdd = Math.max(amount - (prevLastIndex - index), 0);\n\n previousItem[1] += amountToAdd;\n } else {\n acc.push([index, amount]);\n }\n\n return acc;\n }, [sortedIndexes[0]]);\n\n return normalizedIndexes;\n };\n\n /* eslint-disable no-case-declarations */\n switch (action) {\n case 'insert_row':\n\n const numberOfSourceRows = instance.countSourceRows();\n\n if (instance.getSettings().maxRows === numberOfSourceRows) {\n return;\n }\n\n index = (isDefined(index)) ? index : numberOfSourceRows;\n\n delta = datamap.createRow(index, amount, source);\n spliceWith(priv.cellSettings, index, amount, 'array');\n\n if (delta) {\n if (selection.isSelected() && selection.selectedRange.current().from.row >= index) {\n selection.selectedRange.current().from.row += delta;\n selection.transformEnd(delta, 0); // will call render() internally\n } else {\n instance._refreshBorders(); // it will call render and prepare methods\n }\n }\n break;\n\n case 'insert_col':\n delta = datamap.createCol(index, amount, source);\n\n for (let row = 0, len = instance.countSourceRows(); row < len; row++) {\n if (priv.cellSettings[row]) {\n spliceWith(priv.cellSettings[row], index, amount);\n }\n }\n\n if (delta) {\n if (Array.isArray(instance.getSettings().colHeaders)) {\n var spliceArray = [index, 0];\n spliceArray.length += delta; // inserts empty (undefined) elements at the end of an array\n Array.prototype.splice.apply(instance.getSettings().colHeaders, spliceArray); // inserts empty (undefined) elements into the colHeader array\n }\n\n if (selection.isSelected() && selection.selectedRange.current().from.col >= index) {\n selection.selectedRange.current().from.col += delta;\n selection.transformEnd(0, delta); // will call render() internally\n } else {\n instance._refreshBorders(); // it will call render and prepare methods\n }\n }\n break;\n\n case 'remove_row':\n\n const removeRow = (indexes) => {\n let offset = 0;\n\n arrayEach(indexes, ([index, amount]) => {\n const calcIndex = isEmpty(index) ? instance.countRows() - 1 : Math.max(index - offset, 0);\n\n // If the 'index' is an integer decrease it by 'offset' otherwise pass it through to make the value\n // compatible with datamap.removeCol method.\n if (Number.isInteger(index)) {\n index = Math.max(index - offset, 0);\n }\n\n // TODO: for datamap.removeRow index should be passed as it is (with undefined and null values). If not, the logic\n // inside the datamap.removeRow breaks the removing functionality.\n datamap.removeRow(index, amount, source);\n priv.cellSettings.splice(calcIndex, amount);\n\n const totalRows = instance.countRows();\n const fixedRowsTop = instance.getSettings().fixedRowsTop;\n\n if (fixedRowsTop >= calcIndex + 1) {\n instance.getSettings().fixedRowsTop -= Math.min(amount, fixedRowsTop - calcIndex);\n }\n\n const fixedRowsBottom = instance.getSettings().fixedRowsBottom;\n\n if (fixedRowsBottom && calcIndex >= totalRows - fixedRowsBottom) {\n instance.getSettings().fixedRowsBottom -= Math.min(amount, fixedRowsBottom);\n }\n\n offset += amount;\n });\n };\n\n if (Array.isArray(index)) {\n removeRow(normalizeIndexesGroup(index));\n } else {\n removeRow([[index, amount]]);\n }\n\n grid.adjustRowsAndCols();\n instance._refreshBorders(); // it will call render and prepare methods\n break;\n\n case 'remove_col':\n\n const removeCol = (indexes) => {\n let offset = 0;\n\n arrayEach(indexes, ([index, amount]) => {\n const calcIndex = isEmpty(index) ? instance.countCols() - 1 : Math.max(index - offset, 0);\n\n let visualColumnIndex = recordTranslator.toPhysicalColumn(calcIndex);\n\n // If the 'index' is an integer decrease it by 'offset' otherwise pass it through to make the value\n // compatible with datamap.removeCol method.\n if (Number.isInteger(index)) {\n index = Math.max(index - offset, 0);\n }\n\n // TODO: for datamap.removeCol index should be passed as it is (with undefined and null values). If not, the logic\n // inside the datamap.removeCol breaks the removing functionality.\n datamap.removeCol(index, amount, source);\n\n for (let row = 0, len = instance.countSourceRows(); row < len; row++) {\n if (priv.cellSettings[row]) { // if row hasn't been rendered it wouldn't have cellSettings\n priv.cellSettings[row].splice(visualColumnIndex, amount);\n }\n }\n var fixedColumnsLeft = instance.getSettings().fixedColumnsLeft;\n\n if (fixedColumnsLeft >= calcIndex + 1) {\n instance.getSettings().fixedColumnsLeft -= Math.min(amount, fixedColumnsLeft - calcIndex);\n }\n\n if (Array.isArray(instance.getSettings().colHeaders)) {\n if (typeof visualColumnIndex === 'undefined') {\n visualColumnIndex = -1;\n }\n instance.getSettings().colHeaders.splice(visualColumnIndex, amount);\n }\n\n offset += amount;\n });\n };\n\n if (Array.isArray(index)) {\n removeCol(normalizeIndexesGroup(index));\n } else {\n removeCol([[index, amount]]);\n }\n\n grid.adjustRowsAndCols();\n instance._refreshBorders(); // it will call render and prepare methods\n\n break;\n default:\n throw new Error(`There is no such action \"${action}\"`);\n }\n\n if (!keepEmptyRows) {\n grid.adjustRowsAndCols(); // makes sure that we did not add rows that will be removed in next refresh\n }\n },\n\n /**\n * Makes sure there are empty rows at the bottom of the table\n */\n adjustRowsAndCols() {\n if (priv.settings.minRows) {\n // should I add empty rows to data source to meet minRows?\n let rows = instance.countRows();\n\n if (rows < priv.settings.minRows) {\n for (let r = 0, minRows = priv.settings.minRows; r < minRows - rows; r++) {\n datamap.createRow(instance.countRows(), 1, 'auto');\n }\n }\n }\n if (priv.settings.minSpareRows) {\n let emptyRows = instance.countEmptyRows(true);\n\n // should I add empty rows to meet minSpareRows?\n if (emptyRows < priv.settings.minSpareRows) {\n for (; emptyRows < priv.settings.minSpareRows && instance.countSourceRows() < priv.settings.maxRows; emptyRows++) {\n datamap.createRow(instance.countRows(), 1, 'auto');\n }\n }\n }\n {\n let emptyCols;\n\n // count currently empty cols\n if (priv.settings.minCols || priv.settings.minSpareCols) {\n emptyCols = instance.countEmptyCols(true);\n }\n\n // should I add empty cols to meet minCols?\n if (priv.settings.minCols && !priv.settings.columns && instance.countCols() < priv.settings.minCols) {\n for (; instance.countCols() < priv.settings.minCols; emptyCols++) {\n datamap.createCol(instance.countCols(), 1, 'auto');\n }\n }\n // should I add empty cols to meet minSpareCols?\n if (priv.settings.minSpareCols && !priv.settings.columns && instance.dataType === 'array' &&\n emptyCols < priv.settings.minSpareCols) {\n for (; emptyCols < priv.settings.minSpareCols && instance.countCols() < priv.settings.maxCols; emptyCols++) {\n datamap.createCol(instance.countCols(), 1, 'auto');\n }\n }\n }\n let rowCount = instance.countRows();\n let colCount = instance.countCols();\n\n if (rowCount === 0 || colCount === 0) {\n selection.deselect();\n }\n\n if (selection.isSelected()) {\n arrayEach(selection.selectedRange, (range) => {\n let selectionChanged = false;\n let fromRow = range.from.row;\n let fromCol = range.from.col;\n let toRow = range.to.row;\n let toCol = range.to.col;\n\n // if selection is outside, move selection to last row\n if (fromRow > rowCount - 1) {\n fromRow = rowCount - 1;\n selectionChanged = true;\n\n if (toRow > fromRow) {\n toRow = fromRow;\n }\n } else if (toRow > rowCount - 1) {\n toRow = rowCount - 1;\n selectionChanged = true;\n\n if (fromRow > toRow) {\n fromRow = toRow;\n }\n }\n // if selection is outside, move selection to last row\n if (fromCol > colCount - 1) {\n fromCol = colCount - 1;\n selectionChanged = true;\n\n if (toCol > fromCol) {\n toCol = fromCol;\n }\n } else if (toCol > colCount - 1) {\n toCol = colCount - 1;\n selectionChanged = true;\n\n if (fromCol > toCol) {\n fromCol = toCol;\n }\n }\n\n if (selectionChanged) {\n instance.selectCell(fromRow, fromCol, toRow, toCol);\n }\n });\n }\n if (instance.view) {\n instance.view.wt.wtOverlays.adjustElementsSize();\n }\n },\n\n /**\n * Populate the data from the provided 2d array from the given cell coordinates.\n *\n * @private\n * @param {Object} start Start selection position. Visual indexes.\n * @param {Array} input 2d data array.\n * @param {Object} [end] End selection position (only for drag-down mode). Visual indexes.\n * @param {String} [source=\"populateFromArray\"] Source information string.\n * @param {String} [method=\"overwrite\"] Populate method. Possible options: `shift_down`, `shift_right`, `overwrite`.\n * @param {String} direction (left|right|up|down) String specifying the direction.\n * @param {Array} deltas The deltas array. A difference between values of adjacent cells.\n * Useful **only** when the type of handled cells is `numeric`.\n * @returns {Object|undefined} ending td in pasted area (only if any cell was changed).\n */\n populateFromArray(start, input, end, source, method, direction, deltas) {\n // TODO: either remove or implement the `direction` argument. Currently it's not working at all.\n var r,\n rlen,\n c,\n clen,\n setData = [],\n current = {};\n\n rlen = input.length;\n\n if (rlen === 0) {\n return false;\n }\n\n var repeatCol,\n repeatRow,\n cmax,\n rmax,\n baseEnd = {\n row: end === null ? null : end.row,\n col: end === null ? null : end.col\n };\n\n /* eslint-disable no-case-declarations */\n // insert data with specified pasteMode method\n switch (method) {\n case 'shift_down' :\n repeatCol = end ? end.col - start.col + 1 : 0;\n repeatRow = end ? end.row - start.row + 1 : 0;\n input = translateRowsToColumns(input);\n for (c = 0, clen = input.length, cmax = Math.max(clen, repeatCol); c < cmax; c++) {\n if (c < clen) {\n for (r = 0, rlen = input[c].length; r < repeatRow - rlen; r++) {\n input[c].push(input[c][r % rlen]);\n }\n input[c].unshift(start.col + c, start.row, 0);\n instance.spliceCol(...input[c]);\n } else {\n input[c % clen][0] = start.col + c;\n instance.spliceCol(...input[c % clen]);\n }\n }\n break;\n\n case 'shift_right':\n repeatCol = end ? end.col - start.col + 1 : 0;\n repeatRow = end ? end.row - start.row + 1 : 0;\n for (r = 0, rlen = input.length, rmax = Math.max(rlen, repeatRow); r < rmax; r++) {\n if (r < rlen) {\n for (c = 0, clen = input[r].length; c < repeatCol - clen; c++) {\n input[r].push(input[r][c % clen]);\n }\n input[r].unshift(start.row + r, start.col, 0);\n instance.spliceRow(...input[r]);\n } else {\n input[r % rlen][0] = start.row + r;\n instance.spliceRow(...input[r % rlen]);\n }\n }\n break;\n\n case 'overwrite':\n default:\n // overwrite and other not specified options\n current.row = start.row;\n current.col = start.col;\n\n let selected = { // selected range\n row: (end && start) ? (end.row - start.row + 1) : 1,\n col: (end && start) ? (end.col - start.col + 1) : 1\n };\n let skippedRow = 0;\n let skippedColumn = 0;\n let pushData = true;\n let cellMeta;\n\n let getInputValue = function getInputValue(row, col = null) {\n let rowValue = input[row % input.length];\n\n if (col !== null) {\n return rowValue[col % rowValue.length];\n }\n\n return rowValue;\n };\n let rowInputLength = input.length;\n let rowSelectionLength = end ? end.row - start.row + 1 : 0;\n\n if (end) {\n rlen = rowSelectionLength;\n } else {\n rlen = Math.max(rowInputLength, rowSelectionLength);\n }\n for (r = 0; r < rlen; r++) {\n if ((end && current.row > end.row && rowSelectionLength > rowInputLength) ||\n (!priv.settings.allowInsertRow && current.row > instance.countRows() - 1) ||\n (current.row >= priv.settings.maxRows)) {\n break;\n }\n let visualRow = r - skippedRow;\n let colInputLength = getInputValue(visualRow).length;\n let colSelectionLength = end ? end.col - start.col + 1 : 0;\n\n if (end) {\n clen = colSelectionLength;\n } else {\n clen = Math.max(colInputLength, colSelectionLength);\n }\n current.col = start.col;\n cellMeta = instance.getCellMeta(current.row, current.col);\n\n if ((source === 'CopyPaste.paste' || source === 'Autofill.autofill') && cellMeta.skipRowOnPaste) {\n skippedRow++;\n current.row++;\n rlen++;\n /* eslint-disable no-continue */\n continue;\n }\n skippedColumn = 0;\n\n for (c = 0; c < clen; c++) {\n if ((end && current.col > end.col && colSelectionLength > colInputLength) ||\n (!priv.settings.allowInsertColumn && current.col > instance.countCols() - 1) ||\n (current.col >= priv.settings.maxCols)) {\n break;\n }\n cellMeta = instance.getCellMeta(current.row, current.col);\n\n if ((source === 'CopyPaste.paste' || source === 'Autofill.fill') && cellMeta.skipColumnOnPaste) {\n skippedColumn++;\n current.col++;\n clen++;\n continue;\n }\n if (cellMeta.readOnly) {\n current.col++;\n /* eslint-disable no-continue */\n continue;\n }\n let visualColumn = c - skippedColumn;\n let value = getInputValue(visualRow, visualColumn);\n let orgValue = instance.getDataAtCell(current.row, current.col);\n let index = {\n row: visualRow,\n col: visualColumn\n };\n\n if (source === 'Autofill.fill') {\n let result = instance.runHooks('beforeAutofillInsidePopulate', index, direction, input, deltas, {}, selected);\n\n if (result) {\n value = isUndefined(result.value) ? value : result.value;\n }\n }\n if (value !== null && typeof value === 'object') {\n if (orgValue === null || typeof orgValue !== 'object') {\n pushData = false;\n\n } else {\n let orgValueSchema = duckSchema(orgValue[0] || orgValue);\n let valueSchema = duckSchema(value[0] || value);\n\n /* eslint-disable max-depth */\n if (isObjectEqual(orgValueSchema, valueSchema)) {\n value = deepClone(value);\n } else {\n pushData = false;\n }\n }\n\n } else if (orgValue !== null && typeof orgValue === 'object') {\n pushData = false;\n }\n if (pushData) {\n setData.push([current.row, current.col, value]);\n }\n pushData = true;\n current.col++;\n }\n current.row++;\n }\n instance.setDataAtCell(setData, null, null, source || 'populateFromArray');\n break;\n }\n },\n };\n\n /**\n * Internal function to set `language` key of settings.\n *\n * @private\n * @param {String} languageCode Language code for specific language i.e. 'en-US', 'pt-BR', 'de-DE'\n * @fires Hooks#afterLanguageChange\n */\n function setLanguage(languageCode) {\n const normalizedLanguageCode = normalizeLanguageCode(languageCode);\n\n if (hasLanguageDictionary(normalizedLanguageCode)) {\n instance.runHooks('beforeLanguageChange', normalizedLanguageCode);\n\n GridSettings.prototype.language = normalizedLanguageCode;\n\n instance.runHooks('afterLanguageChange', normalizedLanguageCode);\n\n } else {\n warnUserAboutLanguageRegistration(languageCode);\n }\n }\n\n this.init = function() {\n dataSource.setData(priv.settings.data);\n instance.runHooks('beforeInit');\n\n if (isMobileBrowser()) {\n addClass(instance.rootElement, 'mobile');\n }\n\n this.updateSettings(priv.settings, true);\n\n this.view = new TableView(this);\n editorManager = EditorManager.getInstance(instance, priv, selection, datamap);\n\n this.forceFullRender = true; // used when data was changed\n\n instance.runHooks('init');\n this.view.render();\n\n if (typeof priv.firstRun === 'object') {\n instance.runHooks('afterChange', priv.firstRun[0], priv.firstRun[1]);\n priv.firstRun = false;\n }\n instance.runHooks('afterInit');\n };\n\n function ValidatorsQueue() { // moved this one level up so it can be used in any function here. Probably this should be moved to a separate file\n var resolved = false;\n\n return {\n validatorsInQueue: 0,\n valid: true,\n addValidatorToQueue() {\n this.validatorsInQueue++;\n resolved = false;\n },\n removeValidatorFormQueue() {\n this.validatorsInQueue = this.validatorsInQueue - 1 < 0 ? 0 : this.validatorsInQueue - 1;\n this.checkIfQueueIsEmpty();\n },\n onQueueEmpty(valid) {\n },\n checkIfQueueIsEmpty() {\n if (this.validatorsInQueue == 0 && resolved == false) {\n resolved = true;\n this.onQueueEmpty(this.valid);\n }\n }\n };\n }\n\n /**\n * Get parsed number from numeric string.\n *\n * @private\n * @param {String} numericData Float (separated by a dot or a comma) or integer.\n * @returns {Number} Number if we get data in parsable format, not changed value otherwise.\n */\n function getParsedNumber(numericData) {\n // Unifying \"float like\" string. Change from value with comma determiner to value with dot determiner,\n // for example from `450,65` to `450.65`.\n const unifiedNumericData = numericData.replace(',', '.');\n\n if (isNaN(parseFloat(unifiedNumericData)) === false) {\n return parseFloat(unifiedNumericData);\n }\n\n return numericData;\n }\n\n function validateChanges(changes, source, callback) {\n const waitingForValidator = new ValidatorsQueue();\n const isNumericData = (value) => value.length > 0 && /^-?[\\d\\s]*(\\.|,)?\\d*$/.test(value);\n\n waitingForValidator.onQueueEmpty = resolve;\n\n for (let i = changes.length - 1; i >= 0; i--) {\n if (changes[i] === null) {\n changes.splice(i, 1);\n } else {\n const [row, prop, , newValue] = changes[i];\n const col = datamap.propToCol(prop);\n const cellProperties = instance.getCellMeta(row, col);\n\n if (cellProperties.type === 'numeric' && typeof newValue === 'string' && isNumericData(newValue)) {\n changes[i][3] = getParsedNumber(newValue);\n }\n\n /* eslint-disable no-loop-func */\n if (instance.getCellValidator(cellProperties)) {\n waitingForValidator.addValidatorToQueue();\n instance.validateCell(changes[i][3], cellProperties, (function(i, cellProperties) {\n return function(result) {\n if (typeof result !== 'boolean') {\n throw new Error('Validation error: result is not boolean');\n }\n if (result === false && cellProperties.allowInvalid === false) {\n changes.splice(i, 1); // cancel the change\n cellProperties.valid = true; // we cancelled the change, so cell value is still valid\n const cell = instance.getCell(cellProperties.visualRow, cellProperties.visualCol);\n removeClass(cell, instance.getSettings().invalidCellClassName);\n --i;\n }\n waitingForValidator.removeValidatorFormQueue();\n };\n }(i, cellProperties)), source);\n }\n }\n }\n waitingForValidator.checkIfQueueIsEmpty();\n\n function resolve() {\n var beforeChangeResult;\n\n if (changes.length) {\n beforeChangeResult = instance.runHooks('beforeChange', changes, source || 'edit');\n if (isFunction(beforeChangeResult)) {\n warn('Your beforeChange callback returns a function. It\\'s not supported since Handsontable 0.12.1 (and the returned function will not be executed).');\n } else if (beforeChangeResult === false) {\n changes.splice(0, changes.length); // invalidate all changes (remove everything from array)\n }\n }\n callback(); // called when async validators are resolved and beforeChange was not async\n }\n }\n\n /**\n * Internal function to apply changes. Called after validateChanges\n *\n * @private\n * @param {Array} changes Array in form of [row, prop, oldValue, newValue]\n * @param {String} source String that identifies how this change will be described in changes array (useful in onChange callback)\n * @fires Hooks#beforeChangeRender\n * @fires Hooks#afterChange\n */\n function applyChanges(changes, source) {\n let i = changes.length - 1;\n\n if (i < 0) {\n return;\n }\n\n for (; i >= 0; i--) {\n let skipThisChange = false;\n\n if (changes[i] === null) {\n changes.splice(i, 1);\n /* eslint-disable no-continue */\n continue;\n }\n\n if (changes[i][2] == null && changes[i][3] == null) {\n /* eslint-disable no-continue */\n continue;\n }\n\n if (priv.settings.allowInsertRow) {\n while (changes[i][0] > instance.countRows() - 1) {\n let numberOfCreatedRows = datamap.createRow(void 0, void 0, source);\n\n if (numberOfCreatedRows === 0) {\n skipThisChange = true;\n break;\n }\n }\n }\n\n if (skipThisChange) {\n /* eslint-disable no-continue */\n continue;\n }\n\n if (instance.dataType === 'array' && (!priv.settings.columns || priv.settings.columns.length === 0) && priv.settings.allowInsertColumn) {\n while (datamap.propToCol(changes[i][1]) > instance.countCols() - 1) {\n datamap.createCol(void 0, void 0, source);\n }\n }\n\n datamap.set(changes[i][0], changes[i][1], changes[i][3]);\n }\n\n instance.forceFullRender = true; // used when data was changed\n grid.adjustRowsAndCols();\n instance.runHooks('beforeChangeRender', changes, source);\n editorManager.lockEditor();\n instance._refreshBorders(null);\n editorManager.unlockEditor();\n instance.view.wt.wtOverlays.adjustElementsSize();\n instance.runHooks('afterChange', changes, source || 'edit');\n\n let activeEditor = instance.getActiveEditor();\n\n if (activeEditor && isDefined(activeEditor.refreshValue)) {\n activeEditor.refreshValue();\n }\n }\n\n /**\n * Validate a single cell.\n *\n * @param {String|Number} value\n * @param cellProperties\n * @param callback\n * @param source\n */\n this.validateCell = function(value, cellProperties, callback, source) {\n var validator = instance.getCellValidator(cellProperties);\n\n // the `canBeValidated = false` argument suggests, that the cell passes validation by default.\n function done(valid, canBeValidated = true) {\n // Fixes GH#3903\n if (!canBeValidated || cellProperties.hidden === true) {\n callback(valid);\n return;\n }\n\n var col = cellProperties.visualCol,\n row = cellProperties.visualRow,\n td = instance.getCell(row, col, true);\n\n if (td && td.nodeName != 'TH') {\n instance.view.wt.wtSettings.settings.cellRenderer(row, col, td);\n }\n callback(valid);\n }\n\n if (isRegExp(validator)) {\n validator = (function(validator) {\n return function(value, callback) {\n callback(validator.test(value));\n };\n }(validator));\n }\n\n if (isFunction(validator)) {\n\n value = instance.runHooks('beforeValidate', value, cellProperties.visualRow, cellProperties.prop, source);\n\n // To provide consistent behaviour, validation should be always asynchronous\n instance._registerTimeout(setTimeout(() => {\n validator.call(cellProperties, value, (valid) => {\n valid = instance.runHooks('afterValidate', valid, value, cellProperties.visualRow, cellProperties.prop, source);\n cellProperties.valid = valid;\n\n done(valid);\n instance.runHooks('postAfterValidate', valid, value, cellProperties.visualRow, cellProperties.prop, source);\n });\n }, 0));\n\n } else {\n // resolve callback even if validator function was not found\n instance._registerTimeout(setTimeout(() => {\n cellProperties.valid = true;\n done(cellProperties.valid, false);\n }, 0));\n }\n };\n\n function setDataInputToArray(row, propOrCol, value) {\n if (typeof row === 'object') { // is it an array of changes\n return row;\n }\n return [\n [row, propOrCol, value]\n ];\n }\n\n /**\n * @description\n * Set new value to a cell. To change many cells at once, pass an array of `changes` in format `[[row, col, value], ...]` as\n * the only parameter. `col` is the index of a __visible__ column (note that if columns were reordered,\n * the current visible order will be used). `source` is a flag for before/afterChange events. If you pass only array of\n * changes then `source` could be set as second parameter.\n *\n * @memberof Core#\n * @function setDataAtCell\n * @param {Number|Array} row Visual row index or array of changes in format `[[row, col, value], ...]`.\n * @param {Number} col Visual column index.\n * @param {String} value New value.\n * @param {String} [source] String that identifies how this change will be described in the changes array (useful in onAfterChange or onBeforeChange callback).\n */\n this.setDataAtCell = function(row, col, value, source) {\n var\n input = setDataInputToArray(row, col, value),\n i,\n ilen,\n changes = [],\n prop;\n\n for (i = 0, ilen = input.length; i < ilen; i++) {\n if (typeof input[i] !== 'object') {\n throw new Error('Method `setDataAtCell` accepts row number or changes array of arrays as its first parameter');\n }\n if (typeof input[i][1] !== 'number') {\n throw new Error('Method `setDataAtCell` accepts row and column number as its parameters. If you want to use object property name, use method `setDataAtRowProp`');\n }\n prop = datamap.colToProp(input[i][1]);\n changes.push([\n input[i][0],\n prop,\n dataSource.getAtCell(recordTranslator.toPhysicalRow(input[i][0]), input[i][1]),\n input[i][2],\n ]);\n }\n\n if (!source && typeof row === 'object') {\n source = col;\n }\n\n instance.runHooks('afterSetDataAtCell', changes, source);\n\n validateChanges(changes, source, () => {\n applyChanges(changes, source);\n });\n };\n\n /**\n * @description\n * Set new value to a cell. To change many cells at once, pass an array of `changes` in format `[[row, prop, value], ...]` as\n * the only parameter. `prop` is the name of the object property (e.g. `first.name`). `source` is a flag for before/afterChange events.\n * If you pass only array of changes then `source` could be set as second parameter.\n *\n * @memberof Core#\n * @function setDataAtRowProp\n * @param {Number|Array} row Visual row index or array of changes in format `[[row, prop, value], ...]`.\n * @param {String} prop Property name or the source string.\n * @param {String} value Value to be set.\n * @param {String} [source] String that identifies how this change will be described in changes array (useful in onChange callback).\n */\n this.setDataAtRowProp = function(row, prop, value, source) {\n var input = setDataInputToArray(row, prop, value),\n i,\n ilen,\n changes = [];\n\n for (i = 0, ilen = input.length; i < ilen; i++) {\n changes.push([\n input[i][0],\n input[i][1],\n dataSource.getAtCell(recordTranslator.toPhysicalRow(input[i][0]), input[i][1]),\n input[i][2],\n ]);\n }\n\n if (!source && typeof row === 'object') {\n source = prop;\n }\n\n instance.runHooks('afterSetDataAtRowProp', changes, source);\n\n validateChanges(changes, source, () => {\n applyChanges(changes, source);\n });\n };\n\n /**\n * Listen to the keyboard input on document body.\n *\n * @memberof Core#\n * @function listen\n * @since 0.11\n * @param {Boolean} [modifyDocumentFocus=true] If `true`, currently focused element will be blured (which returns focus\n * to the document.body). Otherwise the active element does not lose its focus.\n */\n this.listen = function(modifyDocumentFocus = true) {\n if (modifyDocumentFocus) {\n let invalidActiveElement = !document.activeElement || (document.activeElement && document.activeElement.nodeName === void 0);\n\n if (document.activeElement && document.activeElement !== document.body && !invalidActiveElement) {\n document.activeElement.blur();\n\n } else if (invalidActiveElement) { // IE\n document.body.focus();\n }\n }\n\n if (instance && !instance.isListening()) {\n activeGuid = instance.guid;\n instance.runHooks('afterListen');\n }\n };\n\n /**\n * Stop listening to keyboard input on the document body.\n *\n * @memberof Core#\n * @function unlisten\n * @since 0.11\n */\n this.unlisten = function() {\n if (this.isListening()) {\n activeGuid = null;\n instance.runHooks('afterUnlisten');\n }\n };\n\n /**\n * Returns `true` if the current Handsontable instance is listening to keyboard input on document body.\n *\n * @memberof Core#\n * @function isListening\n * @since 0.11\n * @returns {Boolean} `true` if the instance is listening, `false` otherwise.\n */\n this.isListening = function() {\n return activeGuid === instance.guid;\n };\n\n /**\n * Destroys the current editor, renders and selects the current cell.\n *\n * @memberof Core#\n * @function destroyEditor\n * @param {Boolean} [revertOriginal] If != `true`, edited data is saved. Otherwise the previous value is restored.\n */\n this.destroyEditor = function(revertOriginal) {\n instance._refreshBorders(revertOriginal);\n };\n\n /**\n * Populate cells at position with 2D input array (e.g. `[[1, 2], [3, 4]]`).\n * Use `endRow`, `endCol` when you want to cut input when a certain row is reached.\n * Optional `source` parameter (default value \"populateFromArray\") is used to identify this call in the resulting events (beforeChange, afterChange).\n * Optional `populateMethod` parameter (default value \"overwrite\", possible values \"shift_down\" and \"shift_right\")\n * has the same effect as pasteMode option {@link Options#pasteMode}\n *\n * @memberof Core#\n * @function populateFromArray\n * @since 0.9.0\n * @param {Number} row Start visual row index.\n * @param {Number} col Start visual column index.\n * @param {Array} input 2d array\n * @param {Number} [endRow] End visual row index (use when you want to cut input when certain row is reached).\n * @param {Number} [endCol] End visual column index (use when you want to cut input when certain column is reached).\n * @param {String} [source=\"populateFromArray\"] Source string.\n * @param {String} [method=\"overwrite\"] Populate method. Possible options: `shift_down`, `shift_right`, `overwrite`.\n * @param {String} direction Populate direction. (left|right|up|down)\n * @param {Array} deltas Deltas array.\n * @returns {Object|undefined} The ending TD element in pasted area (only if any cells were changed).\n */\n this.populateFromArray = function(row, col, input, endRow, endCol, source, method, direction, deltas) {\n var c;\n\n if (!(typeof input === 'object' && typeof input[0] === 'object')) {\n throw new Error('populateFromArray parameter `input` must be an array of arrays'); // API changed in 0.9-beta2, let's check if you use it correctly\n }\n c = typeof endRow === 'number' ? new CellCoords(endRow, endCol) : null;\n\n return grid.populateFromArray(new CellCoords(row, col), input, c, source, method, direction, deltas);\n };\n\n /**\n * Adds/removes data from the column. This function is modelled after Array.splice.\n * Parameter `col` is the index of the column in which do you want to do splice.\n * Parameter `index` is the row index at which to start changing the array.\n * If negative, will begin that many elements from the end. Parameter `amount`, is the number of the old array elements to remove.\n * If the amount is 0, no elements are removed. Fourth and further parameters are the `elements` to add to the array.\n * If you don't specify any elements, spliceCol simply removes elements from the array.\n * {@link DataMap#spliceCol}\n *\n * @memberof Core#\n * @function spliceCol\n * @since 0.9-beta2\n * @param {Number} col Index of the column in which do you want to do splice.\n * @param {Number} index Index at which to start changing the array. If negative, will begin that many elements from the end.\n * @param {Number} amount An integer indicating the number of old array elements to remove. If amount is 0, no elements are removed.\n * @param {*} [elements] The elements to add to the array. If you don't specify any elements, spliceCol simply removes elements from the array.\n */\n this.spliceCol = function(col, index, amount/* , elements... */) {\n return datamap.spliceCol(...arguments);\n };\n\n /**\n * Adds/removes data from the row. This function works is modelled after Array.splice.\n * Parameter `row` is the index of row in which do you want to do splice.\n * Parameter `index` is the column index at which to start changing the array.\n * If negative, will begin that many elements from the end. Parameter `amount`, is the number of old array elements to remove.\n * If the amount is 0, no elements are removed. Fourth and further parameters are the `elements` to add to the array.\n * If you don't specify any elements, spliceCol simply removes elements from the array.\n * {@link DataMap#spliceRow}\n *\n * @memberof Core#\n * @function spliceRow\n * @since 0.11\n * @param {Number} row Index of column in which do you want to do splice.\n * @param {Number} index Index at which to start changing the array. If negative, will begin that many elements from the end.\n * @param {Number} amount An integer indicating the number of old array elements to remove. If amount is 0, no elements are removed.\n * @param {*} [elements] The elements to add to the array. If you don't specify any elements, spliceCol simply removes elements from the array.\n */\n this.spliceRow = function(row, index, amount/* , elements... */) {\n return datamap.spliceRow(...arguments);\n };\n\n /**\n * Returns indexes of the currently selected cells as an array of arrays `[[startRow, startCol, endRow, endCol], ...]`.\n *\n * Start row and start col are the coordinates of the active cell (where the selection was started).\n *\n * The version 0.36.0 adds a non-consecutive selection feature. Since this version, the method returns an array of arrays.\n * Additionally to collect the coordinates of the currently selected area (as it was previously done by the method)\n * you need to use `getSelectedLast` method.\n *\n * @memberof Core#\n * @function getSelected\n * @returns {Array[]|undefined} An array of arrays of the selection's coordinates.\n */\n this.getSelected = function() { // https://github.com/handsontable/handsontable/issues/44 //cjl\n if (selection.isSelected()) {\n return arrayMap(selection.getSelectedRange(), ({from, to}) => [from.row, from.col, to.row, to.col]);\n }\n };\n\n /**\n * Returns the last coordinates applied to the table as a an array `[startRow, startCol, endRow, endCol]`.\n *\n * @since 0.36.0\n * @memberof Core#\n * @function getSelectedLast\n * @returns {Array|undefined} An array of the selection's coordinates.\n */\n this.getSelectedLast = function() {\n const selected = this.getSelected();\n let result;\n\n if (selected && selected.length > 0) {\n result = selected[selected.length - 1];\n }\n\n return result;\n };\n\n /**\n * Returns the current selection as an array of CellRange objects.\n *\n * The version 0.36.0 adds a non-consecutive selection feature. Since this version, the method returns an array of arrays.\n * Additionally to collect the coordinates of the currently selected area (as it was previously done by the method)\n * you need to use `getSelectedRangeLast` method.\n *\n * @memberof Core#\n * @function getSelectedRange\n * @since 0.11\n * @returns {CellRange[]|undefined} Selected range object or undefined` if there is no selection.\n */\n this.getSelectedRange = function() { // https://github.com/handsontable/handsontable/issues/44 //cjl\n if (selection.isSelected()) {\n return Array.from(selection.getSelectedRange());\n }\n };\n\n /**\n * Returns the last coordinates applied to the table as a CellRange object.\n *\n * @memberof Core#\n * @function getSelectedRangeLast\n * @since 0.36.0\n * @returns {CellRange|undefined} Selected range object or undefined` if there is no selection.\n */\n this.getSelectedRangeLast = function() {\n const selectedRange = this.getSelectedRange();\n let result;\n\n if (selectedRange && selectedRange.length > 0) {\n result = selectedRange[selectedRange.length - 1];\n }\n\n return result;\n };\n\n /**\n * Erases content from cells that have been selected in the table.\n *\n * @memberof Core#\n * @function emptySelectedCells\n * @since 0.36.0\n */\n this.emptySelectedCells = function() {\n if (!selection.isSelected()) {\n return;\n }\n const changes = [];\n\n arrayEach(selection.getSelectedRange(), (cellRange) => {\n const topLeft = cellRange.getTopLeftCorner();\n const bottomRight = cellRange.getBottomRightCorner();\n\n rangeEach(topLeft.row, bottomRight.row, (row) => {\n rangeEach(topLeft.col, bottomRight.col, (column) => {\n if (!this.getCellMeta(row, column).readOnly) {\n changes.push([row, column, '']);\n }\n });\n });\n });\n\n if (changes.length > 0) {\n this.setDataAtCell(changes);\n }\n };\n\n /**\n * Rerender the table.\n *\n * @memberof Core#\n * @function render\n */\n this.render = function() {\n if (instance.view) {\n instance.renderCall = true;\n instance.forceFullRender = true; // used when data was changed\n editorManager.lockEditor();\n instance._refreshBorders(null);\n editorManager.unlockEditor();\n }\n };\n\n /**\n * Reset all cells in the grid to contain data from the data array.\n *\n * @memberof Core#\n * @function loadData\n * @param {Array} data Array of arrays or array of objects containing data.\n * @fires Hooks#afterLoadData\n * @fires Hooks#afterChange\n */\n this.loadData = function(data) {\n if (Array.isArray(priv.settings.dataSchema)) {\n instance.dataType = 'array';\n } else if (isFunction(priv.settings.dataSchema)) {\n instance.dataType = 'function';\n } else {\n instance.dataType = 'object';\n }\n\n if (datamap) {\n datamap.destroy();\n }\n datamap = new DataMap(instance, priv, GridSettings);\n\n if (typeof data === 'object' && data !== null) {\n if (!(data.push && data.splice)) { // check if data is array. Must use duck-type check so Backbone Collections also pass it\n // when data is not an array, attempt to make a single-row array of it\n data = [data];\n }\n\n } else if (data === null) {\n data = [];\n var row;\n var r = 0;\n var rlen = 0;\n var dataSchema = datamap.getSchema();\n\n for (r = 0, rlen = priv.settings.startRows; r < rlen; r++) {\n if ((instance.dataType === 'object' || instance.dataType === 'function') && priv.settings.dataSchema) {\n row = deepClone(dataSchema);\n data.push(row);\n\n } else if (instance.dataType === 'array') {\n row = deepClone(dataSchema[0]);\n data.push(row);\n\n } else {\n row = [];\n\n for (var c = 0, clen = priv.settings.startCols; c < clen; c++) {\n row.push(null);\n }\n\n data.push(row);\n }\n }\n\n } else {\n throw new Error(`loadData only accepts array of objects or array of arrays (${typeof data} given)`);\n }\n\n priv.isPopulated = false;\n GridSettings.prototype.data = data;\n\n if (Array.isArray(data[0])) {\n instance.dataType = 'array';\n }\n\n datamap.dataSource = data;\n dataSource.data = data;\n dataSource.dataType = instance.dataType;\n dataSource.colToProp = datamap.colToProp.bind(datamap);\n dataSource.propToCol = datamap.propToCol.bind(datamap);\n\n clearCellSettingCache();\n\n grid.adjustRowsAndCols();\n instance.runHooks('afterLoadData', priv.firstRun);\n\n if (priv.firstRun) {\n priv.firstRun = [null, 'loadData'];\n } else {\n instance.runHooks('afterChange', null, 'loadData');\n instance.render();\n }\n priv.isPopulated = true;\n\n function clearCellSettingCache() {\n priv.cellSettings.length = 0;\n }\n };\n\n /**\n * Returns the current data object (the same one that was passed by `data` configuration option or `loadData` method,\n * unless the `modifyRow` hook was used to trim some of the rows. If that's the case - use the {@link Core#getSourceData} method.).\n * Optionally you can provide cell range by defining `row`, `col`, `row2`, `col2` to get only a fragment of grid data.\n *\n * Note: getData functionality changed with the release of version 0.20. If you're looking for the previous functionality,\n * you should use the {@link Core#getSourceData} method.\n *\n * @memberof Core#\n * @function getData\n * @param {Number} [r] From visual row index.\n * @param {Number} [c] From visual column index.\n * @param {Number} [r2] To visual row index.\n * @param {Number} [c2] To visual column index.\n * @returns {Array} Array with the data.\n */\n this.getData = function(r, c, r2, c2) {\n if (isUndefined(r)) {\n return datamap.getAll();\n }\n return datamap.getRange(new CellCoords(r, c), new CellCoords(r2, c2), datamap.DESTINATION_RENDERER);\n\n };\n\n /**\n * Returns a string value of the selected range. Each column is separated by tab, each row is separated by a new line character.\n * {@link DataMap#getCopyableText}\n *\n * @memberof Core#\n * @function getCopyableText\n * @since 0.11\n * @param {Number} startRow From visual row index.\n * @param {Number} startCol From visual column index.\n * @param {Number} endRow To visual row index.\n * @param {Number} endCol To visual column index.\n * @returns {String}\n */\n this.getCopyableText = function(startRow, startCol, endRow, endCol) {\n return datamap.getCopyableText(new CellCoords(startRow, startCol), new CellCoords(endRow, endCol));\n };\n\n /**\n * Returns the data's copyable value at specified row and column index ({@link DataMap#getCopyable}).\n *\n * @memberof Core#\n * @function getCopyableData\n * @since 0.19.0\n * @param {Number} row Visual row index.\n * @param {Number} column Visual column index.\n * @returns {String}\n */\n this.getCopyableData = function(row, column) {\n return datamap.getCopyable(row, datamap.colToProp(column));\n };\n\n /**\n * Returns schema provided by constructor settings. If it doesn't exist then it returns the schema based on the data\n * structure in the first row.\n *\n * @memberof Core#\n * @function getSchema\n * @since 0.13.2\n * @returns {Object} Schema object.\n */\n this.getSchema = function() {\n return datamap.getSchema();\n };\n\n /**\n * Use it if you need to change configuration after initialization. The `settings` parameter is an object containing the new\n * settings, declared the same way as in the initial settings object.\n * Note, that although the `updateSettings` method doesn't overwrite the previously declared settings, it might reset\n * the settings made post-initialization. (for example - ignore changes made using the columnResize feature).\n *\n * @memberof Core#\n * @function updateSettings\n * @param {Object} settings New settings object.\n * @param {Boolean} init Calls this method in the initialization mode. Internal use only.\n * Used by API could be cause of the unexpected behaviour of the Handsontable.\n * @example\n * ```js\n * hot.updateSettings({\n * contextMenu: true,\n * colHeaders: true,\n * fixedRowsTop: 2\n * });\n * ```\n * @fires Hooks#afterCellMetaReset\n * @fires Hooks#afterUpdateSettings\n */\n this.updateSettings = function(settings, init) {\n let columnsAsFunc = false;\n let i;\n let j;\n let clen;\n\n if (isDefined(settings.rows)) {\n throw new Error('\"rows\" setting is no longer supported. do you mean startRows, minRows or maxRows?');\n }\n if (isDefined(settings.cols)) {\n throw new Error('\"cols\" setting is no longer supported. do you mean startCols, minCols or maxCols?');\n }\n\n for (i in settings) {\n if (i === 'data') {\n /* eslint-disable-next-line no-continue */\n continue; // loadData will be triggered later\n\n } else if (i === 'language') {\n setLanguage(settings.language);\n\n /* eslint-disable-next-line no-continue */\n continue;\n\n } else if (Hooks.getSingleton().getRegistered().indexOf(i) > -1) {\n if (isFunction(settings[i]) || Array.isArray(settings[i])) {\n settings[i].initialHook = true;\n instance.addHook(i, settings[i]);\n }\n\n } else if (!init && hasOwnProperty(settings, i)) { // Update settings\n GridSettings.prototype[i] = settings[i];\n }\n }\n\n // Load data or create data map\n if (settings.data === void 0 && priv.settings.data === void 0) {\n instance.loadData(null); // data source created just now\n\n } else if (settings.data !== void 0) {\n instance.loadData(settings.data); // data source given as option\n\n } else if (settings.columns !== void 0) {\n datamap.createMap();\n }\n\n clen = instance.countCols();\n\n const columnSetting = settings.columns || GridSettings.prototype.columns;\n\n // Init columns constructors configuration\n if (columnSetting && isFunction(columnSetting)) {\n clen = instance.countSourceCols();\n columnsAsFunc = true;\n }\n\n // Clear cellSettings cache\n if (settings.cell !== void 0 || settings.cells !== void 0 || settings.columns !== void 0) {\n priv.cellSettings.length = 0;\n }\n\n if (clen > 0) {\n let proto;\n let column;\n\n for (i = 0, j = 0; i < clen; i++) {\n if (columnsAsFunc && !columnSetting(i)) {\n /* eslint-disable no-continue */\n continue;\n }\n priv.columnSettings[j] = columnFactory(GridSettings, priv.columnsSettingConflicts);\n\n // shortcut for prototype\n proto = priv.columnSettings[j].prototype;\n\n // Use settings provided by user\n if (columnSetting) {\n if (columnsAsFunc) {\n column = columnSetting(i);\n\n } else {\n column = columnSetting[j];\n }\n\n if (column) {\n extend(proto, column);\n extend(proto, expandType(column));\n }\n }\n\n j++;\n }\n }\n\n if (isDefined(settings.cell)) {\n for (let key in settings.cell) {\n if (hasOwnProperty(settings.cell, key)) {\n let cell = settings.cell[key];\n\n instance.setCellMetaObject(cell.row, cell.col, cell);\n }\n }\n }\n\n instance.runHooks('afterCellMetaReset');\n\n if (isDefined(settings.className)) {\n if (GridSettings.prototype.className) {\n removeClass(instance.rootElement, GridSettings.prototype.className);\n }\n if (settings.className) {\n addClass(instance.rootElement, settings.className);\n }\n }\n\n let currentHeight = instance.rootElement.style.height;\n if (currentHeight !== '') {\n currentHeight = parseInt(instance.rootElement.style.height, 10);\n }\n\n let height = settings.height;\n if (isFunction(height)) {\n height = height();\n }\n\n if (init) {\n let initialStyle = instance.rootElement.getAttribute('style');\n\n if (initialStyle) {\n instance.rootElement.setAttribute('data-initialstyle', instance.rootElement.getAttribute('style'));\n }\n }\n\n if (height === null) {\n let initialStyle = instance.rootElement.getAttribute('data-initialstyle');\n\n if (initialStyle && (initialStyle.indexOf('height') > -1 || initialStyle.indexOf('overflow') > -1)) {\n instance.rootElement.setAttribute('style', initialStyle);\n\n } else {\n instance.rootElement.style.height = '';\n instance.rootElement.style.overflow = '';\n }\n\n } else if (height !== void 0) {\n instance.rootElement.style.height = `${height}px`;\n instance.rootElement.style.overflow = 'hidden';\n }\n\n if (typeof settings.width !== 'undefined') {\n var width = settings.width;\n\n if (isFunction(width)) {\n width = width();\n }\n\n instance.rootElement.style.width = `${width}px`;\n }\n\n if (!init) {\n datamap.clearLengthCache(); // force clear cache length on updateSettings() #3416\n\n if (instance.view) {\n instance.view.wt.wtViewport.resetHasOversizedColumnHeadersMarked();\n }\n\n instance.runHooks('afterUpdateSettings', settings);\n }\n\n grid.adjustRowsAndCols();\n if (instance.view && !priv.firstRun) {\n instance.forceFullRender = true; // used when data was changed\n editorManager.lockEditor();\n instance._refreshBorders(null);\n editorManager.unlockEditor();\n }\n\n if (!init && instance.view && (currentHeight === '' || height === '' || height === void 0) && currentHeight !== height) {\n instance.view.wt.wtOverlays.updateMainScrollableElements();\n }\n };\n\n /**\n * Get value from the selected cell.\n *\n * @memberof Core#\n * @function getValue\n * @since 0.11\n * @returns {*} Value of selected cell.\n */\n this.getValue = function() {\n var sel = instance.getSelectedLast();\n\n if (GridSettings.prototype.getValue) {\n if (isFunction(GridSettings.prototype.getValue)) {\n return GridSettings.prototype.getValue.call(instance);\n } else if (sel) {\n return instance.getData()[sel[0][0]][GridSettings.prototype.getValue];\n }\n } else if (sel) {\n return instance.getDataAtCell(sel[0], sel[1]);\n }\n };\n\n function expandType(obj) {\n if (!hasOwnProperty(obj, 'type')) {\n // ignore obj.prototype.type\n return;\n }\n\n var type,\n expandedType = {};\n\n if (typeof obj.type === 'object') {\n type = obj.type;\n } else if (typeof obj.type === 'string') {\n type = getCellType(obj.type);\n }\n\n for (var i in type) {\n if (hasOwnProperty(type, i) && !hasOwnProperty(obj, i)) {\n expandedType[i] = type[i];\n }\n }\n\n return expandedType;\n\n }\n\n /**\n * Returns the object settings.\n *\n * @memberof Core#\n * @function getSettings\n * @returns {Object} Object containing the current grid settings.\n */\n this.getSettings = function() {\n return priv.settings;\n };\n\n /**\n * Clears the data from the grid (the table settings remain intact).\n *\n * @memberof Core#\n * @function clear\n * @since 0.11.0\n */\n this.clear = function() {\n this.selectAll();\n this.emptySelectedCells();\n };\n\n /**\n * @memberof Core#\n * @function alter\n * @param {String} action See grid.alter for possible values: `\"insert_row\"`, `\"insert_col\"`, `\"remove_row\"`, `\"remove_col\"`\n * @param {Number} index Visual index of the row/column before which the new row/column will be inserted/removed.\n * @param {Number} [amount = 1] Amound of rows/columns to be inserted/removed.\n * @param {String} [source] Source indicator.\n * @param {Boolean} [keepEmptyRows] Flag for preventing deletion of empty rows.\n * @description\n *\n * Allows altering the table structure by either inserting/removing rows or inserting/removing columns:\n *\n * Insert new row(s) above the row with a given `index`. If index is `null` or `undefined`, the new row will be\n * added after the last row.\n * ```js\n * var hot = new Handsontable(document.getElementById('example'));\n * hot.alter('insert_row', 10);\n * ```\n *\n * Insert new column(s) before the column with a given `index`. If index is `null` or `undefined`, the new column\n * will be added after the last column.\n * ```js\n * var hot = new Handsontable(document.getElementById('example'));\n * hot.alter('insert_col', 10);\n * ```\n *\n * Remove the row(s) at the given `index`.\n * ```js\n * var hot = new Handsontable(document.getElementById('example'));\n * hot.alter('remove_row', 10);\n * ```\n *\n * Remove the column(s) at the given `index`.\n * ```js\n * var hot = new Handsontable(document.getElementById('example'));\n * hot.alter('remove_col', 10);\n * ```\n */\n this.alter = function(action, index, amount, source, keepEmptyRows) {\n grid.alter(action, index, amount, source, keepEmptyRows);\n };\n\n /**\n * Returns a TD element for the given `row` and `col` arguments, if it is rendered on screen.\n * Returns `null` if the TD is not rendered on screen (probably because that part of the table is not visible).\n *\n * @memberof Core#\n * @function getCell\n * @param {Number} row Visual row index.\n * @param {Number} col Visual column index.\n * @param {Boolean} topmost If set to true, it returns the TD element from the topmost overlay. For example,\n * if the wanted cell is in the range of fixed rows, it will return a TD element from the `top` overlay.\n * @returns {Element} The cell's TD element.\n */\n this.getCell = function(row, col, topmost) {\n return instance.view.getCellAtCoords(new CellCoords(row, col), topmost);\n };\n\n /**\n * Returns the coordinates of the cell, provided as a HTML Element.\n *\n * @memberof Core#\n * @function getCoords\n * @param {Element} elem The HTML Element representing the cell.\n * @returns {CellCoords} Visual coordinates object.\n */\n this.getCoords = function(elem) {\n return this.view.wt.wtTable.getCoords.call(this.view.wt.wtTable, elem);\n };\n\n /**\n * Returns the property name that corresponds with the given column index. {@link DataMap#colToProp}\n * If the data source is an array of arrays, it returns the columns index.\n *\n * @memberof Core#\n * @function colToProp\n * @param {Number} col Visual column index.\n * @returns {String|Number} Column property or physical column index.\n */\n this.colToProp = function(col) {\n return datamap.colToProp(col);\n };\n\n /**\n * Returns column index that corresponds with the given property. {@link DataMap#propToCol}\n *\n * @memberof Core#\n * @function propToCol\n * @param {String|Number} prop Property name or physical column index.\n * @returns {Number} Visual column index.\n */\n this.propToCol = function(prop) {\n return datamap.propToCol(prop);\n };\n\n /**\n * Translate physical row index into visual.\n *\n * @since 0.29.0\n * @memberof Core#\n * @function toVisualRow\n * @param {Number} row Physical row index.\n * @returns {Number} Returns visual row index.\n */\n this.toVisualRow = (row) => recordTranslator.toVisualRow(row);\n\n /**\n * Translate physical column index into visual.\n *\n * @since 0.29.0\n * @memberof Core#\n * @function toVisualColumn\n * @param {Number} column Physical column index.\n * @returns {Number} Returns visual column index.\n */\n this.toVisualColumn = (column) => recordTranslator.toVisualColumn(column);\n\n /**\n * Translate visual row index into physical.\n * If displayed rows order is different than the order of rows stored in memory (i.e. sorting is applied)\n * to retrieve valid physical row index you can use this method.\n *\n * @since 0.29.0\n * @memberof Core#\n * @function toPhysicalRow\n * @param {Number} row Visual row index.\n * @returns {Number} Returns physical row index.\n */\n this.toPhysicalRow = (row) => recordTranslator.toPhysicalRow(row);\n\n /**\n * Translate visual column index into physical.\n * If displayed columns order is different than the order of columns stored in memory (i.e. manual column move is applied)\n * to retrieve valid physical column index you can use this method.\n *\n * @since 0.29.0\n * @memberof Core#\n * @function toPhysicalColumn\n * @param {Number} column Visual column index.\n * @returns {Number} Returns physical column index.\n */\n this.toPhysicalColumn = (column) => recordTranslator.toPhysicalColumn(column);\n\n /**\n * @description\n * Returns the cell value at `row`, `col`. `row` and `col` are the __visible__ indexes (note, that if columns were reordered or sorted,\n * the currently visible order will be used).\n *\n * @memberof Core#\n * @function getDataAtCell\n * @param {Number} row Visual row index.\n * @param {Number} col Visual column index.\n * @returns {String|Boolean|null} Data at cell.\n */\n this.getDataAtCell = function(row, col) {\n return datamap.get(row, datamap.colToProp(col));\n };\n\n /**\n * Return value at `row`, `prop`. (Uses {@link DataMap#get})\n *\n * @memberof Core#\n * @function getDataAtRowProp\n * @param {Number} row Visual row index.\n * @param {String} prop Property name.\n * @returns {*} Cell value.\n */\n this.getDataAtRowProp = function(row, prop) {\n return datamap.get(row, prop);\n };\n\n /**\n * @description\n * Returns array of column values from the data source. `col` is the __visible__ index of the column.\n * Note, that if columns were reordered or sorted, the currently visible order will be used.\n *\n * @memberof Core#\n * @function getDataAtCol\n * @since 0.9-beta2\n * @param {Number} col Visual column index.\n * @returns {Array} Array of cell values.\n */\n this.getDataAtCol = function(col) {\n var out = [];\n return out.concat(...datamap.getRange(\n new CellCoords(0, col), new CellCoords(priv.settings.data.length - 1, col), datamap.DESTINATION_RENDERER));\n };\n\n /**\n * Given the object property name (e.g. `'first.name'`), returns an array of column's values from the data source.\n * You can also provide a column index as the first argument.\n *\n * @memberof Core#\n * @function getDataAtProp\n * @since 0.9-beta2\n * @param {String|Number} prop Property name / physical column index.\n * @returns {Array} Array of cell values.\n */\n // TODO: Getting data from `datamap` should work on visual indexes.\n this.getDataAtProp = function(prop) {\n var out = [],\n range;\n\n range = datamap.getRange(\n new CellCoords(0, datamap.propToCol(prop)),\n new CellCoords(priv.settings.data.length - 1, datamap.propToCol(prop)),\n datamap.DESTINATION_RENDERER);\n\n return out.concat(...range);\n };\n\n /**\n * Returns the source data object (the same that was passed by `data` configuration option or `loadData` method).\n * Optionally you can provide a cell range by using the `row`, `col`, `row2`, `col2` arguments, to get only a fragment of grid data.\n *\n * @memberof Core#\n * @function getSourceData\n * @since 0.20.0\n * @param {Number} [r] From physical row index.\n * @param {Number} [c] From physical column index (or visual index, if data type is an array of objects).\n * @param {Number} [r2] To physical row index.\n * @param {Number} [c2] To physical column index (or visual index, if data type is an array of objects).\n * @returns {Array} Array of grid data.\n */\n this.getSourceData = function(r, c, r2, c2) {\n let data;\n\n if (r === void 0) {\n data = dataSource.getData();\n } else {\n data = dataSource.getByRange(new CellCoords(r, c), new CellCoords(r2, c2));\n }\n\n return data;\n };\n\n /**\n * Returns the source data object as an arrays of arrays format even when source data was provided in another format.\n * Optionally you can provide a cell range by using the `row`, `col`, `row2`, `col2` arguments, to get only a fragment of grid data.\n *\n * @memberof Core#\n * @function getSourceDataArray\n * @since 0.28.0\n * @param {Number} [r] From physical row index.\n * @param {Number} [c] From physical column index (or visual index, if data type is an array of objects).\n * @param {Number} [r2] To physical row index.\n * @param {Number} [c2] To physical column index (or visual index, if data type is an array of objects).\n * @returns {Array} An array of arrays.\n */\n this.getSourceDataArray = function(r, c, r2, c2) {\n let data;\n\n if (r === void 0) {\n data = dataSource.getData(true);\n } else {\n data = dataSource.getByRange(new CellCoords(r, c), new CellCoords(r2, c2), true);\n }\n\n return data;\n };\n\n /**\n * Returns an array of column values from the data source. `col` is the index of the row in the data source.\n *\n * @memberof Core#\n * @function getSourceDataAtCol\n * @since 0.11.0-beta3\n * @param {Number} column Visual column index.\n * @returns {Array} Array of the column's cell values.\n */\n // TODO: Getting data from `sourceData` should work always on physical indexes.\n this.getSourceDataAtCol = function(column) {\n return dataSource.getAtColumn(column);\n };\n\n /**\n * Returns a single row of the data (array or object, depending on what you have). `row` is the index of the row in the data source.\n *\n * @memberof Core#\n * @function getSourceDataAtRow\n * @since 0.11.0-beta3\n * @param {Number} row Physical row index.\n * @returns {Array|Object} Single row of data.\n */\n this.getSourceDataAtRow = function(row) {\n return dataSource.getAtRow(row);\n };\n\n /**\n * Returns a single value from the data source.\n *\n * @memberof Core#\n * @function getSourceDataAtCell\n * @param {Number} row Physical row index.\n * @param {Number} column Visual column index.\n * @returns {*} Cell data.\n * @since 0.20.0\n */\n // TODO: Getting data from `sourceData` should work always on physical indexes.\n this.getSourceDataAtCell = function(row, column) {\n return dataSource.getAtCell(row, column);\n };\n\n /**\n * @description\n * Returns a single row of the data. The `row` argument is the __visible__ index of the row.\n *\n * @memberof Core#\n * @function getDataAtRow\n * @param {Number} row Visual row index.\n * @returns {Array} Array of row's cell data.\n * @since 0.9-beta2\n */\n this.getDataAtRow = function(row) {\n var data = datamap.getRange(new CellCoords(row, 0), new CellCoords(row, this.countCols() - 1), datamap.DESTINATION_RENDERER);\n\n return data[0] || [];\n };\n\n /**\n * @description\n * Returns a data type defined in the Handsontable settings under the `type` key ([Options#type](http://docs.handsontable.com/Options.html#type)).\n * If there are cells with different types in the selected range, it returns `'mixed'`.\n *\n * @since 0.18.1\n * @memberof Core#\n * @function getDataType\n * @param {Number} rowFrom From visual row index.\n * @param {Number} columnFrom From visual column index.\n * @param {Number} rowTo To visual row index.\n * @param {Number} columnTo To visual column index.\n * @returns {String} Cell type (e.q: `'mixed'`, `'text'`, `'numeric'`, `'autocomplete'`).\n */\n this.getDataType = function(rowFrom, columnFrom, rowTo, columnTo) {\n let previousType = null;\n let currentType = null;\n\n if (rowFrom === void 0) {\n rowFrom = 0;\n rowTo = this.countRows();\n columnFrom = 0;\n columnTo = this.countCols();\n }\n if (rowTo === void 0) {\n rowTo = rowFrom;\n }\n if (columnTo === void 0) {\n columnTo = columnFrom;\n }\n let type = 'mixed';\n\n rangeEach(Math.min(rowFrom, rowTo), Math.max(rowFrom, rowTo), (row) => {\n let isTypeEqual = true;\n\n rangeEach(Math.min(columnFrom, columnTo), Math.max(columnFrom, columnTo), (column) => {\n let cellType = this.getCellMeta(row, column);\n\n currentType = cellType.type;\n\n if (previousType) {\n isTypeEqual = previousType === currentType;\n } else {\n previousType = currentType;\n }\n\n return isTypeEqual;\n });\n type = isTypeEqual ? currentType : 'mixed';\n\n return isTypeEqual;\n });\n\n return type;\n };\n\n /**\n * Remove a property defined by the `key` argument from the cell meta object for the provided `row` and `col` coordinates.\n *\n * @memberof Core#\n * @function removeCellMeta\n * @param {Number} row Visual row index.\n * @param {Number} col Visual column index.\n * @param {String} key Property name.\n * @fires Hooks#beforeRemoveCellMeta\n * @fires Hooks#afterRemoveCellMeta\n */\n this.removeCellMeta = function(row, col, key) {\n const [physicalRow, physicalColumn] = recordTranslator.toPhysical(row, col);\n let cachedValue = priv.cellSettings[physicalRow][physicalColumn][key];\n\n const hookResult = instance.runHooks('beforeRemoveCellMeta', row, col, key, cachedValue);\n\n if (hookResult !== false) {\n delete priv.cellSettings[physicalRow][physicalColumn][key];\n\n instance.runHooks('afterRemoveCellMeta', row, col, key, cachedValue);\n }\n\n cachedValue = null;\n };\n\n /**\n * Remove one or more rows from the cell meta object.\n *\n * @since 0.30.0\n * @param {Number} index An integer that specifies at what position to add/remove items, Use negative values to specify the position from the end of the array.\n * @param {Number} deleteAmount The number of items to be removed. If set to 0, no items will be removed.\n * @param {Array} items The new items to be added to the array.\n */\n this.spliceCellsMeta = function(index, deleteAmount, ...items) {\n priv.cellSettings.splice(index, deleteAmount, ...items);\n };\n\n /**\n * Set cell meta data object defined by `prop` to the corresponding params `row` and `col`.\n *\n * @memberof Core#\n * @function setCellMetaObject\n * @since 0.11\n * @param {Number} row Visual row index.\n * @param {Number} col Visual column index.\n * @param {Object} prop Meta object.\n */\n this.setCellMetaObject = function(row, col, prop) {\n if (typeof prop === 'object') {\n for (var key in prop) {\n if (hasOwnProperty(prop, key)) {\n var value = prop[key];\n this.setCellMeta(row, col, key, value);\n }\n }\n }\n };\n\n /**\n * Sets a property defined by the `key` object to the meta object of a cell corresponding to params `row` and `col`.\n *\n * @memberof Core#\n * @function setCellMeta\n * @since 0.11\n * @param {Number} row Visual row index.\n * @param {Number} col Visual column index.\n * @param {String} key Property name.\n * @param {String} val Property value.\n * @fires Hooks#afterSetCellMeta\n */\n this.setCellMeta = function(row, col, key, val) {\n const [physicalRow, physicalColumn] = recordTranslator.toPhysical(row, col);\n\n if (!priv.columnSettings[physicalColumn]) {\n priv.columnSettings[physicalColumn] = columnFactory(GridSettings, priv.columnsSettingConflicts);\n }\n\n if (!priv.cellSettings[physicalRow]) {\n priv.cellSettings[physicalRow] = [];\n }\n if (!priv.cellSettings[physicalRow][physicalColumn]) {\n priv.cellSettings[physicalRow][physicalColumn] = new priv.columnSettings[physicalColumn]();\n }\n priv.cellSettings[physicalRow][physicalColumn][key] = val;\n instance.runHooks('afterSetCellMeta', row, col, key, val);\n };\n\n /**\n * Get all the cells meta settings at least once generated in the table (in order of cell initialization).\n *\n * @since 0.19.0\n * @returns {Array} Returns Array of ColumnSettings object.\n */\n this.getCellsMeta = function() {\n return arrayFlatten(priv.cellSettings);\n };\n\n /**\n * Returns the cell properties object for the given `row` and `col` coordinates.\n *\n * @memberof Core#\n * @function getCellMeta\n * @param {Number} row Visual row index.\n * @param {Number} col Visual column index.\n * @returns {Object} The cell properties object.\n * @fires Hooks#beforeGetCellMeta\n * @fires Hooks#afterGetCellMeta\n */\n this.getCellMeta = function(row, col) {\n const prop = datamap.colToProp(col);\n let cellProperties;\n\n let [physicalRow, physicalColumn] = recordTranslator.toPhysical(row, col);\n\n // Workaround for #11. Connected also with #3849. It should be fixed within #4497.\n if (physicalRow === null) {\n physicalRow = row;\n }\n\n if (!priv.columnSettings[physicalColumn]) {\n priv.columnSettings[physicalColumn] = columnFactory(GridSettings, priv.columnsSettingConflicts);\n }\n\n if (!priv.cellSettings[physicalRow]) {\n priv.cellSettings[physicalRow] = [];\n }\n if (!priv.cellSettings[physicalRow][physicalColumn]) {\n priv.cellSettings[physicalRow][physicalColumn] = new priv.columnSettings[physicalColumn]();\n }\n\n cellProperties = priv.cellSettings[physicalRow][physicalColumn]; // retrieve cellProperties from cache\n\n cellProperties.row = physicalRow;\n cellProperties.col = physicalColumn;\n cellProperties.visualRow = row;\n cellProperties.visualCol = col;\n cellProperties.prop = prop;\n cellProperties.instance = instance;\n\n instance.runHooks('beforeGetCellMeta', row, col, cellProperties);\n extend(cellProperties, expandType(cellProperties)); // for `type` added in beforeGetCellMeta\n\n if (cellProperties.cells) {\n const settings = cellProperties.cells.call(cellProperties, physicalRow, physicalColumn, prop);\n\n if (settings) {\n extend(cellProperties, settings);\n extend(cellProperties, expandType(settings)); // for `type` added in cells\n }\n }\n\n instance.runHooks('afterGetCellMeta', row, col, cellProperties);\n\n return cellProperties;\n };\n\n /**\n * Returns a row off the cell meta array.\n *\n * @memberof Core#\n * @function getCellMetaAtRow\n * @since 0.30.0\n * @param {Number} row Physical index of the row to return cell meta for.\n * @returns {Array}\n */\n this.getCellMetaAtRow = function(row) {\n return priv.cellSettings[row];\n };\n\n /**\n * Checks if the data format and config allows user to modify the column structure.\n * @returns {boolean}\n */\n this.isColumnModificationAllowed = function() {\n return !(instance.dataType === 'object' || instance.getSettings().columns);\n };\n\n const rendererLookup = cellMethodLookupFactory('renderer');\n\n /**\n * Returns the cell renderer function by given `row` and `col` arguments.\n *\n * @memberof Core#\n * @function getCellRenderer\n * @since 0.11\n * @param {Number|Object} row Visual row index or cell meta object.\n * @param {Number} [col] Visual column index.\n * @returns {Function} The renderer function.\n */\n this.getCellRenderer = function(row, col) {\n return getRenderer(rendererLookup.call(this, row, col));\n };\n\n /**\n * Returns the cell editor by the provided `row` and `col` arguments.\n *\n * @memberof Core#\n * @function getCellEditor\n * @param {Number} row Visual row index.\n * @param {Number} col Visual column index.\n * @returns {Object} The Editor object.\n */\n this.getCellEditor = cellMethodLookupFactory('editor');\n\n const validatorLookup = cellMethodLookupFactory('validator');\n\n /**\n * Returns the cell validator by `row` and `col`, provided a validator is defined. If not - it doesn't return anything.\n *\n * @memberof Core#\n * @function getCellValidator\n * @param {Number} row Visual row index.\n * @param {Number} col Visual column index.\n * @returns {Function|RegExp|undefined} The validator function.\n */\n this.getCellValidator = function(row, col) {\n let validator = validatorLookup.call(this, row, col);\n\n if (typeof validator === 'string') {\n validator = getValidator(validator);\n }\n\n return validator;\n };\n\n /**\n * Validates all cells using their validator functions and calls callback when finished.\n *\n * If one of the cells is invalid, the callback will be fired with `'valid'` arguments as `false` - otherwise it would equal `true`.\n *\n * @memberof Core#\n * @function validateCells\n * @param {Function} [callback] The callback function.\n */\n this.validateCells = function(callback) {\n this._validateCells(callback);\n };\n\n /**\n * Validates rows using their validator functions and calls callback when finished.\n *\n * If one of the cells is invalid, the callback will be fired with `'valid'` arguments as `false` - otherwise it would equal `true`.\n *\n * @memberof Core#\n * @function validateRows\n * @param {Array} [rows] Array of validation target visual row indexes.\n * @param {Function} [callback] The callback function.\n */\n this.validateRows = function(rows, callback) {\n if (!Array.isArray(rows)) {\n throw new Error('validateRows parameter `rows` must be an array');\n }\n this._validateCells(callback, rows);\n };\n\n /**\n * Validates columns using their validator functions and calls callback when finished.\n *\n * If one of the cells is invalid, the callback will be fired with `'valid'` arguments as `false` - otherwise it would equal `true`.\n *\n * @memberof Core#\n * @function validateColumns\n * @param {Array} [columns] Array of validation target visual columns indexes.\n * @param {Function} [callback] The callback function.\n */\n this.validateColumns = function(columns, callback) {\n if (!Array.isArray(columns)) {\n throw new Error('validateColumns parameter `columns` must be an array');\n }\n this._validateCells(callback, undefined, columns);\n };\n\n /**\n * Validates all cells using their validator functions and calls callback when finished.\n *\n * If one of the cells is invalid, the callback will be fired with `'valid'` arguments as `false` - otherwise it would equal `true`.\n *\n * Private use intended.\n *\n * @private\n * @memberof Core#\n * @function _validateCells\n * @param {Function} [callback] The callback function.\n * @param {Array} [rows] Optional. Array of validation target visual row indexes.\n * @param {Array} [columns] Optional. Array of validation target visual column indexes.\n */\n this._validateCells = function(callback, rows, columns) {\n var waitingForValidator = new ValidatorsQueue();\n\n if (callback) {\n waitingForValidator.onQueueEmpty = callback;\n }\n\n let i = instance.countRows() - 1;\n\n while (i >= 0) {\n if (rows !== undefined && rows.indexOf(i) === -1) {\n i--;\n continue;\n }\n let j = instance.countCols() - 1;\n\n while (j >= 0) {\n if (columns !== undefined && columns.indexOf(j) === -1) {\n j--;\n continue;\n }\n waitingForValidator.addValidatorToQueue();\n\n instance.validateCell(instance.getDataAtCell(i, j), instance.getCellMeta(i, j), (result) => {\n if (typeof result !== 'boolean') {\n throw new Error('Validation error: result is not boolean');\n }\n if (result === false) {\n waitingForValidator.valid = false;\n }\n waitingForValidator.removeValidatorFormQueue();\n }, 'validateCells');\n j--;\n }\n i--;\n }\n waitingForValidator.checkIfQueueIsEmpty();\n };\n\n /**\n * Returns an array of row headers' values (if they are enabled). If param `row` was given, it returns the header of the given row as a string.\n *\n * @memberof Core#\n * @function getRowHeader\n * @param {Number} [row] Visual row index.\n * @fires Hooks#modifyRowHeader\n * @returns {Array|String} Array of header values / single header value.\n */\n this.getRowHeader = function(row) {\n let rowHeader = priv.settings.rowHeaders;\n\n if (row !== void 0) {\n row = instance.runHooks('modifyRowHeader', row);\n }\n if (row === void 0) {\n rowHeader = [];\n rangeEach(instance.countRows() - 1, (i) => {\n rowHeader.push(instance.getRowHeader(i));\n });\n\n } else if (Array.isArray(rowHeader) && rowHeader[row] !== void 0) {\n rowHeader = rowHeader[row];\n\n } else if (isFunction(rowHeader)) {\n rowHeader = rowHeader(row);\n\n } else if (rowHeader && typeof rowHeader !== 'string' && typeof rowHeader !== 'number') {\n rowHeader = row + 1;\n }\n\n return rowHeader;\n };\n\n /**\n * Returns information about if this table is configured to display row headers.\n *\n * @memberof Core#\n * @function hasRowHeaders\n * @returns {Boolean} `true` if the instance has the row headers enabled, `false` otherwise.\n * @since 0.11\n */\n this.hasRowHeaders = function() {\n return !!priv.settings.rowHeaders;\n };\n\n /**\n * Returns information about if this table is configured to display column headers.\n *\n * @memberof Core#\n * @function hasColHeaders\n * @since 0.11\n * @returns {Boolean} `True` if the instance has the column headers enabled, `false` otherwise.\n */\n this.hasColHeaders = function() {\n if (priv.settings.colHeaders !== void 0 && priv.settings.colHeaders !== null) { // Polymer has empty value = null\n return !!priv.settings.colHeaders;\n }\n for (var i = 0, ilen = instance.countCols(); i < ilen; i++) {\n if (instance.getColHeader(i)) {\n return true;\n }\n }\n\n return false;\n };\n\n /**\n * Returns an array of column headers (in string format, if they are enabled). If param `col` is given, it returns the header at the given column as a string.\n *\n * @memberof Core#\n * @function getColHeader\n * @param {Number} [col] Visual column index.\n * @fires Hooks#modifyColHeader\n * @returns {Array|String} The column header(s).\n */\n this.getColHeader = function(col) {\n let columnsAsFunc = priv.settings.columns && isFunction(priv.settings.columns);\n let result = priv.settings.colHeaders;\n\n col = instance.runHooks('modifyColHeader', col);\n\n if (col === void 0) {\n let out = [];\n let ilen = columnsAsFunc ? instance.countSourceCols() : instance.countCols();\n\n for (let i = 0; i < ilen; i++) {\n out.push(instance.getColHeader(i));\n }\n\n result = out;\n\n } else {\n let translateVisualIndexToColumns = function(col) {\n let arr = [];\n let columnsLen = instance.countSourceCols();\n let index = 0;\n\n for (; index < columnsLen; index++) {\n if (isFunction(instance.getSettings().columns) && instance.getSettings().columns(index)) {\n arr.push(index);\n }\n }\n\n return arr[col];\n };\n let baseCol = col;\n col = instance.runHooks('modifyCol', col);\n\n let prop = translateVisualIndexToColumns(col);\n\n if (priv.settings.columns && isFunction(priv.settings.columns) && priv.settings.columns(prop) && priv.settings.columns(prop).title) {\n result = priv.settings.columns(prop).title;\n\n } else if (priv.settings.columns && priv.settings.columns[col] && priv.settings.columns[col].title) {\n result = priv.settings.columns[col].title;\n\n } else if (Array.isArray(priv.settings.colHeaders) && priv.settings.colHeaders[col] !== void 0) {\n result = priv.settings.colHeaders[col];\n\n } else if (isFunction(priv.settings.colHeaders)) {\n result = priv.settings.colHeaders(col);\n\n } else if (priv.settings.colHeaders && typeof priv.settings.colHeaders !== 'string' && typeof priv.settings.colHeaders !== 'number') {\n result = spreadsheetColumnLabel(baseCol); // see #1458\n\n }\n }\n\n return result;\n };\n\n /**\n * Return column width from settings (no guessing). Private use intended.\n *\n * @private\n * @memberof Core#\n * @function _getColWidthFromSettings\n * @param {Number} col Visual col index.\n * @returns {Number}\n */\n this._getColWidthFromSettings = function(col) {\n var cellProperties = instance.getCellMeta(0, col);\n var width = cellProperties.width;\n\n if (width === void 0 || width === priv.settings.width) {\n width = cellProperties.colWidths;\n }\n if (width !== void 0 && width !== null) {\n switch (typeof width) {\n case 'object': // array\n width = width[col];\n break;\n\n case 'function':\n width = width(col);\n break;\n default:\n break;\n }\n if (typeof width === 'string') {\n width = parseInt(width, 10);\n }\n }\n\n return width;\n };\n\n /**\n * Returns the width of the requested column.\n *\n * @memberof Core#\n * @function getColWidth\n * @since 0.11\n * @param {Number} col Visual column index.\n * @returns {Number} Column width.\n * @fires Hooks#modifyColWidth\n */\n this.getColWidth = function(col) {\n let width = instance._getColWidthFromSettings(col);\n\n width = instance.runHooks('modifyColWidth', width, col);\n\n if (width === void 0) {\n width = ViewportColumnsCalculator.DEFAULT_WIDTH;\n }\n\n return width;\n };\n\n /**\n * Return row height from settings (no guessing). Private use intended.\n *\n * @private\n * @memberof Core#\n * @function _getRowHeightFromSettings\n * @param {Number} row Visual row index.\n * @returns {Number}\n */\n this._getRowHeightFromSettings = function(row) {\n // let cellProperties = instance.getCellMeta(row, 0);\n // let height = cellProperties.height;\n //\n // if (height === void 0 || height === priv.settings.height) {\n // height = cellProperties.rowHeights;\n // }\n var height = priv.settings.rowHeights;\n\n if (height !== void 0 && height !== null) {\n switch (typeof height) {\n case 'object': // array\n height = height[row];\n break;\n\n case 'function':\n height = height(row);\n break;\n default:\n break;\n }\n if (typeof height === 'string') {\n height = parseInt(height, 10);\n }\n }\n\n return height;\n };\n\n /**\n * Returns the row height.\n *\n * @memberof Core#\n * @function getRowHeight\n * @since 0.11\n * @param {Number} row Visual row index.\n * @returns {Number} The given row's height.\n * @fires Hooks#modifyRowHeight\n */\n this.getRowHeight = function(row) {\n var height = instance._getRowHeightFromSettings(row);\n\n height = instance.runHooks('modifyRowHeight', height, row);\n\n return height;\n };\n\n /**\n * Returns the total number of rows in the data source.\n *\n * @memberof Core#\n * @function countSourceRows\n * @since 0.20.0\n * @returns {Number} Total number in rows in data source.\n */\n this.countSourceRows = function() {\n let sourceLength = instance.runHooks('modifySourceLength');\n return sourceLength || (instance.getSourceData() ? instance.getSourceData().length : 0);\n };\n\n /**\n * Returns the total number of columns in the data source.\n *\n * @memberof Core#\n * @function countSourceCols\n * @since 0.26.1\n * @returns {Number} Total number in columns in data source.\n */\n this.countSourceCols = function() {\n let len = 0;\n let obj = instance.getSourceData() && instance.getSourceData()[0] ? instance.getSourceData()[0] : [];\n\n if (isObject(obj)) {\n len = deepObjectSize(obj);\n\n } else {\n len = obj.length || 0;\n }\n\n return len;\n };\n\n /**\n * Returns the total number of rows in the grid.\n *\n * @memberof Core#\n * @function countRows\n * @returns {Number} Total number in rows the grid.\n */\n this.countRows = function() {\n return datamap.getLength();\n };\n\n /**\n * Returns the total number of columns in the grid.\n *\n * @memberof Core#\n * @function countCols\n * @returns {Number} Total number of columns.\n */\n this.countCols = function() {\n const maxCols = this.getSettings().maxCols;\n let dataHasLength = false;\n let dataLen = 0;\n\n if (instance.dataType === 'array') {\n dataHasLength = priv.settings.data && priv.settings.data[0] && priv.settings.data[0].length;\n }\n\n if (dataHasLength) {\n dataLen = priv.settings.data[0].length;\n }\n\n if (priv.settings.columns) {\n let columnsIsFunction = isFunction(priv.settings.columns);\n\n if (columnsIsFunction) {\n if (instance.dataType === 'array') {\n let columnLen = 0;\n\n for (let i = 0; i < dataLen; i++) {\n if (priv.settings.columns(i)) {\n columnLen++;\n }\n }\n\n dataLen = columnLen;\n } else if (instance.dataType === 'object' || instance.dataType === 'function') {\n dataLen = datamap.colToPropCache.length;\n }\n\n } else {\n dataLen = priv.settings.columns.length;\n }\n\n } else if (instance.dataType === 'object' || instance.dataType === 'function') {\n dataLen = datamap.colToPropCache.length;\n }\n\n return Math.min(maxCols, dataLen);\n };\n\n /**\n * Returns an visual index of the first rendered row.\n *\n * @memberof Core#\n * @function rowOffset\n * @returns {Number} Visual index of first rendered row.\n */\n this.rowOffset = function() {\n return instance.view.wt.wtTable.getFirstRenderedRow();\n };\n\n /**\n * Returns the visual index of the first rendered column.\n *\n * @memberof Core#\n * @function colOffset\n * @returns {Number} Visual index of the first visible column.\n */\n this.colOffset = function() {\n return instance.view.wt.wtTable.getFirstRenderedColumn();\n };\n\n /**\n * Returns the number of rendered rows (including rows partially or fully rendered outside viewport).\n *\n * @memberof Core#\n * @function countRenderedRows\n * @returns {Number} Returns -1 if table is not visible.\n */\n this.countRenderedRows = function() {\n return instance.view.wt.drawn ? instance.view.wt.wtTable.getRenderedRowsCount() : -1;\n };\n\n /**\n * Returns the number of visible rows (rendered rows that fully fit inside viewport).\n *\n * @memberof Core#\n * @function countVisibleRows\n * @returns {Number} Number of visible rows or -1.\n */\n this.countVisibleRows = function() {\n return instance.view.wt.drawn ? instance.view.wt.wtTable.getVisibleRowsCount() : -1;\n };\n\n /**\n * Returns the number of rendered columns (including columns partially or fully rendered outside viewport).\n *\n * @memberof Core#\n * @function countRenderedCols\n * @returns {Number} Returns -1 if table is not visible.\n */\n this.countRenderedCols = function() {\n return instance.view.wt.drawn ? instance.view.wt.wtTable.getRenderedColumnsCount() : -1;\n };\n\n /**\n * Returns the number of visible columns. Returns -1 if table is not visible\n *\n * @memberof Core#\n * @function countVisibleCols\n * @return {Number} Number of visible columns or -1.\n */\n this.countVisibleCols = function() {\n return instance.view.wt.drawn ? instance.view.wt.wtTable.getVisibleColumnsCount() : -1;\n };\n\n /**\n * Returns the number of empty rows. If the optional ending parameter is `true`, returns the\n * number of empty rows at the bottom of the table.\n *\n * @memberof Core#\n * @function countEmptyRows\n * @param {Boolean} [ending] If `true`, will only count empty rows at the end of the data source.\n * @returns {Number} Count empty rows.\n */\n this.countEmptyRows = function(ending) {\n let emptyRows = 0;\n\n rangeEachReverse(instance.countRows() - 1, (visualIndex) => {\n if (instance.isEmptyRow(visualIndex)) {\n emptyRows += 1;\n\n } else if (ending === true) {\n return false;\n }\n });\n\n return emptyRows;\n };\n\n /**\n * Returns the number of empty columns. If the optional ending parameter is `true`, returns the number of empty\n * columns at right hand edge of the table.\n *\n * @memberof Core#\n * @function countEmptyCols\n * @param {Boolean} [ending] If `true`, will only count empty columns at the end of the data source row.\n * @returns {Number} Count empty cols.\n */\n this.countEmptyCols = function(ending) {\n if (instance.countRows() < 1) {\n return 0;\n }\n\n let emptyColumns = 0;\n\n rangeEachReverse(instance.countCols() - 1, (visualIndex) => {\n if (instance.isEmptyCol(visualIndex)) {\n emptyColumns += 1;\n\n } else if (ending === true) {\n return false;\n }\n });\n\n return emptyColumns;\n };\n\n /**\n * Check if all cells in the row declared by the `row` argument are empty.\n *\n * @memberof Core#\n * @function isEmptyRow\n * @param {Number} row Visual row index.\n * @returns {Boolean} `true` if the row at the given `row` is empty, `false` otherwise.\n */\n this.isEmptyRow = function(row) {\n return priv.settings.isEmptyRow.call(instance, row);\n };\n\n /**\n * Check if all cells in the the column declared by the `col` argument are empty.\n *\n * @memberof Core#\n * @function isEmptyCol\n * @param {Number} col Column index.\n * @returns {Boolean} `true` if the column at the given `col` is empty, `false` otherwise.\n */\n this.isEmptyCol = function(col) {\n return priv.settings.isEmptyCol.call(instance, col);\n };\n\n /**\n * Select cell specified by `row` and `col` values or a range of cells finishing at `endRow`, `endCol`. If the table\n * was configured to support data column properties that properties can be used to making a selection.\n *\n * By default, viewport will be scrolled to the selection. After the `selectCell` method had finished, the instance\n * will be listening to keyboard input on the document.\n *\n * @example\n * ```js\n * // select a single cell\n * hot.selectCell(2, 4);\n * // select a single cell using column property\n * hot.selectCell(2, 'address');\n * // select a range of cells\n * hot.selectCell(2, 4, 3, 5);\n * // select a range of cells using column properties\n * hot.selectCell(2, 'address', 3, 'phone_number');\n * // select a range of cells without scrolling to them\n * hot.selectCell(2, 'address', 3, 'phone_number', false);\n * ```\n *\n * @memberof Core#\n * @function selectCell\n * @param {Number} row Visual row index.\n * @param {Number|String} column Visual column index or column property.\n * @param {Number} [endRow] Visual end row index (if selecting a range).\n * @param {Number|String} [endColumn] Visual end column index or column property (if selecting a range).\n * @param {Boolean} [scrollToCell=true] If `true`, the viewport will be scrolled to the selection.\n * @param {Boolean} [changeListener=true] If `false`, Handsontable will not change keyboard events listener to himself.\n * @returns {Boolean} `true` if selection was successful, `false` otherwise.\n */\n this.selectCell = function(row, column, endRow, endColumn, scrollToCell = true, changeListener = true) {\n if (isUndefined(row) || isUndefined(column)) {\n return false;\n }\n\n return this.selectCells([[row, column, endRow, endColumn]], scrollToCell, changeListener);\n };\n\n /**\n * Make multiple, non-contiguous selection specified by `row` and `column` values or a range of cells\n * finishing at `endRow`, `endColumn`. The method supports two input formats which are the same as that\n * produces by `getSelected` and `getSelectedRange` methods.\n *\n * By default, viewport will be scrolled to selection. After the `selectCells` method had finished, the instance\n * will be listening to keyboard input on the document.\n *\n * @example\n * ```js\n * // using an array of arrays\n * hot.selectCells([[1, 1, 2, 2], [3, 3], [6, 2, 0, 2]]);\n * // using an array of arrays with defined columns as props\n * hot.selectCells([[1, 'id', 2, 'first_name'], [3, 'full_name'], [6, 'last_name', 0, 'first_name']]);\n * // or using an array of CellRange objects (produced by `.getSelectedRange()` method)\n * const selected = hot.getSelectedRange();\n *\n * selected[0].from.row = 0;\n * selected[0].from.col = 0;\n *\n * hot.selectCells(selected);\n * ```\n *\n * @memberof Core#\n * @since 0.38.0\n * @function selectCells\n * @param {Array[]|CellRange[]} coords Visual coords passed as an array of array (`[[rowStart, columnStart, rowEnd, columnEnd], ...]`)\n * the same format as `getSelected` method returns or as an CellRange objects\n * which is the same format what `getSelectedRange` method returns.\n * @param {Boolean} [scrollToCell=true] If `true`, the viewport will be scrolled to the selection.\n * @param {Boolean} [changeListener=true] If `false`, Handsontable will not change keyboard events listener to himself.\n * @returns {Boolean} `true` if selection was successful, `false` otherwise.\n */\n this.selectCells = function(coords = [[]], scrollToCell = true, changeListener = true) {\n if (scrollToCell === false) {\n preventScrollingToCell = true;\n }\n\n const wasSelected = selection.selectCells(coords);\n\n if (wasSelected && changeListener) {\n instance.listen();\n }\n preventScrollingToCell = false;\n\n return wasSelected;\n };\n\n /**\n * Select the cell specified by the `row` and `prop` arguments, or a range finishing at `endRow`, `endProp`.\n * By default, viewport will be scrolled to selection.\n *\n * @deprecated\n * @memberof Core#\n * @function selectCellByProp\n * @param {Number} row Visual row index.\n * @param {String} prop Property name.\n * @param {Number} [endRow] visual end row index (if selecting a range).\n * @param {String} [endProp] End property name (if selecting a range).\n * @param {Boolean} [scrollToCell=true] If `true`, viewport will be scrolled to the selection.\n * @param {Boolean} [changeListener=true] If `false`, Handsontable will not change keyboard events listener to himself.\n * @returns {Boolean} `true` if selection was successful, `false` otherwise.\n */\n this.selectCellByProp = function(row, prop, endRow, endProp, scrollToCell = true, changeListener = true) {\n warn(toSingleLine`Deprecation warning: This method is going to be removed in the next release.\\x20\n If you want to select a cell using props, please use the \\`selectCell\\` method.`);\n\n return this.selectCells([[row, prop, endRow, endProp]], scrollToCell, changeListener);\n };\n\n /**\n * Select column specified by `startColumn` visual index, column property or a range of columns finishing at `endColumn`.\n *\n * @example\n * ```js\n * // select column using visual index\n * hot.selectColumns(1);\n * // select column using column property\n * hot.selectColumns('id');\n * // select range of columns using visual indexes\n * hot.selectColumns(1, 4);\n * // select range of columns using column properties\n * hot.selectColumns('id', 'last_name');\n * ```\n *\n * @memberof Core#\n * @since 0.38.0\n * @function selectColumns\n * @param {Number} startColumn The visual column index from which the selection starts.\n * @param {Number} [endColumn=startColumn] The visual column index to which the selection finishes. If `endColumn`\n * is not defined the column defined by `startColumn` will be selected.\n * @returns {Boolean} `true` if selection was successful, `false` otherwise.\n */\n this.selectColumns = function(startColumn, endColumn = startColumn) {\n return selection.selectColumns(startColumn, endColumn);\n };\n\n /**\n * Select row specified by `startRow` visual index or a range of rows finishing at `endRow`.\n *\n * @example\n * ```js\n * select row using visual index\n * hot.selectRows(1);\n * select range of rows using visual indexes\n * hot.selectRows(1, 4);\n * ```\n *\n * @memberof Core#\n * @since 0.38.0\n * @function selectRows\n * @param {Number} startRow The visual row index from which the selection starts.\n * @param {Number} [endRow=startRow] The visual row index to which the selection finishes. If `endRow`\n * is not defined the row defined by `startRow` will be selected.\n * @returns {Boolean} `true` if selection was successful, `false` otherwise.\n */\n this.selectRows = function(startRow, endRow = startRow) {\n return selection.selectRows(startRow, endRow);\n };\n\n /**\n * Deselects the current cell selection on grid.\n *\n * @memberof Core#\n * @function deselectCell\n */\n this.deselectCell = function() {\n selection.deselect();\n };\n\n /**\n * Select the whole table. The previous selection will be overwritten.\n *\n * @since 0.38.2\n * @memberof Core#\n * @function selectAll\n */\n this.selectAll = function() {\n preventScrollingToCell = true;\n selection.selectAll();\n preventScrollingToCell = false;\n };\n\n /**\n * Scroll viewport to coords specified by the `row` and `column` arguments.\n *\n * @since 0.24.3\n * @memberof Core#\n * @function scrollViewportTo\n * @param {Number} [row] Visual row index.\n * @param {Number} [column] Visual column index.\n * @param {Boolean} [snapToBottom = false] If `true`, viewport is scrolled to show the cell on the bottom of the table.\n * @param {Boolean} [snapToRight = false] If `true`, viewport is scrolled to show the cell on the right side of the table.\n * @returns {Boolean} `true` if scroll was successful, `false` otherwise.\n */\n this.scrollViewportTo = function(row, column, snapToBottom = false, snapToRight = false) {\n if (row !== void 0 && (row < 0 || row >= instance.countRows())) {\n return false;\n }\n if (column !== void 0 && (column < 0 || column >= instance.countCols())) {\n return false;\n }\n\n let result = false;\n\n if (row !== void 0 && column !== void 0) {\n instance.view.wt.wtOverlays.topOverlay.scrollTo(row, snapToBottom);\n instance.view.wt.wtOverlays.leftOverlay.scrollTo(column, snapToRight);\n\n result = true;\n }\n if (typeof row === 'number' && typeof column !== 'number') {\n instance.view.wt.wtOverlays.topOverlay.scrollTo(row, snapToBottom);\n\n result = true;\n }\n if (typeof column === 'number' && typeof row !== 'number') {\n instance.view.wt.wtOverlays.leftOverlay.scrollTo(column, snapToRight);\n\n result = true;\n }\n\n return result;\n };\n\n /**\n * Removes grid from the DOM.\n *\n * @memberof Core#\n * @function destroy\n * @fires Hooks#afterDestroy\n */\n this.destroy = function() {\n\n instance._clearTimeouts();\n if (instance.view) { // in case HT is destroyed before initialization has finished\n instance.view.destroy();\n }\n if (dataSource) {\n dataSource.destroy();\n }\n dataSource = null;\n\n keyStateStopObserving();\n\n if (process.env.HOT_PACKAGE_TYPE !== '\\x63\\x65' && isRootInstance(instance)) {\n const licenseInfo = document.querySelector('#hot-display-license-info');\n\n if (licenseInfo) {\n licenseInfo.parentNode.removeChild(licenseInfo);\n }\n }\n empty(instance.rootElement);\n eventManager.destroy();\n\n if (editorManager) {\n editorManager.destroy();\n }\n\n instance.runHooks('afterDestroy');\n Hooks.getSingleton().destroy(instance);\n\n for (var i in instance) {\n if (hasOwnProperty(instance, i)) {\n // replace instance methods with post mortem\n if (isFunction(instance[i])) {\n instance[i] = postMortem;\n\n } else if (i !== 'guid') {\n // replace instance properties with null (restores memory)\n // it should not be necessary but this prevents a memory leak side effects that show itself in Jasmine tests\n instance[i] = null;\n }\n }\n }\n\n // replace private properties with null (restores memory)\n // it should not be necessary but this prevents a memory leak side effects that show itself in Jasmine tests\n if (datamap) {\n datamap.destroy();\n }\n datamap = null;\n priv = null;\n grid = null;\n selection = null;\n editorManager = null;\n instance = null;\n GridSettings = null;\n };\n\n /**\n * Replacement for all methods after Handsotnable was destroyed.\n *\n * @private\n */\n function postMortem() {\n throw new Error('This method cannot be called because this Handsontable instance has been destroyed');\n }\n\n /**\n * Returns the active editor object.\n *\n * @memberof Core#\n * @function getActiveEditor\n * @returns {Object} The active editor object.\n */\n this.getActiveEditor = function() {\n return editorManager.getActiveEditor();\n };\n\n /**\n * Returns plugin instance using the plugin name provided.\n *\n * @memberof Core#\n * @function getPlugin\n * @param {String} pluginName The plugin name.\n * @returns {*} The plugin instance.\n * @since 0.15.0\n */\n this.getPlugin = function(pluginName) {\n return getPlugin(this, pluginName);\n };\n\n /**\n * Returns the Handsontable instance.\n *\n * @memberof Core#\n * @function getInstance\n * @returns {Handsontable} The Handsontable instance.\n */\n this.getInstance = function() {\n return instance;\n };\n\n /**\n * Adds listener to the specified hook name (only for this Handsontable instance).\n *\n * @memberof Core#\n * @function addHook\n * @see Hooks#add\n * @param {String} key Hook name.\n * @param {Function|Array} callback Function or array of Functions.\n *\n * @example\n * ```js\n * hot.addHook('beforeInit', myCallback);\n * ```\n */\n this.addHook = function(key, callback) {\n Hooks.getSingleton().add(key, callback, instance);\n };\n\n /**\n * Check if for a specified hook name there are added listeners (only for this Handsontable instance).\n *\n * @memberof Core#\n * @function hasHook\n * @see Hooks#has\n * @param {String} key Hook name\n * @return {Boolean}\n *\n * @example\n * ```js\n * var hasBeforeInitListeners = hot.hasHook('beforeInit');\n * ```\n */\n this.hasHook = function(key) {\n return Hooks.getSingleton().has(key, instance);\n };\n\n /**\n * Adds listener to specified hook name (only for this Handsontable instance).\n * After the listener is triggered, it will be automatically removed.\n *\n * @memberof Core#\n * @function addHookOnce\n * @see Hooks#once\n * @param {String} key Hook name.\n * @param {Function|Array} callback Function or array of Functions.\n *\n * @example\n * ```js\n * hot.addHookOnce('beforeInit', myCallback);\n * ```\n */\n this.addHookOnce = function(key, callback) {\n Hooks.getSingleton().once(key, callback, instance);\n };\n\n /**\n * Removes the hook listener previously registered with {@link Core#addHook}.\n *\n * @memberof Core#\n * @function removeHook\n * @see Hooks#remove\n * @param {String} key Hook name.\n * @param {Function} callback Function which have been registered via {@link Core#addHook}.\n *\n * @example\n * ```js\n * hot.removeHook('beforeInit', myCallback);\n * ```\n */\n this.removeHook = function(key, callback) {\n Hooks.getSingleton().remove(key, callback, instance);\n };\n\n /**\n * Run the callbacks for the hook provided in the `key` argument using the parameters given in the other arguments.\n *\n * @memberof Core#\n * @function runHooks\n * @see Hooks#run\n * @param {String} key Hook name.\n * @param {*} [p1] Argument passed to the callback.\n * @param {*} [p2] Argument passed to the callback.\n * @param {*} [p3] Argument passed to the callback.\n * @param {*} [p4] Argument passed to the callback.\n * @param {*} [p5] Argument passed to the callback.\n * @param {*} [p6] Argument passed to the callback.\n * @returns {*}\n *\n * @example\n * ```js\n * hot.runHooks('beforeInit');\n * ```\n */\n this.runHooks = function(key, p1, p2, p3, p4, p5, p6) {\n return Hooks.getSingleton().run(instance, key, p1, p2, p3, p4, p5, p6);\n };\n\n /**\n * Get phrase for specified dictionary key.\n *\n * @memberof Core#\n * @function getTranslatedPhrase\n * @since 0.35.0\n * @param {String} dictionaryKey Constant which is dictionary key.\n * @param {*} extraArguments Arguments which will be handled by formatters.\n *\n * @returns {String}\n */\n this.getTranslatedPhrase = function(dictionaryKey, extraArguments) {\n return getTranslatedPhrase(priv.settings.language, dictionaryKey, extraArguments);\n };\n\n this.timeouts = [];\n\n /**\n * Sets timeout. Purpose of this method is to clear all known timeouts when `destroy` method is called.\n *\n * @param {*} handle\n * @private\n */\n this._registerTimeout = function(handle) {\n this.timeouts.push(handle);\n };\n\n /**\n * Clears all known timeouts.\n *\n * @private\n */\n this._clearTimeouts = function() {\n for (var i = 0, ilen = this.timeouts.length; i < ilen; i++) {\n clearTimeout(this.timeouts[i]);\n }\n };\n\n /**\n * Refresh selection borders. This is temporary method relic after selection rewrite.\n *\n * @private\n * @param {Boolean} revertOriginal\n */\n this._refreshBorders = function(revertOriginal) {\n editorManager.destroyEditor(revertOriginal);\n instance.view.render();\n\n if (selection.isSelected()) {\n editorManager.prepareEditor();\n }\n };\n\n Hooks.getSingleton().run(instance, 'construct');\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/core.js","import {inherit} from './object';\n/* eslint-disable import/prefer-default-export */\n/**\n * Factory for columns constructors.\n *\n * @param {Object} GridSettings\n * @param {Array} conflictList\n * @return {Object} ColumnSettings\n */\nexport function columnFactory(GridSettings, conflictList) {\n function ColumnSettings() {};\n\n inherit(ColumnSettings, GridSettings);\n\n // Clear conflict settings\n for (let i = 0, len = conflictList.length; i < len; i++) {\n ColumnSettings.prototype[conflictList[i]] = void 0;\n }\n\n return ColumnSettings;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/helpers/setting.js","import {getCellType} from './../cellTypes';\nimport {hasOwnProperty} from './object';\n\nconst COLUMN_LABEL_BASE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\nconst COLUMN_LABEL_BASE_LENGTH = COLUMN_LABEL_BASE.length;\n\n/**\n * Generates spreadsheet-like column names: A, B, C, ..., Z, AA, AB, etc.\n *\n * @param {Number} index Column index.\n * @returns {String}\n */\nexport function spreadsheetColumnLabel(index) {\n let dividend = index + 1;\n let columnLabel = '';\n let modulo;\n\n while (dividend > 0) {\n modulo = (dividend - 1) % COLUMN_LABEL_BASE_LENGTH;\n columnLabel = String.fromCharCode(65 + modulo) + columnLabel;\n dividend = parseInt((dividend - modulo) / COLUMN_LABEL_BASE_LENGTH, 10);\n }\n\n return columnLabel;\n}\n\n/**\n * Generates spreadsheet-like column index from theirs labels: A, B, C ...., Z, AA, AB, etc.\n *\n * @param {String} label Column label.\n * @returns {Number}\n */\nexport function spreadsheetColumnIndex(label) {\n let result = 0;\n\n if (label) {\n for (let i = 0, j = label.length - 1; i < label.length; i += 1, j -= 1) {\n result += Math.pow(COLUMN_LABEL_BASE_LENGTH, j) * (COLUMN_LABEL_BASE.indexOf(label[i]) + 1);\n }\n }\n --result;\n\n return result;\n}\n\n/**\n * Creates 2D array of Excel-like values \"A1\", \"A2\", ...\n *\n * @param {Number} rows Number of rows to generate.\n * @param {Number} columns Number of columns to generate.\n * @returns {Array}\n */\nexport function createSpreadsheetData(rows = 100, columns = 4) {\n var _rows = [],\n i,\n j;\n\n for (i = 0; i < rows; i++) {\n var row = [];\n\n for (j = 0; j < columns; j++) {\n row.push(spreadsheetColumnLabel(j) + (i + 1));\n }\n _rows.push(row);\n }\n\n return _rows;\n}\n\n/**\n * Creates 2D array of Excel-like values \"A1\", \"A2\", as an array of objects.\n *\n * @param {Number} rows Number of rows to generate.\n * @param {Number} colCount Number of columns to generate.\n * @returns {Array}\n */\nexport function createSpreadsheetObjectData(rows = 100, colCount = 4) {\n var _rows = [],\n i,\n j;\n\n for (i = 0; i < rows; i++) {\n var row = {};\n\n for (j = 0; j < colCount; j++) {\n row[`prop${j}`] = spreadsheetColumnLabel(j) + (i + 1);\n }\n _rows.push(row);\n }\n\n return _rows;\n}\n\n/**\n * Generates an empty data object.\n *\n * @param {Number} rows Number of rows to generate.\n * @param {Number} columns Number of columns to generate\n * @returns {Array}\n */\nexport function createEmptySpreadsheetData(rows, columns) {\n let data = [];\n let row;\n\n for (let i = 0; i < rows; i++) {\n row = [];\n for (let j = 0; j < columns; j++) {\n row.push('');\n }\n data.push(row);\n }\n\n return data;\n}\n\nexport function translateRowsToColumns(input) {\n var i,\n ilen,\n j,\n jlen,\n output = [],\n olen = 0;\n\n for (i = 0, ilen = input.length; i < ilen; i++) {\n for (j = 0, jlen = input[i].length; j < jlen; j++) {\n if (j == olen) {\n output.push([]);\n olen++;\n }\n output[j].push(input[i][j]);\n }\n }\n\n return output;\n}\n\n/**\n * Factory that produces a function for searching methods (or any properties) which could be defined directly in\n * table configuration or implicitly, within cell type definition.\n *\n * For example: renderer can be defined explicitly using \"renderer\" property in column configuration or it can be\n * defined implicitly using \"type\" property.\n *\n * Methods/properties defined explicitly always takes precedence over those defined through \"type\".\n *\n * If the method/property is not found in an object, searching is continued recursively through prototype chain, until\n * it reaches the Object.prototype.\n *\n *\n * @param methodName {String} name of the method/property to search (i.e. 'renderer', 'validator', 'copyable')\n * @param allowUndefined {Boolean} [optional] if false, the search is continued if methodName has not been found in cell \"type\"\n * @returns {Function}\n */\nexport function cellMethodLookupFactory(methodName, allowUndefined) {\n\n allowUndefined = typeof allowUndefined == 'undefined' ? true : allowUndefined;\n\n return function cellMethodLookup(row, col) {\n return (function getMethodFromProperties(properties) {\n\n if (!properties) {\n return; // method not found\n\n } else if (hasOwnProperty(properties, methodName) && properties[methodName] !== void 0) { // check if it is own and is not empty\n return properties[methodName]; // method defined directly\n\n } else if (hasOwnProperty(properties, 'type') && properties.type) { // check if it is own and is not empty\n var type;\n\n if (typeof properties.type != 'string') {\n throw new Error('Cell type must be a string ');\n }\n type = getCellType(properties.type);\n\n if (hasOwnProperty(type, methodName)) {\n return type[methodName]; // method defined in type.\n } else if (allowUndefined) {\n return; // method does not defined in type (eg. validator), returns undefined\n }\n }\n\n return getMethodFromProperties(Object.getPrototypeOf(properties));\n\n }(typeof row == 'number' ? this.getCellMeta(row, col) : row));\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/helpers/data.js","import {CellRange} from './../3rdparty/walkontable/src';\nimport {arrayEach, arrayReduce, arrayMap} from './../helpers/array';\nimport {isUndefined} from './../helpers/mixed';\n\nexport const SELECTION_TYPE_UNRECOGNIZED = 0;\nexport const SELECTION_TYPE_EMPTY = 1;\nexport const SELECTION_TYPE_ARRAY = 2;\nexport const SELECTION_TYPE_OBJECT = 3;\nexport const SELECTION_TYPES = [\n SELECTION_TYPE_OBJECT,\n SELECTION_TYPE_ARRAY,\n];\nconst ARRAY_TYPE_PATTERN = [['number'], ['number', 'string'], ['number', 'undefined'], ['number', 'string', 'undefined']];\nconst rootCall = Symbol('root');\nconst childCall = Symbol('child');\n\n/**\n * Detect selection schema structure.\n *\n * @param {*} selectionRanges The selected range or and array of selected ranges. This type of data is produced by\n * `hot.getSelected()`, `hot.getSelectedLast()`, `hot.getSelectedRange()`\n * and `hot.getSelectedRangeLast()` methods.\n * @returns {Number} Returns a number that specifies the type of detected selection schema. If selection schema type\n * is unrecognized than it returns `0`.\n */\nexport function detectSelectionType(selectionRanges, _callSymbol = rootCall) {\n if (_callSymbol !== rootCall && _callSymbol !== childCall) {\n throw new Error('The second argument is used internally only and cannot be overwritten.');\n }\n\n const isArray = Array.isArray(selectionRanges);\n const isRootCall = _callSymbol === rootCall;\n let result = SELECTION_TYPE_UNRECOGNIZED;\n\n if (isArray) {\n const firstItem = selectionRanges[0];\n\n if (selectionRanges.length === 0) {\n result = SELECTION_TYPE_EMPTY;\n\n } else if (isRootCall && firstItem instanceof CellRange) {\n result = SELECTION_TYPE_OBJECT;\n\n } else if (isRootCall && Array.isArray(firstItem)) {\n result = detectSelectionType(firstItem, childCall);\n\n } else if (selectionRanges.length >= 2 && selectionRanges.length <= 4) {\n const isArrayType = !selectionRanges.some((value, index) => !ARRAY_TYPE_PATTERN[index].includes(typeof value));\n\n if (isArrayType) {\n result = SELECTION_TYPE_ARRAY;\n }\n }\n }\n\n return result;\n}\n\n/**\n * Factory function designed for normalization data schema from different data structures of the selection ranges.\n *\n * @param {String} type Selection type which will be processed.\n * @param {Object} [options]\n * @param {Boolean} [options.keepDirection=false] If `true`, the coordinates which contain the direction of the\n * selected cells won't be changed. Otherwise, the selection will be\n * normalized to values starting from top-left to bottom-right.\n * @param {Function} [options.propToCol] Pass the converting function (usually `datamap.propToCol`) if the column\n * defined as props should be normalized to the numeric values.\n * @returns {Number[]} Returns normalized data about selected range as an array (`[rowStart, columnStart, rowEnd, columnEnd]`).\n */\nexport function normalizeSelectionFactory(type, {keepDirection = false, propToCol} = {}) {\n if (!SELECTION_TYPES.includes(type)) {\n throw new Error('Unsupported selection ranges schema type was provided.');\n }\n\n return function(selection) {\n const isObjectType = type === SELECTION_TYPE_OBJECT;\n let rowStart = isObjectType ? selection.from.row : selection[0];\n let columnStart = isObjectType ? selection.from.col : selection[1];\n let rowEnd = isObjectType ? selection.to.row : selection[2];\n let columnEnd = isObjectType ? selection.to.col : selection[3];\n\n if (typeof propToCol === 'function') {\n if (typeof columnStart === 'string') {\n columnStart = propToCol(columnStart);\n }\n if (typeof columnEnd === 'string') {\n columnEnd = propToCol(columnEnd);\n }\n }\n\n if (isUndefined(rowEnd)) {\n rowEnd = rowStart;\n }\n if (isUndefined(columnEnd)) {\n columnEnd = columnStart;\n }\n\n if (!keepDirection) {\n const origRowStart = rowStart;\n const origColumnStart = columnStart;\n const origRowEnd = rowEnd;\n const origColumnEnd = columnEnd;\n\n rowStart = Math.min(origRowStart, origRowEnd);\n columnStart = Math.min(origColumnStart, origColumnEnd);\n rowEnd = Math.max(origRowStart, origRowEnd);\n columnEnd = Math.max(origColumnStart, origColumnEnd);\n }\n\n return [rowStart, columnStart, rowEnd, columnEnd];\n };\n}\n\n/**\n * Function transform selection ranges (produced by `hot.getSelected()` and `hot.getSelectedRange()`) to normalized\n * data structure. It merges repeated ranges into consecutive coordinates. The returned structure\n * contains an array of arrays. The single item contains at index 0 visual column index from the selection was\n * started and at index 1 distance as a count of selected columns.\n *\n * @param {Array[]|CellRange[]} selectionRanges Selection ranges produced by Handsontable.\n * @return {Array[]} Returns an array of arrays with ranges defines in that schema:\n * `[[visualColumnStart, distance], [visualColumnStart, distance], ...]`.\n * The column distances are always created starting from the left (zero index) to the\n * right (the latest column index).\n */\nexport function transformSelectionToColumnDistance(selectionRanges) {\n const selectionType = detectSelectionType(selectionRanges);\n\n if (selectionType === SELECTION_TYPE_UNRECOGNIZED || selectionType === SELECTION_TYPE_EMPTY) {\n return [];\n }\n\n const selectionSchemaNormalizer = normalizeSelectionFactory(selectionType);\n const unorderedIndexes = new Set();\n\n // Iterate through all ranges and collect all column indexes which are not saved yet.\n arrayEach(selectionRanges, (selection) => {\n const [, columnStart,, columnEnd] = selectionSchemaNormalizer(selection);\n const amount = columnEnd - columnStart + 1;\n\n arrayEach(Array.from(new Array(amount), (_, i) => columnStart + i), (index) => {\n if (!unorderedIndexes.has(index)) {\n unorderedIndexes.add(index);\n }\n });\n });\n\n // Sort indexes in ascending order to easily detecting non-consecutive columns.\n const orderedIndexes = Array.from(unorderedIndexes).sort((a, b) => a - b);\n const normalizedColumnRanges = arrayReduce(orderedIndexes, (acc, visualColumnIndex, index, array) => {\n if (index !== 0 && visualColumnIndex === array[index - 1] + 1) {\n acc[acc.length - 1][1]++;\n\n } else {\n acc.push([visualColumnIndex, 1]);\n }\n\n return acc;\n }, []);\n\n return normalizedColumnRanges;\n}\n\n/**\n * Function transform selection ranges (produced by `hot.getSelected()` and `hot.getSelectedRange()`) to normalized\n * data structure. It merges repeated ranges into consecutive coordinates. The returned structure\n * contains an array of arrays. The single item contains at index 0 visual column index from the selection was\n * started and at index 1 distance as a count of selected columns.\n *\n * @param {Array[]|CellRange[]} selectionRanges Selection ranges produced by Handsontable.\n * @return {Array[]} Returns an array of arrays with ranges defines in that schema:\n * `[[visualColumnStart, distance], [visualColumnStart, distance], ...]`.\n * The column distances are always created starting from the left (zero index) to the\n * right (the latest column index).\n */\nexport function transformSelectionToRowDistance(selectionRanges) {\n const selectionType = detectSelectionType(selectionRanges);\n\n if (selectionType === SELECTION_TYPE_UNRECOGNIZED || selectionType === SELECTION_TYPE_EMPTY) {\n return [];\n }\n\n const selectionSchemaNormalizer = normalizeSelectionFactory(selectionType);\n const unorderedIndexes = new Set();\n\n // Iterate through all ranges and collect all column indexes which are not saved yet.\n arrayEach(selectionRanges, (selection) => {\n const [rowStart,, rowEnd] = selectionSchemaNormalizer(selection);\n const amount = rowEnd - rowStart + 1;\n\n arrayEach(Array.from(new Array(amount), (_, i) => rowStart + i), (index) => {\n if (!unorderedIndexes.has(index)) {\n unorderedIndexes.add(index);\n }\n });\n });\n\n // Sort indexes in ascending order to easily detecting non-consecutive columns.\n const orderedIndexes = Array.from(unorderedIndexes).sort((a, b) => a - b);\n const normalizedRowRanges = arrayReduce(orderedIndexes, (acc, rowIndex, index, array) => {\n if (index !== 0 && rowIndex === array[index - 1] + 1) {\n acc[acc.length - 1][1]++;\n\n } else {\n acc.push([rowIndex, 1]);\n }\n\n return acc;\n }, []);\n\n return normalizedRowRanges;\n}\n\n/**\n * Check if passed value can be treated as valid cell coordinate. The second argument is\n * used to check if the value doesn't exceed the defined max table rows/columns count.\n *\n * @param {*} coord\n * @param {Number} maxTableItemsCount The value that declares the maximum coordinate that is still validatable.\n * @return {Boolean}\n */\nexport function isValidCoord(coord, maxTableItemsCount = Infinity) {\n return typeof coord === 'number' && coord >= 0 && coord < maxTableItemsCount;\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/selection/utils.js","import {addClass, outerHeight, outerWidth} from './../helpers/dom/element';\nimport {arrayEach} from './../helpers/array';\n\n/**\n * @class GhostTable\n * @util\n */\nclass GhostTable {\n constructor(hotInstance) {\n /**\n * Handsontable instance.\n *\n * @type {Core}\n */\n this.hot = hotInstance;\n /**\n * Container element where every table will be injected.\n *\n * @type {HTMLElement|null}\n */\n this.container = null;\n /**\n * Flag which determine is table was injected to DOM.\n *\n * @type {Boolean}\n */\n this.injected = false;\n /**\n * Added rows collection.\n *\n * @type {Array}\n */\n this.rows = [];\n /**\n * Added columns collection.\n *\n * @type {Array}\n */\n this.columns = [];\n /**\n * Samples prepared for calculations.\n *\n * @type {Map}\n * @default {null}\n */\n this.samples = null;\n /**\n * Ghost table settings.\n *\n * @type {Object}\n * @default {Object}\n */\n this.settings = {\n useHeaders: true\n };\n }\n\n /**\n * Add row.\n *\n * @param {Number} row Row index.\n * @param {Map} samples Samples Map object.\n */\n addRow(row, samples) {\n if (this.columns.length) {\n throw new Error('Doesn\\'t support multi-dimensional table');\n }\n if (!this.rows.length) {\n this.container = this.createContainer(this.hot.rootElement.className);\n }\n const rowObject = {row};\n this.rows.push(rowObject);\n\n this.samples = samples;\n this.table = this.createTable(this.hot.table.className);\n this.table.colGroup.appendChild(this.createColGroupsCol());\n this.table.tr.appendChild(this.createRow(row));\n this.container.container.appendChild(this.table.fragment);\n\n rowObject.table = this.table.table;\n }\n\n /**\n * Add a row consisting of the column headers.\n */\n addColumnHeadersRow(samples) {\n if (this.hot.getColHeader(0) != null) {\n const rowObject = {row: -1};\n this.rows.push(rowObject);\n\n this.container = this.createContainer(this.hot.rootElement.className);\n\n this.samples = samples;\n this.table = this.createTable(this.hot.table.className);\n this.table.colGroup.appendChild(this.createColGroupsCol());\n this.table.tHead.appendChild(this.createColumnHeadersRow());\n this.container.container.appendChild(this.table.fragment);\n\n rowObject.table = this.table.table;\n }\n }\n\n /**\n * Add column.\n *\n * @param {Number} column Column index.\n * @param {Map} samples Samples Map object.\n */\n addColumn(column, samples) {\n if (this.rows.length) {\n throw new Error('Doesn\\'t support multi-dimensional table');\n }\n if (!this.columns.length) {\n this.container = this.createContainer(this.hot.rootElement.className);\n }\n const columnObject = {col: column};\n this.columns.push(columnObject);\n\n this.samples = samples;\n this.table = this.createTable(this.hot.table.className);\n\n if (this.getSetting('useHeaders') && this.hot.getColHeader(column) !== null) {\n this.hot.view.appendColHeader(column, this.table.th);\n }\n this.table.tBody.appendChild(this.createCol(column));\n this.container.container.appendChild(this.table.fragment);\n\n columnObject.table = this.table.table;\n }\n\n /**\n * Get calculated heights.\n *\n * @param {Function} callback Callback which will be fired for each calculated row.\n */\n getHeights(callback) {\n if (!this.injected) {\n this.injectTable();\n }\n arrayEach(this.rows, (row) => {\n // -1 <- reduce border-top from table\n callback(row.row, outerHeight(row.table) - 1);\n });\n }\n\n /**\n * Get calculated widths.\n *\n * @param {Function} callback Callback which will be fired for each calculated column.\n */\n getWidths(callback) {\n if (!this.injected) {\n this.injectTable();\n }\n arrayEach(this.columns, (column) => {\n callback(column.col, outerWidth(column.table));\n });\n }\n\n /**\n * Set the Ghost Table settings to the provided object.\n *\n * @param {Object} settings New Ghost Table Settings\n */\n setSettings(settings) {\n this.settings = settings;\n }\n\n /**\n * Set a single setting of the Ghost Table.\n *\n * @param {String} name Setting name.\n * @param {*} value Setting value.\n */\n setSetting(name, value) {\n if (!this.settings) {\n this.settings = {};\n }\n\n this.settings[name] = value;\n }\n\n /**\n * Get the Ghost Table settings.\n *\n * @returns {Object|null}\n */\n getSettings() {\n return this.settings;\n }\n\n /**\n * Get a single Ghost Table setting.\n *\n * @param {String} name\n * @returns {Boolean|null}\n */\n getSetting(name) {\n if (this.settings) {\n return this.settings[name];\n }\n return null;\n\n }\n\n /**\n * Create colgroup col elements.\n *\n * @returns {DocumentFragment}\n */\n createColGroupsCol() {\n const d = document;\n const fragment = d.createDocumentFragment();\n\n if (this.hot.hasRowHeaders()) {\n fragment.appendChild(this.createColElement(-1));\n }\n\n this.samples.forEach((sample) => {\n arrayEach(sample.strings, (string) => {\n fragment.appendChild(this.createColElement(string.col));\n });\n });\n\n return fragment;\n }\n\n /**\n * Create table row element.\n *\n * @param {Number} row Row index.\n * @returns {DocumentFragment} Returns created table row elements.\n */\n createRow(row) {\n const d = document;\n const fragment = d.createDocumentFragment();\n const th = d.createElement('th');\n\n if (this.hot.hasRowHeaders()) {\n this.hot.view.appendRowHeader(row, th);\n\n fragment.appendChild(th);\n }\n\n this.samples.forEach((sample) => {\n arrayEach(sample.strings, (string) => {\n let column = string.col;\n let cellProperties = this.hot.getCellMeta(row, column);\n\n cellProperties.col = column;\n cellProperties.row = row;\n\n let renderer = this.hot.getCellRenderer(cellProperties);\n const td = d.createElement('td');\n\n renderer(this.hot, td, row, column, this.hot.colToProp(column), string.value, cellProperties);\n fragment.appendChild(td);\n });\n });\n\n return fragment;\n }\n\n createColumnHeadersRow() {\n const d = document;\n const fragment = d.createDocumentFragment();\n\n if (this.hot.hasRowHeaders()) {\n const th = d.createElement('th');\n this.hot.view.appendColHeader(-1, th);\n fragment.appendChild(th);\n }\n\n this.samples.forEach((sample) => {\n arrayEach(sample.strings, (string) => {\n let column = string.col;\n\n const th = d.createElement('th');\n\n this.hot.view.appendColHeader(column, th);\n fragment.appendChild(th);\n });\n });\n\n return fragment;\n }\n\n /**\n * Create table column elements.\n *\n * @param {Number} column Column index.\n * @returns {DocumentFragment} Returns created column table column elements.\n */\n createCol(column) {\n const d = document;\n const fragment = d.createDocumentFragment();\n\n this.samples.forEach((sample) => {\n arrayEach(sample.strings, (string) => {\n let row = string.row;\n let cellProperties = this.hot.getCellMeta(row, column);\n\n cellProperties.col = column;\n cellProperties.row = row;\n\n let renderer = this.hot.getCellRenderer(cellProperties);\n const td = d.createElement('td');\n const tr = d.createElement('tr');\n\n renderer(this.hot, td, row, column, this.hot.colToProp(column), string.value, cellProperties);\n tr.appendChild(td);\n fragment.appendChild(tr);\n });\n });\n\n return fragment;\n }\n\n /**\n * Remove table from document and reset internal state.\n */\n clean() {\n this.rows.length = 0;\n this.rows[-1] = void 0;\n this.columns.length = 0;\n\n if (this.samples) {\n this.samples.clear();\n }\n this.samples = null;\n this.removeTable();\n }\n\n /**\n * Inject generated table into document.\n *\n * @param {HTMLElement} [parent=null]\n */\n injectTable(parent = null) {\n if (!this.injected) {\n (parent || this.hot.rootElement).appendChild(this.container.fragment);\n this.injected = true;\n }\n }\n\n /**\n * Remove table from document.\n */\n removeTable() {\n if (this.injected && this.container.container.parentNode) {\n this.container.container.parentNode.removeChild(this.container.container);\n this.container = null;\n this.injected = false;\n }\n }\n\n /**\n * Create col element.\n *\n * @param {Number} column Column index.\n * @returns {HTMLElement}\n */\n createColElement(column) {\n const d = document;\n const col = d.createElement('col');\n\n col.style.width = `${this.hot.view.wt.wtTable.getStretchedColumnWidth(column)}px`;\n\n return col;\n }\n\n /**\n * Create table element.\n *\n * @param {String} className\n * @returns {Object}\n */\n createTable(className = '') {\n const d = document;\n const fragment = d.createDocumentFragment();\n const table = d.createElement('table');\n const tHead = d.createElement('thead');\n const tBody = d.createElement('tbody');\n const colGroup = d.createElement('colgroup');\n const tr = d.createElement('tr');\n const th = d.createElement('th');\n\n if (this.isVertical()) {\n table.appendChild(colGroup);\n }\n if (this.isHorizontal()) {\n tr.appendChild(th);\n tHead.appendChild(tr);\n table.style.tableLayout = 'auto';\n table.style.width = 'auto';\n }\n table.appendChild(tHead);\n\n if (this.isVertical()) {\n tBody.appendChild(tr);\n }\n table.appendChild(tBody);\n addClass(table, className);\n fragment.appendChild(table);\n\n return {fragment, table, tHead, tBody, colGroup, tr, th};\n }\n\n /**\n * Create container for tables.\n *\n * @param {String} className\n * @returns {Object}\n */\n createContainer(className = '') {\n const d = document;\n const fragment = d.createDocumentFragment();\n const container = d.createElement('div');\n\n className = `htGhostTable htAutoSize ${className.trim()}`;\n addClass(container, className);\n fragment.appendChild(container);\n\n return {fragment, container};\n }\n\n /**\n * Checks if table is raised vertically (checking rows).\n *\n * @returns {Boolean}\n */\n isVertical() {\n return !!(this.rows.length && !this.columns.length);\n }\n\n /**\n * Checks if table is raised horizontally (checking columns).\n *\n * @returns {Boolean}\n */\n isHorizontal() {\n return !!(this.columns.length && !this.rows.length);\n }\n}\n\nexport default GhostTable;\n\n\n\n// WEBPACK FOOTER //\n// ./src/utils/ghostTable.js","export const KEY = '---------';\n\nexport default function separatorItem() {\n return {\n name: KEY\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/contextMenu/predefinedItems/separator.js","import {objectEach} from './../../helpers/object';\nimport alignmentItem, {KEY as ALIGNMENT} from './predefinedItems/alignment';\nimport clearColumnItem, {KEY as CLEAR_COLUMN} from './predefinedItems/clearColumn';\nimport columnLeftItem, {KEY as COLUMN_LEFT} from './predefinedItems/columnLeft';\nimport columnRightItem, {KEY as COLUMN_RIGHT} from './predefinedItems/columnRight';\nimport readOnlyItem, {KEY as READ_ONLY} from './predefinedItems/readOnly';\nimport redoItem, {KEY as REDO} from './predefinedItems/redo';\nimport removeColumnItem, {KEY as REMOVE_COLUMN} from './predefinedItems/removeColumn';\nimport removeRowItem, {KEY as REMOVE_ROW} from './predefinedItems/removeRow';\nimport rowAboveItem, {KEY as ROW_ABOVE} from './predefinedItems/rowAbove';\nimport rowBelowItem, {KEY as ROW_BELOW} from './predefinedItems/rowBelow';\nimport separatorItem, {KEY as SEPARATOR} from './predefinedItems/separator';\nimport undoItem, {KEY as UNDO} from './predefinedItems/undo';\n\nexport {KEY as ALIGNMENT} from './predefinedItems/alignment';\nexport {KEY as CLEAR_COLUMN} from './predefinedItems/clearColumn';\nexport {KEY as COLUMN_LEFT} from './predefinedItems/columnLeft';\nexport {KEY as COLUMN_RIGHT} from './predefinedItems/columnRight';\nexport {KEY as READ_ONLY} from './predefinedItems/readOnly';\nexport {KEY as REDO} from './predefinedItems/redo';\nexport {KEY as REMOVE_COLUMN} from './predefinedItems/removeColumn';\nexport {KEY as REMOVE_ROW} from './predefinedItems/removeRow';\nexport {KEY as ROW_ABOVE} from './predefinedItems/rowAbove';\nexport {KEY as ROW_BELOW} from './predefinedItems/rowBelow';\nexport {KEY as SEPARATOR} from './predefinedItems/separator';\nexport {KEY as UNDO} from './predefinedItems/undo';\n\nexport const ITEMS = [\n ROW_ABOVE, ROW_BELOW, COLUMN_LEFT, COLUMN_RIGHT, CLEAR_COLUMN, REMOVE_ROW, REMOVE_COLUMN, UNDO, REDO, READ_ONLY,\n ALIGNMENT, SEPARATOR\n];\n\nconst _predefinedItems = {\n [SEPARATOR]: separatorItem,\n [ROW_ABOVE]: rowAboveItem,\n [ROW_BELOW]: rowBelowItem,\n [COLUMN_LEFT]: columnLeftItem,\n [COLUMN_RIGHT]: columnRightItem,\n [CLEAR_COLUMN]: clearColumnItem,\n [REMOVE_ROW]: removeRowItem,\n [REMOVE_COLUMN]: removeColumnItem,\n [UNDO]: undoItem,\n [REDO]: redoItem,\n [READ_ONLY]: readOnlyItem,\n [ALIGNMENT]: alignmentItem,\n};\n\n/**\n * Gets new object with all predefined menu items.\n *\n * @returns {Object}\n */\nexport function predefinedItems() {\n const items = {};\n\n objectEach(_predefinedItems, (itemFactory, key) => {\n items[key] = itemFactory();\n });\n\n return items;\n}\n\n/**\n * Add new predefined menu item to the collection.\n *\n * @param {String} key Menu command id.\n * @param {Object} item Object command descriptor.\n */\nexport function addItem(key, item) {\n if (ITEMS.indexOf(key) === -1) {\n _predefinedItems[key] = item;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/contextMenu/predefinedItems.js","import {CellCoords, CellRange} from '../../3rdparty/walkontable/src/index';\nimport {toSingleLine} from './../../helpers/templateLiteralTag';\n\n/**\n * The `MergedCellCoords` class represents a single merged cell.\n *\n * @class MergedCellCoords\n * @plugin MergeCells\n */\nclass MergedCellCoords {\n constructor(row, column, rowspan, colspan) {\n /**\n * The index of the topmost merged cell row.\n *\n * @type {Number}\n */\n this.row = row;\n /**\n * The index of the leftmost column.\n *\n * @type {Number}\n */\n this.col = column;\n /**\n * The `rowspan` value of the merged cell.\n *\n * @type {Number}\n */\n this.rowspan = rowspan;\n /**\n * The `colspan` value of the merged cell.\n *\n * @type {Number}\n */\n this.colspan = colspan;\n /**\n * `true` only if the merged cell is bound to be removed.\n *\n * @type {Boolean}\n */\n this.removed = false;\n }\n\n /**\n * Get a warning message for when the declared merged cell data contains negative values.\n *\n * @param {Object} newMergedCell Object containg information about the merged cells that was about to be added.\n * @return {String}\n */\n static NEGATIVE_VALUES_WARNING(newMergedCell) {\n return toSingleLine`The merged cell declared with {row: ${newMergedCell.row}, col: ${newMergedCell.col}, rowspan: \n ${newMergedCell.rowspan}, colspan: ${newMergedCell.colspan}} contains negative values, which is not supported. It \n will not be added to the collection.`;\n }\n\n /**\n * Get a warning message for when the declared merged cell data contains values exceeding the table limits.\n *\n * @param {Object} newMergedCell Object containg information about the merged cells that was about to be added.\n * @return {String}\n */\n static IS_OUT_OF_BOUNDS_WARNING(newMergedCell) {\n return toSingleLine`The merged cell declared at [${newMergedCell.row}, ${newMergedCell.col}] is positioned (or positioned partially) \n outside of the table range. It was not added to the table, please fix your setup.`;\n }\n\n /**\n * Get a warning message for when the declared merged cell data represents a single cell.\n *\n * @param {Object} newMergedCell Object containg information about the merged cells that was about to be added.\n * @return {String}\n */\n static IS_SINGLE_CELL(newMergedCell) {\n return toSingleLine`The merged cell declared at [${newMergedCell.row}, ${newMergedCell.col}] has both \"rowspan\" \n and \"colspan\" declared as \"1\", which makes it a single cell. It cannot be added to the collection.`;\n }\n\n /**\n * Get a warning message for when the declared merged cell data contains \"colspan\" or \"rowspan\", that equals 0.\n *\n * @param {Object} newMergedCell Object containg information about the merged cells that was about to be added.\n * @return {String}\n */\n static ZERO_SPAN_WARNING(newMergedCell) {\n return toSingleLine`The merged cell declared at [${newMergedCell.row}, ${newMergedCell.col}] has \"rowspan\" or \"colspan\" declared as \n \"0\", which is not supported. It cannot be added to the collection.`;\n }\n\n /**\n * Check whether the values provided for a merged cell contain any negative values.\n *\n * @param {Object} mergedCellInfo Object containing the `row`, `col`, `rowspan` and `colspan` properties.\n * @return {Boolean}\n */\n static containsNegativeValues(mergedCellInfo) {\n return mergedCellInfo.row < 0 || mergedCellInfo.col < 0 || mergedCellInfo.rowspan < 0 || mergedCellInfo.colspan < 0;\n }\n\n /**\n * Check whether the provided merged cell information object represents a single cell.\n *\n * @private\n * @param {Object} mergedCellInfo An object with `row`, `col`, `rowspan` and `colspan` properties.\n * @return {Boolean}\n */\n static isSingleCell(mergedCellInfo) {\n return mergedCellInfo.colspan === 1 && mergedCellInfo.rowspan === 1;\n }\n\n /**\n * Check whether the provided merged cell information object contains a rowspan or colspan of 0.\n *\n * @private\n * @param {Object} mergedCellInfo An object with `row`, `col`, `rowspan` and `colspan` properties.\n * @return {Boolean}\n */\n static containsZeroSpan(mergedCellInfo) {\n return mergedCellInfo.colspan === 0 || mergedCellInfo.rowspan === 0;\n }\n\n /**\n * Check whether the provided merged cell object is to be declared out of bounds of the table.\n *\n * @param {Object} mergeCell Object containing the `row`, `col`, `rowspan` and `colspan` properties.\n * @param {Number} rowCount Number of rows in the table.\n * @param {Number} columnCount Number of rows in the table.\n * @return {Boolean}\n */\n static isOutOfBounds(mergeCell, rowCount, columnCount) {\n return mergeCell.row < 0 ||\n mergeCell.col < 0 ||\n mergeCell.row >= rowCount ||\n mergeCell.row + mergeCell.rowspan - 1 >= rowCount ||\n mergeCell.col >= columnCount ||\n mergeCell.col + mergeCell.colspan - 1 >= columnCount;\n }\n\n /**\n * Sanitize (prevent from going outside the boundaries) the merged cell.\n *\n * @param hotInstance\n */\n normalize(hotInstance) {\n const totalRows = hotInstance.countRows();\n const totalColumns = hotInstance.countCols();\n\n if (this.row < 0) {\n this.row = 0;\n\n } else if (this.row > totalRows - 1) {\n this.row = totalRows - 1;\n }\n\n if (this.col < 0) {\n this.col = 0;\n\n } else if (this.col > totalColumns - 1) {\n this.col = totalColumns - 1;\n }\n\n if (this.row + this.rowspan > totalRows - 1) {\n this.rowspan = totalRows - this.row;\n }\n\n if (this.col + this.colspan > totalColumns - 1) {\n this.colspan = totalColumns - this.col;\n }\n }\n\n /**\n * Returns `true` if the provided coordinates are inside the merged cell.\n *\n * @param {Number} row The row index.\n * @param {Number} column The column index.\n * @return {Boolean}\n */\n includes(row, column) {\n return this.row <= row && this.col <= column && this.row + this.rowspan - 1 >= row && this.col + this.colspan - 1 >= column;\n }\n\n /**\n * Returns `true` if the provided `column` property is within the column span of the merged cell.\n *\n * @param {Number} column The column index.\n * @return {Boolean}\n */\n includesHorizontally(column) {\n return this.col <= column && this.col + this.colspan - 1 >= column;\n }\n\n /**\n * Returns `true` if the provided `row` property is within the row span of the merged cell.\n *\n * @param {Number} row Row index.\n * @return {Boolean}\n */\n includesVertically(row) {\n return this.row <= row && this.row + this.rowspan - 1 >= row;\n }\n\n /**\n * Shift (and possibly resize, if needed) the merged cell.\n *\n * @param {Array} shiftVector 2-element array containing the information on the shifting in the `x` and `y` axis.\n * @param {Number} indexOfChange Index of the preceding change.\n * @returns {Boolean} Returns `false` if the whole merged cell was removed.\n */\n shift(shiftVector, indexOfChange) {\n const shiftValue = shiftVector[0] || shiftVector[1];\n const shiftedIndex = indexOfChange + Math.abs(shiftVector[0] || shiftVector[1]) - 1;\n const span = shiftVector[0] ? 'colspan' : 'rowspan';\n const index = shiftVector[0] ? 'col' : 'row';\n const changeStart = Math.min(indexOfChange, shiftedIndex);\n const changeEnd = Math.max(indexOfChange, shiftedIndex);\n const mergeStart = this[index];\n const mergeEnd = this[index] + this[span] - 1;\n\n if (mergeStart >= indexOfChange) {\n this[index] += shiftValue;\n }\n\n // adding rows/columns\n if (shiftValue > 0) {\n if (indexOfChange <= mergeEnd && indexOfChange > mergeStart) {\n this[span] += shiftValue;\n }\n\n // removing rows/columns\n } else if (shiftValue < 0) {\n\n // removing the whole merge\n if (changeStart <= mergeStart && changeEnd >= mergeEnd) {\n this.removed = true;\n return false;\n\n // removing the merge partially, including the beginning\n } else if (mergeStart >= changeStart && mergeStart <= changeEnd) {\n const removedOffset = changeEnd - mergeStart + 1;\n const preRemovedOffset = Math.abs(shiftValue) - removedOffset;\n\n this[index] -= preRemovedOffset + shiftValue;\n this[span] -= removedOffset;\n\n // removing the middle part of the merge\n } else if (mergeStart <= changeStart && mergeEnd >= changeEnd) {\n this[span] += shiftValue;\n\n // removing the end part of the merge\n } else if (mergeStart <= changeStart && mergeEnd >= changeStart && mergeEnd < changeEnd) {\n const removedPart = mergeEnd - changeStart + 1;\n\n this[span] -= removedPart;\n }\n }\n\n return true;\n }\n\n /**\n * Check if the second provided merged cell is \"farther\" in the provided direction.\n *\n * @param {MergedCellCoords} mergedCell The merged cell to check.\n * @param {String} direction Drag direction.\n * @return {Boolean|null} `true` if the second provided merged cell is \"farther\".\n */\n isFarther(mergedCell, direction) {\n if (!mergedCell) {\n return true;\n }\n\n if (direction === 'down') {\n return mergedCell.row + mergedCell.rowspan - 1 < this.row + this.rowspan - 1;\n\n } else if (direction === 'up') {\n return mergedCell.row > this.row;\n\n } else if (direction === 'right') {\n return mergedCell.col + mergedCell.colspan - 1 < this.col + this.colspan - 1;\n\n } else if (direction === 'left') {\n return mergedCell.col > this.col;\n }\n return null;\n }\n\n /**\n * Get the bottom row index of the merged cell.\n *\n * @returns {Number}\n */\n getLastRow() {\n return this.row + this.rowspan - 1;\n }\n\n /**\n * Get the rightmost column index of the merged cell.\n *\n * @returns {Number}\n */\n getLastColumn() {\n return this.col + this.colspan - 1;\n }\n\n /**\n * Get the range coordinates of the merged cell.\n *\n * @return {CellRange}\n */\n getRange() {\n return new CellRange(new CellCoords(this.row, this.col), new CellCoords(this.row, this.col), new CellCoords(this.getLastRow(), this.getLastColumn()));\n }\n}\n\nexport default MergedCellCoords;\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/mergeCells/cellCoords.js","'use strict';\nvar strong = require('./_collection-strong');\nvar validate = require('./_validate-collection');\nvar MAP = 'Map';\n\n// 23.1 Map Objects\nmodule.exports = require('./_collection')(MAP, function (get) {\n return function Map() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };\n}, {\n // 23.1.3.6 Map.prototype.get(key)\n get: function get(key) {\n var entry = strong.getEntry(validate(this, MAP), key);\n return entry && entry.v;\n },\n // 23.1.3.9 Map.prototype.set(key, value)\n set: function set(key, value) {\n return strong.def(validate(this, MAP), key === 0 ? 0 : key, value);\n }\n}, strong, true);\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/es6.map.js\n// module id = 96\n// module chunks = 0","'use strict';\nvar dP = require('./_object-dp').f;\nvar create = require('./_object-create');\nvar redefineAll = require('./_redefine-all');\nvar ctx = require('./_ctx');\nvar anInstance = require('./_an-instance');\nvar forOf = require('./_for-of');\nvar $iterDefine = require('./_iter-define');\nvar step = require('./_iter-step');\nvar setSpecies = require('./_set-species');\nvar DESCRIPTORS = require('./_descriptors');\nvar fastKey = require('./_meta').fastKey;\nvar validate = require('./_validate-collection');\nvar SIZE = DESCRIPTORS ? '_s' : 'size';\n\nvar getEntry = function (that, key) {\n // fast case\n var index = fastKey(key);\n var entry;\n if (index !== 'F') return that._i[index];\n // frozen object case\n for (entry = that._f; entry; entry = entry.n) {\n if (entry.k == key) return entry;\n }\n};\n\nmodule.exports = {\n getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {\n var C = wrapper(function (that, iterable) {\n anInstance(that, C, NAME, '_i');\n that._t = NAME; // collection type\n that._i = create(null); // index\n that._f = undefined; // first entry\n that._l = undefined; // last entry\n that[SIZE] = 0; // size\n if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);\n });\n redefineAll(C.prototype, {\n // 23.1.3.1 Map.prototype.clear()\n // 23.2.3.2 Set.prototype.clear()\n clear: function clear() {\n for (var that = validate(this, NAME), data = that._i, entry = that._f; entry; entry = entry.n) {\n entry.r = true;\n if (entry.p) entry.p = entry.p.n = undefined;\n delete data[entry.i];\n }\n that._f = that._l = undefined;\n that[SIZE] = 0;\n },\n // 23.1.3.3 Map.prototype.delete(key)\n // 23.2.3.4 Set.prototype.delete(value)\n 'delete': function (key) {\n var that = validate(this, NAME);\n var entry = getEntry(that, key);\n if (entry) {\n var next = entry.n;\n var prev = entry.p;\n delete that._i[entry.i];\n entry.r = true;\n if (prev) prev.n = next;\n if (next) next.p = prev;\n if (that._f == entry) that._f = next;\n if (that._l == entry) that._l = prev;\n that[SIZE]--;\n } return !!entry;\n },\n // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)\n // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)\n forEach: function forEach(callbackfn /* , that = undefined */) {\n validate(this, NAME);\n var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);\n var entry;\n while (entry = entry ? entry.n : this._f) {\n f(entry.v, entry.k, this);\n // revert to the last existing entry\n while (entry && entry.r) entry = entry.p;\n }\n },\n // 23.1.3.7 Map.prototype.has(key)\n // 23.2.3.7 Set.prototype.has(value)\n has: function has(key) {\n return !!getEntry(validate(this, NAME), key);\n }\n });\n if (DESCRIPTORS) dP(C.prototype, 'size', {\n get: function () {\n return validate(this, NAME)[SIZE];\n }\n });\n return C;\n },\n def: function (that, key, value) {\n var entry = getEntry(that, key);\n var prev, index;\n // change existing entry\n if (entry) {\n entry.v = value;\n // create new entry\n } else {\n that._l = entry = {\n i: index = fastKey(key, true), // <- index\n k: key, // <- key\n v: value, // <- value\n p: prev = that._l, // <- previous entry\n n: undefined, // <- next entry\n r: false // <- removed\n };\n if (!that._f) that._f = entry;\n if (prev) prev.n = entry;\n that[SIZE]++;\n // add to index\n if (index !== 'F') that._i[index] = entry;\n } return that;\n },\n getEntry: getEntry,\n setStrong: function (C, NAME, IS_MAP) {\n // add .keys, .values, .entries, [@@iterator]\n // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11\n $iterDefine(C, NAME, function (iterated, kind) {\n this._t = validate(iterated, NAME); // target\n this._k = kind; // kind\n this._l = undefined; // previous\n }, function () {\n var that = this;\n var kind = that._k;\n var entry = that._l;\n // revert to the last existing entry\n while (entry && entry.r) entry = entry.p;\n // get next entry\n if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) {\n // or finish the iteration\n that._t = undefined;\n return step(1);\n }\n // return step by kind\n if (kind == 'keys') return step(0, entry.k);\n if (kind == 'values') return step(0, entry.v);\n return step(0, [entry.k, entry.v]);\n }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);\n\n // add [@@species], 23.1.2.2, 23.2.2.2\n setSpecies(NAME);\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_collection-strong.js\n// module id = 97\n// module chunks = 0","module.exports = !require('./_descriptors') && !require('./_fails')(function () {\n return Object.defineProperty(require('./_dom-create')('div'), 'a', { get: function () { return 7; } }).a != 7;\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_ie8-dom-define.js\n// module id = 98\n// module chunks = 0","var has = require('./_has');\nvar toIObject = require('./_to-iobject');\nvar arrayIndexOf = require('./_array-includes')(false);\nvar IE_PROTO = require('./_shared-key')('IE_PROTO');\n\nmodule.exports = function (object, names) {\n var O = toIObject(object);\n var i = 0;\n var result = [];\n var key;\n for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);\n // Don't enum bug & hidden keys\n while (names.length > i) if (has(O, key = names[i++])) {\n ~arrayIndexOf(result, key) || result.push(key);\n }\n return result;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_object-keys-internal.js\n// module id = 99\n// module chunks = 0","// false -> Array#indexOf\n// true -> Array#includes\nvar toIObject = require('./_to-iobject');\nvar toLength = require('./_to-length');\nvar toAbsoluteIndex = require('./_to-absolute-index');\nmodule.exports = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIObject($this);\n var length = toLength(O.length);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare\n if (value != value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) if (IS_INCLUDES || index in O) {\n if (O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_array-includes.js\n// module id = 100\n// module chunks = 0","var document = require('./_global').document;\nmodule.exports = document && document.documentElement;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_html.js\n// module id = 101\n// module chunks = 0","// call something on iterator step with safe closing on error\nvar anObject = require('./_an-object');\nmodule.exports = function (iterator, fn, value, entries) {\n try {\n return entries ? fn(anObject(value)[0], value[1]) : fn(value);\n // 7.4.6 IteratorClose(iterator, completion)\n } catch (e) {\n var ret = iterator['return'];\n if (ret !== undefined) anObject(ret.call(iterator));\n throw e;\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_iter-call.js\n// module id = 102\n// module chunks = 0","// check on default Array iterator\nvar Iterators = require('./_iterators');\nvar ITERATOR = require('./_wks')('iterator');\nvar ArrayProto = Array.prototype;\n\nmodule.exports = function (it) {\n return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_is-array-iter.js\n// module id = 103\n// module chunks = 0","var classof = require('./_classof');\nvar ITERATOR = require('./_wks')('iterator');\nvar Iterators = require('./_iterators');\nmodule.exports = require('./_core').getIteratorMethod = function (it) {\n if (it != undefined) return it[ITERATOR]\n || it['@@iterator']\n || Iterators[classof(it)];\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/core.get-iterator-method.js\n// module id = 104\n// module chunks = 0","// getting tag from 19.1.3.6 Object.prototype.toString()\nvar cof = require('./_cof');\nvar TAG = require('./_wks')('toStringTag');\n// ES3 wrong here\nvar ARG = cof(function () { return arguments; }()) == 'Arguments';\n\n// fallback for IE11 Script Access Denied error\nvar tryGet = function (it, key) {\n try {\n return it[key];\n } catch (e) { /* empty */ }\n};\n\nmodule.exports = function (it) {\n var O, T, B;\n return it === undefined ? 'Undefined' : it === null ? 'Null'\n // @@toStringTag case\n : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T\n // builtinTag case\n : ARG ? cof(O)\n // ES3 arguments fallback\n : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_classof.js\n// module id = 105\n// module chunks = 0","'use strict';\nvar LIBRARY = require('./_library');\nvar $export = require('./_export');\nvar redefine = require('./_redefine');\nvar hide = require('./_hide');\nvar Iterators = require('./_iterators');\nvar $iterCreate = require('./_iter-create');\nvar setToStringTag = require('./_set-to-string-tag');\nvar getPrototypeOf = require('./_object-gpo');\nvar ITERATOR = require('./_wks')('iterator');\nvar BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`\nvar FF_ITERATOR = '@@iterator';\nvar KEYS = 'keys';\nvar VALUES = 'values';\n\nvar returnThis = function () { return this; };\n\nmodule.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {\n $iterCreate(Constructor, NAME, next);\n var getMethod = function (kind) {\n if (!BUGGY && kind in proto) return proto[kind];\n switch (kind) {\n case KEYS: return function keys() { return new Constructor(this, kind); };\n case VALUES: return function values() { return new Constructor(this, kind); };\n } return function entries() { return new Constructor(this, kind); };\n };\n var TAG = NAME + ' Iterator';\n var DEF_VALUES = DEFAULT == VALUES;\n var VALUES_BUG = false;\n var proto = Base.prototype;\n var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];\n var $default = $native || getMethod(DEFAULT);\n var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;\n var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;\n var methods, key, IteratorPrototype;\n // Fix native\n if ($anyNative) {\n IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));\n if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {\n // Set @@toStringTag to native iterators\n setToStringTag(IteratorPrototype, TAG, true);\n // fix for some old engines\n if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis);\n }\n }\n // fix Array#{values, @@iterator}.name in V8 / FF\n if (DEF_VALUES && $native && $native.name !== VALUES) {\n VALUES_BUG = true;\n $default = function values() { return $native.call(this); };\n }\n // Define iterator\n if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {\n hide(proto, ITERATOR, $default);\n }\n // Plug for library\n Iterators[NAME] = $default;\n Iterators[TAG] = returnThis;\n if (DEFAULT) {\n methods = {\n values: DEF_VALUES ? $default : getMethod(VALUES),\n keys: IS_SET ? $default : getMethod(KEYS),\n entries: $entries\n };\n if (FORCED) for (key in methods) {\n if (!(key in proto)) redefine(proto, key, methods[key]);\n } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);\n }\n return methods;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_iter-define.js\n// module id = 106\n// module chunks = 0","// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)\nvar has = require('./_has');\nvar toObject = require('./_to-object');\nvar IE_PROTO = require('./_shared-key')('IE_PROTO');\nvar ObjectProto = Object.prototype;\n\nmodule.exports = Object.getPrototypeOf || function (O) {\n O = toObject(O);\n if (has(O, IE_PROTO)) return O[IE_PROTO];\n if (typeof O.constructor == 'function' && O instanceof O.constructor) {\n return O.constructor.prototype;\n } return O instanceof Object ? ObjectProto : null;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_object-gpo.js\n// module id = 107\n// module chunks = 0","module.exports = function (done, value) {\n return { value: value, done: !!done };\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_iter-step.js\n// module id = 108\n// module chunks = 0","'use strict';\nvar global = require('./_global');\nvar dP = require('./_object-dp');\nvar DESCRIPTORS = require('./_descriptors');\nvar SPECIES = require('./_wks')('species');\n\nmodule.exports = function (KEY) {\n var C = global[KEY];\n if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, {\n configurable: true,\n get: function () { return this; }\n });\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_set-species.js\n// module id = 109\n// module chunks = 0","// Works with __proto__ only. Old v8 can't work with null proto objects.\n/* eslint-disable no-proto */\nvar isObject = require('./_is-object');\nvar anObject = require('./_an-object');\nvar check = function (O, proto) {\n anObject(O);\n if (!isObject(proto) && proto !== null) throw TypeError(proto + \": can't set as prototype!\");\n};\nmodule.exports = {\n set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line\n function (test, buggy, set) {\n try {\n set = require('./_ctx')(Function.call, require('./_object-gopd').f(Object.prototype, '__proto__').set, 2);\n set(test, []);\n buggy = !(test instanceof Array);\n } catch (e) { buggy = true; }\n return function setPrototypeOf(O, proto) {\n check(O, proto);\n if (buggy) O.__proto__ = proto;\n else set(O, proto);\n return O;\n };\n }({}, false) : undefined),\n check: check\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_set-proto.js\n// module id = 110\n// module chunks = 0","'use strict';\nvar strong = require('./_collection-strong');\nvar validate = require('./_validate-collection');\nvar SET = 'Set';\n\n// 23.2 Set Objects\nmodule.exports = require('./_collection')(SET, function (get) {\n return function Set() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };\n}, {\n // 23.2.3.1 Set.prototype.add(value)\n add: function add(value) {\n return strong.def(validate(this, SET), value = value === 0 ? 0 : value, value);\n }\n}, strong);\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/es6.set.js\n// module id = 111\n// module chunks = 0","'use strict';\nvar each = require('./_array-methods')(0);\nvar redefine = require('./_redefine');\nvar meta = require('./_meta');\nvar assign = require('./_object-assign');\nvar weak = require('./_collection-weak');\nvar isObject = require('./_is-object');\nvar fails = require('./_fails');\nvar validate = require('./_validate-collection');\nvar WEAK_MAP = 'WeakMap';\nvar getWeak = meta.getWeak;\nvar isExtensible = Object.isExtensible;\nvar uncaughtFrozenStore = weak.ufstore;\nvar tmp = {};\nvar InternalMap;\n\nvar wrapper = function (get) {\n return function WeakMap() {\n return get(this, arguments.length > 0 ? arguments[0] : undefined);\n };\n};\n\nvar methods = {\n // 23.3.3.3 WeakMap.prototype.get(key)\n get: function get(key) {\n if (isObject(key)) {\n var data = getWeak(key);\n if (data === true) return uncaughtFrozenStore(validate(this, WEAK_MAP)).get(key);\n return data ? data[this._i] : undefined;\n }\n },\n // 23.3.3.5 WeakMap.prototype.set(key, value)\n set: function set(key, value) {\n return weak.def(validate(this, WEAK_MAP), key, value);\n }\n};\n\n// 23.3 WeakMap Objects\nvar $WeakMap = module.exports = require('./_collection')(WEAK_MAP, wrapper, methods, weak, true, true);\n\n// IE11 WeakMap frozen keys fix\nif (fails(function () { return new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7; })) {\n InternalMap = weak.getConstructor(wrapper, WEAK_MAP);\n assign(InternalMap.prototype, methods);\n meta.NEED = true;\n each(['delete', 'has', 'get', 'set'], function (key) {\n var proto = $WeakMap.prototype;\n var method = proto[key];\n redefine(proto, key, function (a, b) {\n // store frozen objects on internal weakmap shim\n if (isObject(a) && !isExtensible(a)) {\n if (!this._f) this._f = new InternalMap();\n var result = this._f[key](a, b);\n return key == 'set' ? this : result;\n // store all the rest on native weakmap\n } return method.call(this, a, b);\n });\n });\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/es6.weak-map.js\n// module id = 112\n// module chunks = 0","// 7.2.2 IsArray(argument)\nvar cof = require('./_cof');\nmodule.exports = Array.isArray || function isArray(arg) {\n return cof(arg) == 'Array';\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_is-array.js\n// module id = 113\n// module chunks = 0","'use strict';\n// 19.1.2.1 Object.assign(target, source, ...)\nvar getKeys = require('./_object-keys');\nvar gOPS = require('./_object-gops');\nvar pIE = require('./_object-pie');\nvar toObject = require('./_to-object');\nvar IObject = require('./_iobject');\nvar $assign = Object.assign;\n\n// should work with symbols and should have deterministic property order (V8 bug)\nmodule.exports = !$assign || require('./_fails')(function () {\n var A = {};\n var B = {};\n // eslint-disable-next-line no-undef\n var S = Symbol();\n var K = 'abcdefghijklmnopqrst';\n A[S] = 7;\n K.split('').forEach(function (k) { B[k] = k; });\n return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;\n}) ? function assign(target, source) { // eslint-disable-line no-unused-vars\n var T = toObject(target);\n var aLen = arguments.length;\n var index = 1;\n var getSymbols = gOPS.f;\n var isEnum = pIE.f;\n while (aLen > index) {\n var S = IObject(arguments[index++]);\n var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);\n var length = keys.length;\n var j = 0;\n var key;\n while (length > j) if (isEnum.call(S, key = keys[j++])) T[key] = S[key];\n } return T;\n} : $assign;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_object-assign.js\n// module id = 114\n// module chunks = 0","'use strict';\nvar redefineAll = require('./_redefine-all');\nvar getWeak = require('./_meta').getWeak;\nvar anObject = require('./_an-object');\nvar isObject = require('./_is-object');\nvar anInstance = require('./_an-instance');\nvar forOf = require('./_for-of');\nvar createArrayMethod = require('./_array-methods');\nvar $has = require('./_has');\nvar validate = require('./_validate-collection');\nvar arrayFind = createArrayMethod(5);\nvar arrayFindIndex = createArrayMethod(6);\nvar id = 0;\n\n// fallback for uncaught frozen keys\nvar uncaughtFrozenStore = function (that) {\n return that._l || (that._l = new UncaughtFrozenStore());\n};\nvar UncaughtFrozenStore = function () {\n this.a = [];\n};\nvar findUncaughtFrozen = function (store, key) {\n return arrayFind(store.a, function (it) {\n return it[0] === key;\n });\n};\nUncaughtFrozenStore.prototype = {\n get: function (key) {\n var entry = findUncaughtFrozen(this, key);\n if (entry) return entry[1];\n },\n has: function (key) {\n return !!findUncaughtFrozen(this, key);\n },\n set: function (key, value) {\n var entry = findUncaughtFrozen(this, key);\n if (entry) entry[1] = value;\n else this.a.push([key, value]);\n },\n 'delete': function (key) {\n var index = arrayFindIndex(this.a, function (it) {\n return it[0] === key;\n });\n if (~index) this.a.splice(index, 1);\n return !!~index;\n }\n};\n\nmodule.exports = {\n getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {\n var C = wrapper(function (that, iterable) {\n anInstance(that, C, NAME, '_i');\n that._t = NAME; // collection type\n that._i = id++; // collection id\n that._l = undefined; // leak store for uncaught frozen objects\n if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);\n });\n redefineAll(C.prototype, {\n // 23.3.3.2 WeakMap.prototype.delete(key)\n // 23.4.3.3 WeakSet.prototype.delete(value)\n 'delete': function (key) {\n if (!isObject(key)) return false;\n var data = getWeak(key);\n if (data === true) return uncaughtFrozenStore(validate(this, NAME))['delete'](key);\n return data && $has(data, this._i) && delete data[this._i];\n },\n // 23.3.3.4 WeakMap.prototype.has(key)\n // 23.4.3.4 WeakSet.prototype.has(value)\n has: function has(key) {\n if (!isObject(key)) return false;\n var data = getWeak(key);\n if (data === true) return uncaughtFrozenStore(validate(this, NAME)).has(key);\n return data && $has(data, this._i);\n }\n });\n return C;\n },\n def: function (that, key, value) {\n var data = getWeak(anObject(key), true);\n if (data === true) uncaughtFrozenStore(that).set(key, value);\n else data[that._i] = value;\n return that;\n },\n ufstore: uncaughtFrozenStore\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_collection-weak.js\n// module id = 115\n// module chunks = 0","'use strict';\nvar weak = require('./_collection-weak');\nvar validate = require('./_validate-collection');\nvar WEAK_SET = 'WeakSet';\n\n// 23.4 WeakSet Objects\nrequire('./_collection')(WEAK_SET, function (get) {\n return function WeakSet() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };\n}, {\n // 23.4.3.1 WeakSet.prototype.add(value)\n add: function add(value) {\n return weak.def(validate(this, WEAK_SET), value, true);\n }\n}, weak, false, true);\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/es6.weak-set.js\n// module id = 116\n// module chunks = 0","'use strict';\nvar LIBRARY = require('./_library');\nvar global = require('./_global');\nvar ctx = require('./_ctx');\nvar classof = require('./_classof');\nvar $export = require('./_export');\nvar isObject = require('./_is-object');\nvar aFunction = require('./_a-function');\nvar anInstance = require('./_an-instance');\nvar forOf = require('./_for-of');\nvar speciesConstructor = require('./_species-constructor');\nvar task = require('./_task').set;\nvar microtask = require('./_microtask')();\nvar newPromiseCapabilityModule = require('./_new-promise-capability');\nvar perform = require('./_perform');\nvar promiseResolve = require('./_promise-resolve');\nvar PROMISE = 'Promise';\nvar TypeError = global.TypeError;\nvar process = global.process;\nvar $Promise = global[PROMISE];\nvar isNode = classof(process) == 'process';\nvar empty = function () { /* empty */ };\nvar Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper;\nvar newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f;\n\nvar USE_NATIVE = !!function () {\n try {\n // correct subclassing with @@species support\n var promise = $Promise.resolve(1);\n var FakePromise = (promise.constructor = {})[require('./_wks')('species')] = function (exec) {\n exec(empty, empty);\n };\n // unhandled rejections tracking support, NodeJS Promise without it fails @@species test\n return (isNode || typeof PromiseRejectionEvent == 'function') && promise.then(empty) instanceof FakePromise;\n } catch (e) { /* empty */ }\n}();\n\n// helpers\nvar isThenable = function (it) {\n var then;\n return isObject(it) && typeof (then = it.then) == 'function' ? then : false;\n};\nvar notify = function (promise, isReject) {\n if (promise._n) return;\n promise._n = true;\n var chain = promise._c;\n microtask(function () {\n var value = promise._v;\n var ok = promise._s == 1;\n var i = 0;\n var run = function (reaction) {\n var handler = ok ? reaction.ok : reaction.fail;\n var resolve = reaction.resolve;\n var reject = reaction.reject;\n var domain = reaction.domain;\n var result, then, exited;\n try {\n if (handler) {\n if (!ok) {\n if (promise._h == 2) onHandleUnhandled(promise);\n promise._h = 1;\n }\n if (handler === true) result = value;\n else {\n if (domain) domain.enter();\n result = handler(value); // may throw\n if (domain) {\n domain.exit();\n exited = true;\n }\n }\n if (result === reaction.promise) {\n reject(TypeError('Promise-chain cycle'));\n } else if (then = isThenable(result)) {\n then.call(result, resolve, reject);\n } else resolve(result);\n } else reject(value);\n } catch (e) {\n if (domain && !exited) domain.exit();\n reject(e);\n }\n };\n while (chain.length > i) run(chain[i++]); // variable length - can't use forEach\n promise._c = [];\n promise._n = false;\n if (isReject && !promise._h) onUnhandled(promise);\n });\n};\nvar onUnhandled = function (promise) {\n task.call(global, function () {\n var value = promise._v;\n var unhandled = isUnhandled(promise);\n var result, handler, console;\n if (unhandled) {\n result = perform(function () {\n if (isNode) {\n process.emit('unhandledRejection', value, promise);\n } else if (handler = global.onunhandledrejection) {\n handler({ promise: promise, reason: value });\n } else if ((console = global.console) && console.error) {\n console.error('Unhandled promise rejection', value);\n }\n });\n // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should\n promise._h = isNode || isUnhandled(promise) ? 2 : 1;\n } promise._a = undefined;\n if (unhandled && result.e) throw result.v;\n });\n};\nvar isUnhandled = function (promise) {\n return promise._h !== 1 && (promise._a || promise._c).length === 0;\n};\nvar onHandleUnhandled = function (promise) {\n task.call(global, function () {\n var handler;\n if (isNode) {\n process.emit('rejectionHandled', promise);\n } else if (handler = global.onrejectionhandled) {\n handler({ promise: promise, reason: promise._v });\n }\n });\n};\nvar $reject = function (value) {\n var promise = this;\n if (promise._d) return;\n promise._d = true;\n promise = promise._w || promise; // unwrap\n promise._v = value;\n promise._s = 2;\n if (!promise._a) promise._a = promise._c.slice();\n notify(promise, true);\n};\nvar $resolve = function (value) {\n var promise = this;\n var then;\n if (promise._d) return;\n promise._d = true;\n promise = promise._w || promise; // unwrap\n try {\n if (promise === value) throw TypeError(\"Promise can't be resolved itself\");\n if (then = isThenable(value)) {\n microtask(function () {\n var wrapper = { _w: promise, _d: false }; // wrap\n try {\n then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1));\n } catch (e) {\n $reject.call(wrapper, e);\n }\n });\n } else {\n promise._v = value;\n promise._s = 1;\n notify(promise, false);\n }\n } catch (e) {\n $reject.call({ _w: promise, _d: false }, e); // wrap\n }\n};\n\n// constructor polyfill\nif (!USE_NATIVE) {\n // 25.4.3.1 Promise(executor)\n $Promise = function Promise(executor) {\n anInstance(this, $Promise, PROMISE, '_h');\n aFunction(executor);\n Internal.call(this);\n try {\n executor(ctx($resolve, this, 1), ctx($reject, this, 1));\n } catch (err) {\n $reject.call(this, err);\n }\n };\n // eslint-disable-next-line no-unused-vars\n Internal = function Promise(executor) {\n this._c = []; // <- awaiting reactions\n this._a = undefined; // <- checked in isUnhandled reactions\n this._s = 0; // <- state\n this._d = false; // <- done\n this._v = undefined; // <- value\n this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled\n this._n = false; // <- notify\n };\n Internal.prototype = require('./_redefine-all')($Promise.prototype, {\n // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)\n then: function then(onFulfilled, onRejected) {\n var reaction = newPromiseCapability(speciesConstructor(this, $Promise));\n reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;\n reaction.fail = typeof onRejected == 'function' && onRejected;\n reaction.domain = isNode ? process.domain : undefined;\n this._c.push(reaction);\n if (this._a) this._a.push(reaction);\n if (this._s) notify(this, false);\n return reaction.promise;\n },\n // 25.4.5.1 Promise.prototype.catch(onRejected)\n 'catch': function (onRejected) {\n return this.then(undefined, onRejected);\n }\n });\n OwnPromiseCapability = function () {\n var promise = new Internal();\n this.promise = promise;\n this.resolve = ctx($resolve, promise, 1);\n this.reject = ctx($reject, promise, 1);\n };\n newPromiseCapabilityModule.f = newPromiseCapability = function (C) {\n return C === $Promise || C === Wrapper\n ? new OwnPromiseCapability(C)\n : newGenericPromiseCapability(C);\n };\n}\n\n$export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise });\nrequire('./_set-to-string-tag')($Promise, PROMISE);\nrequire('./_set-species')(PROMISE);\nWrapper = require('./_core')[PROMISE];\n\n// statics\n$export($export.S + $export.F * !USE_NATIVE, PROMISE, {\n // 25.4.4.5 Promise.reject(r)\n reject: function reject(r) {\n var capability = newPromiseCapability(this);\n var $$reject = capability.reject;\n $$reject(r);\n return capability.promise;\n }\n});\n$export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, {\n // 25.4.4.6 Promise.resolve(x)\n resolve: function resolve(x) {\n return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x);\n }\n});\n$export($export.S + $export.F * !(USE_NATIVE && require('./_iter-detect')(function (iter) {\n $Promise.all(iter)['catch'](empty);\n})), PROMISE, {\n // 25.4.4.1 Promise.all(iterable)\n all: function all(iterable) {\n var C = this;\n var capability = newPromiseCapability(C);\n var resolve = capability.resolve;\n var reject = capability.reject;\n var result = perform(function () {\n var values = [];\n var index = 0;\n var remaining = 1;\n forOf(iterable, false, function (promise) {\n var $index = index++;\n var alreadyCalled = false;\n values.push(undefined);\n remaining++;\n C.resolve(promise).then(function (value) {\n if (alreadyCalled) return;\n alreadyCalled = true;\n values[$index] = value;\n --remaining || resolve(values);\n }, reject);\n });\n --remaining || resolve(values);\n });\n if (result.e) reject(result.v);\n return capability.promise;\n },\n // 25.4.4.4 Promise.race(iterable)\n race: function race(iterable) {\n var C = this;\n var capability = newPromiseCapability(C);\n var reject = capability.reject;\n var result = perform(function () {\n forOf(iterable, false, function (promise) {\n C.resolve(promise).then(capability.resolve, reject);\n });\n });\n if (result.e) reject(result.v);\n return capability.promise;\n }\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/es6.promise.js\n// module id = 117\n// module chunks = 0","'use strict';\n// 25.4.1.5 NewPromiseCapability(C)\nvar aFunction = require('./_a-function');\n\nfunction PromiseCapability(C) {\n var resolve, reject;\n this.promise = new C(function ($$resolve, $$reject) {\n if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');\n resolve = $$resolve;\n reject = $$reject;\n });\n this.resolve = aFunction(resolve);\n this.reject = aFunction(reject);\n}\n\nmodule.exports.f = function (C) {\n return new PromiseCapability(C);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_new-promise-capability.js\n// module id = 118\n// module chunks = 0","'use strict';\n// ECMAScript 6 symbols shim\nvar global = require('./_global');\nvar has = require('./_has');\nvar DESCRIPTORS = require('./_descriptors');\nvar $export = require('./_export');\nvar redefine = require('./_redefine');\nvar META = require('./_meta').KEY;\nvar $fails = require('./_fails');\nvar shared = require('./_shared');\nvar setToStringTag = require('./_set-to-string-tag');\nvar uid = require('./_uid');\nvar wks = require('./_wks');\nvar wksExt = require('./_wks-ext');\nvar wksDefine = require('./_wks-define');\nvar enumKeys = require('./_enum-keys');\nvar isArray = require('./_is-array');\nvar anObject = require('./_an-object');\nvar isObject = require('./_is-object');\nvar toIObject = require('./_to-iobject');\nvar toPrimitive = require('./_to-primitive');\nvar createDesc = require('./_property-desc');\nvar _create = require('./_object-create');\nvar gOPNExt = require('./_object-gopn-ext');\nvar $GOPD = require('./_object-gopd');\nvar $DP = require('./_object-dp');\nvar $keys = require('./_object-keys');\nvar gOPD = $GOPD.f;\nvar dP = $DP.f;\nvar gOPN = gOPNExt.f;\nvar $Symbol = global.Symbol;\nvar $JSON = global.JSON;\nvar _stringify = $JSON && $JSON.stringify;\nvar PROTOTYPE = 'prototype';\nvar HIDDEN = wks('_hidden');\nvar TO_PRIMITIVE = wks('toPrimitive');\nvar isEnum = {}.propertyIsEnumerable;\nvar SymbolRegistry = shared('symbol-registry');\nvar AllSymbols = shared('symbols');\nvar OPSymbols = shared('op-symbols');\nvar ObjectProto = Object[PROTOTYPE];\nvar USE_NATIVE = typeof $Symbol == 'function';\nvar QObject = global.QObject;\n// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173\nvar setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;\n\n// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687\nvar setSymbolDesc = DESCRIPTORS && $fails(function () {\n return _create(dP({}, 'a', {\n get: function () { return dP(this, 'a', { value: 7 }).a; }\n })).a != 7;\n}) ? function (it, key, D) {\n var protoDesc = gOPD(ObjectProto, key);\n if (protoDesc) delete ObjectProto[key];\n dP(it, key, D);\n if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc);\n} : dP;\n\nvar wrap = function (tag) {\n var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);\n sym._k = tag;\n return sym;\n};\n\nvar isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {\n return typeof it == 'symbol';\n} : function (it) {\n return it instanceof $Symbol;\n};\n\nvar $defineProperty = function defineProperty(it, key, D) {\n if (it === ObjectProto) $defineProperty(OPSymbols, key, D);\n anObject(it);\n key = toPrimitive(key, true);\n anObject(D);\n if (has(AllSymbols, key)) {\n if (!D.enumerable) {\n if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {}));\n it[HIDDEN][key] = true;\n } else {\n if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;\n D = _create(D, { enumerable: createDesc(0, false) });\n } return setSymbolDesc(it, key, D);\n } return dP(it, key, D);\n};\nvar $defineProperties = function defineProperties(it, P) {\n anObject(it);\n var keys = enumKeys(P = toIObject(P));\n var i = 0;\n var l = keys.length;\n var key;\n while (l > i) $defineProperty(it, key = keys[i++], P[key]);\n return it;\n};\nvar $create = function create(it, P) {\n return P === undefined ? _create(it) : $defineProperties(_create(it), P);\n};\nvar $propertyIsEnumerable = function propertyIsEnumerable(key) {\n var E = isEnum.call(this, key = toPrimitive(key, true));\n if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false;\n return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;\n};\nvar $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {\n it = toIObject(it);\n key = toPrimitive(key, true);\n if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return;\n var D = gOPD(it, key);\n if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;\n return D;\n};\nvar $getOwnPropertyNames = function getOwnPropertyNames(it) {\n var names = gOPN(toIObject(it));\n var result = [];\n var i = 0;\n var key;\n while (names.length > i) {\n if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);\n } return result;\n};\nvar $getOwnPropertySymbols = function getOwnPropertySymbols(it) {\n var IS_OP = it === ObjectProto;\n var names = gOPN(IS_OP ? OPSymbols : toIObject(it));\n var result = [];\n var i = 0;\n var key;\n while (names.length > i) {\n if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]);\n } return result;\n};\n\n// 19.4.1.1 Symbol([description])\nif (!USE_NATIVE) {\n $Symbol = function Symbol() {\n if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');\n var tag = uid(arguments.length > 0 ? arguments[0] : undefined);\n var $set = function (value) {\n if (this === ObjectProto) $set.call(OPSymbols, value);\n if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;\n setSymbolDesc(this, tag, createDesc(1, value));\n };\n if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set });\n return wrap(tag);\n };\n redefine($Symbol[PROTOTYPE], 'toString', function toString() {\n return this._k;\n });\n\n $GOPD.f = $getOwnPropertyDescriptor;\n $DP.f = $defineProperty;\n require('./_object-gopn').f = gOPNExt.f = $getOwnPropertyNames;\n require('./_object-pie').f = $propertyIsEnumerable;\n require('./_object-gops').f = $getOwnPropertySymbols;\n\n if (DESCRIPTORS && !require('./_library')) {\n redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);\n }\n\n wksExt.f = function (name) {\n return wrap(wks(name));\n };\n}\n\n$export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol });\n\nfor (var es6Symbols = (\n // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14\n 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'\n).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]);\n\nfor (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]);\n\n$export($export.S + $export.F * !USE_NATIVE, 'Symbol', {\n // 19.4.2.1 Symbol.for(key)\n 'for': function (key) {\n return has(SymbolRegistry, key += '')\n ? SymbolRegistry[key]\n : SymbolRegistry[key] = $Symbol(key);\n },\n // 19.4.2.5 Symbol.keyFor(sym)\n keyFor: function keyFor(sym) {\n if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!');\n for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;\n },\n useSetter: function () { setter = true; },\n useSimple: function () { setter = false; }\n});\n\n$export($export.S + $export.F * !USE_NATIVE, 'Object', {\n // 19.1.2.2 Object.create(O [, Properties])\n create: $create,\n // 19.1.2.4 Object.defineProperty(O, P, Attributes)\n defineProperty: $defineProperty,\n // 19.1.2.3 Object.defineProperties(O, Properties)\n defineProperties: $defineProperties,\n // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)\n getOwnPropertyDescriptor: $getOwnPropertyDescriptor,\n // 19.1.2.7 Object.getOwnPropertyNames(O)\n getOwnPropertyNames: $getOwnPropertyNames,\n // 19.1.2.8 Object.getOwnPropertySymbols(O)\n getOwnPropertySymbols: $getOwnPropertySymbols\n});\n\n// 24.3.2 JSON.stringify(value [, replacer [, space]])\n$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () {\n var S = $Symbol();\n // MS Edge converts symbol values to JSON as {}\n // WebKit converts symbol values to JSON as null\n // V8 throws on boxed symbols\n return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';\n})), 'JSON', {\n stringify: function stringify(it) {\n var args = [it];\n var i = 1;\n var replacer, $replacer;\n while (arguments.length > i) args.push(arguments[i++]);\n $replacer = replacer = args[1];\n if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined\n if (!isArray(replacer)) replacer = function (key, value) {\n if (typeof $replacer == 'function') value = $replacer.call(this, key, value);\n if (!isSymbol(value)) return value;\n };\n args[1] = replacer;\n return _stringify.apply($JSON, args);\n }\n});\n\n// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)\n$Symbol[PROTOTYPE][TO_PRIMITIVE] || require('./_hide')($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);\n// 19.4.3.5 Symbol.prototype[@@toStringTag]\nsetToStringTag($Symbol, 'Symbol');\n// 20.2.1.9 Math[@@toStringTag]\nsetToStringTag(Math, 'Math', true);\n// 24.3.3 JSON[@@toStringTag]\nsetToStringTag(global.JSON, 'JSON', true);\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/es6.symbol.js\n// module id = 119\n// module chunks = 0","exports.f = require('./_wks');\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_wks-ext.js\n// module id = 120\n// module chunks = 0","// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window\nvar toIObject = require('./_to-iobject');\nvar gOPN = require('./_object-gopn').f;\nvar toString = {}.toString;\n\nvar windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames\n ? Object.getOwnPropertyNames(window) : [];\n\nvar getWindowNames = function (it) {\n try {\n return gOPN(it);\n } catch (e) {\n return windowNames.slice();\n }\n};\n\nmodule.exports.f = function getOwnPropertyNames(it) {\n return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_object-gopn-ext.js\n// module id = 121\n// module chunks = 0","// 19.1.2.5 Object.freeze(O)\nvar isObject = require('./_is-object');\nvar meta = require('./_meta').onFreeze;\n\nrequire('./_object-sap')('freeze', function ($freeze) {\n return function freeze(it) {\n return $freeze && isObject(it) ? $freeze(meta(it)) : it;\n };\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/es6.object.freeze.js\n// module id = 122\n// module chunks = 0","// 19.1.2.17 Object.seal(O)\nvar isObject = require('./_is-object');\nvar meta = require('./_meta').onFreeze;\n\nrequire('./_object-sap')('seal', function ($seal) {\n return function seal(it) {\n return $seal && isObject(it) ? $seal(meta(it)) : it;\n };\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/es6.object.seal.js\n// module id = 123\n// module chunks = 0","// 19.1.2.15 Object.preventExtensions(O)\nvar isObject = require('./_is-object');\nvar meta = require('./_meta').onFreeze;\n\nrequire('./_object-sap')('preventExtensions', function ($preventExtensions) {\n return function preventExtensions(it) {\n return $preventExtensions && isObject(it) ? $preventExtensions(meta(it)) : it;\n };\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/es6.object.prevent-extensions.js\n// module id = 124\n// module chunks = 0","// 19.1.2.12 Object.isFrozen(O)\nvar isObject = require('./_is-object');\n\nrequire('./_object-sap')('isFrozen', function ($isFrozen) {\n return function isFrozen(it) {\n return isObject(it) ? $isFrozen ? $isFrozen(it) : false : true;\n };\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/es6.object.is-frozen.js\n// module id = 125\n// module chunks = 0","// 19.1.2.13 Object.isSealed(O)\nvar isObject = require('./_is-object');\n\nrequire('./_object-sap')('isSealed', function ($isSealed) {\n return function isSealed(it) {\n return isObject(it) ? $isSealed ? $isSealed(it) : false : true;\n };\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/es6.object.is-sealed.js\n// module id = 126\n// module chunks = 0","// 19.1.2.11 Object.isExtensible(O)\nvar isObject = require('./_is-object');\n\nrequire('./_object-sap')('isExtensible', function ($isExtensible) {\n return function isExtensible(it) {\n return isObject(it) ? $isExtensible ? $isExtensible(it) : true : false;\n };\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/es6.object.is-extensible.js\n// module id = 127\n// module chunks = 0","// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)\nvar toIObject = require('./_to-iobject');\nvar $getOwnPropertyDescriptor = require('./_object-gopd').f;\n\nrequire('./_object-sap')('getOwnPropertyDescriptor', function () {\n return function getOwnPropertyDescriptor(it, key) {\n return $getOwnPropertyDescriptor(toIObject(it), key);\n };\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/es6.object.get-own-property-descriptor.js\n// module id = 128\n// module chunks = 0","// 19.1.2.9 Object.getPrototypeOf(O)\nvar toObject = require('./_to-object');\nvar $getPrototypeOf = require('./_object-gpo');\n\nrequire('./_object-sap')('getPrototypeOf', function () {\n return function getPrototypeOf(it) {\n return $getPrototypeOf(toObject(it));\n };\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/es6.object.get-prototype-of.js\n// module id = 129\n// module chunks = 0","// 19.1.2.14 Object.keys(O)\nvar toObject = require('./_to-object');\nvar $keys = require('./_object-keys');\n\nrequire('./_object-sap')('keys', function () {\n return function keys(it) {\n return $keys(toObject(it));\n };\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/es6.object.keys.js\n// module id = 130\n// module chunks = 0","// 19.1.2.7 Object.getOwnPropertyNames(O)\nrequire('./_object-sap')('getOwnPropertyNames', function () {\n return require('./_object-gopn-ext').f;\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/es6.object.get-own-property-names.js\n// module id = 131\n// module chunks = 0","// 19.1.3.1 Object.assign(target, source)\nvar $export = require('./_export');\n\n$export($export.S + $export.F, 'Object', { assign: require('./_object-assign') });\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/es6.object.assign.js\n// module id = 132\n// module chunks = 0","// 19.1.3.10 Object.is(value1, value2)\nvar $export = require('./_export');\n$export($export.S, 'Object', { is: require('./_same-value') });\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/es6.object.is.js\n// module id = 133\n// module chunks = 0","// 19.1.3.19 Object.setPrototypeOf(O, proto)\nvar $export = require('./_export');\n$export($export.S, 'Object', { setPrototypeOf: require('./_set-proto').set });\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/es6.object.set-prototype-of.js\n// module id = 134\n// module chunks = 0","var dP = require('./_object-dp').f;\nvar FProto = Function.prototype;\nvar nameRE = /^\\s*function ([^ (]*)/;\nvar NAME = 'name';\n\n// 19.2.4.2 name\nNAME in FProto || require('./_descriptors') && dP(FProto, NAME, {\n configurable: true,\n get: function () {\n try {\n return ('' + this).match(nameRE)[1];\n } catch (e) {\n return '';\n }\n }\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/es6.function.name.js\n// module id = 135\n// module chunks = 0","var $export = require('./_export');\nvar toIObject = require('./_to-iobject');\nvar toLength = require('./_to-length');\n\n$export($export.S, 'String', {\n // 21.1.2.4 String.raw(callSite, ...substitutions)\n raw: function raw(callSite) {\n var tpl = toIObject(callSite.raw);\n var len = toLength(tpl.length);\n var aLen = arguments.length;\n var res = [];\n var i = 0;\n while (len > i) {\n res.push(String(tpl[i++]));\n if (i < aLen) res.push(String(arguments[i]));\n } return res.join('');\n }\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/es6.string.raw.js\n// module id = 136\n// module chunks = 0","var $export = require('./_export');\nvar toAbsoluteIndex = require('./_to-absolute-index');\nvar fromCharCode = String.fromCharCode;\nvar $fromCodePoint = String.fromCodePoint;\n\n// length should be 1, old FF problem\n$export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', {\n // 21.1.2.2 String.fromCodePoint(...codePoints)\n fromCodePoint: function fromCodePoint(x) { // eslint-disable-line no-unused-vars\n var res = [];\n var aLen = arguments.length;\n var i = 0;\n var code;\n while (aLen > i) {\n code = +arguments[i++];\n if (toAbsoluteIndex(code, 0x10ffff) !== code) throw RangeError(code + ' is not a valid code point');\n res.push(code < 0x10000\n ? fromCharCode(code)\n : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00)\n );\n } return res.join('');\n }\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/es6.string.from-code-point.js\n// module id = 137\n// module chunks = 0","'use strict';\nvar $export = require('./_export');\nvar $at = require('./_string-at')(false);\n$export($export.P, 'String', {\n // 21.1.3.3 String.prototype.codePointAt(pos)\n codePointAt: function codePointAt(pos) {\n return $at(this, pos);\n }\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/es6.string.code-point-at.js\n// module id = 138\n// module chunks = 0","var $export = require('./_export');\n\n$export($export.P, 'String', {\n // 21.1.3.13 String.prototype.repeat(count)\n repeat: require('./_string-repeat')\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/es6.string.repeat.js\n// module id = 139\n// module chunks = 0","'use strict';\nvar toInteger = require('./_to-integer');\nvar defined = require('./_defined');\n\nmodule.exports = function repeat(count) {\n var str = String(defined(this));\n var res = '';\n var n = toInteger(count);\n if (n < 0 || n == Infinity) throw RangeError(\"Count can't be negative\");\n for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) res += str;\n return res;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_string-repeat.js\n// module id = 140\n// module chunks = 0","// 21.1.3.18 String.prototype.startsWith(searchString [, position ])\n'use strict';\nvar $export = require('./_export');\nvar toLength = require('./_to-length');\nvar context = require('./_string-context');\nvar STARTS_WITH = 'startsWith';\nvar $startsWith = ''[STARTS_WITH];\n\n$export($export.P + $export.F * require('./_fails-is-regexp')(STARTS_WITH), 'String', {\n startsWith: function startsWith(searchString /* , position = 0 */) {\n var that = context(this, searchString, STARTS_WITH);\n var index = toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length));\n var search = String(searchString);\n return $startsWith\n ? $startsWith.call(that, search, index)\n : that.slice(index, index + search.length) === search;\n }\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/es6.string.starts-with.js\n// module id = 141\n// module chunks = 0","// 7.2.8 IsRegExp(argument)\nvar isObject = require('./_is-object');\nvar cof = require('./_cof');\nvar MATCH = require('./_wks')('match');\nmodule.exports = function (it) {\n var isRegExp;\n return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp');\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_is-regexp.js\n// module id = 142\n// module chunks = 0","// 21.1.3.6 String.prototype.endsWith(searchString [, endPosition])\n'use strict';\nvar $export = require('./_export');\nvar toLength = require('./_to-length');\nvar context = require('./_string-context');\nvar ENDS_WITH = 'endsWith';\nvar $endsWith = ''[ENDS_WITH];\n\n$export($export.P + $export.F * require('./_fails-is-regexp')(ENDS_WITH), 'String', {\n endsWith: function endsWith(searchString /* , endPosition = @length */) {\n var that = context(this, searchString, ENDS_WITH);\n var endPosition = arguments.length > 1 ? arguments[1] : undefined;\n var len = toLength(that.length);\n var end = endPosition === undefined ? len : Math.min(toLength(endPosition), len);\n var search = String(searchString);\n return $endsWith\n ? $endsWith.call(that, search, end)\n : that.slice(end - search.length, end) === search;\n }\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/es6.string.ends-with.js\n// module id = 143\n// module chunks = 0","// 21.1.3.7 String.prototype.includes(searchString, position = 0)\n'use strict';\nvar $export = require('./_export');\nvar context = require('./_string-context');\nvar INCLUDES = 'includes';\n\n$export($export.P + $export.F * require('./_fails-is-regexp')(INCLUDES), 'String', {\n includes: function includes(searchString /* , position = 0 */) {\n return !!~context(this, searchString, INCLUDES)\n .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/es6.string.includes.js\n// module id = 144\n// module chunks = 0","// 21.2.5.3 get RegExp.prototype.flags()\nif (require('./_descriptors') && /./g.flags != 'g') require('./_object-dp').f(RegExp.prototype, 'flags', {\n configurable: true,\n get: require('./_flags')\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/es6.regexp.flags.js\n// module id = 145\n// module chunks = 0","// @@match logic\nrequire('./_fix-re-wks')('match', 1, function (defined, MATCH, $match) {\n // 21.1.3.11 String.prototype.match(regexp)\n return [function match(regexp) {\n 'use strict';\n var O = defined(this);\n var fn = regexp == undefined ? undefined : regexp[MATCH];\n return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));\n }, $match];\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/es6.regexp.match.js\n// module id = 146\n// module chunks = 0","// @@replace logic\nrequire('./_fix-re-wks')('replace', 2, function (defined, REPLACE, $replace) {\n // 21.1.3.14 String.prototype.replace(searchValue, replaceValue)\n return [function replace(searchValue, replaceValue) {\n 'use strict';\n var O = defined(this);\n var fn = searchValue == undefined ? undefined : searchValue[REPLACE];\n return fn !== undefined\n ? fn.call(searchValue, O, replaceValue)\n : $replace.call(String(O), searchValue, replaceValue);\n }, $replace];\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/es6.regexp.replace.js\n// module id = 147\n// module chunks = 0","// @@split logic\nrequire('./_fix-re-wks')('split', 2, function (defined, SPLIT, $split) {\n 'use strict';\n var isRegExp = require('./_is-regexp');\n var _split = $split;\n var $push = [].push;\n var $SPLIT = 'split';\n var LENGTH = 'length';\n var LAST_INDEX = 'lastIndex';\n if (\n 'abbc'[$SPLIT](/(b)*/)[1] == 'c' ||\n 'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 ||\n 'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 ||\n '.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 ||\n '.'[$SPLIT](/()()/)[LENGTH] > 1 ||\n ''[$SPLIT](/.?/)[LENGTH]\n ) {\n var NPCG = /()??/.exec('')[1] === undefined; // nonparticipating capturing group\n // based on es5-shim implementation, need to rework it\n $split = function (separator, limit) {\n var string = String(this);\n if (separator === undefined && limit === 0) return [];\n // If `separator` is not a regex, use native split\n if (!isRegExp(separator)) return _split.call(string, separator, limit);\n var output = [];\n var flags = (separator.ignoreCase ? 'i' : '') +\n (separator.multiline ? 'm' : '') +\n (separator.unicode ? 'u' : '') +\n (separator.sticky ? 'y' : '');\n var lastLastIndex = 0;\n var splitLimit = limit === undefined ? 4294967295 : limit >>> 0;\n // Make `global` and avoid `lastIndex` issues by working with a copy\n var separatorCopy = new RegExp(separator.source, flags + 'g');\n var separator2, match, lastIndex, lastLength, i;\n // Doesn't need flags gy, but they don't hurt\n if (!NPCG) separator2 = new RegExp('^' + separatorCopy.source + '$(?!\\\\s)', flags);\n while (match = separatorCopy.exec(string)) {\n // `separatorCopy.lastIndex` is not reliable cross-browser\n lastIndex = match.index + match[0][LENGTH];\n if (lastIndex > lastLastIndex) {\n output.push(string.slice(lastLastIndex, match.index));\n // Fix browsers whose `exec` methods don't consistently return `undefined` for NPCG\n // eslint-disable-next-line no-loop-func\n if (!NPCG && match[LENGTH] > 1) match[0].replace(separator2, function () {\n for (i = 1; i < arguments[LENGTH] - 2; i++) if (arguments[i] === undefined) match[i] = undefined;\n });\n if (match[LENGTH] > 1 && match.index < string[LENGTH]) $push.apply(output, match.slice(1));\n lastLength = match[0][LENGTH];\n lastLastIndex = lastIndex;\n if (output[LENGTH] >= splitLimit) break;\n }\n if (separatorCopy[LAST_INDEX] === match.index) separatorCopy[LAST_INDEX]++; // Avoid an infinite loop\n }\n if (lastLastIndex === string[LENGTH]) {\n if (lastLength || !separatorCopy.test('')) output.push('');\n } else output.push(string.slice(lastLastIndex));\n return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output;\n };\n // Chakra, V8\n } else if ('0'[$SPLIT](undefined, 0)[LENGTH]) {\n $split = function (separator, limit) {\n return separator === undefined && limit === 0 ? [] : _split.call(this, separator, limit);\n };\n }\n // 21.1.3.17 String.prototype.split(separator, limit)\n return [function split(separator, limit) {\n var O = defined(this);\n var fn = separator == undefined ? undefined : separator[SPLIT];\n return fn !== undefined ? fn.call(separator, O, limit) : $split.call(String(O), separator, limit);\n }, $split];\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/es6.regexp.split.js\n// module id = 148\n// module chunks = 0","// @@search logic\nrequire('./_fix-re-wks')('search', 1, function (defined, SEARCH, $search) {\n // 21.1.3.15 String.prototype.search(regexp)\n return [function search(regexp) {\n 'use strict';\n var O = defined(this);\n var fn = regexp == undefined ? undefined : regexp[SEARCH];\n return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O));\n }, $search];\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/es6.regexp.search.js\n// module id = 149\n// module chunks = 0","'use strict';\nvar ctx = require('./_ctx');\nvar $export = require('./_export');\nvar toObject = require('./_to-object');\nvar call = require('./_iter-call');\nvar isArrayIter = require('./_is-array-iter');\nvar toLength = require('./_to-length');\nvar createProperty = require('./_create-property');\nvar getIterFn = require('./core.get-iterator-method');\n\n$export($export.S + $export.F * !require('./_iter-detect')(function (iter) { Array.from(iter); }), 'Array', {\n // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)\n from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {\n var O = toObject(arrayLike);\n var C = typeof this == 'function' ? this : Array;\n var aLen = arguments.length;\n var mapfn = aLen > 1 ? arguments[1] : undefined;\n var mapping = mapfn !== undefined;\n var index = 0;\n var iterFn = getIterFn(O);\n var length, result, step, iterator;\n if (mapping) mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2);\n // if object isn't iterable or it's array with default iterator - use simple case\n if (iterFn != undefined && !(C == Array && isArrayIter(iterFn))) {\n for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) {\n createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value);\n }\n } else {\n length = toLength(O.length);\n for (result = new C(length); length > index; index++) {\n createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]);\n }\n }\n result.length = index;\n return result;\n }\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/es6.array.from.js\n// module id = 150\n// module chunks = 0","'use strict';\nvar $export = require('./_export');\nvar createProperty = require('./_create-property');\n\n// WebKit Array.of isn't generic\n$export($export.S + $export.F * require('./_fails')(function () {\n function F() { /* empty */ }\n return !(Array.of.call(F) instanceof F);\n}), 'Array', {\n // 22.1.2.3 Array.of( ...items)\n of: function of(/* ...args */) {\n var index = 0;\n var aLen = arguments.length;\n var result = new (typeof this == 'function' ? this : Array)(aLen);\n while (aLen > index) createProperty(result, index, arguments[index++]);\n result.length = aLen;\n return result;\n }\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/es6.array.of.js\n// module id = 151\n// module chunks = 0","// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length)\nvar $export = require('./_export');\n\n$export($export.P, 'Array', { copyWithin: require('./_array-copy-within') });\n\nrequire('./_add-to-unscopables')('copyWithin');\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/es6.array.copy-within.js\n// module id = 152\n// module chunks = 0","'use strict';\n// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined)\nvar $export = require('./_export');\nvar $find = require('./_array-methods')(5);\nvar KEY = 'find';\nvar forced = true;\n// Shouldn't skip holes\nif (KEY in []) Array(1)[KEY](function () { forced = false; });\n$export($export.P + $export.F * forced, 'Array', {\n find: function find(callbackfn /* , that = undefined */) {\n return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\nrequire('./_add-to-unscopables')(KEY);\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/es6.array.find.js\n// module id = 153\n// module chunks = 0","'use strict';\n// 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined)\nvar $export = require('./_export');\nvar $find = require('./_array-methods')(6);\nvar KEY = 'findIndex';\nvar forced = true;\n// Shouldn't skip holes\nif (KEY in []) Array(1)[KEY](function () { forced = false; });\n$export($export.P + $export.F * forced, 'Array', {\n findIndex: function findIndex(callbackfn /* , that = undefined */) {\n return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\nrequire('./_add-to-unscopables')(KEY);\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/es6.array.find-index.js\n// module id = 154\n// module chunks = 0","// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)\nvar $export = require('./_export');\n\n$export($export.P, 'Array', { fill: require('./_array-fill') });\n\nrequire('./_add-to-unscopables')('fill');\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/es6.array.fill.js\n// module id = 155\n// module chunks = 0","// 20.1.2.2 Number.isFinite(number)\nvar $export = require('./_export');\nvar _isFinite = require('./_global').isFinite;\n\n$export($export.S, 'Number', {\n isFinite: function isFinite(it) {\n return typeof it == 'number' && _isFinite(it);\n }\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/es6.number.is-finite.js\n// module id = 156\n// module chunks = 0","// 20.1.2.3 Number.isInteger(number)\nvar $export = require('./_export');\n\n$export($export.S, 'Number', { isInteger: require('./_is-integer') });\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/es6.number.is-integer.js\n// module id = 157\n// module chunks = 0","// 20.1.2.3 Number.isInteger(number)\nvar isObject = require('./_is-object');\nvar floor = Math.floor;\nmodule.exports = function isInteger(it) {\n return !isObject(it) && isFinite(it) && floor(it) === it;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_is-integer.js\n// module id = 158\n// module chunks = 0","// 20.1.2.5 Number.isSafeInteger(number)\nvar $export = require('./_export');\nvar isInteger = require('./_is-integer');\nvar abs = Math.abs;\n\n$export($export.S, 'Number', {\n isSafeInteger: function isSafeInteger(number) {\n return isInteger(number) && abs(number) <= 0x1fffffffffffff;\n }\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/es6.number.is-safe-integer.js\n// module id = 159\n// module chunks = 0","// 20.1.2.4 Number.isNaN(number)\nvar $export = require('./_export');\n\n$export($export.S, 'Number', {\n isNaN: function isNaN(number) {\n // eslint-disable-next-line no-self-compare\n return number != number;\n }\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/es6.number.is-nan.js\n// module id = 160\n// module chunks = 0","// 20.1.2.1 Number.EPSILON\nvar $export = require('./_export');\n\n$export($export.S, 'Number', { EPSILON: Math.pow(2, -52) });\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/es6.number.epsilon.js\n// module id = 161\n// module chunks = 0","// 20.1.2.10 Number.MIN_SAFE_INTEGER\nvar $export = require('./_export');\n\n$export($export.S, 'Number', { MIN_SAFE_INTEGER: -0x1fffffffffffff });\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/es6.number.min-safe-integer.js\n// module id = 162\n// module chunks = 0","// 20.1.2.6 Number.MAX_SAFE_INTEGER\nvar $export = require('./_export');\n\n$export($export.S, 'Number', { MAX_SAFE_INTEGER: 0x1fffffffffffff });\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/es6.number.max-safe-integer.js\n// module id = 163\n// module chunks = 0","'use strict';\n// https://github.com/tc39/Array.prototype.includes\nvar $export = require('./_export');\nvar $includes = require('./_array-includes')(true);\n\n$export($export.P, 'Array', {\n includes: function includes(el /* , fromIndex = 0 */) {\n return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n\nrequire('./_add-to-unscopables')('includes');\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/es7.array.includes.js\n// module id = 164\n// module chunks = 0","// https://github.com/tc39/proposal-object-values-entries\nvar $export = require('./_export');\nvar $values = require('./_object-to-array')(false);\n\n$export($export.S, 'Object', {\n values: function values(it) {\n return $values(it);\n }\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/es7.object.values.js\n// module id = 165\n// module chunks = 0","var getKeys = require('./_object-keys');\nvar toIObject = require('./_to-iobject');\nvar isEnum = require('./_object-pie').f;\nmodule.exports = function (isEntries) {\n return function (it) {\n var O = toIObject(it);\n var keys = getKeys(O);\n var length = keys.length;\n var i = 0;\n var result = [];\n var key;\n while (length > i) if (isEnum.call(O, key = keys[i++])) {\n result.push(isEntries ? [key, O[key]] : O[key]);\n } return result;\n };\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_object-to-array.js\n// module id = 166\n// module chunks = 0","// https://github.com/tc39/proposal-object-values-entries\nvar $export = require('./_export');\nvar $entries = require('./_object-to-array')(true);\n\n$export($export.S, 'Object', {\n entries: function entries(it) {\n return $entries(it);\n }\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/es7.object.entries.js\n// module id = 167\n// module chunks = 0","// https://github.com/tc39/proposal-object-getownpropertydescriptors\nvar $export = require('./_export');\nvar ownKeys = require('./_own-keys');\nvar toIObject = require('./_to-iobject');\nvar gOPD = require('./_object-gopd');\nvar createProperty = require('./_create-property');\n\n$export($export.S, 'Object', {\n getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) {\n var O = toIObject(object);\n var getDesc = gOPD.f;\n var keys = ownKeys(O);\n var result = {};\n var i = 0;\n var key, desc;\n while (keys.length > i) {\n desc = getDesc(O, key = keys[i++]);\n if (desc !== undefined) createProperty(result, key, desc);\n }\n return result;\n }\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/es7.object.get-own-property-descriptors.js\n// module id = 168\n// module chunks = 0","'use strict';\n// https://github.com/tc39/proposal-string-pad-start-end\nvar $export = require('./_export');\nvar $pad = require('./_string-pad');\nvar userAgent = require('./_user-agent');\n\n// https://github.com/zloirock/core-js/issues/280\n$export($export.P + $export.F * /Version\\/10\\.\\d+(\\.\\d+)? Safari\\//.test(userAgent), 'String', {\n padStart: function padStart(maxLength /* , fillString = ' ' */) {\n return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true);\n }\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/es7.string.pad-start.js\n// module id = 169\n// module chunks = 0","// https://github.com/tc39/proposal-string-pad-start-end\nvar toLength = require('./_to-length');\nvar repeat = require('./_string-repeat');\nvar defined = require('./_defined');\n\nmodule.exports = function (that, maxLength, fillString, left) {\n var S = String(defined(that));\n var stringLength = S.length;\n var fillStr = fillString === undefined ? ' ' : String(fillString);\n var intMaxLength = toLength(maxLength);\n if (intMaxLength <= stringLength || fillStr == '') return S;\n var fillLen = intMaxLength - stringLength;\n var stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length));\n if (stringFiller.length > fillLen) stringFiller = stringFiller.slice(0, fillLen);\n return left ? stringFiller + S : S + stringFiller;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_string-pad.js\n// module id = 170\n// module chunks = 0","var global = require('./_global');\nvar navigator = global.navigator;\n\nmodule.exports = navigator && navigator.userAgent || '';\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_user-agent.js\n// module id = 171\n// module chunks = 0","'use strict';\n// https://github.com/tc39/proposal-string-pad-start-end\nvar $export = require('./_export');\nvar $pad = require('./_string-pad');\nvar userAgent = require('./_user-agent');\n\n// https://github.com/zloirock/core-js/issues/280\n$export($export.P + $export.F * /Version\\/10\\.\\d+(\\.\\d+)? Safari\\//.test(userAgent), 'String', {\n padEnd: function padEnd(maxLength /* , fillString = ' ' */) {\n return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false);\n }\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/es7.string.pad-end.js\n// module id = 172\n// module chunks = 0","var $export = require('./_export');\nvar $task = require('./_task');\n$export($export.G + $export.B, {\n setImmediate: $task.set,\n clearImmediate: $task.clear\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/web.immediate.js\n// module id = 173\n// module chunks = 0","var $iterators = require('./es6.array.iterator');\nvar getKeys = require('./_object-keys');\nvar redefine = require('./_redefine');\nvar global = require('./_global');\nvar hide = require('./_hide');\nvar Iterators = require('./_iterators');\nvar wks = require('./_wks');\nvar ITERATOR = wks('iterator');\nvar TO_STRING_TAG = wks('toStringTag');\nvar ArrayValues = Iterators.Array;\n\nvar DOMIterables = {\n CSSRuleList: true, // TODO: Not spec compliant, should be false.\n CSSStyleDeclaration: false,\n CSSValueList: false,\n ClientRectList: false,\n DOMRectList: false,\n DOMStringList: false,\n DOMTokenList: true,\n DataTransferItemList: false,\n FileList: false,\n HTMLAllCollection: false,\n HTMLCollection: false,\n HTMLFormElement: false,\n HTMLSelectElement: false,\n MediaList: true, // TODO: Not spec compliant, should be false.\n MimeTypeArray: false,\n NamedNodeMap: false,\n NodeList: true,\n PaintRequestList: false,\n Plugin: false,\n PluginArray: false,\n SVGLengthList: false,\n SVGNumberList: false,\n SVGPathSegList: false,\n SVGPointList: false,\n SVGStringList: false,\n SVGTransformList: false,\n SourceBufferList: false,\n StyleSheetList: true, // TODO: Not spec compliant, should be false.\n TextTrackCueList: false,\n TextTrackList: false,\n TouchList: false\n};\n\nfor (var collections = getKeys(DOMIterables), i = 0; i < collections.length; i++) {\n var NAME = collections[i];\n var explicit = DOMIterables[NAME];\n var Collection = global[NAME];\n var proto = Collection && Collection.prototype;\n var key;\n if (proto) {\n if (!proto[ITERATOR]) hide(proto, ITERATOR, ArrayValues);\n if (!proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);\n Iterators[NAME] = ArrayValues;\n if (explicit) for (key in $iterators) if (!proto[key]) redefine(proto, key, $iterators[key], true);\n }\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/web.dom.iterable.js\n// module id = 174\n// module chunks = 0","const privatePool = new WeakMap();\n\n/**\n * Calculates indexes of columns to render OR columns that are visible.\n * To redo the calculation, you need to create a new calculator.\n *\n * @class ViewportColumnsCalculator\n */\nclass ViewportColumnsCalculator {\n /**\n * Default column width\n *\n * @type {Number}\n */\n static get DEFAULT_WIDTH() {\n return 50;\n }\n\n /**\n * @param {Number} viewportWidth Width of the viewport\n * @param {Number} scrollOffset Current horizontal scroll position of the viewport\n * @param {Number} totalColumns Total number of rows\n * @param {Function} columnWidthFn Function that returns the width of the column at a given index (in px)\n * @param {Function} overrideFn Function that changes calculated this.startRow, this.endRow (used by MergeCells plugin)\n * @param {Boolean} onlyFullyVisible if `true`, only startRow and endRow will be indexes of rows that are fully in viewport\n * @param {Boolean} stretchH\n * @param {Function} [stretchingColumnWidthFn] Function that returns the new width of the stretched column.\n */\n constructor(viewportWidth, scrollOffset, totalColumns, columnWidthFn, overrideFn, onlyFullyVisible, stretchH,\n stretchingColumnWidthFn = (width) => width) {\n privatePool.set(this, {\n viewportWidth,\n scrollOffset,\n totalColumns,\n columnWidthFn,\n overrideFn,\n onlyFullyVisible,\n stretchingColumnWidthFn,\n });\n\n /**\n * Number of rendered/visible columns\n *\n * @type {Number}\n */\n this.count = 0;\n\n /**\n * Index of the first rendered/visible column (can be overwritten using overrideFn)\n *\n * @type {Number|null}\n */\n this.startColumn = null;\n\n /**\n * Index of the last rendered/visible column (can be overwritten using overrideFn)\n *\n * @type {null}\n */\n this.endColumn = null;\n\n /**\n * Position of the first rendered/visible column (in px)\n *\n * @type {Number|null}\n */\n this.startPosition = null;\n\n this.stretchAllRatio = 0;\n this.stretchLastWidth = 0;\n this.stretch = stretchH;\n this.totalTargetWidth = 0;\n this.needVerifyLastColumnWidth = true;\n this.stretchAllColumnsWidth = [];\n\n this.calculate();\n }\n\n /**\n * Calculates viewport\n */\n calculate() {\n let sum = 0;\n let needReverse = true;\n let startPositions = [];\n let columnWidth;\n\n let priv = privatePool.get(this);\n let onlyFullyVisible = priv.onlyFullyVisible;\n let overrideFn = priv.overrideFn;\n let scrollOffset = priv.scrollOffset;\n let totalColumns = priv.totalColumns;\n let viewportWidth = priv.viewportWidth;\n\n for (let i = 0; i < totalColumns; i++) {\n columnWidth = this._getColumnWidth(i);\n\n if (sum <= scrollOffset && !onlyFullyVisible) {\n this.startColumn = i;\n }\n\n // +1 pixel for row header width compensation for horizontal scroll > 0\n let compensatedViewportWidth = scrollOffset > 0 ? viewportWidth + 1 : viewportWidth;\n\n if (sum >= scrollOffset && sum + columnWidth <= scrollOffset + compensatedViewportWidth) {\n if (this.startColumn == null) {\n this.startColumn = i;\n }\n this.endColumn = i;\n }\n startPositions.push(sum);\n sum += columnWidth;\n\n if (!onlyFullyVisible) {\n this.endColumn = i;\n }\n if (sum >= scrollOffset + viewportWidth) {\n needReverse = false;\n break;\n }\n }\n\n if (this.endColumn === totalColumns - 1 && needReverse) {\n this.startColumn = this.endColumn;\n\n while (this.startColumn > 0) {\n let viewportSum = startPositions[this.endColumn] + columnWidth - startPositions[this.startColumn - 1];\n\n if (viewportSum <= viewportWidth || !onlyFullyVisible) {\n this.startColumn--;\n }\n if (viewportSum > viewportWidth) {\n break;\n }\n }\n }\n\n if (this.startColumn !== null && overrideFn) {\n overrideFn(this);\n }\n this.startPosition = startPositions[this.startColumn];\n\n if (this.startPosition == void 0) {\n this.startPosition = null;\n }\n if (this.startColumn !== null) {\n this.count = this.endColumn - this.startColumn + 1;\n }\n }\n\n /**\n * Recalculate columns stretching.\n *\n * @param {Number} totalWidth\n */\n refreshStretching(totalWidth) {\n if (this.stretch === 'none') {\n return;\n }\n this.totalTargetWidth = totalWidth;\n\n let priv = privatePool.get(this);\n let totalColumns = priv.totalColumns;\n let sumAll = 0;\n\n for (let i = 0; i < totalColumns; i++) {\n let columnWidth = this._getColumnWidth(i);\n let permanentColumnWidth = priv.stretchingColumnWidthFn(void 0, i);\n\n if (typeof permanentColumnWidth === 'number') {\n totalWidth -= permanentColumnWidth;\n } else {\n sumAll += columnWidth;\n }\n }\n let remainingSize = totalWidth - sumAll;\n\n if (this.stretch === 'all' && remainingSize > 0) {\n this.stretchAllRatio = totalWidth / sumAll;\n this.stretchAllColumnsWidth = [];\n this.needVerifyLastColumnWidth = true;\n\n } else if (this.stretch === 'last' && totalWidth !== Infinity) {\n let columnWidth = this._getColumnWidth(totalColumns - 1);\n let lastColumnWidth = remainingSize + columnWidth;\n\n this.stretchLastWidth = lastColumnWidth >= 0 ? lastColumnWidth : columnWidth;\n }\n }\n\n /**\n * Get stretched column width based on stretchH (all or last) setting passed in handsontable instance.\n *\n * @param {Number} column\n * @param {Number} baseWidth\n * @returns {Number|null}\n */\n getStretchedColumnWidth(column, baseWidth) {\n let result = null;\n\n if (this.stretch === 'all' && this.stretchAllRatio !== 0) {\n result = this._getStretchedAllColumnWidth(column, baseWidth);\n\n } else if (this.stretch === 'last' && this.stretchLastWidth !== 0) {\n result = this._getStretchedLastColumnWidth(column);\n }\n\n return result;\n }\n\n /**\n * @param {Number} column\n * @param {Number} baseWidth\n * @returns {Number}\n * @private\n */\n _getStretchedAllColumnWidth(column, baseWidth) {\n let sumRatioWidth = 0;\n let priv = privatePool.get(this);\n let totalColumns = priv.totalColumns;\n\n if (!this.stretchAllColumnsWidth[column]) {\n let stretchedWidth = Math.round(baseWidth * this.stretchAllRatio);\n let newStretchedWidth = priv.stretchingColumnWidthFn(stretchedWidth, column);\n\n if (newStretchedWidth === void 0) {\n this.stretchAllColumnsWidth[column] = stretchedWidth;\n } else {\n this.stretchAllColumnsWidth[column] = isNaN(newStretchedWidth) ? this._getColumnWidth(column) : newStretchedWidth;\n }\n }\n\n if (this.stretchAllColumnsWidth.length === totalColumns && this.needVerifyLastColumnWidth) {\n this.needVerifyLastColumnWidth = false;\n\n for (let i = 0; i < this.stretchAllColumnsWidth.length; i++) {\n sumRatioWidth += this.stretchAllColumnsWidth[i];\n }\n if (sumRatioWidth !== this.totalTargetWidth) {\n this.stretchAllColumnsWidth[this.stretchAllColumnsWidth.length - 1] += this.totalTargetWidth - sumRatioWidth;\n }\n }\n\n return this.stretchAllColumnsWidth[column];\n }\n\n /**\n * @param {Number} column\n * @returns {Number|null}\n * @private\n */\n _getStretchedLastColumnWidth(column) {\n let priv = privatePool.get(this);\n let totalColumns = priv.totalColumns;\n\n if (column === totalColumns - 1) {\n return this.stretchLastWidth;\n }\n\n return null;\n }\n\n /**\n * @param {Number} column Column index.\n * @returns {Number}\n * @private\n */\n _getColumnWidth(column) {\n let width = privatePool.get(this).columnWidthFn(column);\n\n if (width === void 0) {\n width = ViewportColumnsCalculator.DEFAULT_WIDTH;\n }\n\n return width;\n }\n}\n\nexport default ViewportColumnsCalculator;\n\n\n\n// WEBPACK FOOTER //\n// ./src/3rdparty/walkontable/src/calculator/viewportColumns.js","const privatePool = new WeakMap();\n\n/**\n * Calculates indexes of rows to render OR rows that are visible.\n * To redo the calculation, you need to create a new calculator.\n *\n * @class ViewportRowsCalculator\n */\nclass ViewportRowsCalculator {\n /**\n * Default row height\n *\n * @type {Number}\n */\n static get DEFAULT_HEIGHT() {\n return 23;\n }\n\n /**\n * @param {Number} viewportHeight Height of the viewport\n * @param {Number} scrollOffset Current vertical scroll position of the viewport\n * @param {Number} totalRows Total number of rows\n * @param {Function} rowHeightFn Function that returns the height of the row at a given index (in px)\n * @param {Function} overrideFn Function that changes calculated this.startRow, this.endRow (used by MergeCells plugin)\n * @param {Boolean} onlyFullyVisible if `true`, only startRow and endRow will be indexes of rows that are fully in viewport\n * @param {Number} horizontalScrollbarHeight\n */\n constructor(viewportHeight, scrollOffset, totalRows, rowHeightFn, overrideFn, onlyFullyVisible, horizontalScrollbarHeight) {\n privatePool.set(this, {\n viewportHeight,\n scrollOffset,\n totalRows,\n rowHeightFn,\n overrideFn,\n onlyFullyVisible,\n horizontalScrollbarHeight\n });\n\n /**\n * Number of rendered/visible rows\n *\n * @type {Number}\n */\n this.count = 0;\n\n /**\n * Index of the first rendered/visible row (can be overwritten using overrideFn)\n *\n * @type {Number|null}\n */\n this.startRow = null;\n\n /**\n * Index of the last rendered/visible row (can be overwritten using overrideFn)\n *\n * @type {null}\n */\n this.endRow = null;\n\n /**\n * Position of the first rendered/visible row (in px)\n *\n * @type {Number|null}\n */\n this.startPosition = null;\n\n this.calculate();\n }\n\n /**\n * Calculates viewport\n */\n calculate() {\n let sum = 0;\n let needReverse = true;\n let startPositions = [];\n\n let priv = privatePool.get(this);\n let onlyFullyVisible = priv.onlyFullyVisible;\n let overrideFn = priv.overrideFn;\n let rowHeightFn = priv.rowHeightFn;\n let scrollOffset = priv.scrollOffset;\n let totalRows = priv.totalRows;\n let viewportHeight = priv.viewportHeight;\n let horizontalScrollbarHeight = priv.horizontalScrollbarHeight || 0;\n let rowHeight;\n\n // Calculate the number (start and end index) of rows needed\n for (let i = 0; i < totalRows; i++) {\n rowHeight = rowHeightFn(i);\n\n if (rowHeight === undefined) {\n rowHeight = ViewportRowsCalculator.DEFAULT_HEIGHT;\n }\n if (sum <= scrollOffset && !onlyFullyVisible) {\n this.startRow = i;\n }\n\n // the row is within the \"visible range\"\n if (sum >= scrollOffset && sum + rowHeight <= scrollOffset + viewportHeight - horizontalScrollbarHeight) {\n if (this.startRow === null) {\n this.startRow = i;\n }\n this.endRow = i;\n }\n startPositions.push(sum);\n sum += rowHeight;\n\n if (!onlyFullyVisible) {\n this.endRow = i;\n }\n if (sum >= scrollOffset + viewportHeight - horizontalScrollbarHeight) {\n needReverse = false;\n break;\n }\n }\n\n // If the estimation has reached the last row and there is still some space available in the viewport,\n // we need to render in reverse in order to fill the whole viewport with rows\n if (this.endRow === totalRows - 1 && needReverse) {\n this.startRow = this.endRow;\n\n while (this.startRow > 0) {\n // rowHeight is the height of the last row\n let viewportSum = startPositions[this.endRow] + rowHeight - startPositions[this.startRow - 1];\n\n if (viewportSum <= viewportHeight - horizontalScrollbarHeight || !onlyFullyVisible) {\n this.startRow--;\n }\n if (viewportSum >= viewportHeight - horizontalScrollbarHeight) {\n break;\n }\n }\n }\n\n if (this.startRow !== null && overrideFn) {\n overrideFn(this);\n }\n this.startPosition = startPositions[this.startRow];\n\n if (this.startPosition == void 0) {\n this.startPosition = null;\n }\n if (this.startRow !== null) {\n this.count = this.endRow - this.startRow + 1;\n }\n }\n}\n\nexport default ViewportRowsCalculator;\n\n\n\n// WEBPACK FOOTER //\n// ./src/3rdparty/walkontable/src/calculator/viewportRows.js","/**\n * @class ColumnFilter\n */\nclass ColumnFilter {\n /**\n * @param {Number} offset\n * @param {Number} total\n * @param {Number} countTH\n */\n constructor(offset, total, countTH) {\n this.offset = offset;\n this.total = total;\n this.countTH = countTH;\n }\n\n /**\n * @param index\n * @returns {Number}\n */\n offsetted(index) {\n return index + this.offset;\n }\n\n /**\n * @param index\n * @returns {Number}\n */\n unOffsetted(index) {\n return index - this.offset;\n }\n\n /**\n * @param index\n * @returns {Number}\n */\n renderedToSource(index) {\n return this.offsetted(index);\n }\n\n /**\n * @param index\n * @returns {Number}\n */\n sourceToRendered(index) {\n return this.unOffsetted(index);\n }\n\n /**\n * @param index\n * @returns {Number}\n */\n offsettedTH(index) {\n return index - this.countTH;\n }\n\n /**\n * @param index\n * @returns {Number}\n */\n unOffsettedTH(index) {\n return index + this.countTH;\n }\n\n /**\n * @param index\n * @returns {Number}\n */\n visibleRowHeadedColumnToSourceColumn(index) {\n return this.renderedToSource(this.offsettedTH(index));\n }\n\n /**\n * @param index\n * @returns {Number}\n */\n sourceColumnToVisibleRowHeadedColumn(index) {\n return this.unOffsettedTH(this.sourceToRendered(index));\n }\n}\n\nexport default ColumnFilter;\n\n\n\n// WEBPACK FOOTER //\n// ./src/3rdparty/walkontable/src/filter/column.js","/**\n * @class RowFilter\n */\nclass RowFilter {\n /**\n * @param {Number} offset\n * @param {Number} total\n * @param {Number} countTH\n */\n constructor(offset, total, countTH) {\n this.offset = offset;\n this.total = total;\n this.countTH = countTH;\n }\n\n /**\n * @param index\n * @returns {Number}\n */\n offsetted(index) {\n return index + this.offset;\n }\n\n /**\n * @param index\n * @returns {Number}\n */\n unOffsetted(index) {\n return index - this.offset;\n }\n\n /**\n * @param index\n * @returns {Number}\n */\n renderedToSource(index) {\n return this.offsetted(index);\n }\n\n /**\n * @param index\n * @returns {Number}\n */\n sourceToRendered(index) {\n return this.unOffsetted(index);\n }\n\n /**\n * @param index\n * @returns {Number}\n */\n offsettedTH(index) {\n return index - this.countTH;\n }\n\n /**\n * @param index\n * @returns {Number}\n */\n unOffsettedTH(index) {\n return index + this.countTH;\n }\n\n /**\n * @param index\n * @returns {Number}\n */\n visibleColHeadedRowToSourceRow(index) {\n return this.renderedToSource(this.offsettedTH(index));\n }\n\n /**\n * @param index\n * @returns {Number}\n */\n sourceRowToVisibleColHeadedRow(index) {\n return this.unOffsettedTH(this.sourceToRendered(index));\n }\n}\n\nexport default RowFilter;\n\n\n\n// WEBPACK FOOTER //\n// ./src/3rdparty/walkontable/src/filter/row.js","import {\n addClass,\n fastInnerText,\n isVisible,\n removeClass,\n} from './../../../helpers/dom/element';\nimport {objectEach} from './../../../helpers/object';\nimport {toUpperCaseFirst, randomString} from './../../../helpers/string';\nimport Event from './event';\nimport Overlays from './overlays';\nimport Scroll from './scroll';\nimport Settings from './settings';\nimport Table from './table';\nimport Viewport from './viewport';\n\n/**\n * @class Walkontable\n */\nclass Walkontable {\n /**\n * @param {Object} settings\n */\n constructor(settings) {\n let originalHeaders = [];\n\n // this is the namespace for global events\n this.guid = `wt_${randomString()}`;\n\n // bootstrap from settings\n if (settings.cloneSource) {\n this.cloneSource = settings.cloneSource;\n this.cloneOverlay = settings.cloneOverlay;\n this.wtSettings = settings.cloneSource.wtSettings;\n this.wtTable = new Table(this, settings.table, settings.wtRootElement);\n this.wtScroll = new Scroll(this);\n this.wtViewport = settings.cloneSource.wtViewport;\n this.wtEvent = new Event(this);\n this.selections = this.cloneSource.selections;\n } else {\n this.wtSettings = new Settings(this, settings);\n this.wtTable = new Table(this, settings.table);\n this.wtScroll = new Scroll(this);\n this.wtViewport = new Viewport(this);\n this.wtEvent = new Event(this);\n this.selections = this.getSetting('selections');\n this.wtOverlays = new Overlays(this);\n this.exportSettingsAsClassNames();\n }\n\n // find original headers\n if (this.wtTable.THEAD.childNodes.length && this.wtTable.THEAD.childNodes[0].childNodes.length) {\n for (let c = 0, clen = this.wtTable.THEAD.childNodes[0].childNodes.length; c < clen; c++) {\n originalHeaders.push(this.wtTable.THEAD.childNodes[0].childNodes[c].innerHTML);\n }\n if (!this.getSetting('columnHeaders').length) {\n this.update('columnHeaders', [\n function(column, TH) {\n fastInnerText(TH, originalHeaders[column]);\n }\n ]);\n }\n }\n this.drawn = false;\n this.drawInterrupted = false;\n }\n\n /**\n * Force rerender of Walkontable\n *\n * @param {Boolean} [fastDraw=false] When `true`, try to refresh only the positions of borders without rerendering\n * the data. It will only work if Table.draw() does not force\n * rendering anyway\n * @returns {Walkontable}\n */\n draw(fastDraw = false) {\n this.drawInterrupted = false;\n\n if (!fastDraw && !isVisible(this.wtTable.TABLE)) {\n // draw interrupted because TABLE is not visible\n this.drawInterrupted = true;\n } else {\n this.wtTable.draw(fastDraw);\n }\n\n return this;\n }\n\n /**\n * Returns the TD at coords. If topmost is set to true, returns TD from the topmost overlay layer,\n * if not set or set to false, returns TD from the master table.\n *\n * @param {CellCoords} coords\n * @param {Boolean} [topmost=false]\n * @returns {Object}\n */\n getCell(coords, topmost = false) {\n if (!topmost) {\n return this.wtTable.getCell(coords);\n }\n\n let totalRows = this.wtSettings.getSetting('totalRows');\n let fixedRowsTop = this.wtSettings.getSetting('fixedRowsTop');\n let fixedRowsBottom = this.wtSettings.getSetting('fixedRowsBottom');\n let fixedColumns = this.wtSettings.getSetting('fixedColumnsLeft');\n\n if (coords.row < fixedRowsTop && coords.col < fixedColumns) {\n return this.wtOverlays.topLeftCornerOverlay.clone.wtTable.getCell(coords);\n\n } else if (coords.row < fixedRowsTop) {\n return this.wtOverlays.topOverlay.clone.wtTable.getCell(coords);\n\n } else if (coords.col < fixedColumns && coords.row >= totalRows - fixedRowsBottom) {\n if (this.wtOverlays.bottomLeftCornerOverlay && this.wtOverlays.bottomLeftCornerOverlay.clone) {\n return this.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.getCell(coords);\n }\n\n } else if (coords.col < fixedColumns) {\n return this.wtOverlays.leftOverlay.clone.wtTable.getCell(coords);\n\n } else if (coords.row < totalRows && coords.row > totalRows - fixedRowsBottom) {\n if (this.wtOverlays.bottomOverlay && this.wtOverlays.bottomOverlay.clone) {\n return this.wtOverlays.bottomOverlay.clone.wtTable.getCell(coords);\n }\n\n }\n\n return this.wtTable.getCell(coords);\n }\n\n /**\n * @param {Object} settings\n * @param {*} value\n * @returns {Walkontable}\n */\n update(settings, value) {\n return this.wtSettings.update(settings, value);\n }\n\n /**\n * Scroll the viewport to a row at the given index in the data source\n *\n * @param {Number} row\n * @returns {Walkontable}\n */\n scrollVertical(row) {\n this.wtOverlays.topOverlay.scrollTo(row);\n this.getSetting('onScrollVertically');\n\n return this;\n }\n\n /**\n * Scroll the viewport to a column at the given index in the data source\n *\n * @param {Number} column\n * @returns {Walkontable}\n */\n scrollHorizontal(column) {\n this.wtOverlays.leftOverlay.scrollTo(column);\n this.getSetting('onScrollHorizontally');\n\n return this;\n }\n\n /**\n * Scrolls the viewport to a cell (rerenders if needed)\n *\n * @param {CellCoords} coords\n * @returns {Walkontable}\n */\n scrollViewport(coords) {\n this.wtScroll.scrollViewport(coords);\n\n return this;\n }\n\n /**\n * @returns {Array}\n */\n getViewport() {\n return [\n this.wtTable.getFirstVisibleRow(),\n this.wtTable.getFirstVisibleColumn(),\n this.wtTable.getLastVisibleRow(),\n this.wtTable.getLastVisibleColumn()\n ];\n }\n\n /**\n * Get overlay name\n *\n * @returns {String}\n */\n getOverlayName() {\n return this.cloneOverlay ? this.cloneOverlay.type : 'master';\n }\n\n /**\n * Check overlay type of this Walkontable instance.\n *\n * @param {String} name Clone type @see {Overlay.CLONE_TYPES}.\n * @returns {Boolean}\n */\n isOverlayName(name) {\n if (this.cloneOverlay) {\n return this.cloneOverlay.type === name;\n }\n\n return false;\n }\n\n /**\n * Export settings as class names added to the parent element of the table.\n */\n exportSettingsAsClassNames() {\n let toExport = {\n rowHeaders: ['array'],\n columnHeaders: ['array']\n };\n let allClassNames = [];\n let newClassNames = [];\n\n objectEach(toExport, (optionType, key) => {\n if (optionType.indexOf('array') > -1 && this.getSetting(key).length) {\n newClassNames.push(`ht${toUpperCaseFirst(key)}`);\n }\n allClassNames.push(`ht${toUpperCaseFirst(key)}`);\n });\n removeClass(this.wtTable.wtRootElement.parentNode, allClassNames);\n addClass(this.wtTable.wtRootElement.parentNode, newClassNames);\n }\n\n /**\n * Get/Set Walkontable instance setting\n *\n * @param {String} key\n * @param {*} [param1]\n * @param {*} [param2]\n * @param {*} [param3]\n * @param {*} [param4]\n * @returns {*}\n */\n getSetting(key, param1, param2, param3, param4) {\n // this is faster than .apply - https://github.com/handsontable/handsontable/wiki/JavaScript-&-DOM-performance-tips\n return this.wtSettings.getSetting(key, param1, param2, param3, param4);\n }\n\n /**\n * Checks if setting exists\n *\n * @param {String} key\n * @returns {Boolean}\n */\n hasSetting(key) {\n return this.wtSettings.has(key);\n }\n\n /**\n * Destroy instance\n */\n destroy() {\n this.wtOverlays.destroy();\n this.wtEvent.destroy();\n }\n}\n\nexport default Walkontable;\n\n\n\n// WEBPACK FOOTER //\n// ./src/3rdparty/walkontable/src/core.js","import {\n closestDown,\n hasClass,\n isChildOf,\n getParent,\n} from './../../../helpers/dom/element';\nimport {partial} from './../../../helpers/function';\nimport {isMobileBrowser} from './../../../helpers/browser';\nimport EventManager from './../../../eventManager';\n\n/**\n *\n */\nfunction Event(instance) {\n const that = this;\n const eventManager = new EventManager(instance);\n let selectedCellBeforeTouchEnd;\n\n this.instance = instance;\n\n var dblClickOrigin = [null, null];\n this.dblClickTimeout = [null, null];\n\n var onMouseDown = function(event) {\n const activeElement = document.activeElement;\n const getParentNode = partial(getParent, event.realTarget);\n const realTarget = event.realTarget;\n\n // ignore focusable element from mouse down processing (https://github.com/handsontable/handsontable/issues/3555)\n if (realTarget === activeElement ||\n getParentNode(0) === activeElement ||\n getParentNode(1) === activeElement) {\n return;\n }\n\n var cell = that.parentCell(realTarget);\n\n if (hasClass(realTarget, 'corner')) {\n that.instance.getSetting('onCellCornerMouseDown', event, realTarget);\n } else if (cell.TD) {\n if (that.instance.hasSetting('onCellMouseDown')) {\n that.instance.getSetting('onCellMouseDown', event, cell.coords, cell.TD, that.instance);\n }\n }\n\n if (event.button !== 2) { // if not right mouse button\n if (cell.TD) {\n dblClickOrigin[0] = cell.TD;\n clearTimeout(that.dblClickTimeout[0]);\n that.dblClickTimeout[0] = setTimeout(() => {\n dblClickOrigin[0] = null;\n }, 1000);\n }\n }\n };\n\n var onTouchMove = function(event) {\n that.instance.touchMoving = true;\n };\n\n var onTouchStart = function(event) {\n eventManager.addEventListener(this, 'touchmove', onTouchMove);\n\n // Prevent cell selection when scrolling with touch event - not the best solution performance-wise\n that.checkIfTouchMove = setTimeout(() => {\n if (that.instance.touchMoving === true) {\n that.instance.touchMoving = void 0;\n\n eventManager.removeEventListener('touchmove', onTouchMove, false);\n }\n\n onMouseDown(event);\n\n }, 30);\n };\n\n var onMouseOver = function(event) {\n var table,\n td,\n mainWOT;\n\n if (that.instance.hasSetting('onCellMouseOver')) {\n table = that.instance.wtTable.TABLE;\n td = closestDown(event.realTarget, ['TD', 'TH'], table);\n mainWOT = that.instance.cloneSource || that.instance;\n\n if (td && td !== mainWOT.lastMouseOver && isChildOf(td, table)) {\n mainWOT.lastMouseOver = td;\n\n that.instance.getSetting('onCellMouseOver', event, that.instance.wtTable.getCoords(td), td, that.instance);\n }\n }\n };\n\n var onMouseOut = function(event) {\n let table;\n let lastTD;\n let nextTD;\n\n if (that.instance.hasSetting('onCellMouseOut')) {\n table = that.instance.wtTable.TABLE;\n lastTD = closestDown(event.realTarget, ['TD', 'TH'], table);\n nextTD = closestDown(event.relatedTarget, ['TD', 'TH'], table);\n\n if (lastTD && lastTD !== nextTD && isChildOf(lastTD, table)) {\n that.instance.getSetting('onCellMouseOut', event, that.instance.wtTable.getCoords(lastTD), lastTD, that.instance);\n }\n }\n };\n\n var onMouseUp = function(event) {\n if (event.button !== 2) { // if not right mouse button\n var cell = that.parentCell(event.realTarget);\n\n if (cell.TD === dblClickOrigin[0] && cell.TD === dblClickOrigin[1]) {\n if (hasClass(event.realTarget, 'corner')) {\n that.instance.getSetting('onCellCornerDblClick', event, cell.coords, cell.TD, that.instance);\n\n } else {\n that.instance.getSetting('onCellDblClick', event, cell.coords, cell.TD, that.instance);\n }\n\n dblClickOrigin[0] = null;\n dblClickOrigin[1] = null;\n\n } else if (cell.TD === dblClickOrigin[0]) {\n that.instance.getSetting('onCellMouseUp', event, cell.coords, cell.TD, that.instance);\n\n dblClickOrigin[1] = cell.TD;\n clearTimeout(that.dblClickTimeout[1]);\n that.dblClickTimeout[1] = setTimeout(() => {\n dblClickOrigin[1] = null;\n }, 500);\n\n } else if (cell.TD && that.instance.hasSetting('onCellMouseUp')) {\n that.instance.getSetting('onCellMouseUp', event, cell.coords, cell.TD, that.instance);\n }\n }\n };\n\n const selectedCellWasTouched = (touchTarget) => {\n const cellUnderFinger = that.parentCell(touchTarget);\n const coordsOfCellUnderFinger = cellUnderFinger.coords;\n\n if (selectedCellBeforeTouchEnd && coordsOfCellUnderFinger) {\n const [rowTouched, rowSelected] = [coordsOfCellUnderFinger.row, selectedCellBeforeTouchEnd.from.row];\n const [colTouched, colSelected] = [coordsOfCellUnderFinger.col, selectedCellBeforeTouchEnd.from.col];\n\n return rowTouched === rowSelected && colTouched === colSelected;\n }\n\n return false;\n };\n\n var onTouchEnd = function(event) {\n const excludeTags = ['A', 'BUTTON', 'INPUT'];\n const target = event.target;\n\n // touched link which was placed inside a cell (a cell with DOM `a` element) WILL NOT trigger the below function calls\n // and as consequence will behave as standard (open the link).\n if (selectedCellWasTouched(target) === false || excludeTags.includes(target.tagName) === false) {\n event.preventDefault();\n onMouseUp(event);\n }\n };\n\n eventManager.addEventListener(this.instance.wtTable.holder, 'mousedown', onMouseDown);\n eventManager.addEventListener(this.instance.wtTable.TABLE, 'mouseover', onMouseOver);\n eventManager.addEventListener(this.instance.wtTable.TABLE, 'mouseout', onMouseOut);\n eventManager.addEventListener(this.instance.wtTable.holder, 'mouseup', onMouseUp);\n\n // check if full HOT instance, or detached WOT AND run on mobile device\n if (this.instance.wtTable.holder.parentNode.parentNode && isMobileBrowser() && !that.instance.wtTable.isWorkingOnClone()) {\n var classSelector = `.${this.instance.wtTable.holder.parentNode.className.split(' ').join('.')}`;\n\n eventManager.addEventListener(this.instance.wtTable.holder, 'touchstart', (event) => {\n selectedCellBeforeTouchEnd = instance.selections.getCell().cellRange;\n\n that.instance.touchApplied = true;\n if (isChildOf(event.target, classSelector)) {\n onTouchStart.call(event.target, event);\n }\n });\n eventManager.addEventListener(this.instance.wtTable.holder, 'touchend', (event) => {\n that.instance.touchApplied = false;\n if (isChildOf(event.target, classSelector)) {\n onTouchEnd.call(event.target, event);\n }\n });\n\n if (!that.instance.momentumScrolling) {\n that.instance.momentumScrolling = {};\n }\n eventManager.addEventListener(this.instance.wtTable.holder, 'scroll', (event) => {\n clearTimeout(that.instance.momentumScrolling._timeout);\n\n if (!that.instance.momentumScrolling.ongoing) {\n that.instance.getSetting('onBeforeTouchScroll');\n }\n that.instance.momentumScrolling.ongoing = true;\n\n that.instance.momentumScrolling._timeout = setTimeout(() => {\n if (!that.instance.touchApplied) {\n that.instance.momentumScrolling.ongoing = false;\n\n that.instance.getSetting('onAfterMomentumScroll');\n }\n }, 200);\n });\n }\n\n eventManager.addEventListener(window, 'resize', () => {\n if (that.instance.getSetting('stretchH') !== 'none') {\n that.instance.draw();\n }\n });\n\n this.destroy = function() {\n clearTimeout(this.dblClickTimeout[0]);\n clearTimeout(this.dblClickTimeout[1]);\n\n eventManager.destroy();\n };\n}\n\nEvent.prototype.parentCell = function(elem) {\n var cell = {};\n var TABLE = this.instance.wtTable.TABLE;\n var TD = closestDown(elem, ['TD', 'TH'], TABLE);\n\n if (TD) {\n cell.coords = this.instance.wtTable.getCoords(TD);\n cell.TD = TD;\n\n } else if (hasClass(elem, 'wtBorder') && hasClass(elem, 'current')) {\n cell.coords = this.instance.selections.getCell().cellRange.highlight;\n cell.TD = this.instance.wtTable.getCell(cell.coords);\n\n } else if (hasClass(elem, 'wtBorder') && hasClass(elem, 'area')) {\n if (this.instance.selections.createOrGetArea().cellRange) {\n cell.coords = this.instance.selections.createOrGetArea().cellRange.to;\n cell.TD = this.instance.wtTable.getCell(cell.coords);\n }\n }\n\n return cell;\n};\n\nexport default Event;\n\n\n\n// WEBPACK FOOTER //\n// ./src/3rdparty/walkontable/src/event.js","import {\n getScrollableElement,\n getScrollbarWidth,\n getScrollLeft,\n getScrollTop,\n} from './../../../helpers/dom/element';\nimport {arrayEach} from './../../../helpers/array';\nimport {isKey} from './../../../helpers/unicode';\nimport {isMobileBrowser, isChrome} from './../../../helpers/browser';\nimport EventManager from './../../../eventManager';\nimport Overlay from './overlay/_base.js';\n\n/**\n * @class Overlays\n */\nclass Overlays {\n /**\n * @param {Walkontable} wotInstance\n */\n constructor(wotInstance) {\n /**\n * Sometimes `line-height` might be set to 'normal'. In that case, a default `font-size` should be multiplied by roughly 1.2.\n * https://developer.mozilla.org/pl/docs/Web/CSS/line-height#Values\n */\n const BODY_LINE_HEIGHT = parseInt(getComputedStyle(document.body).lineHeight, 10);\n const FALLBACK_BODY_LINE_HEIGHT = parseInt(getComputedStyle(document.body).fontSize, 10) * 1.2;\n\n this.wot = wotInstance;\n\n // legacy support\n this.instance = this.wot;\n this.eventManager = new EventManager(this.wot);\n\n this.wot.update('scrollbarWidth', getScrollbarWidth());\n this.wot.update('scrollbarHeight', getScrollbarWidth());\n\n this.scrollableElement = getScrollableElement(this.wot.wtTable.TABLE);\n\n this.prepareOverlays();\n\n this.destroyed = false;\n this.keyPressed = false;\n this.spreaderLastSize = {\n width: null,\n height: null,\n };\n this.overlayScrollPositions = {\n master: {\n top: 0,\n left: 0,\n },\n top: {\n top: null,\n left: 0,\n },\n bottom: {\n top: null,\n left: 0\n },\n left: {\n top: 0,\n left: null\n }\n };\n\n this.pendingScrollCallbacks = {\n master: {\n top: 0,\n left: 0,\n },\n top: {\n left: 0,\n },\n bottom: {\n left: 0,\n },\n left: {\n top: 0,\n }\n };\n\n this.verticalScrolling = false;\n this.horizontalScrolling = false;\n this.delegatedScrollCallback = false;\n\n this.registeredListeners = [];\n\n this.browserLineHeight = BODY_LINE_HEIGHT || FALLBACK_BODY_LINE_HEIGHT;\n\n this.registerListeners();\n }\n\n /**\n * Prepare overlays based on user settings.\n *\n * @returns {Boolean} Returns `true` if changes applied to overlay needs scroll synchronization.\n */\n prepareOverlays() {\n let syncScroll = false;\n\n if (this.topOverlay) {\n syncScroll = this.topOverlay.updateStateOfRendering() || syncScroll;\n } else {\n this.topOverlay = Overlay.createOverlay(Overlay.CLONE_TOP, this.wot);\n }\n\n if (!Overlay.hasOverlay(Overlay.CLONE_BOTTOM)) {\n this.bottomOverlay = {\n needFullRender: false,\n updateStateOfRendering: () => false,\n };\n }\n if (!Overlay.hasOverlay(Overlay.CLONE_BOTTOM_LEFT_CORNER)) {\n this.bottomLeftCornerOverlay = {\n needFullRender: false,\n updateStateOfRendering: () => false,\n };\n }\n\n if (this.bottomOverlay) {\n syncScroll = this.bottomOverlay.updateStateOfRendering() || syncScroll;\n } else {\n this.bottomOverlay = Overlay.createOverlay(Overlay.CLONE_BOTTOM, this.wot);\n }\n\n if (this.leftOverlay) {\n syncScroll = this.leftOverlay.updateStateOfRendering() || syncScroll;\n } else {\n this.leftOverlay = Overlay.createOverlay(Overlay.CLONE_LEFT, this.wot);\n }\n\n if (this.topOverlay.needFullRender && this.leftOverlay.needFullRender) {\n if (this.topLeftCornerOverlay) {\n syncScroll = this.topLeftCornerOverlay.updateStateOfRendering() || syncScroll;\n } else {\n this.topLeftCornerOverlay = Overlay.createOverlay(Overlay.CLONE_TOP_LEFT_CORNER, this.wot);\n }\n }\n\n if (this.bottomOverlay.needFullRender && this.leftOverlay.needFullRender) {\n if (this.bottomLeftCornerOverlay) {\n syncScroll = this.bottomLeftCornerOverlay.updateStateOfRendering() || syncScroll;\n } else {\n this.bottomLeftCornerOverlay = Overlay.createOverlay(Overlay.CLONE_BOTTOM_LEFT_CORNER, this.wot);\n }\n }\n\n if (this.wot.getSetting('debug') && !this.debug) {\n this.debug = Overlay.createOverlay(Overlay.CLONE_DEBUG, this.wot);\n }\n\n return syncScroll;\n }\n\n /**\n * Refresh and redraw table\n */\n refreshAll() {\n if (!this.wot.drawn) {\n return;\n }\n if (!this.wot.wtTable.holder.parentNode) {\n // Walkontable was detached from DOM, but this handler was not removed\n this.destroy();\n\n return;\n }\n this.wot.draw(true);\n\n if (this.verticalScrolling) {\n this.leftOverlay.onScroll();\n }\n\n if (this.horizontalScrolling) {\n this.topOverlay.onScroll();\n }\n\n this.verticalScrolling = false;\n this.horizontalScrolling = false;\n }\n\n /**\n * Register all necessary event listeners.\n */\n registerListeners() {\n const topOverlayScrollable = this.topOverlay.mainTableScrollableElement;\n const leftOverlayScrollable = this.leftOverlay.mainTableScrollableElement;\n\n let listenersToRegister = [];\n listenersToRegister.push([document.documentElement, 'keydown', (event) => this.onKeyDown(event)]);\n listenersToRegister.push([document.documentElement, 'keyup', () => this.onKeyUp()]);\n listenersToRegister.push([document, 'visibilitychange', () => this.onKeyUp()]);\n listenersToRegister.push([topOverlayScrollable, 'scroll', (event) => this.onTableScroll(event)]);\n\n if (topOverlayScrollable !== leftOverlayScrollable) {\n listenersToRegister.push([leftOverlayScrollable, 'scroll', (event) => this.onTableScroll(event)]);\n }\n\n const isHighPixelRatio = window.devicePixelRatio && window.devicePixelRatio > 1;\n\n if (isHighPixelRatio || !isChrome()) {\n listenersToRegister.push([this.instance.wtTable.wtRootElement.parentNode, 'wheel', (event) => this.onCloneWheel(event)]);\n\n } else {\n if (this.topOverlay.needFullRender) {\n listenersToRegister.push([this.topOverlay.clone.wtTable.holder, 'wheel', (event) => this.onCloneWheel(event)]);\n }\n\n if (this.bottomOverlay.needFullRender) {\n listenersToRegister.push([this.bottomOverlay.clone.wtTable.holder, 'wheel', (event) => this.onCloneWheel(event)]);\n }\n\n if (this.leftOverlay.needFullRender) {\n listenersToRegister.push([this.leftOverlay.clone.wtTable.holder, 'wheel', (event) => this.onCloneWheel(event)]);\n }\n\n if (this.topLeftCornerOverlay && this.topLeftCornerOverlay.needFullRender) {\n listenersToRegister.push([this.topLeftCornerOverlay.clone.wtTable.holder, 'wheel', (event) => this.onCloneWheel(event)]);\n }\n\n if (this.bottomLeftCornerOverlay && this.bottomLeftCornerOverlay.needFullRender) {\n listenersToRegister.push([this.bottomLeftCornerOverlay.clone.wtTable.holder, 'wheel', (event) => this.onCloneWheel(event)]);\n }\n }\n\n if (this.topOverlay.trimmingContainer !== window && this.leftOverlay.trimmingContainer !== window) {\n // This is necessary?\n // eventManager.addEventListener(window, 'scroll', (event) => this.refreshAll(event));\n listenersToRegister.push([window, 'wheel', (event) => {\n let overlay;\n let deltaY = event.wheelDeltaY || event.deltaY;\n let deltaX = event.wheelDeltaX || event.deltaX;\n\n if (this.topOverlay.clone.wtTable.holder.contains(event.realTarget)) {\n overlay = 'top';\n\n } else if (this.bottomOverlay.clone && this.bottomOverlay.clone.wtTable.holder.contains(event.realTarget)) {\n overlay = 'bottom';\n\n } else if (this.leftOverlay.clone.wtTable.holder.contains(event.realTarget)) {\n overlay = 'left';\n\n } else if (this.topLeftCornerOverlay && this.topLeftCornerOverlay.clone && this.topLeftCornerOverlay.clone.wtTable.holder.contains(event.realTarget)) {\n overlay = 'topLeft';\n\n } else if (this.bottomLeftCornerOverlay && this.bottomLeftCornerOverlay.clone && this.bottomLeftCornerOverlay.clone.wtTable.holder.contains(event.realTarget)) {\n overlay = 'bottomLeft';\n }\n\n if ((overlay === 'top' && deltaY !== 0) ||\n (overlay === 'left' && deltaX !== 0) ||\n (overlay === 'bottom' && deltaY !== 0) ||\n ((overlay === 'topLeft' || overlay === 'bottomLeft') && (deltaY !== 0 || deltaX !== 0))) {\n\n event.preventDefault();\n }\n }]);\n }\n\n while (listenersToRegister.length) {\n let listener = listenersToRegister.pop();\n this.eventManager.addEventListener(listener[0], listener[1], listener[2]);\n\n this.registeredListeners.push(listener);\n }\n }\n\n /**\n * Deregister all previously registered listeners.\n */\n deregisterListeners() {\n while (this.registeredListeners.length) {\n let listener = this.registeredListeners.pop();\n this.eventManager.removeEventListener(listener[0], listener[1], listener[2]);\n }\n }\n\n /**\n * Scroll listener\n *\n * @param {Event} event\n */\n onTableScroll(event) {\n // There was if statement which controlled flow of this function. It avoided the execution of the next lines\n // on mobile devices. It was changed. Broader description of this case is included within issue #4856.\n\n const masterHorizontal = this.leftOverlay.mainTableScrollableElement;\n const masterVertical = this.topOverlay.mainTableScrollableElement;\n const target = event.target;\n\n // For key press, sync only master -> overlay position because while pressing Walkontable.render is triggered\n // by hot.refreshBorder\n if (this.keyPressed) {\n if ((masterVertical !== window && target !== window && !event.target.contains(masterVertical)) ||\n (masterHorizontal !== window && target !== window && !event.target.contains(masterHorizontal))) {\n return;\n }\n }\n\n this.syncScrollPositions(event);\n }\n\n /**\n * Wheel listener for cloned overlays.\n *\n * @param {Event} event\n */\n onCloneWheel(event) {\n if (this.scrollableElement !== window) {\n event.preventDefault();\n }\n // There was if statement which controlled flow of this function. It avoided the execution of the next lines\n // on mobile devices. It was changed. Broader description of this case is included within issue #4856.\n\n const masterHorizontal = this.leftOverlay.mainTableScrollableElement;\n const masterVertical = this.topOverlay.mainTableScrollableElement;\n const target = event.target;\n\n // For key press, sync only master -> overlay position because while pressing Walkontable.render is triggered\n // by hot.refreshBorder\n const shouldNotWheelVertically = masterVertical !== window && target !== window && !event.target.contains(masterVertical);\n const shouldNotWheelHorizontally = masterHorizontal !== window && target !== window && !event.target.contains(masterHorizontal);\n\n if (this.keyPressed && (shouldNotWheelVertically || shouldNotWheelHorizontally)) {\n return;\n }\n\n this.translateMouseWheelToScroll(event);\n }\n\n /**\n * Key down listener\n */\n onKeyDown(event) {\n this.keyPressed = isKey(event.keyCode, 'ARROW_UP|ARROW_RIGHT|ARROW_DOWN|ARROW_LEFT');\n }\n\n /**\n * Key up listener\n */\n onKeyUp() {\n this.keyPressed = false;\n }\n\n /**\n * Translate wheel event into scroll event and sync scroll overlays position\n *\n * @private\n * @param {Event} event\n * @returns {Boolean}\n */\n translateMouseWheelToScroll(event) {\n let deltaY = isNaN(event.deltaY) ? (-1) * event.wheelDeltaY : event.deltaY;\n let deltaX = isNaN(event.deltaX) ? (-1) * event.wheelDeltaX : event.deltaX;\n\n if (event.deltaMode === 1) {\n deltaX += deltaX * this.browserLineHeight;\n deltaY += deltaY * this.browserLineHeight;\n }\n\n this.scrollVertically(deltaY);\n this.scrollHorizontally(deltaX);\n\n return false;\n }\n\n scrollVertically(distance) {\n if (distance === 0) {\n return 0;\n }\n this.scrollableElement.scrollTop += distance;\n }\n\n scrollHorizontally(distance) {\n if (distance === 0) {\n return 0;\n }\n this.scrollableElement.scrollLeft += distance;\n }\n\n /**\n * Synchronize scroll position between master table and overlay table.\n *\n * @private\n * @param {Event|Object} event\n */\n syncScrollPositions(event) {\n if (this.destroyed) {\n return;\n }\n\n let topHolder = this.topOverlay.clone.wtTable.holder;\n let leftHolder = this.leftOverlay.clone.wtTable.holder;\n\n const [scrollLeft, scrollTop] = [this.scrollableElement.scrollLeft, this.scrollableElement.scrollTop];\n\n this.horizontalScrolling = topHolder.scrollLeft !== scrollLeft;\n this.verticalScrolling = leftHolder.scrollTop !== scrollTop;\n\n if (this.horizontalScrolling) {\n topHolder.scrollLeft = scrollLeft;\n }\n\n if (this.verticalScrolling) {\n leftHolder.scrollTop = scrollTop;\n\n if (this.bottomOverlay.needFullRender) {\n this.bottomOverlay.clone.wtTable.holder.scrollLeft = scrollLeft;\n }\n }\n\n this.refreshAll();\n }\n\n /**\n * Synchronize overlay scrollbars with the master scrollbar\n */\n syncScrollWithMaster() {\n const master = this.topOverlay.mainTableScrollableElement;\n const {scrollLeft, scrollTop} = master;\n\n if (this.topOverlay.needFullRender) {\n this.topOverlay.clone.wtTable.holder.scrollLeft = scrollLeft;\n }\n if (this.bottomOverlay.needFullRender) {\n this.bottomOverlay.clone.wtTable.holder.scrollLeft = scrollLeft;\n }\n if (this.leftOverlay.needFullRender) {\n this.leftOverlay.clone.wtTable.holder.scrollTop = scrollTop;\n }\n }\n\n /**\n * Update the main scrollable elements for all the overlays.\n */\n updateMainScrollableElements() {\n this.deregisterListeners();\n\n this.leftOverlay.updateMainScrollableElement();\n this.topOverlay.updateMainScrollableElement();\n\n if (this.bottomOverlay.needFullRender) {\n this.bottomOverlay.updateMainScrollableElement();\n }\n\n this.scrollableElement = getScrollableElement(this.wot.wtTable.TABLE);\n\n this.registerListeners();\n }\n\n /**\n *\n */\n destroy() {\n this.eventManager.destroy();\n this.topOverlay.destroy();\n\n if (this.bottomOverlay.clone) {\n this.bottomOverlay.destroy();\n }\n this.leftOverlay.destroy();\n\n if (this.topLeftCornerOverlay) {\n this.topLeftCornerOverlay.destroy();\n }\n\n if (this.bottomLeftCornerOverlay && this.bottomLeftCornerOverlay.clone) {\n this.bottomLeftCornerOverlay.destroy();\n }\n\n if (this.debug) {\n this.debug.destroy();\n }\n this.destroyed = true;\n }\n\n /**\n * @param {Boolean} [fastDraw=false]\n */\n refresh(fastDraw = false) {\n if (this.topOverlay.areElementSizesAdjusted && this.leftOverlay.areElementSizesAdjusted) {\n let container = this.wot.wtTable.wtRootElement.parentNode || this.wot.wtTable.wtRootElement;\n let width = container.clientWidth;\n let height = container.clientHeight;\n\n if (width !== this.spreaderLastSize.width || height !== this.spreaderLastSize.height) {\n this.spreaderLastSize.width = width;\n this.spreaderLastSize.height = height;\n this.adjustElementsSize();\n }\n }\n\n if (this.bottomOverlay.clone) {\n this.bottomOverlay.refresh(fastDraw);\n }\n\n this.leftOverlay.refresh(fastDraw);\n this.topOverlay.refresh(fastDraw);\n\n if (this.topLeftCornerOverlay) {\n this.topLeftCornerOverlay.refresh(fastDraw);\n }\n\n if (this.bottomLeftCornerOverlay && this.bottomLeftCornerOverlay.clone) {\n this.bottomLeftCornerOverlay.refresh(fastDraw);\n }\n\n if (this.debug) {\n this.debug.refresh(fastDraw);\n }\n }\n\n /**\n * Adjust overlays elements size and master table size\n *\n * @param {Boolean} [force=false]\n */\n adjustElementsSize(force = false) {\n let totalColumns = this.wot.getSetting('totalColumns');\n let totalRows = this.wot.getSetting('totalRows');\n let headerRowSize = this.wot.wtViewport.getRowHeaderWidth();\n let headerColumnSize = this.wot.wtViewport.getColumnHeaderHeight();\n let hiderStyle = this.wot.wtTable.hider.style;\n\n hiderStyle.width = `${headerRowSize + this.leftOverlay.sumCellSizes(0, totalColumns)}px`;\n hiderStyle.height = `${headerColumnSize + this.topOverlay.sumCellSizes(0, totalRows) + 1}px`;\n\n this.topOverlay.adjustElementsSize(force);\n this.leftOverlay.adjustElementsSize(force);\n\n if (this.bottomOverlay.clone) {\n this.bottomOverlay.adjustElementsSize(force);\n }\n }\n\n /**\n *\n */\n applyToDOM() {\n if (!this.topOverlay.areElementSizesAdjusted || !this.leftOverlay.areElementSizesAdjusted) {\n this.adjustElementsSize();\n }\n this.topOverlay.applyToDOM();\n\n if (this.bottomOverlay.clone) {\n this.bottomOverlay.applyToDOM();\n }\n\n this.leftOverlay.applyToDOM();\n }\n\n /**\n * Get the parent overlay of the provided element.\n *\n * @param {HTMLElement} element\n * @returns {Object|null}\n */\n getParentOverlay(element) {\n if (!element) {\n return null;\n }\n\n let overlays = [\n this.topOverlay,\n this.leftOverlay,\n this.bottomOverlay,\n this.topLeftCornerOverlay,\n this.bottomLeftCornerOverlay\n ];\n let result = null;\n\n arrayEach(overlays, (elem, i) => {\n if (!elem) {\n return;\n }\n\n if (elem.clone && elem.clone.wtTable.TABLE.contains(element)) {\n result = elem.clone;\n }\n });\n\n return result;\n }\n}\n\nexport default Overlays;\n\n\n\n// WEBPACK FOOTER //\n// ./src/3rdparty/walkontable/src/overlays.js","import {\n innerHeight,\n innerWidth,\n getScrollLeft,\n getScrollTop,\n offset,\n} from './../../../helpers/dom/element';\nimport {rangeEach, rangeEachReverse} from './../../../helpers/number';\n\n/**\n * @class Scroll\n */\nclass Scroll {\n /**\n * @param {Walkontable} wotInstance\n */\n constructor(wotInstance) {\n this.wot = wotInstance;\n\n // legacy support\n this.instance = wotInstance;\n }\n\n /**\n * Scrolls viewport to a cell by minimum number of cells\n *\n * @param {CellCoords} coords\n */\n scrollViewport(coords) {\n if (!this.wot.drawn) {\n return;\n }\n\n const {\n topOverlay,\n leftOverlay,\n totalRows,\n totalColumns,\n fixedRowsTop,\n fixedRowsBottom,\n fixedColumnsLeft,\n } = this._getVariables();\n\n if (coords.row < 0 || coords.row > Math.max(totalRows - 1, 0)) {\n throw new Error(`row ${coords.row} does not exist`);\n }\n\n if (coords.col < 0 || coords.col > Math.max(totalColumns - 1, 0)) {\n throw new Error(`column ${coords.col} does not exist`);\n }\n\n if (coords.row >= fixedRowsTop && coords.row < this.getFirstVisibleRow()) {\n topOverlay.scrollTo(coords.row);\n\n } else if (coords.row > this.getLastVisibleRow() && coords.row < totalRows - fixedRowsBottom) {\n topOverlay.scrollTo(coords.row, true);\n }\n\n if (coords.col >= fixedColumnsLeft && coords.col < this.getFirstVisibleColumn()) {\n leftOverlay.scrollTo(coords.col);\n\n } else if (coords.col > this.getLastVisibleColumn()) {\n leftOverlay.scrollTo(coords.col, true);\n }\n }\n\n /**\n * Get first visible row based on virtual dom and how table is visible in browser window viewport.\n *\n * @returns {Number}\n */\n getFirstVisibleRow() {\n const {\n topOverlay,\n wtTable,\n wtViewport,\n totalRows,\n fixedRowsTop,\n } = this._getVariables();\n\n let firstVisibleRow = wtTable.getFirstVisibleRow();\n\n if (topOverlay.mainTableScrollableElement === window) {\n const rootElementOffset = offset(wtTable.wtRootElement);\n const totalTableHeight = innerHeight(wtTable.hider);\n const windowHeight = innerHeight(window);\n const windowScrollTop = getScrollTop(window);\n\n // Only calculate firstVisibleRow when table didn't filled (from up) whole viewport space\n if (rootElementOffset.top + totalTableHeight - windowHeight <= windowScrollTop) {\n let rowsHeight = wtViewport.getColumnHeaderHeight();\n\n rowsHeight += topOverlay.sumCellSizes(0, fixedRowsTop);\n\n rangeEachReverse(totalRows, 1, (row) => {\n rowsHeight += topOverlay.sumCellSizes(row - 1, row);\n\n if (rootElementOffset.top + totalTableHeight - rowsHeight <= windowScrollTop) {\n // Return physical row + 1\n firstVisibleRow = row;\n\n return false;\n }\n });\n }\n }\n\n return firstVisibleRow;\n }\n\n /**\n * Get last visible row based on virtual dom and how table is visible in browser window viewport.\n *\n * @returns {Number}\n */\n getLastVisibleRow() {\n const {\n topOverlay,\n wtTable,\n wtViewport,\n totalRows,\n } = this._getVariables();\n\n let lastVisibleRow = wtTable.getLastVisibleRow();\n\n if (topOverlay.mainTableScrollableElement === window) {\n const rootElementOffset = offset(wtTable.wtRootElement);\n const windowHeight = innerHeight(window);\n const windowScrollTop = getScrollTop(window);\n\n // Only calculate lastVisibleRow when table didn't filled (from bottom) whole viewport space\n if (rootElementOffset.top > windowScrollTop) {\n let rowsHeight = wtViewport.getColumnHeaderHeight();\n\n rangeEach(1, totalRows, (row) => {\n rowsHeight += topOverlay.sumCellSizes(row - 1, row);\n\n if (rootElementOffset.top + rowsHeight - windowScrollTop >= windowHeight) {\n // Return physical row - 1 (-2 because rangeEach gives row index + 1 - sumCellSizes requirements)\n lastVisibleRow = row - 2;\n\n return false;\n }\n });\n }\n }\n\n return lastVisibleRow;\n }\n\n /**\n * Get first visible column based on virtual dom and how table is visible in browser window viewport.\n *\n * @returns {Number}\n */\n getFirstVisibleColumn() {\n const {\n leftOverlay,\n wtTable,\n wtViewport,\n totalColumns,\n fixedColumnsLeft,\n } = this._getVariables();\n\n let firstVisibleColumn = wtTable.getFirstVisibleColumn();\n\n if (leftOverlay.mainTableScrollableElement === window) {\n const rootElementOffset = offset(wtTable.wtRootElement);\n const totalTableWidth = innerWidth(wtTable.hider);\n const windowWidth = innerWidth(window);\n const windowScrollLeft = getScrollLeft(window);\n\n // Only calculate firstVisibleColumn when table didn't filled (from left) whole viewport space\n if (rootElementOffset.left + totalTableWidth - windowWidth <= windowScrollLeft) {\n let columnsWidth = wtViewport.getRowHeaderWidth();\n\n rangeEachReverse(totalColumns, 1, (column) => {\n columnsWidth += leftOverlay.sumCellSizes(column - 1, column);\n\n if (rootElementOffset.left + totalTableWidth - columnsWidth <= windowScrollLeft) {\n // Return physical column + 1\n firstVisibleColumn = column;\n\n return false;\n }\n });\n }\n }\n\n return firstVisibleColumn;\n }\n\n /**\n * Get last visible column based on virtual dom and how table is visible in browser window viewport.\n *\n * @returns {Number}\n */\n getLastVisibleColumn() {\n const {\n leftOverlay,\n wtTable,\n wtViewport,\n totalColumns,\n } = this._getVariables();\n\n let lastVisibleColumn = wtTable.getLastVisibleColumn();\n\n if (leftOverlay.mainTableScrollableElement === window) {\n const rootElementOffset = offset(wtTable.wtRootElement);\n const windowWidth = innerWidth(window);\n const windowScrollLeft = getScrollLeft(window);\n\n // Only calculate lastVisibleColumn when table didn't filled (from right) whole viewport space\n if (rootElementOffset.left > windowScrollLeft) {\n let columnsWidth = wtViewport.getRowHeaderWidth();\n\n rangeEach(1, totalColumns, (column) => {\n columnsWidth += leftOverlay.sumCellSizes(column - 1, column);\n\n if (rootElementOffset.left + columnsWidth - windowScrollLeft >= windowWidth) {\n // Return physical column - 1 (-2 because rangeEach gives column index + 1 - sumCellSizes requirements)\n lastVisibleColumn = column - 2;\n\n return false;\n }\n });\n }\n }\n\n return lastVisibleColumn;\n }\n\n /**\n * Returns collection of variables used to rows and columns visibility calculations.\n *\n * @returns {Object}\n * @private\n */\n _getVariables() {\n const wot = this.wot;\n const topOverlay = wot.wtOverlays.topOverlay;\n const leftOverlay = wot.wtOverlays.leftOverlay;\n const wtTable = wot.wtTable;\n const wtViewport = wot.wtViewport;\n const totalRows = wot.getSetting('totalRows');\n const totalColumns = wot.getSetting('totalColumns');\n const fixedRowsTop = wot.getSetting('fixedRowsTop');\n const fixedRowsBottom = wot.getSetting('fixedRowsBottom');\n const fixedColumnsLeft = wot.getSetting('fixedColumnsLeft');\n\n return {\n topOverlay,\n leftOverlay,\n wtTable,\n wtViewport,\n totalRows,\n totalColumns,\n fixedRowsTop,\n fixedRowsBottom,\n fixedColumnsLeft\n };\n }\n}\n\nexport default Scroll;\n\n\n\n// WEBPACK FOOTER //\n// ./src/3rdparty/walkontable/src/scroll.js","import {fastInnerText} from './../../../helpers/dom/element';\nimport {hasOwnProperty} from './../../../helpers/object';\n\n/**\n * @class Settings\n */\nclass Settings {\n /**\n * @param {Walkontable} wotInstance\n * @param {Object} settings\n */\n constructor(wotInstance, settings) {\n this.wot = wotInstance;\n\n // legacy support\n this.instance = wotInstance;\n\n // default settings. void 0 means it is required, null means it can be empty\n this.defaults = {\n table: void 0,\n debug: false, // shows WalkontableDebugOverlay\n\n // presentation mode\n externalRowCalculator: false,\n stretchH: 'none', // values: all, last, none\n currentRowClassName: null,\n currentColumnClassName: null,\n preventOverflow() {\n return false;\n },\n\n // data source\n data: void 0,\n freezeOverlays: false,\n fixedColumnsLeft: 0,\n fixedRowsTop: 0,\n fixedRowsBottom: 0,\n minSpareRows: 0,\n\n // this must be array of functions: [function (row, TH) {}]\n rowHeaders() {\n return [];\n },\n\n // this must be array of functions: [function (column, TH) {}]\n columnHeaders() {\n return [];\n },\n totalRows: void 0,\n totalColumns: void 0,\n cellRenderer: (row, column, TD) => {\n let cellData = this.getSetting('data', row, column);\n\n fastInnerText(TD, cellData === void 0 || cellData === null ? '' : cellData);\n },\n\n // columnWidth: 50,\n columnWidth(col) {\n // return undefined means use default size for the rendered cell content\n },\n rowHeight(row) {\n // return undefined means use default size for the rendered cell content\n },\n defaultRowHeight: 23,\n defaultColumnWidth: 50,\n selections: null,\n hideBorderOnMouseDownOver: false,\n viewportRowCalculatorOverride: null,\n viewportColumnCalculatorOverride: null,\n\n // callbacks\n onCellMouseDown: null,\n onCellMouseOver: null,\n onCellMouseOut: null,\n onCellMouseUp: null,\n\n // onCellMouseOut: null,\n onCellDblClick: null,\n onCellCornerMouseDown: null,\n onCellCornerDblClick: null,\n beforeDraw: null,\n onDraw: null,\n onBeforeRemoveCellClassNames: null,\n onAfterDrawSelection: null,\n onBeforeDrawBorders: null,\n onScrollVertically: null,\n onScrollHorizontally: null,\n onBeforeTouchScroll: null,\n onAfterMomentumScroll: null,\n onBeforeStretchingColumnWidth: (width) => width,\n onModifyRowHeaderWidth: null,\n onModifyGetCellCoords: null,\n\n // constants\n scrollbarWidth: 10,\n scrollbarHeight: 10,\n\n renderAllRows: false,\n groups: false,\n rowHeaderWidth: null,\n columnHeaderHeight: null,\n headerClassName: null\n };\n\n // reference to settings\n this.settings = {};\n\n for (let i in this.defaults) {\n if (hasOwnProperty(this.defaults, i)) {\n if (settings[i] !== void 0) {\n this.settings[i] = settings[i];\n\n } else if (this.defaults[i] === void 0) {\n throw new Error(`A required setting \"${i}\" was not provided`);\n\n } else {\n this.settings[i] = this.defaults[i];\n }\n }\n }\n }\n\n /**\n * Update settings\n *\n * @param {Object} settings\n * @param {*} value\n * @returns {Walkontable}\n */\n update(settings, value) {\n if (value === void 0) { // settings is object\n for (let i in settings) {\n if (hasOwnProperty(settings, i)) {\n this.settings[i] = settings[i];\n }\n }\n } else { // if value is defined then settings is the key\n this.settings[settings] = value;\n }\n return this.wot;\n }\n\n /**\n * Get setting by name\n *\n * @param {String} key\n * @param {*} param1\n * @param {*} param2\n * @param {*} param3\n * @param {*} param4\n * @returns {*}\n */\n getSetting(key, param1, param2, param3, param4) {\n if (typeof this.settings[key] === 'function') {\n // this is faster than .apply - https://github.com/handsontable/handsontable/wiki/JavaScript-&-DOM-performance-tips\n return this.settings[key](param1, param2, param3, param4);\n\n } else if (param1 !== void 0 && Array.isArray(this.settings[key])) {\n // perhaps this can be removed, it is only used in tests\n return this.settings[key][param1];\n\n }\n\n return this.settings[key];\n }\n\n /**\n * Checks if setting exists\n *\n * @param {Boolean} key\n * @returns {Boolean}\n */\n has(key) {\n return !!this.settings[key];\n }\n}\n\nexport default Settings;\n\n\n\n// WEBPACK FOOTER //\n// ./src/3rdparty/walkontable/src/settings.js","import {\n getStyle,\n getTrimmingContainer,\n hasClass,\n index,\n offset,\n removeClass,\n removeTextNodes,\n overlayContainsElement,\n closest\n} from './../../../helpers/dom/element';\nimport {isFunction} from './../../../helpers/function';\nimport CellCoords from './cell/coords';\nimport CellRange from './cell/range';\nimport ColumnFilter from './filter/column';\nimport RowFilter from './filter/row';\nimport TableRenderer from './tableRenderer';\nimport Overlay from './overlay/_base';\n\n/**\n *\n */\nclass Table {\n /**\n * @param {Walkontable} wotInstance\n * @param {HTMLTableElement} table\n */\n constructor(wotInstance, table) {\n this.wot = wotInstance;\n\n // legacy support\n this.instance = this.wot;\n this.TABLE = table;\n this.TBODY = null;\n this.THEAD = null;\n this.COLGROUP = null;\n this.tableOffset = 0;\n this.holderOffset = 0;\n\n removeTextNodes(this.TABLE);\n\n this.spreader = this.createSpreader(this.TABLE);\n this.hider = this.createHider(this.spreader);\n this.holder = this.createHolder(this.hider);\n\n this.wtRootElement = this.holder.parentNode;\n this.alignOverlaysWithTrimmingContainer();\n this.fixTableDomTree();\n\n this.colgroupChildrenLength = this.COLGROUP.childNodes.length;\n this.theadChildrenLength = this.THEAD.firstChild ? this.THEAD.firstChild.childNodes.length : 0;\n this.tbodyChildrenLength = this.TBODY.childNodes.length;\n\n this.rowFilter = null;\n this.columnFilter = null;\n this.correctHeaderWidth = false;\n\n const origRowHeaderWidth = this.wot.wtSettings.settings.rowHeaderWidth;\n\n // Fix for jumping row headers (https://github.com/handsontable/handsontable/issues/3850)\n this.wot.wtSettings.settings.rowHeaderWidth = () => this._modifyRowHeaderWidth(origRowHeaderWidth);\n }\n\n /**\n *\n */\n fixTableDomTree() {\n this.TBODY = this.TABLE.querySelector('tbody');\n\n if (!this.TBODY) {\n this.TBODY = document.createElement('tbody');\n this.TABLE.appendChild(this.TBODY);\n }\n this.THEAD = this.TABLE.querySelector('thead');\n\n if (!this.THEAD) {\n this.THEAD = document.createElement('thead');\n this.TABLE.insertBefore(this.THEAD, this.TBODY);\n }\n this.COLGROUP = this.TABLE.querySelector('colgroup');\n\n if (!this.COLGROUP) {\n this.COLGROUP = document.createElement('colgroup');\n this.TABLE.insertBefore(this.COLGROUP, this.THEAD);\n }\n\n if (this.wot.getSetting('columnHeaders').length && !this.THEAD.childNodes.length) {\n this.THEAD.appendChild(document.createElement('TR'));\n }\n }\n\n /**\n * @param table\n * @returns {HTMLElement}\n */\n createSpreader(table) {\n const parent = table.parentNode;\n let spreader;\n\n if (!parent || parent.nodeType !== 1 || !hasClass(parent, 'wtHolder')) {\n spreader = document.createElement('div');\n spreader.className = 'wtSpreader';\n\n if (parent) {\n // if TABLE is detached (e.g. in Jasmine test), it has no parentNode so we cannot attach holder to it\n parent.insertBefore(spreader, table);\n }\n spreader.appendChild(table);\n }\n spreader.style.position = 'relative';\n\n return spreader;\n }\n\n /**\n * @param spreader\n * @returns {HTMLElement}\n */\n createHider(spreader) {\n const parent = spreader.parentNode;\n let hider;\n\n if (!parent || parent.nodeType !== 1 || !hasClass(parent, 'wtHolder')) {\n hider = document.createElement('div');\n hider.className = 'wtHider';\n\n if (parent) {\n // if TABLE is detached (e.g. in Jasmine test), it has no parentNode so we cannot attach holder to it\n parent.insertBefore(hider, spreader);\n }\n hider.appendChild(spreader);\n }\n\n return hider;\n }\n\n /**\n *\n * @param hider\n * @returns {HTMLElement}\n */\n createHolder(hider) {\n const parent = hider.parentNode;\n let holder;\n\n if (!parent || parent.nodeType !== 1 || !hasClass(parent, 'wtHolder')) {\n holder = document.createElement('div');\n holder.style.position = 'relative';\n holder.className = 'wtHolder';\n\n if (parent) {\n // if TABLE is detached (e.g. in Jasmine test), it has no parentNode so we cannot attach holder to it\n parent.insertBefore(holder, hider);\n }\n if (!this.isWorkingOnClone()) {\n holder.parentNode.className += 'ht_master handsontable';\n }\n holder.appendChild(hider);\n }\n\n return holder;\n }\n\n alignOverlaysWithTrimmingContainer() {\n const trimmingElement = getTrimmingContainer(this.wtRootElement);\n\n if (!this.isWorkingOnClone()) {\n this.holder.parentNode.style.position = 'relative';\n\n if (trimmingElement === window) {\n let preventOverflow = this.wot.getSetting('preventOverflow');\n\n if (!preventOverflow) {\n this.holder.style.overflow = 'visible';\n this.wtRootElement.style.overflow = 'visible';\n }\n } else {\n this.holder.style.width = getStyle(trimmingElement, 'width');\n this.holder.style.height = getStyle(trimmingElement, 'height');\n this.holder.style.overflow = '';\n }\n }\n }\n\n isWorkingOnClone() {\n return !!this.wot.cloneSource;\n }\n\n /**\n * Redraws the table\n *\n * @param {Boolean} fastDraw If TRUE, will try to avoid full redraw and only update the border positions. If FALSE or UNDEFINED, will perform a full redraw\n * @returns {Table}\n */\n draw(fastDraw) {\n const {wtOverlays, wtViewport} = this.wot;\n let totalRows = this.instance.getSetting('totalRows');\n let rowHeaders = this.wot.getSetting('rowHeaders').length;\n let columnHeaders = this.wot.getSetting('columnHeaders').length;\n let syncScroll = false;\n\n if (!this.isWorkingOnClone()) {\n this.holderOffset = offset(this.holder);\n fastDraw = wtViewport.createRenderCalculators(fastDraw);\n\n if (rowHeaders && !this.wot.getSetting('fixedColumnsLeft')) {\n const leftScrollPos = wtOverlays.leftOverlay.getScrollPosition();\n const previousState = this.correctHeaderWidth;\n\n this.correctHeaderWidth = leftScrollPos > 0;\n\n if (previousState !== this.correctHeaderWidth) {\n fastDraw = false;\n }\n }\n }\n\n if (!this.isWorkingOnClone()) {\n syncScroll = wtOverlays.prepareOverlays();\n }\n\n if (fastDraw) {\n if (!this.isWorkingOnClone()) {\n // in case we only scrolled without redraw, update visible rows information in oldRowsCalculator\n wtViewport.createVisibleCalculators();\n }\n if (wtOverlays) {\n wtOverlays.refresh(true);\n }\n } else {\n if (this.isWorkingOnClone()) {\n this.tableOffset = this.wot.cloneSource.wtTable.tableOffset;\n } else {\n this.tableOffset = offset(this.TABLE);\n }\n let startRow;\n\n if (Overlay.isOverlayTypeOf(this.wot.cloneOverlay, Overlay.CLONE_DEBUG) ||\n Overlay.isOverlayTypeOf(this.wot.cloneOverlay, Overlay.CLONE_TOP) ||\n Overlay.isOverlayTypeOf(this.wot.cloneOverlay, Overlay.CLONE_TOP_LEFT_CORNER)) {\n startRow = 0;\n } else if (Overlay.isOverlayTypeOf(this.instance.cloneOverlay, Overlay.CLONE_BOTTOM) ||\n Overlay.isOverlayTypeOf(this.instance.cloneOverlay, Overlay.CLONE_BOTTOM_LEFT_CORNER)) {\n startRow = Math.max(totalRows - this.wot.getSetting('fixedRowsBottom'), 0);\n } else {\n startRow = wtViewport.rowsRenderCalculator.startRow;\n }\n let startColumn;\n\n if (Overlay.isOverlayTypeOf(this.wot.cloneOverlay, Overlay.CLONE_DEBUG) ||\n Overlay.isOverlayTypeOf(this.wot.cloneOverlay, Overlay.CLONE_LEFT) ||\n Overlay.isOverlayTypeOf(this.wot.cloneOverlay, Overlay.CLONE_TOP_LEFT_CORNER) ||\n Overlay.isOverlayTypeOf(this.wot.cloneOverlay, Overlay.CLONE_BOTTOM_LEFT_CORNER)) {\n startColumn = 0;\n } else {\n startColumn = wtViewport.columnsRenderCalculator.startColumn;\n }\n this.rowFilter = new RowFilter(startRow, totalRows, columnHeaders);\n this.columnFilter = new ColumnFilter(startColumn, this.wot.getSetting('totalColumns'), rowHeaders);\n\n this.alignOverlaysWithTrimmingContainer();\n this._doDraw(); // creates calculator after draw\n }\n this.refreshSelections(fastDraw);\n\n if (!this.isWorkingOnClone()) {\n wtOverlays.topOverlay.resetFixedPosition();\n\n if (wtOverlays.bottomOverlay.clone) {\n wtOverlays.bottomOverlay.resetFixedPosition();\n }\n\n wtOverlays.leftOverlay.resetFixedPosition();\n\n if (wtOverlays.topLeftCornerOverlay) {\n wtOverlays.topLeftCornerOverlay.resetFixedPosition();\n }\n\n if (wtOverlays.bottomLeftCornerOverlay && wtOverlays.bottomLeftCornerOverlay.clone) {\n wtOverlays.bottomLeftCornerOverlay.resetFixedPosition();\n }\n }\n if (syncScroll) {\n wtOverlays.syncScrollWithMaster();\n }\n this.wot.drawn = true;\n\n return this;\n }\n\n _doDraw() {\n const wtRenderer = new TableRenderer(this);\n\n wtRenderer.render();\n }\n\n removeClassFromCells(className) {\n const nodes = this.TABLE.querySelectorAll(`.${className}`);\n\n for (let i = 0, len = nodes.length; i < len; i++) {\n removeClass(nodes[i], className);\n }\n }\n\n /**\n * Refresh the table selection by re-rendering Selection instances connected with that instance.\n *\n * @param {Boolean} fastDraw If fast drawing is enabled than additionally className clearing is applied.\n */\n refreshSelections(fastDraw) {\n if (!this.wot.selections) {\n return;\n }\n const highlights = Array.from(this.wot.selections);\n const len = highlights.length;\n\n if (fastDraw) {\n const classesToRemove = [];\n\n for (let i = 0; i < len; i++) {\n const {\n highlightHeaderClassName,\n highlightRowClassName,\n highlightColumnClassName,\n } = highlights[i].settings;\n const classNames = highlights[i].classNames;\n const classNamesLength = classNames.length;\n\n for (let j = 0; j < classNamesLength; j++) {\n if (!classesToRemove.includes(classNames[j])) {\n classesToRemove.push(classNames[j]);\n }\n }\n\n if (highlightHeaderClassName && !classesToRemove.includes(highlightHeaderClassName)) {\n classesToRemove.push(highlightHeaderClassName);\n }\n if (highlightRowClassName && !classesToRemove.includes(highlightRowClassName)) {\n classesToRemove.push(highlightRowClassName);\n }\n if (highlightColumnClassName && !classesToRemove.includes(highlightColumnClassName)) {\n classesToRemove.push(highlightColumnClassName);\n }\n }\n\n let additionalClassesToRemove = this.wot.getSetting('onBeforeRemoveCellClassNames');\n\n if (Array.isArray(additionalClassesToRemove)) {\n for (let i = 0; i < additionalClassesToRemove.length; i++) {\n classesToRemove.push(additionalClassesToRemove[i]);\n }\n }\n\n const classesToRemoveLength = classesToRemove.length;\n\n for (let i = 0; i < classesToRemoveLength; i++) {\n // there was no rerender, so we need to remove classNames by ourselves\n this.removeClassFromCells(classesToRemove[i]);\n }\n }\n\n for (let i = 0; i < len; i++) {\n highlights[i].draw(this.wot, fastDraw);\n }\n }\n\n /**\n * Get cell element at coords.\n *\n * @param {CellCoords} coords\n * @returns {HTMLElement|Number} HTMLElement on success or Number one of the exit codes on error:\n * -1 row before viewport\n * -2 row after viewport\n */\n getCell(coords) {\n let row = coords.row;\n let column = coords.col;\n const hookResult = this.wot.getSetting('onModifyGetCellCoords', row, column);\n\n if (hookResult && Array.isArray(hookResult)) {\n [row, column] = hookResult;\n }\n\n if (this.isRowBeforeRenderedRows(row)) {\n // row before rendered rows\n return -1;\n\n } else if (this.isRowAfterRenderedRows(row)) {\n // row after rendered rows\n return -2;\n }\n\n const TR = this.TBODY.childNodes[this.rowFilter.sourceToRendered(row)];\n\n if (TR) {\n return TR.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(column)];\n }\n }\n\n /**\n * getColumnHeader\n *\n * @param {Number} col Column index\n * @param {Number} [level=0] Header level (0 = most distant to the table)\n * @returns {Object} HTMLElement on success or undefined on error\n */\n getColumnHeader(col, level = 0) {\n const TR = this.THEAD.childNodes[level];\n\n if (TR) {\n return TR.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(col)];\n }\n }\n\n /**\n * getRowHeader\n *\n * @param {Number} row Row index\n * @returns {HTMLElement} HTMLElement on success or Number one of the exit codes on error: `null table doesn't have row headers`\n */\n getRowHeader(row) {\n if (this.columnFilter.sourceColumnToVisibleRowHeadedColumn(0) === 0) {\n return null;\n }\n const TR = this.TBODY.childNodes[this.rowFilter.sourceToRendered(row)];\n\n if (TR) {\n return TR.childNodes[0];\n }\n }\n\n /**\n * Returns cell coords object for a given TD (or a child element of a TD element).\n *\n * @param {HTMLTableCellElement} TD A cell DOM element (or a child of one).\n * @returns {CellCoords|null} The coordinates of the provided TD element (or the closest TD element) or null, if the provided element is not applicable.\n */\n getCoords(TD) {\n if (TD.nodeName !== 'TD' && TD.nodeName !== 'TH') {\n TD = closest(TD, ['TD', 'TH']);\n }\n\n if (TD === null) {\n return null;\n }\n\n const TR = TD.parentNode;\n const CONTAINER = TR.parentNode;\n let row = index(TR);\n let col = TD.cellIndex;\n\n if (overlayContainsElement(Overlay.CLONE_TOP_LEFT_CORNER, TD) || overlayContainsElement(Overlay.CLONE_TOP, TD)) {\n if (CONTAINER.nodeName === 'THEAD') {\n row -= CONTAINER.childNodes.length;\n }\n\n } else if (CONTAINER === this.THEAD) {\n row = this.rowFilter.visibleColHeadedRowToSourceRow(row);\n\n } else {\n row = this.rowFilter.renderedToSource(row);\n }\n\n if (overlayContainsElement(Overlay.CLONE_TOP_LEFT_CORNER, TD) || overlayContainsElement(Overlay.CLONE_LEFT, TD)) {\n col = this.columnFilter.offsettedTH(col);\n\n } else {\n col = this.columnFilter.visibleRowHeadedColumnToSourceColumn(col);\n }\n\n return new CellCoords(row, col);\n }\n\n getTrForRow(row) {\n return this.TBODY.childNodes[this.rowFilter.sourceToRendered(row)];\n }\n\n getFirstRenderedRow() {\n return this.wot.wtViewport.rowsRenderCalculator.startRow;\n }\n\n getFirstVisibleRow() {\n return this.wot.wtViewport.rowsVisibleCalculator.startRow;\n }\n\n getFirstRenderedColumn() {\n return this.wot.wtViewport.columnsRenderCalculator.startColumn;\n }\n\n /**\n * @returns {Number} Returns -1 if no row is visible\n */\n getFirstVisibleColumn() {\n return this.wot.wtViewport.columnsVisibleCalculator.startColumn;\n }\n\n /**\n * @returns {Number} Returns -1 if no row is visible\n */\n getLastRenderedRow() {\n return this.wot.wtViewport.rowsRenderCalculator.endRow;\n }\n\n getLastVisibleRow() {\n return this.wot.wtViewport.rowsVisibleCalculator.endRow;\n }\n\n getLastRenderedColumn() {\n return this.wot.wtViewport.columnsRenderCalculator.endColumn;\n }\n\n /**\n * @returns {Number} Returns -1 if no column is visible\n */\n getLastVisibleColumn() {\n return this.wot.wtViewport.columnsVisibleCalculator.endColumn;\n }\n\n isRowBeforeRenderedRows(row) {\n return this.rowFilter && (this.rowFilter.sourceToRendered(row) < 0 && row >= 0);\n }\n\n isRowAfterViewport(row) {\n return this.rowFilter && (this.rowFilter.sourceToRendered(row) > this.getLastVisibleRow());\n }\n\n isRowAfterRenderedRows(row) {\n return this.rowFilter && (this.rowFilter.sourceToRendered(row) > this.getLastRenderedRow());\n }\n\n isColumnBeforeViewport(column) {\n return this.columnFilter && (this.columnFilter.sourceToRendered(column) < 0 && column >= 0);\n }\n\n isColumnAfterViewport(column) {\n return this.columnFilter && (this.columnFilter.sourceToRendered(column) > this.getLastVisibleColumn());\n }\n\n isLastRowFullyVisible() {\n return this.getLastVisibleRow() === this.getLastRenderedRow();\n }\n\n isLastColumnFullyVisible() {\n return this.getLastVisibleColumn() === this.getLastRenderedColumn();\n }\n\n getRenderedColumnsCount() {\n let columnsCount = this.wot.wtViewport.columnsRenderCalculator.count;\n let totalColumns = this.wot.getSetting('totalColumns');\n\n if (this.wot.isOverlayName(Overlay.CLONE_DEBUG)) {\n columnsCount = totalColumns;\n\n } else if (this.wot.isOverlayName(Overlay.CLONE_LEFT) ||\n this.wot.isOverlayName(Overlay.CLONE_TOP_LEFT_CORNER) ||\n this.wot.isOverlayName(Overlay.CLONE_BOTTOM_LEFT_CORNER)) {\n return Math.min(this.wot.getSetting('fixedColumnsLeft'), totalColumns);\n\n }\n\n return columnsCount;\n }\n\n getRenderedRowsCount() {\n let rowsCount = this.wot.wtViewport.rowsRenderCalculator.count;\n let totalRows = this.wot.getSetting('totalRows');\n\n if (this.wot.isOverlayName(Overlay.CLONE_DEBUG)) {\n rowsCount = totalRows;\n\n } else if (this.wot.isOverlayName(Overlay.CLONE_TOP) ||\n this.wot.isOverlayName(Overlay.CLONE_TOP_LEFT_CORNER)) {\n rowsCount = Math.min(this.wot.getSetting('fixedRowsTop'), totalRows);\n\n } else if (this.wot.isOverlayName(Overlay.CLONE_BOTTOM) ||\n this.wot.isOverlayName(Overlay.CLONE_BOTTOM_LEFT_CORNER)) {\n rowsCount = Math.min(this.wot.getSetting('fixedRowsBottom'), totalRows);\n }\n\n return rowsCount;\n }\n\n getVisibleRowsCount() {\n return this.wot.wtViewport.rowsVisibleCalculator.count;\n }\n\n allRowsInViewport() {\n return this.wot.getSetting('totalRows') == this.getVisibleRowsCount();\n }\n\n /**\n * Checks if any of the row's cells content exceeds its initial height, and if so, returns the oversized height\n *\n * @param {Number} sourceRow\n * @returns {Number}\n */\n getRowHeight(sourceRow) {\n let height = this.wot.wtSettings.settings.rowHeight(sourceRow);\n let oversizedHeight = this.wot.wtViewport.oversizedRows[sourceRow];\n\n if (oversizedHeight !== void 0) {\n height = height === void 0 ? oversizedHeight : Math.max(height, oversizedHeight);\n }\n\n return height;\n }\n\n getColumnHeaderHeight(level) {\n let height = this.wot.wtSettings.settings.defaultRowHeight;\n let oversizedHeight = this.wot.wtViewport.oversizedColumnHeaders[level];\n\n if (oversizedHeight !== void 0) {\n height = height ? Math.max(height, oversizedHeight) : oversizedHeight;\n }\n\n return height;\n }\n\n getVisibleColumnsCount() {\n return this.wot.wtViewport.columnsVisibleCalculator.count;\n }\n\n allColumnsInViewport() {\n return this.wot.getSetting('totalColumns') == this.getVisibleColumnsCount();\n }\n\n getColumnWidth(sourceColumn) {\n let width = this.wot.wtSettings.settings.columnWidth;\n\n if (typeof width === 'function') {\n width = width(sourceColumn);\n\n } else if (typeof width === 'object') {\n width = width[sourceColumn];\n }\n\n return width || this.wot.wtSettings.settings.defaultColumnWidth;\n }\n\n getStretchedColumnWidth(sourceColumn) {\n let columnWidth = this.getColumnWidth(sourceColumn);\n let width = columnWidth == null ? this.instance.wtSettings.settings.defaultColumnWidth : columnWidth;\n let calculator = this.wot.wtViewport.columnsRenderCalculator;\n\n if (calculator) {\n let stretchedWidth = calculator.getStretchedColumnWidth(sourceColumn, width);\n\n if (stretchedWidth) {\n width = stretchedWidth;\n }\n }\n\n return width;\n }\n\n /**\n * Modify row header widths provided by user in class contructor.\n *\n * @private\n */\n _modifyRowHeaderWidth(rowHeaderWidthFactory) {\n let widths = isFunction(rowHeaderWidthFactory) ? rowHeaderWidthFactory() : null;\n\n if (Array.isArray(widths)) {\n widths = [...widths];\n widths[widths.length - 1] = this._correctRowHeaderWidth(widths[widths.length - 1]);\n } else {\n widths = this._correctRowHeaderWidth(widths);\n }\n\n return widths;\n }\n\n /**\n * Correct row header width if necessary.\n *\n * @private\n */\n _correctRowHeaderWidth(width) {\n if (typeof width !== 'number') {\n width = this.wot.getSetting('defaultColumnWidth');\n }\n if (this.correctHeaderWidth) {\n width++;\n }\n\n return width;\n }\n}\n\nexport default Table;\n\n\n\n// WEBPACK FOOTER //\n// ./src/3rdparty/walkontable/src/table.js","import {\n addClass,\n empty,\n getScrollbarWidth,\n hasClass,\n innerHeight,\n outerWidth\n} from './../../../helpers/dom/element';\nimport {warn} from './../../../helpers/console';\nimport {toSingleLine} from './../../../helpers/templateLiteralTag';\nimport Overlay from './overlay/_base';\n\nlet performanceWarningAppeared = false;\n\n/**\n * @class TableRenderer\n */\nclass TableRenderer {\n /**\n * @param {WalkontableTable} wtTable\n */\n constructor(wtTable) {\n this.wtTable = wtTable;\n this.wot = wtTable.instance;\n\n // legacy support\n this.instance = wtTable.instance;\n\n this.rowFilter = wtTable.rowFilter;\n this.columnFilter = wtTable.columnFilter;\n\n this.TABLE = wtTable.TABLE;\n this.THEAD = wtTable.THEAD;\n this.TBODY = wtTable.TBODY;\n this.COLGROUP = wtTable.COLGROUP;\n\n this.rowHeaders = [];\n this.rowHeaderCount = 0;\n this.columnHeaders = [];\n this.columnHeaderCount = 0;\n this.fixedRowsTop = 0;\n this.fixedRowsBottom = 0;\n }\n\n /**\n *\n */\n render() {\n if (!this.wtTable.isWorkingOnClone()) {\n const skipRender = {};\n this.wot.getSetting('beforeDraw', true, skipRender);\n\n if (skipRender.skipRender === true) {\n return;\n }\n }\n\n this.rowHeaders = this.wot.getSetting('rowHeaders');\n this.rowHeaderCount = this.rowHeaders.length;\n this.fixedRowsTop = this.wot.getSetting('fixedRowsTop');\n this.fixedRowsBottom = this.wot.getSetting('fixedRowsBottom');\n this.columnHeaders = this.wot.getSetting('columnHeaders');\n this.columnHeaderCount = this.columnHeaders.length;\n\n let columnsToRender = this.wtTable.getRenderedColumnsCount();\n let rowsToRender = this.wtTable.getRenderedRowsCount();\n let totalColumns = this.wot.getSetting('totalColumns');\n let totalRows = this.wot.getSetting('totalRows');\n let workspaceWidth;\n let adjusted = false;\n\n if (Overlay.isOverlayTypeOf(this.wot.cloneOverlay, Overlay.CLONE_BOTTOM) ||\n Overlay.isOverlayTypeOf(this.wot.cloneOverlay, Overlay.CLONE_BOTTOM_LEFT_CORNER)) {\n\n // do NOT render headers on the bottom or bottom-left corner overlay\n this.columnHeaders = [];\n this.columnHeaderCount = 0;\n }\n\n if (totalColumns >= 0) {\n // prepare COL and TH elements for rendering\n this.adjustAvailableNodes();\n adjusted = true;\n\n // adjust column widths according to user widths settings\n this.renderColumnHeaders();\n\n // Render table rows\n this.renderRows(totalRows, rowsToRender, columnsToRender);\n\n if (!this.wtTable.isWorkingOnClone()) {\n workspaceWidth = this.wot.wtViewport.getWorkspaceWidth();\n this.wot.wtViewport.containerWidth = null;\n }\n\n this.adjustColumnWidths(columnsToRender);\n this.markOversizedColumnHeaders();\n this.adjustColumnHeaderHeights();\n }\n\n if (!adjusted) {\n this.adjustAvailableNodes();\n }\n this.removeRedundantRows(rowsToRender);\n\n if (!this.wtTable.isWorkingOnClone() || this.wot.isOverlayName(Overlay.CLONE_BOTTOM)) {\n this.markOversizedRows();\n }\n if (!this.wtTable.isWorkingOnClone()) {\n this.wot.wtViewport.createVisibleCalculators();\n this.wot.wtOverlays.refresh(false);\n\n this.wot.wtOverlays.applyToDOM();\n\n let hiderWidth = outerWidth(this.wtTable.hider);\n let tableWidth = outerWidth(this.wtTable.TABLE);\n\n if (hiderWidth !== 0 && (tableWidth !== hiderWidth)) {\n // Recalculate the column widths, if width changes made in the overlays removed the scrollbar, thus changing the viewport width.\n this.adjustColumnWidths(columnsToRender);\n }\n\n if (workspaceWidth !== this.wot.wtViewport.getWorkspaceWidth()) {\n // workspace width changed though to shown/hidden vertical scrollbar. Let's reapply stretching\n this.wot.wtViewport.containerWidth = null;\n\n let firstRendered = this.wtTable.getFirstRenderedColumn();\n let lastRendered = this.wtTable.getLastRenderedColumn();\n let defaultColumnWidth = this.wot.getSetting('defaultColumnWidth');\n let rowHeaderWidthSetting = this.wot.getSetting('rowHeaderWidth');\n\n rowHeaderWidthSetting = this.instance.getSetting('onModifyRowHeaderWidth', rowHeaderWidthSetting);\n\n if (rowHeaderWidthSetting != null) {\n for (let i = 0; i < this.rowHeaderCount; i++) {\n let width = Array.isArray(rowHeaderWidthSetting) ? rowHeaderWidthSetting[i] : rowHeaderWidthSetting;\n\n width = width == null ? defaultColumnWidth : width;\n\n this.COLGROUP.childNodes[i].style.width = `${width}px`;\n }\n }\n\n for (let i = firstRendered; i < lastRendered; i++) {\n let width = this.wtTable.getStretchedColumnWidth(i);\n let renderedIndex = this.columnFilter.sourceToRendered(i);\n\n this.COLGROUP.childNodes[renderedIndex + this.rowHeaderCount].style.width = `${width}px`;\n }\n }\n\n this.wot.getSetting('onDraw', true);\n\n } else if (this.wot.isOverlayName(Overlay.CLONE_BOTTOM)) {\n this.wot.cloneSource.wtOverlays.adjustElementsSize();\n }\n }\n\n /**\n * @param {Number} renderedRowsCount\n */\n removeRedundantRows(renderedRowsCount) {\n while (this.wtTable.tbodyChildrenLength > renderedRowsCount) {\n this.TBODY.removeChild(this.TBODY.lastChild);\n this.wtTable.tbodyChildrenLength--;\n }\n }\n\n /**\n * @param {Number} totalRows\n * @param {Number} rowsToRender\n * @param {Number} columnsToRender\n */\n renderRows(totalRows, rowsToRender, columnsToRender) {\n let lastTD;\n let TR;\n let visibleRowIndex = 0;\n let sourceRowIndex = this.rowFilter.renderedToSource(visibleRowIndex);\n let isWorkingOnClone = this.wtTable.isWorkingOnClone();\n\n while (sourceRowIndex < totalRows && sourceRowIndex >= 0) {\n if (!performanceWarningAppeared && visibleRowIndex > 1000) {\n performanceWarningAppeared = true;\n warn(toSingleLine`Performance tip: Handsontable rendered more than 1000 visible rows. Consider limiting the number \n of rendered rows by specifying the table height and/or turning off the \"renderAllRows\" option.`);\n }\n if (rowsToRender !== void 0 && visibleRowIndex === rowsToRender) {\n // We have as much rows as needed for this clone\n break;\n }\n TR = this.getOrCreateTrForRow(visibleRowIndex, TR);\n\n // Render row headers\n this.renderRowHeaders(sourceRowIndex, TR);\n // Add and/or remove TDs to TR to match the desired number\n this.adjustColumns(TR, columnsToRender + this.rowHeaderCount);\n\n lastTD = this.renderCells(sourceRowIndex, TR, columnsToRender);\n\n if (!isWorkingOnClone ||\n // Necessary to refresh oversized row heights after editing cell in overlays\n this.wot.isOverlayName(Overlay.CLONE_BOTTOM)) {\n // Reset the oversized row cache for this row\n this.resetOversizedRow(sourceRowIndex);\n }\n\n if (TR.firstChild) {\n // if I have 2 fixed columns with one-line content and the 3rd column has a multiline content, this is\n // the way to make sure that the overlay will has same row height\n let height = this.wot.wtTable.getRowHeight(sourceRowIndex);\n\n if (height) {\n // Decrease height. 1 pixel will be \"replaced\" by 1px border top\n height--;\n TR.firstChild.style.height = `${height}px`;\n } else {\n TR.firstChild.style.height = '';\n }\n }\n visibleRowIndex++;\n sourceRowIndex = this.rowFilter.renderedToSource(visibleRowIndex);\n }\n }\n\n /**\n * Reset the oversized row cache for the provided index\n *\n * @param {Number} sourceRow Row index\n */\n resetOversizedRow(sourceRow) {\n if (this.wot.getSetting('externalRowCalculator')) {\n return;\n }\n if (this.wot.wtViewport.oversizedRows && this.wot.wtViewport.oversizedRows[sourceRow]) {\n this.wot.wtViewport.oversizedRows[sourceRow] = void 0;\n }\n }\n\n /**\n * Check if any of the rendered rows is higher than expected, and if so, cache them\n */\n markOversizedRows() {\n if (this.wot.getSetting('externalRowCalculator')) {\n return;\n }\n let rowCount = this.instance.wtTable.TBODY.childNodes.length;\n let expectedTableHeight = rowCount * this.instance.wtSettings.settings.defaultRowHeight;\n let actualTableHeight = innerHeight(this.instance.wtTable.TBODY) - 1;\n let previousRowHeight;\n let rowInnerHeight;\n let sourceRowIndex;\n let currentTr;\n let rowHeader;\n let totalRows = this.instance.getSetting('totalRows');\n\n if (expectedTableHeight === actualTableHeight && !this.instance.getSetting('fixedRowsBottom')) {\n // If the actual table height equals rowCount * default single row height, no row is oversized -> no need to iterate over them\n return;\n }\n\n while (rowCount) {\n rowCount--;\n sourceRowIndex = this.instance.wtTable.rowFilter.renderedToSource(rowCount);\n previousRowHeight = this.instance.wtTable.getRowHeight(sourceRowIndex);\n currentTr = this.instance.wtTable.getTrForRow(sourceRowIndex);\n rowHeader = currentTr.querySelector('th');\n\n if (rowHeader) {\n rowInnerHeight = innerHeight(rowHeader);\n } else {\n rowInnerHeight = innerHeight(currentTr) - 1;\n }\n\n if ((!previousRowHeight && this.instance.wtSettings.settings.defaultRowHeight < rowInnerHeight ||\n previousRowHeight < rowInnerHeight)) {\n this.instance.wtViewport.oversizedRows[sourceRowIndex] = ++rowInnerHeight;\n }\n }\n }\n\n /**\n * Check if any of the rendered columns is higher than expected, and if so, cache them.\n */\n markOversizedColumnHeaders() {\n let overlayName = this.wot.getOverlayName();\n\n if (!this.columnHeaderCount || this.wot.wtViewport.hasOversizedColumnHeadersMarked[overlayName] || this.wtTable.isWorkingOnClone()) {\n return;\n }\n let columnCount = this.wtTable.getRenderedColumnsCount();\n\n for (let i = 0; i < this.columnHeaderCount; i++) {\n for (let renderedColumnIndex = (-1) * this.rowHeaderCount; renderedColumnIndex < columnCount; renderedColumnIndex++) {\n this.markIfOversizedColumnHeader(renderedColumnIndex);\n }\n }\n this.wot.wtViewport.hasOversizedColumnHeadersMarked[overlayName] = true;\n }\n\n /**\n *\n */\n adjustColumnHeaderHeights() {\n let columnHeaders = this.wot.getSetting('columnHeaders');\n let children = this.wot.wtTable.THEAD.childNodes;\n let oversizedColumnHeaders = this.wot.wtViewport.oversizedColumnHeaders;\n\n for (let i = 0, len = columnHeaders.length; i < len; i++) {\n if (oversizedColumnHeaders[i]) {\n if (!children[i] || children[i].childNodes.length === 0) {\n return;\n }\n children[i].childNodes[0].style.height = `${oversizedColumnHeaders[i]}px`;\n }\n }\n }\n\n /**\n * Check if column header for the specified column is higher than expected, and if so, cache it\n *\n * @param {Number} col Index of column\n */\n markIfOversizedColumnHeader(col) {\n let sourceColIndex = this.wot.wtTable.columnFilter.renderedToSource(col);\n let level = this.columnHeaderCount;\n let defaultRowHeight = this.wot.wtSettings.settings.defaultRowHeight;\n let previousColHeaderHeight;\n let currentHeader;\n let currentHeaderHeight;\n let columnHeaderHeightSetting = this.wot.getSetting('columnHeaderHeight') || [];\n\n while (level) {\n level--;\n\n previousColHeaderHeight = this.wot.wtTable.getColumnHeaderHeight(level);\n currentHeader = this.wot.wtTable.getColumnHeader(sourceColIndex, level);\n\n if (!currentHeader) {\n /* eslint-disable no-continue */\n continue;\n }\n currentHeaderHeight = innerHeight(currentHeader);\n\n if (!previousColHeaderHeight && defaultRowHeight < currentHeaderHeight || previousColHeaderHeight < currentHeaderHeight) {\n this.wot.wtViewport.oversizedColumnHeaders[level] = currentHeaderHeight;\n }\n\n if (Array.isArray(columnHeaderHeightSetting)) {\n if (columnHeaderHeightSetting[level] != null) {\n this.wot.wtViewport.oversizedColumnHeaders[level] = columnHeaderHeightSetting[level];\n }\n\n } else if (!isNaN(columnHeaderHeightSetting)) {\n this.wot.wtViewport.oversizedColumnHeaders[level] = columnHeaderHeightSetting;\n }\n\n if (this.wot.wtViewport.oversizedColumnHeaders[level] < (columnHeaderHeightSetting[level] || columnHeaderHeightSetting)) {\n this.wot.wtViewport.oversizedColumnHeaders[level] = (columnHeaderHeightSetting[level] || columnHeaderHeightSetting);\n }\n }\n }\n\n /**\n * @param {Number} sourceRowIndex\n * @param {HTMLTableRowElement} TR\n * @param {Number} columnsToRender\n * @returns {HTMLTableCellElement}\n */\n renderCells(sourceRowIndex, TR, columnsToRender) {\n let TD;\n let sourceColIndex;\n\n for (let visibleColIndex = 0; visibleColIndex < columnsToRender; visibleColIndex++) {\n sourceColIndex = this.columnFilter.renderedToSource(visibleColIndex);\n\n if (visibleColIndex === 0) {\n TD = TR.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(sourceColIndex)];\n } else {\n TD = TD.nextSibling; // http://jsperf.com/nextsibling-vs-indexed-childnodes\n }\n // If the number of headers has been reduced, we need to replace excess TH with TD\n if (TD.nodeName == 'TH') {\n TD = replaceThWithTd(TD, TR);\n }\n if (!hasClass(TD, 'hide')) {\n TD.className = '';\n }\n TD.removeAttribute('style');\n this.wot.wtSettings.settings.cellRenderer(sourceRowIndex, sourceColIndex, TD);\n }\n\n return TD;\n }\n\n /**\n * @param {Number} columnsToRender Number of columns to render.\n */\n adjustColumnWidths(columnsToRender) {\n let scrollbarCompensation = 0;\n let sourceInstance = this.wot.cloneSource ? this.wot.cloneSource : this.wot;\n let mainHolder = sourceInstance.wtTable.holder;\n let defaultColumnWidth = this.wot.getSetting('defaultColumnWidth');\n let rowHeaderWidthSetting = this.wot.getSetting('rowHeaderWidth');\n\n if (mainHolder.offsetHeight < mainHolder.scrollHeight) {\n scrollbarCompensation = getScrollbarWidth();\n }\n this.wot.wtViewport.columnsRenderCalculator.refreshStretching(this.wot.wtViewport.getViewportWidth() - scrollbarCompensation);\n\n rowHeaderWidthSetting = this.instance.getSetting('onModifyRowHeaderWidth', rowHeaderWidthSetting);\n\n if (rowHeaderWidthSetting != null) {\n for (let i = 0; i < this.rowHeaderCount; i++) {\n let width = Array.isArray(rowHeaderWidthSetting) ? rowHeaderWidthSetting[i] : rowHeaderWidthSetting;\n\n width = width == null ? defaultColumnWidth : width;\n\n this.COLGROUP.childNodes[i].style.width = `${width}px`;\n }\n }\n\n for (let renderedColIndex = 0; renderedColIndex < columnsToRender; renderedColIndex++) {\n let width = this.wtTable.getStretchedColumnWidth(this.columnFilter.renderedToSource(renderedColIndex));\n\n this.COLGROUP.childNodes[renderedColIndex + this.rowHeaderCount].style.width = `${width}px`;\n }\n }\n\n /**\n * @param {HTMLTableCellElement} TR\n */\n appendToTbody(TR) {\n this.TBODY.appendChild(TR);\n this.wtTable.tbodyChildrenLength++;\n }\n\n /**\n * @param {Number} rowIndex\n * @param {HTMLTableRowElement} currentTr\n * @returns {HTMLTableCellElement}\n */\n getOrCreateTrForRow(rowIndex, currentTr) {\n let TR;\n\n if (rowIndex >= this.wtTable.tbodyChildrenLength) {\n TR = this.createRow();\n this.appendToTbody(TR);\n\n } else if (rowIndex === 0) {\n TR = this.TBODY.firstChild;\n\n } else {\n // http://jsperf.com/nextsibling-vs-indexed-childnodes\n TR = currentTr.nextSibling;\n }\n if (TR.className) {\n TR.removeAttribute('class');\n }\n\n return TR;\n }\n\n /**\n * @returns {HTMLTableCellElement}\n */\n createRow() {\n let TR = document.createElement('TR');\n\n for (let visibleColIndex = 0; visibleColIndex < this.rowHeaderCount; visibleColIndex++) {\n TR.appendChild(document.createElement('TH'));\n }\n\n return TR;\n }\n\n /**\n * @param {Number} row\n * @param {Number} col\n * @param {HTMLTableCellElement} TH\n */\n renderRowHeader(row, col, TH) {\n TH.className = '';\n TH.removeAttribute('style');\n this.rowHeaders[col](row, TH, col);\n }\n\n /**\n * @param {Number} row\n * @param {HTMLTableCellElement} TR\n */\n renderRowHeaders(row, TR) {\n for (let TH = TR.firstChild, visibleColIndex = 0; visibleColIndex < this.rowHeaderCount; visibleColIndex++) {\n // If the number of row headers increased we need to create TH or replace an existing TD node with TH\n if (!TH) {\n TH = document.createElement('TH');\n TR.appendChild(TH);\n\n } else if (TH.nodeName == 'TD') {\n TH = replaceTdWithTh(TH, TR);\n }\n this.renderRowHeader(row, visibleColIndex, TH);\n // http://jsperf.com/nextsibling-vs-indexed-childnodes\n TH = TH.nextSibling;\n }\n }\n\n /**\n * Adjust the number of COL and TH elements to match the number of columns and headers that need to be rendered\n */\n adjustAvailableNodes() {\n this.adjustColGroups();\n this.adjustThead();\n }\n\n /**\n * Renders the column headers\n */\n renderColumnHeaders() {\n if (!this.columnHeaderCount) {\n return;\n }\n let columnCount = this.wtTable.getRenderedColumnsCount();\n\n for (let i = 0; i < this.columnHeaderCount; i++) {\n let TR = this.getTrForColumnHeaders(i);\n\n for (let renderedColumnIndex = (-1) * this.rowHeaderCount; renderedColumnIndex < columnCount; renderedColumnIndex++) {\n let sourceCol = this.columnFilter.renderedToSource(renderedColumnIndex);\n\n this.renderColumnHeader(i, sourceCol, TR.childNodes[renderedColumnIndex + this.rowHeaderCount]);\n }\n }\n }\n\n /**\n * Adjusts the number of COL elements to match the number of columns that need to be rendered\n */\n adjustColGroups() {\n let columnCount = this.wtTable.getRenderedColumnsCount();\n\n while (this.wtTable.colgroupChildrenLength < columnCount + this.rowHeaderCount) {\n this.COLGROUP.appendChild(document.createElement('COL'));\n this.wtTable.colgroupChildrenLength++;\n }\n while (this.wtTable.colgroupChildrenLength > columnCount + this.rowHeaderCount) {\n this.COLGROUP.removeChild(this.COLGROUP.lastChild);\n this.wtTable.colgroupChildrenLength--;\n }\n if (this.rowHeaderCount) {\n addClass(this.COLGROUP.childNodes[0], 'rowHeader');\n }\n }\n\n /**\n * Adjusts the number of TH elements in THEAD to match the number of headers and columns that need to be rendered\n */\n adjustThead() {\n let columnCount = this.wtTable.getRenderedColumnsCount();\n let TR = this.THEAD.firstChild;\n\n if (this.columnHeaders.length) {\n for (let i = 0, len = this.columnHeaders.length; i < len; i++) {\n TR = this.THEAD.childNodes[i];\n\n if (!TR) {\n TR = document.createElement('TR');\n this.THEAD.appendChild(TR);\n }\n this.theadChildrenLength = TR.childNodes.length;\n\n while (this.theadChildrenLength < columnCount + this.rowHeaderCount) {\n TR.appendChild(document.createElement('TH'));\n this.theadChildrenLength++;\n }\n while (this.theadChildrenLength > columnCount + this.rowHeaderCount) {\n TR.removeChild(TR.lastChild);\n this.theadChildrenLength--;\n }\n }\n let theadChildrenLength = this.THEAD.childNodes.length;\n\n if (theadChildrenLength > this.columnHeaders.length) {\n for (let i = this.columnHeaders.length; i < theadChildrenLength; i++) {\n this.THEAD.removeChild(this.THEAD.lastChild);\n }\n }\n } else if (TR) {\n empty(TR);\n }\n }\n\n /**\n * @param {Number} index\n * @returns {HTMLTableCellElement}\n */\n getTrForColumnHeaders(index) {\n return this.THEAD.childNodes[index];\n }\n\n /**\n * @param {Number} row\n * @param {Number} col\n * @param {HTMLTableCellElement} TH\n * @returns {*}\n */\n renderColumnHeader(row, col, TH) {\n TH.className = '';\n TH.removeAttribute('style');\n\n return this.columnHeaders[row](col, TH, row);\n }\n\n /**\n * Add and/or remove the TDs to match the desired number\n *\n * @param {HTMLTableCellElement} TR Table row in question\n * @param {Number} desiredCount The desired number of TDs in the TR\n */\n adjustColumns(TR, desiredCount) {\n let count = TR.childNodes.length;\n\n while (count < desiredCount) {\n let TD = document.createElement('TD');\n\n TR.appendChild(TD);\n count++;\n }\n while (count > desiredCount) {\n TR.removeChild(TR.lastChild);\n count--;\n }\n }\n\n /**\n * @param {Number} columnsToRender\n */\n removeRedundantColumns(columnsToRender) {\n while (this.wtTable.tbodyChildrenLength > columnsToRender) {\n this.TBODY.removeChild(this.TBODY.lastChild);\n this.wtTable.tbodyChildrenLength--;\n }\n }\n}\n\nfunction replaceTdWithTh(TD, TR) {\n let TH = document.createElement('TH');\n\n TR.insertBefore(TH, TD);\n TR.removeChild(TD);\n\n return TH;\n}\n\nfunction replaceThWithTd(TH, TR) {\n let TD = document.createElement('TD');\n\n TR.insertBefore(TD, TH);\n TR.removeChild(TH);\n\n return TD;\n}\n\nexport default TableRenderer;\n\n\n\n// WEBPACK FOOTER //\n// ./src/3rdparty/walkontable/src/tableRenderer.js","import {\n getScrollbarWidth,\n getScrollTop,\n getStyle,\n offset,\n outerHeight,\n outerWidth,\n} from './../../../helpers/dom/element';\nimport {objectEach} from './../../../helpers/object';\nimport EventManager from './../../../eventManager';\nimport ViewportColumnsCalculator from './calculator/viewportColumns';\nimport ViewportRowsCalculator from './calculator/viewportRows';\n\n/**\n * @class Viewport\n */\nclass Viewport {\n /**\n * @param wotInstance\n */\n constructor(wotInstance) {\n this.wot = wotInstance;\n // legacy support\n this.instance = this.wot;\n\n this.oversizedRows = [];\n this.oversizedColumnHeaders = [];\n this.hasOversizedColumnHeadersMarked = {};\n this.clientHeight = 0;\n this.containerWidth = NaN;\n this.rowHeaderWidth = NaN;\n this.rowsVisibleCalculator = null;\n this.columnsVisibleCalculator = null;\n\n this.eventManager = new EventManager(this.wot);\n this.eventManager.addEventListener(window, 'resize', () => {\n this.clientHeight = this.getWorkspaceHeight();\n });\n }\n\n /**\n * @returns {number}\n */\n getWorkspaceHeight() {\n let trimmingContainer = this.instance.wtOverlays.topOverlay.trimmingContainer;\n let elemHeight;\n let height = 0;\n\n if (trimmingContainer === window) {\n height = document.documentElement.clientHeight;\n\n } else {\n elemHeight = outerHeight(trimmingContainer);\n // returns height without DIV scrollbar\n height = (elemHeight > 0 && trimmingContainer.clientHeight > 0) ? trimmingContainer.clientHeight : Infinity;\n }\n\n return height;\n }\n\n getWorkspaceWidth() {\n let width;\n let totalColumns = this.wot.getSetting('totalColumns');\n let trimmingContainer = this.instance.wtOverlays.leftOverlay.trimmingContainer;\n let overflow;\n let stretchSetting = this.wot.getSetting('stretchH');\n let docOffsetWidth = document.documentElement.offsetWidth;\n let preventOverflow = this.wot.getSetting('preventOverflow');\n\n if (preventOverflow) {\n return outerWidth(this.instance.wtTable.wtRootElement);\n }\n\n if (this.wot.getSetting('freezeOverlays')) {\n width = Math.min(docOffsetWidth - this.getWorkspaceOffset().left, docOffsetWidth);\n } else {\n width = Math.min(this.getContainerFillWidth(), docOffsetWidth - this.getWorkspaceOffset().left, docOffsetWidth);\n }\n\n if (trimmingContainer === window && totalColumns > 0 && this.sumColumnWidths(0, totalColumns - 1) > width) {\n // in case sum of column widths is higher than available stylesheet width, let's assume using the whole window\n // otherwise continue below, which will allow stretching\n // this is used in `scroll_window.html`\n // TODO test me\n return document.documentElement.clientWidth;\n }\n\n if (trimmingContainer !== window) {\n overflow = getStyle(this.instance.wtOverlays.leftOverlay.trimmingContainer, 'overflow');\n\n if (overflow == 'scroll' || overflow == 'hidden' || overflow == 'auto') {\n // this is used in `scroll.html`\n // TODO test me\n return Math.max(width, trimmingContainer.clientWidth);\n }\n }\n\n if (stretchSetting === 'none' || !stretchSetting) {\n // if no stretching is used, return the maximum used workspace width\n return Math.max(width, outerWidth(this.instance.wtTable.TABLE));\n }\n\n // if stretching is used, return the actual container width, so the columns can fit inside it\n return width;\n }\n\n /**\n * Checks if viewport has vertical scroll\n *\n * @returns {Boolean}\n */\n hasVerticalScroll() {\n return this.getWorkspaceActualHeight() > this.getWorkspaceHeight();\n }\n\n /**\n * Checks if viewport has horizontal scroll\n *\n * @returns {Boolean}\n */\n hasHorizontalScroll() {\n return this.getWorkspaceActualWidth() > this.getWorkspaceWidth();\n }\n\n /**\n * @param from\n * @param length\n * @returns {Number}\n */\n sumColumnWidths(from, length) {\n let sum = 0;\n\n while (from < length) {\n sum += this.wot.wtTable.getColumnWidth(from);\n from++;\n }\n\n return sum;\n }\n\n /**\n * @returns {Number}\n */\n getContainerFillWidth() {\n if (this.containerWidth) {\n return this.containerWidth;\n }\n let mainContainer = this.instance.wtTable.holder;\n let fillWidth;\n let dummyElement;\n\n dummyElement = document.createElement('div');\n dummyElement.style.width = '100%';\n dummyElement.style.height = '1px';\n mainContainer.appendChild(dummyElement);\n fillWidth = dummyElement.offsetWidth;\n\n this.containerWidth = fillWidth;\n mainContainer.removeChild(dummyElement);\n\n return fillWidth;\n }\n\n /**\n * @returns {Number}\n */\n getWorkspaceOffset() {\n return offset(this.wot.wtTable.TABLE);\n }\n\n /**\n * @returns {Number}\n */\n getWorkspaceActualHeight() {\n return outerHeight(this.wot.wtTable.TABLE);\n }\n\n /**\n * @returns {Number}\n */\n getWorkspaceActualWidth() {\n return outerWidth(this.wot.wtTable.TABLE) ||\n outerWidth(this.wot.wtTable.TBODY) ||\n outerWidth(this.wot.wtTable.THEAD); // IE8 reports 0 as <table> offsetWidth;\n }\n\n /**\n * @returns {Number}\n */\n getColumnHeaderHeight() {\n if (isNaN(this.columnHeaderHeight)) {\n this.columnHeaderHeight = outerHeight(this.wot.wtTable.THEAD);\n }\n\n return this.columnHeaderHeight;\n }\n\n /**\n * @returns {Number}\n */\n getViewportHeight() {\n let containerHeight = this.getWorkspaceHeight();\n let columnHeaderHeight;\n\n if (containerHeight === Infinity) {\n return containerHeight;\n }\n columnHeaderHeight = this.getColumnHeaderHeight();\n\n if (columnHeaderHeight > 0) {\n containerHeight -= columnHeaderHeight;\n }\n\n return containerHeight;\n }\n\n /**\n * @returns {Number}\n */\n getRowHeaderWidth() {\n let rowHeadersHeightSetting = this.instance.getSetting('rowHeaderWidth');\n let rowHeaders = this.instance.getSetting('rowHeaders');\n\n if (rowHeadersHeightSetting) {\n this.rowHeaderWidth = 0;\n\n for (let i = 0, len = rowHeaders.length; i < len; i++) {\n this.rowHeaderWidth += rowHeadersHeightSetting[i] || rowHeadersHeightSetting;\n }\n }\n\n if (this.wot.cloneSource) {\n return this.wot.cloneSource.wtViewport.getRowHeaderWidth();\n }\n\n if (isNaN(this.rowHeaderWidth)) {\n\n if (rowHeaders.length) {\n let TH = this.instance.wtTable.TABLE.querySelector('TH');\n this.rowHeaderWidth = 0;\n\n for (let i = 0, len = rowHeaders.length; i < len; i++) {\n if (TH) {\n this.rowHeaderWidth += outerWidth(TH);\n TH = TH.nextSibling;\n\n } else {\n // yes this is a cheat but it worked like that before, just taking assumption from CSS instead of measuring.\n // TODO: proper fix\n this.rowHeaderWidth += 50;\n }\n }\n } else {\n this.rowHeaderWidth = 0;\n }\n }\n\n this.rowHeaderWidth = this.instance.getSetting('onModifyRowHeaderWidth', this.rowHeaderWidth) || this.rowHeaderWidth;\n\n return this.rowHeaderWidth;\n }\n\n /**\n * @returns {Number}\n */\n getViewportWidth() {\n let containerWidth = this.getWorkspaceWidth();\n let rowHeaderWidth;\n\n if (containerWidth === Infinity) {\n return containerWidth;\n }\n rowHeaderWidth = this.getRowHeaderWidth();\n\n if (rowHeaderWidth > 0) {\n return containerWidth - rowHeaderWidth;\n }\n\n return containerWidth;\n }\n\n /**\n * Creates:\n * - rowsRenderCalculator (before draw, to qualify rows for rendering)\n * - rowsVisibleCalculator (after draw, to measure which rows are actually visible)\n *\n * @returns {ViewportRowsCalculator}\n */\n createRowsCalculator(visible = false) {\n let height;\n let pos;\n let fixedRowsTop;\n let scrollbarHeight;\n let fixedRowsBottom;\n let fixedRowsHeight;\n let totalRows;\n\n this.rowHeaderWidth = NaN;\n\n if (this.wot.wtSettings.settings.renderAllRows && !visible) {\n height = Infinity;\n } else {\n height = this.getViewportHeight();\n }\n pos = this.wot.wtOverlays.topOverlay.getScrollPosition() - this.wot.wtOverlays.topOverlay.getTableParentOffset();\n\n if (pos < 0) {\n pos = 0;\n }\n fixedRowsTop = this.wot.getSetting('fixedRowsTop');\n fixedRowsBottom = this.wot.getSetting('fixedRowsBottom');\n totalRows = this.wot.getSetting('totalRows');\n\n if (fixedRowsTop) {\n fixedRowsHeight = this.wot.wtOverlays.topOverlay.sumCellSizes(0, fixedRowsTop);\n pos += fixedRowsHeight;\n height -= fixedRowsHeight;\n }\n\n if (fixedRowsBottom && this.wot.wtOverlays.bottomOverlay.clone) {\n fixedRowsHeight = this.wot.wtOverlays.bottomOverlay.sumCellSizes(totalRows - fixedRowsBottom, totalRows);\n\n height -= fixedRowsHeight;\n }\n\n if (this.wot.wtTable.holder.clientHeight === this.wot.wtTable.holder.offsetHeight) {\n scrollbarHeight = 0;\n } else {\n scrollbarHeight = getScrollbarWidth();\n }\n\n return new ViewportRowsCalculator(\n height,\n pos,\n this.wot.getSetting('totalRows'),\n (sourceRow) => this.wot.wtTable.getRowHeight(sourceRow),\n visible ? null : this.wot.wtSettings.settings.viewportRowCalculatorOverride,\n visible,\n scrollbarHeight\n );\n }\n\n /**\n * Creates:\n * - columnsRenderCalculator (before draw, to qualify columns for rendering)\n * - columnsVisibleCalculator (after draw, to measure which columns are actually visible)\n *\n * @returns {ViewportRowsCalculator}\n */\n createColumnsCalculator(visible = false) {\n let width = this.getViewportWidth();\n let pos;\n let fixedColumnsLeft;\n\n this.columnHeaderHeight = NaN;\n\n pos = this.wot.wtOverlays.leftOverlay.getScrollPosition() - this.wot.wtOverlays.leftOverlay.getTableParentOffset();\n\n if (pos < 0) {\n pos = 0;\n }\n fixedColumnsLeft = this.wot.getSetting('fixedColumnsLeft');\n\n if (fixedColumnsLeft) {\n let fixedColumnsWidth = this.wot.wtOverlays.leftOverlay.sumCellSizes(0, fixedColumnsLeft);\n pos += fixedColumnsWidth;\n width -= fixedColumnsWidth;\n }\n if (this.wot.wtTable.holder.clientWidth !== this.wot.wtTable.holder.offsetWidth) {\n width -= getScrollbarWidth();\n }\n\n return new ViewportColumnsCalculator(\n width,\n pos,\n this.wot.getSetting('totalColumns'),\n (sourceCol) => this.wot.wtTable.getColumnWidth(sourceCol),\n visible ? null : this.wot.wtSettings.settings.viewportColumnCalculatorOverride,\n visible,\n this.wot.getSetting('stretchH'),\n (stretchedWidth, column) => this.wot.getSetting('onBeforeStretchingColumnWidth', stretchedWidth, column)\n );\n }\n\n /**\n * Creates rowsRenderCalculator and columnsRenderCalculator (before draw, to determine what rows and\n * cols should be rendered)\n *\n * @param fastDraw {Boolean} If `true`, will try to avoid full redraw and only update the border positions.\n * If `false` or `undefined`, will perform a full redraw\n * @returns fastDraw {Boolean} The fastDraw value, possibly modified\n */\n createRenderCalculators(fastDraw = false) {\n if (fastDraw) {\n let proposedRowsVisibleCalculator = this.createRowsCalculator(true);\n let proposedColumnsVisibleCalculator = this.createColumnsCalculator(true);\n\n if (!(this.areAllProposedVisibleRowsAlreadyRendered(proposedRowsVisibleCalculator) &&\n this.areAllProposedVisibleColumnsAlreadyRendered(proposedColumnsVisibleCalculator))) {\n fastDraw = false;\n }\n }\n\n if (!fastDraw) {\n this.rowsRenderCalculator = this.createRowsCalculator();\n this.columnsRenderCalculator = this.createColumnsCalculator();\n }\n // delete temporarily to make sure that renderers always use rowsRenderCalculator, not rowsVisibleCalculator\n this.rowsVisibleCalculator = null;\n this.columnsVisibleCalculator = null;\n\n return fastDraw;\n }\n\n /**\n * Creates rowsVisibleCalculator and columnsVisibleCalculator (after draw, to determine what are\n * the actually visible rows and columns)\n */\n createVisibleCalculators() {\n this.rowsVisibleCalculator = this.createRowsCalculator(true);\n this.columnsVisibleCalculator = this.createColumnsCalculator(true);\n }\n\n /**\n * Returns information whether proposedRowsVisibleCalculator viewport\n * is contained inside rows rendered in previous draw (cached in rowsRenderCalculator)\n *\n * @param {Object} proposedRowsVisibleCalculator\n * @returns {Boolean} Returns `true` if all proposed visible rows are already rendered (meaning: redraw is not needed).\n * Returns `false` if at least one proposed visible row is not already rendered (meaning: redraw is needed)\n */\n areAllProposedVisibleRowsAlreadyRendered(proposedRowsVisibleCalculator) {\n if (this.rowsVisibleCalculator) {\n if (proposedRowsVisibleCalculator.startRow < this.rowsRenderCalculator.startRow ||\n (proposedRowsVisibleCalculator.startRow === this.rowsRenderCalculator.startRow &&\n proposedRowsVisibleCalculator.startRow > 0)) {\n return false;\n\n } else if (proposedRowsVisibleCalculator.endRow > this.rowsRenderCalculator.endRow ||\n (proposedRowsVisibleCalculator.endRow === this.rowsRenderCalculator.endRow &&\n proposedRowsVisibleCalculator.endRow < this.wot.getSetting('totalRows') - 1)) {\n return false;\n\n }\n return true;\n\n }\n\n return false;\n }\n\n /**\n * Returns information whether proposedColumnsVisibleCalculator viewport\n * is contained inside column rendered in previous draw (cached in columnsRenderCalculator)\n *\n * @param {Object} proposedColumnsVisibleCalculator\n * @returns {Boolean} Returns `true` if all proposed visible columns are already rendered (meaning: redraw is not needed).\n * Returns `false` if at least one proposed visible column is not already rendered (meaning: redraw is needed)\n */\n areAllProposedVisibleColumnsAlreadyRendered(proposedColumnsVisibleCalculator) {\n if (this.columnsVisibleCalculator) {\n if (proposedColumnsVisibleCalculator.startColumn < this.columnsRenderCalculator.startColumn ||\n (proposedColumnsVisibleCalculator.startColumn === this.columnsRenderCalculator.startColumn &&\n proposedColumnsVisibleCalculator.startColumn > 0)) {\n return false;\n\n } else if (proposedColumnsVisibleCalculator.endColumn > this.columnsRenderCalculator.endColumn ||\n (proposedColumnsVisibleCalculator.endColumn === this.columnsRenderCalculator.endColumn &&\n proposedColumnsVisibleCalculator.endColumn < this.wot.getSetting('totalColumns') - 1)) {\n return false;\n\n }\n return true;\n\n }\n\n return false;\n }\n\n /**\n * Resets values in keys of the hasOversizedColumnHeadersMarked object after updateSettings.\n */\n resetHasOversizedColumnHeadersMarked() {\n objectEach(this.hasOversizedColumnHeadersMarked, (value, key, object) => {\n object[key] = void 0;\n });\n }\n}\n\nexport default Viewport;\n\n\n\n// WEBPACK FOOTER //\n// ./src/3rdparty/walkontable/src/viewport.js","import {\n getComputedStyle,\n getTrimmingContainer,\n innerWidth,\n innerHeight,\n offset,\n outerHeight,\n outerWidth,\n} from './../../../helpers/dom/element';\nimport {stopImmediatePropagation} from './../../../helpers/dom/event';\nimport {hasOwnProperty} from './../../../helpers/object';\nimport {isMobileBrowser} from './../../../helpers/browser';\nimport EventManager from './../../../eventManager';\nimport CellCoords from './cell/coords';\nimport Overlay from './overlay/_base.js';\n\n/**\n *\n */\nclass Border {\n /**\n * @param {Walkontable} wotInstance\n * @param {Object} settings\n */\n constructor(wotInstance, settings) {\n if (!settings) {\n return;\n }\n this.eventManager = new EventManager(wotInstance);\n this.instance = wotInstance;\n this.wot = wotInstance;\n this.settings = settings;\n this.mouseDown = false;\n this.main = null;\n\n this.top = null;\n this.left = null;\n this.bottom = null;\n this.right = null;\n\n this.topStyle = null;\n this.leftStyle = null;\n this.bottomStyle = null;\n this.rightStyle = null;\n\n this.cornerDefaultStyle = {\n width: '6px',\n height: '6px',\n borderWidth: '1px',\n borderStyle: 'solid',\n borderColor: '#FFF'\n };\n this.corner = null;\n this.cornerStyle = null;\n\n this.createBorders(settings);\n this.registerListeners();\n }\n\n /**\n * Register all necessary events\n */\n registerListeners() {\n this.eventManager.addEventListener(document.body, 'mousedown', () => this.onMouseDown());\n this.eventManager.addEventListener(document.body, 'mouseup', () => this.onMouseUp());\n\n for (let c = 0, len = this.main.childNodes.length; c < len; c++) {\n this.eventManager.addEventListener(this.main.childNodes[c], 'mouseenter', (event) => this.onMouseEnter(event, this.main.childNodes[c]));\n }\n }\n\n /**\n * Mouse down listener\n *\n * @private\n */\n onMouseDown() {\n this.mouseDown = true;\n }\n\n /**\n * Mouse up listener\n *\n * @private\n */\n onMouseUp() {\n this.mouseDown = false;\n }\n\n /**\n * Mouse enter listener for fragment selection functionality.\n *\n * @private\n * @param {Event} event Dom event\n * @param {HTMLElement} parentElement Part of border element.\n */\n onMouseEnter(event, parentElement) {\n if (!this.mouseDown || !this.wot.getSetting('hideBorderOnMouseDownOver')) {\n return;\n }\n event.preventDefault();\n stopImmediatePropagation(event);\n\n let _this = this;\n let bounds = parentElement.getBoundingClientRect();\n // Hide border to prevents selection jumping when fragmentSelection is enabled.\n parentElement.style.display = 'none';\n\n function isOutside(event) {\n if (event.clientY < Math.floor(bounds.top)) {\n return true;\n }\n if (event.clientY > Math.ceil(bounds.top + bounds.height)) {\n return true;\n }\n if (event.clientX < Math.floor(bounds.left)) {\n return true;\n }\n if (event.clientX > Math.ceil(bounds.left + bounds.width)) {\n return true;\n }\n }\n\n function handler(event) {\n if (isOutside(event)) {\n _this.eventManager.removeEventListener(document.body, 'mousemove', handler);\n parentElement.style.display = 'block';\n }\n }\n\n this.eventManager.addEventListener(document.body, 'mousemove', handler);\n }\n\n /**\n * Create border elements\n *\n * @param {Object} settings\n */\n createBorders(settings) {\n this.main = document.createElement('div');\n\n let borderDivs = ['top', 'left', 'bottom', 'right', 'corner'];\n let style = this.main.style;\n style.position = 'absolute';\n style.top = 0;\n style.left = 0;\n\n for (let i = 0; i < 5; i++) {\n let position = borderDivs[i];\n let div = document.createElement('div');\n div.className = `wtBorder ${this.settings.className || ''}`; // + borderDivs[i];\n\n if (this.settings[position] && this.settings[position].hide) {\n div.className += ' hidden';\n }\n style = div.style;\n style.backgroundColor = (this.settings[position] && this.settings[position].color) ? this.settings[position].color : settings.border.color;\n style.height = (this.settings[position] && this.settings[position].width) ? `${this.settings[position].width}px` : `${settings.border.width}px`;\n style.width = (this.settings[position] && this.settings[position].width) ? `${this.settings[position].width}px` : `${settings.border.width}px`;\n\n this.main.appendChild(div);\n }\n this.top = this.main.childNodes[0];\n this.left = this.main.childNodes[1];\n this.bottom = this.main.childNodes[2];\n this.right = this.main.childNodes[3];\n\n this.topStyle = this.top.style;\n this.leftStyle = this.left.style;\n this.bottomStyle = this.bottom.style;\n this.rightStyle = this.right.style;\n\n this.corner = this.main.childNodes[4];\n this.corner.className += ' corner';\n this.cornerStyle = this.corner.style;\n this.cornerStyle.width = this.cornerDefaultStyle.width;\n this.cornerStyle.height = this.cornerDefaultStyle.height;\n this.cornerStyle.border = [\n this.cornerDefaultStyle.borderWidth,\n this.cornerDefaultStyle.borderStyle,\n this.cornerDefaultStyle.borderColor\n ].join(' ');\n\n if (isMobileBrowser()) {\n this.createMultipleSelectorHandles();\n }\n this.disappear();\n\n if (!this.wot.wtTable.bordersHolder) {\n this.wot.wtTable.bordersHolder = document.createElement('div');\n this.wot.wtTable.bordersHolder.className = 'htBorders';\n this.wot.wtTable.spreader.appendChild(this.wot.wtTable.bordersHolder);\n }\n this.wot.wtTable.bordersHolder.insertBefore(this.main, this.wot.wtTable.bordersHolder.firstChild);\n }\n\n /**\n * Create multiple selector handler for mobile devices\n */\n createMultipleSelectorHandles() {\n this.selectionHandles = {\n topLeft: document.createElement('DIV'),\n topLeftHitArea: document.createElement('DIV'),\n bottomRight: document.createElement('DIV'),\n bottomRightHitArea: document.createElement('DIV')\n };\n let width = 10;\n let hitAreaWidth = 40;\n\n this.selectionHandles.topLeft.className = 'topLeftSelectionHandle';\n this.selectionHandles.topLeftHitArea.className = 'topLeftSelectionHandle-HitArea';\n this.selectionHandles.bottomRight.className = 'bottomRightSelectionHandle';\n this.selectionHandles.bottomRightHitArea.className = 'bottomRightSelectionHandle-HitArea';\n\n this.selectionHandles.styles = {\n topLeft: this.selectionHandles.topLeft.style,\n topLeftHitArea: this.selectionHandles.topLeftHitArea.style,\n bottomRight: this.selectionHandles.bottomRight.style,\n bottomRightHitArea: this.selectionHandles.bottomRightHitArea.style\n };\n\n let hitAreaStyle = {\n position: 'absolute',\n height: `${hitAreaWidth}px`,\n width: `${hitAreaWidth}px`,\n 'border-radius': `${parseInt(hitAreaWidth / 1.5, 10)}px`,\n };\n\n for (let prop in hitAreaStyle) {\n if (hasOwnProperty(hitAreaStyle, prop)) {\n this.selectionHandles.styles.bottomRightHitArea[prop] = hitAreaStyle[prop];\n this.selectionHandles.styles.topLeftHitArea[prop] = hitAreaStyle[prop];\n }\n }\n\n let handleStyle = {\n position: 'absolute',\n height: `${width}px`,\n width: `${width}px`,\n 'border-radius': `${parseInt(width / 1.5, 10)}px`,\n background: '#F5F5FF',\n border: '1px solid #4285c8'\n };\n\n for (let prop in handleStyle) {\n if (hasOwnProperty(handleStyle, prop)) {\n this.selectionHandles.styles.bottomRight[prop] = handleStyle[prop];\n this.selectionHandles.styles.topLeft[prop] = handleStyle[prop];\n }\n }\n this.main.appendChild(this.selectionHandles.topLeft);\n this.main.appendChild(this.selectionHandles.bottomRight);\n this.main.appendChild(this.selectionHandles.topLeftHitArea);\n this.main.appendChild(this.selectionHandles.bottomRightHitArea);\n }\n\n isPartRange(row, col) {\n const areaSelection = this.wot.selections.createOrGetArea();\n\n if (areaSelection.cellRange) {\n if (row != areaSelection.cellRange.to.row || col != areaSelection.cellRange.to.col) {\n return true;\n }\n }\n\n return false;\n }\n\n updateMultipleSelectionHandlesPosition(row, col, top, left, width, height) {\n let handleWidth = parseInt(this.selectionHandles.styles.topLeft.width, 10);\n let hitAreaWidth = parseInt(this.selectionHandles.styles.topLeftHitArea.width, 10);\n\n this.selectionHandles.styles.topLeft.top = `${parseInt(top - handleWidth, 10)}px`;\n this.selectionHandles.styles.topLeft.left = `${parseInt(left - handleWidth, 10)}px`;\n\n this.selectionHandles.styles.topLeftHitArea.top = `${parseInt(top - ((hitAreaWidth / 4) * 3), 10)}px`;\n this.selectionHandles.styles.topLeftHitArea.left = `${parseInt(left - ((hitAreaWidth / 4) * 3), 10)}px`;\n\n this.selectionHandles.styles.bottomRight.top = `${parseInt(top + height, 10)}px`;\n this.selectionHandles.styles.bottomRight.left = `${parseInt(left + width, 10)}px`;\n\n this.selectionHandles.styles.bottomRightHitArea.top = `${parseInt(top + height - (hitAreaWidth / 4), 10)}px`;\n this.selectionHandles.styles.bottomRightHitArea.left = `${parseInt(left + width - (hitAreaWidth / 4), 10)}px`;\n\n if (this.settings.border.cornerVisible && this.settings.border.cornerVisible()) {\n this.selectionHandles.styles.topLeft.display = 'block';\n this.selectionHandles.styles.topLeftHitArea.display = 'block';\n\n if (this.isPartRange(row, col)) {\n this.selectionHandles.styles.bottomRight.display = 'none';\n this.selectionHandles.styles.bottomRightHitArea.display = 'none';\n } else {\n this.selectionHandles.styles.bottomRight.display = 'block';\n this.selectionHandles.styles.bottomRightHitArea.display = 'block';\n }\n } else {\n this.selectionHandles.styles.topLeft.display = 'none';\n this.selectionHandles.styles.bottomRight.display = 'none';\n this.selectionHandles.styles.topLeftHitArea.display = 'none';\n this.selectionHandles.styles.bottomRightHitArea.display = 'none';\n }\n\n if (row == this.wot.wtSettings.getSetting('fixedRowsTop') || col == this.wot.wtSettings.getSetting('fixedColumnsLeft')) {\n this.selectionHandles.styles.topLeft.zIndex = '9999';\n this.selectionHandles.styles.topLeftHitArea.zIndex = '9999';\n } else {\n this.selectionHandles.styles.topLeft.zIndex = '';\n this.selectionHandles.styles.topLeftHitArea.zIndex = '';\n }\n }\n\n /**\n * Show border around one or many cells\n *\n * @param {Array} corners\n */\n appear(corners) {\n if (this.disabled) {\n return;\n }\n\n let fromRow;\n let toRow;\n let fromColumn;\n let toColumn;\n\n const rowsCount = this.wot.wtTable.getRenderedRowsCount();\n\n for (let i = 0; i < rowsCount; i += 1) {\n let s = this.wot.wtTable.rowFilter.renderedToSource(i);\n\n if (s >= corners[0] && s <= corners[2]) {\n fromRow = s;\n break;\n }\n }\n\n for (let i = rowsCount - 1; i >= 0; i -= 1) {\n let s = this.wot.wtTable.rowFilter.renderedToSource(i);\n\n if (s >= corners[0] && s <= corners[2]) {\n toRow = s;\n break;\n }\n }\n\n const columnsCount = this.wot.wtTable.getRenderedColumnsCount();\n\n for (let i = 0; i < columnsCount; i += 1) {\n let s = this.wot.wtTable.columnFilter.renderedToSource(i);\n\n if (s >= corners[1] && s <= corners[3]) {\n fromColumn = s;\n break;\n }\n }\n\n for (let i = columnsCount - 1; i >= 0; i -= 1) {\n let s = this.wot.wtTable.columnFilter.renderedToSource(i);\n\n if (s >= corners[1] && s <= corners[3]) {\n toColumn = s;\n break;\n }\n }\n if (fromRow === void 0 || fromColumn === void 0) {\n this.disappear();\n\n return;\n }\n let fromTD = this.wot.wtTable.getCell(new CellCoords(fromRow, fromColumn));\n const isMultiple = (fromRow !== toRow || fromColumn !== toColumn);\n const toTD = isMultiple ? this.wot.wtTable.getCell(new CellCoords(toRow, toColumn)) : fromTD;\n const fromOffset = offset(fromTD);\n const toOffset = isMultiple ? offset(toTD) : fromOffset;\n const containerOffset = offset(this.wot.wtTable.TABLE);\n const minTop = fromOffset.top;\n const minLeft = fromOffset.left;\n\n let left = minLeft - containerOffset.left - 1;\n let width = toOffset.left + outerWidth(toTD) - minLeft;\n\n if (this.isEntireColumnSelected(fromRow, toRow)) {\n const modifiedValues = this.getDimensionsFromHeader('columns', fromColumn, toColumn, containerOffset);\n let fromTH = null;\n\n if (modifiedValues) {\n [fromTH, left, width] = modifiedValues;\n }\n\n if (fromTH) {\n fromTD = fromTH;\n }\n }\n\n let top = minTop - containerOffset.top - 1;\n let height = toOffset.top + outerHeight(toTD) - minTop;\n\n if (this.isEntireRowSelected(fromColumn, toColumn)) {\n const modifiedValues = this.getDimensionsFromHeader('rows', fromRow, toRow, containerOffset);\n let fromTH = null;\n\n if (modifiedValues) {\n [fromTH, top, height] = modifiedValues;\n }\n\n if (fromTH) {\n fromTD = fromTH;\n }\n }\n\n let style = getComputedStyle(fromTD);\n\n if (parseInt(style.borderTopWidth, 10) > 0) {\n top += 1;\n height = height > 0 ? height - 1 : 0;\n }\n if (parseInt(style.borderLeftWidth, 10) > 0) {\n left += 1;\n width = width > 0 ? width - 1 : 0;\n }\n\n this.topStyle.top = `${top}px`;\n this.topStyle.left = `${left}px`;\n this.topStyle.width = `${width}px`;\n this.topStyle.display = 'block';\n\n this.leftStyle.top = `${top}px`;\n this.leftStyle.left = `${left}px`;\n this.leftStyle.height = `${height}px`;\n this.leftStyle.display = 'block';\n\n const delta = Math.floor(this.settings.border.width / 2);\n\n this.bottomStyle.top = `${top + height - delta}px`;\n this.bottomStyle.left = `${left}px`;\n this.bottomStyle.width = `${width}px`;\n this.bottomStyle.display = 'block';\n\n this.rightStyle.top = `${top}px`;\n this.rightStyle.left = `${left + width - delta}px`;\n this.rightStyle.height = `${height + 1}px`;\n this.rightStyle.display = 'block';\n\n let cornerVisibleSetting = this.settings.border.cornerVisible;\n cornerVisibleSetting = typeof cornerVisibleSetting === 'function' ? cornerVisibleSetting(this.settings.layerLevel) : cornerVisibleSetting;\n\n const hookResult = this.wot.getSetting('onModifyGetCellCoords', toRow, toColumn);\n let [checkRow, checkCol] = [toRow, toColumn];\n\n if (hookResult && Array.isArray(hookResult)) {\n [,, checkRow, checkCol] = hookResult;\n }\n\n if (isMobileBrowser() || !cornerVisibleSetting || this.isPartRange(checkRow, checkCol)) {\n this.cornerStyle.display = 'none';\n\n } else {\n this.cornerStyle.top = `${top + height - 4}px`;\n this.cornerStyle.left = `${left + width - 4}px`;\n this.cornerStyle.borderRightWidth = this.cornerDefaultStyle.borderWidth;\n this.cornerStyle.width = this.cornerDefaultStyle.width;\n\n // Hide the fill handle, so the possible further adjustments won't force unneeded scrollbars.\n this.cornerStyle.display = 'none';\n\n const trimmingContainer = getTrimmingContainer(this.wot.wtTable.TABLE);\n\n if (toColumn === this.wot.getSetting('totalColumns') - 1) {\n const cornerOverlappingContainer = toTD.offsetLeft + outerWidth(toTD) + (parseInt(this.cornerDefaultStyle.width, 10) / 2) >= innerWidth(trimmingContainer);\n\n if (cornerOverlappingContainer) {\n this.cornerStyle.left = `${Math.floor(left + width - 3 - (parseInt(this.cornerDefaultStyle.width, 10) / 2))}px`;\n this.cornerStyle.borderRightWidth = 0;\n }\n }\n\n if (toRow === this.wot.getSetting('totalRows') - 1) {\n const cornerOverlappingContainer = toTD.offsetTop + outerHeight(toTD) + (parseInt(this.cornerDefaultStyle.height, 10) / 2) >= innerHeight(trimmingContainer);\n\n if (cornerOverlappingContainer) {\n this.cornerStyle.top = `${Math.floor(top + height - 3 - (parseInt(this.cornerDefaultStyle.height, 10) / 2))}px`;\n this.cornerStyle.borderBottomWidth = 0;\n }\n }\n\n this.cornerStyle.display = 'block';\n }\n\n if (isMobileBrowser()) {\n this.updateMultipleSelectionHandlesPosition(toRow, toColumn, top, left, width, height);\n }\n }\n\n /**\n * Check whether an entire column of cells is selected.\n *\n * @private\n * @param {Number} startRowIndex Start row index.\n * @param {Number} endRowIndex End row index.\n */\n isEntireColumnSelected(startRowIndex, endRowIndex) {\n return startRowIndex === this.wot.wtTable.getFirstRenderedRow() && endRowIndex === this.wot.wtTable.getLastRenderedRow();\n }\n\n /**\n * Check whether an entire row of cells is selected.\n *\n * @private\n * @param {Number} startColumnIndex Start column index.\n * @param {Number} endColumnIndex End column index.\n */\n isEntireRowSelected(startColumnIndex, endColumnIndex) {\n return startColumnIndex === this.wot.wtTable.getFirstRenderedColumn() && endColumnIndex === this.wot.wtTable.getLastRenderedColumn();\n }\n\n /**\n * Get left/top index and width/height depending on the `direction` provided.\n *\n * @private\n * @param {String} direction `rows` or `columns`, defines if an entire column or row is selected.\n * @param {Number} fromIndex Start index of the selection.\n * @param {Number} toIndex End index of the selection.\n * @param {Number} containerOffset offset of the container.\n * @return {Array|Boolean} Returns an array of [headerElement, left, width] or [headerElement, top, height], depending on `direction` (`false` in case of an error getting the headers).\n */\n getDimensionsFromHeader(direction, fromIndex, toIndex, containerOffset) {\n const rootHotElement = this.wot.wtTable.wtRootElement.parentNode;\n let getHeaderFn = null;\n let dimensionFn = null;\n let entireSelectionClassname = null;\n let index = null;\n let dimension = null;\n let dimensionProperty = null;\n let startHeader = null;\n let endHeader = null;\n\n switch (direction) {\n case 'rows':\n getHeaderFn = (...args) => this.wot.wtTable.getRowHeader(...args);\n dimensionFn = (...args) => outerHeight(...args);\n entireSelectionClassname = 'ht__selection--rows';\n dimensionProperty = 'top';\n\n break;\n\n case 'columns':\n getHeaderFn = (...args) => this.wot.wtTable.getColumnHeader(...args);\n dimensionFn = (...args) => outerWidth(...args);\n entireSelectionClassname = 'ht__selection--columns';\n dimensionProperty = 'left';\n break;\n default:\n }\n\n if (rootHotElement.className.includes(entireSelectionClassname)) {\n const columnHeaderLevelCount = this.wot.getSetting('columnHeaders').length;\n\n startHeader = getHeaderFn(fromIndex, columnHeaderLevelCount - 1);\n endHeader = getHeaderFn(toIndex, columnHeaderLevelCount - 1);\n\n if (!startHeader || !endHeader) {\n return false;\n }\n\n const startHeaderOffset = offset(startHeader);\n const endOffset = offset(endHeader);\n\n if (startHeader && endHeader) {\n index = startHeaderOffset[dimensionProperty] - containerOffset[dimensionProperty] - 1;\n dimension = endOffset[dimensionProperty] + dimensionFn(endHeader) - startHeaderOffset[dimensionProperty];\n }\n\n return [startHeader, index, dimension];\n }\n\n return false;\n }\n\n /**\n * Hide border\n */\n disappear() {\n this.topStyle.display = 'none';\n this.leftStyle.display = 'none';\n this.bottomStyle.display = 'none';\n this.rightStyle.display = 'none';\n this.cornerStyle.display = 'none';\n\n if (isMobileBrowser()) {\n this.selectionHandles.styles.topLeft.display = 'none';\n this.selectionHandles.styles.bottomRight.display = 'none';\n }\n }\n}\n\nexport default Border;\n\n\n\n// WEBPACK FOOTER //\n// ./src/3rdparty/walkontable/src/border.js","import {KEY_CODES, isPrintableChar} from './../helpers/unicode';\nimport {stringify, isDefined} from './../helpers/mixed';\nimport {stripTags} from './../helpers/string';\nimport {pivot, arrayMap} from './../helpers/array';\nimport {\n addClass,\n getCaretPosition,\n getScrollbarWidth,\n getSelectionEndPosition,\n outerWidth,\n outerHeight,\n offset,\n getTrimmingContainer,\n setCaretPosition,\n} from './../helpers/dom/element';\nimport HandsontableEditor from './handsontableEditor';\n\nconst AutocompleteEditor = HandsontableEditor.prototype.extend();\n\n/**\n * @private\n * @editor AutocompleteEditor\n * @class AutocompleteEditor\n * @dependencies HandsontableEditor\n */\nAutocompleteEditor.prototype.init = function() {\n HandsontableEditor.prototype.init.apply(this, arguments);\n this.query = null;\n this.strippedChoices = [];\n this.rawChoices = [];\n};\n\nAutocompleteEditor.prototype.getValue = function() {\n const selectedValue = this.rawChoices.find((value) => {\n const strippedValue = this.stripValueIfNeeded(value);\n\n return strippedValue === this.TEXTAREA.value;\n });\n\n if (isDefined(selectedValue)) {\n return selectedValue;\n }\n\n return this.TEXTAREA.value;\n};\n\nAutocompleteEditor.prototype.createElements = function() {\n HandsontableEditor.prototype.createElements.apply(this, arguments);\n\n addClass(this.htContainer, 'autocompleteEditor');\n addClass(this.htContainer, window.navigator.platform.indexOf('Mac') === -1 ? '' : 'htMacScroll');\n};\n\nvar skipOne = false;\nfunction onBeforeKeyDown(event) {\n skipOne = false;\n let editor = this.getActiveEditor();\n\n if (isPrintableChar(event.keyCode) || event.keyCode === KEY_CODES.BACKSPACE ||\n event.keyCode === KEY_CODES.DELETE || event.keyCode === KEY_CODES.INSERT) {\n let timeOffset = 0;\n\n // on ctl+c / cmd+c don't update suggestion list\n if (event.keyCode === KEY_CODES.C && (event.ctrlKey || event.metaKey)) {\n return;\n }\n if (!editor.isOpened()) {\n timeOffset += 10;\n }\n\n if (editor.htEditor) {\n editor.instance._registerTimeout(setTimeout(() => {\n editor.queryChoices(editor.TEXTAREA.value);\n skipOne = true;\n }, timeOffset));\n }\n }\n}\n\nAutocompleteEditor.prototype.prepare = function() {\n this.instance.addHook('beforeKeyDown', onBeforeKeyDown);\n HandsontableEditor.prototype.prepare.apply(this, arguments);\n};\n\nAutocompleteEditor.prototype.open = function() {\n // Ugly fix for handsontable which grab window object for autocomplete scroll listener instead table element.\n this.TEXTAREA_PARENT.style.overflow = 'auto';\n HandsontableEditor.prototype.open.apply(this, arguments);\n this.TEXTAREA_PARENT.style.overflow = '';\n\n let choicesListHot = this.htEditor.getInstance();\n let _this = this;\n let trimDropdown = this.cellProperties.trimDropdown === void 0 ? true : this.cellProperties.trimDropdown;\n\n this.TEXTAREA.style.visibility = 'visible';\n this.focus();\n\n choicesListHot.updateSettings({\n colWidths: trimDropdown ? [outerWidth(this.TEXTAREA) - 2] : void 0,\n width: trimDropdown ? outerWidth(this.TEXTAREA) + getScrollbarWidth() + 2 : void 0,\n afterRenderer(TD, row, col, prop, value, cellProperties) {\n let {filteringCaseSensitive, allowHtml} = _this.cellProperties;\n let indexOfMatch;\n let match;\n\n value = stringify(value);\n\n if (value && !allowHtml) {\n indexOfMatch = filteringCaseSensitive === true ? value.indexOf(this.query) : value.toLowerCase().indexOf(_this.query.toLowerCase());\n\n if (indexOfMatch !== -1) {\n match = value.substr(indexOfMatch, _this.query.length);\n value = value.replace(match, `<strong>${match}</strong>`);\n }\n }\n TD.innerHTML = value;\n },\n autoColumnSize: true,\n modifyColWidth(width, col) {\n // workaround for <strong> text overlapping the dropdown, not really accurate\n let autoWidths = this.getPlugin('autoColumnSize').widths;\n\n if (autoWidths[col]) {\n width = autoWidths[col];\n }\n\n return trimDropdown ? width : width + 15;\n }\n });\n\n // Add additional space for autocomplete holder\n this.htEditor.view.wt.wtTable.holder.parentNode.style['padding-right'] = `${getScrollbarWidth() + 2}px`;\n\n if (skipOne) {\n skipOne = false;\n }\n\n _this.instance._registerTimeout(setTimeout(() => {\n _this.queryChoices(_this.TEXTAREA.value);\n }, 0));\n};\n\nAutocompleteEditor.prototype.close = function() {\n HandsontableEditor.prototype.close.apply(this, arguments);\n};\nAutocompleteEditor.prototype.queryChoices = function(query) {\n this.query = query;\n const source = this.cellProperties.source;\n\n if (typeof source == 'function') {\n source.call(this.cellProperties, query, (choices) => {\n this.rawChoices = choices;\n this.updateChoicesList(this.stripValuesIfNeeded(choices));\n });\n\n } else if (Array.isArray(source)) {\n this.rawChoices = source;\n this.updateChoicesList(this.stripValuesIfNeeded(source));\n\n } else {\n this.updateChoicesList([]);\n }\n};\n\nAutocompleteEditor.prototype.updateChoicesList = function(choices) {\n let pos = getCaretPosition(this.TEXTAREA);\n let endPos = getSelectionEndPosition(this.TEXTAREA);\n let sortByRelevanceSetting = this.cellProperties.sortByRelevance;\n let filterSetting = this.cellProperties.filter;\n let orderByRelevance = null;\n let highlightIndex = null;\n\n if (sortByRelevanceSetting) {\n orderByRelevance = AutocompleteEditor.sortByRelevance(\n this.stripValueIfNeeded(this.getValue()),\n choices,\n this.cellProperties.filteringCaseSensitive\n );\n }\n let orderByRelevanceLength = Array.isArray(orderByRelevance) ? orderByRelevance.length : 0;\n\n if (filterSetting === false) {\n if (orderByRelevanceLength) {\n highlightIndex = orderByRelevance[0];\n }\n } else {\n let sorted = [];\n\n for (let i = 0, choicesCount = choices.length; i < choicesCount; i++) {\n if (sortByRelevanceSetting && orderByRelevanceLength <= i) {\n break;\n }\n if (orderByRelevanceLength) {\n sorted.push(choices[orderByRelevance[i]]);\n } else {\n sorted.push(choices[i]);\n }\n }\n\n highlightIndex = 0;\n choices = sorted;\n }\n\n this.strippedChoices = choices;\n this.htEditor.loadData(pivot([choices]));\n\n this.updateDropdownHeight();\n\n this.flipDropdownIfNeeded();\n\n if (this.cellProperties.strict === true) {\n this.highlightBestMatchingChoice(highlightIndex);\n }\n\n this.instance.listen(false);\n\n setCaretPosition(this.TEXTAREA, pos, (pos === endPos ? void 0 : endPos));\n};\n\nAutocompleteEditor.prototype.flipDropdownIfNeeded = function() {\n let textareaOffset = offset(this.TEXTAREA);\n let textareaHeight = outerHeight(this.TEXTAREA);\n let dropdownHeight = this.getDropdownHeight();\n let trimmingContainer = getTrimmingContainer(this.instance.view.wt.wtTable.TABLE);\n let trimmingContainerScrollTop = trimmingContainer.scrollTop;\n let headersHeight = outerHeight(this.instance.view.wt.wtTable.THEAD);\n let containerOffset = {\n row: 0,\n col: 0\n };\n\n if (trimmingContainer !== window) {\n containerOffset = offset(trimmingContainer);\n }\n\n let spaceAbove = textareaOffset.top - containerOffset.top - headersHeight + trimmingContainerScrollTop;\n let spaceBelow = trimmingContainer.scrollHeight - spaceAbove - headersHeight - textareaHeight;\n let flipNeeded = dropdownHeight > spaceBelow && spaceAbove > spaceBelow;\n\n if (flipNeeded) {\n this.flipDropdown(dropdownHeight);\n } else {\n this.unflipDropdown();\n }\n\n this.limitDropdownIfNeeded(flipNeeded ? spaceAbove : spaceBelow, dropdownHeight);\n\n return flipNeeded;\n};\n\nAutocompleteEditor.prototype.limitDropdownIfNeeded = function(spaceAvailable, dropdownHeight) {\n if (dropdownHeight > spaceAvailable) {\n let tempHeight = 0;\n let i = 0;\n let lastRowHeight = 0;\n let height = null;\n\n do {\n lastRowHeight = this.htEditor.getRowHeight(i) || this.htEditor.view.wt.wtSettings.settings.defaultRowHeight;\n tempHeight += lastRowHeight;\n i++;\n } while (tempHeight < spaceAvailable);\n\n height = tempHeight - lastRowHeight;\n\n if (this.htEditor.flipped) {\n this.htEditor.rootElement.style.top = `${parseInt(this.htEditor.rootElement.style.top, 10) + dropdownHeight - height}px`;\n }\n\n this.setDropdownHeight(tempHeight - lastRowHeight);\n }\n};\n\nAutocompleteEditor.prototype.flipDropdown = function(dropdownHeight) {\n let dropdownStyle = this.htEditor.rootElement.style;\n\n dropdownStyle.position = 'absolute';\n dropdownStyle.top = `${-dropdownHeight}px`;\n\n this.htEditor.flipped = true;\n};\n\nAutocompleteEditor.prototype.unflipDropdown = function() {\n let dropdownStyle = this.htEditor.rootElement.style;\n\n if (dropdownStyle.position === 'absolute') {\n dropdownStyle.position = '';\n dropdownStyle.top = '';\n }\n\n this.htEditor.flipped = void 0;\n};\n\nAutocompleteEditor.prototype.updateDropdownHeight = function() {\n var currentDropdownWidth = this.htEditor.getColWidth(0) + getScrollbarWidth() + 2;\n var trimDropdown = this.cellProperties.trimDropdown;\n\n this.htEditor.updateSettings({\n height: this.getDropdownHeight(),\n width: trimDropdown ? void 0 : currentDropdownWidth\n });\n\n this.htEditor.view.wt.wtTable.alignOverlaysWithTrimmingContainer();\n};\n\nAutocompleteEditor.prototype.setDropdownHeight = function(height) {\n this.htEditor.updateSettings({\n height\n });\n};\n\nAutocompleteEditor.prototype.finishEditing = function(restoreOriginalValue) {\n if (!restoreOriginalValue) {\n this.instance.removeHook('beforeKeyDown', onBeforeKeyDown);\n }\n HandsontableEditor.prototype.finishEditing.apply(this, arguments);\n};\n\nAutocompleteEditor.prototype.highlightBestMatchingChoice = function(index) {\n if (typeof index === 'number') {\n this.htEditor.selectCell(index, 0, void 0, void 0, void 0, false);\n } else {\n this.htEditor.deselectCell();\n }\n};\n\n/**\n * Filters and sorts by relevance\n * @param value\n * @param choices\n * @param caseSensitive\n * @returns {Array} array of indexes in original choices array\n */\nAutocompleteEditor.sortByRelevance = function(value, choices, caseSensitive) {\n let choicesRelevance = [];\n let currentItem;\n let valueLength = value.length;\n let valueIndex;\n let charsLeft;\n let result = [];\n let i;\n let choicesCount = choices.length;\n\n if (valueLength === 0) {\n for (i = 0; i < choicesCount; i++) {\n result.push(i);\n }\n return result;\n }\n\n for (i = 0; i < choicesCount; i++) {\n currentItem = stripTags(stringify(choices[i]));\n\n if (caseSensitive) {\n valueIndex = currentItem.indexOf(value);\n } else {\n valueIndex = currentItem.toLowerCase().indexOf(value.toLowerCase());\n }\n\n if (valueIndex !== -1) {\n charsLeft = currentItem.length - valueIndex - valueLength;\n\n choicesRelevance.push({\n baseIndex: i,\n index: valueIndex,\n charsLeft,\n value: currentItem\n });\n }\n }\n\n choicesRelevance.sort((a, b) => {\n\n if (b.index === -1) {\n return -1;\n }\n if (a.index === -1) {\n return 1;\n }\n\n if (a.index < b.index) {\n return -1;\n } else if (b.index < a.index) {\n return 1;\n } else if (a.index === b.index) {\n if (a.charsLeft < b.charsLeft) {\n return -1;\n } else if (a.charsLeft > b.charsLeft) {\n return 1;\n }\n }\n\n return 0;\n });\n\n for (i = 0, choicesCount = choicesRelevance.length; i < choicesCount; i++) {\n result.push(choicesRelevance[i].baseIndex);\n }\n\n return result;\n};\n\nAutocompleteEditor.prototype.getDropdownHeight = function() {\n let firstRowHeight = this.htEditor.getInstance().getRowHeight(0) || 23;\n let visibleRows = this.cellProperties.visibleRows;\n\n return this.strippedChoices.length >= visibleRows ? (visibleRows * firstRowHeight) : (this.strippedChoices.length * firstRowHeight) + 8;\n};\n\nAutocompleteEditor.prototype.stripValueIfNeeded = function (value) {\n return this.stripValuesIfNeeded([value])[0];\n};\n\nAutocompleteEditor.prototype.stripValuesIfNeeded = function (values) {\n const {allowHtml} = this.cellProperties;\n\n const stringifiedValues = arrayMap(values, (value) => stringify(value));\n const strippedValues = arrayMap(stringifiedValues, (value) => (allowHtml ? value : stripTags(value)));\n\n return strippedValues;\n};\n\nAutocompleteEditor.prototype.allowKeyEventPropagation = function(keyCode) {\n const selectedRange = this.htEditor.getSelectedRangeLast();\n\n let selected = {row: selectedRange ? selectedRange.from.row : -1};\n let allowed = false;\n\n if (keyCode === KEY_CODES.ARROW_DOWN && selected.row > 0 && selected.row < this.htEditor.countRows() - 1) {\n allowed = true;\n }\n if (keyCode === KEY_CODES.ARROW_UP && selected.row > -1) {\n allowed = true;\n }\n\n return allowed;\n};\n\nAutocompleteEditor.prototype.discardEditor = function(result) {\n HandsontableEditor.prototype.discardEditor.apply(this, arguments);\n\n this.instance.view.render();\n};\n\nexport default AutocompleteEditor;\n\n\n\n// WEBPACK FOOTER //\n// ./src/editors/autocompleteEditor.js","import {KEY_CODES} from './../helpers/unicode';\nimport {extend} from './../helpers/object';\nimport {setCaretPosition} from './../helpers/dom/element';\nimport {stopImmediatePropagation, isImmediatePropagationStopped} from './../helpers/dom/event';\nimport TextEditor from './textEditor';\n\nconst HandsontableEditor = TextEditor.prototype.extend();\n\n/**\n * @private\n * @editor HandsontableEditor\n * @class HandsontableEditor\n * @dependencies TextEditor\n */\nHandsontableEditor.prototype.createElements = function() {\n TextEditor.prototype.createElements.apply(this, arguments);\n\n var DIV = document.createElement('DIV');\n DIV.className = 'handsontableEditor';\n this.TEXTAREA_PARENT.appendChild(DIV);\n\n this.htContainer = DIV;\n this.assignHooks();\n};\n\nHandsontableEditor.prototype.prepare = function(td, row, col, prop, value, cellProperties) {\n TextEditor.prototype.prepare.apply(this, arguments);\n\n var parent = this;\n var options = {\n startRows: 0,\n startCols: 0,\n minRows: 0,\n minCols: 0,\n className: 'listbox',\n copyPaste: false,\n autoColumnSize: false,\n autoRowSize: false,\n readOnly: true,\n fillHandle: false,\n afterOnCellMouseDown(_, coords) {\n var value = this.getSourceData(coords.row, coords.col);\n\n // if the value is undefined then it means we don't want to set the value\n if (value !== void 0) {\n parent.setValue(value);\n }\n parent.instance.destroyEditor();\n }\n };\n\n if (this.cellProperties.handsontable) {\n extend(options, cellProperties.handsontable);\n }\n this.htOptions = options;\n};\n\nvar onBeforeKeyDown = function(event) {\n if (isImmediatePropagationStopped(event)) {\n return;\n }\n var editor = this.getActiveEditor();\n\n var innerHOT = editor.htEditor.getInstance();\n\n var rowToSelect;\n var selectedRow;\n\n if (event.keyCode == KEY_CODES.ARROW_DOWN) {\n if (!innerHOT.getSelectedLast() && !innerHOT.flipped) {\n rowToSelect = 0;\n } else if (innerHOT.getSelectedLast()) {\n if (innerHOT.flipped) {\n rowToSelect = innerHOT.getSelectedLast()[0] + 1;\n } else if (!innerHOT.flipped) {\n selectedRow = innerHOT.getSelectedLast()[0];\n var lastRow = innerHOT.countRows() - 1;\n rowToSelect = Math.min(lastRow, selectedRow + 1);\n }\n }\n } else if (event.keyCode == KEY_CODES.ARROW_UP) {\n if (!innerHOT.getSelectedLast() && innerHOT.flipped) {\n rowToSelect = innerHOT.countRows() - 1;\n\n } else if (innerHOT.getSelectedLast()) {\n if (innerHOT.flipped) {\n selectedRow = innerHOT.getSelectedLast()[0];\n rowToSelect = Math.max(0, selectedRow - 1);\n } else {\n selectedRow = innerHOT.getSelectedLast()[0];\n rowToSelect = selectedRow - 1;\n }\n }\n }\n\n if (rowToSelect !== void 0) {\n if (rowToSelect < 0 || (innerHOT.flipped && rowToSelect > innerHOT.countRows() - 1)) {\n innerHOT.deselectCell();\n } else {\n innerHOT.selectCell(rowToSelect, 0);\n }\n if (innerHOT.getData().length) {\n event.preventDefault();\n stopImmediatePropagation(event);\n\n editor.instance.listen();\n editor.TEXTAREA.focus();\n }\n }\n};\n\nHandsontableEditor.prototype.open = function() {\n this.instance.addHook('beforeKeyDown', onBeforeKeyDown);\n\n TextEditor.prototype.open.apply(this, arguments);\n\n if (this.htEditor) {\n this.htEditor.destroy();\n }\n // Construct and initialise a new Handsontable\n this.htEditor = new this.instance.constructor(this.htContainer, this.htOptions);\n this.htEditor.init();\n\n if (this.cellProperties.strict) {\n this.htEditor.selectCell(0, 0);\n this.TEXTAREA.style.visibility = 'hidden';\n } else {\n this.htEditor.deselectCell();\n this.TEXTAREA.style.visibility = 'visible';\n }\n\n setCaretPosition(this.TEXTAREA, 0, this.TEXTAREA.value.length);\n};\n\nHandsontableEditor.prototype.close = function() {\n this.instance.removeHook('beforeKeyDown', onBeforeKeyDown);\n this.instance.listen();\n\n TextEditor.prototype.close.apply(this, arguments);\n};\n\nHandsontableEditor.prototype.focus = function() {\n this.instance.listen();\n TextEditor.prototype.focus.apply(this, arguments);\n};\n\nHandsontableEditor.prototype.beginEditing = function(initialValue) {\n var onBeginEditing = this.instance.getSettings().onBeginEditing;\n\n if (onBeginEditing && onBeginEditing() === false) {\n return;\n }\n TextEditor.prototype.beginEditing.apply(this, arguments);\n};\n\nHandsontableEditor.prototype.finishEditing = function(isCancelled, ctrlDown) {\n if (this.htEditor && this.htEditor.isListening()) { // if focus is still in the HOT editor\n\n this.instance.listen(); // return the focus to the parent HOT instance\n }\n\n if (this.htEditor && this.htEditor.getSelectedLast()) {\n var value = this.htEditor.getInstance().getValue();\n\n if (value !== void 0) { // if the value is undefined then it means we don't want to set the value\n this.setValue(value);\n }\n }\n\n return TextEditor.prototype.finishEditing.apply(this, arguments);\n};\n\nHandsontableEditor.prototype.assignHooks = function() {\n var _this = this;\n\n this.instance.addHook('afterDestroy', () => {\n if (_this.htEditor) {\n _this.htEditor.destroy();\n }\n });\n};\n\nexport default HandsontableEditor;\n\n\n\n// WEBPACK FOOTER //\n// ./src/editors/handsontableEditor.js","/* eslint-disable import/prefer-default-export */\n\n/**\n * Get normalized Date object for the ISO formatted date strings.\n * Natively, the date object parsed from a ISO 8601 string will be offsetted by the timezone difference, which may result in returning a wrong date.\n * See: Github issue #3338.\n *\n * @param {String} dateString String representing the date.\n * @returns {Date} The proper Date object.\n */\nexport function getNormalizedDate(dateString) {\n let nativeDate = new Date(dateString);\n\n // NaN if dateString is not in ISO format\n if (!isNaN(new Date(`${dateString}T00:00`).getDate())) {\n\n // Compensate timezone offset\n return new Date(nativeDate.getTime() + (nativeDate.getTimezoneOffset() * 60000));\n }\n\n return nativeDate;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/helpers/date.js","/**\n * SheetClip - Spreadsheet Clipboard Parser\n * version 0.2\n *\n * This tiny library transforms JavaScript arrays to strings that are pasteable by LibreOffice, OpenOffice,\n * Google Docs and Microsoft Excel.\n *\n * Copyright 2012, Marcin Warpechowski\n * Licensed under the MIT license.\n * http://github.com/warpech/sheetclip/\n */\n/*jslint white: true*/\n(function (global) {\n \"use strict\";\n\n function countQuotes(str) {\n return str.split('\"').length - 1;\n }\n\n var SheetClip = {\n /**\n * Decode spreadsheet string into array\n *\n * @param {String} str\n * @returns {Array}\n */\n parse: function (str) {\n var r, rLen, rows, arr = [], a = 0, c, cLen, multiline, last;\n\n rows = str.split('\\n');\n\n if (rows.length > 1 && rows[rows.length - 1] === '') {\n rows.pop();\n }\n for (r = 0, rLen = rows.length; r < rLen; r += 1) {\n rows[r] = rows[r].split('\\t');\n\n for (c = 0, cLen = rows[r].length; c < cLen; c += 1) {\n if (!arr[a]) {\n arr[a] = [];\n }\n if (multiline && c === 0) {\n last = arr[a].length - 1;\n arr[a][last] = arr[a][last] + '\\n' + rows[r][0];\n\n if (multiline && (countQuotes(rows[r][0]) & 1)) { //& 1 is a bitwise way of performing mod 2\n multiline = false;\n arr[a][last] = arr[a][last].substring(0, arr[a][last].length - 1).replace(/\"\"/g, '\"');\n }\n }\n else {\n if (c === cLen - 1 && rows[r][c].indexOf('\"') === 0 && (countQuotes(rows[r][c]) & 1)) {\n arr[a].push(rows[r][c].substring(1).replace(/\"\"/g, '\"'));\n multiline = true;\n }\n else {\n arr[a].push(rows[r][c].replace(/\"\"/g, '\"'));\n multiline = false;\n }\n }\n }\n if (!multiline) {\n a += 1;\n }\n }\n\n return arr;\n },\n\n /**\n * Encode array into valid spreadsheet string\n *\n * @param arr\n * @returns {String}\n */\n stringify: function (arr) {\n var r, rLen, c, cLen, str = '', val;\n\n for (r = 0, rLen = arr.length; r < rLen; r += 1) {\n cLen = arr[r].length;\n\n for (c = 0; c < cLen; c += 1) {\n if (c > 0) {\n str += '\\t';\n }\n val = arr[r][c];\n\n if (typeof val === 'string') {\n if (val.indexOf('\\n') > -1) {\n str += '\"' + val.replace(/\"/g, '\"\"') + '\"';\n }\n else {\n str += val;\n }\n }\n else if (val === null || val === void 0) { // void 0 resolves to undefined\n str += '';\n }\n else {\n str += val;\n }\n }\n\n if (r !== rLen - 1) {\n str += '\\n';\n }\n }\n\n return str;\n }\n };\n\n if (typeof exports !== 'undefined') {\n exports.parse = SheetClip.parse;\n exports.stringify = SheetClip.stringify;\n } else {\n global.SheetClip = SheetClip;\n }\n}(window));\n\n\n\n// WEBPACK FOOTER //\n// ./lib/SheetClip/SheetClip.js","import {isRightClick, isLeftClick} from './../helpers/dom/event';\nimport {CellCoords} from './../3rdparty/walkontable/src';\n\n/**\n * MouseDown handler.\n *\n * @param {Object} options\n * @param {Boolean} options.isShiftKey The flag which indicates if the shift key is pressed.\n * @param {Boolean} options.isLeftClick The flag which indicates if the left mouse button is pressed.\n * @param {Boolean} options.isRightClick The flag which indicates if the right mouse button is pressed.\n * @param {CellRange} options.coords The CellCoords object with defined visual coordinates.\n * @param {Selection} options.selection The Selection class instance.\n * @param {Object} options.controller An object with keys `row`, `column`, `cell` which indicate what\n * operation will be performed in later selection stages.\n */\nexport function mouseDown({isShiftKey, isLeftClick, isRightClick, coords, selection, controller}) {\n const currentSelection = selection.isSelected() ? selection.getSelectedRange().current() : null;\n const selectedCorner = selection.isSelectedByCorner();\n const selectedRow = selection.isSelectedByRowHeader();\n const selectedColumn = selection.isSelectedByColumnHeader();\n\n if (isShiftKey && currentSelection) {\n if (coords.row >= 0 && coords.col >= 0 && !controller.cells) {\n selection.setRangeEnd(coords);\n\n } else if ((selectedCorner || selectedRow) && coords.row >= 0 && coords.col >= 0 && !controller.cells) {\n selection.setRangeEnd(new CellCoords(coords.row, coords.col));\n\n } else if (selectedCorner && coords.row < 0 && !controller.column) {\n selection.setRangeEnd(new CellCoords(currentSelection.to.row, coords.col));\n\n } else if (selectedRow && coords.col < 0 && !controller.row) {\n selection.setRangeEnd(new CellCoords(coords.row, currentSelection.to.col));\n\n } else if (((!selectedCorner && !selectedRow && coords.col < 0) ||\n (selectedCorner && coords.col < 0)) && !controller.row) {\n selection.selectRows(currentSelection.from.row, coords.row);\n\n } else if (((!selectedCorner && !selectedRow && coords.row < 0) ||\n (selectedRow && coords.row < 0)) && !controller.column) {\n selection.selectColumns(currentSelection.from.col, coords.col);\n }\n } else {\n const newCoord = new CellCoords(coords.row, coords.col);\n\n if (newCoord.row < 0) {\n newCoord.row = 0;\n }\n if (newCoord.col < 0) {\n newCoord.col = 0;\n }\n\n const allowRightClickSelection = !selection.inInSelection(newCoord);\n const performSelection = isLeftClick || (isRightClick && allowRightClickSelection);\n\n // clicked row header and when some column was selected\n if (coords.row < 0 && coords.col >= 0 && !controller.column) {\n if (performSelection) {\n selection.selectColumns(coords.col);\n }\n\n // clicked column header and when some row was selected\n } else if (coords.col < 0 && coords.row >= 0 && !controller.row) {\n if (performSelection) {\n selection.selectRows(coords.row);\n }\n\n } else if (coords.col >= 0 && coords.row >= 0 && !controller.cells) {\n if (performSelection) {\n selection.setRangeStart(coords);\n }\n } else if (coords.col < 0 && coords.row < 0) {\n selection.setRangeStart(coords);\n }\n }\n}\n\n/**\n * MouseOver handler.\n *\n * @param {Object} options\n * @param {Boolean} options.isLeftClick\n * @param {CellRange} options.coords The CellCoords object with defined visual coordinates.\n * @param {Selection} options.selection The Selection class instance.\n * @param {Object} options.controller An object with keys `row`, `column`, `cell` which indicate what\n * operation will be performed in later selection stages.\n */\nexport function mouseOver({isLeftClick, coords, selection, controller}) {\n if (!isLeftClick) {\n return;\n }\n\n const selectedRow = selection.isSelectedByRowHeader();\n const selectedColumn = selection.isSelectedByColumnHeader();\n const countCols = selection.tableProps.countCols();\n const countRows = selection.tableProps.countRows();\n\n if (selectedColumn && !controller.column) {\n selection.setRangeEnd(new CellCoords(countRows - 1, coords.col));\n\n } else if (selectedRow && !controller.row) {\n selection.setRangeEnd(new CellCoords(coords.row, countCols - 1));\n\n } else if (!controller.cell) {\n selection.setRangeEnd(coords);\n }\n}\n\nconst handlers = new Map([\n ['mousedown', mouseDown],\n ['mouseover', mouseOver],\n ['touchstart', mouseDown],\n]);\n\n/**\n * Mouse handler for selection functionality.\n *\n * @param {Event} event An native event to handle.\n * @param {Object} options\n * @param {CellRange} options.coords The CellCoords object with defined visual coordinates.\n * @param {Selection} options.selection The Selection class instance.\n * @param {Object} options.controller An object with keys `row`, `column`, `cell` which indicate what\n * operation will be performed in later selection stages.\n */\nexport function handleMouseEvent(event, {coords, selection, controller}) {\n handlers.get(event.type)({\n coords,\n selection,\n controller,\n isShiftKey: event.shiftKey,\n isLeftClick: isLeftClick(event) || event.type === 'touchstart',\n isRightClick: isRightClick(event),\n });\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/selection/mouseEventHandler.js","import Core from './../core';\nimport {isObject} from './../helpers/object';\n\n/**\n * @class RecordTranslator\n * @util\n */\nclass RecordTranslator {\n constructor(hot) {\n this.hot = hot;\n }\n\n /**\n * Translate physical row index into visual.\n *\n * @param {Number} row Physical row index.\n * @returns {Number} Returns visual row index.\n */\n toVisualRow(row) {\n return this.hot.runHooks('unmodifyRow', row);\n }\n\n /**\n * Translate physical column index into visual.\n *\n * @param {Number} column Physical column index.\n * @returns {Number} Returns visual column index.\n */\n toVisualColumn(column) {\n return this.hot.runHooks('unmodifyCol', column);\n }\n\n /**\n * Translate physical coordinates into visual. Can be passed as separate 2 arguments (row, column) or as an object in first\n * argument with `row` and `column` keys.\n *\n * @param {Number|Object} row Physical coordinates or row index.\n * @param {Number} [column] Physical column index.\n * @returns {Object|Array} Returns an object with visual records or an array if coordinates passed as separate arguments.\n */\n toVisual(row, column) {\n let result;\n\n if (isObject(row)) {\n result = {\n row: this.toVisualRow(row.row),\n column: this.toVisualColumn(row.column),\n };\n } else {\n result = [this.toVisualRow(row), this.toVisualColumn(column)];\n }\n\n return result;\n }\n\n /**\n * Translate visual row index into physical.\n *\n * @param {Number} row Visual row index.\n * @returns {Number} Returns physical row index.\n */\n toPhysicalRow(row) {\n return this.hot.runHooks('modifyRow', row);\n }\n\n /**\n * Translate visual column index into physical.\n *\n * @param {Number} column Visual column index.\n * @returns {Number} Returns physical column index.\n */\n toPhysicalColumn(column) {\n return this.hot.runHooks('modifyCol', column);\n }\n\n /**\n * Translate visual coordinates into physical. Can be passed as separate 2 arguments (row, column) or as an object in first\n * argument with `row` and `column` keys.\n *\n * @param {Number|Object} row Visual coordinates or row index.\n * @param {Number} [column] Visual column index.\n * @returns {Object|Array} Returns an object with physical records or an array if coordinates passed as separate arguments.\n */\n toPhysical(row, column) {\n let result;\n\n if (isObject(row)) {\n result = {\n row: this.toPhysicalRow(row.row),\n column: this.toPhysicalColumn(row.column),\n };\n } else {\n result = [this.toPhysicalRow(row), this.toPhysicalColumn(column)];\n }\n\n return result;\n }\n}\n\nexport {RecordTranslator};\n\nconst identities = new WeakMap();\nconst translatorSingletons = new WeakMap();\n\nexport function registerIdentity(identity, hot) {\n identities.set(identity, hot);\n}\n\nexport function getTranslator(identity) {\n let singleton;\n\n if (!(identity instanceof Core)) {\n if (!identities.has(identity)) {\n throw Error('Record translator was not registered for this object identity');\n }\n identity = identities.get(identity);\n }\n if (translatorSingletons.has(identity)) {\n singleton = translatorSingletons.get(identity);\n\n } else {\n singleton = new RecordTranslator(identity);\n translatorSingletons.set(identity, singleton);\n }\n\n return singleton;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/utils/recordTranslator.js","export const holder = new WeakMap();\n\nexport const rootInstanceSymbol = Symbol('rootInstance');\n\n/**\n * Register an object as a root instance.\n *\n * @param {Object} object An object to associate with root instance flag.\n */\nexport function registerAsRootInstance(object) {\n holder.set(object, true);\n}\n\n/**\n * Check if the source of the root indication call is valid.\n *\n * @param {Symbol} rootSymbol A symbol as a source of truth.\n * @return {Boolean}\n */\nexport function hasValidParameter(rootSymbol) {\n return rootSymbol === rootInstanceSymbol;\n}\n\n/**\n * Check if passed an object was flagged as a root instance.\n *\n * @param {Object} object An object to check.\n * @return {Boolean}\n */\nexport function isRootInstance(object) {\n return holder.has(object);\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/utils/rootInstance.js","import {isDefined} from './helpers/mixed';\nimport {isObjectEqual} from './helpers/object';\n\n/**\n * @alias Options\n * @constructor\n * @description\n\n * ## Constructor options\n *\n * Constructor options are applied using an object literal passed as a second argument to the Handsontable constructor.\n *\n * ```js\n * var hot = new Handsontable(document.getElementById('example1'), {\n * data: myArray,\n * width: 400,\n * height: 300\n * });\n * ```\n *\n * ---\n * ## Cascading configuration\n *\n * Handsontable 0.9 and newer is using *Cascading Configuration*, which is a fast way to provide configuration options\n * for the entire table, including its columns and particular cells.\n *\n * Consider the following example:\n * ```js\n * var hot = new Handsontable(document.getElementById('example'), {\n * readOnly: true,\n * columns: [\n * {readOnly: false},\n * {},\n * {}\n * ],\n * cells: function (row, col, prop) {\n * var cellProperties = {};\n *\n * if (row === 0 && col === 0) {\n * cellProperties.readOnly = true;\n * }\n *\n * return cellProperties;\n * }\n * });\n * ```\n *\n * The above notation will result in all TDs being *read only*, except for first column TDs which will be *editable*, except for the TD in top left corner which will still be *read only*.\n *\n * ### The Cascading Configuration model\n *\n * ##### 1. Constructor\n *\n * Configuration options that are provided using first-level `handsontable(container, {option: \"value\"})` and `updateSettings` method.\n *\n * ##### 2. Columns\n *\n * Configuration options that are provided using second-level object `handsontable(container, {columns: {option: \"value\"}]})`\n *\n * ##### 3. Cells\n *\n * Configuration options that are provided using third-level function `handsontable(container, {cells: function: (row, col, prop){ }})`\n *\n * ---\n * ## Architecture performance\n *\n * The Cascading Configuration model is based on prototypical inheritance. It is much faster and memory efficient compared\n * to the previous model that used jQuery extend. See: [http://jsperf.com/extending-settings](http://jsperf.com/extending-settings).\n *\n * ---\n * __Important notice:__ In order for the data separation to work properly, make sure that each instance of Handsontable has a unique `id`.\n */\nfunction DefaultSettings() {};\n\nDefaultSettings.prototype = {\n /**\n * License key for commercial version of Handsontable.\n *\n * @pro\n * @type {String}\n * @default 'trial'\n */\n licenseKey: 'trial',\n\n /**\n * @description\n * Initial data source that will be bound to the data grid __by reference__ (editing data grid alters the data source).\n * Can be declared as an Array of Arrays, Array of Objects or a Function.\n *\n * See [Understanding binding as reference](http://docs.handsontable.com/tutorial-data-binding.html#page-reference).\n *\n * @type {Array|Function}\n * @default undefined\n */\n data: void 0,\n\n /**\n * @description\n * Defines the structure of a new row when data source is an array of objects.\n *\n * See [data-schema](http://docs.handsontable.com/tutorial-data-sources.html#page-data-schema) for examples.\n *\n * @type {Object}\n * @default undefined\n */\n dataSchema: void 0,\n\n /**\n * Width of the grid. Can be a value or a function that returns a value.\n *\n * @type {Number|Function}\n * @default undefined\n */\n width: void 0,\n\n /**\n * Height of the grid. Can be a number or a function that returns a number.\n *\n * @type {Number|Function}\n * @default undefined\n */\n height: void 0,\n\n /**\n * @description\n * Initial number of rows.\n *\n * __Notice:__ This option only has effect in Handsontable constructor and only if `data` option is not provided\n *\n * @type {Number}\n * @default 5\n */\n startRows: 5,\n\n /**\n * @description\n * Initial number of columns.\n *\n * __Notice:__ This option only has effect in Handsontable constructor and only if `data` option is not provided\n *\n * @type {Number}\n * @default 5\n */\n startCols: 5,\n\n /**\n * Setting `true` or `false` will enable or disable the default row headers (1, 2, 3).\n * You can also define an array `['One', 'Two', 'Three', ...]` or a function to define the headers.\n * If a function is set the index of the row is passed as a parameter.\n *\n * @type {Boolean|Array|Function}\n * @default null\n * @example\n * ```js\n * ...\n * // as boolean\n * rowHeaders: true,\n * ...\n *\n * ...\n * // as array\n * rowHeaders: [1, 2, 3],\n * ...\n *\n * ...\n * // as function\n * rowHeaders: function(index) {\n * return index + ': AB';\n * },\n * ...\n * ```\n */\n rowHeaders: void 0,\n\n /**\n * Setting `true` or `false` will enable or disable the default column headers (A, B, C).\n * You can also define an array `['One', 'Two', 'Three', ...]` or a function to define the headers.\n * If a function is set, then the index of the column is passed as a parameter.\n *\n * @type {Boolean|Array|Function}\n * @default null\n * @example\n * ```js\n * ...\n * // as boolean\n * colHeaders: true,\n * ...\n *\n * ...\n * // as array\n * colHeaders: ['A', 'B', 'C'],\n * ...\n *\n * ...\n * // as function\n * colHeaders: function(index) {\n * return index + ': AB';\n * },\n * ...\n * ```\n */\n colHeaders: null,\n\n /**\n * Defines column widths in pixels. Accepts number, string (that will be converted to a number),\n * array of numbers (if you want to define column width separately for each column) or a\n * function (if you want to set column width dynamically on each render).\n *\n * @type {Array|Function|Number|String}\n * @default undefined\n * @example\n * ```js\n * ...\n * // as numeric, for each column.\n * colWidths: 100,\n * ...\n *\n * * ...\n * // as string, for each column.\n * colWidths: '100px',\n * ...\n *\n * ...\n * // as array, based on visual indexes. The rest of the columns have a default width.\n * colWidths: [100, 120, 90],\n * ...\n *\n * ...\n * // as function, based on visual indexes.\n * colWidths: function(index) {\n * return index * 10;\n * },\n * ...\n * ```\n */\n colWidths: void 0,\n\n /**\n * Defines row heights in pixels. Accepts numbers, strings (that will be converted into a number),\n * array of numbers (if you want to define row height separately for each row) or a\n * function (if you want to set row height dynamically on each render).\n * If the ManualRowResize or AutoRowSize plugins are enabled, this is also the minimum height that can be set\n * via either of those two plugins.\n * Height should be equal or greater than 23px. Table is rendered incorrectly if height is less than 23px.\n *\n * @type {Array|Function|Number|String}\n * @default undefined\n * @example\n * ```js\n * ...\n * // as numeric, for each row.\n * rowHeights: 100,\n * ...\n *\n * * ...\n * // as string, for each row.\n * rowHeights: '100px',\n * ...\n *\n * ...\n * // as array, based on visual indexes. The rest of the rows have a default height.\n * rowHeights: [100, 120, 90],\n * ...\n *\n * ...\n * // as function, based on visual indexes.\n * rowHeights: function(index) {\n * return index * 10;\n * },\n * ...\n * ```\n */\n rowHeights: void 0,\n\n /**\n * @description\n * Defines the cell properties and data binding for certain columns.\n *\n * __Notice:__ Using this option sets a fixed number of columns (options `startCols`, `minCols`, `maxCols` will be ignored).\n *\n * See [documentation -> datasources.html](http://docs.handsontable.com/tutorial-data-sources.html#page-nested) for examples.\n *\n * @type {Array|Function}\n * @default undefined\n * @example\n * ```js\n * ...\n * // as an array of objects. Order of the objects in array is representation of physical indexes.\n * columns: [\n * {\n * // column options for the first column\n * type: 'numeric',\n * numericFormat: {\n * pattern: '0,0.00 $'\n * }\n * },\n * {\n * // column options for the second column\n * type: 'text',\n * readOnly: true\n * }\n * ],\n * ...\n *\n * // or as function, based on physical indexes\n * ...\n * columns: function(index) {\n * return {\n * type: index > 0 ? 'numeric' : 'text',\n * readOnly: index < 1\n * }\n * }\n * ...\n * ```\n */\n columns: void 0,\n\n /**\n * @description\n * Defines the cell properties for given `row`, `col`, `prop` coordinates.\n * Any constructor or column option may be overwritten for a particular cell (row/column combination)\n * using the `cells` property in the Handsontable constructor.\n *\n * __Note:__ Parameters `row` and `col` always represent __physical indexes__. Example below show how to execute\n * operations based on the __visual__ representation of Handsontable.\n *\n * Possible values of `prop`:\n * - property name for column's data source object, when dataset is an [array of objects](/tutorial-data-sources.html#page-object)\n * - the same number as `col`, when dataset is an [array of arrays](/tutorial-data-sources.html#page-array)\n *\n * @type {Function}\n * @default undefined\n * @example\n * ```js\n * ...\n * cells: function (row, col, prop) {\n * var cellProperties = {};\n * var visualRowIndex = this.instance.toVisualRow(row);\n * var visualColIndex = this.instance.toVisualColumn(col);\n *\n * if (visualRowIndex === 0 && visualColIndex === 0) {\n * cellProperties.readOnly = true;\n * }\n *\n * return cellProperties;\n * },\n * ...\n * ```\n */\n cells: void 0,\n\n /**\n * Any constructor or column option may be overwritten for a particular cell (row/column combination), using `cell`\n * array passed to the Handsontable constructor.\n *\n * @type {Array}\n * @default []\n * @example\n * ```js\n * ...\n * cell: [\n * {row: 0, col: 0, readOnly: true}\n * ],\n * ...\n * ```\n */\n cell: [],\n\n /**\n * @description\n * If `true`, enables the {@link Comments} plugin, which enables an option to apply cell comments through the context menu\n * (configurable with context menu keys `commentsAddEdit`, `commentsRemove`).\n *\n * To initialize Handsontable with predefined comments, provide cell coordinates and comment text values in a form of an array.\n *\n * See [Comments](http://docs.handsontable.com/demo-comments_.html) demo for examples.\n *\n * @since 0.11.0\n * @type {Boolean|Array}\n * @default false\n * @example\n * ```js\n * ...\n * comments: [{row: 1, col: 1, comment: {value: \"Test comment\"}}],\n * ...\n * ```\n */\n comments: false,\n\n /**\n * @description\n * If `true`, enables the Custom Borders plugin, which enables an option to apply custom borders through the context menu (configurable with context menu key `borders`).\n *\n * To initialize Handsontable with predefined custom borders, provide cell coordinates and border styles in a form of an array.\n *\n * See [Custom Borders](http://docs.handsontable.com/demo-custom-borders.html) demo for examples.\n *\n * @since 0.11.0\n * @type {Boolean|Array}\n * @default false\n * @example\n * ```js\n * ...\n * customBorders: [\n * {range: {\n * from: {row: 1, col: 1},\n * to: {row: 3, col: 4}},\n * left: {},\n * right: {},\n * top: {},\n * bottom: {}\n * }\n * ],\n * ...\n *\n * // or\n * ...\n * customBorders: [\n * {row: 2, col: 2, left: {width: 2, color: 'red'},\n * right: {width: 1, color: 'green'}, top: '', bottom: ''}\n * ],\n * ...\n * ```\n */\n customBorders: false,\n\n /**\n * Minimum number of rows. At least that number of rows will be created during initialization.\n *\n * @type {Number}\n * @default 0\n */\n minRows: 0,\n\n /**\n * Minimum number of columns. At least that number of columns will be created during initialization.\n *\n * @type {Number}\n * @default 0\n */\n minCols: 0,\n\n /**\n * Maximum number of rows. If set to a value lower than the initial row count, the data will be trimmed to the provided value as the number of rows.\n *\n * @type {Number}\n * @default Infinity\n */\n maxRows: Infinity,\n\n /**\n * Maximum number of cols. If set to a value lower than the initial col count, the data will be trimmed to the provided value as the number of cols.\n *\n * @type {Number}\n * @default Infinity\n */\n maxCols: Infinity,\n\n /**\n * When set to 1 (or more), Handsontable will add a new row at the end of grid if there are no more empty rows.\n * (unless the number of rows exceeds the one set in the `maxRows` property)\n *\n * @type {Number}\n * @default 0\n */\n minSpareRows: 0,\n\n /**\n * When set to 1 (or more), Handsontable will add a new column at the end of grid if there are no more empty columns.\n * (unless the number of rows exceeds the one set in the `maxCols` property)\n *\n * @type {Number}\n * @default 0\n */\n minSpareCols: 0,\n\n /**\n * If set to `false`, there won't be an option to insert new rows in the Context Menu.\n *\n * @type {Boolean}\n * @default true\n */\n allowInsertRow: true,\n\n /**\n * If set to `false`, there won't be an option to insert new columns in the Context Menu.\n *\n * @type {Boolean}\n * @default true\n */\n allowInsertColumn: true,\n\n /**\n * If set to `false`, there won't be an option to remove rows in the Context Menu.\n *\n * @type {Boolean}\n * @default true\n */\n allowRemoveRow: true,\n\n /**\n * If set to `false`, there won't be an option to remove columns in the Context Menu.\n *\n * @type {Boolean}\n * @default true\n */\n allowRemoveColumn: true,\n\n /**\n * @description\n * Defines how the table selection reacts. The selection support three different behaviors defined as:\n * * `'single'` Only a single cell can be selected.\n * * `'range'` Multiple cells within a single range can be selected.\n * * `'multiple'` Multiple ranges of cells can be selected.\n *\n * To see how to interact with selection by getting selected data or change styles of the selected cells go to\n * [https://docs.handsontable.com/demo-selecting-ranges.html](https://docs.handsontable.com/demo-selecting-ranges.html).\n *\n * @since 0.36.0\n * @type {String}\n * @default 'multiple'\n */\n selectionMode: 'multiple',\n\n /**\n * Enables the fill handle (drag-down and copy-down) functionality, which shows a small rectangle in bottom\n * right corner of the selected area, that let's you expand values to the adjacent cells.\n *\n * Possible values: `true` (to enable in all directions), `'vertical'` or `'horizontal'` (to enable in one direction),\n * `false` (to disable completely). Setting to `true` enables the fillHandle plugin.\n *\n * Since 0.23.0 you can pass object to plugin which allows you to add more options for this functionality. If `autoInsertRow`\n * option is `true`, fill-handler will create new rows till it reaches the last row. It is enabled by default.\n *\n * @example\n * ```js\n * ...\n * fillHandle: true // enable plugin in all directions and with autoInsertRow as true\n * ...\n * // or\n * ...\n * fillHandle: 'vertical' // enable plugin in vertical direction and with autoInsertRow as true\n * ...\n * // or\n * ...\n * fillHandle: { // enable plugin in both directions and with autoInsertRow as false\n * autoInsertRow: false,\n * }\n * // or\n * ...\n * fillHandle: { // enable plugin in vertical direction and with autoInsertRow as false\n * autoInsertRow: false,\n * direction: 'vertical' // 'vertical' or 'horizontal'\n * }\n * ```\n *\n * @type {Boolean|String|Object}\n * @default true\n */\n fillHandle: true,\n\n /**\n * Allows to specify the number of fixed (or *frozen*) rows at the top of the table.\n *\n * @type {Number}\n * @default 0\n * @example\n * ```js\n * fixedRowsTop: 3 // This would freeze the top 3 rows of the table.\n * ```\n */\n fixedRowsTop: 0,\n\n /**\n * Allows to specify the number of fixed (or *frozen*) rows at the bottom of the table.\n *\n * @pro\n * @type {Number}\n * @default 0\n * @example\n * ```js\n * fixedRowsBottom: 3 // This would freeze the top 3 rows of the table.\n * ```\n */\n fixedRowsBottom: 0,\n\n /**\n * Allows to specify the number of fixed (or *frozen*) columns on the left of the table.\n *\n * @type {Number}\n * @default 0\n * @example\n * ```js\n * fixedColumnsLeft: 3 // This would freeze the top 3 rows of the table.\n * ```\n */\n fixedColumnsLeft: 0,\n\n /**\n * If `true`, mouse click outside the grid will deselect the current selection.\n * Can be a function that takes the click event target and returns a boolean.\n *\n * @type {Boolean|Function}\n * @default true\n */\n outsideClickDeselects: true,\n\n /**\n * If `true`, <kbd>ENTER</kbd> begins editing mode (like in Google Docs). If `false`, <kbd>ENTER</kbd> moves to next\n * row (like Excel) and adds a new row if necessary. <kbd>TAB</kbd> adds new column if necessary.\n *\n * @type {Boolean}\n * @default true\n */\n enterBeginsEditing: true,\n\n /**\n * Defines the cursor movement after <kbd>ENTER</kbd> was pressed (<kbd>SHIFT</kbd> + <kbd>ENTER</kbd> uses a negative vector).\n * Can be an object or a function that returns an object. The event argument passed to the function\n * is a DOM Event object received after the <kbd>ENTER</kbd> key has been pressed. This event object can be used to check\n * whether user pressed <kbd>ENTER</kbd> or <kbd>SHIFT</kbd> + <kbd>ENTER</kbd>.\n *\n * @type {Object|Function}\n * @default {row: 1, col: 0}\n */\n enterMoves: {row: 1, col: 0},\n\n /**\n * Defines the cursor movement after <kbd>TAB</kbd> is pressed (<kbd>SHIFT</kbd> + <kbd>TAB</kbd> uses a negative vector).\n * Can be an object or a function that returns an object. The event argument passed to the function\n * is a DOM Event object received after the <kbd>TAB</kbd> key has been pressed. This event object can be used to check\n * whether user pressed <kbd>TAB</kbd> or <kbd>SHIFT</kbd> + <kbd>TAB</kbd>.\n *\n * @type {Object}\n * @default {row: 0, col: 1}\n */\n tabMoves: {row: 0, col: 1},\n\n /**\n * If `true`, pressing <kbd>TAB</kbd> or right arrow in the last column will move to first column in next row.\n *\n * @type {Boolean}\n * @default false\n */\n autoWrapRow: false,\n\n /**\n * If `true`, pressing <kbd>ENTER</kbd> or down arrow in the last row will move to the first row in the next column.\n *\n * @type {Boolean}\n * @default false\n */\n autoWrapCol: false,\n\n /**\n * @description\n * Turns on saving the state of column sorting, column positions and column sizes in local storage.\n *\n * You can save any sort of data in local storage to preserve table state between page reloads.\n * In order to enable data storage mechanism, `persistentState` option must be set to `true` (you can set it\n * either during Handsontable initialization or using the `updateSettings` method). When `persistentState` is enabled it exposes 3 hooks:\n *\n * __persistentStateSave__ (key: String, value: Mixed)\n *\n * * Saves value under given key in browser local storage.\n *\n * __persistentStateLoad__ (key: String, valuePlaceholder: Object)\n *\n * * Loads `value`, saved under given key, form browser local storage. The loaded `value` will be saved in `valuePlaceholder.value`\n * (this is due to specific behaviour of `Hooks.run()` method). If no value have been saved under key `valuePlaceholder.value`\n * will be `undefined`.\n *\n * __persistentStateReset__ (key: String)\n *\n * * Clears the value saved under `key`. If no `key` is given, all values associated with table will be cleared.\n *\n * __Note:__ The main reason behind using `persistentState` hooks rather than regular LocalStorage API is that it\n * ensures separation of data stored by multiple Handsontable instances. In other words, if you have two (or more)\n * instances of Handsontable on one page, data saved by one instance won't be accessible by the second instance.\n * Those two instances can store data under the same key and no data would be overwritten.\n *\n * __Important:__ In order for the data separation to work properly, make sure that each instance of Handsontable has a unique `id`.\n *\n * @type {Boolean}\n * @default false\n */\n persistentState: void 0,\n\n /**\n * Class name for all visible rows in the current selection.\n *\n * @type {String}\n * @default undefined\n * @example\n * ```js\n * currentRowClassName: 'currentRow' // This will add a 'currentRow' class name to appropriate table cells.\n * ```\n */\n currentRowClassName: void 0,\n\n /**\n * Class name for all visible columns in the current selection.\n *\n * @type {String}\n * @default undefined\n * @example\n * ```js\n * currentColClassName: 'currentColumn' // This will add a 'currentColumn' class name to appropriate table cells.\n * ```\n */\n currentColClassName: void 0,\n\n /**\n * Class name for all visible headers in current selection.\n *\n * @type {String}\n * @since 0.27.0\n * @default 'ht__highlight'\n * @example\n * ```js\n * currentHeaderClassName: 'ht__highlight' // This will add a 'ht__highlight' class name to appropriate table headers.\n * ```\n */\n currentHeaderClassName: 'ht__highlight',\n\n /**\n * Class name for all active headers in selections. The header will be marked with this class name\n * only when a whole column or row will be selected.\n *\n * @type {String}\n * @since 0.38.2\n * @default 'ht__active_highlight'\n * @example\n * ```js\n * activeHeaderClassName: 'ht__active_highlight' // This will add a 'ht__active_highlight' class name to appropriate table headers.\n * ```\n */\n activeHeaderClassName: 'ht__active_highlight',\n\n /**\n * Class name for the Handsontable container element.\n *\n * @type {String|Array}\n * @default undefined\n */\n className: void 0,\n\n /**\n * Class name for all tables inside container element.\n *\n * @since 0.17.0\n * @type {String|Array}\n * @default undefined\n */\n tableClassName: void 0,\n\n /**\n * @description\n * Defines how the columns react, when the declared table width is different than the calculated sum of all column widths.\n * [See more](http://docs.handsontable.com/demo-stretching.html) mode. Possible values:\n * * `'none'` Disable stretching\n * * `'last'` Stretch only the last column\n * * `'all'` Stretch all the columns evenly\n *\n * @type {String}\n * @default 'none'\n */\n stretchH: 'none',\n\n /**\n * Lets you overwrite the default `isEmptyRow` method, which checks if row at the provided index is empty.\n *\n * @type {Function}\n * @param {Number} row Visual row index.\n * @returns {Boolean}\n */\n isEmptyRow(row) {\n var col,\n colLen,\n value,\n meta;\n\n for (col = 0, colLen = this.countCols(); col < colLen; col++) {\n value = this.getDataAtCell(row, col);\n\n if (value !== '' && value !== null && isDefined(value)) {\n if (typeof value === 'object') {\n meta = this.getCellMeta(row, col);\n\n return isObjectEqual(this.getSchema()[meta.prop], value);\n }\n return false;\n }\n }\n\n return true;\n },\n\n /**\n * Lets you overwrite the default `isEmptyCol` method, which checks if column at the provided index is empty.\n *\n * @type {Function}\n * @param {Number} col Visual column index\n * @returns {Boolean}\n */\n isEmptyCol(col) {\n var row,\n rowLen,\n value;\n\n for (row = 0, rowLen = this.countRows(); row < rowLen; row++) {\n value = this.getDataAtCell(row, col);\n\n if (value !== '' && value !== null && isDefined(value)) {\n return false;\n }\n }\n\n return true;\n },\n\n /**\n * When set to `true`, the table is re-rendered when it is detected that it was made visible in DOM.\n *\n * @type {Boolean}\n * @default true\n */\n observeDOMVisibility: true,\n\n /**\n * If set to `true`, Handsontable will accept values that were marked as invalid by the cell `validator`.\n * It will result with *invalid* cells being treated as *valid* (will save the *invalid* value into the Handsontable data source).\n * If set to `false`, Handsontable will *not* accept the invalid values and won't allow the user to close the editor.\n * This option will be particularly useful when used with the Autocomplete's `strict` mode.\n *\n * @type {Boolean}\n * @default true\n * @since 0.9.5\n */\n allowInvalid: true,\n\n /**\n * If set to `true`, Handsontable will accept values that are empty (`null`, `undefined` or `''`).\n * If set to `false`, Handsontable will *not* accept the empty values and mark cell as invalid.\n *\n * @example\n * ```js\n * ...\n * allowEmpty: true // allow empty values for all cells (whole table)\n * ...\n * // or\n * ...\n * columns: [\n * // allow empty values only for 'date' column\n * {data: 'date', dateFormat: 'DD/MM/YYYY', allowEmpty: true}\n * ]\n * ...\n * ```\n *\n * @type {Boolean}\n * @default true\n * @since 0.23.0\n */\n allowEmpty: true,\n\n /**\n * CSS class name for cells that did not pass validation.\n *\n * @type {String}\n * @default 'htInvalid'\n */\n invalidCellClassName: 'htInvalid',\n\n /**\n * When set to an non-empty string, displayed as the cell content for empty cells. If a value of a different type is provided,\n * it will be stringified and applied as a string.\n *\n * @type {Mixed}\n * @default false\n */\n placeholder: false,\n\n /**\n * CSS class name for cells that have a placeholder in use.\n *\n * @type {String}\n * @default 'htPlaceholder'\n */\n placeholderCellClassName: 'htPlaceholder',\n\n /**\n * CSS class name for read-only cells.\n *\n * @type {String}\n * @default 'htDimmed'\n */\n readOnlyCellClassName: 'htDimmed',\n\n /**\n * @description\n * If a string is provided, it may be one of the following predefined values:\n * * `autocomplete`,\n * * `checkbox`,\n * * `html`,\n * * `numeric`,\n * * `password`.\n * * `text`.\n *\n * Or you can [register](http://docs.handsontable.com/demo-custom-renderers.html) the custom renderer under specified name and use\n * its name as an alias in your configuration.\n *\n * If a function is provided, it will receive the following arguments:\n * ```js\n * function(instance, TD, row, col, prop, value, cellProperties) {}\n * ```\n *\n * You can read more about custom renderes [in the documentation](http://docs.handsontable.com/demo-custom-renderers.html).\n *\n * @example\n * ```js\n * ...\n * Handsontable.renderers.registerRenderer('my.renderer', function(instance, TD, row, col, prop, value, cellProperties) {\n * TD.innerHTML = value;\n * });\n * ...\n * columns: [\n * {\n * editor: 'select',\n * renderer: 'autocomplete' // as string\n * },\n * {\n * renderer: 'my.renderer' // custom renderer as an alias\n * },\n * {\n * // renderer as custom function\n * renderer: function(hotInstance, TD, row, col, prop, value, cellProperties) {\n * TD.style.color = 'blue';\n * TD.innerHTML = value;\n * }\n * }\n * ]\n * ...\n * ```\n *\n * @type {String|Function}\n * @default undefined\n */\n renderer: void 0,\n\n /**\n * CSS class name added to the commented cells.\n *\n * @type {String}\n * @default 'htCommentCell'\n */\n commentedCellClassName: 'htCommentCell',\n\n /**\n * If set to `true`, it enables the browser's native selection of a fragment of the text within a single cell, between adjacent cells or in a whole table.\n * If set to `'cell'`, it enables the possibility of selecting a fragment of the text within a single cell's body.\n *\n * @type {Boolean|String}\n * @default false\n */\n fragmentSelection: false,\n\n /**\n * @description\n * Make cell [read only](http://docs.handsontable.com/demo-read-only.html).\n *\n * @type {Boolean}\n * @default false\n */\n readOnly: false,\n\n /**\n * @description\n * When added to a `column` property, it skips the column on paste and pastes the data on the next column to the right.\n *\n * @type {Boolean}\n * @default false\n */\n skipColumnOnPaste: false,\n\n /**\n * @description\n * Setting to true enables the search plugin (see [demo](http://docs.handsontable.com/demo-search-for-values.html)).\n *\n * @type {Boolean}\n * @default false\n */\n search: false,\n\n /**\n * @description\n * Shortcut to define the combination of the cell renderer, editor and validator for the column, cell or whole table.\n *\n * Possible values:\n * * [autocomplete](http://docs.handsontable.com/demo-autocomplete.html)\n * * [checkbox](http://docs.handsontable.com/demo-checkbox.html)\n * * [date](http://docs.handsontable.com/demo-date.html)\n * * [dropdown](http://docs.handsontable.com/demo-dropdown.html)\n * * [handsontable](http://docs.handsontable.com/demo-handsontable.html)\n * * [numeric](http://docs.handsontable.com/demo-numeric.html)\n * * [password](http://docs.handsontable.com/demo-password.html)\n * * text\n * * [time](http://docs.handsontable.com/demo-time.html)\n *\n * Or you can register the custom cell type under specified name and use\n * its name as an alias in your configuration.\n *\n * @example\n * ```js\n * ...\n * Handsontable.cellTypes.registerCellType('my.type', {\n * editor: MyEditorClass,\n * renderer: function(hot, td, row, col, prop, value, cellProperties) {\n * td.innerHTML = value;\n * },\n * validator: function(value, callback) {\n * callback(value === 'foo' ? true : false);\n * }\n * });\n * ...\n * columns: [\n * {\n * type: 'text'\n * },\n * {\n * type: 'my.type' // an alias to custom type\n * },\n * {\n * type: 'checkbox'\n * }\n * ]\n * ...\n * ```\n *\n * @type {String}\n * @default 'text'\n */\n type: 'text',\n\n /**\n * @description\n * Make cell copyable (pressing <kbd>CTRL</kbd> + <kbd>C</kbd> on your keyboard moves its value to system clipboard).\n *\n * __Note:__ this setting is `false` by default for cells with type `password`.\n *\n * @type {Boolean}\n * @default true\n * @since 0.10.2\n */\n copyable: true,\n\n /**\n * Defines the editor for the table/column/cell.\n *\n * If a string is provided, it may be one of the following predefined values:\n * * [autocomplete](http://docs.handsontable.com/demo-autocomplete.html)\n * * [checkbox](http://docs.handsontable.com/demo-checkbox.html)\n * * [date](http://docs.handsontable.com/demo-date.html)\n * * [dropdown](http://docs.handsontable.com/demo-dropdown.html)\n * * [handsontable](http://docs.handsontable.com/demo-handsontable.html)\n * * [mobile](http://docs.handsontable.com/demo-mobiles-and-tablets.html)\n * * [password](http://docs.handsontable.com/demo-password.html)\n * * [select](http://docs.handsontable.com/demo-select.html)\n * * text\n *\n * Or you can [register](http://docs.handsontable.com/tutorial-cell-editor.html#registering-an-editor) the custom editor under specified name and use\n * its name as an alias in your configuration.\n *\n * To disable cell editing completely set `editor` property to `false`.\n *\n * @example\n * ```js\n * ...\n * columns: [\n * {\n * editor: 'select'\n * },\n * {\n * editor: false\n * }\n * ]\n * ...\n * ```\n *\n * @type {String|Function|Boolean}\n * @default 'text'\n */\n editor: void 0,\n\n /**\n * @description\n * Autocomplete definitions. See [autocomplete demo](http://docs.handsontable.com/demo-autocomplete.html) for examples and definitions.\n *\n * @type {Array}\n * @default undefined\n */\n autoComplete: void 0,\n\n /**\n * Control number of choices for the autocomplete (or dropdown) typed cells. After exceeding it, a scrollbar for the dropdown list of choices will appear.\n *\n * @since 0.18.0\n * @type {Number}\n * @default 10\n */\n visibleRows: 10,\n\n /**\n * Makes autocomplete or dropdown width the same as the edited cell width. If `false` then editor will be scaled\n * according to its content.\n *\n * @since 0.17.0\n * @type {Boolean}\n * @default true\n */\n trimDropdown: true,\n\n /**\n * Setting to true enables the debug mode, currently used to test the correctness of the row and column\n * header fixed positioning on a layer above the master table.\n *\n * @type {Boolean}\n * @default false\n */\n debug: false,\n\n /**\n * When set to `true`, the text of the cell content is wrapped if it does not fit in the fixed column width.\n *\n * @type {Boolean}\n * @default true\n * @since 0.11.0\n */\n wordWrap: true,\n\n /**\n * CSS class name added to cells with cell meta `wordWrap: false`.\n *\n * @type {String}\n * @default 'htNoWrap'\n * @since 0.11.0\n */\n noWordWrapClassName: 'htNoWrap',\n\n /**\n * @description\n * Defines if the right-click context menu should be enabled. Context menu allows to create new row or\n * column at any place in the grid among [other features](http://docs.handsontable.com/demo-context-menu.html).\n * Possible values:\n * * `true` (to enable default options),\n * * `false` (to disable completely)\n * * an array of [predefined options](https://docs.handsontable.com/demo-context-menu.html#page-specific),\n * * an object [with defined structure](http://docs.handsontable.com/demo-context-menu.html#page-custom)\n *\n * See [the context menu demo](http://docs.handsontable.com/demo-context-menu.html) for examples.\n *\n * @example\n * ```js\n * ...\n * // as a boolean\n * contextMenu: true\n * ...\n * // as an array\n * contextMenu: ['row_above', 'row_below', '--------', 'undo', 'redo']\n * ...\n * ```\n * ...\n * // as an object (`name` attribute is required in the custom keys)\n * contextMenu: {\n * items: {\n * \"option1\": {\n * name: \"option1\"\n * },\n * \"option2\": {\n * name: \"option2\",\n * submenu: {\n * items: [\n * {\n * key: \"option2:suboption1\",\n * name: \"option2:suboption1\",\n * callback: function(key, options) {\n * ...\n * }\n * },\n * ...\n * ]\n * }\n * }\n * }\n * }\n * ...\n * ```\n * @type {Boolean|Array|Object}\n * @default undefined\n */\n contextMenu: void 0,\n\n /**\n * @description\n * Disable or enable the copy/paste functionality.\n *\n * @example\n * ```js\n * ...\n * copyPaste: false,\n * ...\n * ```\n *\n * @type {Boolean}\n * @default true\n */\n copyPaste: true,\n\n /**\n * If `true`, undo/redo functionality is enabled.\n *\n * @type {Boolean}\n * @default undefined\n */\n undo: void 0,\n\n /**\n * @description\n * Turns on [Column sorting](http://docs.handsontable.com/demo-sorting-data.html).\n * Can be either a boolean (true/false) or an object with a declared sorting options. See the below example:\n *\n * @example\n * ```js\n * ...\n * // as boolean\n * columnSorting: true\n * ...\n * // as a object with initial order (sort ascending column at index 2)\n * columnSorting: {\n * column: 2,\n * sortOrder: true, // true = ascending, false = descending, undefined = original order\n * sortEmptyCells: true // true = the table sorts empty cells, false = the table moves all empty cells to the end of the table\n * }\n * ...\n * ```\n *\n * @type {Boolean|Object}\n * @default undefined\n */\n columnSorting: void 0,\n\n /**\n * @description\n * Turns on [Manual column move](http://docs.handsontable.com/demo-moving-rows-and-columns.html), if set to a boolean or define initial\n * column order, if set to an array of column indexes.\n *\n * @example\n * ```js\n * ...\n * // as boolean\n * manualColumnMove: true\n * ...\n * // as a array with initial order (move column index at 0 to 1 and move column index at 1 to 4)\n * manualColumnMove: [1, 4]\n * ...\n * ```\n *\n * @type {Boolean|Array}\n * @default undefined\n */\n manualColumnMove: void 0,\n\n /**\n * @description\n * Turns on [Manual column resize](http://docs.handsontable.com/demo-resizing.html), if set to a boolean or define initial\n * column resized widths, if set to an array of numbers.\n *\n * @example\n * ```js\n * ...\n * // as boolean\n * manualColumnResize: true\n * ...\n * // as a array with initial widths (column at 0 index has 40px and column at 1 index has 50px)\n * manualColumnResize: [40, 50]\n * ...\n * ```\n *\n * @type {Boolean|Array}\n * @default undefined\n */\n manualColumnResize: void 0,\n\n /**\n * @description\n * Turns on [Manual row move](http://docs.handsontable.com/demo-moving-rows-and-columns.html), if set to a boolean or define initial\n * row order, if set to an array of row indexes.\n *\n * @example\n * ```js\n * ...\n * // as boolean\n * manualRowMove: true\n * ...\n * // as a array with initial order (move row index at 0 to 1 and move row index at 1 to 4)\n * manualRowMove: [1, 4]\n * ...\n * ```\n *\n * @type {Boolean|Array}\n * @default undefined\n * @since 0.11.0\n */\n manualRowMove: void 0,\n\n /**\n * @description\n * Turns on [Manual row resize](http://docs.handsontable.com/demo-resizing.html), if set to a boolean or define initial\n * row resized heights, if set to an array of numbers.\n *\n * @example\n * ```js\n * ...\n * // as boolean\n * manualRowResize: true\n * ...\n * // as a array with initial heights (row at 0 index has 40px and row at 1 index has 50px)\n * manualRowResize: [40, 50]\n * ...\n * ```\n *\n * @type {Boolean|Array}\n * @default undefined\n * @since 0.11.0\n */\n manualRowResize: void 0,\n\n /**\n * @description\n * If set to `true`, it enables a possibility to merge cells. If set to an array of objects, it merges the cells provided in the objects (see the example below).\n * [More information on the demo page.](http://docs.handsontable.com/demo-merge-cells.html)\n *\n * @example\n * ```js\n * // enables the mergeCells plugin:\n * margeCells: true\n * ...\n * // declares a list of merged sections:\n * mergeCells: [\n * {row: 1, col: 1, rowspan: 3, colspan: 3}, // rowspan and colspan properties declare the width and height of a merged section in cells\n * {row: 3, col: 4, rowspan: 2, colspan: 2},\n * {row: 5, col: 6, rowspan: 3, colspan: 3}\n * ]\n * ```\n * @type {Boolean|Array}\n * @default false\n */\n mergeCells: false,\n\n /**\n * Number of rows to be rendered outside of the visible part of the table.\n * By default, it's set to `'auto'`, which makes Handsontable to attempt to calculate the best offset performance-wise.\n *\n * You may test out different values to find the best one that works for your specific implementation.\n *\n * @type {Number|String}\n * @default 'auto'\n */\n viewportRowRenderingOffset: 'auto',\n\n /**\n * Number of columns to be rendered outside of the visible part of the table.\n * By default, it's set to `'auto'`, which makes Handsontable try calculating the best offset performance-wise.\n *\n * You may experiment with the value to find the one that works best for your specific implementation.\n *\n * @type {Number|String}\n * @default 'auto'\n */\n viewportColumnRenderingOffset: 'auto',\n\n /**\n * A function, regular expression or a string, which will be used in the process of cell validation.\n * If a function is used, be sure to execute the callback argument with either `true` (`callback(true)`) if the validation passed\n * or with `false` (`callback(false)`), if the validation failed.\n * Note, that `this` in the function points to the `cellProperties` object.\n *\n * If a string is provided, it may be one of the following predefined values:\n * * `autocomplete`,\n * * `date`,\n * * `numeric`,\n * * `time`.\n *\n * Or you can [register](http://docs.handsontable.com/demo-data-validation.html) the validator function under specified name and use\n * its name as an alias in your configuration.\n *\n * See more [in the demo](http://docs.handsontable.com/demo-data-validation.html).\n *\n * @example\n * ```js\n * // as a function\n * columns: [\n * {\n * validator: function(value, callback) { // validation rules }\n * }\n * ]\n * ...\n * // as a regexp\n * columns: [\n * {\n * validator: /^[0-9]$/ // regular expression\n * }\n * ]\n * // as a string\n * columns: [\n * {\n * validator: 'numeric'\n * }\n * ]\n * ```\n * @type {Function|RegExp|String}\n * @default undefined\n * @since 0.9.5\n */\n validator: void 0,\n\n /**\n * @description\n * Disable visual cells selection.\n *\n * Possible values:\n * * `true` - Disables any type of visual selection (current and area selection),\n * * `false` - Enables any type of visual selection. This is default value.\n * * `'current'` - Disables the selection of a currently selected cell, the area selection is still present.\n * * `'area'` - Disables the area selection, the currently selected cell selection is still present.\n * * `'header'` - Disables the headers selection, the currently selected cell selection is still present (available since 0.36.0).\n *\n * @type {Boolean|String|Array}\n * @default false\n * @since 0.13.2\n * @example\n * ```js\n * ...\n * // as boolean\n * disableVisualSelection: true,\n * ...\n *\n * ...\n * // as string ('current', 'area' or 'header')\n * disableVisualSelection: 'current',\n * ...\n *\n * ...\n * // as array\n * disableVisualSelection: ['current', 'area'],\n * ...\n * ```\n */\n disableVisualSelection: false,\n\n /**\n * @description\n * Set whether to display the current sorting order indicator (a triangle icon in the column header, specifying the sorting order).\n *\n * @type {Boolean}\n * @default false\n * @since 0.15.0-beta3\n */\n sortIndicator: void 0,\n\n /**\n * Disable or enable ManualColumnFreeze plugin.\n *\n * @type {Boolean}\n * @default false\n */\n manualColumnFreeze: void 0,\n\n /**\n * @description\n * Defines whether Handsontable should trim the whitespace at the beginning and the end of the cell contents.\n *\n * @type {Boolean}\n * @default true\n */\n trimWhitespace: true,\n\n settings: void 0,\n\n /**\n * @description\n * Defines data source for Autocomplete or Dropdown cell types.\n *\n * @example\n * ```js\n * ...\n * // source as a array\n * columns: [{\n * type: 'autocomplete',\n * source: ['A', 'B', 'C', 'D']\n * }]\n * ...\n * // source as a function\n * columns: [{\n * type: 'autocomplete',\n * source: function(query, callback) {\n * fetch('http://example.com/query?q=' + query, function(response) {\n * callback(response.items);\n * })\n * }\n * }]\n * ...\n * ```\n *\n * @type {Array|Function}\n * @default undefined\n */\n source: void 0,\n\n /**\n * @description\n * Defines the column header name.\n *\n * @example\n * ```js\n * ...\n * columns: [{\n * title: 'First name',\n * type: 'text',\n * },\n * {\n * title: 'Last name',\n * type: 'text',\n * }]\n * ...\n * ```\n *\n * @type {String}\n * @default undefined\n */\n title: void 0,\n\n /**\n * Data template for `'checkbox'` type when checkbox is checked.\n *\n * @example\n * ```js\n * checkedTemplate: 'good'\n *\n * // if a checkbox-typed cell is checked, then getDataAtCell(x,y), where x and y are the coordinates of the cell\n * // will return 'good'.\n * ```\n * @type {Boolean|String}\n * @default true\n */\n checkedTemplate: void 0,\n\n /**\n * Data template for `'checkbox'` type when checkbox is unchecked.\n *\n * @example\n * ```js\n * uncheckedTemplate: 'bad'\n *\n * // if a checkbox-typed cell is not checked, then getDataAtCell(x,y), where x and y are the coordinates of the cell\n * // will return 'bad'.\n * ```\n * @type {Boolean|String}\n * @default false\n */\n uncheckedTemplate: void 0,\n\n /**\n * @description\n * Object which describes if renderer should create checkbox element with label element as a parent. Option desired for\n * [checkbox](http://docs.handsontable.com/demo-checkbox.html)-typed cells.\n *\n * By default the [checkbox](http://docs.handsontable.com/demo-checkbox.html) renderer renders the checkbox without a label.\n *\n * Possible object properties:\n * * `property` - Defines the property name of the data object, which will to be used as a label.\n * (eg. `label: {property: 'name.last'}`). This option works only if data was passed as an array of objects.\n * * `position` - String which describes where to place the label text (before or after checkbox element).\n * Valid values are `'before'` and '`after`' (defaults to `'after'`).\n * * `value` - String or a Function which will be used as label text.\n *\n * @example\n * ```js\n * ...\n * columns: [{\n * type: 'checkbox',\n * label: {position: 'after', value: 'My label: '}\n * }]\n * ...\n * ```\n *\n * @since 0.19.0\n * @type {Object}\n * @default undefined\n */\n label: void 0,\n\n /**\n * Display format. This option is desired for [numeric-typed](http://docs.handsontable.com/demo-numeric.html) cells. Format is described by two properties:\n *\n * - pattern, which is handled by `numbro` for purpose of formatting numbers to desired pattern. List of supported patterns can be found [here](http://numbrojs.com/format.html#numbers).\n * - culture, which is handled by `numbro` for purpose of formatting currencies. Examples showing how it works can be found [here](http://numbrojs.com/format.html#currency). List of supported cultures can be found [here](http://numbrojs.com/languages.html#supported-languages).\n *\n * __Note:__ Please keep in mind that this option is used only to format the displayed output! It has no effect on the input data provided for the cell. The numeric data can be entered to the table only as floats (separated by a dot or a comma) or integers, and are stored in the source dataset as JavaScript numbers.\n *\n * Since 0.26.0 Handsontable uses [numbro](http://numbrojs.com/) as a main library for numbers formatting.\n *\n * @example\n * ```js\n * ...\n * columns: [{\n * type: 'numeric',\n * numericFormat: {\n * pattern: '0,00',\n * culture: 'en-US'\n * }\n * }]\n * ...\n * ```\n *\n * @since 0.35.0\n * @type {Object}\n */\n numericFormat: void 0,\n\n /**\n * Language for Handsontable translation. Possible language codes are: `en-US`, `pl-PL`.\n *\n * @type {String}\n * @default 'en-US'\n */\n language: void 0,\n\n /**\n * @description\n * Data source for [select](http://docs.handsontable.com/demo-select.html)-typed cells.\n *\n * @example\n * ```js\n * ...\n * columns: [{\n * editor: 'select',\n * selectOptions: ['A', 'B', 'C'],\n * }]\n * ...\n * ```\n *\n * @type {Array}\n */\n selectOptions: void 0,\n\n /**\n * Enables or disables the autoColumnSize plugin. Default value is `undefined`, which has the same effect as `true`.\n * Disabling this plugin can increase performance, as no size-related calculations would be done.\n *\n * Column width calculations are divided into sync and async part. Each of this parts has their own advantages and\n * disadvantages. Synchronous calculations are faster but they block the browser UI, while the slower asynchronous operations don't\n * block the browser UI.\n *\n * To configure the sync/async distribution, you can pass an absolute value (number of columns) or a percentage value.\n * `syncLimit` option is available since 0.16.0.\n *\n * You can also use the `useHeaders` option to take the column headers with into calculation.\n *\n * @example\n * ```js\n * ...\n * // as a number (300 columns in sync, rest async)\n * autoColumnSize: {syncLimit: 300},\n * ...\n *\n * ...\n * // as a string (percent)\n * autoColumnSize: {syncLimit: '40%'},\n * ...\n *\n * ...\n * // use headers width while calculation the column width\n * autoColumnSize: {useHeaders: true},\n * ...\n *\n * ```\n *\n * @type {Object|Boolean}\n * @default {syncLimit: 50}\n */\n autoColumnSize: void 0,\n\n /**\n * Enables or disables autoRowSize plugin. Default value is `undefined`, which has the same effect as `false` (disabled).\n * Enabling this plugin can decrease performance, as size-related calculations would be performed.\n *\n * Row height calculations are divided into sync and async stages. Each of these stages has their own advantages and\n * disadvantages. Synchronous calculations are faster but they block the browser UI, while the slower asynchronous operations don't\n * block the browser UI.\n *\n * To configure the sync/async distribution, you can pass an absolute value (number of columns) or a percentage value.\n * `syncLimit` options is available since 0.16.0.\n *\n * @example\n * ```js\n * ...\n * // as number (300 columns in sync, rest async)\n * autoRowSize: {syncLimit: 300},\n * ...\n *\n * ...\n * // as string (percent)\n * autoRowSize: {syncLimit: '40%'},\n * ...\n * ```\n * @type {Object|Boolean}\n * @default {syncLimit: 1000}\n */\n autoRowSize: void 0,\n\n /**\n * Date validation format.\n *\n * Option desired for `'date'` - typed cells.\n *\n * @example\n * ```js\n * ...\n * columns: [{\n * type: 'date',\n * dateFormat: 'MM/DD/YYYY'\n * }]\n * ...\n * ```\n *\n * @type {String}\n * @default 'DD/MM/YYYY'\n */\n dateFormat: void 0,\n\n /**\n * If `true` then dates will be automatically formatted to match the desired format.\n *\n * Option desired for `'date'`-typed typed cells.\n *\n * @example\n * ```js\n * ...\n * columns: [{\n * type: 'date',\n * dateFormat: 'YYYY-MM-DD',\n * correctFormat: true\n * }]\n * ...\n * ```\n *\n * @type {Boolean}\n * @default false\n */\n correctFormat: false,\n\n /**\n * Definition of default value which will fill the empty cells.\n *\n * Option desired for `'date'`-typed cells.\n *\n * @example\n * ```js\n * ...\n * columns: [{\n * type: 'date',\n * defaultData: '2015-02-02'\n * }]\n * ...\n * ```\n *\n * @type {String}\n */\n defaultDate: void 0,\n\n /**\n * If set to `true`, the value entered into the cell must match (case-sensitive) the autocomplete source. Otherwise, cell won't pass the validation.\n * When filtering the autocomplete source list, the editor will be working in case-insensitive mode.\n *\n * Option desired for `autocomplete`-typed cells.\n *\n * @example\n * ```js\n * ...\n * columns: [{\n * type: 'autocomplete',\n * source: ['A', 'B', 'C'],\n * strict: true\n * }]\n * ...\n * ```\n *\n * @type {Boolean}\n */\n strict: void 0,\n\n /**\n * @description\n * If typed `true`, data defined in `source` of the autocomplete or dropdown cell will be treated as HTML.\n *\n * __Warning:__ Enabling this option can cause serious XSS vulnerabilities.\n *\n * Option desired for `'autocomplete'`-typed cells.\n * @example\n * ```js\n * ...\n * columns: [{\n * type: 'autocomplete',\n * allowHtml: true,\n * source: ['<b>foo</b>', '<b>bar</b>']\n * }]\n * ...\n * ```\n * @type {Boolean}\n * @default false\n */\n allowHtml: false,\n\n /**\n * If typed `true` then virtual rendering mechanism for handsontable will be disabled.\n *\n * @type {Boolean}\n */\n renderAllRows: void 0,\n\n /**\n * Prevents table to overlap outside the parent element. If `'horizontal'` option is chosen then table will appear horizontal\n * scrollbar in case where parent's width is narrower then table's width.\n *\n * Possible values:\n * * `false` - Disables functionality (Default option).\n * * `horizontal` - Prevents horizontal overflow table.\n * * `vertical` - Prevents vertical overflow table (Not implemented yet).\n *\n * @since 0.20.3\n * @example\n * ```js\n * ...\n * preventOverflow: 'horizontal'\n * ...\n * ```\n *\n * @type {String|Boolean}\n */\n preventOverflow: false,\n\n /**\n * @description\n * Plugin allowing binding the table rows with their headers.\n * If the plugin is enabled, the table row headers will \"stick\" to the rows, when they are hidden/moved. Basically, if at the initialization\n * row 0 has a header titled \"A\", it will have it no matter what you do with the table.\n *\n * @pro\n * @since 1.0.0-beta1\n * @type {Boolean|String}\n * @example\n *\n * ```js\n * ...\n * var hot = new Handsontable(document.getElementById('example'), {\n * date: getData(),\n * bindRowsWithHeaders: true\n * });\n * ...\n * ```\n *\n */\n bindRowsWithHeaders: void 0,\n\n /**\n * @description\n * The CollapsibleColumns plugin allows collapsing of columns, covered by a header with the `colspan` property defined.\n *\n * Clicking the \"collapse/expand\" button collapses (or expands) all \"child\" headers except the first one.\n *\n * Setting the `collapsibleColumns` property to `true` will display a \"collapse/expand\" button in every header with a defined\n * `colspan` property.\n *\n * To limit this functionality to a smaller group of headers, define the `collapsibleColumns` property as an array of objects, as in\n * the example below.\n *\n * @pro\n * @since 1.0.0-beta1\n * @type {Boolean|Array}\n * @example\n * ```js\n * ...\n * collapsibleColumns: [\n * {row: -4, col: 1, collapsible: true},\n * {row: -3, col: 5, collapsible: true}\n * ]\n * ...\n * // or\n * ...\n * collapsibleColumns: true\n * ...\n * ```\n */\n collapsibleColumns: void 0,\n\n /**\n * @description\n * Allows making pre-defined calculations on the cell values and display the results within Handsontable.\n * See the demo for more information.\n *\n * @pro\n * @since 1.0.0-beta1\n * @type {Object}\n */\n columnSummary: void 0,\n\n /**\n * This plugin allows adding a configurable dropdown menu to the table's column headers.\n * The dropdown menu acts like the Context Menu, but is triggered by clicking the button in the header.\n *\n * @pro\n * @since 1.0.0-beta1\n * @type {Boolean|Object|Array}\n */\n dropdownMenu: void 0,\n\n /**\n * The filters plugin.\n * It allows filtering the table data either by the built-in component or with the API.\n *\n * @pro\n * @since 1.0.0-beta1\n * @type {Boolean}\n */\n filters: void 0,\n\n /**\n * It allows Handsontable to process formula expressions defined in the provided data.\n *\n * @pro\n * @since 1.7.0\n * @type {Boolean}\n */\n formulas: void 0,\n\n /**\n * @description\n * GanttChart plugin enables a possibility to create a Gantt chart using a Handsontable instance.\n * In this case, the whole table becomes read-only.\n *\n * @pro\n * @since 1.0.0-beta1\n * @type {Object}\n */\n ganttChart: void 0,\n\n /**\n * @description\n * Allows adding a tooltip to the table headers.\n *\n * Available options:\n * * the `rows` property defines if tooltips should be added to row headers,\n * * the `columns` property defines if tooltips should be added to column headers,\n * * the `onlyTrimmed` property defines if tooltips should be added only to headers, which content is trimmed by the header itself (the content being wider then the header).\n *\n * @pro\n * @since 1.0.0-beta1\n * @type {Boolean|Object}\n */\n headerTooltips: void 0,\n\n /**\n * Plugin allowing hiding of certain columns.\n *\n * @pro\n * @since 1.0.0-beta1\n * @type {Boolean|Object}\n */\n hiddenColumns: void 0,\n\n /**\n * @description\n * Plugin allowing hiding of certain rows.\n *\n * @pro\n * @since 1.0.0-beta1\n * @type {Boolean|Object}\n */\n hiddenRows: void 0,\n\n /**\n * @description\n * Allows creating a nested header structure, using the HTML's colspan attribute.\n *\n * @pro\n * @since 1.0.0-beta1\n * @type {Array}\n */\n nestedHeaders: void 0,\n\n /**\n * @description\n * Plugin allowing hiding of certain rows.\n *\n * @pro\n * @since 1.0.0-beta1\n * @type {Boolean|Array}\n */\n trimRows: void 0,\n\n /**\n * @description\n * Allows setting a custom width of the row headers. You can provide a number or an array of widths, if many row header levels are defined.\n *\n * @since 0.22.0\n * @type {Number|Array}\n */\n rowHeaderWidth: void 0,\n\n /**\n * @description\n * Allows setting a custom height of the column headers. You can provide a number or an array of heights, if many column header levels are defined.\n *\n * @since 0.22.0\n * @type {Number|Array}\n */\n columnHeaderHeight: void 0,\n\n /**\n * @description\n * Enabling this plugin switches table into one-way data binding where changes are applied into data source (from outside table)\n * will be automatically reflected in the table.\n *\n * For every data change [afterChangesObserved](Hooks.html#event:afterChangesObserved) hook will be fired.\n *\n * @type {Boolean}\n * @default false\n */\n observeChanges: void 0,\n\n /**\n * @description\n * When passed to the `column` property, allows specifying a custom sorting function for the desired column.\n *\n * @since 0.24.0\n * @type {Function}\n * @example\n * ```js\n * columns: [\n * {\n * sortFunction: function(sortOrder) {\n * return function(a, b) {\n * // sorting function body.\n * //\n * // Function parameters:\n * // sortOrder: If true, the order is ascending, if false - descending. undefined = original order\n * // a, b: Two compared elements. These are 2-element arrays, with the first element being the row index, the second - cell value.\n * }\n * }\n * }\n * ]\n * ```\n */\n sortFunction: void 0,\n\n /**\n * If defined as 'true', the Autocomplete's suggestion list would be sorted by relevance (the closer to the left the match is, the higher the suggestion).\n *\n * Option desired for cells of the `'autocomplete'` type.\n *\n * @type {Boolean}\n * @default true\n */\n sortByRelevance: true,\n\n /**\n * If defined as 'true', when the user types into the input area the Autocomplete's suggestion list is updated to only\n * include those choices starting with what has been typed; if defined as 'false' all suggestions remain shown, with\n * those matching what has been typed marked in bold.\n *\n * @type {Boolean}\n * @default true\n */\n filter: true,\n\n /**\n * If defined as 'true', filtering in the Autocomplete Editor will be case-sensitive.\n *\n * @type {Boolean}\n * @default: false\n */\n filteringCaseSensitive: false,\n\n /**\n * @description\n * Disable or enable the drag to scroll functionality.\n *\n * @example\n * ```js\n * ...\n * dragToScroll: false,\n * ...\n * ```\n *\n * @type {Boolean}\n * @default true\n */\n dragToScroll: true,\n};\n\nexport default DefaultSettings;\n\n\n\n// WEBPACK FOOTER //\n// ./src/defaultSettings.js","import {arrayEach} from './../helpers/array';\nimport {getLanguageDictionary} from './dictionariesManager';\nimport {getPhraseFormatters} from './phraseFormatters';\nimport {isUndefined} from '../helpers/mixed';\n\n/**\n * Get phrase for specified dictionary key.\n *\n * @param {String} languageCode Language code for specific language i.e. 'en-US', 'pt-BR', 'de-DE'.\n * @param {String} dictionaryKey Constant which is dictionary key.\n * @param {*} argumentsForFormatters Arguments which will be handled by formatters.\n *\n * @returns {String}\n */\n// eslint-disable-next-line import/prefer-default-export\nexport function getTranslatedPhrase(languageCode, dictionaryKey, argumentsForFormatters) {\n const languageDictionary = getLanguageDictionary(languageCode);\n\n if (languageDictionary === null) {\n return null;\n }\n\n const phrasePropositions = languageDictionary[dictionaryKey];\n\n if (isUndefined(phrasePropositions)) {\n return null;\n }\n\n const formattedPhrase = getFormattedPhrase(phrasePropositions, argumentsForFormatters);\n\n if (Array.isArray(formattedPhrase)) {\n return formattedPhrase[0];\n }\n\n return formattedPhrase;\n}\n\n/**\n * Get formatted phrase from phrases propositions for specified dictionary key.\n *\n * @private\n * @param {Array|string} phrasePropositions List of phrase propositions.\n * @param {*} argumentsForFormatters Arguments which will be handled by formatters.\n *\n * @returns {Array|string}\n */\nfunction getFormattedPhrase(phrasePropositions, argumentsForFormatters) {\n let formattedPhrasePropositions = phrasePropositions;\n\n arrayEach(getPhraseFormatters(), (formatter) => {\n formattedPhrasePropositions = formatter(phrasePropositions, argumentsForFormatters);\n });\n\n return formattedPhrasePropositions;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/i18n/index.js","import {isUndefined, isDefined} from './../helpers/mixed';\nimport {objectEach} from './../helpers/object';\nimport {error} from './../helpers/console';\nimport {toSingleLine} from './../helpers/templateLiteralTag';\nimport {DEFAULT_LANGUAGE_CODE, hasLanguageDictionary} from './dictionariesManager';\n\n/**\n * Perform shallow extend of a target object with only this extension's properties which doesn't exist in the target.\n *\n * @param {Object} target An object that will receive the new properties.\n * @param {Object} extension An object containing additional properties to merge into the target.\n */\n// TODO: Maybe it should be moved to global helpers? It's changed `extend` function.\nexport function extendNotExistingKeys(target, extension) {\n objectEach(extension, (value, key) => {\n if (isUndefined(target[key])) {\n target[key] = value;\n }\n });\n\n return target;\n}\n\n/**\n * Create range of values basing on cell indexes. For example, it will create below ranges for specified function arguments:\n *\n * createCellHeadersRange(2, 7) => `2-7`\n * createCellHeadersRange(7, 2) => `2-7`\n * createCellHeadersRange(0, 4, 'A', 'D') => `A-D`\n * createCellHeadersRange(4, 0, 'D', 'A') => `A-D`\n *\n * @param {number} firstRowIndex Index of \"first\" cell\n * @param {number} nextRowIndex Index of \"next\" cell\n * @param {*} fromValue Value which will represent \"first\" cell\n * @param {*} toValue Value which will represent \"next\" cell\n * @returns {String} Value representing range i.e. A-Z, 11-15.\n */\nexport function createCellHeadersRange(firstRowIndex, nextRowIndex, fromValue = firstRowIndex, toValue = nextRowIndex) {\n // Will swap `fromValue` with `toValue` if it's necessary.\n if (firstRowIndex > nextRowIndex) {\n [fromValue, toValue] = [toValue, fromValue];\n }\n\n return `${fromValue}-${toValue}`;\n}\n\n/**\n * Normalize language code. It takes handled languageCode proposition and change it to proper languageCode.\n * For example, when it takes `eN-us` as parameter it return `en-US`\n *\n * @param {String} languageCode Language code for specific language i.e. 'en-US', 'pt-BR', 'de-DE'.\n * @returns {String}\n */\nexport function normalizeLanguageCode(languageCode) {\n const languageCodePattern = /^([a-zA-Z]{2})-([a-zA-Z]{2})$/;\n const partsOfLanguageCode = languageCodePattern.exec(languageCode);\n\n if (partsOfLanguageCode) {\n return `${partsOfLanguageCode[1].toLowerCase()}-${partsOfLanguageCode[2].toUpperCase()}`;\n }\n\n return languageCode;\n}\n\n/**\n * Set proper start language code. User may set language code which is not proper.\n *\n * @param {Object} settings Settings object.\n * @param {String} languageCode Language code for specific language i.e. 'en-US', 'pt-BR', 'de-DE'.\n * @returns {String}\n */\nexport function applyLanguageSetting(settings, languageCode) {\n const normalizedLanguageCode = normalizeLanguageCode(languageCode);\n\n if (hasLanguageDictionary(normalizedLanguageCode)) {\n settings.language = normalizedLanguageCode;\n\n } else {\n settings.language = DEFAULT_LANGUAGE_CODE;\n\n warnUserAboutLanguageRegistration(languageCode);\n }\n}\n\n/**\n *\n * Warn user if there is no registered language.\n *\n * @param {String} languageCode Language code for specific language i.e. 'en-US', 'pt-BR', 'de-DE'.\n */\nexport function warnUserAboutLanguageRegistration(languageCode) {\n if (isDefined(languageCode)) {\n error(toSingleLine`Language with code \"${languageCode}\" was not found. You should register particular language \n before using it. Read more about this issue at: https://docs.handsontable.com/i18n/missing-language-code.`);\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/i18n/utils.js","import EventManager from '../eventManager';\nimport {isCtrlMetaKey, isKey} from '../helpers/unicode';\nimport {arrayEach, arrayReduce} from '../helpers/array';\n\nconst eventManager = new EventManager();\nconst pressedKeys = new Set();\nlet refCount = 0;\n\n/**\n * Begins observing keyboard keys states.\n */\nfunction startObserving() {\n if (refCount === 0) {\n eventManager.addEventListener(document, 'keydown', (event) => {\n if (!pressedKeys.has(event.keyCode)) {\n pressedKeys.add(event.keyCode);\n }\n });\n eventManager.addEventListener(document, 'keyup', (event) => {\n if (pressedKeys.has(event.keyCode)) {\n pressedKeys.delete(event.keyCode);\n }\n });\n eventManager.addEventListener(document, 'visibilitychange', () => {\n if (document.hidden) {\n pressedKeys.clear();\n }\n });\n }\n\n refCount += 1;\n}\n\n/**\n * Stops observing keyboard keys states and clear all previously saved states.\n */\nfunction stopObserving() {\n if (refCount > 0) {\n refCount -= 1;\n }\n\n if (refCount === 0) {\n _resetState();\n }\n}\n\n/**\n * Remove all listeners attached to the DOM and clear all previously saved states.\n */\nfunction _resetState() {\n eventManager.clearEvents();\n pressedKeys.clear();\n refCount = 0;\n}\n\n/**\n * Checks if provided keyCode or keyCodes are pressed.\n *\n * @param {String} keyCodes The key codes passed as a string defined in helpers/unicode.js file delimited with '|'.\n * @return {Boolean}\n */\nfunction isPressed(keyCodes) {\n return Array.from(pressedKeys.values()).some((_keyCode) => isKey(_keyCode, keyCodes));\n}\n\n/**\n * Checks if ctrl keys are pressed.\n *\n * @return {Boolean}\n */\nfunction isPressedCtrlKey() {\n return Array.from(pressedKeys.values()).some((_keyCode) => isCtrlMetaKey(_keyCode));\n}\n\n/**\n * Returns reference count. Useful for debugging and testing purposes.\n *\n * @return {Number}\n */\nfunction _getRefCount() {\n return refCount;\n}\n\nexport {\n _getRefCount,\n _resetState,\n isPressed,\n isPressedCtrlKey,\n startObserving,\n stopObserving,\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/utils/keyStateObserver.js","import {createHighlight} from './types';\nimport {arrayEach, arrayFilter} from './../../helpers/array';\n\nexport const ACTIVE_HEADER_TYPE = 'active-header';\nexport const AREA_TYPE = 'area';\nexport const CELL_TYPE = 'cell';\nexport const FILL_TYPE = 'fill';\nexport const HEADER_TYPE = 'header';\n\n/**\n * Highlight class responsible for managing Walkontable Selection classes.\n *\n * With Highlight object you can manipulate four different highlight types:\n * - `cell` can be added only to a single cell at a time and it defines currently selected cell;\n * - `fill` can occur only once and its highlight defines selection of autofill functionality (managed by the plugin with the same name);\n * - `areas` can be added to multiple cells at a time. This type highlights selected cell or multiple cells.\n * The multiple cells have to be defined as an uninterrupted order (regular shape). Otherwise, the new layer of\n * that type should be created to manage not-consecutive selection;\n * - `header` can occur multiple times. This type is designed to highlight only headers. Like `area` type it\n * can appear with multiple highlights (accessed under different level layers).\n *\n * @class Highlight\n * @util\n */\nclass Highlight {\n constructor(options) {\n /**\n * Options consumed by Highlight class and Walkontable Selection classes.\n *\n * @type {Object}\n */\n this.options = options;\n /**\n * The property which describes which layer level of the visual selection will be modified.\n * This option is valid only for `area` and `header` highlight types which occurs multiple times on\n * the table (as a non-consecutive selection).\n *\n * An order of the layers is the same as the order of added new non-consecutive selections.\n *\n * @type {Number}\n * @default 0\n */\n this.layerLevel = 0;\n /**\n * `cell` highlight object which describes attributes for the currently selected cell.\n * It can only occur only once on the table.\n *\n * @type {Selection}\n */\n this.cell = createHighlight(CELL_TYPE, options);\n /**\n * `fill` highlight object which describes attributes for the borders for autofill functionality.\n * It can only occur only once on the table.\n *\n * @type {Selection}\n */\n this.fill = createHighlight(FILL_TYPE, options);\n /**\n * Collection of the `area` highlights. That objects describes attributes for the borders and selection of\n * the multiple selected cells. It can occur multiple times on the table.\n *\n * @type {Map.<number, Selection>}\n */\n this.areas = new Map();\n /**\n * Collection of the `header` highlights. That objects describes attributes for the selection of\n * the multiple selected rows and columns in the table header. It can occur multiple times on the table.\n *\n * @type {Map.<number, Selection>}\n */\n this.headers = new Map();\n /**\n * Collection of the `active-header` highlights. That objects describes attributes for the selection of\n * the multiple selected rows and columns in the table header. The table headers which have selected all items in\n * a row will be marked as `active-header`.\n *\n * @type {Map.<number, Selection>}\n */\n this.activeHeaders = new Map();\n /**\n * The temporary property, holder for borders added through CustomBorders plugin.\n *\n * @type {Selection[]}\n */\n this.borders = [];\n }\n\n /**\n * Check if highlight cell rendering is disabled for specyfied highlight type.\n *\n * @param {String} highlightType Highlight type. Possible values are: `cell`, `area`, `fill` or `header`.\n * @return {Boolean}\n */\n isEnabledFor(highlightType) {\n let disableHighlight = this.options.disableHighlight;\n\n // Legacy compatibility.\n if (highlightType === 'current') {\n highlightType = CELL_TYPE;\n }\n\n if (typeof disableHighlight === 'string') {\n disableHighlight = [disableHighlight];\n }\n\n return disableHighlight === false || Array.isArray(disableHighlight) && !disableHighlight.includes(highlightType);\n }\n\n /**\n * Set a new layer level to make access to the desire `area` and `header` highlights.\n *\n * @param {Number} [level=0] Layer level to use.\n * @returns {Highlight}\n */\n useLayerLevel(level = 0) {\n this.layerLevel = level;\n\n return this;\n }\n\n /**\n * Get Walkontable Selection instance created for controlling highlight of the currently selected/edited cell.\n *\n * @return {Selection}\n */\n getCell() {\n return this.cell;\n }\n\n /**\n * Get Walkontable Selection instance created for controlling highlight of the autofill functionality.\n *\n * @return {Selection}\n */\n getFill() {\n return this.fill;\n }\n\n /**\n * Get or create (if not exist in the cache) Walkontable Selection instance created for controlling highlight\n * of the multiple selected cells.\n *\n * @return {Selection}\n */\n createOrGetArea() {\n const layerLevel = this.layerLevel;\n let area;\n\n if (this.areas.has(layerLevel)) {\n area = this.areas.get(layerLevel);\n } else {\n area = createHighlight(AREA_TYPE, {layerLevel, ...this.options});\n\n this.areas.set(layerLevel, area);\n }\n\n return area;\n }\n\n /**\n * Get all Walkontable Selection instances which describes the state of the visual highlight of the cells.\n *\n * @return {Selection[]}\n */\n getAreas() {\n return [...this.areas.values()];\n }\n\n /**\n * Get or create (if not exist in the cache) Walkontable Selection instance created for controlling highlight\n * of the multiple selected header cells.\n *\n * @return {Selection}\n */\n createOrGetHeader() {\n const layerLevel = this.layerLevel;\n let header;\n\n if (this.headers.has(layerLevel)) {\n header = this.headers.get(layerLevel);\n } else {\n header = createHighlight(HEADER_TYPE, {...this.options});\n\n this.headers.set(layerLevel, header);\n }\n\n return header;\n }\n\n /**\n * Get all Walkontable Selection instances which describes the state of the visual highlight of the headers.\n *\n * @return {Selection[]}\n */\n getHeaders() {\n return [...this.headers.values()];\n }\n\n /**\n * Get or create (if not exist in the cache) Walkontable Selection instance created for controlling highlight\n * of the multiple selected active header cells.\n *\n * @return {Selection}\n */\n createOrGetActiveHeader() {\n const layerLevel = this.layerLevel;\n let header;\n\n if (this.activeHeaders.has(layerLevel)) {\n header = this.activeHeaders.get(layerLevel);\n } else {\n header = createHighlight(ACTIVE_HEADER_TYPE, {...this.options});\n\n this.activeHeaders.set(layerLevel, header);\n }\n\n return header;\n }\n\n /**\n * Get all Walkontable Selection instances which describes the state of the visual highlight of the active headers.\n *\n * @return {Selection[]}\n */\n getActiveHeaders() {\n return [...this.activeHeaders.values()];\n }\n\n /**\n * Perform cleaning visual highlights for the whole table.\n */\n clear() {\n this.cell.clear();\n this.fill.clear();\n\n arrayEach(this.areas.values(), (highlight) => void highlight.clear());\n arrayEach(this.headers.values(), (highlight) => void highlight.clear());\n arrayEach(this.activeHeaders.values(), (highlight) => void highlight.clear());\n }\n\n /**\n * This object can be iterate over using `for of` syntax or using internal `arrayEach` helper.\n */\n [Symbol.iterator]() {\n return [\n this.cell,\n this.fill,\n ...this.areas.values(),\n ...this.headers.values(),\n ...this.activeHeaders.values(),\n ...this.borders,\n ][Symbol.iterator]();\n }\n}\n\nexport default Highlight;\n\n\n\n// WEBPACK FOOTER //\n// ./src/selection/highlight/highlight.js","import {isObject} from './../helpers/object';\nimport {rangeEach} from './../helpers/number';\nimport {stringify} from './../helpers/mixed';\n\n/**\n * @class SamplesGenerator\n * @util\n */\nclass SamplesGenerator {\n /**\n * Number of samples to take of each value length.\n *\n * @type {Number}\n */\n static get SAMPLE_COUNT() {\n return 3;\n }\n\n constructor(dataFactory) {\n /**\n * Samples prepared for calculations.\n *\n * @type {Map}\n * @default {null}\n */\n this.samples = null;\n /**\n * Function which give the data to collect samples.\n *\n * @type {Function}\n */\n this.dataFactory = dataFactory;\n /**\n * Custom number of samples to take of each value length.\n *\n * @type {Number}\n * @default {null}\n */\n this.customSampleCount = null;\n /**\n * `true` if duplicate samples collection should be allowed, `false` otherwise.\n *\n * @type {Boolean}\n * @default {false}\n */\n this.allowDuplicates = false;\n }\n\n /**\n * Get the sample count for this instance.\n *\n * @returns {Number}\n */\n getSampleCount() {\n if (this.customSampleCount) {\n return this.customSampleCount;\n }\n return SamplesGenerator.SAMPLE_COUNT;\n };\n\n /**\n * Set the sample count.\n *\n * @param {Number} sampleCount Number of samples to be collected.\n */\n setSampleCount(sampleCount) {\n this.customSampleCount = sampleCount;\n }\n\n /**\n * Set if the generator should accept duplicate values.\n *\n * @param {Boolean} allowDuplicates `true` to allow duplicate values.\n */\n setAllowDuplicates(allowDuplicates) {\n this.allowDuplicates = allowDuplicates;\n }\n\n /**\n * Generate samples for row. You can control which area should be sampled by passing `rowRange` object and `colRange` object.\n *\n * @param {Object|Number} rowRange\n * @param {Object} colRange\n * @returns {Object}\n */\n generateRowSamples(rowRange, colRange) {\n return this.generateSamples('row', colRange, rowRange);\n }\n\n /**\n * Generate samples for column. You can control which area should be sampled by passing `colRange` object and `rowRange` object.\n *\n * @param {Object} colRange Column index.\n * @param {Object} rowRange Column index.\n * @returns {Object}\n */\n generateColumnSamples(colRange, rowRange) {\n return this.generateSamples('col', rowRange, colRange);\n }\n\n /**\n * Generate collection of samples.\n *\n * @param {String} type Type to generate. Can be `col` or `row`.\n * @param {Object} range\n * @param {Object|Number} specifierRange\n * @returns {Map}\n */\n generateSamples(type, range, specifierRange) {\n const samples = new Map();\n\n if (typeof specifierRange === 'number') {\n specifierRange = {from: specifierRange, to: specifierRange};\n }\n rangeEach(specifierRange.from, specifierRange.to, (index) => {\n const sample = this.generateSample(type, range, index);\n\n samples.set(index, sample);\n });\n\n return samples;\n }\n\n /**\n * Generate sample for specified type (`row` or `col`).\n *\n * @param {String} type Samples type `row` or `col`.\n * @param {Object} range\n * @param {Number} specifierValue\n * @returns {Map}\n */\n generateSample(type, range, specifierValue) {\n const samples = new Map();\n let sampledValues = [];\n let length;\n\n rangeEach(range.from, range.to, (index) => {\n let value;\n\n if (type === 'row') {\n value = this.dataFactory(specifierValue, index);\n\n } else if (type === 'col') {\n value = this.dataFactory(index, specifierValue);\n\n } else {\n throw new Error('Unsupported sample type');\n }\n\n if (isObject(value)) {\n length = Object.keys(value).length;\n\n } else if (Array.isArray(value)) {\n length = value.length;\n\n } else {\n length = stringify(value).length;\n }\n\n if (!samples.has(length)) {\n samples.set(length, {\n needed: this.getSampleCount(),\n strings: [],\n });\n }\n let sample = samples.get(length);\n\n if (sample.needed) {\n let duplicate = sampledValues.indexOf(value) > -1;\n\n if (!duplicate || this.allowDuplicates) {\n let computedKey = type === 'row' ? 'col' : 'row';\n\n sample.strings.push({value, [computedKey]: index});\n sampledValues.push(value);\n sample.needed--;\n }\n }\n });\n\n return samples;\n }\n}\n\nexport default SamplesGenerator;\n\n\n\n// WEBPACK FOOTER //\n// ./src/utils/samplesGenerator.js","import {arrayReduce, arrayMap, arrayMax} from './../helpers/array';\nimport {defineGetter} from './../helpers/object';\nimport {rangeEach} from './../helpers/number';\n\nconst MIXIN_NAME = 'arrayMapper';\n\n/**\n * @type {Object}\n */\nconst arrayMapper = {\n _arrayMap: [],\n\n /**\n * Get translated index by its physical index.\n *\n * @param {Number} physicalIndex Physical index.\n * @return {Number|null} Returns translated index mapped by passed physical index.\n */\n getValueByIndex(physicalIndex) {\n const length = this._arrayMap.length;\n let translatedIndex = null;\n\n if (physicalIndex < length) {\n translatedIndex = this._arrayMap[physicalIndex];\n }\n\n return translatedIndex;\n },\n\n /**\n * Get physical index by its translated index.\n *\n * @param {*} translatedIndex Value to search.\n * @returns {Number|null} Returns a physical index of the array mapper.\n */\n getIndexByValue(translatedIndex) {\n let physicalIndex;\n\n // eslint-disable-next-line no-cond-assign, no-return-assign\n return (physicalIndex = this._arrayMap.indexOf(translatedIndex)) === -1 ? null : physicalIndex;\n },\n\n /**\n * Insert new items to array mapper starting at passed index. New entries will be a continuation of last value in the array.\n *\n * @param {Number} physicalIndex Array index.\n * @param {Number} [amount=1] Defines how many items will be created to an array.\n * @returns {Array} Returns added items.\n */\n insertItems(physicalIndex, amount = 1) {\n let newIndex = arrayMax(this._arrayMap) + 1;\n let addedItems = [];\n\n rangeEach(amount - 1, (count) => {\n addedItems.push(this._arrayMap.splice(physicalIndex + count, 0, newIndex + count));\n });\n\n return addedItems;\n },\n\n /**\n * Remove items from array mapper.\n *\n * @param {Number} physicalIndex Array index.\n * @param {Number} [amount=1] Defines how many items will be created to an array.\n * @returns {Array} Returns removed items.\n */\n removeItems(physicalIndex, amount = 1) {\n let removedItems = [];\n\n if (Array.isArray(physicalIndex)) {\n let mapCopy = [].concat(this._arrayMap);\n\n // Sort descending\n physicalIndex.sort((a, b) => b - a);\n\n removedItems = arrayReduce(physicalIndex, (acc, item) => {\n this._arrayMap.splice(item, 1);\n\n return acc.concat(mapCopy.slice(item, item + 1));\n }, []);\n\n } else {\n removedItems = this._arrayMap.splice(physicalIndex, amount);\n }\n\n return removedItems;\n },\n\n /**\n * Unshift items (remove and shift chunk of array to the left).\n *\n * @param {Number|Array} physicalIndex Array index or Array of indexes to unshift.\n * @param {Number} [amount=1] Defines how many items will be removed from an array (when index is passed as number).\n */\n unshiftItems(physicalIndex, amount = 1) {\n let removedItems = this.removeItems(physicalIndex, amount);\n\n function countRowShift(logicalRow) {\n // Todo: compare perf between reduce vs sort->each->brake\n return arrayReduce(removedItems, (count, removedLogicalRow) => {\n if (logicalRow > removedLogicalRow) {\n count++;\n }\n\n return count;\n }, 0);\n }\n\n this._arrayMap = arrayMap(this._arrayMap, (logicalRow, physicalRow) => {\n let rowShift = countRowShift(logicalRow);\n\n if (rowShift) {\n logicalRow -= rowShift;\n }\n\n return logicalRow;\n });\n },\n\n /**\n * Shift (right shifting) items starting at passed index.\n *\n * @param {Number} physicalIndex Array index.\n * @param {Number} [amount=1] Defines how many items will be created to an array.\n */\n shiftItems(physicalIndex, amount = 1) {\n this._arrayMap = arrayMap(this._arrayMap, (row) => {\n if (row >= physicalIndex) {\n row += amount;\n }\n return row;\n });\n\n rangeEach(amount - 1, (count) => {\n this._arrayMap.splice(physicalIndex + count, 0, physicalIndex + count);\n });\n },\n\n /**\n * Swap indexes in arrayMapper.\n *\n * @param {Number} physicalIndexFrom index to move.\n * @param {Number} physicalIndexTo index to.\n */\n swapIndexes(physicalIndexFrom, physicalIndexTo) {\n this._arrayMap.splice(physicalIndexTo, 0, ...this._arrayMap.splice(physicalIndexFrom, 1));\n },\n\n /**\n * Clear all stored index<->value information from an array.\n */\n clearMap() {\n this._arrayMap.length = 0;\n }\n};\n\ndefineGetter(arrayMapper, 'MIXIN_NAME', MIXIN_NAME, {\n writable: false,\n enumerable: false,\n});\n\nexport default arrayMapper;\n\n\n\n// WEBPACK FOOTER //\n// ./src/mixins/arrayMapper.js","import {isNumeric} from './../../../helpers/number';\n\nconst STATE_INITIALIZED = 0;\nconst STATE_BUILT = 1;\nconst STATE_APPENDED = 2;\nconst UNIT = 'px';\n\n/**\n * @class\n * @private\n */\nclass BaseUI {\n constructor(hotInstance) {\n /**\n * Instance of Handsontable.\n *\n * @type {Core}\n */\n this.hot = hotInstance;\n /**\n * DOM element representing the ui element.\n *\n * @type {HTMLElement}\n * @private\n */\n this._element = null;\n /**\n * Flag which determines build state of element.\n *\n * @type {Boolean}\n */\n this.state = STATE_INITIALIZED;\n }\n\n /**\n * Add created UI elements to table.\n *\n * @param {HTMLElement} wrapper Element which are parent for our UI element.\n */\n appendTo(wrapper) {\n wrapper.appendChild(this._element);\n\n this.state = STATE_APPENDED;\n }\n\n /**\n * Method for create UI element. Only create, without append to table.\n */\n build() {\n this._element = document.createElement('div');\n this.state = STATE_BUILT;\n }\n\n /**\n * Method for remove UI element.\n */\n destroy() {\n if (this.isAppended()) {\n this._element.parentElement.removeChild(this._element);\n }\n\n this._element = null;\n this.state = STATE_INITIALIZED;\n }\n\n /**\n * Check if UI element are appended.\n *\n * @returns {Boolean}\n */\n isAppended() {\n return this.state === STATE_APPENDED;\n }\n\n /**\n * Check if UI element are built.\n *\n * @returns {Boolean}\n */\n isBuilt() {\n return this.state >= STATE_BUILT;\n }\n\n /**\n * Setter for position.\n *\n * @param {Number} top New top position of the element.\n * @param {Number} left New left position of the element.\n */\n setPosition(top, left) {\n if (isNumeric(top)) {\n this._element.style.top = top + UNIT;\n }\n if (isNumeric(left)) {\n this._element.style.left = left + UNIT;\n }\n }\n\n /**\n * Getter for the element position.\n *\n * @returns {Object} Object contains left and top position of the element.\n */\n getPosition() {\n return {\n top: this._element.style.top ? parseInt(this._element.style.top, 10) : 0,\n left: this._element.style.left ? parseInt(this._element.style.left, 10) : 0\n };\n }\n\n /**\n * Setter for the element size.\n *\n * @param {Number} width New width of the element.\n * @param {Number} height New height of the element.\n */\n setSize(width, height) {\n if (isNumeric(width)) {\n this._element.style.width = width + UNIT;\n }\n if (isNumeric(height)) {\n this._element.style.height = height + UNIT;\n }\n }\n\n /**\n * Getter for the element position.\n *\n * @returns {Object} Object contains height and width of the element.\n */\n getSize() {\n return {\n width: this._element.style.width ? parseInt(this._element.style.width, 10) : 0,\n height: this._element.style.height ? parseInt(this._element.style.height, 10) : 0\n };\n }\n\n /**\n * Setter for the element offset. Offset means marginTop and marginLeft of the element.\n *\n * @param {Number} top New margin top of the element.\n * @param {Number} left New margin left of the element.\n */\n setOffset(top, left) {\n if (isNumeric(top)) {\n this._element.style.marginTop = top + UNIT;\n }\n if (isNumeric(left)) {\n this._element.style.marginLeft = left + UNIT;\n }\n }\n\n /**\n * Getter for the element offset.\n *\n * @returns {Object} Object contains top and left offset of the element.\n */\n getOffset() {\n return {\n top: this._element.style.marginTop ? parseInt(this._element.style.marginTop, 10) : 0,\n left: this._element.style.marginLeft ? parseInt(this._element.style.marginLeft, 10) : 0\n };\n }\n}\n\nexport default BaseUI;\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/manualColumnMove/ui/_base.js","const STATE_INITIALIZED = 0;\nconst STATE_BUILT = 1;\nconst STATE_APPENDED = 2;\nconst UNIT = 'px';\n\n/**\n * @class\n * @private\n */\nclass BaseUI {\n constructor(hotInstance) {\n /**\n * Instance of Handsontable.\n *\n * @type {Core}\n */\n this.hot = hotInstance;\n /**\n * DOM element representing the ui element.\n *\n * @type {HTMLElement}\n * @private\n */\n this._element = null;\n /**\n * Flag which determines build state of element.\n *\n * @type {Boolean}\n */\n this.state = STATE_INITIALIZED;\n }\n\n /**\n * Add created UI elements to table.\n *\n * @param {HTMLElement} wrapper Element which are parent for our UI element.\n */\n appendTo(wrapper) {\n wrapper.appendChild(this._element);\n\n this.state = STATE_APPENDED;\n }\n\n /**\n * Method for create UI element. Only create, without append to table.\n */\n build() {\n this._element = document.createElement('div');\n this.state = STATE_BUILT;\n }\n\n /**\n * Method for remove UI element.\n */\n destroy() {\n if (this.isAppended()) {\n this._element.parentElement.removeChild(this._element);\n }\n\n this._element = null;\n this.state = STATE_INITIALIZED;\n }\n\n /**\n * Check if UI element are appended.\n *\n * @returns {Boolean}\n */\n isAppended() {\n return this.state === STATE_APPENDED;\n }\n\n /**\n * Check if UI element are built.\n *\n * @returns {Boolean}\n */\n isBuilt() {\n return this.state >= STATE_BUILT;\n }\n\n /**\n * Setter for position.\n *\n * @param {Number} top New top position of the element.\n * @param {Number} left New left position of the element.\n */\n setPosition(top, left) {\n if (top !== void 0) {\n this._element.style.top = top + UNIT;\n }\n if (left !== void 0) {\n this._element.style.left = left + UNIT;\n }\n }\n\n /**\n * Getter for the element position.\n *\n * @returns {Object} Object contains left and top position of the element.\n */\n getPosition() {\n return {\n top: this._element.style.top ? parseInt(this._element.style.top, 10) : 0,\n left: this._element.style.left ? parseInt(this._element.style.left, 10) : 0\n };\n }\n\n /**\n * Setter for the element size.\n *\n * @param {Number} width New width of the element.\n * @param {Number} height New height of the element.\n */\n setSize(width, height) {\n if (width) {\n this._element.style.width = width + UNIT;\n }\n if (height) {\n this._element.style.height = height + UNIT;\n }\n }\n\n /**\n * Getter for the element position.\n *\n * @returns {Object} Object contains height and width of the element.\n */\n getSize() {\n return {\n width: this._element.style.width ? parseInt(this._element.style.width, 10) : 0,\n height: this._element.style.height ? parseInt(this._element.style.height, 10) : 0\n };\n }\n\n /**\n * Setter for the element offset. Offset means marginTop and marginLeft of the element.\n *\n * @param {Number} top New margin top of the element.\n * @param {Number} left New margin left of the element.\n */\n setOffset(top, left) {\n if (top) {\n this._element.style.marginTop = top + UNIT;\n }\n if (left) {\n this._element.style.marginLeft = left + UNIT;\n }\n }\n\n /**\n * Getter for the element offset.\n *\n * @returns {Object} Object contains top and left offset of the element.\n */\n getOffset() {\n return {\n top: this._element.style.marginTop ? parseInt(this._element.style.marginTop, 10) : 0,\n left: this._element.style.marginLeft ? parseInt(this._element.style.marginLeft, 10) : 0\n };\n }\n}\n\nexport default BaseUI;\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/manualRowMove/ui/_base.js","/**\n * Apply the `colspan`/`rowspan` properties.\n *\n * @param {HTMLElement} TD The soon-to-be-modified cell.\n * @param {MergedCellCoords} merged cellInfo The merged cell in question.\n * @param {Number} row Row index.\n * @param {Number} col Column index.\n */\n// eslint-disable-next-line import/prefer-default-export\nexport function applySpanProperties(TD, mergedCellInfo, row, col) {\n if (mergedCellInfo) {\n if (mergedCellInfo.row === row && mergedCellInfo.col === col) {\n TD.setAttribute('rowspan', mergedCellInfo.rowspan.toString());\n TD.setAttribute('colspan', mergedCellInfo.colspan.toString());\n\n } else {\n TD.removeAttribute('rowspan');\n TD.removeAttribute('colspan');\n\n TD.style.display = 'none';\n }\n\n } else {\n TD.removeAttribute('rowspan');\n TD.removeAttribute('colspan');\n\n TD.style.display = '';\n }\n}\n\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/mergeCells/utils.js","/*!\n * https://github.com/Starcounter-Jack/JSON-Patch\n * json-patch-duplex.js version: 0.5.7\n * (c) 2013 Joachim Wester\n * MIT license\n */\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar OriginalError = Error;\nvar jsonpatch;\n(function (jsonpatch) {\n var _objectKeys = function (obj) {\n if (_isArray(obj)) {\n var keys = new Array(obj.length);\n for (var k = 0; k < keys.length; k++) {\n keys[k] = \"\" + k;\n }\n return keys;\n }\n if (Object.keys) {\n return Object.keys(obj);\n }\n var keys = [];\n for (var i in obj) {\n if (obj.hasOwnProperty(i)) {\n keys.push(i);\n }\n }\n return keys;\n };\n function _equals(a, b) {\n switch (typeof a) {\n case 'undefined': //backward compatibility, but really I think we should return false\n case 'boolean':\n case 'string':\n case 'number':\n return a === b;\n case 'object':\n if (a === null)\n return b === null;\n if (_isArray(a)) {\n if (!_isArray(b) || a.length !== b.length)\n return false;\n for (var i = 0, l = a.length; i < l; i++)\n if (!_equals(a[i], b[i]))\n return false;\n return true;\n }\n var bKeys = _objectKeys(b);\n var bLength = bKeys.length;\n if (_objectKeys(a).length !== bLength)\n return false;\n for (var i = 0; i < bLength; i++)\n if (!_equals(a[i], b[i]))\n return false;\n return true;\n default:\n return false;\n }\n }\n /* We use a Javascript hash to store each\n function. Each hash entry (property) uses\n the operation identifiers specified in rfc6902.\n In this way, we can map each patch operation\n to its dedicated function in efficient way.\n */\n /* The operations applicable to an object */\n var objOps = {\n add: function (obj, key) {\n obj[key] = this.value;\n return true;\n },\n remove: function (obj, key) {\n delete obj[key];\n return true;\n },\n replace: function (obj, key) {\n obj[key] = this.value;\n return true;\n },\n move: function (obj, key, tree) {\n var temp = { op: \"_get\", path: this.from };\n apply(tree, [temp]);\n apply(tree, [\n { op: \"remove\", path: this.from }\n ]);\n apply(tree, [\n { op: \"add\", path: this.path, value: temp.value }\n ]);\n return true;\n },\n copy: function (obj, key, tree) {\n var temp = { op: \"_get\", path: this.from };\n apply(tree, [temp]);\n apply(tree, [\n { op: \"add\", path: this.path, value: temp.value }\n ]);\n return true;\n },\n test: function (obj, key) {\n return _equals(obj[key], this.value);\n },\n _get: function (obj, key) {\n this.value = obj[key];\n }\n };\n /* The operations applicable to an array. Many are the same as for the object */\n var arrOps = {\n add: function (arr, i) {\n arr.splice(i, 0, this.value);\n return true;\n },\n remove: function (arr, i) {\n arr.splice(i, 1);\n return true;\n },\n replace: function (arr, i) {\n arr[i] = this.value;\n return true;\n },\n move: objOps.move,\n copy: objOps.copy,\n test: objOps.test,\n _get: objOps._get\n };\n /* The operations applicable to object root. Many are the same as for the object */\n var rootOps = {\n add: function (obj) {\n rootOps.remove.call(this, obj);\n for (var key in this.value) {\n if (this.value.hasOwnProperty(key)) {\n obj[key] = this.value[key];\n }\n }\n return true;\n },\n remove: function (obj) {\n for (var key in obj) {\n if (obj.hasOwnProperty(key)) {\n objOps.remove.call(this, obj, key);\n }\n }\n return true;\n },\n replace: function (obj) {\n apply(obj, [\n { op: \"remove\", path: this.path }\n ]);\n apply(obj, [\n { op: \"add\", path: this.path, value: this.value }\n ]);\n return true;\n },\n move: objOps.move,\n copy: objOps.copy,\n test: function (obj) {\n return (JSON.stringify(obj) === JSON.stringify(this.value));\n },\n _get: function (obj) {\n this.value = obj;\n }\n };\n var observeOps = {\n add: function (patches, path) {\n var patch = {\n op: \"add\",\n path: path + escapePathComponent(this.name),\n value: this.object[this.name] };\n patches.push(patch);\n },\n 'delete': function (patches, path) {\n var patch = {\n op: \"remove\",\n path: path + escapePathComponent(this.name)\n };\n patches.push(patch);\n },\n update: function (patches, path) {\n var patch = {\n op: \"replace\",\n path: path + escapePathComponent(this.name),\n value: this.object[this.name]\n };\n patches.push(patch);\n }\n };\n function escapePathComponent(str) {\n if (str.indexOf('/') === -1 && str.indexOf('~') === -1)\n return str;\n return str.replace(/~/g, '~0').replace(/\\//g, '~1');\n }\n function _getPathRecursive(root, obj) {\n var found;\n for (var key in root) {\n if (root.hasOwnProperty(key)) {\n if (root[key] === obj) {\n return escapePathComponent(key) + '/';\n }\n else if (typeof root[key] === 'object') {\n found = _getPathRecursive(root[key], obj);\n if (found != '') {\n return escapePathComponent(key) + '/' + found;\n }\n }\n }\n }\n return '';\n }\n function getPath(root, obj) {\n if (root === obj) {\n return '/';\n }\n var path = _getPathRecursive(root, obj);\n if (path === '') {\n throw new OriginalError(\"Object not found in root\");\n }\n return '/' + path;\n }\n var beforeDict = [];\n var Mirror = (function () {\n function Mirror(obj) {\n this.observers = [];\n this.obj = obj;\n }\n return Mirror;\n })();\n var ObserverInfo = (function () {\n function ObserverInfo(callback, observer) {\n this.callback = callback;\n this.observer = observer;\n }\n return ObserverInfo;\n })();\n function getMirror(obj) {\n for (var i = 0, ilen = beforeDict.length; i < ilen; i++) {\n if (beforeDict[i].obj === obj) {\n return beforeDict[i];\n }\n }\n }\n function getObserverFromMirror(mirror, callback) {\n for (var j = 0, jlen = mirror.observers.length; j < jlen; j++) {\n if (mirror.observers[j].callback === callback) {\n return mirror.observers[j].observer;\n }\n }\n }\n function removeObserverFromMirror(mirror, observer) {\n for (var j = 0, jlen = mirror.observers.length; j < jlen; j++) {\n if (mirror.observers[j].observer === observer) {\n mirror.observers.splice(j, 1);\n return;\n }\n }\n }\n function unobserve(root, observer) {\n observer.unobserve();\n }\n jsonpatch.unobserve = unobserve;\n function deepClone(obj) {\n if (typeof obj === \"object\") {\n return JSON.parse(JSON.stringify(obj)); //Faster than ES5 clone - http://jsperf.com/deep-cloning-of-objects/5\n }\n else {\n return obj; //no need to clone primitives\n }\n }\n function observe(obj, callback) {\n var patches = [];\n var root = obj;\n var observer;\n var mirror = getMirror(obj);\n if (!mirror) {\n mirror = new Mirror(obj);\n beforeDict.push(mirror);\n }\n else {\n observer = getObserverFromMirror(mirror, callback);\n }\n if (observer) {\n return observer;\n }\n observer = {};\n mirror.value = deepClone(obj);\n if (callback) {\n observer.callback = callback;\n observer.next = null;\n var intervals = this.intervals || [100, 1000, 10000, 60000];\n if (intervals.push === void 0) {\n throw new OriginalError(\"jsonpatch.intervals must be an array\");\n }\n var currentInterval = 0;\n var dirtyCheck = function () {\n generate(observer);\n };\n var fastCheck = function () {\n clearTimeout(observer.next);\n observer.next = setTimeout(function () {\n dirtyCheck();\n currentInterval = 0;\n observer.next = setTimeout(slowCheck, intervals[currentInterval++]);\n }, 0);\n };\n var slowCheck = function () {\n dirtyCheck();\n if (currentInterval == intervals.length)\n currentInterval = intervals.length - 1;\n observer.next = setTimeout(slowCheck, intervals[currentInterval++]);\n };\n if (typeof window !== 'undefined') {\n if (window.addEventListener) {\n window.addEventListener('mousedown', fastCheck);\n window.addEventListener('mouseup', fastCheck);\n window.addEventListener('keydown', fastCheck);\n }\n else {\n document.documentElement.attachEvent('onmousedown', fastCheck);\n document.documentElement.attachEvent('onmouseup', fastCheck);\n document.documentElement.attachEvent('onkeydown', fastCheck);\n }\n }\n observer.next = setTimeout(slowCheck, intervals[currentInterval++]);\n }\n observer.patches = patches;\n observer.object = obj;\n observer.unobserve = function () {\n generate(observer);\n clearTimeout(observer.next);\n removeObserverFromMirror(mirror, observer);\n if (typeof window !== 'undefined') {\n if (window.removeEventListener) {\n window.removeEventListener('mousedown', fastCheck);\n window.removeEventListener('mouseup', fastCheck);\n window.removeEventListener('keydown', fastCheck);\n }\n else {\n document.documentElement.detachEvent('onmousedown', fastCheck);\n document.documentElement.detachEvent('onmouseup', fastCheck);\n document.documentElement.detachEvent('onkeydown', fastCheck);\n }\n }\n };\n mirror.observers.push(new ObserverInfo(callback, observer));\n return observer;\n }\n jsonpatch.observe = observe;\n function generate(observer) {\n var mirror;\n for (var i = 0, ilen = beforeDict.length; i < ilen; i++) {\n if (beforeDict[i].obj === observer.object) {\n mirror = beforeDict[i];\n break;\n }\n }\n _generate(mirror.value, observer.object, observer.patches, \"\");\n if (observer.patches.length) {\n apply(mirror.value, observer.patches);\n }\n var temp = observer.patches;\n if (temp.length > 0) {\n observer.patches = [];\n if (observer.callback) {\n observer.callback(temp);\n }\n }\n return temp;\n }\n jsonpatch.generate = generate;\n // Dirty check if obj is different from mirror, generate patches and update mirror\n function _generate(mirror, obj, patches, path) {\n var newKeys = _objectKeys(obj);\n var oldKeys = _objectKeys(mirror);\n var changed = false;\n var deleted = false;\n //if ever \"move\" operation is implemented here, make sure this test runs OK: \"should not generate the same patch twice (move)\"\n for (var t = oldKeys.length - 1; t >= 0; t--) {\n var key = oldKeys[t];\n var oldVal = mirror[key];\n if (obj.hasOwnProperty(key)) {\n var newVal = obj[key];\n if (typeof oldVal == \"object\" && oldVal != null && typeof newVal == \"object\" && newVal != null) {\n _generate(oldVal, newVal, patches, path + \"/\" + escapePathComponent(key));\n }\n else {\n if (oldVal != newVal) {\n changed = true;\n patches.push({ op: \"replace\", path: path + \"/\" + escapePathComponent(key), value: deepClone(newVal) });\n }\n }\n }\n else {\n patches.push({ op: \"remove\", path: path + \"/\" + escapePathComponent(key) });\n deleted = true; // property has been deleted\n }\n }\n if (!deleted && newKeys.length == oldKeys.length) {\n return;\n }\n for (var t = 0; t < newKeys.length; t++) {\n var key = newKeys[t];\n if (!mirror.hasOwnProperty(key)) {\n patches.push({ op: \"add\", path: path + \"/\" + escapePathComponent(key), value: deepClone(obj[key]) });\n }\n }\n }\n var _isArray;\n if (Array.isArray) {\n _isArray = Array.isArray;\n }\n else {\n _isArray = function (obj) {\n return obj.push && typeof obj.length === 'number';\n };\n }\n //3x faster than cached /^\\d+$/.test(str)\n function isInteger(str) {\n var i = 0;\n var len = str.length;\n var charCode;\n while (i < len) {\n charCode = str.charCodeAt(i);\n if (charCode >= 48 && charCode <= 57) {\n i++;\n continue;\n }\n return false;\n }\n return true;\n }\n /// Apply a json-patch operation on an object tree\n function apply(tree, patches, validate) {\n var result = false, p = 0, plen = patches.length, patch, key;\n while (p < plen) {\n patch = patches[p];\n p++;\n // Find the object\n var path = patch.path || \"\";\n var keys = path.split('/');\n var obj = tree;\n var t = 1; //skip empty element - http://jsperf.com/to-shift-or-not-to-shift\n var len = keys.length;\n var existingPathFragment = undefined;\n while (true) {\n key = keys[t];\n if (validate) {\n if (existingPathFragment === undefined) {\n if (obj[key] === undefined) {\n existingPathFragment = keys.slice(0, t).join('/');\n }\n else if (t == len - 1) {\n existingPathFragment = patch.path;\n }\n if (existingPathFragment !== undefined) {\n this.validator(patch, p - 1, tree, existingPathFragment);\n }\n }\n }\n t++;\n if (key === undefined) {\n if (t >= len) {\n result = rootOps[patch.op].call(patch, obj, key, tree); // Apply patch\n break;\n }\n }\n if (_isArray(obj)) {\n if (key === '-') {\n key = obj.length;\n }\n else {\n if (validate && !isInteger(key)) {\n throw new JsonPatchError(\"Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index\", \"OPERATION_PATH_ILLEGAL_ARRAY_INDEX\", p - 1, patch.path, patch);\n }\n key = parseInt(key, 10);\n }\n if (t >= len) {\n if (validate && patch.op === \"add\" && key > obj.length) {\n throw new JsonPatchError(\"The specified index MUST NOT be greater than the number of elements in the array\", \"OPERATION_VALUE_OUT_OF_BOUNDS\", p - 1, patch.path, patch);\n }\n result = arrOps[patch.op].call(patch, obj, key, tree); // Apply patch\n break;\n }\n }\n else {\n if (key && key.indexOf('~') != -1)\n key = key.replace(/~1/g, '/').replace(/~0/g, '~'); // escape chars\n if (t >= len) {\n result = objOps[patch.op].call(patch, obj, key, tree); // Apply patch\n break;\n }\n }\n obj = obj[key];\n }\n }\n return result;\n }\n jsonpatch.apply = apply;\n function compare(tree1, tree2) {\n var patches = [];\n _generate(tree1, tree2, patches, '');\n return patches;\n }\n jsonpatch.compare = compare;\n var JsonPatchError = (function (_super) {\n __extends(JsonPatchError, _super);\n function JsonPatchError(message, name, index, operation, tree) {\n _super.call(this, message);\n this.message = message;\n this.name = name;\n this.index = index;\n this.operation = operation;\n this.tree = tree;\n }\n return JsonPatchError;\n })(OriginalError);\n jsonpatch.JsonPatchError = JsonPatchError;\n jsonpatch.Error = JsonPatchError;\n /**\n * Recursively checks whether an object has any undefined values inside.\n */\n function hasUndefined(obj) {\n if (obj === undefined) {\n return true;\n }\n if (typeof obj == \"array\" || typeof obj == \"object\") {\n for (var i in obj) {\n if (hasUndefined(obj[i])) {\n return true;\n }\n }\n }\n return false;\n }\n /**\n * Validates a single operation. Called from `jsonpatch.validate`. Throws `JsonPatchError` in case of an error.\n * @param {object} operation - operation object (patch)\n * @param {number} index - index of operation in the sequence\n * @param {object} [tree] - object where the operation is supposed to be applied\n * @param {string} [existingPathFragment] - comes along with `tree`\n */\n function validator(operation, index, tree, existingPathFragment) {\n if (typeof operation !== 'object' || operation === null || _isArray(operation)) {\n throw new JsonPatchError('Operation is not an object', 'OPERATION_NOT_AN_OBJECT', index, operation, tree);\n }\n else if (!objOps[operation.op]) {\n throw new JsonPatchError('Operation `op` property is not one of operations defined in RFC-6902', 'OPERATION_OP_INVALID', index, operation, tree);\n }\n else if (typeof operation.path !== 'string') {\n throw new JsonPatchError('Operation `path` property is not a string', 'OPERATION_PATH_INVALID', index, operation, tree);\n }\n else if ((operation.op === 'move' || operation.op === 'copy') && typeof operation.from !== 'string') {\n throw new JsonPatchError('Operation `from` property is not present (applicable in `move` and `copy` operations)', 'OPERATION_FROM_REQUIRED', index, operation, tree);\n }\n else if ((operation.op === 'add' || operation.op === 'replace' || operation.op === 'test') && operation.value === undefined) {\n throw new JsonPatchError('Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)', 'OPERATION_VALUE_REQUIRED', index, operation, tree);\n }\n else if ((operation.op === 'add' || operation.op === 'replace' || operation.op === 'test') && hasUndefined(operation.value)) {\n throw new JsonPatchError('Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)', 'OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED', index, operation, tree);\n }\n else if (tree) {\n if (operation.op == \"add\") {\n var pathLen = operation.path.split(\"/\").length;\n var existingPathLen = existingPathFragment.split(\"/\").length;\n if (pathLen !== existingPathLen + 1 && pathLen !== existingPathLen) {\n throw new JsonPatchError('Cannot perform an `add` operation at the desired path', 'OPERATION_PATH_CANNOT_ADD', index, operation, tree);\n }\n }\n else if (operation.op === 'replace' || operation.op === 'remove' || operation.op === '_get') {\n if (operation.path !== existingPathFragment) {\n throw new JsonPatchError('Cannot perform the operation at a path that does not exist', 'OPERATION_PATH_UNRESOLVABLE', index, operation, tree);\n }\n }\n else if (operation.op === 'move' || operation.op === 'copy') {\n var existingValue = { op: \"_get\", path: operation.from, value: undefined };\n var error = jsonpatch.validate([existingValue], tree);\n if (error && error.name === 'OPERATION_PATH_UNRESOLVABLE') {\n throw new JsonPatchError('Cannot perform the operation from a path that does not exist', 'OPERATION_FROM_UNRESOLVABLE', index, operation, tree);\n }\n }\n }\n }\n jsonpatch.validator = validator;\n /**\n * Validates a sequence of operations. If `tree` parameter is provided, the sequence is additionally validated against the object tree.\n * If error is encountered, returns a JsonPatchError object\n * @param sequence\n * @param tree\n * @returns {JsonPatchError|undefined}\n */\n function validate(sequence, tree) {\n try {\n if (!_isArray(sequence)) {\n throw new JsonPatchError('Patch sequence must be an array', 'SEQUENCE_NOT_AN_ARRAY');\n }\n if (tree) {\n tree = JSON.parse(JSON.stringify(tree)); //clone tree so that we can safely try applying operations\n apply.call(this, tree, sequence, true);\n }\n else {\n for (var i = 0; i < sequence.length; i++) {\n this.validator(sequence[i], i);\n }\n }\n }\n catch (e) {\n if (e instanceof JsonPatchError) {\n return e;\n }\n else {\n throw e;\n }\n }\n }\n jsonpatch.validate = validate;\n})(jsonpatch || (jsonpatch = {}));\nif (typeof exports !== \"undefined\") {\n exports.apply = jsonpatch.apply;\n exports.observe = jsonpatch.observe;\n exports.unobserve = jsonpatch.unobserve;\n exports.generate = jsonpatch.generate;\n exports.compare = jsonpatch.compare;\n exports.validate = jsonpatch.validate;\n exports.validator = jsonpatch.validator;\n exports.JsonPatchError = jsonpatch.JsonPatchError;\n exports.Error = jsonpatch.Error;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./lib/jsonpatch/json-patch-duplex.js","import 'babel-polyfill';\n\nimport './css/bootstrap.css';\nimport './css/handsontable.css';\nimport './css/mobile.handsontable.css';\n\nimport {getRegisteredEditorNames, registerEditor, getEditor} from './editors';\nimport {getRegisteredRendererNames, getRenderer, registerRenderer} from './renderers';\nimport {getRegisteredValidatorNames, getValidator, registerValidator} from './validators';\nimport {getRegisteredCellTypeNames, getCellType, registerCellType} from './cellTypes';\n\nimport Core from './core';\nimport jQueryWrapper from './helpers/wrappers/jquery';\nimport EventManager, {getListenersCounter} from './eventManager';\nimport Hooks from './pluginHooks';\nimport GhostTable from './utils/ghostTable';\nimport * as arrayHelpers from './helpers/array';\nimport * as browserHelpers from './helpers/browser';\nimport * as dataHelpers from './helpers/data';\nimport * as dateHelpers from './helpers/date';\nimport * as featureHelpers from './helpers/feature';\nimport * as functionHelpers from './helpers/function';\nimport * as mixedHelpers from './helpers/mixed';\nimport * as numberHelpers from './helpers/number';\nimport * as objectHelpers from './helpers/object';\nimport * as settingHelpers from './helpers/setting';\nimport * as stringHelpers from './helpers/string';\nimport * as unicodeHelpers from './helpers/unicode';\nimport * as domHelpers from './helpers/dom/element';\nimport * as domEventHelpers from './helpers/dom/event';\nimport * as plugins from './plugins/index';\nimport {registerPlugin} from './plugins';\nimport DefaultSettings from './defaultSettings';\nimport {rootInstanceSymbol} from './utils/rootInstance';\nimport {getTranslatedPhrase} from './i18n';\nimport * as constants from './i18n/constants';\nimport {registerLanguageDictionary, getLanguagesDictionaries, getLanguageDictionary} from './i18n/dictionariesManager';\n\nfunction Handsontable(rootElement, userSettings) {\n const instance = new Core(rootElement, userSettings || {}, rootInstanceSymbol);\n\n instance.init();\n\n return instance;\n}\n\njQueryWrapper(Handsontable);\n\nHandsontable.Core = Core;\nHandsontable.DefaultSettings = DefaultSettings;\nHandsontable.EventManager = EventManager;\nHandsontable._getListenersCounter = getListenersCounter; // For MemoryLeak tests\n\nHandsontable.buildDate = process.env.HOT_BUILD_DATE;\nHandsontable.packageName = process.env.HOT_PACKAGE_NAME;\nHandsontable.version = process.env.HOT_VERSION;\n\nconst baseVersion = process.env.HOT_BASE_VERSION;\n\nif (baseVersion) {\n Handsontable.baseVersion = baseVersion;\n}\n\n// Export Hooks singleton\nHandsontable.hooks = Hooks.getSingleton();\n\n// TODO: Remove this exports after rewrite tests about this module\nHandsontable.__GhostTable = GhostTable;\n//\n\n// Export all helpers to the Handsontable object\nconst HELPERS = [\n arrayHelpers,\n browserHelpers,\n dataHelpers,\n dateHelpers,\n featureHelpers,\n functionHelpers,\n mixedHelpers,\n numberHelpers,\n objectHelpers,\n settingHelpers,\n stringHelpers,\n unicodeHelpers,\n];\nconst DOM = [\n domHelpers,\n domEventHelpers,\n];\n\nHandsontable.helper = {};\nHandsontable.dom = {};\n\n// Fill general helpers.\narrayHelpers.arrayEach(HELPERS, (helper) => {\n arrayHelpers.arrayEach(Object.getOwnPropertyNames(helper), (key) => {\n if (key.charAt(0) !== '_') {\n Handsontable.helper[key] = helper[key];\n }\n });\n});\n\n// Fill DOM helpers.\narrayHelpers.arrayEach(DOM, (helper) => {\n arrayHelpers.arrayEach(Object.getOwnPropertyNames(helper), (key) => {\n if (key.charAt(0) !== '_') {\n Handsontable.dom[key] = helper[key];\n }\n });\n});\n\n// Export cell types.\nHandsontable.cellTypes = {};\n\narrayHelpers.arrayEach(getRegisteredCellTypeNames(), (cellTypeName) => {\n Handsontable.cellTypes[cellTypeName] = getCellType(cellTypeName);\n});\n\nHandsontable.cellTypes.registerCellType = registerCellType;\nHandsontable.cellTypes.getCellType = getCellType;\n\n// Export all registered editors from the Handsontable.\nHandsontable.editors = {};\n\narrayHelpers.arrayEach(getRegisteredEditorNames(), (editorName) => {\n Handsontable.editors[`${stringHelpers.toUpperCaseFirst(editorName)}Editor`] = getEditor(editorName);\n});\n\nHandsontable.editors.registerEditor = registerEditor;\nHandsontable.editors.getEditor = getEditor;\n\n// Export all registered renderers from the Handsontable.\nHandsontable.renderers = {};\n\narrayHelpers.arrayEach(getRegisteredRendererNames(), (rendererName) => {\n const renderer = getRenderer(rendererName);\n\n if (rendererName === 'base') {\n Handsontable.renderers.cellDecorator = renderer;\n }\n Handsontable.renderers[`${stringHelpers.toUpperCaseFirst(rendererName)}Renderer`] = renderer;\n});\n\nHandsontable.renderers.registerRenderer = registerRenderer;\nHandsontable.renderers.getRenderer = getRenderer;\n\n// Export all registered validators from the Handsontable.\nHandsontable.validators = {};\n\narrayHelpers.arrayEach(getRegisteredValidatorNames(), (validatorName) => {\n Handsontable.validators[`${stringHelpers.toUpperCaseFirst(validatorName)}Validator`] = getValidator(validatorName);\n});\n\nHandsontable.validators.registerValidator = registerValidator;\nHandsontable.validators.getValidator = getValidator;\n\n// Export all registered plugins from the Handsontable.\nHandsontable.plugins = {};\n\narrayHelpers.arrayEach(Object.getOwnPropertyNames(plugins), (pluginName) => {\n const plugin = plugins[pluginName];\n\n if (pluginName === 'Base') {\n Handsontable.plugins[`${pluginName}Plugin`] = plugin;\n } else {\n Handsontable.plugins[pluginName] = plugin;\n }\n});\n\nHandsontable.plugins.registerPlugin = registerPlugin;\n\nHandsontable.languages = {};\nHandsontable.languages.dictionaryKeys = constants;\nHandsontable.languages.getLanguageDictionary = getLanguageDictionary;\nHandsontable.languages.getLanguagesDictionaries = getLanguagesDictionaries;\nHandsontable.languages.registerLanguageDictionary = registerLanguageDictionary;\n\n// Alias to `getTranslatedPhrase` function, for more information check it API.\nHandsontable.languages.getTranslatedPhrase = (...args) => getTranslatedPhrase(...args);\n\nexport default Handsontable;\n\n\n\n// WEBPACK FOOTER //\n// ./src/index.js","var dP = require('./_object-dp');\nvar anObject = require('./_an-object');\nvar getKeys = require('./_object-keys');\n\nmodule.exports = require('./_descriptors') ? Object.defineProperties : function defineProperties(O, Properties) {\n anObject(O);\n var keys = getKeys(Properties);\n var length = keys.length;\n var i = 0;\n var P;\n while (length > i) dP.f(O, P = keys[i++], Properties[P]);\n return O;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_object-dps.js\n// module id = 207\n// module chunks = 0","'use strict';\nvar create = require('./_object-create');\nvar descriptor = require('./_property-desc');\nvar setToStringTag = require('./_set-to-string-tag');\nvar IteratorPrototype = {};\n\n// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()\nrequire('./_hide')(IteratorPrototype, require('./_wks')('iterator'), function () { return this; });\n\nmodule.exports = function (Constructor, NAME, next) {\n Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });\n setToStringTag(Constructor, NAME + ' Iterator');\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_iter-create.js\n// module id = 208\n// module chunks = 0","var isObject = require('./_is-object');\nvar setPrototypeOf = require('./_set-proto').set;\nmodule.exports = function (that, target, C) {\n var S = target.constructor;\n var P;\n if (S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf) {\n setPrototypeOf(that, P);\n } return that;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_inherit-if-required.js\n// module id = 209\n// module chunks = 0","// 9.4.2.3 ArraySpeciesCreate(originalArray, length)\nvar speciesConstructor = require('./_array-species-constructor');\n\nmodule.exports = function (original, length) {\n return new (speciesConstructor(original))(length);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_array-species-create.js\n// module id = 210\n// module chunks = 0","var isObject = require('./_is-object');\nvar isArray = require('./_is-array');\nvar SPECIES = require('./_wks')('species');\n\nmodule.exports = function (original) {\n var C;\n if (isArray(original)) {\n C = original.constructor;\n // cross-realm fallback\n if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;\n if (isObject(C)) {\n C = C[SPECIES];\n if (C === null) C = undefined;\n }\n } return C === undefined ? Array : C;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_array-species-constructor.js\n// module id = 211\n// module chunks = 0","// 7.3.20 SpeciesConstructor(O, defaultConstructor)\nvar anObject = require('./_an-object');\nvar aFunction = require('./_a-function');\nvar SPECIES = require('./_wks')('species');\nmodule.exports = function (O, D) {\n var C = anObject(O).constructor;\n var S;\n return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_species-constructor.js\n// module id = 212\n// module chunks = 0","// fast apply, http://jsperf.lnkit.com/fast-apply/5\nmodule.exports = function (fn, args, that) {\n var un = that === undefined;\n switch (args.length) {\n case 0: return un ? fn()\n : fn.call(that);\n case 1: return un ? fn(args[0])\n : fn.call(that, args[0]);\n case 2: return un ? fn(args[0], args[1])\n : fn.call(that, args[0], args[1]);\n case 3: return un ? fn(args[0], args[1], args[2])\n : fn.call(that, args[0], args[1], args[2]);\n case 4: return un ? fn(args[0], args[1], args[2], args[3])\n : fn.call(that, args[0], args[1], args[2], args[3]);\n } return fn.apply(that, args);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_invoke.js\n// module id = 213\n// module chunks = 0","var global = require('./_global');\nvar macrotask = require('./_task').set;\nvar Observer = global.MutationObserver || global.WebKitMutationObserver;\nvar process = global.process;\nvar Promise = global.Promise;\nvar isNode = require('./_cof')(process) == 'process';\n\nmodule.exports = function () {\n var head, last, notify;\n\n var flush = function () {\n var parent, fn;\n if (isNode && (parent = process.domain)) parent.exit();\n while (head) {\n fn = head.fn;\n head = head.next;\n try {\n fn();\n } catch (e) {\n if (head) notify();\n else last = undefined;\n throw e;\n }\n } last = undefined;\n if (parent) parent.enter();\n };\n\n // Node.js\n if (isNode) {\n notify = function () {\n process.nextTick(flush);\n };\n // browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339\n } else if (Observer && !(global.navigator && global.navigator.standalone)) {\n var toggle = true;\n var node = document.createTextNode('');\n new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new\n notify = function () {\n node.data = toggle = !toggle;\n };\n // environments with maybe non-completely correct, but existent Promise\n } else if (Promise && Promise.resolve) {\n var promise = Promise.resolve();\n notify = function () {\n promise.then(flush);\n };\n // for other environments - macrotask based on:\n // - setImmediate\n // - MessageChannel\n // - window.postMessag\n // - onreadystatechange\n // - setTimeout\n } else {\n notify = function () {\n // strange IE + webpack dev server bug - use .call(global)\n macrotask.call(global, flush);\n };\n }\n\n return function (fn) {\n var task = { fn: fn, next: undefined };\n if (last) last.next = task;\n if (!head) {\n head = task;\n notify();\n } last = task;\n };\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_microtask.js\n// module id = 214\n// module chunks = 0","module.exports = function (exec) {\n try {\n return { e: false, v: exec() };\n } catch (e) {\n return { e: true, v: e };\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_perform.js\n// module id = 215\n// module chunks = 0","var anObject = require('./_an-object');\nvar isObject = require('./_is-object');\nvar newPromiseCapability = require('./_new-promise-capability');\n\nmodule.exports = function (C, x) {\n anObject(C);\n if (isObject(x) && x.constructor === C) return x;\n var promiseCapability = newPromiseCapability.f(C);\n var resolve = promiseCapability.resolve;\n resolve(x);\n return promiseCapability.promise;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_promise-resolve.js\n// module id = 216\n// module chunks = 0","var global = require('./_global');\nvar core = require('./_core');\nvar LIBRARY = require('./_library');\nvar wksExt = require('./_wks-ext');\nvar defineProperty = require('./_object-dp').f;\nmodule.exports = function (name) {\n var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});\n if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) });\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_wks-define.js\n// module id = 217\n// module chunks = 0","// all enumerable object keys, includes symbols\nvar getKeys = require('./_object-keys');\nvar gOPS = require('./_object-gops');\nvar pIE = require('./_object-pie');\nmodule.exports = function (it) {\n var result = getKeys(it);\n var getSymbols = gOPS.f;\n if (getSymbols) {\n var symbols = getSymbols(it);\n var isEnum = pIE.f;\n var i = 0;\n var key;\n while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);\n } return result;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_enum-keys.js\n// module id = 218\n// module chunks = 0","// 7.2.9 SameValue(x, y)\nmodule.exports = Object.is || function is(x, y) {\n // eslint-disable-next-line no-self-compare\n return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_same-value.js\n// module id = 219\n// module chunks = 0","var toInteger = require('./_to-integer');\nvar defined = require('./_defined');\n// true -> String#at\n// false -> String#codePointAt\nmodule.exports = function (TO_STRING) {\n return function (that, pos) {\n var s = String(defined(that));\n var i = toInteger(pos);\n var l = s.length;\n var a, b;\n if (i < 0 || i >= l) return TO_STRING ? '' : undefined;\n a = s.charCodeAt(i);\n return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff\n ? TO_STRING ? s.charAt(i) : a\n : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;\n };\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_string-at.js\n// module id = 220\n// module chunks = 0","'use strict';\n// 21.2.5.3 get RegExp.prototype.flags\nvar anObject = require('./_an-object');\nmodule.exports = function () {\n var that = anObject(this);\n var result = '';\n if (that.global) result += 'g';\n if (that.ignoreCase) result += 'i';\n if (that.multiline) result += 'm';\n if (that.unicode) result += 'u';\n if (that.sticky) result += 'y';\n return result;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_flags.js\n// module id = 221\n// module chunks = 0","// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length)\n'use strict';\nvar toObject = require('./_to-object');\nvar toAbsoluteIndex = require('./_to-absolute-index');\nvar toLength = require('./_to-length');\n\nmodule.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) {\n var O = toObject(this);\n var len = toLength(O.length);\n var to = toAbsoluteIndex(target, len);\n var from = toAbsoluteIndex(start, len);\n var end = arguments.length > 2 ? arguments[2] : undefined;\n var count = Math.min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to);\n var inc = 1;\n if (from < to && to < from + count) {\n inc = -1;\n from += count - 1;\n to += count - 1;\n }\n while (count-- > 0) {\n if (from in O) O[to] = O[from];\n else delete O[to];\n to += inc;\n from += inc;\n } return O;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_array-copy-within.js\n// module id = 222\n// module chunks = 0","// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)\n'use strict';\nvar toObject = require('./_to-object');\nvar toAbsoluteIndex = require('./_to-absolute-index');\nvar toLength = require('./_to-length');\nmodule.exports = function fill(value /* , start = 0, end = @length */) {\n var O = toObject(this);\n var length = toLength(O.length);\n var aLen = arguments.length;\n var index = toAbsoluteIndex(aLen > 1 ? arguments[1] : undefined, length);\n var end = aLen > 2 ? arguments[2] : undefined;\n var endPos = end === undefined ? length : toAbsoluteIndex(end, length);\n while (endPos > index) O[index++] = value;\n return O;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_array-fill.js\n// module id = 223\n// module chunks = 0","// all object keys, includes non-enumerable and symbols\nvar gOPN = require('./_object-gopn');\nvar gOPS = require('./_object-gops');\nvar anObject = require('./_an-object');\nvar Reflect = require('./_global').Reflect;\nmodule.exports = Reflect && Reflect.ownKeys || function ownKeys(it) {\n var keys = gOPN.f(anObject(it));\n var getSymbols = gOPS.f;\n return getSymbols ? keys.concat(getSymbols(it)) : keys;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/core-js/modules/_own-keys.js\n// module id = 224\n// module chunks = 0","// removed by extract-text-webpack-plugin\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/css/bootstrap.css\n// module id = 225\n// module chunks = 0","// removed by extract-text-webpack-plugin\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/css/handsontable.css\n// module id = 226\n// module chunks = 0","// removed by extract-text-webpack-plugin\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/css/mobile.handsontable.css\n// module id = 227\n// module chunks = 0","import {addClass} from './../../../../helpers/dom/element';\nimport Overlay from './_base';\n\n/**\n * A overlay that renders ALL available rows & columns positioned on top of the original Walkontable instance and all other overlays.\n * Used for debugging purposes to see if the other overlays (that render only part of the rows & columns) are positioned correctly\n *\n * @class DebugOverlay\n */\nclass DebugOverlay extends Overlay {\n /**\n * @param {Walkontable} wotInstance\n */\n constructor(wotInstance) {\n super(wotInstance);\n\n this.clone = this.makeClone(Overlay.CLONE_DEBUG);\n this.clone.wtTable.holder.style.opacity = 0.4;\n this.clone.wtTable.holder.style.textShadow = '0 0 2px #ff0000';\n\n addClass(this.clone.wtTable.holder.parentNode, 'wtDebugVisible');\n }\n}\n\nOverlay.registerOverlay(Overlay.CLONE_DEBUG, DebugOverlay);\n\nexport default DebugOverlay;\n\n\n\n// WEBPACK FOOTER //\n// ./src/3rdparty/walkontable/src/overlay/debug.js","import {\n addClass,\n getScrollbarWidth,\n getScrollLeft,\n getWindowScrollTop,\n hasClass,\n outerWidth,\n innerHeight,\n removeClass,\n setOverlayPosition,\n resetCssTransform\n} from './../../../../helpers/dom/element';\nimport Overlay from './_base';\n\n/**\n * @class LeftOverlay\n */\nclass LeftOverlay extends Overlay {\n /**\n * @param {Walkontable} wotInstance\n */\n constructor(wotInstance) {\n super(wotInstance);\n this.clone = this.makeClone(Overlay.CLONE_LEFT);\n }\n\n /**\n * Checks if overlay should be fully rendered\n *\n * @returns {Boolean}\n */\n shouldBeRendered() {\n return !!(this.wot.getSetting('fixedColumnsLeft') || this.wot.getSetting('rowHeaders').length);\n }\n\n /**\n * Updates the left overlay position\n */\n resetFixedPosition() {\n if (!this.needFullRender || !this.wot.wtTable.holder.parentNode) {\n // removed from DOM\n return;\n }\n let overlayRoot = this.clone.wtTable.holder.parentNode;\n let headerPosition = 0;\n let preventOverflow = this.wot.getSetting('preventOverflow');\n\n if (this.trimmingContainer === window && (!preventOverflow || preventOverflow !== 'horizontal')) {\n let box = this.wot.wtTable.hider.getBoundingClientRect();\n let left = Math.ceil(box.left);\n let right = Math.ceil(box.right);\n let finalLeft;\n let finalTop;\n\n finalTop = this.wot.wtTable.hider.style.top;\n finalTop = finalTop === '' ? 0 : finalTop;\n\n if (left < 0 && (right - overlayRoot.offsetWidth) > 0) {\n finalLeft = -left;\n } else {\n finalLeft = 0;\n }\n headerPosition = finalLeft;\n finalLeft += 'px';\n\n setOverlayPosition(overlayRoot, finalLeft, finalTop);\n\n } else {\n headerPosition = this.getScrollPosition();\n resetCssTransform(overlayRoot);\n }\n this.adjustHeaderBordersPosition(headerPosition);\n\n this.adjustElementsSize();\n }\n\n /**\n * Sets the main overlay's horizontal scroll position\n *\n * @param {Number} pos\n */\n setScrollPosition(pos) {\n if (this.mainTableScrollableElement === window) {\n window.scrollTo(pos, getWindowScrollTop());\n\n } else {\n this.mainTableScrollableElement.scrollLeft = pos;\n }\n }\n\n /**\n * Triggers onScroll hook callback\n */\n onScroll() {\n this.wot.getSetting('onScrollVertically');\n }\n\n /**\n * Calculates total sum cells width\n *\n * @param {Number} from Column index which calculates started from\n * @param {Number} to Column index where calculation is finished\n * @returns {Number} Width sum\n */\n sumCellSizes(from, to) {\n let sum = 0;\n let defaultColumnWidth = this.wot.wtSettings.defaultColumnWidth;\n\n while (from < to) {\n sum += this.wot.wtTable.getStretchedColumnWidth(from) || defaultColumnWidth;\n from++;\n }\n\n return sum;\n }\n\n /**\n * Adjust overlay root element, childs and master table element sizes (width, height).\n *\n * @param {Boolean} [force=false]\n */\n adjustElementsSize(force = false) {\n this.updateTrimmingContainer();\n\n if (this.needFullRender || force) {\n this.adjustRootElementSize();\n this.adjustRootChildrenSize();\n\n if (!force) {\n this.areElementSizesAdjusted = true;\n }\n }\n }\n\n /**\n * Adjust overlay root element size (width and height).\n */\n adjustRootElementSize() {\n let masterHolder = this.wot.wtTable.holder;\n let scrollbarHeight = masterHolder.clientHeight === masterHolder.offsetHeight ? 0 : getScrollbarWidth();\n let overlayRoot = this.clone.wtTable.holder.parentNode;\n let overlayRootStyle = overlayRoot.style;\n let preventOverflow = this.wot.getSetting('preventOverflow');\n let tableWidth;\n\n if (this.trimmingContainer !== window || preventOverflow === 'vertical') {\n let height = this.wot.wtViewport.getWorkspaceHeight() - scrollbarHeight;\n\n height = Math.min(height, innerHeight(this.wot.wtTable.wtRootElement));\n\n overlayRootStyle.height = `${height}px`;\n\n } else {\n overlayRootStyle.height = '';\n }\n\n this.clone.wtTable.holder.style.height = overlayRootStyle.height;\n\n tableWidth = outerWidth(this.clone.wtTable.TABLE);\n overlayRootStyle.width = `${tableWidth === 0 ? tableWidth : tableWidth + 4}px`;\n }\n\n /**\n * Adjust overlay root childs size\n */\n adjustRootChildrenSize() {\n let scrollbarWidth = getScrollbarWidth();\n\n this.clone.wtTable.hider.style.height = this.hider.style.height;\n this.clone.wtTable.holder.style.height = this.clone.wtTable.holder.parentNode.style.height;\n\n if (scrollbarWidth === 0) {\n scrollbarWidth = 30;\n }\n this.clone.wtTable.holder.style.width = `${parseInt(this.clone.wtTable.holder.parentNode.style.width, 10) + scrollbarWidth}px`;\n }\n\n /**\n * Adjust the overlay dimensions and position\n */\n applyToDOM() {\n let total = this.wot.getSetting('totalColumns');\n\n if (!this.areElementSizesAdjusted) {\n this.adjustElementsSize();\n }\n if (typeof this.wot.wtViewport.columnsRenderCalculator.startPosition === 'number') {\n this.spreader.style.left = `${this.wot.wtViewport.columnsRenderCalculator.startPosition}px`;\n\n } else if (total === 0) {\n this.spreader.style.left = '0';\n\n } else {\n throw new Error('Incorrect value of the columnsRenderCalculator');\n }\n this.spreader.style.right = '';\n\n if (this.needFullRender) {\n this.syncOverlayOffset();\n }\n }\n\n /**\n * Synchronize calculated top position to an element\n */\n syncOverlayOffset() {\n if (typeof this.wot.wtViewport.rowsRenderCalculator.startPosition === 'number') {\n this.clone.wtTable.spreader.style.top = `${this.wot.wtViewport.rowsRenderCalculator.startPosition}px`;\n\n } else {\n this.clone.wtTable.spreader.style.top = '';\n }\n }\n\n /**\n * Scrolls horizontally to a column at the left edge of the viewport\n *\n * @param sourceCol {Number} Column index which you want to scroll to\n * @param [beyondRendered=false] {Boolean} if `true`, scrolls according to the bottom edge (top edge is by default)\n */\n scrollTo(sourceCol, beyondRendered) {\n let newX = this.getTableParentOffset();\n let sourceInstance = this.wot.cloneSource ? this.wot.cloneSource : this.wot;\n let mainHolder = sourceInstance.wtTable.holder;\n let scrollbarCompensation = 0;\n\n if (beyondRendered && mainHolder.offsetWidth !== mainHolder.clientWidth) {\n scrollbarCompensation = getScrollbarWidth();\n }\n if (beyondRendered) {\n newX += this.sumCellSizes(0, sourceCol + 1);\n newX -= this.wot.wtViewport.getViewportWidth();\n\n } else {\n newX += this.sumCellSizes(this.wot.getSetting('fixedColumnsLeft'), sourceCol);\n }\n newX += scrollbarCompensation;\n\n this.setScrollPosition(newX);\n }\n\n /**\n * Gets table parent left position\n *\n * @returns {Number}\n */\n getTableParentOffset() {\n let preventOverflow = this.wot.getSetting('preventOverflow');\n let offset = 0;\n\n if (!preventOverflow && this.trimmingContainer === window) {\n offset = this.wot.wtTable.holderOffset.left;\n }\n\n return offset;\n }\n\n /**\n * Gets the main overlay's horizontal scroll position\n *\n * @returns {Number} Main table's vertical scroll position\n */\n getScrollPosition() {\n return getScrollLeft(this.mainTableScrollableElement);\n }\n\n /**\n * Adds css classes to hide the header border's header (cell-selection border hiding issue)\n *\n * @param {Number} position Header X position if trimming container is window or scroll top if not\n */\n adjustHeaderBordersPosition(position) {\n const masterParent = this.wot.wtTable.holder.parentNode;\n const rowHeaders = this.wot.getSetting('rowHeaders');\n const fixedColumnsLeft = this.wot.getSetting('fixedColumnsLeft');\n const totalRows = this.wot.getSetting('totalRows');\n\n if (totalRows) {\n removeClass(masterParent, 'emptyRows');\n } else {\n addClass(masterParent, 'emptyRows');\n }\n\n if (fixedColumnsLeft && !rowHeaders.length) {\n addClass(masterParent, 'innerBorderLeft');\n\n } else if (!fixedColumnsLeft && rowHeaders.length) {\n let previousState = hasClass(masterParent, 'innerBorderLeft');\n\n if (position) {\n addClass(masterParent, 'innerBorderLeft');\n } else {\n removeClass(masterParent, 'innerBorderLeft');\n }\n if (!previousState && position || previousState && !position) {\n this.wot.wtOverlays.adjustElementsSize();\n }\n }\n }\n}\n\nOverlay.registerOverlay(Overlay.CLONE_LEFT, LeftOverlay);\n\nexport default LeftOverlay;\n\n\n\n// WEBPACK FOOTER //\n// ./src/3rdparty/walkontable/src/overlay/left.js","import {\n addClass,\n getScrollbarWidth,\n getScrollTop,\n getWindowScrollLeft,\n hasClass,\n outerHeight,\n innerWidth,\n removeClass,\n setOverlayPosition,\n resetCssTransform\n} from './../../../../helpers/dom/element';\nimport {arrayEach} from './../../../../helpers/array';\nimport Overlay from './_base';\n\n/**\n * @class TopOverlay\n */\nclass TopOverlay extends Overlay {\n /**\n * @param {Walkontable} wotInstance\n */\n constructor(wotInstance) {\n super(wotInstance);\n this.clone = this.makeClone(Overlay.CLONE_TOP);\n }\n\n /**\n * Checks if overlay should be fully rendered\n *\n * @returns {Boolean}\n */\n shouldBeRendered() {\n return !!(this.wot.getSetting('fixedRowsTop') || this.wot.getSetting('columnHeaders').length);\n }\n\n /**\n * Updates the top overlay position\n */\n resetFixedPosition() {\n if (!this.needFullRender || !this.wot.wtTable.holder.parentNode) {\n // removed from DOM\n return;\n }\n let overlayRoot = this.clone.wtTable.holder.parentNode;\n let headerPosition = 0;\n let preventOverflow = this.wot.getSetting('preventOverflow');\n\n if (this.trimmingContainer === window && (!preventOverflow || preventOverflow !== 'vertical')) {\n let box = this.wot.wtTable.hider.getBoundingClientRect();\n let top = Math.ceil(box.top);\n let bottom = Math.ceil(box.bottom);\n let finalLeft;\n let finalTop;\n\n finalLeft = this.wot.wtTable.hider.style.left;\n finalLeft = finalLeft === '' ? 0 : finalLeft;\n\n if (top < 0 && (bottom - overlayRoot.offsetHeight) > 0) {\n finalTop = -top;\n } else {\n finalTop = 0;\n }\n headerPosition = finalTop;\n finalTop += 'px';\n\n setOverlayPosition(overlayRoot, finalLeft, finalTop);\n\n } else {\n headerPosition = this.getScrollPosition();\n resetCssTransform(overlayRoot);\n }\n\n this.adjustHeaderBordersPosition(headerPosition);\n\n this.adjustElementsSize();\n }\n\n /**\n * Sets the main overlay's vertical scroll position\n *\n * @param {Number} pos\n */\n setScrollPosition(pos) {\n if (this.mainTableScrollableElement === window) {\n window.scrollTo(getWindowScrollLeft(), pos);\n\n } else {\n this.mainTableScrollableElement.scrollTop = pos;\n }\n }\n\n /**\n * Triggers onScroll hook callback\n */\n onScroll() {\n this.wot.getSetting('onScrollHorizontally');\n }\n\n /**\n * Calculates total sum cells height\n *\n * @param {Number} from Row index which calculates started from\n * @param {Number} to Row index where calculation is finished\n * @returns {Number} Height sum\n */\n sumCellSizes(from, to) {\n let sum = 0;\n let defaultRowHeight = this.wot.wtSettings.settings.defaultRowHeight;\n\n while (from < to) {\n let height = this.wot.wtTable.getRowHeight(from);\n\n sum += height === void 0 ? defaultRowHeight : height;\n from++;\n }\n\n return sum;\n }\n\n /**\n * Adjust overlay root element, childs and master table element sizes (width, height).\n *\n * @param {Boolean} [force=false]\n */\n adjustElementsSize(force = false) {\n this.updateTrimmingContainer();\n\n if (this.needFullRender || force) {\n this.adjustRootElementSize();\n this.adjustRootChildrenSize();\n\n if (!force) {\n this.areElementSizesAdjusted = true;\n }\n }\n }\n\n /**\n * Adjust overlay root element size (width and height).\n */\n adjustRootElementSize() {\n let masterHolder = this.wot.wtTable.holder;\n let scrollbarWidth = masterHolder.clientWidth === masterHolder.offsetWidth ? 0 : getScrollbarWidth();\n let overlayRoot = this.clone.wtTable.holder.parentNode;\n let overlayRootStyle = overlayRoot.style;\n let preventOverflow = this.wot.getSetting('preventOverflow');\n let tableHeight;\n\n if (this.trimmingContainer !== window || preventOverflow === 'horizontal') {\n let width = this.wot.wtViewport.getWorkspaceWidth() - scrollbarWidth;\n\n width = Math.min(width, innerWidth(this.wot.wtTable.wtRootElement));\n\n overlayRootStyle.width = `${width}px`;\n\n } else {\n overlayRootStyle.width = '';\n }\n\n this.clone.wtTable.holder.style.width = overlayRootStyle.width;\n\n tableHeight = outerHeight(this.clone.wtTable.TABLE);\n overlayRootStyle.height = `${tableHeight === 0 ? tableHeight : tableHeight + 4}px`;\n }\n\n /**\n * Adjust overlay root childs size\n */\n adjustRootChildrenSize() {\n let scrollbarWidth = getScrollbarWidth();\n\n this.clone.wtTable.hider.style.width = this.hider.style.width;\n this.clone.wtTable.holder.style.width = this.clone.wtTable.holder.parentNode.style.width;\n\n if (scrollbarWidth === 0) {\n scrollbarWidth = 30;\n }\n this.clone.wtTable.holder.style.height = `${parseInt(this.clone.wtTable.holder.parentNode.style.height, 10) + scrollbarWidth}px`;\n }\n\n /**\n * Adjust the overlay dimensions and position\n */\n applyToDOM() {\n let total = this.wot.getSetting('totalRows');\n\n if (!this.areElementSizesAdjusted) {\n this.adjustElementsSize();\n }\n if (typeof this.wot.wtViewport.rowsRenderCalculator.startPosition === 'number') {\n this.spreader.style.top = `${this.wot.wtViewport.rowsRenderCalculator.startPosition}px`;\n\n } else if (total === 0) {\n // can happen if there are 0 rows\n this.spreader.style.top = '0';\n\n } else {\n throw new Error('Incorrect value of the rowsRenderCalculator');\n }\n this.spreader.style.bottom = '';\n\n if (this.needFullRender) {\n this.syncOverlayOffset();\n }\n }\n\n /**\n * Synchronize calculated left position to an element\n */\n syncOverlayOffset() {\n if (typeof this.wot.wtViewport.columnsRenderCalculator.startPosition === 'number') {\n this.clone.wtTable.spreader.style.left = `${this.wot.wtViewport.columnsRenderCalculator.startPosition}px`;\n\n } else {\n this.clone.wtTable.spreader.style.left = '';\n }\n }\n\n /**\n * Scrolls vertically to a row\n *\n * @param sourceRow {Number} Row index which you want to scroll to\n * @param [bottomEdge=false] {Boolean} if `true`, scrolls according to the bottom edge (top edge is by default)\n */\n scrollTo(sourceRow, bottomEdge) {\n let newY = this.getTableParentOffset();\n let sourceInstance = this.wot.cloneSource ? this.wot.cloneSource : this.wot;\n let mainHolder = sourceInstance.wtTable.holder;\n let scrollbarCompensation = 0;\n\n if (bottomEdge && mainHolder.offsetHeight !== mainHolder.clientHeight) {\n scrollbarCompensation = getScrollbarWidth();\n }\n\n if (bottomEdge) {\n let fixedRowsBottom = this.wot.getSetting('fixedRowsBottom');\n let fixedRowsTop = this.wot.getSetting('fixedRowsTop');\n let totalRows = this.wot.getSetting('totalRows');\n\n newY += this.sumCellSizes(0, sourceRow + 1);\n newY -= this.wot.wtViewport.getViewportHeight() - this.sumCellSizes(totalRows - fixedRowsBottom, totalRows);\n // Fix 1 pixel offset when cell is selected\n newY += 1;\n\n } else {\n newY += this.sumCellSizes(this.wot.getSetting('fixedRowsTop'), sourceRow);\n }\n newY += scrollbarCompensation;\n\n this.setScrollPosition(newY);\n }\n\n /**\n * Gets table parent top position\n *\n * @returns {Number}\n */\n getTableParentOffset() {\n if (this.mainTableScrollableElement === window) {\n return this.wot.wtTable.holderOffset.top;\n\n }\n return 0;\n\n }\n\n /**\n * Gets the main overlay's vertical scroll position\n *\n * @returns {Number} Main table's vertical scroll position\n */\n getScrollPosition() {\n return getScrollTop(this.mainTableScrollableElement);\n }\n\n /**\n * Redraw borders of selection\n *\n * @param {WalkontableSelection} selection Selection for redraw\n */\n redrawSelectionBorders(selection) {\n if (selection && selection.cellRange) {\n const border = selection.getBorder(this.wot);\n const corners = selection.getCorners();\n\n border.disappear();\n border.appear(corners);\n }\n }\n\n /**\n * Redrawing borders of all selections\n */\n redrawAllSelectionsBorders() {\n const selections = this.wot.selections;\n\n this.redrawSelectionBorders(selections.getCell());\n\n arrayEach(selections.getAreas(), (area) => {\n this.redrawSelectionBorders(area);\n });\n this.redrawSelectionBorders(selections.getFill());\n\n this.wot.wtTable.wot.wtOverlays.leftOverlay.refresh();\n }\n\n /**\n * Adds css classes to hide the header border's header (cell-selection border hiding issue)\n *\n * @param {Number} position Header Y position if trimming container is window or scroll top if not\n */\n adjustHeaderBordersPosition(position) {\n const masterParent = this.wot.wtTable.holder.parentNode;\n const totalColumns = this.wot.getSetting('totalColumns');\n\n if (totalColumns) {\n removeClass(masterParent, 'emptyColumns');\n } else {\n addClass(masterParent, 'emptyColumns');\n }\n\n if (this.wot.getSetting('fixedRowsTop') === 0 && this.wot.getSetting('columnHeaders').length > 0) {\n let previousState = hasClass(masterParent, 'innerBorderTop');\n\n if (position || this.wot.getSetting('totalRows') === 0) {\n addClass(masterParent, 'innerBorderTop');\n } else {\n removeClass(masterParent, 'innerBorderTop');\n }\n\n if (!previousState && position || previousState && !position) {\n this.wot.wtOverlays.adjustElementsSize();\n\n // cell borders should be positioned once again,\n // because we added / removed 1px border from table header\n this.redrawAllSelectionsBorders();\n }\n }\n\n // nasty workaround for double border in the header, TODO: find a pure-css solution\n if (this.wot.getSetting('rowHeaders').length === 0) {\n let secondHeaderCell = this.clone.wtTable.THEAD.querySelectorAll('th:nth-of-type(2)');\n\n if (secondHeaderCell) {\n for (let i = 0; i < secondHeaderCell.length; i++) {\n secondHeaderCell[i].style['border-left-width'] = 0;\n }\n }\n }\n }\n}\n\nOverlay.registerOverlay(Overlay.CLONE_TOP, TopOverlay);\n\nexport default TopOverlay;\n\n\n\n// WEBPACK FOOTER //\n// ./src/3rdparty/walkontable/src/overlay/top.js","\nimport {\n outerHeight,\n outerWidth,\n setOverlayPosition,\n resetCssTransform\n} from './../../../../helpers/dom/element';\nimport Overlay from './_base';\n\n/**\n * @class TopLeftCornerOverlay\n */\nclass TopLeftCornerOverlay extends Overlay {\n /**\n * @param {Walkontable} wotInstance\n */\n constructor(wotInstance) {\n super(wotInstance);\n this.clone = this.makeClone(Overlay.CLONE_TOP_LEFT_CORNER);\n }\n\n /**\n * Checks if overlay should be fully rendered\n *\n * @returns {Boolean}\n */\n shouldBeRendered() {\n return !!((this.wot.getSetting('fixedRowsTop') || this.wot.getSetting('columnHeaders').length) &&\n (this.wot.getSetting('fixedColumnsLeft') || this.wot.getSetting('rowHeaders').length));\n }\n\n /**\n * Updates the corner overlay position\n */\n resetFixedPosition() {\n this.updateTrimmingContainer();\n\n if (!this.wot.wtTable.holder.parentNode) {\n // removed from DOM\n return;\n }\n let overlayRoot = this.clone.wtTable.holder.parentNode;\n let tableHeight = outerHeight(this.clone.wtTable.TABLE);\n let tableWidth = outerWidth(this.clone.wtTable.TABLE);\n let preventOverflow = this.wot.getSetting('preventOverflow');\n\n if (this.trimmingContainer === window) {\n let box = this.wot.wtTable.hider.getBoundingClientRect();\n let top = Math.ceil(box.top);\n let left = Math.ceil(box.left);\n let bottom = Math.ceil(box.bottom);\n let right = Math.ceil(box.right);\n let finalLeft = '0';\n let finalTop = '0';\n\n if (!preventOverflow || preventOverflow === 'vertical') {\n if (left < 0 && (right - overlayRoot.offsetWidth) > 0) {\n finalLeft = `${-left}px`;\n }\n }\n\n if (!preventOverflow || preventOverflow === 'horizontal') {\n if (top < 0 && (bottom - overlayRoot.offsetHeight) > 0) {\n finalTop = `${-top}px`;\n }\n }\n setOverlayPosition(overlayRoot, finalLeft, finalTop);\n } else {\n resetCssTransform(overlayRoot);\n }\n overlayRoot.style.height = `${tableHeight === 0 ? tableHeight : tableHeight + 4}px`;\n overlayRoot.style.width = `${tableWidth === 0 ? tableWidth : tableWidth + 4}px`;\n }\n}\n\nOverlay.registerOverlay(Overlay.CLONE_TOP_LEFT_CORNER, TopLeftCornerOverlay);\n\nexport default TopLeftCornerOverlay;\n\n\n\n// WEBPACK FOOTER //\n// ./src/3rdparty/walkontable/src/overlay/topLeftCorner.js","import {addClass, hasClass} from './../../../helpers/dom/element';\nimport Border from './border';\nimport CellCoords from './cell/coords';\nimport CellRange from './cell/range';\n\n/**\n * @class Selection\n */\nclass Selection {\n /**\n * @param {Object} settings\n * @param {CellRange} cellRange\n */\n constructor(settings, cellRange) {\n this.settings = settings;\n this.cellRange = cellRange || null;\n this.instanceBorders = {};\n this.classNames = [this.settings.className];\n this.classNameGenerator = this.linearClassNameGenerator(this.settings.className, this.settings.layerLevel);\n }\n\n /**\n * Each Walkontable clone requires it's own border for every selection. This method creates and returns selection\n * borders per instance\n *\n * @param {Walkontable} wotInstance\n * @returns {Border}\n */\n getBorder(wotInstance) {\n if (!this.instanceBorders[wotInstance.guid]) {\n this.instanceBorders[wotInstance.guid] = new Border(wotInstance, this.settings);\n }\n\n return this.instanceBorders[wotInstance.guid];\n }\n\n /**\n * Checks if selection is empty\n *\n * @returns {Boolean}\n */\n isEmpty() {\n return this.cellRange === null;\n }\n\n /**\n * Adds a cell coords to the selection\n *\n * @param {CellCoords} coords\n */\n add(coords) {\n if (this.isEmpty()) {\n this.cellRange = new CellRange(coords);\n\n } else {\n this.cellRange.expand(coords);\n }\n\n return this;\n }\n\n /**\n * If selection range from or to property equals oldCoords, replace it with newCoords. Return boolean\n * information about success\n *\n * @param {CellCoords} oldCoords\n * @param {CellCoords} newCoords\n * @returns {Boolean}\n */\n replace(oldCoords, newCoords) {\n if (!this.isEmpty()) {\n if (this.cellRange.from.isEqual(oldCoords)) {\n this.cellRange.from = newCoords;\n\n return true;\n }\n if (this.cellRange.to.isEqual(oldCoords)) {\n this.cellRange.to = newCoords;\n\n return true;\n }\n }\n\n return false;\n }\n\n /**\n * Clears selection\n *\n * @returns {Selection}\n */\n clear() {\n this.cellRange = null;\n\n return this;\n }\n\n /**\n * Returns the top left (TL) and bottom right (BR) selection coordinates\n *\n * @returns {Array} Returns array of coordinates for example `[1, 1, 5, 5]`\n */\n getCorners() {\n const topLeft = this.cellRange.getTopLeftCorner();\n const bottomRight = this.cellRange.getBottomRightCorner();\n\n return [\n topLeft.row,\n topLeft.col,\n bottomRight.row,\n bottomRight.col,\n ];\n }\n\n /**\n * Adds class name to cell element at given coords\n *\n * @param {Walkontable} wotInstance Walkontable instance\n * @param {Number} sourceRow Cell row coord\n * @param {Number} sourceColumn Cell column coord\n * @param {String} className Class name\n * @param {Boolean} [markIntersections=false] If `true`, linear className generator will be used to add CSS classes\n * in a continuous way.\n * @returns {Selection}\n */\n addClassAtCoords(wotInstance, sourceRow, sourceColumn, className, markIntersections = false) {\n const TD = wotInstance.wtTable.getCell(new CellCoords(sourceRow, sourceColumn));\n\n if (typeof TD === 'object') {\n if (markIntersections) {\n className = this.classNameGenerator(TD);\n\n if (!this.classNames.includes(className)) {\n this.classNames.push(className);\n }\n }\n\n addClass(TD, className);\n }\n\n return this;\n }\n\n /**\n * Generate helper for calculating classNames based on previously added base className.\n * The generated className is always generated as a continuation of the previous className. For example, when\n * the currently checked element has 'area-2' className the generated new className will be 'area-3'. When\n * the element doesn't have any classNames than the base className will be returned ('area');\n *\n * @param {String} baseClassName Base className to be used.\n * @param {Number} layerLevelOwner Layer level which the instance of the Selection belongs to.\n * @return {Function}\n */\n linearClassNameGenerator(baseClassName, layerLevelOwner) {\n // TODO: Make this recursive function Proper Tail Calls (TCO/PTC) friendly.\n return function calcClassName(element, previousIndex = -1) {\n if (layerLevelOwner === 0 || previousIndex === 0) {\n return baseClassName;\n }\n\n let index = previousIndex >= 0 ? previousIndex : layerLevelOwner;\n let className = baseClassName;\n\n index -= 1;\n\n const previousClassName = index === 0 ? baseClassName : `${baseClassName}-${index}`;\n\n if (hasClass(element, previousClassName)) {\n const currentLayer = index + 1;\n\n className = `${baseClassName}-${currentLayer}`;\n\n } else {\n className = calcClassName(element, index);\n }\n\n return className;\n };\n }\n\n /**\n * @param wotInstance\n */\n draw(wotInstance) {\n if (this.isEmpty()) {\n if (this.settings.border) {\n this.getBorder(wotInstance).disappear();\n }\n\n return;\n }\n\n const renderedRows = wotInstance.wtTable.getRenderedRowsCount();\n const renderedColumns = wotInstance.wtTable.getRenderedColumnsCount();\n const corners = this.getCorners();\n const [topRow, topColumn, bottomRow, bottomColumn] = corners;\n\n for (let column = 0; column < renderedColumns; column += 1) {\n const sourceCol = wotInstance.wtTable.columnFilter.renderedToSource(column);\n\n if (sourceCol >= topColumn && sourceCol <= bottomColumn) {\n const TH = wotInstance.wtTable.getColumnHeader(sourceCol);\n\n if (TH) {\n const newClasses = [];\n\n if (this.settings.highlightHeaderClassName) {\n newClasses.push(this.settings.highlightHeaderClassName);\n }\n\n if (this.settings.highlightColumnClassName) {\n newClasses.push(this.settings.highlightColumnClassName);\n }\n\n addClass(TH, newClasses);\n }\n }\n }\n\n for (let row = 0; row < renderedRows; row += 1) {\n const sourceRow = wotInstance.wtTable.rowFilter.renderedToSource(row);\n\n if (sourceRow >= topRow && sourceRow <= bottomRow) {\n const TH = wotInstance.wtTable.getRowHeader(sourceRow);\n\n if (TH) {\n const newClasses = [];\n\n if (this.settings.highlightHeaderClassName) {\n newClasses.push(this.settings.highlightHeaderClassName);\n }\n\n if (this.settings.highlightRowClassName) {\n newClasses.push(this.settings.highlightRowClassName);\n }\n\n addClass(TH, newClasses);\n }\n }\n\n for (let column = 0; column < renderedColumns; column += 1) {\n const sourceCol = wotInstance.wtTable.columnFilter.renderedToSource(column);\n\n if (sourceRow >= topRow && sourceRow <= bottomRow && sourceCol >= topColumn && sourceCol <= bottomColumn) {\n // selected cell\n if (this.settings.className) {\n this.addClassAtCoords(wotInstance, sourceRow, sourceCol, this.settings.className, this.settings.markIntersections);\n }\n\n } else if (sourceRow >= topRow && sourceRow <= bottomRow) {\n // selection is in this row\n if (this.settings.highlightRowClassName) {\n this.addClassAtCoords(wotInstance, sourceRow, sourceCol, this.settings.highlightRowClassName);\n }\n } else if (sourceCol >= topColumn && sourceCol <= bottomColumn) {\n // selection is in this column\n if (this.settings.highlightColumnClassName) {\n this.addClassAtCoords(wotInstance, sourceRow, sourceCol, this.settings.highlightColumnClassName);\n }\n }\n\n let additionalSelectionClass = wotInstance.getSetting('onAfterDrawSelection', sourceRow, sourceCol, corners, this.settings.layerLevel);\n\n if (typeof additionalSelectionClass === 'string') {\n this.addClassAtCoords(wotInstance, sourceRow, sourceCol, additionalSelectionClass);\n }\n\n }\n }\n\n wotInstance.getSetting('onBeforeDrawBorders', corners, this.settings.className);\n\n if (this.settings.border) {\n // warning! border.appear modifies corners!\n this.getBorder(wotInstance).appear(corners);\n }\n }\n}\n\nexport default Selection;\n\n\n\n// WEBPACK FOOTER //\n// ./src/3rdparty/walkontable/src/selection.js","/**\n * autoResize - resizes a DOM element to the width and height of another DOM element\n *\n * Copyright 2014, Marcin Warpechowski\n * Licensed under the MIT license\n */\n\n\nfunction autoResize() {\n var defaults = {\n minHeight: 200,\n maxHeight: 300,\n minWidth: 100,\n maxWidth: 300\n },\n el,\n body = document.body,\n text = document.createTextNode(''),\n span = document.createElement('SPAN'),\n observe = function (element, event, handler) {\n if (element.attachEvent) {\n element.attachEvent('on' + event, handler);\n } else {\n element.addEventListener(event, handler, false);\n }\n },\n unObserve = function (element, event, handler) {\n if (element.removeEventListener) {\n element.removeEventListener(event, handler, false);\n } else {\n element.detachEvent('on' + event, handler);\n }\n },\n resize = function (newChar) {\n var width, scrollHeight;\n\n if (!newChar) {\n newChar = \"\";\n } else if (!/^[a-zA-Z \\.,\\\\\\/\\|0-9]$/.test(newChar)) {\n newChar = \".\";\n }\n\n if (text.textContent !== void 0) {\n text.textContent = el.value + newChar;\n }\n else {\n text.data = el.value + newChar; //IE8\n }\n span.style.fontSize = getComputedStyle(el).fontSize;\n span.style.fontFamily = getComputedStyle(el).fontFamily;\n span.style.whiteSpace = \"pre\";\n\n body.appendChild(span);\n width = span.clientWidth + 2;\n body.removeChild(span);\n\n el.style.height = defaults.minHeight + 'px';\n\n if (defaults.minWidth > width) {\n el.style.width = defaults.minWidth + 'px';\n\n } else if (width > defaults.maxWidth) {\n el.style.width = defaults.maxWidth + 'px';\n\n } else {\n el.style.width = width + 'px';\n }\n scrollHeight = el.scrollHeight ? el.scrollHeight - 1 : 0;\n\n if (defaults.minHeight > scrollHeight) {\n el.style.height = defaults.minHeight + 'px';\n\n } else if (defaults.maxHeight < scrollHeight) {\n el.style.height = defaults.maxHeight + 'px';\n el.style.overflowY = 'visible';\n\n } else {\n el.style.height = scrollHeight + 'px';\n }\n },\n delayedResize = function () {\n window.setTimeout(resize, 0);\n },\n extendDefaults = function (config) {\n\n if (config && config.minHeight) {\n if (config.minHeight == 'inherit') {\n defaults.minHeight = el.clientHeight;\n } else {\n var minHeight = parseInt(config.minHeight);\n if (!isNaN(minHeight)) {\n defaults.minHeight = minHeight;\n }\n }\n }\n\n if (config && config.maxHeight) {\n if (config.maxHeight == 'inherit') {\n defaults.maxHeight = el.clientHeight;\n } else {\n var maxHeight = parseInt(config.maxHeight);\n if (!isNaN(maxHeight)) {\n defaults.maxHeight = maxHeight;\n }\n }\n }\n\n if (config && config.minWidth) {\n if (config.minWidth == 'inherit') {\n defaults.minWidth = el.clientWidth;\n } else {\n var minWidth = parseInt(config.minWidth);\n if (!isNaN(minWidth)) {\n defaults.minWidth = minWidth;\n }\n }\n }\n\n if (config && config.maxWidth) {\n if (config.maxWidth == 'inherit') {\n defaults.maxWidth = el.clientWidth;\n } else {\n var maxWidth = parseInt(config.maxWidth);\n if (!isNaN(maxWidth)) {\n defaults.maxWidth = maxWidth;\n }\n }\n }\n\n if(!span.firstChild) {\n span.className = \"autoResize\";\n span.style.display = 'inline-block';\n span.appendChild(text);\n }\n },\n init = function (el_, config, doObserve) {\n el = el_;\n extendDefaults(config);\n\n if (el.nodeName == 'TEXTAREA') {\n\n el.style.resize = 'none';\n el.style.overflowY = '';\n el.style.height = defaults.minHeight + 'px';\n el.style.minWidth = defaults.minWidth + 'px';\n el.style.maxWidth = defaults.maxWidth + 'px';\n el.style.overflowY = 'hidden';\n }\n\n if(doObserve) {\n observe(el, 'change', resize);\n observe(el, 'cut', delayedResize);\n observe(el, 'paste', delayedResize);\n observe(el, 'drop', delayedResize);\n observe(el, 'keydown', delayedResize);\n observe(el, 'focus', resize);\n }\n\n resize();\n };\n\n function getComputedStyle(element) {\n return element.currentStyle || document.defaultView.getComputedStyle(element);\n }\n\n return {\n init: function (el_, config, doObserve) {\n init(el_, config, doObserve);\n },\n unObserve: function () {\n unObserve(el, 'change', resize);\n unObserve(el, 'cut', delayedResize);\n unObserve(el, 'paste', delayedResize);\n unObserve(el, 'drop', delayedResize);\n unObserve(el, 'keydown', delayedResize);\n unObserve(el, 'focus', resize);\n },\n resize: resize\n };\n}\n\nif (typeof exports !== 'undefined') {\n module.exports = autoResize;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./lib/autoResize/autoResize.js","import BaseEditor from './_baseEditor';\nimport {hasClass} from './../helpers/dom/element';\n\n/**\n * @private\n * @editor CheckboxEditor\n * @class CheckboxEditor\n */\nclass CheckboxEditor extends BaseEditor {\n beginEditing(initialValue, event) {\n // Just some events connected with checkbox editor are delegated here. Some `keydown` events like `enter` and `space` key press\n // are handled inside `checkboxRenderer`. Some events come here from `editorManager`. Below `if` statement was created by author\n // for purpose of handling only `doubleclick` event which may be done on a cell with checkbox.\n\n if (event.type === 'mouseup') {\n let checkbox = this.TD.querySelector('input[type=\"checkbox\"]');\n\n if (!hasClass(checkbox, 'htBadValue')) {\n checkbox.click();\n }\n }\n }\n\n finishEditing() {}\n init() {}\n open() {}\n close() {}\n getValue() {}\n setValue() {}\n focus() {}\n}\n\nexport default CheckboxEditor;\n\n\n\n// WEBPACK FOOTER //\n// ./src/editors/checkboxEditor.js","import moment from 'moment';\nimport Pikaday from 'pikaday';\nimport 'pikaday/css/pikaday.css';\nimport {addClass, outerHeight} from './../helpers/dom/element';\nimport {deepExtend} from './../helpers/object';\nimport EventManager from './../eventManager';\nimport {isMetaKey} from './../helpers/unicode';\nimport {stopPropagation} from './../helpers/dom/event';\nimport TextEditor from './textEditor';\n\n/**\n * @private\n * @editor DateEditor\n * @class DateEditor\n * @dependencies TextEditor moment pikaday\n */\nclass DateEditor extends TextEditor {\n /**\n * @param {Core} hotInstance Handsontable instance\n * @private\n */\n constructor(hotInstance) {\n super(hotInstance);\n\n // TODO: Move this option to general settings\n this.defaultDateFormat = 'DD/MM/YYYY';\n this.isCellEdited = false;\n this.parentDestroyed = false;\n }\n\n init() {\n if (typeof moment !== 'function') {\n throw new Error('You need to include moment.js to your project.');\n }\n\n if (typeof Pikaday !== 'function') {\n throw new Error('You need to include Pikaday to your project.');\n }\n super.init();\n this.instance.addHook('afterDestroy', () => {\n this.parentDestroyed = true;\n this.destroyElements();\n });\n }\n\n /**\n * Create data picker instance\n */\n createElements() {\n super.createElements();\n\n this.datePicker = document.createElement('DIV');\n this.datePickerStyle = this.datePicker.style;\n this.datePickerStyle.position = 'absolute';\n this.datePickerStyle.top = 0;\n this.datePickerStyle.left = 0;\n this.datePickerStyle.zIndex = 9999;\n\n addClass(this.datePicker, 'htDatepickerHolder');\n document.body.appendChild(this.datePicker);\n\n this.$datePicker = new Pikaday(this.getDatePickerConfig());\n const eventManager = new EventManager(this);\n\n /**\n * Prevent recognizing clicking on datepicker as clicking outside of table\n */\n eventManager.addEventListener(this.datePicker, 'mousedown', (event) => stopPropagation(event));\n this.hideDatepicker();\n }\n\n /**\n * Destroy data picker instance\n */\n destroyElements() {\n this.$datePicker.destroy();\n }\n\n /**\n * Prepare editor to appear\n *\n * @param {Number} row Row index\n * @param {Number} col Column index\n * @param {String} prop Property name (passed when datasource is an array of objects)\n * @param {HTMLTableCellElement} td Table cell element\n * @param {*} originalValue Original value\n * @param {Object} cellProperties Object with cell properties ({@see Core#getCellMeta})\n */\n prepare(row, col, prop, td, originalValue, cellProperties) {\n this._opened = false;\n super.prepare(row, col, prop, td, originalValue, cellProperties);\n }\n\n /**\n * Open editor\n *\n * @param {Event} [event=null]\n */\n open(event = null) {\n super.open();\n this.showDatepicker(event);\n }\n\n /**\n * Close editor\n */\n close() {\n this._opened = false;\n this.instance._registerTimeout(setTimeout(() => {\n this.instance._refreshBorders();\n }, 0));\n\n super.close();\n }\n\n /**\n * @param {Boolean} [isCancelled=false]\n * @param {Boolean} [ctrlDown=false]\n */\n finishEditing(isCancelled = false, ctrlDown = false) {\n if (isCancelled) { // pressed ESC, restore original value\n // var value = this.instance.getDataAtCell(this.row, this.col);\n let value = this.originalValue;\n\n if (value !== void 0) {\n this.setValue(value);\n }\n }\n this.hideDatepicker();\n super.finishEditing(isCancelled, ctrlDown);\n }\n\n /**\n * Show data picker\n *\n * @param {Event} event\n */\n showDatepicker(event) {\n this.$datePicker.config(this.getDatePickerConfig());\n\n let offset = this.TD.getBoundingClientRect();\n let dateFormat = this.cellProperties.dateFormat || this.defaultDateFormat;\n let datePickerConfig = this.$datePicker.config();\n let dateStr;\n let isMouseDown = this.instance.view.isMouseDown();\n let isMeta = event ? isMetaKey(event.keyCode) : false;\n\n this.datePickerStyle.top = `${window.pageYOffset + offset.top + outerHeight(this.TD)}px`;\n this.datePickerStyle.left = `${window.pageXOffset + offset.left}px`;\n\n this.$datePicker._onInputFocus = function() {};\n datePickerConfig.format = dateFormat;\n\n if (this.originalValue) {\n dateStr = this.originalValue;\n\n if (moment(dateStr, dateFormat, true).isValid()) {\n this.$datePicker.setMoment(moment(dateStr, dateFormat), true);\n }\n\n // workaround for date/time cells - pikaday resets the cell value to 12:00 AM by default, this will overwrite the value.\n if (this.getValue() !== this.originalValue) {\n this.setValue(this.originalValue);\n }\n\n if (!isMeta && !isMouseDown) {\n this.setValue('');\n }\n\n } else if (this.cellProperties.defaultDate) {\n dateStr = this.cellProperties.defaultDate;\n\n datePickerConfig.defaultDate = dateStr;\n\n if (moment(dateStr, dateFormat, true).isValid()) {\n this.$datePicker.setMoment(moment(dateStr, dateFormat), true);\n }\n\n if (!isMeta && !isMouseDown) {\n this.setValue('');\n }\n } else {\n // if a default date is not defined, set a soft-default-date: display the current day and month in the\n // datepicker, but don't fill the editor input\n this.$datePicker.gotoToday();\n }\n\n this.datePickerStyle.display = 'block';\n this.$datePicker.show();\n }\n\n /**\n * Hide data picker\n */\n hideDatepicker() {\n this.datePickerStyle.display = 'none';\n this.$datePicker.hide();\n }\n\n /**\n * Get date picker options.\n *\n * @returns {Object}\n */\n getDatePickerConfig() {\n let htInput = this.TEXTAREA;\n let options = {};\n\n if (this.cellProperties && this.cellProperties.datePickerConfig) {\n deepExtend(options, this.cellProperties.datePickerConfig);\n }\n const origOnSelect = options.onSelect;\n const origOnClose = options.onClose;\n\n options.field = htInput;\n options.trigger = htInput;\n options.container = this.datePicker;\n options.bound = false;\n options.format = options.format || this.defaultDateFormat;\n options.reposition = options.reposition || false;\n options.onSelect = (dateStr) => {\n if (!isNaN(dateStr.getTime())) {\n dateStr = moment(dateStr).format(this.cellProperties.dateFormat || this.defaultDateFormat);\n }\n this.setValue(dateStr);\n this.hideDatepicker();\n\n if (origOnSelect) {\n origOnSelect();\n }\n };\n options.onClose = () => {\n if (!this.parentDestroyed) {\n this.finishEditing(false);\n }\n if (origOnClose) {\n origOnClose();\n }\n };\n\n return options;\n }\n}\n\nexport default DateEditor;\n\n\n\n// WEBPACK FOOTER //\n// ./src/editors/dateEditor.js","module.exports = __WEBPACK_EXTERNAL_MODULE_236__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"root\":\"Pikaday\",\"commonjs2\":\"pikaday\",\"commonjs\":\"pikaday\",\"amd\":\"pikaday\"}\n// module id = 236\n// module chunks = 0","import AutocompleteEditor from './autocompleteEditor';\nimport Hooks from './../pluginHooks';\n\n/**\n * @private\n * @editor DropdownEditor\n * @class DropdownEditor\n * @dependencies AutocompleteEditor\n */\nclass DropdownEditor extends AutocompleteEditor {\n prepare(row, col, prop, td, originalValue, cellProperties) {\n super.prepare(row, col, prop, td, originalValue, cellProperties);\n this.cellProperties.filter = false;\n this.cellProperties.strict = true;\n }\n}\n\nHooks.getSingleton().add('beforeValidate', function(value, row, col, source) {\n let cellMeta = this.getCellMeta(row, this.propToCol(col));\n\n if (cellMeta.editor === DropdownEditor) {\n if (cellMeta.strict === void 0) {\n cellMeta.filter = false;\n cellMeta.strict = true;\n }\n }\n});\n\nexport default DropdownEditor;\n\n\n\n// WEBPACK FOOTER //\n// ./src/editors/dropdownEditor.js","import TextEditor from './textEditor';\n\n/**\n * @private\n * @editor NumericEditor\n * @class NumericEditor\n */\nclass NumericEditor extends TextEditor {}\n\nexport default NumericEditor;\n\n\n\n// WEBPACK FOOTER //\n// ./src/editors/numericEditor.js","import {empty} from './../helpers/dom/element';\nimport TextEditor from './textEditor';\n\n/**\n * @private\n * @editor PasswordEditor\n * @class PasswordEditor\n * @dependencies TextEditor\n */\nclass PasswordEditor extends TextEditor {\n createElements() {\n super.createElements();\n\n this.TEXTAREA = document.createElement('input');\n this.TEXTAREA.setAttribute('type', 'password');\n this.TEXTAREA.className = 'handsontableInput';\n this.textareaStyle = this.TEXTAREA.style;\n this.textareaStyle.width = 0;\n this.textareaStyle.height = 0;\n\n empty(this.TEXTAREA_PARENT);\n this.TEXTAREA_PARENT.appendChild(this.TEXTAREA);\n }\n}\n\nexport default PasswordEditor;\n\n\n\n// WEBPACK FOOTER //\n// ./src/editors/passwordEditor.js","import {\n addClass,\n empty,\n fastInnerHTML,\n getComputedStyle,\n getCssTransform,\n getScrollableElement,\n offset,\n outerHeight,\n outerWidth,\n resetCssTransform,\n} from './../helpers/dom/element';\nimport {stopImmediatePropagation} from './../helpers/dom/event';\nimport {KEY_CODES} from './../helpers/unicode';\nimport BaseEditor, {EditorState} from './_baseEditor';\n\nconst SelectEditor = BaseEditor.prototype.extend();\n\n/**\n * @private\n * @editor SelectEditor\n * @class SelectEditor\n */\nSelectEditor.prototype.init = function() {\n this.select = document.createElement('SELECT');\n addClass(this.select, 'htSelectEditor');\n this.select.style.display = 'none';\n this.instance.rootElement.appendChild(this.select);\n this.registerHooks();\n};\n\nSelectEditor.prototype.registerHooks = function() {\n this.instance.addHook('afterScrollHorizontally', () => this.refreshDimensions());\n this.instance.addHook('afterScrollVertically', () => this.refreshDimensions());\n this.instance.addHook('afterColumnResize', () => this.refreshDimensions());\n this.instance.addHook('afterRowResize', () => this.refreshDimensions());\n};\n\nSelectEditor.prototype.prepare = function() {\n BaseEditor.prototype.prepare.apply(this, arguments);\n\n var selectOptions = this.cellProperties.selectOptions;\n var options;\n\n if (typeof selectOptions == 'function') {\n options = this.prepareOptions(selectOptions(this.row, this.col, this.prop));\n } else {\n options = this.prepareOptions(selectOptions);\n }\n\n empty(this.select);\n\n for (var option in options) {\n if (Object.prototype.hasOwnProperty.call(options, option)) {\n var optionElement = document.createElement('OPTION');\n optionElement.value = option;\n fastInnerHTML(optionElement, options[option]);\n this.select.appendChild(optionElement);\n }\n }\n};\n\nSelectEditor.prototype.prepareOptions = function(optionsToPrepare) {\n var preparedOptions = {};\n\n if (Array.isArray(optionsToPrepare)) {\n for (var i = 0, len = optionsToPrepare.length; i < len; i++) {\n preparedOptions[optionsToPrepare[i]] = optionsToPrepare[i];\n }\n } else if (typeof optionsToPrepare == 'object') {\n preparedOptions = optionsToPrepare;\n }\n\n return preparedOptions;\n\n};\n\nSelectEditor.prototype.getValue = function() {\n return this.select.value;\n};\n\nSelectEditor.prototype.setValue = function(value) {\n this.select.value = value;\n};\n\nvar onBeforeKeyDown = function(event) {\n var instance = this;\n var editor = instance.getActiveEditor();\n\n switch (event.keyCode) {\n case KEY_CODES.ARROW_UP:\n var previousOptionIndex = editor.select.selectedIndex - 1;\n if (previousOptionIndex >= 0) {\n editor.select[previousOptionIndex].selected = true;\n }\n\n stopImmediatePropagation(event);\n event.preventDefault();\n break;\n\n case KEY_CODES.ARROW_DOWN:\n var nextOptionIndex = editor.select.selectedIndex + 1;\n if (nextOptionIndex <= editor.select.length - 1) {\n editor.select[nextOptionIndex].selected = true;\n }\n\n stopImmediatePropagation(event);\n event.preventDefault();\n break;\n default:\n break;\n }\n};\n\nSelectEditor.prototype.open = function() {\n this._opened = true;\n this.refreshDimensions();\n this.select.style.display = '';\n this.instance.addHook('beforeKeyDown', onBeforeKeyDown);\n};\n\nSelectEditor.prototype.close = function() {\n this._opened = false;\n this.select.style.display = 'none';\n this.instance.removeHook('beforeKeyDown', onBeforeKeyDown);\n};\n\nSelectEditor.prototype.focus = function() {\n this.select.focus();\n};\n\nSelectEditor.prototype.refreshValue = function() {\n let sourceData = this.instance.getSourceDataAtCell(this.row, this.prop);\n this.originalValue = sourceData;\n\n this.setValue(sourceData);\n this.refreshDimensions();\n};\n\nSelectEditor.prototype.refreshDimensions = function() {\n if (this.state !== EditorState.EDITING) {\n return;\n }\n this.TD = this.getEditedCell();\n\n // TD is outside of the viewport.\n if (!this.TD) {\n this.close();\n\n return;\n }\n var\n width = outerWidth(this.TD) + 1,\n height = outerHeight(this.TD) + 1,\n currentOffset = offset(this.TD),\n containerOffset = offset(this.instance.rootElement),\n scrollableContainer = getScrollableElement(this.TD),\n editTop = currentOffset.top - containerOffset.top - 1 - (scrollableContainer.scrollTop || 0),\n editLeft = currentOffset.left - containerOffset.left - 1 - (scrollableContainer.scrollLeft || 0),\n editorSection = this.checkEditorSection(),\n cssTransformOffset;\n\n const settings = this.instance.getSettings();\n let rowHeadersCount = settings.rowHeaders ? 1 : 0;\n let colHeadersCount = settings.colHeaders ? 1 : 0;\n\n switch (editorSection) {\n case 'top':\n cssTransformOffset = getCssTransform(this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.holder.parentNode);\n break;\n case 'left':\n cssTransformOffset = getCssTransform(this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.holder.parentNode);\n break;\n case 'top-left-corner':\n cssTransformOffset = getCssTransform(this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.holder.parentNode);\n break;\n case 'bottom-left-corner':\n cssTransformOffset = getCssTransform(this.instance.view.wt.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.holder.parentNode);\n break;\n case 'bottom':\n cssTransformOffset = getCssTransform(this.instance.view.wt.wtOverlays.bottomOverlay.clone.wtTable.holder.parentNode);\n break;\n default:\n break;\n }\n if (this.instance.getSelectedLast()[0] === 0) {\n editTop += 1;\n }\n\n if (this.instance.getSelectedLast()[1] === 0) {\n editLeft += 1;\n }\n\n var selectStyle = this.select.style;\n\n if (cssTransformOffset && cssTransformOffset != -1) {\n selectStyle[cssTransformOffset[0]] = cssTransformOffset[1];\n } else {\n resetCssTransform(this.select);\n }\n const cellComputedStyle = getComputedStyle(this.TD);\n\n if (parseInt(cellComputedStyle.borderTopWidth, 10) > 0) {\n height -= 1;\n }\n if (parseInt(cellComputedStyle.borderLeftWidth, 10) > 0) {\n width -= 1;\n }\n\n selectStyle.height = `${height}px`;\n selectStyle.minWidth = `${width}px`;\n selectStyle.top = `${editTop}px`;\n selectStyle.left = `${editLeft}px`;\n selectStyle.margin = '0px';\n};\n\nSelectEditor.prototype.getEditedCell = function() {\n var editorSection = this.checkEditorSection(),\n editedCell;\n\n switch (editorSection) {\n case 'top':\n editedCell = this.instance.view.wt.wtOverlays.topOverlay.clone.wtTable.getCell({\n row: this.row,\n col: this.col\n });\n this.select.style.zIndex = 101;\n break;\n case 'corner':\n editedCell = this.instance.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.getCell({\n row: this.row,\n col: this.col\n });\n this.select.style.zIndex = 103;\n break;\n case 'left':\n editedCell = this.instance.view.wt.wtOverlays.leftOverlay.clone.wtTable.getCell({\n row: this.row,\n col: this.col\n });\n this.select.style.zIndex = 102;\n break;\n default:\n editedCell = this.instance.getCell(this.row, this.col);\n this.select.style.zIndex = '';\n break;\n }\n\n return editedCell != -1 && editedCell != -2 ? editedCell : void 0;\n};\n\nexport default SelectEditor;\n\n\n\n// WEBPACK FOOTER //\n// ./src/editors/selectEditor.js","/**\n * Adds appropriate CSS class to table cell, based on cellProperties\n */\nimport {addClass, removeClass} from './../helpers/dom/element';\n\nfunction cellDecorator(instance, TD, row, col, prop, value, cellProperties) {\n const classesToAdd = [];\n const classesToRemove = [];\n\n if (cellProperties.className) {\n if (TD.className) {\n TD.className = `${TD.className} ${cellProperties.className}`;\n } else {\n TD.className = cellProperties.className;\n }\n }\n\n if (cellProperties.readOnly) {\n classesToAdd.push(cellProperties.readOnlyCellClassName);\n }\n\n if (cellProperties.valid === false && cellProperties.invalidCellClassName) {\n classesToAdd.push(cellProperties.invalidCellClassName);\n\n } else {\n classesToRemove.push(cellProperties.invalidCellClassName);\n }\n\n if (cellProperties.wordWrap === false && cellProperties.noWordWrapClassName) {\n classesToAdd.push(cellProperties.noWordWrapClassName);\n }\n\n if (!value && cellProperties.placeholder) {\n classesToAdd.push(cellProperties.placeholderCellClassName);\n }\n\n removeClass(TD, classesToRemove);\n addClass(TD, classesToAdd);\n}\n\nexport default cellDecorator;\n\n\n\n// WEBPACK FOOTER //\n// ./src/renderers/_cellDecorator.js","import {addClass, hasClass, empty} from './../helpers/dom/element';\nimport EventManager from './../eventManager';\nimport {CellCoords} from './../3rdparty/walkontable/src';\nimport {getRenderer} from './index';\n\nvar clonableWRAPPER = document.createElement('DIV');\nclonableWRAPPER.className = 'htAutocompleteWrapper';\n\nvar clonableARROW = document.createElement('DIV');\nclonableARROW.className = 'htAutocompleteArrow';\n// workaround for https://github.com/handsontable/handsontable/issues/1946\n// this is faster than innerHTML. See: https://github.com/handsontable/handsontable/wiki/JavaScript-&-DOM-performance-tips\nclonableARROW.appendChild(document.createTextNode(String.fromCharCode(9660)));\n\nvar wrapTdContentWithWrapper = function(TD, WRAPPER) {\n WRAPPER.innerHTML = TD.innerHTML;\n empty(TD);\n TD.appendChild(WRAPPER);\n};\n\n/**\n * Autocomplete renderer\n *\n * @private\n * @renderer AutocompleteRenderer\n * @param {Object} instance Handsontable instance\n * @param {Element} TD Table cell where to render\n * @param {Number} row\n * @param {Number} col\n * @param {String|Number} prop Row object property name\n * @param value Value to render (remember to escape unsafe HTML before inserting to DOM!)\n * @param {Object} cellProperties Cell properites (shared by cell renderer and editor)\n */\nfunction autocompleteRenderer(instance, TD, row, col, prop, value, cellProperties) {\n var WRAPPER = clonableWRAPPER.cloneNode(true); // this is faster than createElement\n var ARROW = clonableARROW.cloneNode(true); // this is faster than createElement\n\n if (cellProperties.allowHtml) {\n getRenderer('html').apply(this, arguments);\n } else {\n getRenderer('text').apply(this, arguments);\n }\n\n TD.appendChild(ARROW);\n addClass(TD, 'htAutocomplete');\n\n if (!TD.firstChild) { // http://jsperf.com/empty-node-if-needed\n // otherwise empty fields appear borderless in demo/renderers.html (IE)\n TD.appendChild(document.createTextNode(String.fromCharCode(160))); // workaround for https://github.com/handsontable/handsontable/issues/1946\n // this is faster than innerHTML. See: https://github.com/handsontable/handsontable/wiki/JavaScript-&-DOM-performance-tips\n }\n\n if (!instance.acArrowListener) {\n var eventManager = new EventManager(instance);\n\n // not very elegant but easy and fast\n instance.acArrowListener = function(event) {\n if (hasClass(event.target, 'htAutocompleteArrow')) {\n instance.view.wt.getSetting('onCellDblClick', null, new CellCoords(row, col), TD);\n }\n };\n\n eventManager.addEventListener(instance.rootElement, 'mousedown', instance.acArrowListener);\n\n // We need to unbind the listener after the table has been destroyed\n instance.addHookOnce('afterDestroy', () => {\n eventManager.destroy();\n });\n }\n}\n\nexport default autocompleteRenderer;\n\n\n\n// WEBPACK FOOTER //\n// ./src/renderers/autocompleteRenderer.js","import {empty, addClass, hasClass} from './../helpers/dom/element';\nimport {equalsIgnoreCase} from './../helpers/string';\nimport EventManager from './../eventManager';\nimport {isKey} from './../helpers/unicode';\nimport {partial} from './../helpers/function';\nimport {stopImmediatePropagation, isImmediatePropagationStopped} from './../helpers/dom/event';\nimport {getRenderer} from './index';\n\nconst isListeningKeyDownEvent = new WeakMap();\nconst isCheckboxListenerAdded = new WeakMap();\nconst BAD_VALUE_CLASS = 'htBadValue';\n\n/**\n * Checkbox renderer\n *\n * @private\n * @param {Object} instance Handsontable instance\n * @param {Element} TD Table cell where to render\n * @param {Number} row\n * @param {Number} col\n * @param {String|Number} prop Row object property name\n * @param value Value to render (remember to escape unsafe HTML before inserting to DOM!)\n * @param {Object} cellProperties Cell properties (shared by cell renderer and editor)\n */\nfunction checkboxRenderer(instance, TD, row, col, prop, value, cellProperties) {\n getRenderer('base').apply(this, arguments);\n\n const eventManager = registerEvents(instance);\n let input = createInput();\n const labelOptions = cellProperties.label;\n let badValue = false;\n\n if (typeof cellProperties.checkedTemplate === 'undefined') {\n cellProperties.checkedTemplate = true;\n }\n if (typeof cellProperties.uncheckedTemplate === 'undefined') {\n cellProperties.uncheckedTemplate = false;\n }\n\n empty(TD); // TODO identify under what circumstances this line can be removed\n\n if (value === cellProperties.checkedTemplate || equalsIgnoreCase(value, cellProperties.checkedTemplate)) {\n input.checked = true;\n\n } else if (value === cellProperties.uncheckedTemplate || equalsIgnoreCase(value, cellProperties.uncheckedTemplate)) {\n input.checked = false;\n\n } else if (value === null) { // default value\n addClass(input, 'noValue');\n\n } else {\n input.style.display = 'none';\n addClass(input, BAD_VALUE_CLASS);\n badValue = true;\n }\n\n input.setAttribute('data-row', row);\n input.setAttribute('data-col', col);\n\n if (!badValue && labelOptions) {\n let labelText = '';\n\n if (labelOptions.value) {\n labelText = typeof labelOptions.value === 'function' ? labelOptions.value.call(this, row, col, prop, value) : labelOptions.value;\n\n } else if (labelOptions.property) {\n labelText = instance.getDataAtRowProp(row, labelOptions.property);\n }\n const label = createLabel(labelText);\n\n if (labelOptions.position === 'before') {\n label.appendChild(input);\n } else {\n label.insertBefore(input, label.firstChild);\n }\n input = label;\n }\n\n TD.appendChild(input);\n\n if (badValue) {\n TD.appendChild(document.createTextNode('#bad-value#'));\n }\n\n if (!isListeningKeyDownEvent.has(instance)) {\n isListeningKeyDownEvent.set(instance, true);\n instance.addHook('beforeKeyDown', onBeforeKeyDown);\n }\n\n /**\n * On before key down DOM listener.\n *\n * @private\n * @param {Event} event\n */\n function onBeforeKeyDown(event) {\n const toggleKeys = 'SPACE|ENTER';\n const switchOffKeys = 'DELETE|BACKSPACE';\n const isKeyCode = partial(isKey, event.keyCode);\n\n if (isKeyCode(`${toggleKeys}|${switchOffKeys}`) && !isImmediatePropagationStopped(event)) {\n eachSelectedCheckboxCell(() => {\n stopImmediatePropagation(event);\n event.preventDefault();\n });\n }\n if (isKeyCode(toggleKeys)) {\n changeSelectedCheckboxesState();\n }\n if (isKeyCode(switchOffKeys)) {\n changeSelectedCheckboxesState(true);\n }\n }\n\n /**\n * Change checkbox checked property\n *\n * @private\n * @param {Boolean} [uncheckCheckbox=false]\n */\n function changeSelectedCheckboxesState(uncheckCheckbox = false) {\n const selRange = instance.getSelectedRangeLast();\n\n if (!selRange) {\n return;\n }\n\n const {row: startRow, col: startColumn} = selRange.getTopLeftCorner();\n const {row: endRow, col: endColumn} = selRange.getBottomRightCorner();\n const changes = [];\n\n for (let row = startRow; row <= endRow; row += 1) {\n for (let col = startColumn; col <= endColumn; col += 1) {\n const cellProperties = instance.getCellMeta(row, col);\n\n if (cellProperties.type !== 'checkbox') {\n return;\n }\n\n /* eslint-disable no-continue */\n if (cellProperties.readOnly === true) {\n continue;\n }\n\n if (typeof cellProperties.checkedTemplate === 'undefined') {\n cellProperties.checkedTemplate = true;\n }\n if (typeof cellProperties.uncheckedTemplate === 'undefined') {\n cellProperties.uncheckedTemplate = false;\n }\n\n const dataAtCell = instance.getDataAtCell(row, col);\n\n if (uncheckCheckbox === false) {\n if ([cellProperties.checkedTemplate, cellProperties.checkedTemplate.toString()].includes(dataAtCell)) {\n changes.push([row, col, cellProperties.uncheckedTemplate]);\n\n } else if ([cellProperties.uncheckedTemplate, cellProperties.uncheckedTemplate.toString(), null, void 0].includes(dataAtCell)) {\n changes.push([row, col, cellProperties.checkedTemplate]);\n }\n\n } else {\n changes.push([row, col, cellProperties.uncheckedTemplate]);\n }\n }\n }\n\n if (changes.length > 0) {\n instance.setDataAtCell(changes);\n }\n }\n\n /**\n * Call callback for each found selected cell with checkbox type.\n *\n * @private\n * @param {Function} callback\n */\n function eachSelectedCheckboxCell(callback) {\n const selRange = instance.getSelectedRangeLast();\n\n if (!selRange) {\n return;\n }\n const topLeft = selRange.getTopLeftCorner();\n const bottomRight = selRange.getBottomRightCorner();\n\n for (let row = topLeft.row; row <= bottomRight.row; row++) {\n for (let col = topLeft.col; col <= bottomRight.col; col++) {\n let cellProperties = instance.getCellMeta(row, col);\n\n if (cellProperties.type !== 'checkbox') {\n return;\n }\n\n let cell = instance.getCell(row, col);\n\n if (cell == null) {\n\n callback(row, col, cellProperties);\n\n } else {\n let checkboxes = cell.querySelectorAll('input[type=checkbox]');\n\n if (checkboxes.length > 0 && !cellProperties.readOnly) {\n callback(checkboxes);\n }\n }\n }\n }\n }\n}\n\n/**\n * Register checkbox listeners.\n *\n * @param {Handsontable} instance Handsontable instance.\n * @returns {EventManager}\n */\nfunction registerEvents(instance) {\n let eventManager = isCheckboxListenerAdded.get(instance);\n\n if (!eventManager) {\n eventManager = new EventManager(instance);\n eventManager.addEventListener(instance.rootElement, 'click', (event) => onClick(event, instance));\n eventManager.addEventListener(instance.rootElement, 'mouseup', (event) => onMouseUp(event, instance));\n eventManager.addEventListener(instance.rootElement, 'change', (event) => onChange(event, instance));\n\n isCheckboxListenerAdded.set(instance, eventManager);\n }\n\n return eventManager;\n}\n\n/**\n * Create input element.\n *\n * @returns {Node}\n */\nfunction createInput() {\n let input = document.createElement('input');\n\n input.className = 'htCheckboxRendererInput';\n input.type = 'checkbox';\n input.setAttribute('autocomplete', 'off');\n input.setAttribute('tabindex', '-1');\n\n return input.cloneNode(false);\n}\n\n/**\n * Create label element.\n *\n * @returns {Node}\n */\nfunction createLabel(text) {\n let label = document.createElement('label');\n\n label.className = 'htCheckboxRendererLabel';\n label.appendChild(document.createTextNode(text));\n\n return label.cloneNode(true);\n}\n\n/**\n * `mouseup` callback.\n *\n * @private\n * @param {Event} event `mouseup` event.\n * @param {Object} instance Handsontable instance.\n */\nfunction onMouseUp(event, instance) {\n if (!isCheckboxInput(event.target)) {\n return;\n }\n setTimeout(instance.listen, 10);\n}\n\n/**\n * `click` callback.\n *\n * @private\n * @param {Event} event `click` event.\n * @param {Object} instance Handsontable instance.\n */\nfunction onClick(event, instance) {\n if (!isCheckboxInput(event.target)) {\n return false;\n }\n\n const row = parseInt(event.target.getAttribute('data-row'), 10);\n const col = parseInt(event.target.getAttribute('data-col'), 10);\n const cellProperties = instance.getCellMeta(row, col);\n\n if (cellProperties.readOnly) {\n event.preventDefault();\n }\n}\n\n/**\n * `change` callback.\n *\n * @param {Event} event `change` event.\n * @param {Object} instance Handsontable instance.\n * @param {Object} cellProperties Reference to cell properties.\n * @returns {Boolean}\n */\nfunction onChange(event, instance) {\n if (!isCheckboxInput(event.target)) {\n return false;\n }\n\n const row = parseInt(event.target.getAttribute('data-row'), 10);\n const col = parseInt(event.target.getAttribute('data-col'), 10);\n const cellProperties = instance.getCellMeta(row, col);\n\n if (!cellProperties.readOnly) {\n let newCheckboxValue = null;\n\n if (event.target.checked) {\n newCheckboxValue = cellProperties.uncheckedTemplate === void 0 ? true : cellProperties.checkedTemplate;\n\n } else {\n newCheckboxValue = cellProperties.uncheckedTemplate === void 0 ? false : cellProperties.uncheckedTemplate;\n }\n\n instance.setDataAtCell(row, col, newCheckboxValue);\n }\n}\n\n/**\n * Check if the provided element is the checkbox input.\n *\n * @private\n * @param {HTMLElement} element The element in question.\n * @returns {Boolean}\n */\nfunction isCheckboxInput(element) {\n return element.tagName === 'INPUT' && element.getAttribute('type') === 'checkbox';\n}\n\nexport default checkboxRenderer;\n\n\n\n// WEBPACK FOOTER //\n// ./src/renderers/checkboxRenderer.js","import {fastInnerHTML} from './../helpers/dom/element';\nimport {getRenderer} from './index';\n\n/**\n * @private\n * @renderer HtmlRenderer\n * @param instance\n * @param TD\n * @param row\n * @param col\n * @param prop\n * @param value\n * @param cellProperties\n */\nfunction htmlRenderer(instance, TD, row, col, prop, value, cellProperties) {\n getRenderer('base').apply(this, arguments);\n\n if (value === null || value === void 0) {\n value = '';\n }\n\n fastInnerHTML(TD, value);\n}\n\nexport default htmlRenderer;\n\n\n\n// WEBPACK FOOTER //\n// ./src/renderers/htmlRenderer.js","import numbro from 'numbro';\nimport {getRenderer} from './index';\nimport {isNumeric} from './../helpers/number';\n\n/**\n * Numeric cell renderer\n *\n * @private\n * @renderer NumericRenderer\n * @dependencies numbro\n * @param {Object} instance Handsontable instance\n * @param {Element} TD Table cell where to render\n * @param {Number} row\n * @param {Number} col\n * @param {String|Number} prop Row object property name\n * @param value Value to render (remember to escape unsafe HTML before inserting to DOM!)\n * @param {Object} cellProperties Cell properties (shared by cell renderer and editor)\n */\nfunction numericRenderer(instance, TD, row, col, prop, value, cellProperties) {\n if (isNumeric(value)) {\n const numericFormat = cellProperties.numericFormat;\n const cellCulture = numericFormat && numericFormat.culture;\n const cellFormatPattern = numericFormat && numericFormat.pattern;\n const className = cellProperties.className || '';\n let classArr = className.length ? className.split(' ') : [];\n\n if (typeof cellCulture !== 'undefined') {\n numbro.culture(cellCulture);\n }\n\n value = numbro(value).format(cellFormatPattern || '0');\n\n if (classArr.indexOf('htLeft') < 0 && classArr.indexOf('htCenter') < 0 &&\n classArr.indexOf('htRight') < 0 && classArr.indexOf('htJustify') < 0) {\n classArr.push('htRight');\n }\n\n if (classArr.indexOf('htNumeric') < 0) {\n classArr.push('htNumeric');\n }\n\n cellProperties.className = classArr.join(' ');\n }\n\n getRenderer('text')(instance, TD, row, col, prop, value, cellProperties);\n}\n\nexport default numericRenderer;\n\n\n\n// WEBPACK FOOTER //\n// ./src/renderers/numericRenderer.js","module.exports = __WEBPACK_EXTERNAL_MODULE_247__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"root\":\"numbro\",\"commonjs2\":\"numbro\",\"commonjs\":\"numbro\",\"amd\":\"numbro\"}\n// module id = 247\n// module chunks = 0","import {fastInnerHTML} from './../helpers/dom/element';\nimport {getRenderer} from './index';\nimport {rangeEach} from './../helpers/number';\n\n/**\n * @private\n * @renderer PasswordRenderer\n * @param instance\n * @param TD\n * @param row\n * @param col\n * @param prop\n * @param value\n * @param cellProperties\n */\nfunction passwordRenderer(instance, TD, row, col, prop, value, cellProperties) {\n getRenderer('text').apply(this, arguments);\n\n value = TD.innerHTML;\n\n const hashLength = cellProperties.hashLength || value.length;\n const hashSymbol = cellProperties.hashSymbol || '*';\n\n let hash = '';\n\n rangeEach(hashLength - 1, () => {\n hash += hashSymbol;\n });\n fastInnerHTML(TD, hash);\n}\n\nexport default passwordRenderer;\n\n\n\n// WEBPACK FOOTER //\n// ./src/renderers/passwordRenderer.js","import {empty, fastInnerText} from './../helpers/dom/element';\nimport {stringify} from './../helpers/mixed';\nimport {getRenderer} from './index';\n\n/**\n * Default text renderer\n *\n * @private\n * @renderer TextRenderer\n * @param {Object} instance Handsontable instance\n * @param {Element} TD Table cell where to render\n * @param {Number} row\n * @param {Number} col\n * @param {String|Number} prop Row object property name\n * @param value Value to render (remember to escape unsafe HTML before inserting to DOM!)\n * @param {Object} cellProperties Cell properties (shared by cell renderer and editor)\n */\nfunction textRenderer(instance, TD, row, col, prop, value, cellProperties) {\n getRenderer('base').apply(this, arguments);\n\n if (!value && cellProperties.placeholder) {\n value = cellProperties.placeholder;\n }\n\n var escaped = stringify(value);\n\n if (!instance.getSettings().trimWhitespace) {\n escaped = escaped.replace(/ /g, String.fromCharCode(160));\n }\n\n if (cellProperties.rendererTemplate) {\n empty(TD);\n var TEMPLATE = document.createElement('TEMPLATE');\n TEMPLATE.setAttribute('bind', '{{}}');\n TEMPLATE.innerHTML = cellProperties.rendererTemplate;\n HTMLTemplateElement.decorate(TEMPLATE);\n TEMPLATE.model = instance.getSourceDataAtRow(row);\n TD.appendChild(TEMPLATE);\n\n } else {\n // this is faster than innerHTML. See: https://github.com/handsontable/handsontable/wiki/JavaScript-&-DOM-performance-tips\n fastInnerText(TD, escaped);\n }\n}\n\nexport default textRenderer;\n\n\n\n// WEBPACK FOOTER //\n// ./src/renderers/textRenderer.js","/**\n * Autocomplete cell validator.\n *\n * @private\n * @validator AutocompleteValidator\n * @param {*} value - Value of edited cell\n * @param {Function} callback - Callback called with validation result\n */\nexport default function autocompleteValidator(value, callback) {\n if (value == null) {\n value = '';\n }\n\n if (this.allowEmpty && value === '') {\n callback(true);\n\n return;\n }\n\n if (this.strict && this.source) {\n if (typeof this.source === 'function') {\n this.source(value, process(value, callback));\n } else {\n process(value, callback)(this.source);\n }\n } else {\n callback(true);\n }\n};\n\n/**\n * Function responsible for validation of autocomplete value.\n *\n * @param {*} value - Value of edited cell\n * @param {Function} callback - Callback called with validation result\n */\nfunction process(value, callback) {\n var originalVal = value;\n\n return function(source) {\n var found = false;\n\n for (var s = 0, slen = source.length; s < slen; s++) {\n if (originalVal === source[s]) {\n found = true; // perfect match\n break;\n }\n }\n\n callback(found);\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/validators/autocompleteValidator.js","import moment from 'moment';\nimport {getNormalizedDate} from '../helpers/date';\nimport {getEditorInstance} from '../editors';\n\n/**\n * Date cell validator\n *\n * @private\n * @validator DateValidator\n * @dependencies moment\n * @param {*} value - Value of edited cell\n * @param {Function} callback - Callback called with validation result\n */\nexport default function dateValidator(value, callback) {\n let valid = true;\n const dateEditor = getEditorInstance('date', this.instance);\n\n if (value == null) {\n value = '';\n }\n let isValidDate = moment(new Date(value)).isValid() || moment(value, dateEditor.defaultDateFormat).isValid();\n // is it in the specified format\n let isValidFormat = moment(value, this.dateFormat || dateEditor.defaultDateFormat, true).isValid();\n\n if (this.allowEmpty && value === '') {\n isValidDate = true;\n isValidFormat = true;\n }\n if (!isValidDate) {\n valid = false;\n }\n if (!isValidDate && isValidFormat) {\n valid = true;\n }\n\n if (isValidDate && !isValidFormat) {\n if (this.correctFormat === true) { // if format correction is enabled\n let correctedValue = correctFormat(value, this.dateFormat);\n let row = this.instance.runHooks('unmodifyRow', this.row);\n let column = this.instance.runHooks('unmodifyCol', this.col);\n\n this.instance.setDataAtCell(row, column, correctedValue, 'dateValidator');\n valid = true;\n } else {\n valid = false;\n }\n }\n\n callback(valid);\n};\n\n/**\n * Format the given string using moment.js' format feature\n *\n * @param {String} value\n * @param {String} dateFormat\n * @returns {String}\n */\nexport function correctFormat(value, dateFormat) {\n let dateFromDate = moment(getNormalizedDate(value));\n let dateFromMoment = moment(value, dateFormat);\n let isAlphanumeric = value.search(/[A-z]/g) > -1;\n let date;\n\n if ((dateFromDate.isValid() && dateFromDate.format('x') === dateFromMoment.format('x')) ||\n !dateFromMoment.isValid() ||\n isAlphanumeric) {\n date = dateFromDate;\n\n } else {\n date = dateFromMoment;\n }\n\n return date.format(dateFormat);\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/validators/dateValidator.js","/**\n * Numeric cell validator\n *\n * @private\n * @validator NumericValidator\n * @param {*} value - Value of edited cell\n * @param {*} callback - Callback called with validation result\n */\nexport default function numericValidator(value, callback) {\n if (value == null) {\n value = '';\n }\n if (this.allowEmpty && value === '') {\n callback(true);\n\n } else if (value === '') {\n callback(false);\n\n } else {\n callback(/^-?\\d*(\\.|,)?\\d*$/.test(value));\n }\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/validators/numericValidator.js","import moment from 'moment';\n\n// Formats which are correctly parsed to time (supported by momentjs)\nconst STRICT_FORMATS = [\n 'YYYY-MM-DDTHH:mm:ss.SSSZ',\n 'X', // Unix timestamp\n 'x' // Unix ms timestamp\n];\n\n/**\n * Time cell validator\n *\n * @private\n * @validator TimeValidator\n * @dependencies moment\n * @param {*} value - Value of edited cell\n * @param {Function} callback - Callback called with validation result\n */\nexport default function timeValidator(value, callback) {\n let valid = true;\n let timeFormat = this.timeFormat || 'h:mm:ss a';\n\n if (value === null) {\n value = '';\n }\n\n value = /^\\d{3,}$/.test(value) ? parseInt(value, 10) : value;\n\n let twoDigitValue = /^\\d{1,2}$/.test(value);\n\n if (twoDigitValue) {\n value += ':00';\n }\n\n let date = moment(value, STRICT_FORMATS, true).isValid() ? moment(value) : moment(value, timeFormat);\n let isValidTime = date.isValid();\n\n // is it in the specified format\n let isValidFormat = moment(value, timeFormat, true).isValid() && !twoDigitValue;\n\n if (this.allowEmpty && value === '') {\n isValidTime = true;\n isValidFormat = true;\n }\n if (!isValidTime) {\n valid = false;\n }\n if (!isValidTime && isValidFormat) {\n valid = true;\n }\n if (isValidTime && !isValidFormat) {\n if (this.correctFormat === true) { // if format correction is enabled\n let correctedValue = date.format(timeFormat);\n let row = this.instance.runHooks('unmodifyRow', this.row);\n let column = this.instance.runHooks('unmodifyCol', this.col);\n\n this.instance.setDataAtCell(row, column, correctedValue, 'timeValidator');\n valid = true;\n } else {\n valid = false;\n }\n }\n\n callback(valid);\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/validators/timeValidator.js","import {getEditor} from './../editors';\nimport {getRenderer} from './../renderers';\nimport {getValidator} from './../validators';\n\nconst CELL_TYPE = 'autocomplete';\n\nexport default {\n editor: getEditor(CELL_TYPE),\n renderer: getRenderer(CELL_TYPE),\n validator: getValidator(CELL_TYPE),\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/cellTypes/autocompleteType.js","import {getEditor} from './../editors';\nimport {getRenderer} from './../renderers';\n\nconst CELL_TYPE = 'checkbox';\n\nexport default {\n editor: getEditor(CELL_TYPE),\n renderer: getRenderer(CELL_TYPE),\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/cellTypes/checkboxType.js","import {getEditor} from './../editors';\nimport {getRenderer} from './../renderers';\nimport {getValidator} from './../validators';\n\nconst CELL_TYPE = 'date';\n\nexport default {\n editor: getEditor(CELL_TYPE),\n // displays small gray arrow on right side of the cell\n renderer: getRenderer('autocomplete'),\n validator: getValidator(CELL_TYPE),\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/cellTypes/dateType.js","import {getEditor} from './../editors';\nimport {getRenderer} from './../renderers';\nimport {getValidator} from './../validators';\n\nconst CELL_TYPE = 'dropdown';\n\nexport default {\n editor: getEditor(CELL_TYPE),\n // displays small gray arrow on right side of the cell\n renderer: getRenderer('autocomplete'),\n validator: getValidator('autocomplete'),\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/cellTypes/dropdownType.js","import {getEditor} from './../editors';\nimport {getRenderer} from './../renderers';\n\nconst CELL_TYPE = 'handsontable';\n\nexport default {\n editor: getEditor(CELL_TYPE),\n // displays small gray arrow on right side of the cell\n renderer: getRenderer('autocomplete'),\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/cellTypes/handsontableType.js","import {getEditor} from './../editors';\nimport {getRenderer} from './../renderers';\nimport {getValidator} from './../validators';\n\nconst CELL_TYPE = 'numeric';\n\nexport default {\n editor: getEditor(CELL_TYPE),\n renderer: getRenderer(CELL_TYPE),\n validator: getValidator(CELL_TYPE),\n dataType: 'number',\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/cellTypes/numericType.js","import {getEditor} from './../editors';\nimport {getRenderer} from './../renderers';\nimport {getValidator} from './../validators';\n\nconst CELL_TYPE = 'password';\n\nexport default {\n editor: getEditor(CELL_TYPE),\n renderer: getRenderer(CELL_TYPE),\n copyable: false,\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/cellTypes/passwordType.js","import {isMobileBrowser} from './../helpers/browser';\nimport {getEditor} from './../editors';\nimport {getRenderer} from './../renderers';\n\nconst CELL_TYPE = 'text';\n\nexport default {\n editor: getEditor(CELL_TYPE),\n renderer: getRenderer(CELL_TYPE),\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/cellTypes/textType.js","import {getEditor} from './../editors';\nimport {getRenderer} from './../renderers';\nimport {getValidator} from './../validators';\n\nconst CELL_TYPE = 'time';\n\nexport default {\n editor: getEditor('text'),\n // displays small gray arrow on right side of the cell\n renderer: getRenderer('text'),\n validator: getValidator(CELL_TYPE),\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/cellTypes/timeType.js","import SheetClip from './../lib/SheetClip/SheetClip.js';\nimport {cellMethodLookupFactory} from './helpers/data';\nimport {columnFactory} from './helpers/setting';\nimport {createObjectPropListener, duckSchema, deepExtend, deepClone, isObject, deepObjectSize, hasOwnProperty} from './helpers/object';\nimport {extendArray, to2dArray} from './helpers/array';\nimport Interval from './utils/interval';\nimport {rangeEach} from './helpers/number';\nimport MultiMap from './multiMap';\nimport Hooks from './pluginHooks';\n\n/**\n * Utility class that gets and saves data from/to the data source using mapping of columns numbers to object property names\n * @todo refactor arguments of methods getRange, getText to be numbers (not objects)\n * @todo remove priv, GridSettings from object constructor\n *\n * @param {Object} instance Instance of Handsontable\n * @param {*} priv\n * @param {*} GridSettings Grid settings\n * @util\n * @class DataMap\n */\nfunction DataMap(instance, priv, GridSettings) {\n this.instance = instance;\n this.priv = priv;\n this.GridSettings = GridSettings;\n this.dataSource = this.instance.getSettings().data;\n this.cachedLength = null;\n this.skipCache = false;\n this.latestSourceRowsCount = 0;\n\n if (this.dataSource && this.dataSource[0]) {\n this.duckSchema = this.recursiveDuckSchema(this.dataSource[0]);\n } else {\n this.duckSchema = {};\n }\n this.createMap();\n this.interval = Interval.create(() => this.clearLengthCache(), '15fps');\n\n this.instance.addHook('skipLengthCache', (delay) => this.onSkipLengthCache(delay));\n this.onSkipLengthCache(500);\n}\n\nDataMap.prototype.DESTINATION_RENDERER = 1;\nDataMap.prototype.DESTINATION_CLIPBOARD_GENERATOR = 2;\n\n/**\n * @param {Object|Array} object\n * @returns {Object|Array}\n */\nDataMap.prototype.recursiveDuckSchema = function(object) {\n return duckSchema(object);\n};\n\n/**\n * @param {Object} schema\n * @param {Number} lastCol\n * @param {Number} parent\n * @returns {Number}\n */\nDataMap.prototype.recursiveDuckColumns = function(schema, lastCol, parent) {\n var prop,\n i;\n if (typeof lastCol === 'undefined') {\n lastCol = 0;\n parent = '';\n }\n if (typeof schema === 'object' && !Array.isArray(schema)) {\n for (i in schema) {\n if (hasOwnProperty(schema, i)) {\n if (schema[i] === null) {\n prop = parent + i;\n this.colToPropCache.push(prop);\n this.propToColCache.set(prop, lastCol);\n\n lastCol++;\n } else {\n lastCol = this.recursiveDuckColumns(schema[i], lastCol, `${i}.`);\n }\n }\n }\n }\n\n return lastCol;\n};\n\nDataMap.prototype.createMap = function() {\n let i;\n let schema = this.getSchema();\n\n if (typeof schema === 'undefined') {\n throw new Error('trying to create `columns` definition but you didn\\'t provide `schema` nor `data`');\n }\n\n this.colToPropCache = [];\n this.propToColCache = new MultiMap();\n\n let columns = this.instance.getSettings().columns;\n\n if (columns) {\n const maxCols = this.instance.getSettings().maxCols;\n let columnsLen = Math.min(maxCols, columns.length);\n let filteredIndex = 0;\n let columnsAsFunc = false;\n let schemaLen = deepObjectSize(schema);\n\n if (typeof columns === 'function') {\n columnsLen = schemaLen > 0 ? schemaLen : this.instance.countSourceCols();\n columnsAsFunc = true;\n }\n\n for (i = 0; i < columnsLen; i++) {\n let column = columnsAsFunc ? columns(i) : columns[i];\n\n if (isObject(column)) {\n if (typeof column.data !== 'undefined') {\n let index = columnsAsFunc ? filteredIndex : i;\n this.colToPropCache[index] = column.data;\n this.propToColCache.set(column.data, index);\n }\n\n filteredIndex++;\n }\n }\n\n } else {\n this.recursiveDuckColumns(schema);\n }\n};\n\n/**\n * Returns property name that corresponds with the given column index.\n *\n * @param {Number} col Visual column index.\n * @returns {Number} Physical column index.\n */\nDataMap.prototype.colToProp = function(col) {\n col = this.instance.runHooks('modifyCol', col);\n\n if (!isNaN(col) && this.colToPropCache && typeof this.colToPropCache[col] !== 'undefined') {\n return this.colToPropCache[col];\n }\n\n return col;\n};\n\n/**\n * @param {Object} prop\n * @fires Hooks#modifyCol\n * @returns {*}\n */\nDataMap.prototype.propToCol = function(prop) {\n var col;\n\n if (typeof this.propToColCache.get(prop) === 'undefined') {\n col = prop;\n } else {\n col = this.propToColCache.get(prop);\n }\n col = this.instance.runHooks('unmodifyCol', col);\n\n return col;\n};\n\n/**\n * @returns {Object}\n */\nDataMap.prototype.getSchema = function() {\n var schema = this.instance.getSettings().dataSchema;\n\n if (schema) {\n if (typeof schema === 'function') {\n return schema();\n }\n return schema;\n }\n\n return this.duckSchema;\n};\n\n/**\n * Creates row at the bottom of the data array.\n *\n * @param {Number} [index] Physical index of the row before which the new row will be inserted.\n * @param {Number} [amount=1] An amount of rows to add.\n * @param {String} [source] Source of method call.\n * @fires Hooks#afterCreateRow\n * @returns {Number} Returns number of created rows.\n */\nDataMap.prototype.createRow = function(index, amount = 1, source) {\n let numberOfCreatedRows = 0;\n\n if (typeof index !== 'number' || index >= this.instance.countSourceRows()) {\n index = this.instance.countSourceRows();\n }\n\n const continueProcess = this.instance.runHooks('beforeCreateRow', index, amount, source);\n\n if (continueProcess === false) {\n return 0;\n }\n\n const maxRows = this.instance.getSettings().maxRows;\n const columnCount = this.instance.countCols();\n\n while (numberOfCreatedRows < amount && this.instance.countSourceRows() < maxRows) {\n let row = null;\n\n if (this.instance.dataType === 'array') {\n if (this.instance.getSettings().dataSchema) {\n // Clone template array\n row = deepClone(this.getSchema());\n\n } else {\n row = [];\n /* eslint-disable no-loop-func */\n rangeEach(columnCount - 1, () => row.push(null));\n }\n\n } else if (this.instance.dataType === 'function') {\n row = this.instance.getSettings().dataSchema(index);\n\n } else {\n row = {};\n deepExtend(row, this.getSchema());\n }\n\n if (index === this.instance.countSourceRows()) {\n this.dataSource.push(row);\n\n } else {\n this.spliceData(index, 0, row);\n }\n\n numberOfCreatedRows++;\n }\n\n this.instance.runHooks('afterCreateRow', index, numberOfCreatedRows, source);\n this.instance.forceFullRender = true; // used when data was changed\n\n return numberOfCreatedRows;\n};\n\n/**\n * Creates col at the right of the data array.\n *\n * @param {Number} [index] Visual index of the column before which the new column will be inserted\n * @param {Number} [amount] An amount of columns to add.\n * @param {String} [source] Source of method call.\n * @fires Hooks#afterCreateCol\n * @returns {Number} Returns number of created columns\n */\nDataMap.prototype.createCol = function(index, amount, source) {\n if (!this.instance.isColumnModificationAllowed()) {\n throw new Error('Cannot create new column. When data source in an object, ' +\n 'you can only have as much columns as defined in first data row, data schema or in the \\'columns\\' setting.' +\n 'If you want to be able to add new columns, you have to use array datasource.');\n }\n var rlen = this.instance.countSourceRows(),\n data = this.dataSource,\n constructor,\n numberOfCreatedCols = 0,\n currentIndex;\n\n if (!amount) {\n amount = 1;\n }\n\n if (typeof index !== 'number' || index >= this.instance.countCols()) {\n index = this.instance.countCols();\n }\n this.instance.runHooks('beforeCreateCol', index, amount, source);\n\n currentIndex = index;\n\n var maxCols = this.instance.getSettings().maxCols;\n while (numberOfCreatedCols < amount && this.instance.countCols() < maxCols) {\n constructor = columnFactory(this.GridSettings, this.priv.columnsSettingConflicts);\n\n if (typeof index !== 'number' || index >= this.instance.countCols()) {\n if (rlen > 0) {\n for (var r = 0; r < rlen; r++) {\n if (typeof data[r] === 'undefined') {\n data[r] = [];\n }\n data[r].push(null);\n }\n } else {\n data.push([null]);\n }\n // Add new column constructor\n this.priv.columnSettings.push(constructor);\n\n } else {\n for (let r = 0; r < rlen; r++) {\n data[r].splice(currentIndex, 0, null);\n }\n // Add new column constructor at given index\n this.priv.columnSettings.splice(currentIndex, 0, constructor);\n }\n\n numberOfCreatedCols++;\n currentIndex++;\n }\n\n this.instance.runHooks('afterCreateCol', index, numberOfCreatedCols, source);\n this.instance.forceFullRender = true; // used when data was changed\n\n return numberOfCreatedCols;\n};\n\n/**\n * Removes row from the data array.\n *\n * @param {Number} [index] Visual index of the row to be removed. If not provided, the last row will be removed\n * @param {Number} [amount] Amount of the rows to be removed. If not provided, one row will be removed\n * @param {String} [source] Source of method call.\n * @fires Hooks#beforeRemoveRow\n * @fires Hooks#afterRemoveRow\n */\nDataMap.prototype.removeRow = function(index, amount, source) {\n if (!amount) {\n amount = 1;\n }\n if (typeof index !== 'number') {\n index = -amount;\n }\n\n amount = this.instance.runHooks('modifyRemovedAmount', amount, index);\n\n index = (this.instance.countSourceRows() + index) % this.instance.countSourceRows();\n\n let logicRows = this.visualRowsToPhysical(index, amount);\n let actionWasNotCancelled = this.instance.runHooks('beforeRemoveRow', index, amount, logicRows, source);\n\n if (actionWasNotCancelled === false) {\n return;\n }\n\n let data = this.dataSource;\n let newData;\n\n newData = this.filterData(index, amount);\n\n if (newData) {\n data.length = 0;\n Array.prototype.push.apply(data, newData);\n }\n\n this.instance.runHooks('afterRemoveRow', index, amount, logicRows, source);\n\n this.instance.forceFullRender = true; // used when data was changed\n};\n\n/**\n * Removes column from the data array.\n *\n * @param {Number} [index] Visual index of the column to be removed. If not provided, the last column will be removed\n * @param {Number} [amount] Amount of the columns to be removed. If not provided, one column will be removed\n * @param {String} [source] Source of method call.\n * @fires Hooks#beforeRemoveCol\n * @fires Hooks#afterRemoveCol\n */\nDataMap.prototype.removeCol = function(index, amount, source) {\n if (this.instance.dataType === 'object' || this.instance.getSettings().columns) {\n throw new Error('cannot remove column with object data source or columns option specified');\n }\n if (!amount) {\n amount = 1;\n }\n if (typeof index !== 'number') {\n index = -amount;\n }\n\n index = (this.instance.countCols() + index) % this.instance.countCols();\n\n let logicColumns = this.visualColumnsToPhysical(index, amount);\n let descendingLogicColumns = logicColumns.slice(0).sort((a, b) => b - a);\n let actionWasNotCancelled = this.instance.runHooks('beforeRemoveCol', index, amount, logicColumns, source);\n\n if (actionWasNotCancelled === false) {\n return;\n }\n\n let isTableUniform = true;\n let removedColumnsCount = descendingLogicColumns.length;\n let data = this.dataSource;\n\n for (let c = 0; c < removedColumnsCount; c++) {\n if (isTableUniform && logicColumns[0] !== logicColumns[c] - c) {\n isTableUniform = false;\n }\n }\n\n if (isTableUniform) {\n for (let r = 0, rlen = this.instance.countSourceRows(); r < rlen; r++) {\n data[r].splice(logicColumns[0], amount);\n }\n\n } else {\n for (let r = 0, rlen = this.instance.countSourceRows(); r < rlen; r++) {\n for (let c = 0; c < removedColumnsCount; c++) {\n data[r].splice(descendingLogicColumns[c], 1);\n }\n }\n\n for (let c = 0; c < removedColumnsCount; c++) {\n this.priv.columnSettings.splice(logicColumns[c], 1);\n }\n }\n\n this.instance.runHooks('afterRemoveCol', index, amount, logicColumns, source);\n\n this.instance.forceFullRender = true; // used when data was changed\n};\n\n/**\n * Add/Removes data from the column.\n *\n * @param {Number} col Physical index of column in which do you want to do splice\n * @param {Number} index Index at which to start changing the array. If negative, will begin that many elements from the end\n * @param {Number} amount An integer indicating the number of old array elements to remove. If amount is 0, no elements are removed\n * @returns {Array} Returns removed portion of columns\n */\nDataMap.prototype.spliceCol = function(col, index, amount/* , elements... */) {\n var elements = arguments.length >= 4 ? [].slice.call(arguments, 3) : [];\n\n var colData = this.instance.getDataAtCol(col);\n var removed = colData.slice(index, index + amount);\n var after = colData.slice(index + amount);\n\n extendArray(elements, after);\n var i = 0;\n while (i < amount) {\n elements.push(null); // add null in place of removed elements\n i++;\n }\n to2dArray(elements);\n this.instance.populateFromArray(index, col, elements, null, null, 'spliceCol');\n\n return removed;\n};\n\n/**\n * Add/Removes data from the row.\n *\n * @param {Number} row Physical index of row in which do you want to do splice\n * @param {Number} index Index at which to start changing the array. If negative, will begin that many elements from the end.\n * @param {Number} amount An integer indicating the number of old array elements to remove. If amount is 0, no elements are removed.\n * @returns {Array} Returns removed portion of rows\n */\nDataMap.prototype.spliceRow = function(row, index, amount/* , elements... */) {\n var elements = arguments.length >= 4 ? [].slice.call(arguments, 3) : [];\n\n var rowData = this.instance.getSourceDataAtRow(row);\n var removed = rowData.slice(index, index + amount);\n var after = rowData.slice(index + amount);\n\n extendArray(elements, after);\n var i = 0;\n while (i < amount) {\n elements.push(null); // add null in place of removed elements\n i++;\n }\n this.instance.populateFromArray(row, index, [elements], null, null, 'spliceRow');\n\n return removed;\n};\n\n/**\n * Add/remove row(s) to/from the data source.\n *\n * @param {Number} index Physical index of the element to remove.\n * @param {Number} amount Number of rows to add/remove.\n * @param {Object} element Row to add.\n */\nDataMap.prototype.spliceData = function(index, amount, element) {\n let continueSplicing = this.instance.runHooks('beforeDataSplice', index, amount, element);\n\n if (continueSplicing !== false) {\n this.dataSource.splice(index, amount, element);\n }\n};\n\n/**\n * Filter unwanted data elements from the data source.\n *\n * @param {Number} index Visual index of the element to remove.\n * @param {Number} amount Number of rows to add/remove.\n * @returns {Array}\n */\nDataMap.prototype.filterData = function(index, amount) {\n let physicalRows = this.visualRowsToPhysical(index, amount);\n let continueSplicing = this.instance.runHooks('beforeDataFilter', index, amount, physicalRows);\n\n if (continueSplicing !== false) {\n let newData = this.dataSource.filter((row, index) => physicalRows.indexOf(index) == -1);\n\n return newData;\n }\n};\n\n/**\n * Returns single value from the data array.\n *\n * @param {Number} row Visual row index.\n * @param {Number} prop\n */\nDataMap.prototype.get = function(row, prop) {\n row = this.instance.runHooks('modifyRow', row);\n\n let dataRow = this.dataSource[row];\n // TODO: To remove, use 'modifyData' hook instead (see below)\n let modifiedRowData = this.instance.runHooks('modifyRowData', row);\n\n dataRow = isNaN(modifiedRowData) ? modifiedRowData : dataRow;\n //\n\n let value = null;\n\n // try to get value under property `prop` (includes dot)\n if (dataRow && dataRow.hasOwnProperty && hasOwnProperty(dataRow, prop)) {\n value = dataRow[prop];\n\n } else if (typeof prop === 'string' && prop.indexOf('.') > -1) {\n let sliced = prop.split('.');\n let out = dataRow;\n\n if (!out) {\n return null;\n }\n for (let i = 0, ilen = sliced.length; i < ilen; i++) {\n out = out[sliced[i]];\n\n if (typeof out === 'undefined') {\n return null;\n }\n }\n value = out;\n\n } else if (typeof prop === 'function') {\n /**\n * allows for interacting with complex structures, for example\n * d3/jQuery getter/setter properties:\n *\n * {columns: [{\n * data: function(row, value){\n * if(arguments.length === 1){\n * return row.property();\n * }\n * row.property(value);\n * }\n * }]}\n */\n value = prop(this.dataSource.slice(row, row + 1)[0]);\n }\n\n if (this.instance.hasHook('modifyData')) {\n const valueHolder = createObjectPropListener(value);\n\n this.instance.runHooks('modifyData', row, this.propToCol(prop), valueHolder, 'get');\n\n if (valueHolder.isTouched()) {\n value = valueHolder.value;\n }\n }\n\n return value;\n};\n\nvar copyableLookup = cellMethodLookupFactory('copyable', false);\n\n/**\n * Returns single value from the data array (intended for clipboard copy to an external application).\n *\n * @param {Number} row Physical row index.\n * @param {Number} prop\n * @returns {String}\n */\nDataMap.prototype.getCopyable = function(row, prop) {\n if (copyableLookup.call(this.instance, row, this.propToCol(prop))) {\n return this.get(row, prop);\n }\n return '';\n};\n\n/**\n * Saves single value to the data array.\n *\n * @param {Number} row Visual row index.\n * @param {Number} prop\n * @param {String} value\n * @param {String} [source] Source of hook runner.\n */\nDataMap.prototype.set = function(row, prop, value, source) {\n row = this.instance.runHooks('modifyRow', row, source || 'datamapGet');\n\n let dataRow = this.dataSource[row];\n // TODO: To remove, use 'modifyData' hook instead (see below)\n let modifiedRowData = this.instance.runHooks('modifyRowData', row);\n\n dataRow = isNaN(modifiedRowData) ? modifiedRowData : dataRow;\n //\n\n if (this.instance.hasHook('modifyData')) {\n const valueHolder = createObjectPropListener(value);\n\n this.instance.runHooks('modifyData', row, this.propToCol(prop), valueHolder, 'set');\n\n if (valueHolder.isTouched()) {\n value = valueHolder.value;\n }\n }\n\n // try to set value under property `prop` (includes dot)\n if (dataRow && dataRow.hasOwnProperty && hasOwnProperty(dataRow, prop)) {\n dataRow[prop] = value;\n\n } else if (typeof prop === 'string' && prop.indexOf('.') > -1) {\n let sliced = prop.split('.');\n let out = dataRow;\n let i = 0;\n let ilen;\n\n for (i = 0, ilen = sliced.length - 1; i < ilen; i++) {\n if (typeof out[sliced[i]] === 'undefined') {\n out[sliced[i]] = {};\n }\n out = out[sliced[i]];\n }\n out[sliced[i]] = value;\n\n } else if (typeof prop === 'function') {\n /* see the `function` handler in `get` */\n prop(this.dataSource.slice(row, row + 1)[0], value);\n\n } else {\n dataRow[prop] = value;\n }\n};\n\n/**\n * This ridiculous piece of code maps rows Id that are present in table data to those displayed for user.\n * The trick is, the physical row id (stored in settings.data) is not necessary the same\n * as the visual (displayed) row id (e.g. when sorting is applied).\n *\n * @param {Number} index Visual row index.\n * @param {Number} amount\n * @fires Hooks#modifyRow\n * @returns {Number}\n */\nDataMap.prototype.visualRowsToPhysical = function(index, amount) {\n var totalRows = this.instance.countSourceRows();\n var physicRow = (totalRows + index) % totalRows;\n var logicRows = [];\n var rowsToRemove = amount;\n var row;\n\n while (physicRow < totalRows && rowsToRemove) {\n row = this.instance.runHooks('modifyRow', physicRow);\n logicRows.push(row);\n\n rowsToRemove--;\n physicRow++;\n }\n\n return logicRows;\n};\n\n/**\n *\n * @param index Visual column index.\n * @param amount\n * @returns {Array}\n */\nDataMap.prototype.visualColumnsToPhysical = function(index, amount) {\n let totalCols = this.instance.countCols();\n let physicalCol = (totalCols + index) % totalCols;\n let visualCols = [];\n let colsToRemove = amount;\n\n while (physicalCol < totalCols && colsToRemove) {\n let col = this.instance.runHooks('modifyCol', physicalCol);\n\n visualCols.push(col);\n\n colsToRemove--;\n physicalCol++;\n }\n\n return visualCols;\n};\n\n/**\n * Clears the data array.\n */\nDataMap.prototype.clear = function() {\n for (var r = 0; r < this.instance.countSourceRows(); r++) {\n for (var c = 0; c < this.instance.countCols(); c++) {\n this.set(r, this.colToProp(c), '');\n }\n }\n};\n\n/**\n * Clear cached data length.\n */\nDataMap.prototype.clearLengthCache = function() {\n this.cachedLength = null;\n};\n\n/**\n * Get data length.\n *\n * @returns {Number}\n */\nDataMap.prototype.getLength = function() {\n let maxRows,\n maxRowsFromSettings = this.instance.getSettings().maxRows;\n\n if (maxRowsFromSettings < 0 || maxRowsFromSettings === 0) {\n maxRows = 0;\n } else {\n maxRows = maxRowsFromSettings || Infinity;\n }\n\n let length = this.instance.countSourceRows();\n\n if (this.instance.hasHook('modifyRow')) {\n let reValidate = this.skipCache;\n\n this.interval.start();\n if (length !== this.latestSourceRowsCount) {\n reValidate = true;\n }\n\n this.latestSourceRowsCount = length;\n if (this.cachedLength === null || reValidate) {\n rangeEach(length - 1, (row) => {\n row = this.instance.runHooks('modifyRow', row);\n\n if (row === null) {\n --length;\n }\n });\n this.cachedLength = length;\n\n } else {\n length = this.cachedLength;\n }\n } else {\n this.interval.stop();\n }\n\n return Math.min(length, maxRows);\n};\n\n/**\n * Returns the data array.\n *\n * @returns {Array}\n */\nDataMap.prototype.getAll = function() {\n const start = {\n row: 0,\n col: 0,\n };\n\n let end = {\n row: Math.max(this.instance.countSourceRows() - 1, 0),\n col: Math.max(this.instance.countCols() - 1, 0),\n };\n\n if (start.row - end.row === 0 && !this.instance.countSourceRows()) {\n return [];\n }\n\n return this.getRange(start, end, DataMap.prototype.DESTINATION_RENDERER);\n};\n\n/**\n * Returns data range as array.\n *\n * @param {Object} [start] Start selection position. Visual indexes.\n * @param {Object} [end] End selection position. Visual indexes.\n * @param {Number} destination Destination of datamap.get\n * @returns {Array}\n */\nDataMap.prototype.getRange = function(start, end, destination) {\n var r,\n rlen,\n c,\n clen,\n output = [],\n row;\n\n const maxRows = this.instance.getSettings().maxRows;\n const maxCols = this.instance.getSettings().maxCols;\n\n if (maxRows === 0 || maxCols === 0) {\n return [];\n }\n\n var getFn = destination === this.DESTINATION_CLIPBOARD_GENERATOR ? this.getCopyable : this.get;\n\n rlen = Math.min(Math.max(maxRows - 1, 0), Math.max(start.row, end.row));\n clen = Math.min(Math.max(maxCols - 1, 0), Math.max(start.col, end.col));\n\n for (r = Math.min(start.row, end.row); r <= rlen; r++) {\n row = [];\n let physicalRow = this.instance.runHooks('modifyRow', r);\n\n for (c = Math.min(start.col, end.col); c <= clen; c++) {\n\n if (physicalRow === null) {\n break;\n }\n row.push(getFn.call(this, r, this.colToProp(c)));\n }\n if (physicalRow !== null) {\n output.push(row);\n }\n }\n\n return output;\n};\n\n/**\n * Return data as text (tab separated columns).\n *\n * @param {Object} [start] Start selection position. Visual indexes.\n * @param {Object} [end] End selection position. Visual indexes.\n * @returns {String}\n */\nDataMap.prototype.getText = function(start, end) {\n return SheetClip.stringify(this.getRange(start, end, this.DESTINATION_RENDERER));\n};\n\n/**\n * Return data as copyable text (tab separated columns intended for clipboard copy to an external application).\n *\n * @param {Object} [start] Start selection position. Visual indexes.\n * @param {Object} [end] End selection position. Visual indexes.\n * @returns {String}\n */\nDataMap.prototype.getCopyableText = function(start, end) {\n return SheetClip.stringify(this.getRange(start, end, this.DESTINATION_CLIPBOARD_GENERATOR));\n};\n\n/**\n * `skipLengthCache` callback.\n * @private\n * @param {Number} delay Time of the delay in milliseconds.\n */\nDataMap.prototype.onSkipLengthCache = function(delay) {\n this.skipCache = true;\n setTimeout(() => {\n this.skipCache = false;\n }, delay);\n};\n\n/**\n * Destroy instance.\n */\nDataMap.prototype.destroy = function() {\n this.interval.stop();\n\n this.interval = null;\n this.instance = null;\n this.priv = null;\n this.GridSettings = null;\n this.dataSource = null;\n this.cachedLength = null;\n this.duckSchema = null;\n};\n\nexport default DataMap;\n\n\n\n// WEBPACK FOOTER //\n// ./src/dataMap.js","import {requestAnimationFrame, cancelAnimationFrame} from './../helpers/feature';\n\n/**\n * @class Interval\n * @util\n */\nclass Interval {\n static create(func, delay) {\n return new Interval(func, delay);\n }\n\n constructor(func, delay) {\n /**\n * Animation frame request id.\n *\n * @type {Number}\n */\n this.timer = null;\n /**\n * Function to invoke repeatedly.\n *\n * @type {Function}\n */\n this.func = func;\n /**\n * Number of milliseconds that function should wait before next call.\n */\n this.delay = parseDelay(delay);\n /**\n * Flag which indicates if interval object was stopped.\n *\n * @type {Boolean}\n * @default true\n */\n this.stopped = true;\n /**\n * Interval time (in milliseconds) of the last callback call.\n *\n * @private\n * @type {Number}\n */\n this._then = null;\n /**\n * Bounded function `func`.\n *\n * @private\n * @type {Function}\n */\n this._callback = () => this.__callback();\n }\n\n /**\n * Start loop.\n *\n * @returns {Interval}\n */\n start() {\n if (this.stopped) {\n this._then = Date.now();\n this.stopped = false;\n this.timer = requestAnimationFrame(this._callback);\n }\n\n return this;\n }\n\n /**\n * Stop looping.\n *\n * @returns {Interval}\n */\n stop() {\n if (!this.stopped) {\n this.stopped = true;\n cancelAnimationFrame(this.timer);\n this.timer = null;\n }\n\n return this;\n }\n\n /**\n * Loop callback, fired on every animation frame.\n *\n * @private\n */\n __callback() {\n this.timer = requestAnimationFrame(this._callback);\n\n if (this.delay) {\n const now = Date.now();\n const elapsed = now - this._then;\n\n if (elapsed > this.delay) {\n this._then = now - (elapsed % this.delay);\n this.func();\n }\n } else {\n this.func();\n }\n }\n}\n\nexport default Interval;\n\nexport function parseDelay(delay) {\n if (typeof delay === 'string' && /fps$/.test(delay)) {\n delay = 1000 / parseInt(delay.replace('fps', '') || 0, 10);\n }\n\n return delay;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/utils/interval.js","function MultiMap() {\n var map = {\n arrayMap: [],\n weakMap: new WeakMap(),\n };\n\n return {\n get(key) {\n if (canBeAnArrayMapKey(key)) {\n return map.arrayMap[key];\n } else if (canBeAWeakMapKey(key)) {\n return map.weakMap.get(key);\n }\n },\n\n set(key, value) {\n if (canBeAnArrayMapKey(key)) {\n map.arrayMap[key] = value;\n } else if (canBeAWeakMapKey(key)) {\n map.weakMap.set(key, value);\n } else {\n throw new Error('Invalid key type');\n }\n },\n\n delete(key) {\n if (canBeAnArrayMapKey(key)) {\n delete map.arrayMap[key];\n } else if (canBeAWeakMapKey(key)) {\n map.weakMap.delete(key);\n }\n },\n };\n\n function canBeAnArrayMapKey(obj) {\n return obj !== null && !isNaNSymbol(obj) && (typeof obj == 'string' || typeof obj == 'number');\n }\n\n function canBeAWeakMapKey(obj) {\n return obj !== null && (typeof obj == 'object' || typeof obj == 'function');\n }\n\n function isNaNSymbol(obj) {\n /* eslint-disable no-self-compare */\n return obj !== obj; // NaN === NaN is always false\n }\n}\n\nexport default MultiMap;\n\n\n\n// WEBPACK FOOTER //\n// ./src/multiMap.js","import {CellCoords} from './3rdparty/walkontable/src';\nimport {KEY_CODES, isMetaKey, isCtrlMetaKey} from './helpers/unicode';\nimport {stopPropagation, stopImmediatePropagation, isImmediatePropagationStopped} from './helpers/dom/event';\nimport {getEditorInstance} from './editors';\nimport EventManager from './eventManager';\nimport {EditorState} from './editors/_baseEditor';\n\nfunction EditorManager(instance, priv, selection) {\n var _this = this,\n destroyed = false,\n lock = false,\n eventManager,\n activeEditor;\n\n eventManager = new EventManager(instance);\n\n function moveSelectionAfterEnter(shiftKey) {\n const enterMoves = typeof priv.settings.enterMoves === 'function' ? priv.settings.enterMoves(event) : priv.settings.enterMoves;\n\n if (shiftKey) {\n // move selection up\n selection.transformStart(-enterMoves.row, -enterMoves.col);\n } else {\n // move selection down (add a new row if needed)\n selection.transformStart(enterMoves.row, enterMoves.col, true);\n }\n }\n\n function moveSelectionUp(shiftKey) {\n if (shiftKey) {\n selection.transformEnd(-1, 0);\n } else {\n selection.transformStart(-1, 0);\n }\n }\n\n function moveSelectionDown(shiftKey) {\n if (shiftKey) {\n // expanding selection down with shift\n selection.transformEnd(1, 0);\n } else {\n selection.transformStart(1, 0);\n }\n }\n\n function moveSelectionRight(shiftKey) {\n if (shiftKey) {\n selection.transformEnd(0, 1);\n } else {\n selection.transformStart(0, 1);\n }\n }\n\n function moveSelectionLeft(shiftKey) {\n if (shiftKey) {\n selection.transformEnd(0, -1);\n } else {\n selection.transformStart(0, -1);\n }\n }\n\n function onKeyDown(event) {\n if (!instance.isListening()) {\n return;\n }\n instance.runHooks('beforeKeyDown', event);\n\n if (destroyed) {\n return;\n }\n if (isImmediatePropagationStopped(event)) {\n return;\n }\n priv.lastKeyCode = event.keyCode;\n\n if (!selection.isSelected()) {\n return;\n }\n // catch CTRL but not right ALT (which in some systems triggers ALT+CTRL)\n const ctrlDown = (event.ctrlKey || event.metaKey) && !event.altKey;\n\n if (activeEditor && !activeEditor.isWaiting()) {\n if (!isMetaKey(event.keyCode) && !isCtrlMetaKey(event.keyCode) && !ctrlDown && !_this.isEditorOpened()) {\n _this.openEditor('', event);\n\n return;\n }\n }\n const rangeModifier = event.shiftKey ? selection.setRangeEnd : selection.setRangeStart;\n let tabMoves;\n\n switch (event.keyCode) {\n case KEY_CODES.A:\n if (!_this.isEditorOpened() && ctrlDown) {\n instance.selectAll();\n\n event.preventDefault();\n stopPropagation(event);\n }\n break;\n\n case KEY_CODES.ARROW_UP:\n if (_this.isEditorOpened() && !activeEditor.isWaiting()) {\n _this.closeEditorAndSaveChanges(ctrlDown);\n }\n moveSelectionUp(event.shiftKey);\n\n event.preventDefault();\n stopPropagation(event);\n break;\n\n case KEY_CODES.ARROW_DOWN:\n if (_this.isEditorOpened() && !activeEditor.isWaiting()) {\n _this.closeEditorAndSaveChanges(ctrlDown);\n }\n\n moveSelectionDown(event.shiftKey);\n\n event.preventDefault();\n stopPropagation(event);\n break;\n\n case KEY_CODES.ARROW_RIGHT:\n if (_this.isEditorOpened() && !activeEditor.isWaiting()) {\n _this.closeEditorAndSaveChanges(ctrlDown);\n }\n\n moveSelectionRight(event.shiftKey);\n\n event.preventDefault();\n stopPropagation(event);\n break;\n\n case KEY_CODES.ARROW_LEFT:\n if (_this.isEditorOpened() && !activeEditor.isWaiting()) {\n _this.closeEditorAndSaveChanges(ctrlDown);\n }\n\n moveSelectionLeft(event.shiftKey);\n\n event.preventDefault();\n stopPropagation(event);\n break;\n\n case KEY_CODES.TAB:\n tabMoves = typeof priv.settings.tabMoves === 'function' ? priv.settings.tabMoves(event) : priv.settings.tabMoves;\n\n if (event.shiftKey) {\n // move selection left\n selection.transformStart(-tabMoves.row, -tabMoves.col);\n } else {\n // move selection right (add a new column if needed)\n selection.transformStart(tabMoves.row, tabMoves.col, true);\n }\n event.preventDefault();\n stopPropagation(event);\n break;\n\n case KEY_CODES.BACKSPACE:\n case KEY_CODES.DELETE:\n instance.emptySelectedCells();\n _this.prepareEditor();\n event.preventDefault();\n break;\n\n case KEY_CODES.F2:\n /* F2 */\n _this.openEditor(null, event);\n\n if (activeEditor) {\n activeEditor.enableFullEditMode();\n }\n event.preventDefault(); // prevent Opera from opening 'Go to Page dialog'\n break;\n\n case KEY_CODES.ENTER:\n /* return/enter */\n if (_this.isEditorOpened()) {\n\n if (activeEditor && activeEditor.state !== EditorState.WAITING) {\n _this.closeEditorAndSaveChanges(ctrlDown);\n }\n moveSelectionAfterEnter(event.shiftKey);\n\n } else if (instance.getSettings().enterBeginsEditing) {\n _this.openEditor(null, event);\n\n if (activeEditor) {\n activeEditor.enableFullEditMode();\n }\n } else {\n moveSelectionAfterEnter(event.shiftKey);\n }\n event.preventDefault(); // don't add newline to field\n stopImmediatePropagation(event); // required by HandsontableEditor\n break;\n\n case KEY_CODES.ESCAPE:\n if (_this.isEditorOpened()) {\n _this.closeEditorAndRestoreOriginalValue(ctrlDown);\n }\n event.preventDefault();\n break;\n\n case KEY_CODES.HOME:\n if (event.ctrlKey || event.metaKey) {\n rangeModifier.call(selection, new CellCoords(0, selection.selectedRange.current().from.col));\n } else {\n rangeModifier.call(selection, new CellCoords(selection.selectedRange.current().from.row, 0));\n }\n event.preventDefault(); // don't scroll the window\n stopPropagation(event);\n break;\n\n case KEY_CODES.END:\n if (event.ctrlKey || event.metaKey) {\n rangeModifier.call(selection, new CellCoords(instance.countRows() - 1, selection.selectedRange.current().from.col));\n } else {\n rangeModifier.call(selection, new CellCoords(selection.selectedRange.current().from.row, instance.countCols() - 1));\n }\n event.preventDefault(); // don't scroll the window\n stopPropagation(event);\n break;\n\n case KEY_CODES.PAGE_UP:\n selection.transformStart(-instance.countVisibleRows(), 0);\n event.preventDefault(); // don't page up the window\n stopPropagation(event);\n break;\n\n case KEY_CODES.PAGE_DOWN:\n selection.transformStart(instance.countVisibleRows(), 0);\n event.preventDefault(); // don't page down the window\n stopPropagation(event);\n break;\n default:\n break;\n }\n }\n\n function init() {\n instance.addHook('afterDocumentKeyDown', onKeyDown);\n\n eventManager.addEventListener(document.documentElement, 'keydown', (event) => {\n if (!destroyed) {\n instance.runHooks('afterDocumentKeyDown', event);\n }\n });\n\n function onDblClick(event, coords, elem) {\n // may be TD or TH\n if (elem.nodeName === 'TD') {\n _this.openEditor(null, event);\n\n if (activeEditor) {\n activeEditor.enableFullEditMode();\n }\n }\n }\n instance.view.wt.update('onCellDblClick', onDblClick);\n }\n\n /**\n * Lock the editor from being prepared and closed. Locking the editor prevents its closing and\n * reinitialized after selecting the new cell. This feature is necessary for a mobile editor.\n *\n * @function lockEditor\n * @memberof! Handsontable.EditorManager#\n */\n this.lockEditor = function() {\n lock = true;\n };\n\n /**\n * Unlock the editor from being prepared and closed. This method restores the original behavior of\n * the editors where for every new selection its instances are closed.\n *\n * @function unlockEditor\n * @memberof! Handsontable.EditorManager#\n */\n this.unlockEditor = function() {\n lock = false;\n };\n\n /**\n * Destroy current editor, if exists.\n *\n * @function destroyEditor\n * @memberof! Handsontable.EditorManager#\n * @param {Boolean} revertOriginal\n */\n this.destroyEditor = function(revertOriginal) {\n if (!lock) {\n this.closeEditor(revertOriginal);\n }\n };\n\n /**\n * Get active editor.\n *\n * @function getActiveEditor\n * @memberof! Handsontable.EditorManager#\n * @returns {*}\n */\n this.getActiveEditor = function() {\n return activeEditor;\n };\n\n /**\n * Prepare text input to be displayed at given grid cell.\n *\n * @function prepareEditor\n * @memberof! Handsontable.EditorManager#\n */\n this.prepareEditor = function() {\n if (lock) {\n return;\n }\n\n var row,\n col,\n prop,\n td,\n originalValue,\n cellProperties,\n editorClass;\n\n if (activeEditor && activeEditor.isWaiting()) {\n this.closeEditor(false, false, (dataSaved) => {\n if (dataSaved) {\n _this.prepareEditor();\n }\n });\n\n return;\n }\n row = instance.selection.selectedRange.current().highlight.row;\n col = instance.selection.selectedRange.current().highlight.col;\n prop = instance.colToProp(col);\n td = instance.getCell(row, col);\n\n originalValue = instance.getSourceDataAtCell(instance.runHooks('modifyRow', row), col);\n cellProperties = instance.getCellMeta(row, col);\n editorClass = instance.getCellEditor(cellProperties);\n\n if (editorClass) {\n activeEditor = getEditorInstance(editorClass, instance);\n activeEditor.prepare(row, col, prop, td, originalValue, cellProperties);\n\n } else {\n activeEditor = void 0;\n }\n };\n\n /**\n * Check is editor is opened/showed.\n *\n * @function isEditorOpened\n * @memberof! Handsontable.EditorManager#\n * @returns {Boolean}\n */\n this.isEditorOpened = function() {\n return activeEditor && activeEditor.isOpened();\n };\n\n /**\n * Open editor with initial value.\n *\n * @function openEditor\n * @memberof! Handsontable.EditorManager#\n * @param {null|String} newInitialValue new value from which editor will start if handled property it's not the `null`.\n * @param {DOMEvent} event\n */\n this.openEditor = function(newInitialValue, event) {\n if (activeEditor && !activeEditor.cellProperties.readOnly) {\n activeEditor.beginEditing(newInitialValue, event);\n } else if (activeEditor && activeEditor.cellProperties.readOnly) {\n\n // move the selection after opening the editor with ENTER key\n if (event && event.keyCode === KEY_CODES.ENTER) {\n moveSelectionAfterEnter();\n }\n }\n };\n\n /**\n * Close editor, finish editing cell.\n *\n * @function closeEditor\n * @memberof! Handsontable.EditorManager#\n * @param {Boolean} restoreOriginalValue\n * @param {Boolean} [ctrlDown]\n * @param {Function} [callback]\n */\n this.closeEditor = function(restoreOriginalValue, ctrlDown, callback) {\n if (activeEditor) {\n activeEditor.finishEditing(restoreOriginalValue, ctrlDown, callback);\n\n } else if (callback) {\n callback(false);\n }\n };\n\n /**\n * Close editor and save changes.\n *\n * @function closeEditorAndSaveChanges\n * @memberof! Handsontable.EditorManager#\n * @param {Boolean} ctrlDown\n */\n this.closeEditorAndSaveChanges = function(ctrlDown) {\n return this.closeEditor(false, ctrlDown);\n };\n\n /**\n * Close editor and restore original value.\n *\n * @function closeEditorAndRestoreOriginalValue\n * @memberof! Handsontable.EditorManager#\n * @param {Boolean} ctrlDown\n */\n this.closeEditorAndRestoreOriginalValue = function(ctrlDown) {\n return this.closeEditor(true, ctrlDown);\n };\n\n /**\n * Destroy the instance.\n */\n this.destroy = function() {\n destroyed = true;\n };\n\n init();\n}\n\nconst instances = new WeakMap();\n\nEditorManager.getInstance = function(hotInstance, hotSettings, selection, datamap) {\n let editorManager = instances.get(hotInstance);\n\n if (!editorManager) {\n editorManager = new EditorManager(hotInstance, hotSettings, selection, datamap);\n instances.set(hotInstance, editorManager);\n }\n\n return editorManager;\n};\n\nexport default EditorManager;\n\n\n\n// WEBPACK FOOTER //\n// ./src/editorManager.js","import {\n addClass,\n empty,\n fastInnerHTML,\n fastInnerText,\n getComputedStyle,\n getScrollbarWidth,\n hasClass,\n isChildOf,\n isInput,\n isOutsideInput\n} from './helpers/dom/element';\nimport {isChrome, isSafari} from './helpers/browser';\nimport EventManager from './eventManager';\nimport {stopPropagation, isImmediatePropagationStopped, isRightClick, isLeftClick} from './helpers/dom/event';\nimport Walkontable, {CellCoords} from './3rdparty/walkontable/src';\nimport {handleMouseEvent} from './selection/mouseEventHandler';\n\n/**\n * Handsontable TableView constructor\n * @param {Object} instance\n */\nfunction TableView(instance) {\n var that = this;\n\n this.eventManager = new EventManager(instance);\n this.instance = instance;\n this.settings = instance.getSettings();\n this.selectionMouseDown = false;\n\n var originalStyle = instance.rootElement.getAttribute('style');\n\n if (originalStyle) {\n instance.rootElement.setAttribute('data-originalstyle', originalStyle); // needed to retrieve original style in jsFiddle link generator in HT examples. may be removed in future versions\n }\n\n addClass(instance.rootElement, 'handsontable');\n\n var table = document.createElement('TABLE');\n addClass(table, 'htCore');\n\n if (instance.getSettings().tableClassName) {\n addClass(table, instance.getSettings().tableClassName);\n }\n this.THEAD = document.createElement('THEAD');\n table.appendChild(this.THEAD);\n this.TBODY = document.createElement('TBODY');\n table.appendChild(this.TBODY);\n\n instance.table = table;\n\n instance.container.insertBefore(table, instance.container.firstChild);\n\n this.eventManager.addEventListener(instance.rootElement, 'mousedown', function(event) {\n this.selectionMouseDown = true;\n\n if (!that.isTextSelectionAllowed(event.target)) {\n clearTextSelection();\n event.preventDefault();\n window.focus(); // make sure that window that contains HOT is active. Important when HOT is in iframe.\n }\n });\n this.eventManager.addEventListener(instance.rootElement, 'mouseup', function(event) {\n this.selectionMouseDown = false;\n });\n this.eventManager.addEventListener(instance.rootElement, 'mousemove', function(event) {\n if (this.selectionMouseDown && !that.isTextSelectionAllowed(event.target)) {\n clearTextSelection();\n event.preventDefault();\n }\n });\n\n this.eventManager.addEventListener(document.documentElement, 'keyup', function(event) {\n if (instance.selection.isInProgress() && !event.shiftKey) {\n instance.selection.finish();\n }\n });\n\n var isMouseDown;\n this.isMouseDown = function() {\n return isMouseDown;\n };\n\n this.eventManager.addEventListener(document.documentElement, 'mouseup', function(event) {\n if (instance.selection.isInProgress() && isLeftClick(event)) { // is left mouse button\n instance.selection.finish();\n }\n\n isMouseDown = false;\n\n if (isOutsideInput(document.activeElement) || (!instance.selection.isSelected() && !isRightClick(event))) {\n instance.unlisten();\n }\n });\n\n this.eventManager.addEventListener(document.documentElement, 'mousedown', function(event) {\n var originalTarget = event.target;\n var next = event.target;\n var eventX = event.x || event.clientX;\n var eventY = event.y || event.clientY;\n\n if (isMouseDown || !instance.rootElement) {\n return; // it must have been started in a cell\n }\n\n // immediate click on \"holder\" means click on the right side of vertical scrollbar\n if (next === instance.view.wt.wtTable.holder) {\n var scrollbarWidth = getScrollbarWidth();\n\n if (document.elementFromPoint(eventX + scrollbarWidth, eventY) !== instance.view.wt.wtTable.holder ||\n document.elementFromPoint(eventX, eventY + scrollbarWidth) !== instance.view.wt.wtTable.holder) {\n return;\n }\n } else {\n while (next !== document.documentElement) {\n if (next === null) {\n if (event.isTargetWebComponent) {\n break;\n }\n // click on something that was a row but now is detached (possibly because your click triggered a rerender)\n return;\n }\n if (next === instance.rootElement) {\n // click inside container\n return;\n }\n next = next.parentNode;\n }\n }\n\n // function did not return until here, we have an outside click!\n\n var outsideClickDeselects = typeof that.settings.outsideClickDeselects === 'function' ?\n that.settings.outsideClickDeselects(originalTarget) :\n that.settings.outsideClickDeselects;\n\n if (outsideClickDeselects) {\n instance.deselectCell();\n } else {\n instance.destroyEditor();\n }\n });\n\n this.eventManager.addEventListener(table, 'selectstart', function(event) {\n if (that.settings.fragmentSelection || isInput(event.target)) {\n return;\n }\n // https://github.com/handsontable/handsontable/issues/160\n // Prevent text from being selected when performing drag down.\n event.preventDefault();\n });\n\n var clearTextSelection = function() {\n // http://stackoverflow.com/questions/3169786/clear-text-selection-with-javascript\n if (window.getSelection) {\n if (window.getSelection().empty) { // Chrome\n window.getSelection().empty();\n } else if (window.getSelection().removeAllRanges) { // Firefox\n window.getSelection().removeAllRanges();\n }\n } else if (document.selection) { // IE?\n document.selection.empty();\n }\n };\n\n var walkontableConfig = {\n debug: function() {\n return that.settings.debug;\n },\n externalRowCalculator: this.instance.getPlugin('autoRowSize') && this.instance.getPlugin('autoRowSize').isEnabled(),\n table: table,\n preventOverflow: () => this.settings.preventOverflow,\n stretchH: function() {\n return that.settings.stretchH;\n },\n data: instance.getDataAtCell,\n totalRows: () => instance.countRows(),\n totalColumns: () => instance.countCols(),\n fixedColumnsLeft: function() {\n return that.settings.fixedColumnsLeft;\n },\n fixedRowsTop: function() {\n return that.settings.fixedRowsTop;\n },\n fixedRowsBottom: function() {\n return that.settings.fixedRowsBottom;\n },\n minSpareRows: function() {\n return that.settings.minSpareRows;\n },\n renderAllRows: that.settings.renderAllRows,\n rowHeaders: function() {\n let headerRenderers = [];\n\n if (instance.hasRowHeaders()) {\n headerRenderers.push(function(row, TH) {\n that.appendRowHeader(row, TH);\n });\n }\n instance.runHooks('afterGetRowHeaderRenderers', headerRenderers);\n\n return headerRenderers;\n },\n columnHeaders: function() {\n let headerRenderers = [];\n\n if (instance.hasColHeaders()) {\n headerRenderers.push(function(column, TH) {\n that.appendColHeader(column, TH);\n });\n }\n\n instance.runHooks('afterGetColumnHeaderRenderers', headerRenderers);\n\n return headerRenderers;\n },\n columnWidth: instance.getColWidth,\n rowHeight: instance.getRowHeight,\n cellRenderer: function(row, col, TD) {\n const cellProperties = that.instance.getCellMeta(row, col);\n const prop = that.instance.colToProp(col);\n let value = that.instance.getDataAtRowProp(row, prop);\n\n if (that.instance.hasHook('beforeValueRender')) {\n value = that.instance.runHooks('beforeValueRender', value, cellProperties);\n }\n\n that.instance.runHooks('beforeRenderer', TD, row, col, prop, value, cellProperties);\n that.instance.getCellRenderer(cellProperties)(that.instance, TD, row, col, prop, value, cellProperties);\n that.instance.runHooks('afterRenderer', TD, row, col, prop, value, cellProperties);\n\n },\n selections: that.instance.selection.highlight,\n hideBorderOnMouseDownOver: function() {\n return that.settings.fragmentSelection;\n },\n onCellMouseDown: function(event, coords, TD, wt) {\n const blockCalculations = {\n row: false,\n column: false,\n cell: false\n };\n\n instance.listen();\n\n that.activeWt = wt;\n isMouseDown = true;\n\n instance.runHooks('beforeOnCellMouseDown', event, coords, TD, blockCalculations);\n\n if (isImmediatePropagationStopped(event)) {\n return;\n }\n\n handleMouseEvent(event, {\n coords,\n selection: instance.selection,\n controller: blockCalculations,\n });\n\n instance.runHooks('afterOnCellMouseDown', event, coords, TD);\n that.activeWt = that.wt;\n },\n onCellMouseOut: function(event, coords, TD, wt) {\n that.activeWt = wt;\n instance.runHooks('beforeOnCellMouseOut', event, coords, TD);\n\n if (isImmediatePropagationStopped(event)) {\n return;\n }\n\n instance.runHooks('afterOnCellMouseOut', event, coords, TD);\n that.activeWt = that.wt;\n },\n onCellMouseOver: function(event, coords, TD, wt) {\n const blockCalculations = {\n row: false,\n column: false,\n cell: false\n };\n\n that.activeWt = wt;\n\n instance.runHooks('beforeOnCellMouseOver', event, coords, TD, blockCalculations);\n\n if (isImmediatePropagationStopped(event)) {\n return;\n }\n\n if (isMouseDown) {\n handleMouseEvent(event, {\n coords,\n selection: instance.selection,\n controller: blockCalculations,\n });\n }\n\n instance.runHooks('afterOnCellMouseOver', event, coords, TD);\n that.activeWt = that.wt;\n },\n onCellMouseUp: function(event, coords, TD, wt) {\n that.activeWt = wt;\n instance.runHooks('beforeOnCellMouseUp', event, coords, TD);\n\n instance.runHooks('afterOnCellMouseUp', event, coords, TD);\n that.activeWt = that.wt;\n },\n onCellCornerMouseDown: function(event) {\n event.preventDefault();\n instance.runHooks('afterOnCellCornerMouseDown', event);\n },\n onCellCornerDblClick: function(event) {\n event.preventDefault();\n instance.runHooks('afterOnCellCornerDblClick', event);\n },\n beforeDraw: function(force, skipRender) {\n that.beforeRender(force, skipRender);\n },\n onDraw: function(force) {\n that.onDraw(force);\n },\n onScrollVertically: function() {\n instance.runHooks('afterScrollVertically');\n },\n onScrollHorizontally: function() {\n instance.runHooks('afterScrollHorizontally');\n },\n onBeforeRemoveCellClassNames: function() {\n return instance.runHooks('beforeRemoveCellClassNames');\n },\n onAfterDrawSelection: function(currentRow, currentColumn, cornersOfSelection, layerLevel) {\n return instance.runHooks('afterDrawSelection', currentRow, currentColumn, cornersOfSelection, layerLevel);\n },\n onBeforeDrawBorders: function(corners, borderClassName) {\n instance.runHooks('beforeDrawBorders', corners, borderClassName);\n },\n onBeforeTouchScroll: function() {\n instance.runHooks('beforeTouchScroll');\n },\n onAfterMomentumScroll: function() {\n instance.runHooks('afterMomentumScroll');\n },\n onBeforeStretchingColumnWidth: function(stretchedWidth, column) {\n return instance.runHooks('beforeStretchingColumnWidth', stretchedWidth, column);\n },\n onModifyRowHeaderWidth: function(rowHeaderWidth) {\n return instance.runHooks('modifyRowHeaderWidth', rowHeaderWidth);\n },\n onModifyGetCellCoords: function(row, column, topmost) {\n return instance.runHooks('modifyGetCellCoords', row, column, topmost);\n },\n viewportRowCalculatorOverride: function(calc) {\n let rows = instance.countRows();\n let viewportOffset = that.settings.viewportRowRenderingOffset;\n\n if (viewportOffset === 'auto' && that.settings.fixedRowsTop) {\n viewportOffset = 10;\n }\n if (typeof viewportOffset === 'number') {\n calc.startRow = Math.max(calc.startRow - viewportOffset, 0);\n calc.endRow = Math.min(calc.endRow + viewportOffset, rows - 1);\n }\n if (viewportOffset === 'auto') {\n let center = calc.startRow + calc.endRow - calc.startRow;\n let offset = Math.ceil(center / rows * 12);\n\n calc.startRow = Math.max(calc.startRow - offset, 0);\n calc.endRow = Math.min(calc.endRow + offset, rows - 1);\n }\n instance.runHooks('afterViewportRowCalculatorOverride', calc);\n },\n viewportColumnCalculatorOverride: function(calc) {\n let cols = instance.countCols();\n let viewportOffset = that.settings.viewportColumnRenderingOffset;\n\n if (viewportOffset === 'auto' && that.settings.fixedColumnsLeft) {\n viewportOffset = 10;\n }\n if (typeof viewportOffset === 'number') {\n calc.startColumn = Math.max(calc.startColumn - viewportOffset, 0);\n calc.endColumn = Math.min(calc.endColumn + viewportOffset, cols - 1);\n }\n if (viewportOffset === 'auto') {\n let center = calc.startColumn + calc.endColumn - calc.startColumn;\n let offset = Math.ceil(center / cols * 12);\n\n calc.startRow = Math.max(calc.startColumn - offset, 0);\n calc.endColumn = Math.min(calc.endColumn + offset, cols - 1);\n }\n instance.runHooks('afterViewportColumnCalculatorOverride', calc);\n },\n rowHeaderWidth: function() {\n return that.settings.rowHeaderWidth;\n },\n columnHeaderHeight: function() {\n const columnHeaderHeight = instance.runHooks('modifyColumnHeaderHeight');\n return that.settings.columnHeaderHeight || columnHeaderHeight;\n }\n };\n\n instance.runHooks('beforeInitWalkontable', walkontableConfig);\n\n this.wt = new Walkontable(walkontableConfig);\n this.activeWt = this.wt;\n\n this.eventManager.addEventListener(that.wt.wtTable.spreader, 'mousedown', function(event) {\n // right mouse button exactly on spreader means right click on the right hand side of vertical scrollbar\n if (event.target === that.wt.wtTable.spreader && event.which === 3) {\n stopPropagation(event);\n }\n });\n\n this.eventManager.addEventListener(that.wt.wtTable.spreader, 'contextmenu', function(event) {\n // right mouse button exactly on spreader means right click on the right hand side of vertical scrollbar\n if (event.target === that.wt.wtTable.spreader && event.which === 3) {\n stopPropagation(event);\n }\n });\n\n this.eventManager.addEventListener(document.documentElement, 'click', function() {\n if (that.settings.observeDOMVisibility) {\n if (that.wt.drawInterrupted) {\n that.instance.forceFullRender = true;\n that.render();\n }\n }\n });\n}\n\nTableView.prototype.isTextSelectionAllowed = function(el) {\n if (isInput(el)) {\n return true;\n }\n let isChildOfTableBody = isChildOf(el, this.instance.view.wt.wtTable.spreader);\n\n if (this.settings.fragmentSelection === true && isChildOfTableBody) {\n return true;\n }\n if (this.settings.fragmentSelection === 'cell' && this.isSelectedOnlyCell() && isChildOfTableBody) {\n return true;\n }\n if (!this.settings.fragmentSelection && this.isCellEdited() && this.isSelectedOnlyCell()) {\n return true;\n }\n\n return false;\n};\n\n/**\n * Check if selected only one cell.\n *\n * @returns {Boolean}\n */\nTableView.prototype.isSelectedOnlyCell = function() {\n var [row, col, rowEnd, colEnd] = this.instance.getSelectedLast() || [];\n\n return row !== void 0 && row === rowEnd && col === colEnd;\n};\n\nTableView.prototype.isCellEdited = function() {\n var activeEditor = this.instance.getActiveEditor();\n\n return activeEditor && activeEditor.isOpened();\n};\n\nTableView.prototype.beforeRender = function(force, skipRender) {\n if (force) {\n // this.instance.forceFullRender = did Handsontable request full render?\n this.instance.runHooks('beforeRender', this.instance.forceFullRender, skipRender);\n }\n};\n\nTableView.prototype.onDraw = function(force) {\n if (force) {\n // this.instance.forceFullRender = did Handsontable request full render?\n this.instance.runHooks('afterRender', this.instance.forceFullRender);\n }\n};\n\nTableView.prototype.render = function() {\n this.wt.draw(!this.instance.forceFullRender);\n this.instance.forceFullRender = false;\n this.instance.renderCall = false;\n};\n\n/**\n * Returns td object given coordinates\n *\n * @param {CellCoords} coords\n * @param {Boolean} topmost\n */\nTableView.prototype.getCellAtCoords = function(coords, topmost) {\n var td = this.wt.getCell(coords, topmost);\n\n if (td < 0) { // there was an exit code (cell is out of bounds)\n return null;\n }\n\n return td;\n};\n\n/**\n * Scroll viewport to selection.\n *\n * @param {CellCoords} coords\n */\nTableView.prototype.scrollViewport = function(coords) {\n this.wt.scrollViewport(coords);\n};\n\n/**\n * Append row header to a TH element\n * @param row\n * @param TH\n */\nTableView.prototype.appendRowHeader = function(row, TH) {\n if (TH.firstChild) {\n let container = TH.firstChild;\n\n if (!hasClass(container, 'relative')) {\n empty(TH);\n this.appendRowHeader(row, TH);\n\n return;\n }\n this.updateCellHeader(container.querySelector('.rowHeader'), row, this.instance.getRowHeader);\n\n } else {\n let div = document.createElement('div');\n let span = document.createElement('span');\n\n div.className = 'relative';\n span.className = 'rowHeader';\n this.updateCellHeader(span, row, this.instance.getRowHeader);\n\n div.appendChild(span);\n TH.appendChild(div);\n }\n\n this.instance.runHooks('afterGetRowHeader', row, TH);\n};\n\n/**\n * Append column header to a TH element\n * @param col\n * @param TH\n */\nTableView.prototype.appendColHeader = function(col, TH) {\n if (TH.firstChild) {\n let container = TH.firstChild;\n\n if (hasClass(container, 'relative')) {\n this.updateCellHeader(container.querySelector('.colHeader'), col, this.instance.getColHeader);\n } else {\n empty(TH);\n this.appendColHeader(col, TH);\n }\n\n } else {\n var div = document.createElement('div');\n let span = document.createElement('span');\n\n div.className = 'relative';\n span.className = 'colHeader';\n this.updateCellHeader(span, col, this.instance.getColHeader);\n\n div.appendChild(span);\n TH.appendChild(div);\n }\n\n this.instance.runHooks('afterGetColHeader', col, TH);\n};\n\n/**\n * Update header cell content\n *\n * @since 0.15.0-beta4\n * @param {HTMLElement} element Element to update\n * @param {Number} index Row index or column index\n * @param {Function} content Function which should be returns content for this cell\n */\nTableView.prototype.updateCellHeader = function(element, index, content) {\n let renderedIndex = index;\n let parentOverlay = this.wt.wtOverlays.getParentOverlay(element) || this.wt;\n\n // prevent wrong calculations from SampleGenerator\n if (element.parentNode) {\n if (hasClass(element, 'colHeader')) {\n renderedIndex = parentOverlay.wtTable.columnFilter.sourceToRendered(index);\n } else if (hasClass(element, 'rowHeader')) {\n renderedIndex = parentOverlay.wtTable.rowFilter.sourceToRendered(index);\n }\n }\n\n if (renderedIndex > -1) {\n fastInnerHTML(element, content(index));\n\n } else {\n // workaround for https://github.com/handsontable/handsontable/issues/1946\n fastInnerText(element, String.fromCharCode(160));\n addClass(element, 'cornerHeader');\n }\n};\n\n/**\n * Given a element's left position relative to the viewport, returns maximum element width until the right\n * edge of the viewport (before scrollbar)\n *\n * @param {Number} leftOffset\n * @return {Number}\n */\nTableView.prototype.maximumVisibleElementWidth = function(leftOffset) {\n var workspaceWidth = this.wt.wtViewport.getWorkspaceWidth();\n var maxWidth = workspaceWidth - leftOffset;\n return maxWidth > 0 ? maxWidth : 0;\n};\n\n/**\n * Given a element's top position relative to the viewport, returns maximum element height until the bottom\n * edge of the viewport (before scrollbar)\n *\n * @param {Number} topOffset\n * @return {Number}\n */\nTableView.prototype.maximumVisibleElementHeight = function(topOffset) {\n var workspaceHeight = this.wt.wtViewport.getWorkspaceHeight();\n var maxHeight = workspaceHeight - topOffset;\n return maxHeight > 0 ? maxHeight : 0;\n};\n\nTableView.prototype.mainViewIsActive = function() {\n return this.wt === this.activeWt;\n};\n\nTableView.prototype.destroy = function() {\n this.wt.destroy();\n this.eventManager.destroy();\n};\n\nexport default TableView;\n\n\n\n// WEBPACK FOOTER //\n// ./src/tableView.js","import {getProperty} from './helpers/object';\nimport {arrayEach} from './helpers/array';\nimport {rangeEach} from './helpers/number';\n\n/**\n * @class DataSource\n * @private\n */\nclass DataSource {\n constructor(hotInstance, dataSource = []) {\n /**\n * Instance of Handsontable.\n *\n * @type {Handsontable}\n */\n this.hot = hotInstance;\n /**\n * Data source\n *\n * @type {Array}\n */\n this.data = dataSource;\n /**\n * Type of data source.\n *\n * @type {String}\n * @default 'array'\n */\n this.dataType = 'array';\n\n this.colToProp = () => {};\n this.propToCol = () => {};\n }\n\n /**\n * Get all data.\n *\n * @param {Boolean} [toArray=false] If `true` return source data as an array of arrays even when source data was provided\n * in another format.\n * @returns {Array}\n */\n getData(toArray = false) {\n let result = this.data;\n\n if (toArray) {\n result = this.getByRange(\n {row: 0, col: 0},\n {row: Math.max(this.countRows() - 1, 0), col: Math.max(this.countColumns() - 1, 0)},\n true\n );\n }\n\n return result;\n }\n\n /**\n * Set new data source.\n *\n * @param data {Array}\n */\n setData(data) {\n this.data = data;\n }\n\n /**\n * Returns array of column values from the data source. `column` is the index of the row in the data source.\n *\n * @param {Number} column Visual column index.\n * @returns {Array}\n */\n getAtColumn(column) {\n let result = [];\n\n arrayEach(this.data, (row) => {\n let property = this.colToProp(column);\n\n if (typeof property === 'string') {\n row = getProperty(row, property);\n } else {\n row = row[property];\n }\n result.push(row);\n });\n\n return result;\n }\n\n /**\n * Returns a single row of the data (array or object, depending on what you have). `row` is the index of the row in the data source.\n *\n * @param {Number} row Physical row index.\n * @returns {Array|Object}\n */\n getAtRow(row) {\n return this.data[row];\n }\n\n /**\n * Returns a single value from the data.\n *\n * @param {Number} row Physical row index.\n * @param {Number} column Visual column index.\n * @returns {*}\n */\n getAtCell(row, column) {\n let result = null;\n\n let modifyRowData = this.hot.runHooks('modifyRowData', row);\n\n let dataRow = isNaN(modifyRowData) ? modifyRowData : this.data[row];\n\n if (dataRow) {\n let prop = this.colToProp(column);\n\n if (typeof prop === 'string') {\n result = getProperty(dataRow, prop);\n\n } else if (typeof prop === 'function') {\n result = prop(this.data.slice(row, row + 1)[0]);\n\n } else {\n result = dataRow[prop];\n }\n }\n\n return result;\n }\n\n /**\n * Returns source data by passed range.\n *\n * @param {Object} start Object with physical `row` and `col` keys (or visual column index, if data type is an array of objects).\n * @param {Object} end Object with physical `row` and `col` keys (or visual column index, if data type is an array of objects).\n * @param {Boolean} [toArray=false] If `true` return source data as an array of arrays even when source data was provided\n * in another format.\n * @returns {Array}\n */\n getByRange(start, end, toArray = false) {\n let startRow = Math.min(start.row, end.row);\n let startCol = Math.min(start.col, end.col);\n let endRow = Math.max(start.row, end.row);\n let endCol = Math.max(start.col, end.col);\n let result = [];\n\n rangeEach(startRow, endRow, (currentRow) => {\n let row = this.getAtRow(currentRow);\n let newRow;\n\n if (this.dataType === 'array') {\n newRow = row.slice(startCol, endCol + 1);\n\n } else if (this.dataType === 'object') {\n newRow = toArray ? [] : {};\n\n rangeEach(startCol, endCol, (column) => {\n let prop = this.colToProp(column);\n\n if (toArray) {\n newRow.push(row[prop]);\n } else {\n newRow[prop] = row[prop];\n }\n });\n }\n\n result.push(newRow);\n });\n\n return result;\n }\n\n /**\n * Count number of rows.\n *\n * @returns {Number}\n */\n countRows() {\n return Array.isArray(this.data) ? this.data.length : 0;\n }\n\n /**\n * Count number of columns.\n *\n * @returns {Number}\n */\n countColumns() {\n let result = 0;\n\n if (Array.isArray(this.data)) {\n if (this.dataType === 'array') {\n result = this.data[0].length;\n\n } else if (this.dataType === 'object') {\n result = Object.keys(this.data[0]).length;\n }\n }\n\n return result;\n }\n\n /**\n * Destroy instance.\n */\n destroy() {\n this.data = null;\n this.hot = null;\n }\n}\n\nexport default DataSource;\n\n\n\n// WEBPACK FOOTER //\n// ./src/dataSource.js","/**\n * @preserve\n * Authors: Handsoncode\n * Last updated: Nov 15, 2017\n *\n * Description: Definition file for English - United States language-country.\n */\nimport * as C from '../constants';\n\nconst dictionary = {\n languageCode: 'en-US',\n [C.CONTEXTMENU_ITEMS_ROW_ABOVE]: 'Insert row above',\n [C.CONTEXTMENU_ITEMS_ROW_BELOW]: 'Insert row below',\n [C.CONTEXTMENU_ITEMS_INSERT_LEFT]: 'Insert column left',\n [C.CONTEXTMENU_ITEMS_INSERT_RIGHT]: 'Insert column right',\n [C.CONTEXTMENU_ITEMS_REMOVE_ROW]: ['Remove row', 'Remove rows'],\n [C.CONTEXTMENU_ITEMS_REMOVE_COLUMN]: ['Remove column', 'Remove columns'],\n [C.CONTEXTMENU_ITEMS_UNDO]: 'Undo',\n [C.CONTEXTMENU_ITEMS_REDO]: 'Redo',\n [C.CONTEXTMENU_ITEMS_READ_ONLY]: 'Read only',\n [C.CONTEXTMENU_ITEMS_CLEAR_COLUMN]: 'Clear column',\n\n [C.CONTEXTMENU_ITEMS_ALIGNMENT]: 'Alignment',\n [C.CONTEXTMENU_ITEMS_ALIGNMENT_LEFT]: 'Left',\n [C.CONTEXTMENU_ITEMS_ALIGNMENT_CENTER]: 'Center',\n [C.CONTEXTMENU_ITEMS_ALIGNMENT_RIGHT]: 'Right',\n [C.CONTEXTMENU_ITEMS_ALIGNMENT_JUSTIFY]: 'Justify',\n [C.CONTEXTMENU_ITEMS_ALIGNMENT_TOP]: 'Top',\n [C.CONTEXTMENU_ITEMS_ALIGNMENT_MIDDLE]: 'Middle',\n [C.CONTEXTMENU_ITEMS_ALIGNMENT_BOTTOM]: 'Bottom',\n\n [C.CONTEXTMENU_ITEMS_FREEZE_COLUMN]: 'Freeze column',\n [C.CONTEXTMENU_ITEMS_UNFREEZE_COLUMN]: 'Unfreeze column',\n\n [C.CONTEXTMENU_ITEMS_BORDERS]: 'Borders',\n [C.CONTEXTMENU_ITEMS_BORDERS_TOP]: 'Top',\n [C.CONTEXTMENU_ITEMS_BORDERS_RIGHT]: 'Right',\n [C.CONTEXTMENU_ITEMS_BORDERS_BOTTOM]: 'Bottom',\n [C.CONTEXTMENU_ITEMS_BORDERS_LEFT]: 'Left',\n [C.CONTEXTMENU_ITEMS_REMOVE_BORDERS]: 'Remove border(s)',\n\n [C.CONTEXTMENU_ITEMS_ADD_COMMENT]: 'Add comment',\n [C.CONTEXTMENU_ITEMS_EDIT_COMMENT]: 'Edit comment',\n [C.CONTEXTMENU_ITEMS_REMOVE_COMMENT]: 'Delete comment',\n [C.CONTEXTMENU_ITEMS_READ_ONLY_COMMENT]: 'Read-only comment',\n\n [C.CONTEXTMENU_ITEMS_MERGE_CELLS]: 'Merge cells',\n [C.CONTEXTMENU_ITEMS_UNMERGE_CELLS]: 'Unmerge cells',\n\n [C.CONTEXTMENU_ITEMS_COPY]: 'Copy',\n [C.CONTEXTMENU_ITEMS_CUT]: 'Cut',\n\n [C.CONTEXTMENU_ITEMS_NESTED_ROWS_INSERT_CHILD]: 'Insert child row',\n [C.CONTEXTMENU_ITEMS_NESTED_ROWS_DETACH_CHILD]: 'Detach from parent',\n\n [C.CONTEXTMENU_ITEMS_HIDE_COLUMN]: ['Hide column', 'Hide columns'],\n [C.CONTEXTMENU_ITEMS_SHOW_COLUMN]: ['Show column', 'Show columns'],\n\n [C.CONTEXTMENU_ITEMS_HIDE_ROW]: ['Hide row', 'Hide rows'],\n [C.CONTEXTMENU_ITEMS_SHOW_ROW]: ['Show row', 'Show rows'],\n\n [C.FILTERS_CONDITIONS_NONE]: 'None',\n [C.FILTERS_CONDITIONS_EMPTY]: 'Is empty',\n [C.FILTERS_CONDITIONS_NOT_EMPTY]: 'Is not empty',\n [C.FILTERS_CONDITIONS_EQUAL]: 'Is equal to',\n [C.FILTERS_CONDITIONS_NOT_EQUAL]: 'Is not equal to',\n [C.FILTERS_CONDITIONS_BEGINS_WITH]: 'Begins with',\n [C.FILTERS_CONDITIONS_ENDS_WITH]: 'Ends with',\n [C.FILTERS_CONDITIONS_CONTAINS]: 'Contains',\n [C.FILTERS_CONDITIONS_NOT_CONTAIN]: 'Does not contain',\n [C.FILTERS_CONDITIONS_GREATER_THAN]: 'Greater than',\n [C.FILTERS_CONDITIONS_GREATER_THAN_OR_EQUAL]: 'Greater than or equal to',\n [C.FILTERS_CONDITIONS_LESS_THAN]: 'Less than',\n [C.FILTERS_CONDITIONS_LESS_THAN_OR_EQUAL]: 'Less than or equal to',\n [C.FILTERS_CONDITIONS_BETWEEN]: 'Is between',\n [C.FILTERS_CONDITIONS_NOT_BETWEEN]: 'Is not between',\n [C.FILTERS_CONDITIONS_AFTER]: 'After',\n [C.FILTERS_CONDITIONS_BEFORE]: 'Before',\n [C.FILTERS_CONDITIONS_TODAY]: 'Today',\n [C.FILTERS_CONDITIONS_TOMORROW]: 'Tomorrow',\n [C.FILTERS_CONDITIONS_YESTERDAY]: 'Yesterday',\n\n [C.FILTERS_VALUES_BLANK_CELLS]: 'Blank cells',\n\n [C.FILTERS_DIVS_FILTER_BY_CONDITION]: 'Filter by condition',\n [C.FILTERS_DIVS_FILTER_BY_VALUE]: 'Filter by value',\n\n [C.FILTERS_LABELS_CONJUNCTION]: 'And',\n [C.FILTERS_LABELS_DISJUNCTION]: 'Or',\n\n [C.FILTERS_BUTTONS_SELECT_ALL]: 'Select all',\n [C.FILTERS_BUTTONS_CLEAR]: 'Clear',\n [C.FILTERS_BUTTONS_OK]: 'OK',\n [C.FILTERS_BUTTONS_CANCEL]: 'Cancel',\n\n [C.FILTERS_BUTTONS_PLACEHOLDER_SEARCH]: 'Search',\n [C.FILTERS_BUTTONS_PLACEHOLDER_VALUE]: 'Value',\n [C.FILTERS_BUTTONS_PLACEHOLDER_SECOND_VALUE]: 'Second value'\n};\n\nexport default dictionary;\n\n\n\n// WEBPACK FOOTER //\n// ./src/i18n/languages/en-US.js","import staticRegister from './../../utils/staticRegister';\nimport pluralizeFn from './pluralize';\n\nconst {\n register: registerGloballyPhraseFormatter,\n getValues: getGlobalPhraseFormatters,\n} = staticRegister('phraseFormatters');\n\n/**\n * Register phrase formatter.\n *\n * @param {String} name Name of formatter.\n * @param {Function} formatterFn Function which will be applied on phrase propositions. It will transform them if it's possible.\n */\nexport function register(name, formatterFn) {\n registerGloballyPhraseFormatter(name, formatterFn);\n}\n\n/**\n * Get all registered previously formatters.\n *\n * @returns {Array}\n */\nexport function getAll() {\n return getGlobalPhraseFormatters();\n}\n\nexport {\n register as registerPhraseFormatter,\n getAll as getPhraseFormatters\n};\n\nregister('pluralize', pluralizeFn);\n\n\n\n// WEBPACK FOOTER //\n// ./src/i18n/phraseFormatters/index.js","/**\n * Try to choose plural form from available phrase propositions.\n *\n * @param {Array} phrasePropositions List of phrases propositions.\n * @param {number} pluralForm Number determining which phrase form should be used.\n *\n * @returns {String|Array} One particular phrase if it's possible, list of unchanged phrase propositions otherwise.\n */\nexport default function pluralize(phrasePropositions, pluralForm) {\n const isPluralizable = Array.isArray(phrasePropositions) && Number.isInteger(pluralForm);\n\n if (isPluralizable) {\n return phrasePropositions[pluralForm];\n }\n\n return phrasePropositions;\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/i18n/phraseFormatters/pluralize.js","import Highlight from './highlight/highlight';\nimport Selection from './selection';\nimport {handleMouseEvent} from './mouseEventHandler';\n\nexport {\n handleMouseEvent,\n Highlight,\n Selection,\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/selection/index.js","/* eslint-disable import/prefer-default-export */\nimport staticRegister from './../../../utils/staticRegister';\n\nimport activeHeaderHighlight from './activeHeader';\nimport areaHighlight from './area';\nimport cellHighlight from './cell';\nimport fillHighlight from './fill';\nimport headerHighlight from './header';\n\nconst {\n register,\n getItem,\n} = staticRegister('highlight/types');\n\nregister('active-header', activeHeaderHighlight);\nregister('area', areaHighlight);\nregister('cell', cellHighlight);\nregister('fill', fillHighlight);\nregister('header', headerHighlight);\n\nfunction createHighlight(highlightType, options) {\n return getItem(highlightType)(options);\n}\n\nexport {\n createHighlight,\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/selection/highlight/types/index.js","import {Selection} from './../../../3rdparty/walkontable/src';\n\n/**\n * @return {Selection}\n */\nfunction createHighlight({activeHeaderClassName}) {\n const s = new Selection({\n highlightHeaderClassName: activeHeaderClassName,\n });\n\n return s;\n}\n\nexport default createHighlight;\n\n\n\n// WEBPACK FOOTER //\n// ./src/selection/highlight/types/activeHeader.js","import {Selection} from './../../../3rdparty/walkontable/src';\n\n/**\n * Creates the new instance of Selection responsible for highlighting area of the selected multiple cells.\n *\n * @return {Selection}\n */\nfunction createHighlight({layerLevel, areaCornerVisible}) {\n const s = new Selection({\n className: 'area',\n markIntersections: true,\n layerLevel: Math.min(layerLevel, 7),\n border: {\n width: 1,\n color: '#4b89ff',\n cornerVisible: areaCornerVisible,\n },\n });\n\n return s;\n}\n\nexport default createHighlight;\n\n\n\n// WEBPACK FOOTER //\n// ./src/selection/highlight/types/area.js","import {Selection} from './../../../3rdparty/walkontable/src';\n\n/**\n * Creates the new instance of Selection responsible for highlighting currently selected cell. This type of selection\n * can present on the table only one at the time.\n *\n * @return {Selection}\n */\nfunction createHighlight({cellCornerVisible}) {\n const s = new Selection({\n className: 'current',\n border: {\n width: 2,\n color: '#4b89ff',\n cornerVisible: cellCornerVisible,\n },\n });\n\n return s;\n}\n\nexport default createHighlight;\n\n\n\n// WEBPACK FOOTER //\n// ./src/selection/highlight/types/cell.js","import {Selection} from './../../../3rdparty/walkontable/src';\n\n/**\n * Creates the new instance of Selection, responsible for highlighting cells which are covered by fill handle\n * functionality. This type of selection can present on the table only one at the time.\n *\n * @return {Selection}\n */\nfunction createHighlight() {\n const s = new Selection({\n className: 'fill',\n border: {\n width: 1,\n color: '#ff0000',\n },\n });\n\n return s;\n}\n\nexport default createHighlight;\n\n\n\n// WEBPACK FOOTER //\n// ./src/selection/highlight/types/fill.js","import {Selection} from './../../../3rdparty/walkontable/src';\n\n/**\n * Creates the new instance of Selection, responsible for highlighting row and column headers. This type of selection\n * can occur multiple times.\n *\n * @return {Selection}\n */\nfunction createHighlight({headerClassName, rowClassName, columnClassName}) {\n const s = new Selection({\n className: 'highlight',\n highlightHeaderClassName: headerClassName,\n highlightRowClassName: rowClassName,\n highlightColumnClassName: columnClassName,\n });\n\n return s;\n}\n\nexport default createHighlight;\n\n\n\n// WEBPACK FOOTER //\n// ./src/selection/highlight/types/header.js","import Highlight, {AREA_TYPE, HEADER_TYPE, CELL_TYPE} from './highlight/highlight';\nimport SelectionRange from './range';\nimport {CellCoords} from './../3rdparty/walkontable/src';\nimport {isPressedCtrlKey} from './../utils/keyStateObserver';\nimport {createObjectPropListener, mixin} from './../helpers/object';\nimport {isUndefined} from './../helpers/mixed';\nimport {arrayEach} from './../helpers/array';\nimport localHooks from './../mixins/localHooks';\nimport Transformation from './transformation';\nimport {\n detectSelectionType,\n isValidCoord,\n normalizeSelectionFactory,\n SELECTION_TYPE_EMPTY,\n SELECTION_TYPE_UNRECOGNIZED,\n} from './utils';\nimport {toSingleLine} from './../helpers/templateLiteralTag';\n\n/**\n * @class Selection\n * @util\n */\nclass Selection {\n constructor(settings, tableProps) {\n /**\n * Handsontable settings instance.\n *\n * @type {GridSettings}\n */\n this.settings = settings;\n /**\n * An additional object with dynamically defined properties which describes table state.\n *\n * @type {Object}\n */\n this.tableProps = tableProps;\n /**\n * The flag which determines if the selection is in progress.\n *\n * @type {Boolean}\n */\n this.inProgress = false;\n /**\n * The flag indicates that selection was performed by clicking the corner overlay.\n *\n * @type {Boolean}\n */\n this.selectedByCorner = false;\n /**\n * The collection of the selection layer levels where the whole row was selected using the row header.\n *\n * @type {Set.<Number>}\n */\n this.selectedByRowHeader = new Set();\n /**\n * The collection of the selection layer levels where the whole column was selected using the column header.\n *\n * @type {Set.<Number>}\n */\n this.selectedByColumnHeader = new Set();\n /**\n * Selection data layer.\n *\n * @type {SelectionRange}\n */\n this.selectedRange = new SelectionRange();\n /**\n * Visualization layer.\n *\n * @type {Highlight}\n */\n this.highlight = new Highlight({\n headerClassName: settings.currentHeaderClassName,\n activeHeaderClassName: settings.activeHeaderClassName,\n rowClassName: settings.currentRowClassName,\n columnClassName: settings.currentColClassName,\n disableHighlight: this.settings.disableVisualSelection,\n cellCornerVisible: (...args) => this.isCellCornerVisible(...args),\n areaCornerVisible: (...args) => this.isAreaCornerVisible(...args),\n });\n /**\n * The module for modifying coordinates.\n *\n * @type {Transformation}\n */\n this.transformation = new Transformation(this.selectedRange, {\n countRows: () => this.tableProps.countRows(),\n countCols: () => this.tableProps.countCols(),\n fixedRowsBottom: () => settings.fixedRowsBottom,\n minSpareRows: () => settings.minSpareRows,\n minSpareCols: () => settings.minSpareCols,\n autoWrapRow: () => settings.autoWrapRow,\n autoWrapCol: () => settings.autoWrapCol,\n });\n\n this.transformation.addLocalHook('beforeTransformStart', (...args) => this.runLocalHooks('beforeModifyTransformStart', ...args));\n this.transformation.addLocalHook('afterTransformStart', (...args) => this.runLocalHooks('afterModifyTransformStart', ...args));\n this.transformation.addLocalHook('beforeTransformEnd', (...args) => this.runLocalHooks('beforeModifyTransformEnd', ...args));\n this.transformation.addLocalHook('afterTransformEnd', (...args) => this.runLocalHooks('afterModifyTransformEnd', ...args));\n this.transformation.addLocalHook('insertRowRequire', (...args) => this.runLocalHooks('insertRowRequire', ...args));\n this.transformation.addLocalHook('insertColRequire', (...args) => this.runLocalHooks('insertColRequire', ...args));\n }\n\n /**\n * Get data layer for current selection.\n *\n * @return {SelectionRange}\n */\n getSelectedRange() {\n return this.selectedRange;\n }\n\n /**\n * Indicate that selection process began. It sets internaly `.inProgress` property to `true`.\n */\n begin() {\n this.inProgress = true;\n }\n\n /**\n * Indicate that selection process finished. It sets internaly `.inProgress` property to `false`.\n */\n finish() {\n this.runLocalHooks('afterSelectionFinished', Array.from(this.selectedRange));\n this.inProgress = false;\n }\n\n /**\n * Check if the process of selecting the cell/cells is in progress.\n *\n * @returns {Boolean}\n */\n isInProgress() {\n return this.inProgress;\n }\n\n /**\n * Starts selection range on given coordinate object.\n *\n * @param {CellCoords} coords Visual coords.\n * @param {Boolean} [multipleSelection] If `true`, selection will be worked in 'multiple' mode. This option works\n * only when 'selectionMode' is set as 'multiple'. If the argument is not defined\n * the default trigger will be used (isPressedCtrlKey() helper).\n * @param {Boolean} [fragment=false] If `true`, the selection will be treated as a partial selection where the\n * `setRangeEnd` method won't be called on every `setRangeStart` call.\n */\n setRangeStart(coords, multipleSelection, fragment = false) {\n const isMultipleMode = this.settings.selectionMode === 'multiple';\n const isMultipleSelection = isUndefined(multipleSelection) ? isPressedCtrlKey() : multipleSelection;\n const isRowNegative = coords.row < 0;\n const isColumnNegative = coords.col < 0;\n const selectedByCorner = isRowNegative && isColumnNegative;\n\n if (isRowNegative) {\n coords.row = 0;\n }\n if (isColumnNegative) {\n coords.col = 0;\n }\n\n this.selectedByCorner = selectedByCorner;\n this.runLocalHooks(`beforeSetRangeStart${fragment ? 'Only' : ''}`, coords);\n\n if (!isMultipleMode || (isMultipleMode && !isMultipleSelection && isUndefined(multipleSelection))) {\n this.selectedRange.clear();\n }\n\n this.selectedRange.add(coords);\n\n if (this.getLayerLevel() === 0) {\n this.selectedByRowHeader.clear();\n this.selectedByColumnHeader.clear();\n }\n\n if (!selectedByCorner && isColumnNegative) {\n this.selectedByRowHeader.add(this.getLayerLevel());\n }\n if (!selectedByCorner && isRowNegative) {\n this.selectedByColumnHeader.add(this.getLayerLevel());\n }\n\n if (!fragment) {\n this.setRangeEnd(coords);\n }\n }\n\n /**\n * Starts selection range on given coordinate object.\n *\n * @param {CellCoords} coords Visual coords.\n * @param {Boolean} [multipleSelection] If `true`, selection will be worked in 'multiple' mode. This option works\n * only when 'selectionMode' is set as 'multiple'. If the argument is not defined\n * the default trigger will be used (isPressedCtrlKey() helper).\n */\n setRangeStartOnly(coords, multipleSelection) {\n this.setRangeStart(coords, multipleSelection, true);\n }\n\n /**\n * Ends selection range on given coordinate object.\n *\n * @param {CellCoords} coords Visual coords.\n */\n setRangeEnd(coords) {\n if (this.selectedRange.isEmpty()) {\n return;\n }\n\n this.runLocalHooks('beforeSetRangeEnd', coords);\n this.begin();\n\n const cellRange = this.selectedRange.current();\n\n if (this.settings.selectionMode !== 'single') {\n cellRange.setTo(new CellCoords(coords.row, coords.col));\n }\n\n // Set up current selection.\n this.highlight.getCell().clear();\n\n if (this.highlight.isEnabledFor(CELL_TYPE)) {\n this.highlight.getCell().add(this.selectedRange.current().highlight);\n }\n\n const layerLevel = this.getLayerLevel();\n\n // If the next layer level is lower than previous then clear all area and header highlights. This is the\n // indication that the new selection is performing.\n if (layerLevel < this.highlight.layerLevel) {\n arrayEach(this.highlight.getAreas(), (highlight) => void highlight.clear());\n arrayEach(this.highlight.getHeaders(), (highlight) => void highlight.clear());\n arrayEach(this.highlight.getActiveHeaders(), (highlight) => void highlight.clear());\n }\n\n this.highlight.useLayerLevel(layerLevel);\n\n const areaHighlight = this.highlight.createOrGetArea();\n const headerHighlight = this.highlight.createOrGetHeader();\n const activeHeaderHighlight = this.highlight.createOrGetActiveHeader();\n\n areaHighlight.clear();\n headerHighlight.clear();\n activeHeaderHighlight.clear();\n\n if (this.highlight.isEnabledFor(AREA_TYPE) && (this.isMultiple() || layerLevel >= 1)) {\n areaHighlight\n .add(cellRange.from)\n .add(cellRange.to);\n\n if (layerLevel === 1) {\n // For single cell selection in the same layer, we do not create area selection to prevent blue background.\n // When non-consecutive selection is performed we have to add that missing area selection to the previous layer\n // based on previous coordinates. It only occurs when the previous selection wasn't select multiple cells.\n this.highlight\n .useLayerLevel(layerLevel - 1)\n .createOrGetArea()\n .add(this.selectedRange.previous().from);\n\n this.highlight.useLayerLevel(layerLevel);\n }\n }\n\n if (this.highlight.isEnabledFor(HEADER_TYPE)) {\n if (this.settings.selectionMode === 'single') {\n headerHighlight.add(cellRange.highlight);\n\n } else {\n headerHighlight\n .add(cellRange.from)\n .add(cellRange.to);\n }\n }\n\n if (this.isSelectedByRowHeader()) {\n const isRowSelected = this.tableProps.countCols() === cellRange.getWidth();\n\n // Make sure that the whole row is selected (in case where selectionMode is set to 'single')\n if (isRowSelected) {\n activeHeaderHighlight\n .add(new CellCoords(cellRange.from.row, -1))\n .add(new CellCoords(cellRange.to.row, -1));\n }\n }\n\n if (this.isSelectedByColumnHeader()) {\n const isColumnSelected = this.tableProps.countRows() === cellRange.getHeight();\n\n // Make sure that the whole column is selected (in case where selectionMode is set to 'single')\n if (isColumnSelected) {\n activeHeaderHighlight\n .add(new CellCoords(-1, cellRange.from.col))\n .add(new CellCoords(-1, cellRange.to.col));\n }\n }\n\n this.runLocalHooks('afterSetRangeEnd', coords);\n }\n\n /**\n * Returns information if we have a multiselection. This method check multiselection only on the latest layer of\n * the selection.\n *\n * @returns {Boolean}\n */\n isMultiple() {\n const isMultipleListener = createObjectPropListener(!this.selectedRange.current().isSingle());\n\n this.runLocalHooks('afterIsMultipleSelection', isMultipleListener);\n\n return isMultipleListener.value;\n }\n\n /**\n * Selects cell relative to the current cell (if possible).\n *\n * @param {Number} rowDelta Rows number to move, value can be passed as negative number.\n * @param {Number} colDelta Columns number to move, value can be passed as negative number.\n * @param {Boolean} force If `true` the new rows/columns will be created if necessary. Otherwise, row/column will\n * be created according to `minSpareRows/minSpareCols` settings of Handsontable.\n */\n transformStart(rowDelta, colDelta, force) {\n this.setRangeStart(this.transformation.transformStart(rowDelta, colDelta, force));\n }\n\n /**\n * Sets selection end cell relative to the current selection end cell (if possible).\n *\n * @param {Number} rowDelta Rows number to move, value can be passed as negative number.\n * @param {Number} colDelta Columns number to move, value can be passed as negative number.\n */\n transformEnd(rowDelta, colDelta) {\n this.setRangeEnd(this.transformation.transformEnd(rowDelta, colDelta));\n }\n\n /**\n * Returns currently used layer level.\n *\n * @return {Number} Returns layer level starting from 0. If no selection was added to the table -1 is returned.\n */\n getLayerLevel() {\n return this.selectedRange.size() - 1;\n }\n\n /**\n * Returns `true` if currently there is a selection on the screen, `false` otherwise.\n *\n * @returns {Boolean}\n */\n isSelected() {\n return !this.selectedRange.isEmpty();\n }\n\n /**\n * Returns `true` if the selection was applied by clicking to the row header. If the `layerLevel`\n * argument is passed then only that layer will be checked. Otherwise, it checks if any row header\n * was clicked on any selection layer level.\n *\n * @param {Number} [layerLevel=this.getLayerLevel()] Selection layer level to check.\n * @return {Boolean}\n */\n isSelectedByRowHeader(layerLevel = this.getLayerLevel()) {\n return layerLevel === -1 ? this.selectedByRowHeader.size > 0 : this.selectedByRowHeader.has(layerLevel);\n }\n\n /**\n * Returns `true` if the selection was applied by clicking to the column header. If the `layerLevel`\n * argument is passed then only that layer will be checked. Otherwise, it checks if any column header\n * was clicked on any selection layer level.\n *\n * @param {Number} [layerLevel=this.getLayerLevel()] Selection layer level to check.\n * @return {Boolean}\n */\n isSelectedByColumnHeader(layerLevel = this.getLayerLevel()) {\n return layerLevel === -1 ? this.selectedByColumnHeader.size > 0 : this.selectedByColumnHeader.has(layerLevel);\n }\n\n /**\n * Returns `true` if the selection was applied by clicking on the row or column header on any layer level.\n *\n * @return {Boolean}\n */\n isSelectedByAnyHeader() {\n return this.isSelectedByRowHeader(-1) || this.isSelectedByColumnHeader(-1);\n }\n\n /**\n * Returns `true` if the selection was applied by clicking on the left-top corner overlay.\n *\n * @return {Boolean}\n */\n isSelectedByCorner() {\n return this.selectedByCorner;\n }\n\n /**\n * Returns `true` if coords is within selection coords. This method iterates through all selection layers to check if\n * the coords object is within selection range.\n *\n * @param {CellCoords} coords The CellCoords instance with defined visual coordinates.\n * @returns {Boolean}\n */\n inInSelection(coords) {\n return this.selectedRange.includes(coords);\n }\n\n /**\n * Returns `true` if the cell corner should be visible.\n *\n * @private\n * @return {Boolean} `true` if the corner element has to be visible, `false` otherwise.\n */\n isCellCornerVisible() {\n return this.settings.fillHandle && !this.tableProps.isEditorOpened() && !this.isMultiple();\n }\n\n /**\n * Returns `true` if the area corner should be visible.\n *\n * @param {Number} layerLevel The layer level.\n * @return {Boolean} `true` if the corner element has to be visible, `false` otherwise.\n */\n isAreaCornerVisible(layerLevel) {\n if (Number.isInteger(layerLevel) && layerLevel !== this.getLayerLevel()) {\n return false;\n }\n\n return this.settings.fillHandle && !this.tableProps.isEditorOpened() && this.isMultiple();\n }\n\n /**\n * Clear the selection by resetting the collected ranges and highlights.\n */\n clear() {\n this.selectedRange.clear();\n this.highlight.clear();\n }\n\n /**\n * Deselects all selected cells.\n */\n deselect() {\n if (!this.isSelected()) {\n return;\n }\n\n this.inProgress = false;\n this.clear();\n this.runLocalHooks('afterDeselect');\n }\n\n /**\n * Select all cells.\n */\n selectAll() {\n this.clear();\n this.setRangeStart(new CellCoords(-1, -1));\n this.selectedByRowHeader.add(this.getLayerLevel());\n this.selectedByColumnHeader.add(this.getLayerLevel());\n this.setRangeEnd(new CellCoords(this.tableProps.countRows() - 1, this.tableProps.countCols() - 1));\n }\n\n /**\n * Make multiple, non-contiguous selection specified by `row` and `column` values or a range of cells\n * finishing at `endRow`, `endColumn`. The method supports two input formats, first as an array of arrays such\n * as `[[rowStart, columnStart, rowEnd, columnEnd]]` and second format as an array of CellRange objects.\n * If the passed ranges have another format the exception will be thrown.\n *\n * @param {Array[]|CellRange[]} selectionRanges The coordinates which define what the cells should be selected.\n * @return {Boolean} Returns `true` if selection was successful, `false` otherwise.\n */\n selectCells(selectionRanges) {\n const selectionType = detectSelectionType(selectionRanges);\n\n if (selectionType === SELECTION_TYPE_EMPTY) {\n return false;\n\n } else if (selectionType === SELECTION_TYPE_UNRECOGNIZED) {\n throw new Error(toSingleLine`Unsupported format of the selection ranges was passed. To select cells pass\\x20\n the coordinates as an array of arrays ([[rowStart, columnStart/columnPropStart, rowEnd, columnEnd/columnPropEnd]])\\x20\n or as an array of CellRange objects.`);\n }\n\n const selectionSchemaNormalizer = normalizeSelectionFactory(selectionType, {\n propToCol: (prop) => this.tableProps.propToCol(prop),\n keepDirection: true,\n });\n const countRows = this.tableProps.countRows();\n const countCols = this.tableProps.countCols();\n\n // Check if every layer of the coordinates are valid.\n const isValid = !selectionRanges.some((selection) => {\n const [rowStart, columnStart, rowEnd, columnEnd] = selectionSchemaNormalizer(selection);\n const _isValid = isValidCoord(rowStart, countRows) &&\n isValidCoord(columnStart, countCols) &&\n isValidCoord(rowEnd, countRows) &&\n isValidCoord(columnEnd, countCols);\n\n return !_isValid;\n });\n\n if (isValid) {\n this.clear();\n\n arrayEach(selectionRanges, (selection) => {\n const [rowStart, columnStart, rowEnd, columnEnd] = selectionSchemaNormalizer(selection);\n\n this.setRangeStartOnly(new CellCoords(rowStart, columnStart), false);\n this.setRangeEnd(new CellCoords(rowEnd, columnEnd));\n this.finish();\n });\n }\n\n return isValid;\n }\n\n /**\n * Select column specified by `startColumn` visual index or column property or a range of columns finishing at `endColumn`.\n *\n * @param {Number|String} startColumn Visual column index or column property from which the selection starts.\n * @param {Number|String} [endColumn] Visual column index or column property from to the selection finishes.\n * @returns {Boolean} Returns `true` if selection was successful, `false` otherwise.\n */\n selectColumns(startColumn, endColumn = startColumn) {\n startColumn = typeof startColumn === 'string' ? this.tableProps.propToCol(startColumn) : startColumn;\n endColumn = typeof endColumn === 'string' ? this.tableProps.propToCol(endColumn) : endColumn;\n\n const countCols = this.tableProps.countCols();\n const isValid = isValidCoord(startColumn, countCols) && isValidCoord(endColumn, countCols);\n\n if (isValid) {\n this.setRangeStartOnly(new CellCoords(-1, startColumn));\n this.setRangeEnd(new CellCoords(this.tableProps.countRows() - 1, endColumn));\n this.finish();\n }\n\n return isValid;\n }\n\n /**\n * Select row specified by `startRow` visual index or a range of rows finishing at `endRow`.\n *\n * @param {Number} startRow Visual row index from which the selection starts.\n * @param {Number} [endRow] Visual row index from to the selection finishes.\n * @returns {Boolean} Returns `true` if selection was successful, `false` otherwise.\n */\n selectRows(startRow, endRow = startRow) {\n const countRows = this.tableProps.countRows();\n const isValid = isValidCoord(startRow, countRows) && isValidCoord(endRow, countRows);\n\n if (isValid) {\n this.setRangeStartOnly(new CellCoords(startRow, -1));\n this.setRangeEnd(new CellCoords(endRow, this.tableProps.countCols() - 1));\n this.finish();\n }\n\n return isValid;\n }\n}\n\nmixin(Selection, localHooks);\n\nexport default Selection;\n\n\n\n// WEBPACK FOOTER //\n// ./src/selection/selection.js","import {CellRange} from './../3rdparty/walkontable/src';\n\n/**\n * The SelectionRange class is a simple CellRanges collection designed for easy manipulation of the multiple\n * consecutive and non-consecutive selections.\n *\n * @class SelectionRange\n * @util\n */\nclass SelectionRange {\n constructor() {\n /**\n * List of all CellRanges added to the class instance.\n *\n * @type {CellRange[]}\n */\n this.ranges = [];\n }\n\n /**\n * Check if selected range is empty.\n *\n * @return {Boolean}\n */\n isEmpty() {\n return this.size() === 0;\n }\n\n /**\n * Set coordinates to the class instance. It clears all previously added coordinates and push `coords`\n * to the collection.\n *\n * @param {CellCoords} coords The CellCoords instance with defined visual coordinates.\n * @returns {SelectionRange}\n */\n set(coords) {\n this.clear();\n this.ranges.push(new CellRange(coords));\n\n return this;\n }\n\n /**\n * Add coordinates to the class instance. The new coordinates are added to the end of the range collection.\n *\n * @param {CellCoords} coords The CellCoords instance with defined visual coordinates.\n * @returns {SelectionRange}\n */\n add(coords) {\n this.ranges.push(new CellRange(coords));\n\n return this;\n }\n\n /**\n * Get last added coordinates from ranges, it returns a CellRange instance.\n *\n * @return {CellRange|undefined}\n */\n current() {\n return this.peekByIndex(0);\n }\n\n /**\n * Get previously added coordinates from ranges, it returns a CellRange instance.\n *\n * @return {CellRange|undefined}\n */\n previous() {\n return this.peekByIndex(-1);\n }\n\n /**\n * Returns `true` if coords is within selection coords. This method iterates through all selection layers to check if\n * the coords object is within selection range.\n *\n * @param {CellCoords} coords The CellCoords instance with defined visual coordinates.\n * @returns {Boolean}\n */\n includes(coords) {\n return this.ranges.some((cellRange) => cellRange.includes(coords));\n }\n\n /**\n * Clear collection.\n *\n * @return {SelectionRange}\n */\n clear() {\n this.ranges.length = 0;\n\n return this;\n }\n\n /**\n * Get count of added all coordinates added to the selection.\n *\n * @return {Number}\n */\n size() {\n return this.ranges.length;\n }\n\n /**\n * Peek the coordinates based on the offset where that coordinate resides in the collection.\n *\n * @param {Number} [offset=0] An offset where the coordinate will be retrieved from.\n * @return {CellRange|undefined}\n */\n peekByIndex(offset = 0) {\n const rangeIndex = this.size() + offset - 1;\n let cellRange;\n\n if (rangeIndex >= 0) {\n cellRange = this.ranges[rangeIndex];\n }\n\n return cellRange;\n }\n\n [Symbol.iterator]() {\n return this.ranges[Symbol.iterator]();\n }\n}\n\nexport default SelectionRange;\n\n\n\n// WEBPACK FOOTER //\n// ./src/selection/range.js","import {CellCoords} from './../3rdparty/walkontable/src';\nimport {mixin} from './../helpers/object';\nimport localHooks from './../mixins/localHooks';\n\n/**\n * The Transformation class implements algorithms for transforming coordinates based on current settings\n * passed to the Handsontable.\n *\n * Transformation is always applied relative to the current selection.\n *\n * @class Transformation\n * @util\n */\nclass Transformation {\n constructor(range, options) {\n /**\n * Instance of the SelectionRange, holder for coordinates applied to the table.\n *\n * @type {SelectionRange}\n */\n this.range = range;\n /**\n * Additional options which define the state of the settings which can infer transformation.\n *\n * @type {Object}\n */\n this.options = options;\n }\n\n /**\n * Selects cell relative to current cell (if possible).\n *\n * @param {Number} rowDelta Rows number to move, value can be passed as negative number.\n * @param {Number} colDelta Columns number to move, value can be passed as negative number.\n * @param {Boolean} force If `true` the new rows/columns will be created if necessary. Otherwise, row/column will\n * be created according to `minSpareRows/minSpareCols` settings of Handsontable.\n * @returns {CellCoords}\n */\n transformStart(rowDelta, colDelta, force) {\n const delta = new CellCoords(rowDelta, colDelta);\n\n this.runLocalHooks('beforeTransformStart', delta);\n\n let totalRows = this.options.countRows();\n let totalCols = this.options.countCols();\n const fixedRowsBottom = this.options.fixedRowsBottom();\n const minSpareRows = this.options.minSpareRows();\n const minSpareCols = this.options.minSpareCols();\n const autoWrapRow = this.options.autoWrapRow();\n const autoWrapCol = this.options.autoWrapCol();\n const highlightCoords = this.range.current().highlight;\n\n if (highlightCoords.row + rowDelta > totalRows - 1) {\n if (force && minSpareRows > 0 && !(fixedRowsBottom && highlightCoords.row >= totalRows - fixedRowsBottom - 1)) {\n this.runLocalHooks('insertRowRequire', totalRows);\n totalRows = this.options.countRows();\n\n } else if (autoWrapCol) {\n delta.row = 1 - totalRows;\n delta.col = highlightCoords.col + delta.col == totalCols - 1 ? 1 - totalCols : 1;\n }\n } else if (autoWrapCol && highlightCoords.row + delta.row < 0 && highlightCoords.col + delta.col >= 0) {\n delta.row = totalRows - 1;\n delta.col = highlightCoords.col + delta.col == 0 ? totalCols - 1 : -1;\n }\n\n if (highlightCoords.col + delta.col > totalCols - 1) {\n if (force && minSpareCols > 0) {\n this.runLocalHooks('insertColRequire', totalRows);\n totalCols = this.options.countCols();\n\n } else if (autoWrapRow) {\n delta.row = highlightCoords.row + delta.row == totalRows - 1 ? 1 - totalRows : 1;\n delta.col = 1 - totalCols;\n }\n } else if (autoWrapRow && highlightCoords.col + delta.col < 0 && highlightCoords.row + delta.row >= 0) {\n delta.row = highlightCoords.row + delta.row == 0 ? totalRows - 1 : -1;\n delta.col = totalCols - 1;\n }\n\n const coords = new CellCoords(highlightCoords.row + delta.row, highlightCoords.col + delta.col);\n let rowTransformDir = 0;\n let colTransformDir = 0;\n\n if (coords.row < 0) {\n rowTransformDir = -1;\n coords.row = 0;\n\n } else if (coords.row > 0 && coords.row >= totalRows) {\n rowTransformDir = 1;\n coords.row = totalRows - 1;\n }\n\n if (coords.col < 0) {\n colTransformDir = -1;\n coords.col = 0;\n\n } else if (coords.col > 0 && coords.col >= totalCols) {\n colTransformDir = 1;\n coords.col = totalCols - 1;\n }\n this.runLocalHooks('afterTransformStart', coords, rowTransformDir, colTransformDir);\n\n return coords;\n }\n\n /**\n * Sets selection end cell relative to current selection end cell (if possible).\n *\n * @param {Number} rowDelta Rows number to move, value can be passed as negative number.\n * @param {Number} colDelta Columns number to move, value can be passed as negative number.\n * @returns {CellCoords}\n */\n transformEnd(rowDelta, colDelta) {\n const delta = new CellCoords(rowDelta, colDelta);\n\n this.runLocalHooks('beforeTransformEnd', delta);\n\n const totalRows = this.options.countRows();\n const totalCols = this.options.countCols();\n const cellRange = this.range.current();\n const coords = new CellCoords(cellRange.to.row + delta.row, cellRange.to.col + delta.col);\n let rowTransformDir = 0;\n let colTransformDir = 0;\n\n if (coords.row < 0) {\n rowTransformDir = -1;\n coords.row = 0;\n\n } else if (coords.row > 0 && coords.row >= totalRows) {\n rowTransformDir = 1;\n coords.row = totalRows - 1;\n }\n\n if (coords.col < 0) {\n colTransformDir = -1;\n coords.col = 0;\n\n } else if (coords.col > 0 && coords.col >= totalCols) {\n colTransformDir = 1;\n coords.col = totalCols - 1;\n }\n this.runLocalHooks('afterTransformEnd', coords, rowTransformDir, colTransformDir);\n\n return coords;\n }\n}\n\nmixin(Transformation, localHooks);\n\nexport default Transformation;\n\n\n\n// WEBPACK FOOTER //\n// ./src/selection/transformation.js","export default function jQueryWrapper(Handsontable) {\n const jQuery = typeof window === 'undefined' ? false : window.jQuery;\n\n if (!jQuery) {\n return;\n }\n\n jQuery.fn.handsontable = function(action) {\n const $this = this.first(); // Use only first element from list\n let instance = $this.data('handsontable');\n\n // Init case\n if (typeof action !== 'string') {\n const userSettings = action || {};\n\n if (instance) {\n instance.updateSettings(userSettings);\n\n } else {\n instance = new Handsontable.Core($this[0], userSettings);\n $this.data('handsontable', instance);\n instance.init();\n }\n\n return $this;\n }\n\n // Action case\n const args = [];\n let output;\n\n if (arguments.length > 1) {\n for (let i = 1, ilen = arguments.length; i < ilen; i++) {\n args.push(arguments[i]);\n }\n }\n\n if (instance) {\n if (typeof instance[action] !== 'undefined') {\n output = instance[action].apply(instance, args);\n\n if (action === 'destroy') {\n $this.removeData();\n }\n\n } else {\n throw new Error('Handsontable do not provide action: ' + action);\n }\n }\n\n return output;\n };\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/helpers/wrappers/jquery.js","import PersistentState from './persistentState/persistentState';\nimport AutoColumnSize from './autoColumnSize/autoColumnSize';\nimport AutoFill from './autofill/autofill';\nimport AutoRowSize from './autoRowSize/autoRowSize';\nimport ColumnSorting from './columnSorting/columnSorting';\nimport Comments from './comments/comments';\nimport ContextMenu from './contextMenu/contextMenu';\nimport CopyPaste from './copyPaste/copyPaste';\nimport CustomBorders from './customBorders/customBorders';\nimport DragToScroll from './dragToScroll/dragToScroll';\nimport ManualColumnFreeze from './manualColumnFreeze/manualColumnFreeze';\nimport ManualColumnMove from './manualColumnMove/manualColumnMove';\nimport ManualColumnResize from './manualColumnResize/manualColumnResize';\nimport ManualRowMove from './manualRowMove/manualRowMove';\nimport ManualRowResize from './manualRowResize/manualRowResize';\nimport MergeCells from './mergeCells/mergeCells';\nimport MultipleSelectionHandles from './multipleSelectionHandles/multipleSelectionHandles';\nimport ObserveChanges from './observeChanges/observeChanges';\nimport Search from './search/search';\nimport TouchScroll from './touchScroll/touchScroll';\nimport UndoRedo from './undoRedo/undoRedo';\nimport Base from './_base';\n\nexport {\n AutoColumnSize,\n AutoFill,\n AutoRowSize,\n ColumnSorting,\n Comments,\n ContextMenu,\n CopyPaste,\n CustomBorders,\n DragToScroll,\n ManualColumnFreeze,\n ManualColumnMove,\n ManualColumnResize,\n ManualRowMove,\n ManualRowResize,\n MergeCells,\n MultipleSelectionHandles,\n ObserveChanges,\n PersistentState,\n Search,\n TouchScroll,\n UndoRedo,\n Base,\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/index.js","import BasePlugin from './../_base';\nimport {registerPlugin} from './../../plugins';\nimport Storage from './storage';\nimport Hooks from './../../pluginHooks';\n\nHooks.getSingleton().register('persistentStateSave');\nHooks.getSingleton().register('persistentStateLoad');\nHooks.getSingleton().register('persistentStateReset');\n\n/**\n * Save the state of column sorting, column positions and column sizes in local storage\n * to preserve table state between page reloads.\n *\n * In order to enable data storage mechanism, persistentState option must be set to true.\n *\n * When persistentState is enabled it exposes 3 hooks:\n *\n * persistentStateSave (key: String, value: Mixed) -\n * Saves value under given key in browser local storage.\n *\n * persistentStateLoad (key: String, saveTo: Object) -\n * Loads value, saved under given key, form browser local storage.\n * The loaded value will be saved in saveTo.value.\n *\n * persistentStateReset (key: String) -\n * Clears the value saved under key.\n * If no key is given, all values associated with table will be cleared.\n *\n * @plugin persistentState\n */\nclass PersistentState extends BasePlugin {\n constructor(hotInstance) {\n super(hotInstance);\n /**\n * Instance of {@link Storage}.\n *\n * @type {Storage}\n */\n this.storage = void 0;\n }\n\n /**\n * Check if the plugin is enabled in the Handsontable settings.\n *\n * @returns {Boolean}\n */\n isEnabled() {\n return !!this.hot.getSettings().persistentState;\n }\n\n /**\n * Enable plugin for this Handsontable instance.\n */\n enablePlugin() {\n if (this.enabled) {\n return;\n }\n\n if (!this.storage) {\n this.storage = new Storage(this.hot.rootElement.id);\n }\n\n this.addHook('persistentStateSave', (key, value) => this.saveValue(key, value));\n this.addHook('persistentStateLoad', (key, saveTo) => this.loadValue(key, saveTo));\n this.addHook('persistentStateReset', () => this.resetValue());\n\n super.enablePlugin();\n }\n\n /**\n * Disable plugin for this Handsontable instance.\n */\n disablePlugin() {\n this.storage = void 0;\n\n super.disablePlugin();\n }\n\n /**\n * Updates the plugin to use the latest options you have specified.\n */\n updatePlugin() {\n this.disablePlugin();\n this.enablePlugin();\n\n super.updatePlugin();\n }\n\n /**\n * Load value from localStorage.\n *\n * @param {String} key Key string.\n * @param {Object} saveTo Saved value from browser local storage.\n */\n loadValue(key, saveTo) {\n saveTo.value = this.storage.loadValue(key);\n }\n\n /**\n * Save data to localStorage.\n *\n * @param {String} key Key string.\n * @param {Mixed} value Value to save.\n */\n saveValue(key, value) {\n this.storage.saveValue(key, value);\n }\n\n /**\n * Reset given data or all data from localStorage.\n *\n * @param {String} key [optional] Key string.\n */\n resetValue(key) {\n if (typeof key === 'undefined') {\n this.storage.resetAll();\n\n } else {\n this.storage.reset(key);\n }\n }\n\n /**\n * Destroy plugin instance.\n */\n destroy() {\n super.destroy();\n }\n}\n\nregisterPlugin('persistentState', PersistentState);\n\nexport default PersistentState;\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/persistentState/persistentState.js","import {arrayEach} from './../../helpers/array';\n\n/**\n * @class Storage\n * @plugin PersistentState\n */\nclass Storage {\n constructor(prefix) {\n /**\n * Prefix for key (id element).\n *\n * @type {String}\n */\n this.prefix = prefix;\n\n /**\n * Saved keys.\n *\n * @type {Array}\n */\n this.savedKeys = [];\n this.loadSavedKeys();\n }\n\n /**\n * Save data to localStorage.\n *\n * @param {String} key Key string.\n * @param {Mixed} value Value to save.\n */\n saveValue(key, value) {\n window.localStorage.setItem(`${this.prefix}_${key}`, JSON.stringify(value));\n\n if (this.savedKeys.indexOf(key) === -1) {\n this.savedKeys.push(key);\n this.saveSavedKeys();\n }\n }\n\n /**\n * Load data from localStorage.\n *\n * @param {String} key Key string.\n * @param {Object} defaultValue Object containing the loaded data.\n *\n * @returns {}\n */\n loadValue(key, defaultValue) {\n key = typeof key === 'undefined' ? defaultValue : key;\n\n let value = window.localStorage.getItem(`${this.prefix}_${key}`);\n\n return value === null ? void 0 : JSON.parse(value);\n }\n\n /**\n * Reset given data from localStorage.\n *\n * @param {String} key Key string.\n */\n reset(key) {\n window.localStorage.removeItem(`${this.prefix}_${key}`);\n }\n\n /**\n * Reset all data from localStorage.\n *\n */\n resetAll() {\n arrayEach(this.savedKeys, (value, index) => {\n window.localStorage.removeItem(`${this.prefix}_${this.savedKeys[index]}`);\n });\n\n this.clearSavedKeys();\n }\n\n /**\n * Load and save all keys from localStorage.\n *\n * @private\n */\n loadSavedKeys() {\n let keysJSON = window.localStorage.getItem(`${this.prefix}__persistentStateKeys`);\n let keys = typeof keysJSON === 'string' ? JSON.parse(keysJSON) : void 0;\n\n this.savedKeys = keys ? keys : [];\n };\n\n /**\n * Save saved key in localStorage.\n *\n * @private\n */\n saveSavedKeys() {\n window.localStorage.setItem(`${this.prefix}__persistentStateKeys`, JSON.stringify(this.savedKeys));\n };\n\n /**\n * Clear saved key from localStorage.\n *\n * @private\n */\n clearSavedKeys() {\n this.savedKeys.length = 0;\n this.saveSavedKeys();\n };\n}\n\nexport default Storage;\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/persistentState/storage.js","import BasePlugin from './../_base';\nimport {arrayEach, arrayFilter, arrayReduce, arrayMap} from './../../helpers/array';\nimport {cancelAnimationFrame, requestAnimationFrame} from './../../helpers/feature';\nimport {isVisible} from './../../helpers/dom/element';\nimport GhostTable from './../../utils/ghostTable';\nimport {isObject, objectEach, hasOwnProperty} from './../../helpers/object';\nimport {valueAccordingPercent, rangeEach} from './../../helpers/number';\nimport {registerPlugin} from './../../plugins';\nimport SamplesGenerator from './../../utils/samplesGenerator';\nimport {isPercentValue} from './../../helpers/string';\nimport {ViewportColumnsCalculator} from './../../3rdparty/walkontable/src';\n\nconst privatePool = new WeakMap();\n\n/**\n * @plugin AutoColumnSize\n *\n * @description\n * This plugin allows to set column widths based on their widest cells.\n *\n * By default, the plugin is declared as `undefined`, which makes it enabled (same as if it was declared as `true`).\n * Enabling this plugin may decrease the overall table performance, as it needs to calculate the widths of all cells to\n * resize the columns accordingly.\n * If you experience problems with the performance, try turning this feature off and declaring the column widths manually.\n *\n * Column width calculations are divided into sync and async part. Each of this parts has their own advantages and\n * disadvantages. Synchronous calculations are faster but they block the browser UI, while the slower asynchronous operations don't\n * block the browser UI.\n *\n * To configure the sync/async distribution, you can pass an absolute value (number of columns) or a percentage value to a config object:\n * ```js\n * ...\n * // as a number (300 columns in sync, rest async)\n * autoColumnSize: {syncLimit: 300},\n * ...\n *\n * ...\n * // as a string (percent)\n * autoColumnSize: {syncLimit: '40%'},\n * ...\n * ```\n *\n * To configure this plugin see {@link Options#autoColumnSize}.\n *\n * @example\n * ```js\n * ...\n * var hot = new Handsontable(document.getElementById('example'), {\n * date: getData(),\n * autoColumnSize: true\n * });\n * // Access to plugin instance:\n * var plugin = hot.getPlugin('autoColumnSize');\n *\n * plugin.getColumnWidth(4);\n *\n * if (plugin.isEnabled()) {\n * // code...\n * }\n * ...\n * ```\n */\nclass AutoColumnSize extends BasePlugin {\n static get CALCULATION_STEP() {\n return 50;\n }\n\n static get SYNC_CALCULATION_LIMIT() {\n return 50;\n }\n\n constructor(hotInstance) {\n super(hotInstance);\n privatePool.set(this, {\n /**\n * Cached column header names. It is used to diff current column headers with previous state and detect which\n * columns width should be updated.\n *\n * @private\n * @type {Array}\n */\n cachedColumnHeaders: [],\n });\n /**\n * Cached columns widths.\n *\n * @type {Array}\n */\n this.widths = [];\n /**\n * Instance of {@link GhostTable} for rows and columns size calculations.\n *\n * @type {GhostTable}\n */\n this.ghostTable = new GhostTable(this.hot);\n /**\n * Instance of {@link SamplesGenerator} for generating samples necessary for columns width calculations.\n *\n * @type {SamplesGenerator}\n */\n this.samplesGenerator = new SamplesGenerator((row, col) => (this.hot.getCellMeta(row, col).spanned ? '' : this.hot.getDataAtCell(row, col)));\n /**\n * `true` only if the first calculation was performed\n *\n * @type {Boolean}\n */\n this.firstCalculation = true;\n /**\n * `true` if the size calculation is in progress.\n *\n * @type {Boolean}\n */\n this.inProgress = false;\n\n // moved to constructor to allow auto-sizing the columns when the plugin is disabled\n this.addHook('beforeColumnResize', (col, size, isDblClick) => this.onBeforeColumnResize(col, size, isDblClick));\n }\n\n /**\n * Check if the plugin is enabled in the handsontable settings.\n *\n * @returns {Boolean}\n */\n isEnabled() {\n return this.hot.getSettings().autoColumnSize !== false && !this.hot.getSettings().colWidths;\n }\n\n /**\n * Enable plugin for this Handsontable instance.\n */\n enablePlugin() {\n if (this.enabled) {\n return;\n }\n\n let setting = this.hot.getSettings().autoColumnSize;\n\n if (setting && setting.useHeaders != null) {\n this.ghostTable.setSetting('useHeaders', setting.useHeaders);\n }\n\n this.addHook('afterLoadData', () => this.onAfterLoadData());\n this.addHook('beforeChange', (changes) => this.onBeforeChange(changes));\n\n this.addHook('beforeRender', (force) => this.onBeforeRender(force));\n this.addHook('modifyColWidth', (width, col) => this.getColumnWidth(col, width));\n this.addHook('afterInit', () => this.onAfterInit());\n super.enablePlugin();\n }\n\n /**\n * Update plugin state.\n */\n updatePlugin() {\n const changedColumns = this.findColumnsWhereHeaderWasChanged();\n\n if (changedColumns.length) {\n this.clearCache(changedColumns);\n }\n super.updatePlugin();\n }\n\n /**\n * Disable plugin for this Handsontable instance.\n */\n disablePlugin() {\n super.disablePlugin();\n }\n\n /**\n * Calculate a columns width.\n *\n * @param {Number|Object} colRange Column range object.\n * @param {Number|Object} rowRange Row range object.\n * @param {Boolean} [force=false] If `true` force calculate width even when value was cached earlier.\n */\n calculateColumnsWidth(colRange = {from: 0, to: this.hot.countCols() - 1}, rowRange = {from: 0, to: this.hot.countRows() - 1}, force = false) {\n if (typeof colRange === 'number') {\n colRange = {from: colRange, to: colRange};\n }\n if (typeof rowRange === 'number') {\n rowRange = {from: rowRange, to: rowRange};\n }\n\n rangeEach(colRange.from, colRange.to, (col) => {\n if (force || (this.widths[col] === void 0 && !this.hot._getColWidthFromSettings(col))) {\n const samples = this.samplesGenerator.generateColumnSamples(col, rowRange);\n\n samples.forEach((sample, col) => this.ghostTable.addColumn(col, sample));\n }\n });\n\n if (this.ghostTable.columns.length) {\n this.ghostTable.getWidths((col, width) => {\n this.widths[col] = width;\n });\n this.ghostTable.clean();\n }\n }\n\n /**\n * Calculate all columns width.\n *\n * @param {Object|Number} rowRange Row range object.\n */\n calculateAllColumnsWidth(rowRange = {from: 0, to: this.hot.countRows() - 1}) {\n let current = 0;\n let length = this.hot.countCols() - 1;\n let timer = null;\n\n this.inProgress = true;\n\n let loop = () => {\n // When hot was destroyed after calculating finished cancel frame\n if (!this.hot) {\n cancelAnimationFrame(timer);\n this.inProgress = false;\n\n return;\n }\n\n this.calculateColumnsWidth({\n from: current,\n to: Math.min(current + AutoColumnSize.CALCULATION_STEP, length)\n }, rowRange);\n\n current = current + AutoColumnSize.CALCULATION_STEP + 1;\n\n if (current < length) {\n timer = requestAnimationFrame(loop);\n } else {\n cancelAnimationFrame(timer);\n this.inProgress = false;\n\n // @TODO Should call once per render cycle, currently fired separately in different plugins\n this.hot.view.wt.wtOverlays.adjustElementsSize(true);\n // tmp\n if (this.hot.view.wt.wtOverlays.leftOverlay.needFullRender) {\n this.hot.view.wt.wtOverlays.leftOverlay.clone.draw();\n }\n }\n };\n // sync\n if (this.firstCalculation && this.getSyncCalculationLimit()) {\n this.calculateColumnsWidth({from: 0, to: this.getSyncCalculationLimit()}, rowRange);\n this.firstCalculation = false;\n current = this.getSyncCalculationLimit() + 1;\n }\n // async\n if (current < length) {\n loop();\n } else {\n this.inProgress = false;\n }\n }\n\n /**\n * Set the sampling options.\n *\n * @private\n */\n setSamplingOptions() {\n let setting = this.hot.getSettings().autoColumnSize;\n let samplingRatio = setting && hasOwnProperty(setting, 'samplingRatio') ? this.hot.getSettings().autoColumnSize.samplingRatio : void 0;\n let allowSampleDuplicates = setting && hasOwnProperty(setting, 'allowSampleDuplicates') ? this.hot.getSettings().autoColumnSize.allowSampleDuplicates : void 0;\n\n if (samplingRatio && !isNaN(samplingRatio)) {\n this.samplesGenerator.setSampleCount(parseInt(samplingRatio, 10));\n }\n\n if (allowSampleDuplicates) {\n this.samplesGenerator.setAllowDuplicates(allowSampleDuplicates);\n }\n }\n\n /**\n * Recalculate all columns width (overwrite cache values).\n */\n recalculateAllColumnsWidth() {\n if (this.hot.view && isVisible(this.hot.view.wt.wtTable.TABLE)) {\n this.clearCache();\n this.calculateAllColumnsWidth();\n }\n }\n\n /**\n * Get value which tells how many columns should be calculated synchronously. Rest of the columns will be calculated asynchronously.\n *\n * @returns {Number}\n */\n getSyncCalculationLimit() {\n /* eslint-disable no-bitwise */\n let limit = AutoColumnSize.SYNC_CALCULATION_LIMIT;\n let colsLimit = this.hot.countCols() - 1;\n\n if (isObject(this.hot.getSettings().autoColumnSize)) {\n limit = this.hot.getSettings().autoColumnSize.syncLimit;\n\n if (isPercentValue(limit)) {\n limit = valueAccordingPercent(colsLimit, limit);\n } else {\n // Force to Number\n limit >>= 0;\n }\n }\n\n return Math.min(limit, colsLimit);\n }\n\n /**\n * Get the calculated column width.\n *\n * @param {Number} col Column index.\n * @param {Number} [defaultWidth] Default column width. It will be picked up if no calculated width found.\n * @param {Boolean} [keepMinimum=true] If `true` then returned value won't be smaller then 50 (default column width).\n * @returns {Number}\n */\n getColumnWidth(col, defaultWidth = void 0, keepMinimum = true) {\n let width = defaultWidth;\n\n if (width === void 0) {\n width = this.widths[col];\n\n if (keepMinimum && typeof width === 'number') {\n width = Math.max(width, ViewportColumnsCalculator.DEFAULT_WIDTH);\n }\n }\n\n return width;\n }\n\n /**\n * Get the first visible column.\n *\n * @returns {Number} Returns column index or -1 if table is not rendered.\n */\n getFirstVisibleColumn() {\n const wot = this.hot.view.wt;\n\n if (wot.wtViewport.columnsVisibleCalculator) {\n return wot.wtTable.getFirstVisibleColumn();\n }\n if (wot.wtViewport.columnsRenderCalculator) {\n return wot.wtTable.getFirstRenderedColumn();\n }\n\n return -1;\n }\n\n /**\n * Get the last visible column.\n *\n * @returns {Number} Returns column index or -1 if table is not rendered.\n */\n getLastVisibleColumn() {\n const wot = this.hot.view.wt;\n\n if (wot.wtViewport.columnsVisibleCalculator) {\n return wot.wtTable.getLastVisibleColumn();\n }\n if (wot.wtViewport.columnsRenderCalculator) {\n return wot.wtTable.getLastRenderedColumn();\n }\n\n return -1;\n }\n\n /**\n * Collects all columns which titles has been changed in comparison to the previous state.\n *\n * @returns {Array} It returns an array of physical column indexes.\n */\n findColumnsWhereHeaderWasChanged() {\n const columnHeaders = this.hot.getColHeader();\n const {cachedColumnHeaders} = privatePool.get(this);\n\n const changedColumns = arrayReduce(columnHeaders, (acc, columnTitle, physicalColumn) => {\n const cachedColumnsLength = cachedColumnHeaders.length;\n\n if (cachedColumnsLength - 1 < physicalColumn || cachedColumnHeaders[physicalColumn] !== columnTitle) {\n acc.push(physicalColumn);\n }\n if (cachedColumnsLength - 1 < physicalColumn) {\n cachedColumnHeaders.push(columnTitle);\n } else {\n cachedColumnHeaders[physicalColumn] = columnTitle;\n }\n\n return acc;\n }, []);\n\n return changedColumns;\n }\n\n /**\n * Clear cache of calculated column widths. If you want to clear only selected columns pass an array with their indexes.\n * Otherwise whole cache will be cleared.\n *\n * @param {Array} [columns=[]] List of column indexes (physical indexes) to clear.\n */\n clearCache(columns = []) {\n if (columns.length) {\n arrayEach(columns, (physicalIndex) => {\n this.widths[physicalIndex] = void 0;\n });\n } else {\n this.widths.length = 0;\n }\n }\n\n /**\n * Check if all widths were calculated. If not then return `true` (need recalculate).\n *\n * @returns {Boolean}\n */\n isNeedRecalculate() {\n return !!arrayFilter(this.widths, (item) => (item === void 0)).length;\n }\n\n /**\n * On before render listener.\n *\n * @private\n */\n onBeforeRender() {\n const force = this.hot.renderCall;\n const rowsCount = this.hot.countRows();\n\n // Keep last column widths unchanged for situation when all rows was deleted or trimmed (pro #6)\n if (!rowsCount) {\n return;\n }\n\n this.calculateColumnsWidth({from: this.getFirstVisibleColumn(), to: this.getLastVisibleColumn()}, void 0, force);\n\n if (this.isNeedRecalculate() && !this.inProgress) {\n this.calculateAllColumnsWidth();\n }\n }\n\n /**\n * On after load data listener.\n *\n * @private\n */\n onAfterLoadData() {\n if (this.hot.view) {\n this.recalculateAllColumnsWidth();\n } else {\n // first load - initialization\n setTimeout(() => {\n if (this.hot) {\n this.recalculateAllColumnsWidth();\n }\n }, 0);\n }\n }\n\n /**\n * On before change listener.\n *\n * @private\n * @param {Array} changes\n */\n onBeforeChange(changes) {\n const changedColumns = arrayMap(changes, ([row, column]) => this.hot.propToCol(column));\n\n this.clearCache(changedColumns);\n }\n\n /**\n * On before column resize listener.\n *\n * @private\n * @param {Number} col\n * @param {Number} size\n * @param {Boolean} isDblClick\n * @returns {Number}\n */\n onBeforeColumnResize(col, size, isDblClick) {\n if (isDblClick) {\n this.calculateColumnsWidth(col, void 0, true);\n size = this.getColumnWidth(col, void 0, false);\n }\n\n return size;\n }\n\n /**\n * On after Handsontable init fill plugin with all necessary values.\n *\n * @private\n */\n onAfterInit() {\n privatePool.get(this).cachedColumnHeaders = this.hot.getColHeader();\n }\n\n /**\n * Destroy plugin instance.\n */\n destroy() {\n this.ghostTable.clean();\n super.destroy();\n }\n}\n\nregisterPlugin('autoColumnSize', AutoColumnSize);\n\nexport default AutoColumnSize;\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/autoColumnSize/autoColumnSize.js","import BasePlugin from './../_base';\nimport Hooks from './../../pluginHooks';\nimport {offset, outerHeight, outerWidth} from './../../helpers/dom/element';\nimport EventManager from './../../eventManager';\nimport {registerPlugin} from './../../plugins';\nimport {CellCoords} from './../../3rdparty/walkontable/src';\nimport {getDeltas, getDragDirectionAndRange, DIRECTIONS, getMappedFillHandleSetting} from './utils';\n\nHooks.getSingleton().register('modifyAutofillRange');\nHooks.getSingleton().register('beforeAutofill');\n\nconst INSERT_ROW_ALTER_ACTION_NAME = 'insert_row';\nconst INTERVAL_FOR_ADDING_ROW = 200;\n\n/**\n * This plugin provides \"drag-down\" and \"copy-down\" functionalities, both operated\n * using the small square in the right bottom of the cell selection.\n *\n * \"Drag-down\" expands the value of the selected cells to the neighbouring\n * cells when you drag the small square in the corner.\n *\n * \"Copy-down\" copies the value of the selection to all empty cells\n * below when you double click the small square.\n *\n * @class Autofill\n * @plugin Autofill\n */\n\nclass Autofill extends BasePlugin {\n constructor(hotInstance) {\n super(hotInstance);\n /**\n * Event manager\n *\n * @type {EventManager}\n */\n this.eventManager = new EventManager(this);\n /**\n * Specifies if adding new row started.\n *\n * @type {Boolean}\n */\n this.addingStarted = false;\n /**\n * Specifies if there was mouse down on the cell corner.\n *\n * @type {Boolean}\n */\n this.mouseDownOnCellCorner = false;\n /**\n * Specifies if mouse was dragged outside Handsontable.\n *\n * @type {Boolean}\n */\n this.mouseDragOutside = false;\n /**\n * Specifies how many cell levels were dragged using the handle.\n *\n * @type {Boolean}\n */\n this.handleDraggedCells = 0;\n /**\n * Specifies allowed directions of drag.\n *\n * @type {Array}\n */\n this.directions = [];\n /**\n * Specifies if can insert new rows if needed.\n *\n * @type {Boolean}\n */\n this.autoInsertRow = false;\n }\n\n /**\n * Check if the plugin is enabled in the Handsontable settings.\n *\n * @returns {Boolean}\n */\n isEnabled() {\n return this.hot.getSettings().fillHandle;\n }\n\n /**\n * Enable plugin for this Handsontable instance.\n */\n enablePlugin() {\n if (this.enabled) {\n return;\n }\n\n this.mapSettings();\n this.registerEvents();\n\n this.addHook('afterOnCellCornerMouseDown', (event) => this.onAfterCellCornerMouseDown(event));\n this.addHook('afterOnCellCornerDblClick', (event) => this.onCellCornerDblClick(event));\n this.addHook('beforeOnCellMouseOver', (event, coords, TD) => this.onBeforeCellMouseOver(coords));\n\n super.enablePlugin();\n }\n\n /**\n * Update plugin for this Handsontable instance.\n */\n updatePlugin() {\n this.disablePlugin();\n this.enablePlugin();\n super.updatePlugin();\n }\n\n /**\n * Disable plugin for this Handsontable instance.\n */\n disablePlugin() {\n this.clearMappedSettings();\n super.disablePlugin();\n }\n\n /**\n * Get selection data\n *\n * @private\n * @returns {Array} Array with the data.\n */\n getSelectionData() {\n const selRange = {\n from: this.hot.getSelectedRangeLast().from,\n to: this.hot.getSelectedRangeLast().to,\n };\n\n return this.hot.getData(selRange.from.row, selRange.from.col, selRange.to.row, selRange.to.col);\n }\n\n /**\n * Try to apply fill values to the area in fill border, omitting the selection border.\n *\n * @private\n * @returns {Boolean} reports if fill was applied.\n */\n fillIn() {\n if (this.hot.selection.highlight.getFill().isEmpty()) {\n return false;\n }\n\n let cornersOfSelectionAndDragAreas = this.hot.selection.highlight.getFill().getCorners();\n\n this.resetSelectionOfDraggedArea();\n\n const cornersOfSelectedCells = this.getCornersOfSelectedCells();\n cornersOfSelectionAndDragAreas = this.hot.runHooks('modifyAutofillRange', cornersOfSelectionAndDragAreas, cornersOfSelectedCells);\n\n const {directionOfDrag, startOfDragCoords, endOfDragCoords} = getDragDirectionAndRange(cornersOfSelectedCells, cornersOfSelectionAndDragAreas);\n\n if (startOfDragCoords && startOfDragCoords.row > -1 && startOfDragCoords.col > -1) {\n const selectionData = this.getSelectionData();\n\n this.hot.runHooks('beforeAutofill', startOfDragCoords, endOfDragCoords, selectionData);\n\n const deltas = getDeltas(startOfDragCoords, endOfDragCoords, selectionData, directionOfDrag);\n let fillData = selectionData;\n\n if (['up', 'left'].indexOf(directionOfDrag) > -1) {\n fillData = [];\n\n let dragLength = null;\n let fillOffset = null;\n\n if (directionOfDrag === 'up') {\n dragLength = endOfDragCoords.row - startOfDragCoords.row + 1;\n fillOffset = dragLength % selectionData.length;\n\n for (let i = 0; i < dragLength; i++) {\n fillData.push(selectionData[(i + (selectionData.length - fillOffset)) % selectionData.length]);\n }\n\n } else {\n dragLength = endOfDragCoords.col - startOfDragCoords.col + 1;\n fillOffset = dragLength % selectionData[0].length;\n\n for (let i = 0; i < selectionData.length; i++) {\n fillData.push([]);\n for (let j = 0; j < dragLength; j++) {\n fillData[i].push(selectionData[i][(j + (selectionData[i].length - fillOffset)) % selectionData[i].length]);\n }\n }\n }\n }\n\n this.hot.populateFromArray(\n startOfDragCoords.row,\n startOfDragCoords.col,\n fillData,\n endOfDragCoords.row,\n endOfDragCoords.col,\n `${this.pluginName}.fill`,\n null,\n directionOfDrag,\n deltas\n );\n\n this.setSelection(cornersOfSelectionAndDragAreas);\n\n } else {\n // reset to avoid some range bug\n this.hot._refreshBorders();\n }\n\n return true;\n }\n\n /**\n * Reduce the selection area if the handle was dragged outside of the table or on headers.\n *\n * @private\n * @param {CellCoords} coords indexes of selection corners.\n * @returns {CellCoords}\n */\n reduceSelectionAreaIfNeeded(coords) {\n if (coords.row < 0) {\n coords.row = 0;\n }\n\n if (coords.col < 0) {\n coords.col = 0;\n }\n return coords;\n }\n\n /**\n * Get the coordinates of the drag & drop borders.\n *\n * @private\n * @param {CellCoords} coordsOfSelection `CellCoords` coord object.\n * @returns {Array}\n */\n\n getCoordsOfDragAndDropBorders(coordsOfSelection) {\n const topLeftCorner = this.hot.getSelectedRangeLast().getTopLeftCorner();\n const bottomRightCorner = this.hot.getSelectedRangeLast().getBottomRightCorner();\n let coords;\n\n if (this.directions.includes(DIRECTIONS.vertical) &&\n (bottomRightCorner.row < coordsOfSelection.row || topLeftCorner.row > coordsOfSelection.row)) {\n coords = new CellCoords(coordsOfSelection.row, bottomRightCorner.col);\n\n } else if (this.directions.includes(DIRECTIONS.horizontal)) {\n coords = new CellCoords(bottomRightCorner.row, coordsOfSelection.col);\n\n } else {\n // wrong direction\n return;\n }\n\n return this.reduceSelectionAreaIfNeeded(coords);\n }\n\n /**\n * Show the fill border.\n *\n * @private\n * @param {CellCoords} coordsOfSelection `CellCoords` coord object.\n */\n showBorder(coordsOfSelection) {\n const coordsOfDragAndDropBorders = this.getCoordsOfDragAndDropBorders(coordsOfSelection);\n\n if (coordsOfDragAndDropBorders) {\n this.redrawBorders(coordsOfDragAndDropBorders);\n }\n }\n\n /**\n * Add new row\n *\n * @private\n */\n addRow() {\n this.hot._registerTimeout(setTimeout(() => {\n this.hot.alter(INSERT_ROW_ALTER_ACTION_NAME, void 0, 1, `${this.pluginName}.fill`);\n\n this.addingStarted = false;\n }, INTERVAL_FOR_ADDING_ROW));\n }\n\n /**\n * Add new rows if they are needed to continue auto-filling values.\n *\n * @private\n */\n addNewRowIfNeeded() {\n if (this.hot.selection.highlight.getFill().cellRange && this.addingStarted === false && this.autoInsertRow) {\n const cornersOfSelectedCells = this.hot.getSelectedLast();\n const cornersOfSelectedDragArea = this.hot.selection.highlight.getFill().getCorners();\n const nrOfTableRows = this.hot.countRows();\n\n if (cornersOfSelectedCells[2] < nrOfTableRows - 1 && cornersOfSelectedDragArea[2] === nrOfTableRows - 1) {\n this.addingStarted = true;\n\n this.addRow();\n }\n }\n }\n\n /**\n * Get corners of selected cells.\n *\n * @private\n * @returns {Array}\n */\n getCornersOfSelectedCells() {\n if (this.hot.selection.isMultiple()) {\n return this.hot.selection.highlight.createOrGetArea().getCorners();\n\n }\n return this.hot.selection.highlight.getCell().getCorners();\n\n }\n\n /**\n * Get index of last adjacent filled in row\n *\n * @private\n * @param {Array} cornersOfSelectedCells indexes of selection corners.\n * @returns {Number} gives number greater than or equal to zero when selection adjacent can be applied.\n * or -1 when selection adjacent can't be applied\n */\n getIndexOfLastAdjacentFilledInRow(cornersOfSelectedCells) {\n const data = this.hot.getData();\n const nrOfTableRows = this.hot.countRows();\n let lastFilledInRowIndex;\n\n for (let rowIndex = cornersOfSelectedCells[2] + 1; rowIndex < nrOfTableRows; rowIndex++) {\n for (let columnIndex = cornersOfSelectedCells[1]; columnIndex <= cornersOfSelectedCells[3]; columnIndex++) {\n const dataInCell = data[rowIndex][columnIndex];\n\n if (dataInCell) {\n return -1;\n }\n }\n\n const dataInNextLeftCell = data[rowIndex][cornersOfSelectedCells[1] - 1];\n const dataInNextRightCell = data[rowIndex][cornersOfSelectedCells[3] + 1];\n\n if (!!dataInNextLeftCell || !!dataInNextRightCell) {\n lastFilledInRowIndex = rowIndex;\n }\n }\n return lastFilledInRowIndex;\n }\n\n /**\n * Add a selection from the start area to the specific row index.\n *\n * @private\n * @param {Array} selectStartArea selection area from which we start to create more comprehensive selection.\n * @param {Number} rowIndex\n */\n addSelectionFromStartAreaToSpecificRowIndex(selectStartArea, rowIndex) {\n this.hot.selection.highlight.getFill()\n .clear()\n .add(new CellCoords(\n selectStartArea[0],\n selectStartArea[1])\n )\n .add(new CellCoords(\n rowIndex,\n selectStartArea[3])\n );\n }\n\n /**\n * Set selection based on passed corners.\n *\n * @private\n * @param {Array} cornersOfArea\n */\n setSelection(cornersOfArea) {\n this.hot.selectCell(...cornersOfArea, false, false);\n }\n\n /**\n * Try to select cells down to the last row in the left column and then returns if selection was applied.\n *\n * @private\n * @returns {Boolean}\n */\n selectAdjacent() {\n const cornersOfSelectedCells = this.getCornersOfSelectedCells();\n const lastFilledInRowIndex = this.getIndexOfLastAdjacentFilledInRow(cornersOfSelectedCells);\n\n if (lastFilledInRowIndex === -1) {\n return false;\n\n }\n this.addSelectionFromStartAreaToSpecificRowIndex(cornersOfSelectedCells, lastFilledInRowIndex);\n\n return true;\n\n }\n\n /**\n * Reset selection of dragged area.\n *\n * @private\n */\n resetSelectionOfDraggedArea() {\n this.handleDraggedCells = 0;\n\n this.hot.selection.highlight.getFill().clear();\n }\n\n /**\n * Redraw borders.\n *\n * @private\n * @param {CellCoords} coords `CellCoords` coord object.\n */\n redrawBorders(coords) {\n this.hot.selection.highlight.getFill()\n .clear()\n .add(this.hot.getSelectedRangeLast().from)\n .add(this.hot.getSelectedRangeLast().to)\n .add(coords);\n\n this.hot.view.render();\n }\n\n /**\n * Get if mouse was dragged outside.\n *\n * @private\n * @param {MouseEvent} event `mousemove` event properties.\n * @returns {Boolean}\n */\n getIfMouseWasDraggedOutside(event) {\n const tableBottom = offset(this.hot.table).top - (window.pageYOffset ||\n document.documentElement.scrollTop) + outerHeight(this.hot.table);\n const tableRight = offset(this.hot.table).left - (window.pageXOffset ||\n document.documentElement.scrollLeft) + outerWidth(this.hot.table);\n\n return event.clientY > tableBottom && event.clientX <= tableRight;\n }\n\n /**\n * Bind the events used by the plugin.\n *\n * @private\n */\n registerEvents() {\n this.eventManager.addEventListener(document.documentElement, 'mouseup', () => this.onMouseUp());\n this.eventManager.addEventListener(document.documentElement, 'mousemove', (event) => this.onMouseMove(event));\n }\n\n /**\n * On cell corner double click callback.\n *\n * @private\n */\n onCellCornerDblClick() {\n const selectionApplied = this.selectAdjacent();\n\n if (selectionApplied) {\n this.fillIn();\n }\n }\n\n /**\n * On after cell corner mouse down listener.\n *\n * @private\n */\n onAfterCellCornerMouseDown() {\n this.handleDraggedCells = 1;\n this.mouseDownOnCellCorner = true;\n }\n\n /**\n * On before cell mouse over listener.\n *\n * @private\n * @param {CellCoords} coords `CellCoords` coord object.\n */\n onBeforeCellMouseOver(coords) {\n if (this.mouseDownOnCellCorner && !this.hot.view.isMouseDown() && this.handleDraggedCells) {\n this.handleDraggedCells++;\n\n this.showBorder(coords);\n this.addNewRowIfNeeded();\n }\n }\n\n /**\n * On mouse up listener.\n *\n * @private\n */\n onMouseUp() {\n if (this.handleDraggedCells) {\n if (this.handleDraggedCells > 1) {\n this.fillIn();\n }\n\n this.handleDraggedCells = 0;\n this.mouseDownOnCellCorner = false;\n }\n }\n\n /**\n * On mouse move listener.\n *\n * @private\n * @param {MouseEvent} event `mousemove` event properties.\n */\n onMouseMove(event) {\n const mouseWasDraggedOutside = this.getIfMouseWasDraggedOutside(event);\n\n if (this.addingStarted === false && this.handleDraggedCells > 0 && mouseWasDraggedOutside) {\n this.mouseDragOutside = true;\n this.addingStarted = true;\n\n } else {\n this.mouseDragOutside = false;\n }\n\n if (this.mouseDragOutside && this.autoInsertRow) {\n this.addRow();\n }\n }\n\n /**\n * Clear mapped settings.\n *\n * @private\n */\n clearMappedSettings() {\n this.directions.length = 0;\n this.autoInsertRow = false;\n }\n\n /**\n * Map settings.\n *\n * @private\n */\n mapSettings() {\n const mappedSettings = getMappedFillHandleSetting(this.hot.getSettings().fillHandle);\n this.directions = mappedSettings.directions;\n this.autoInsertRow = mappedSettings.autoInsertRow;\n }\n\n /**\n * Destroy plugin instance.\n */\n destroy() {\n super.destroy();\n }\n}\n\nregisterPlugin('autofill', Autofill);\n\nexport default Autofill;\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/autofill/autofill.js","import {isObject} from './../../helpers/object';\nimport {isDefined} from './../../helpers/mixed';\nimport {CellCoords} from './../../3rdparty/walkontable/src';\n\nexport const DIRECTIONS = {\n horizontal: 'horizontal',\n vertical: 'vertical'\n};\n\n/**\n * Get deltas array.\n *\n * @param {CellCoords} start\n * @param {CellCoords} end\n * @param {Array} data\n * @param {String} direction\n * @returns {Array}\n */\nexport function getDeltas(start, end, data, direction) {\n const rowsLength = data.length;\n const columnsLength = data ? data[0].length : 0;\n const deltas = [];\n const diffRow = end.row - start.row;\n const diffCol = end.col - start.col;\n\n if (['down', 'up'].indexOf(direction) !== -1) {\n const arr = [];\n\n for (let col = 0; col <= diffCol; col++) {\n let startValue = parseInt(data[0][col], 10);\n let endValue = parseInt(data[rowsLength - 1][col], 10);\n let delta = (direction === 'down' ? (endValue - startValue) : (startValue - endValue)) / (rowsLength - 1) || 0;\n\n arr.push(delta);\n }\n\n deltas.push(arr);\n }\n\n if (['right', 'left'].indexOf(direction) !== -1) {\n for (let row = 0; row <= diffRow; row++) {\n let startValue = parseInt(data[row][0], 10);\n let endValue = parseInt(data[row][columnsLength - 1], 10);\n let delta = (direction === 'right' ? (endValue - startValue) : (startValue - endValue)) / (columnsLength - 1) || 0;\n\n deltas.push([delta]);\n }\n }\n\n return deltas;\n}\n\n/**\n * Get direction between positions and cords of selections difference (drag area)\n *\n * @param {Array} startSelection\n * @param {Array} endSelection\n * @returns {{direction: String, start: CellCoords, end: CellCoords}}\n */\nexport function getDragDirectionAndRange(startSelection, endSelection) {\n let startOfDragCoords,\n endOfDragCoords,\n directionOfDrag;\n\n if (endSelection[0] === startSelection[0] && endSelection[1] < startSelection[1]) {\n directionOfDrag = 'left';\n\n startOfDragCoords = new CellCoords(endSelection[0], endSelection[1]);\n endOfDragCoords = new CellCoords(endSelection[2], startSelection[1] - 1);\n\n } else if (endSelection[2] === startSelection[2] && endSelection[0] === startSelection[0] && endSelection[3] > startSelection[3]) {\n directionOfDrag = 'right';\n\n startOfDragCoords = new CellCoords(endSelection[0], startSelection[3] + 1);\n endOfDragCoords = new CellCoords(endSelection[2], endSelection[3]);\n\n } else if (endSelection[0] < startSelection[0] && endSelection[1] === startSelection[1]) {\n directionOfDrag = 'up';\n\n startOfDragCoords = new CellCoords(endSelection[0], endSelection[1]);\n endOfDragCoords = new CellCoords(startSelection[0] - 1, endSelection[3]);\n\n } else if (endSelection[2] > startSelection[2] &&\n endSelection[1] === startSelection[1]) {\n directionOfDrag = 'down';\n\n startOfDragCoords = new CellCoords(startSelection[2] + 1, endSelection[1]);\n endOfDragCoords = new CellCoords(endSelection[2], endSelection[3]);\n }\n\n return {\n directionOfDrag,\n startOfDragCoords,\n endOfDragCoords\n };\n}\n\n/**\n * Get mapped FillHandle setting containing information about\n * allowed FillHandle directions and if allowed is automatic insertion of rows on drag\n *\n * @param {Boolean|Object} fillHandle property of Handsontable settings\n * @returns {{directions: Array, autoInsertRow: Boolean}} object allowing access to information\n * about FillHandle in more useful way\n */\nexport function getMappedFillHandleSetting(fillHandle) {\n const mappedSettings = {};\n\n if (fillHandle === true) {\n mappedSettings.directions = Object.keys(DIRECTIONS);\n mappedSettings.autoInsertRow = true;\n\n } else if (isObject(fillHandle)) {\n if (isDefined(fillHandle.autoInsertRow)) {\n\n // autoInsertRow for horizontal direction will be always false\n\n if (fillHandle.direction === DIRECTIONS.horizontal) {\n mappedSettings.autoInsertRow = false;\n\n } else {\n mappedSettings.autoInsertRow = fillHandle.autoInsertRow;\n }\n\n } else {\n mappedSettings.autoInsertRow = false;\n }\n\n if (isDefined(fillHandle.direction)) {\n mappedSettings.directions = [fillHandle.direction];\n\n } else {\n mappedSettings.directions = Object.keys(DIRECTIONS);\n }\n\n } else if (typeof fillHandle === 'string') {\n mappedSettings.directions = [fillHandle];\n mappedSettings.autoInsertRow = true;\n\n } else {\n mappedSettings.directions = [];\n mappedSettings.autoInsertRow = false;\n }\n\n return mappedSettings;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/autofill/utils.js","import BasePlugin from './../_base';\nimport {arrayEach, arrayFilter} from './../../helpers/array';\nimport {cancelAnimationFrame, requestAnimationFrame} from './../../helpers/feature';\nimport {isVisible} from './../../helpers/dom/element';\nimport GhostTable from './../../utils/ghostTable';\nimport {isObject, objectEach, hasOwnProperty} from './../../helpers/object';\nimport {valueAccordingPercent, rangeEach} from './../../helpers/number';\nimport {registerPlugin} from './../../plugins';\nimport SamplesGenerator from './../../utils/samplesGenerator';\nimport {isPercentValue} from './../../helpers/string';\n\n/**\n * @plugin AutoRowSize\n *\n * @description\n * This plugin allows to set row heights based on their highest cells.\n *\n * By default, the plugin is declared as `undefined`, which makes it disabled (same as if it was declared as `false`).\n * Enabling this plugin may decrease the overall table performance, as it needs to calculate the heights of all cells to\n * resize the rows accordingly.\n * If you experience problems with the performance, try turning this feature off and declaring the row heights manually.\n *\n * Row height calculations are divided into sync and async part. Each of this parts has their own advantages and\n * disadvantages. Synchronous calculations are faster but they block the browser UI, while the slower asynchronous operations don't\n * block the browser UI.\n *\n * To configure the sync/async distribution, you can pass an absolute value (number of columns) or a percentage value to a config object:\n * ```js\n * ...\n * // as a number (300 columns in sync, rest async)\n * autoRowSize: {syncLimit: 300},\n * ...\n *\n * ...\n * // as a string (percent)\n * autoRowSize: {syncLimit: '40%'},\n * ...\n * ```\n *\n * You can also use the `allowSampleDuplicates` option to allow sampling duplicate values when calculating the row height. Note, that this might have\n * a negative impact on performance.\n *\n * To configure this plugin see {@link Options#autoRowSize}.\n *\n * @example\n *\n * ```js\n * ...\n * var hot = new Handsontable(document.getElementById('example'), {\n * date: getData(),\n * autoRowSize: true\n * });\n * // Access to plugin instance:\n * var plugin = hot.getPlugin('autoRowSize');\n *\n * plugin.getRowHeight(4);\n *\n * if (plugin.isEnabled()) {\n * // code...\n * }\n * ...\n * ```\n */\nclass AutoRowSize extends BasePlugin {\n static get CALCULATION_STEP() {\n return 50;\n }\n\n static get SYNC_CALCULATION_LIMIT() {\n return 500;\n }\n\n constructor(hotInstance) {\n super(hotInstance);\n /**\n * Cached rows heights.\n *\n * @type {Array}\n */\n this.heights = [];\n /**\n * Instance of {@link GhostTable} for rows and columns size calculations.\n *\n * @type {GhostTable}\n */\n this.ghostTable = new GhostTable(this.hot);\n /**\n * Instance of {@link SamplesGenerator} for generating samples necessary for rows height calculations.\n *\n * @type {SamplesGenerator}\n */\n this.samplesGenerator = new SamplesGenerator((row, col) => {\n if (row >= 0) {\n return this.hot.getDataAtCell(row, col);\n\n } else if (row === -1) {\n return this.hot.getColHeader(col);\n\n }\n return null;\n\n });\n /**\n * `true` if only the first calculation was performed.\n *\n * @type {Boolean}\n */\n this.firstCalculation = true;\n /**\n * `true` if the size calculation is in progress.\n *\n * @type {Boolean}\n */\n this.inProgress = false;\n\n // moved to constructor to allow auto-sizing the rows when the plugin is disabled\n this.addHook('beforeRowResize', (row, size, isDblClick) => this.onBeforeRowResize(row, size, isDblClick));\n }\n\n /**\n * Check if the plugin is enabled in the Handsontable settings.\n *\n * @returns {Boolean}\n */\n isEnabled() {\n return this.hot.getSettings().autoRowSize === true || isObject(this.hot.getSettings().autoRowSize);\n }\n\n /**\n * Enable plugin for this Handsontable instance.\n */\n enablePlugin() {\n if (this.enabled) {\n return;\n }\n\n this.setSamplingOptions();\n\n this.addHook('afterLoadData', () => this.onAfterLoadData());\n this.addHook('beforeChange', (changes) => this.onBeforeChange(changes));\n this.addHook('beforeColumnMove', () => this.recalculateAllRowsHeight());\n this.addHook('beforeColumnResize', () => this.recalculateAllRowsHeight());\n this.addHook('beforeColumnSort', () => this.clearCache());\n this.addHook('beforeRender', (force) => this.onBeforeRender(force));\n this.addHook('beforeRowMove', (rowStart, rowEnd) => this.onBeforeRowMove(rowStart, rowEnd));\n this.addHook('modifyRowHeight', (height, row) => this.getRowHeight(row, height));\n this.addHook('modifyColumnHeaderHeight', () => this.getColumnHeaderHeight());\n super.enablePlugin();\n }\n\n /**\n * Disable plugin for this Handsontable instance.\n */\n disablePlugin() {\n super.disablePlugin();\n }\n\n /**\n * Calculate a given rows height.\n *\n * @param {Number|Object} rowRange Row range object.\n * @param {Number|Object} colRange Column range object.\n * @param {Boolean} [force=false] If `true` force calculate height even when value was cached earlier.\n */\n calculateRowsHeight(rowRange = {from: 0, to: this.hot.countRows() - 1}, colRange = {from: 0, to: this.hot.countCols() - 1}, force = false) {\n if (typeof rowRange === 'number') {\n rowRange = {from: rowRange, to: rowRange};\n }\n if (typeof colRange === 'number') {\n colRange = {from: colRange, to: colRange};\n }\n\n if (this.hot.getColHeader(0) !== null) {\n const samples = this.samplesGenerator.generateRowSamples(-1, colRange);\n\n this.ghostTable.addColumnHeadersRow(samples.get(-1));\n }\n\n rangeEach(rowRange.from, rowRange.to, (row) => {\n // For rows we must calculate row height even when user had set height value manually.\n // We can shrink column but cannot shrink rows!\n if (force || this.heights[row] === void 0) {\n const samples = this.samplesGenerator.generateRowSamples(row, colRange);\n\n samples.forEach((sample, row) => {\n this.ghostTable.addRow(row, sample);\n });\n }\n });\n if (this.ghostTable.rows.length) {\n this.ghostTable.getHeights((row, height) => {\n this.heights[row] = height;\n });\n this.ghostTable.clean();\n }\n }\n\n /**\n * Calculate the height of all the rows.\n *\n * @param {Object|Number} colRange Column range object.\n */\n calculateAllRowsHeight(colRange = {from: 0, to: this.hot.countCols() - 1}) {\n let current = 0;\n let length = this.hot.countRows() - 1;\n let timer = null;\n\n this.inProgress = true;\n\n let loop = () => {\n // When hot was destroyed after calculating finished cancel frame\n if (!this.hot) {\n cancelAnimationFrame(timer);\n this.inProgress = false;\n\n return;\n }\n this.calculateRowsHeight({from: current, to: Math.min(current + AutoRowSize.CALCULATION_STEP, length)}, colRange);\n current = current + AutoRowSize.CALCULATION_STEP + 1;\n\n if (current < length) {\n timer = requestAnimationFrame(loop);\n } else {\n cancelAnimationFrame(timer);\n this.inProgress = false;\n\n // @TODO Should call once per render cycle, currently fired separately in different plugins\n this.hot.view.wt.wtOverlays.adjustElementsSize(true);\n // tmp\n if (this.hot.view.wt.wtOverlays.leftOverlay.needFullRender) {\n this.hot.view.wt.wtOverlays.leftOverlay.clone.draw();\n }\n }\n };\n // sync\n if (this.firstCalculation && this.getSyncCalculationLimit()) {\n this.calculateRowsHeight({from: 0, to: this.getSyncCalculationLimit()}, colRange);\n this.firstCalculation = false;\n current = this.getSyncCalculationLimit() + 1;\n }\n // async\n if (current < length) {\n loop();\n } else {\n this.inProgress = false;\n this.hot.view.wt.wtOverlays.adjustElementsSize(false);\n }\n }\n\n /**\n * Set the sampling options.\n *\n * @private\n */\n setSamplingOptions() {\n let setting = this.hot.getSettings().autoRowSize;\n let samplingRatio = setting && hasOwnProperty(setting, 'samplingRatio') ? this.hot.getSettings().autoRowSize.samplingRatio : void 0;\n let allowSampleDuplicates = setting && hasOwnProperty(setting, 'allowSampleDuplicates') ? this.hot.getSettings().autoRowSize.allowSampleDuplicates : void 0;\n\n if (samplingRatio && !isNaN(samplingRatio)) {\n this.samplesGenerator.setSampleCount(parseInt(samplingRatio, 10));\n }\n\n if (allowSampleDuplicates) {\n this.samplesGenerator.setAllowDuplicates(allowSampleDuplicates);\n }\n }\n\n /**\n * Recalculate all rows height (overwrite cache values).\n */\n recalculateAllRowsHeight() {\n if (isVisible(this.hot.view.wt.wtTable.TABLE)) {\n this.clearCache();\n this.calculateAllRowsHeight();\n }\n }\n\n /**\n * Get value which tells how much rows will be calculated synchronously. Rest rows will be calculated asynchronously.\n *\n * @returns {Number}\n */\n getSyncCalculationLimit() {\n /* eslint-disable no-bitwise */\n let limit = AutoRowSize.SYNC_CALCULATION_LIMIT;\n let rowsLimit = this.hot.countRows() - 1;\n\n if (isObject(this.hot.getSettings().autoRowSize)) {\n limit = this.hot.getSettings().autoRowSize.syncLimit;\n\n if (isPercentValue(limit)) {\n limit = valueAccordingPercent(rowsLimit, limit);\n } else {\n // Force to Number\n limit >>= 0;\n }\n }\n\n return Math.min(limit, rowsLimit);\n }\n\n /**\n * Get the calculated row height.\n *\n * @param {Number} row Visual row index.\n * @param {Number} [defaultHeight] Default row height. It will be pick up if no calculated height found.\n * @returns {Number}\n */\n getRowHeight(row, defaultHeight = void 0) {\n let height = defaultHeight;\n\n if (this.heights[row] !== void 0 && this.heights[row] > (defaultHeight || 0)) {\n height = this.heights[row];\n }\n\n return height;\n }\n\n /**\n * Get the calculated column header height.\n *\n * @returns {Number|undefined}\n */\n getColumnHeaderHeight() {\n return this.heights[-1];\n }\n\n /**\n * Get the first visible row.\n *\n * @returns {Number} Returns row index or -1 if table is not rendered.\n */\n getFirstVisibleRow() {\n const wot = this.hot.view.wt;\n\n if (wot.wtViewport.rowsVisibleCalculator) {\n return wot.wtTable.getFirstVisibleRow();\n }\n if (wot.wtViewport.rowsRenderCalculator) {\n return wot.wtTable.getFirstRenderedRow();\n }\n\n return -1;\n }\n\n /**\n * Get the last visible row.\n *\n * @returns {Number} Returns row index or -1 if table is not rendered.\n */\n getLastVisibleRow() {\n const wot = this.hot.view.wt;\n\n if (wot.wtViewport.rowsVisibleCalculator) {\n return wot.wtTable.getLastVisibleRow();\n }\n if (wot.wtViewport.rowsRenderCalculator) {\n return wot.wtTable.getLastRenderedRow();\n }\n\n return -1;\n }\n\n /**\n * Clear cached heights.\n */\n clearCache() {\n this.heights.length = 0;\n this.heights[-1] = void 0;\n }\n\n /**\n * Clear cache by range.\n *\n * @param {Object|Number} range Row range object.\n */\n clearCacheByRange(range) {\n if (typeof range === 'number') {\n range = {from: range, to: range};\n }\n rangeEach(Math.min(range.from, range.to), Math.max(range.from, range.to), (row) => {\n this.heights[row] = void 0;\n });\n }\n\n /**\n * @returns {Boolean}\n */\n isNeedRecalculate() {\n return !!arrayFilter(this.heights, (item) => (item === void 0)).length;\n }\n\n /**\n * On before render listener.\n *\n * @private\n */\n onBeforeRender() {\n let force = this.hot.renderCall;\n this.calculateRowsHeight({from: this.getFirstVisibleRow(), to: this.getLastVisibleRow()}, void 0, force);\n\n let fixedRowsBottom = this.hot.getSettings().fixedRowsBottom;\n\n // Calculate rows height synchronously for bottom overlay\n if (fixedRowsBottom) {\n let totalRows = this.hot.countRows() - 1;\n this.calculateRowsHeight({from: totalRows - fixedRowsBottom, to: totalRows});\n }\n\n if (this.isNeedRecalculate() && !this.inProgress) {\n this.calculateAllRowsHeight();\n }\n }\n\n /**\n * On before row move listener.\n *\n * @private\n * @param {Number} from Row index where was grabbed.\n * @param {Number} to Destination row index.\n */\n onBeforeRowMove(from, to) {\n this.clearCacheByRange({from, to});\n this.calculateAllRowsHeight();\n }\n\n /**\n * On before row resize listener.\n *\n * @private\n * @param {Number} row\n * @param {Number} size\n * @param {Boolean} isDblClick\n * @returns {Number}\n */\n onBeforeRowResize(row, size, isDblClick) {\n if (isDblClick) {\n this.calculateRowsHeight(row, void 0, true);\n size = this.getRowHeight(row);\n }\n\n return size;\n }\n\n /**\n * On after load data listener.\n *\n * @private\n */\n onAfterLoadData() {\n if (this.hot.view) {\n this.recalculateAllRowsHeight();\n } else {\n // first load - initialization\n setTimeout(() => {\n if (this.hot) {\n this.recalculateAllRowsHeight();\n }\n }, 0);\n }\n }\n\n /**\n * On before change listener.\n *\n * @private\n * @param {Array} changes\n */\n onBeforeChange(changes) {\n let range = null;\n\n if (changes.length === 1) {\n range = changes[0][0];\n } else if (changes.length > 1) {\n range = {\n from: changes[0][0],\n to: changes[changes.length - 1][0],\n };\n }\n if (range !== null) {\n this.clearCacheByRange(range);\n }\n }\n\n /**\n * Destroy plugin instance.\n */\n destroy() {\n this.ghostTable.clean();\n super.destroy();\n }\n}\n\nregisterPlugin('autoRowSize', AutoRowSize);\n\nexport default AutoRowSize;\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/autoRowSize/autoRowSize.js","import moment from 'moment';\nimport {\n addClass,\n hasClass,\n removeClass,\n} from './../../helpers/dom/element';\nimport {arrayMap, arrayReduce} from './../../helpers/array';\nimport {isEmpty} from './../../helpers/mixed';\nimport {hasOwnProperty} from './../../helpers/object';\nimport BasePlugin from './../_base';\nimport {registerPlugin} from './../../plugins';\nimport mergeSort from './../../utils/sortingAlgorithms/mergeSort';\nimport Hooks from './../../pluginHooks';\n\nHooks.getSingleton().register('beforeColumnSort');\nHooks.getSingleton().register('afterColumnSort');\n\n// TODO: Implement mixin arrayMapper to ColumnSorting plugin.\n\n/**\n * @plugin ColumnSorting\n *\n * @description\n * This plugin sorts the view by a column (but does not sort the data source!).\n * To enable the plugin, set the `columnSorting` property to either:\n * * a boolean value (`true`/`false`),\n * * an object defining the initial sorting order (see the example below).\n *\n * @example\n * ```js\n * ...\n * // as boolean\n * columnSorting: true\n * ...\n * // as a object with initial order (sort ascending column at index 2)\n * columnSorting: {\n * column: 2,\n * sortOrder: true, // true = ascending, false = descending, undefined = original order\n * sortEmptyCells: true // true = the table sorts empty cells, false = the table moves all empty cells to the end of the table\n * }\n * ...\n * ```\n * @dependencies ObserveChanges\n */\nclass ColumnSorting extends BasePlugin {\n\n constructor(hotInstance) {\n super(hotInstance);\n this.sortIndicators = [];\n this.lastSortedColumn = null;\n this.sortEmptyCells = false;\n }\n\n /**\n * Check if the plugin is enabled in the handsontable settings.\n *\n * @returns {Boolean}\n */\n isEnabled() {\n return !!(this.hot.getSettings().columnSorting);\n }\n\n /**\n * Enable plugin for this Handsontable instance.\n */\n enablePlugin() {\n if (this.enabled) {\n return;\n }\n\n this.setPluginOptions();\n\n const _this = this;\n this.hot.sortIndex = [];\n\n this.hot.sort = function() {\n let args = Array.prototype.slice.call(arguments);\n\n return _this.sortByColumn(...args);\n };\n\n if (typeof this.hot.getSettings().observeChanges === 'undefined') {\n this.enableObserveChangesPlugin();\n }\n\n this.addHook('afterTrimRow', (row) => this.sort());\n this.addHook('afterUntrimRow', (row) => this.sort());\n this.addHook('modifyRow', (row) => this.translateRow(row));\n this.addHook('unmodifyRow', (row) => this.untranslateRow(row));\n this.addHook('afterUpdateSettings', () => this.onAfterUpdateSettings());\n this.addHook('afterGetColHeader', (col, TH) => this.getColHeader(col, TH));\n this.addHook('afterOnCellMouseDown', (event, target) => this.onAfterOnCellMouseDown(event, target));\n this.addHook('afterCreateRow', function() {\n _this.afterCreateRow(...arguments);\n });\n this.addHook('afterRemoveRow', function() {\n _this.afterRemoveRow(...arguments);\n });\n this.addHook('afterInit', () => this.sortBySettings());\n this.addHook('afterLoadData', () => {\n this.hot.sortIndex = [];\n\n if (this.hot.view) {\n this.sortBySettings();\n }\n });\n if (this.hot.view) {\n this.sortBySettings();\n }\n super.enablePlugin();\n }\n\n /**\n * Disable plugin for this Handsontable instance.\n */\n disablePlugin() {\n this.hot.sort = void 0;\n super.disablePlugin();\n }\n\n /**\n * afterUpdateSettings callback.\n *\n * @private\n */\n onAfterUpdateSettings() {\n this.sortBySettings();\n }\n\n sortBySettings() {\n let sortingSettings = this.hot.getSettings().columnSorting;\n let loadedSortingState = this.loadSortingState();\n let sortingColumn;\n let sortingOrder;\n\n if (typeof loadedSortingState === 'undefined') {\n sortingColumn = sortingSettings.column;\n sortingOrder = sortingSettings.sortOrder;\n } else {\n sortingColumn = loadedSortingState.sortColumn;\n sortingOrder = loadedSortingState.sortOrder;\n }\n if (typeof sortingColumn === 'number') {\n this.lastSortedColumn = sortingColumn;\n this.sortByColumn(sortingColumn, sortingOrder);\n }\n }\n\n /**\n * Set sorted column and order info\n *\n * @param {number} col Sorted visual column index.\n * @param {boolean|undefined} order Sorting order (`true` for ascending, `false` for descending).\n */\n setSortingColumn(col, order) {\n if (typeof col == 'undefined') {\n this.hot.sortColumn = void 0;\n this.hot.sortOrder = void 0;\n\n return;\n } else if (this.hot.sortColumn === col && typeof order == 'undefined') {\n if (this.hot.sortOrder === false) {\n this.hot.sortOrder = void 0;\n } else {\n this.hot.sortOrder = !this.hot.sortOrder;\n }\n\n } else {\n this.hot.sortOrder = typeof order === 'undefined' ? true : order;\n }\n\n this.hot.sortColumn = col;\n }\n\n sortByColumn(col, order) {\n this.setSortingColumn(col, order);\n\n if (typeof this.hot.sortColumn == 'undefined') {\n return;\n }\n\n let allowSorting = this.hot.runHooks('beforeColumnSort', this.hot.sortColumn, this.hot.sortOrder);\n\n if (allowSorting !== false) {\n this.sort();\n }\n this.updateOrderClass();\n this.updateSortIndicator();\n\n this.hot.runHooks('afterColumnSort', this.hot.sortColumn, this.hot.sortOrder);\n\n this.hot.render();\n this.saveSortingState();\n }\n\n /**\n * Save the sorting state\n */\n saveSortingState() {\n let sortingState = {};\n\n if (typeof this.hot.sortColumn != 'undefined') {\n sortingState.sortColumn = this.hot.sortColumn;\n }\n\n if (typeof this.hot.sortOrder != 'undefined') {\n sortingState.sortOrder = this.hot.sortOrder;\n }\n\n if (hasOwnProperty(sortingState, 'sortColumn') || hasOwnProperty(sortingState, 'sortOrder')) {\n this.hot.runHooks('persistentStateSave', 'columnSorting', sortingState);\n }\n\n }\n\n /**\n * Load the sorting state.\n *\n * @returns {*} Previously saved sorting state.\n */\n loadSortingState() {\n let storedState = {};\n this.hot.runHooks('persistentStateLoad', 'columnSorting', storedState);\n\n return storedState.value;\n }\n\n /**\n * Update sorting class name state.\n */\n updateOrderClass() {\n let orderClass;\n\n if (this.hot.sortOrder === true) {\n orderClass = 'ascending';\n\n } else if (this.hot.sortOrder === false) {\n orderClass = 'descending';\n }\n this.sortOrderClass = orderClass;\n }\n\n enableObserveChangesPlugin() {\n let _this = this;\n\n this.hot._registerTimeout(\n setTimeout(() => {\n _this.hot.updateSettings({\n observeChanges: true\n });\n }, 0));\n }\n\n /**\n * Default sorting algorithm.\n *\n * @param {Boolean} sortOrder Sorting order - `true` for ascending, `false` for descending.\n * @param {Object} columnMeta Column meta object.\n * @returns {Function} The comparing function.\n */\n defaultSort(sortOrder, columnMeta) {\n return function(a, b) {\n if (typeof a[1] == 'string') {\n a[1] = a[1].toLowerCase();\n }\n if (typeof b[1] == 'string') {\n b[1] = b[1].toLowerCase();\n }\n\n if (a[1] === b[1]) {\n return 0;\n }\n\n if (isEmpty(a[1])) {\n if (isEmpty(b[1])) {\n return 0;\n }\n\n if (columnMeta.columnSorting.sortEmptyCells) {\n return sortOrder ? -1 : 1;\n }\n\n return 1;\n }\n if (isEmpty(b[1])) {\n if (isEmpty(a[1])) {\n return 0;\n }\n\n if (columnMeta.columnSorting.sortEmptyCells) {\n return sortOrder ? 1 : -1;\n }\n\n return -1;\n }\n\n if (isNaN(a[1]) && !isNaN(b[1])) {\n return sortOrder ? 1 : -1;\n\n } else if (!isNaN(a[1]) && isNaN(b[1])) {\n return sortOrder ? -1 : 1;\n\n } else if (!(isNaN(a[1]) || isNaN(b[1]))) {\n a[1] = parseFloat(a[1]);\n b[1] = parseFloat(b[1]);\n }\n if (a[1] < b[1]) {\n return sortOrder ? -1 : 1;\n }\n if (a[1] > b[1]) {\n return sortOrder ? 1 : -1;\n }\n\n return 0;\n };\n }\n\n /**\n * Date sorting algorithm\n * @param {Boolean} sortOrder Sorting order (`true` for ascending, `false` for descending).\n * @param {Object} columnMeta Column meta object.\n * @returns {Function} The compare function.\n */\n dateSort(sortOrder, columnMeta) {\n return function(a, b) {\n if (a[1] === b[1]) {\n return 0;\n }\n\n if (isEmpty(a[1])) {\n if (isEmpty(b[1])) {\n return 0;\n }\n\n if (columnMeta.columnSorting.sortEmptyCells) {\n return sortOrder ? -1 : 1;\n }\n\n return 1;\n }\n\n if (isEmpty(b[1])) {\n if (isEmpty(a[1])) {\n return 0;\n }\n\n if (columnMeta.columnSorting.sortEmptyCells) {\n return sortOrder ? 1 : -1;\n }\n\n return -1;\n }\n\n var aDate = moment(a[1], columnMeta.dateFormat);\n var bDate = moment(b[1], columnMeta.dateFormat);\n\n if (!aDate.isValid()) {\n return 1;\n }\n if (!bDate.isValid()) {\n return -1;\n }\n\n if (bDate.isAfter(aDate)) {\n return sortOrder ? -1 : 1;\n }\n if (bDate.isBefore(aDate)) {\n return sortOrder ? 1 : -1;\n }\n\n return 0;\n };\n }\n\n /**\n * Numeric sorting algorithm.\n *\n * @param {Boolean} sortOrder Sorting order (`true` for ascending, `false` for descending).\n * @param {Object} columnMeta Column meta object.\n * @returns {Function} The compare function.\n */\n numericSort(sortOrder, columnMeta) {\n return function(a, b) {\n const parsedA = parseFloat(a[1]);\n const parsedB = parseFloat(b[1]);\n\n // Watch out when changing this part of code!\n // Check below returns 0 (as expected) when comparing empty string, null, undefined\n if (parsedA === parsedB || (isNaN(parsedA) && isNaN(parsedB))) {\n return 0;\n }\n\n if (columnMeta.columnSorting.sortEmptyCells) {\n if (isEmpty(a[1])) {\n return sortOrder ? -1 : 1;\n }\n\n if (isEmpty(b[1])) {\n return sortOrder ? 1 : -1;\n }\n }\n\n if (isNaN(parsedA)) {\n return 1;\n }\n\n if (isNaN(parsedB)) {\n return -1;\n }\n\n if (parsedA < parsedB) {\n return sortOrder ? -1 : 1;\n\n } else if (parsedA > parsedB) {\n return sortOrder ? 1 : -1;\n }\n\n return 0;\n };\n }\n\n /**\n * Perform the sorting.\n */\n sort() {\n if (typeof this.hot.sortOrder == 'undefined') {\n this.hot.sortIndex.length = 0;\n\n return;\n }\n\n const colMeta = this.hot.getCellMeta(0, this.hot.sortColumn);\n const emptyRows = this.hot.countEmptyRows();\n let sortFunction;\n let nrOfRows;\n\n this.hot.sortingEnabled = false; // this is required by translateRow plugin hook\n this.hot.sortIndex.length = 0;\n\n if (typeof colMeta.columnSorting.sortEmptyCells === 'undefined') {\n colMeta.columnSorting = {sortEmptyCells: this.sortEmptyCells};\n }\n\n if (this.hot.getSettings().maxRows === Number.POSITIVE_INFINITY) {\n nrOfRows = this.hot.countRows() - this.hot.getSettings().minSpareRows;\n } else {\n nrOfRows = this.hot.countRows() - emptyRows;\n }\n\n for (let i = 0, ilen = nrOfRows; i < ilen; i++) {\n this.hot.sortIndex.push([i, this.hot.getDataAtCell(i, this.hot.sortColumn)]);\n }\n\n if (colMeta.sortFunction) {\n sortFunction = colMeta.sortFunction;\n\n } else {\n switch (colMeta.type) {\n case 'date':\n sortFunction = this.dateSort;\n break;\n case 'numeric':\n sortFunction = this.numericSort;\n break;\n default:\n sortFunction = this.defaultSort;\n }\n }\n\n mergeSort(this.hot.sortIndex, sortFunction(this.hot.sortOrder, colMeta));\n\n // Append spareRows\n for (let i = this.hot.sortIndex.length; i < this.hot.countRows(); i++) {\n this.hot.sortIndex.push([i, this.hot.getDataAtCell(i, this.hot.sortColumn)]);\n }\n\n this.hot.sortingEnabled = true; // this is required by translateRow plugin hook\n }\n\n /**\n * Update indicator states.\n */\n updateSortIndicator() {\n if (typeof this.hot.sortOrder == 'undefined') {\n return;\n }\n const colMeta = this.hot.getCellMeta(0, this.hot.sortColumn);\n\n this.sortIndicators[this.hot.sortColumn] = colMeta.sortIndicator;\n }\n\n /**\n * `modifyRow` hook callback. Translates physical row index to the sorted row index.\n *\n * @param {Number} row Row index.\n * @returns {Number} Sorted row index.\n */\n translateRow(row) {\n if (this.hot.sortingEnabled && (typeof this.hot.sortOrder !== 'undefined') && this.hot.sortIndex && this.hot.sortIndex.length && this.hot.sortIndex[row]) {\n return this.hot.sortIndex[row][0];\n }\n\n return row;\n }\n\n /**\n * Translates sorted row index to physical row index.\n *\n * @param {Number} row Sorted (visual) row index.\n * @returns {number} Physical row index.\n */\n untranslateRow(row) {\n if (this.hot.sortingEnabled && this.hot.sortIndex && this.hot.sortIndex.length) {\n for (var i = 0; i < this.hot.sortIndex.length; i++) {\n if (this.hot.sortIndex[i][0] == row) {\n return i;\n }\n }\n }\n }\n\n /**\n * `afterGetColHeader` callback. Adds column sorting css classes to clickable headers.\n *\n * @private\n * @param {Number} col Visual column index.\n * @param {Element} TH TH HTML element.\n */\n getColHeader(col, TH) {\n if (col < 0 || !TH.parentNode) {\n return false;\n }\n\n let headerLink = TH.querySelector('.colHeader');\n let colspan = TH.getAttribute('colspan');\n let TRs = TH.parentNode.parentNode.childNodes;\n let headerLevel = Array.prototype.indexOf.call(TRs, TH.parentNode);\n headerLevel -= TRs.length;\n\n if (!headerLink) {\n return;\n }\n\n if (this.hot.getSettings().columnSorting && col >= 0 && headerLevel === -1) {\n addClass(headerLink, 'columnSorting');\n }\n removeClass(headerLink, 'descending');\n removeClass(headerLink, 'ascending');\n\n if (this.sortIndicators[col]) {\n if (col === this.hot.sortColumn) {\n if (this.sortOrderClass === 'ascending') {\n addClass(headerLink, 'ascending');\n\n } else if (this.sortOrderClass === 'descending') {\n addClass(headerLink, 'descending');\n }\n }\n }\n }\n\n /**\n * Check if any column is in a sorted state.\n *\n * @returns {Boolean}\n */\n isSorted() {\n return typeof this.hot.sortColumn != 'undefined';\n }\n\n /**\n * `afterCreateRow` callback. Updates the sorting state after a row have been created.\n *\n * @private\n * @param {Number} index Visual row index.\n * @param {Number} amount\n */\n afterCreateRow(index, amount) {\n if (!this.isSorted()) {\n return;\n }\n\n for (let i = 0; i < this.hot.sortIndex.length; i++) {\n if (this.hot.sortIndex[i][0] >= index) {\n this.hot.sortIndex[i][0] += amount;\n }\n }\n\n for (let i = 0; i < amount; i++) {\n this.hot.sortIndex.splice(index + i, 0, [index + i, this.hot.getSourceData()[index + i][this.hot.sortColumn + this.hot.colOffset()]]);\n }\n\n this.saveSortingState();\n }\n\n /**\n * `afterRemoveRow` hook callback.\n *\n * @private\n * @param {Number} index Visual row index.\n * @param {Number} amount\n */\n afterRemoveRow(index, amount) {\n if (!this.isSorted()) {\n return;\n }\n let removedRows = this.hot.sortIndex.splice(index, amount);\n\n removedRows = arrayMap(removedRows, (row) => row[0]);\n\n function countRowShift(logicalRow) {\n // Todo: compare perf between reduce vs sort->each->brake\n return arrayReduce(removedRows, (count, removedLogicalRow) => {\n if (logicalRow > removedLogicalRow) {\n count++;\n }\n\n return count;\n }, 0);\n }\n\n this.hot.sortIndex = arrayMap(this.hot.sortIndex, (logicalRow, physicalRow) => {\n let rowShift = countRowShift(logicalRow[0]);\n\n if (rowShift) {\n logicalRow[0] -= rowShift;\n }\n\n return logicalRow;\n });\n\n this.saveSortingState();\n }\n\n /**\n * Set options by passed settings\n *\n * @private\n */\n setPluginOptions() {\n const columnSorting = this.hot.getSettings().columnSorting;\n\n if (typeof columnSorting === 'object') {\n this.sortEmptyCells = columnSorting.sortEmptyCells || false;\n\n } else {\n this.sortEmptyCells = false;\n }\n }\n\n /**\n * `onAfterOnCellMouseDown` hook callback.\n *\n * @private\n * @param {Event} event Event which are provided by hook.\n * @param {CellCoords} coords Visual coords of the selected cell.\n */\n onAfterOnCellMouseDown(event, coords) {\n if (coords.row > -1) {\n return;\n }\n\n if (hasClass(event.realTarget, 'columnSorting')) {\n // reset order state on every new column header click\n if (coords.col !== this.lastSortedColumn) {\n this.hot.sortOrder = true;\n }\n\n this.lastSortedColumn = coords.col;\n\n this.sortByColumn(coords.col);\n }\n }\n}\n\nregisterPlugin('columnSorting', ColumnSorting);\n\nexport default ColumnSorting;\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/columnSorting/columnSorting.js","import LinkedList from '../dataStructures/linkedList';\n\n/**\n * Refactored implementation of mergeSort (part of javascript-algorithms project) by Github users:\n * mgechev, AndriiHeonia and lekkas (part of javascript-algorithms project - all project contributors\n * at repository website)\n *\n * Link to repository: https://github.com/mgechev/javascript-algorithms\n */\n\n/**\n * Specifies a function that defines the sort order. The array is sorted according to each\n * character's Unicode code point value, according to the string conversion of each element.\n *\n * @param a {*} first compared element.\n * @param b {*} second compared element.\n * @returns {Number}\n */\nconst defaultCompareFunction = function(a, b) {\n // sort lexically\n\n const firstValue = a.toString();\n const secondValue = b.toString();\n\n if (firstValue === secondValue) {\n return 0;\n\n } else if (firstValue < secondValue) {\n return -1;\n\n }\n return 1;\n\n};\n\n/**\n * Mergesort method which is recursively called for sorting the input array.\n *\n * @param {Array} array The array which should be sorted.\n * @param {Function} compareFunction Compares two items in an array. If compareFunction is not supplied,\n * elements are sorted by converting them to strings and comparing strings in Unicode code point order.\n * @param {Number} startIndex Left side of the subarray.\n * @param {Number} endIndex Right side of the subarray.\n * @returns {Array} Array with sorted subarray.\n */\nexport default function mergeSort(array, compareFunction = defaultCompareFunction, startIndex = 0, endIndex = array.length) {\n if (Math.abs(endIndex - startIndex) <= 1) {\n return [];\n }\n\n const middleIndex = Math.ceil((startIndex + endIndex) / 2);\n\n mergeSort(array, compareFunction, startIndex, middleIndex);\n mergeSort(array, compareFunction, middleIndex, endIndex);\n\n return merge(array, compareFunction, startIndex, middleIndex, endIndex);\n}\n\n/**\n * Devides and sort merges two subarrays of given array\n *\n * @param {Array} array The array which subarrays should be sorted.\n * @param {Number} startIndex The start of the first subarray.\n * This subarray is with end middle - 1.\n * @param {Number} middleIndex The start of the second array.\n * @param {Number} endIndex end - 1 is the end of the second array.\n * @returns {Array} The array with sorted subarray.\n */\nexport function merge(array, compareFunction, startIndex, middleIndex, endIndex) {\n const leftElements = new LinkedList();\n const rightElements = new LinkedList();\n const leftSize = middleIndex - startIndex;\n const rightSize = endIndex - middleIndex;\n const maxSize = Math.max(leftSize, rightSize);\n const size = endIndex - startIndex;\n\n for (let i = 0; i < maxSize; i += 1) {\n if (i < leftSize) {\n leftElements.push(array[startIndex + i]);\n }\n\n if (i < rightSize) {\n rightElements.push(array[middleIndex + i]);\n }\n }\n\n let i = 0;\n\n while (i < size) {\n if (leftElements.first && rightElements.first) {\n if (compareFunction(leftElements.first.data, rightElements.first.data) > 0) {\n array[startIndex + i] = rightElements.shift().data;\n\n } else {\n array[startIndex + i] = leftElements.shift().data;\n }\n\n } else if (leftElements.first) {\n\n array[startIndex + i] = leftElements.shift().data;\n } else {\n\n array[startIndex + i] = rightElements.shift().data;\n }\n\n i += 1;\n }\n\n return array;\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/utils/sortingAlgorithms/mergeSort.js","/**\n * Refactored implementation of LinkedList (part of javascript-algorithms project) by Github users:\n * mgechev, AndriiHeonia, Microfed and Jakeh (part of javascript-algorithms project - all project contributors\n * at repository website)\n *\n * Link to repository: https://github.com/mgechev/javascript-algorithms\n */\n\n/**\n * Linked list node.\n *\n * @class NodeStructure\n * @util\n */\nclass NodeStructure {\n constructor(data) {\n /**\n * Data of the node.\n * @member {Object}\n */\n this.data = data;\n /**\n * Next node.\n * @member {NodeStructure}\n */\n this.next = null;\n /**\n * Previous node.\n * @member {NodeStructure}\n */\n this.prev = null;\n }\n}\n\n/**\n * Linked list.\n *\n * @class LinkedList\n * @util\n */\nclass LinkedList {\n constructor() {\n this.first = null;\n this.last = null;\n }\n\n /**\n * Add data to the end of linked list.\n *\n * @param {Object} data Data which should be added.\n */\n push(data) {\n const node = new NodeStructure(data);\n\n if (this.first === null) {\n this.first = node;\n this.last = node;\n\n } else {\n const temp = this.last;\n\n this.last = node;\n node.prev = temp;\n temp.next = node;\n }\n }\n\n /**\n * Add data to the beginning of linked list.\n *\n * @param {Object} data Data which should be added.\n */\n unshift(data) {\n const node = new NodeStructure(data);\n\n if (this.first === null) {\n this.first = node;\n this.last = node;\n\n } else {\n const temp = this.first;\n\n this.first = node;\n node.next = temp;\n temp.prev = node;\n }\n }\n\n /**\n * In order traversal of the linked list.\n *\n * @param {Function} callback Callback which should be executed on each node.\n */\n inorder(callback) {\n let temp = this.first;\n\n while (temp) {\n callback(temp);\n temp = temp.next;\n }\n }\n\n /**\n * Remove data from the linked list.\n *\n * @param {Object} data Data which should be removed.\n * @returns {Boolean} Returns true if data has been removed.\n */\n remove(data) {\n if (this.first === null) {\n return false;\n }\n\n let temp = this.first;\n let next;\n let prev;\n\n while (temp) {\n if (temp.data === data) {\n next = temp.next;\n prev = temp.prev;\n\n if (next) {\n next.prev = prev;\n }\n\n if (prev) {\n prev.next = next;\n }\n\n if (temp === this.first) {\n this.first = next;\n }\n\n if (temp === this.last) {\n this.last = prev;\n }\n\n return true;\n }\n\n temp = temp.next;\n }\n\n return false;\n }\n\n /**\n * Check if linked list contains cycle.\n *\n * @returns {Boolean} Returns true if linked list contains cycle.\n */\n hasCycle() {\n let fast = this.first;\n let slow = this.first;\n\n while (true) {\n if (fast === null) {\n return false;\n }\n\n fast = fast.next;\n\n if (fast === null) {\n return false;\n }\n\n fast = fast.next;\n slow = slow.next;\n\n if (fast === slow) {\n return true;\n }\n }\n };\n\n /**\n * Return last node from the linked list.\n *\n * @returns {NodeStructure} Last node.\n */\n pop() {\n if (this.last === null) {\n return null;\n }\n\n let temp = this.last;\n this.last = this.last.prev;\n\n return temp;\n };\n\n /**\n * Return first node from the linked list.\n *\n * @returns {NodeStructure} First node.\n */\n shift() {\n if (this.first === null) {\n return null;\n }\n\n const temp = this.first;\n this.first = this.first.next;\n\n return temp;\n };\n\n /**\n * Reverses the linked list recursively\n */\n recursiveReverse() {\n function inverse(current, next) {\n if (!next) {\n return;\n }\n inverse(next, next.next);\n next.next = current;\n }\n\n if (!this.first) {\n return;\n }\n\n inverse(this.first, this.first.next);\n\n this.first.next = null;\n const temp = this.first;\n this.first = this.last;\n this.last = temp;\n };\n\n /**\n * Reverses the linked list iteratively\n */\n reverse() {\n if (!this.first || !this.first.next) {\n return;\n }\n\n let current = this.first.next;\n let prev = this.first;\n let temp;\n\n while (current) {\n temp = current.next;\n current.next = prev;\n prev.prev = current;\n prev = current;\n current = temp;\n }\n\n this.first.next = null;\n this.last.prev = null;\n temp = this.first;\n this.first = prev;\n this.last = temp;\n };\n};\n\nexport {NodeStructure};\nexport default LinkedList;\n\n\n\n// WEBPACK FOOTER //\n// ./src/utils/dataStructures/linkedList.js","import {\n addClass,\n closest,\n isChildOf,\n hasClass,\n offset,\n outerWidth,\n outerHeight,\n getScrollableElement\n} from './../../helpers/dom/element';\nimport {deepClone, deepExtend, isObject} from './../../helpers/object';\nimport EventManager from './../../eventManager';\nimport {CellCoords} from './../../3rdparty/walkontable/src';\nimport {registerPlugin, getPlugin} from './../../plugins';\nimport BasePlugin from './../_base';\nimport CommentEditor from './commentEditor';\nimport {checkSelectionConsistency, markLabelAsSelected} from './../contextMenu/utils';\nimport DisplaySwitch from './displaySwitch';\nimport * as C from './../../i18n/constants';\n\nimport './comments.css';\n\nconst privatePool = new WeakMap();\nconst META_COMMENT = 'comment';\nconst META_COMMENT_VALUE = 'value';\nconst META_STYLE = 'style';\nconst META_READONLY = 'readOnly';\n\n/**\n * @plugin Comments\n *\n * @description\n * This plugin allows setting and managing cell comments by either an option in the context menu or with the use of the API.\n *\n * To enable the plugin, you'll need to set the comments property of the config object to `true`:\n * ```js\n * ...\n * comments: true\n * ...\n * ```\n *\n * or object with extra predefined plugin config:\n *\n * ```js\n * ...\n * comments: {\n * displayDelay: 1000\n * }\n * ...\n * ```\n *\n * To add comments at the table initialization, define the `comment` property in the `cell` config array as in an example below.\n *\n * @example\n *\n * ```js\n * ...\n * var hot = new Handsontable(document.getElementById('example'), {\n * date: getData(),\n * comments: true,\n * cell: [\n * {row: 1, col: 1, comment: {value: 'Foo'}},\n * {row: 2, col: 2, comment: {value: 'Bar'}}\n * ]\n * });\n *\n * // Access to the Comments plugin instance:\n * var commentsPlugin = hot.getPlugin('comments');\n *\n * // Manage comments programmatically:\n * commentsPlugin.setCommentAtCell(1, 6, 'Comment contents');\n * commentsPlugin.showAtCell(1, 6);\n * commentsPlugin.removeCommentAtCell(1, 6);\n *\n * // You can also set range once and use proper methods:\n * commentsPlugin.setRange({row: 1, col: 6});\n * commentsPlugin.setComment('Comment contents');\n * commentsPlugin.show();\n * commentsPlugin.removeComment();\n * ...\n * ```\n */\nclass Comments extends BasePlugin {\n constructor(hotInstance) {\n super(hotInstance);\n /**\n * Instance of {@link CommentEditor}.\n *\n * @type {CommentEditor}\n */\n this.editor = null;\n /**\n * Instance of {@link DisplaySwitch}.\n *\n * @type {DisplaySwitch}\n */\n this.displaySwitch = null;\n /**\n * Instance of {@link EventManager}.\n *\n * @private\n * @type {EventManager}\n */\n this.eventManager = null;\n /**\n * Current cell range.\n *\n * @type {Object}\n */\n this.range = {};\n /**\n * @private\n * @type {Boolean}\n */\n this.mouseDown = false;\n /**\n * @private\n * @type {Boolean}\n */\n this.contextMenuEvent = false;\n /**\n * @private\n * @type {*}\n */\n this.timer = null;\n\n privatePool.set(this, {\n tempEditorDimensions: {},\n cellBelowCursor: null\n });\n }\n\n /**\n * Check if the plugin is enabled in the Handsontable settings.\n *\n * @returns {Boolean}\n */\n isEnabled() {\n return !!this.hot.getSettings().comments;\n }\n\n /**\n * Enable plugin for this Handsontable instance.\n */\n enablePlugin() {\n if (this.enabled) {\n return;\n }\n\n if (!this.editor) {\n this.editor = new CommentEditor();\n }\n\n if (!this.eventManager) {\n this.eventManager = new EventManager(this);\n }\n\n if (!this.displaySwitch) {\n this.displaySwitch = new DisplaySwitch(this.getDisplayDelaySetting());\n }\n\n this.addHook('afterContextMenuDefaultOptions', (options) => this.addToContextMenu(options));\n this.addHook('afterRenderer', (TD, row, col, prop, value, cellProperties) => this.onAfterRenderer(TD, cellProperties));\n this.addHook('afterScrollHorizontally', () => this.hide());\n this.addHook('afterScrollVertically', () => this.hide());\n this.addHook('afterBeginEditing', (args) => this.onAfterBeginEditing(args));\n\n this.displaySwitch.addLocalHook('hide', () => this.hide());\n this.displaySwitch.addLocalHook('show', (row, col) => this.showAtCell(row, col));\n\n this.registerListeners();\n\n super.enablePlugin();\n }\n\n /**\n * Update plugin for this Handsontable instance.\n */\n updatePlugin() {\n this.disablePlugin();\n this.enablePlugin();\n super.updatePlugin();\n\n this.displaySwitch.updateDelay(this.getDisplayDelaySetting());\n }\n\n /**\n * Disable plugin for this Handsontable instance.\n */\n disablePlugin() {\n super.disablePlugin();\n }\n\n /**\n * Register all necessary DOM listeners.\n *\n * @private\n */\n registerListeners() {\n this.eventManager.addEventListener(document, 'mouseover', (event) => this.onMouseOver(event));\n this.eventManager.addEventListener(document, 'mousedown', (event) => this.onMouseDown(event));\n this.eventManager.addEventListener(document, 'mouseup', (event) => this.onMouseUp(event));\n this.eventManager.addEventListener(this.editor.getInputElement(), 'blur', (event) => this.onEditorBlur(event));\n this.eventManager.addEventListener(this.editor.getInputElement(), 'mousedown', (event) => this.onEditorMouseDown(event));\n this.eventManager.addEventListener(this.editor.getInputElement(), 'mouseup', (event) => this.onEditorMouseUp(event));\n }\n\n /**\n * Set current cell range to be able to use general methods like {@link Comments#setComment},\n * {@link Comments#removeComment}, {@link Comments#show}.\n *\n * @param {Object} range Object with `from` and `to` properties, each with `row` and `col` properties.\n */\n setRange(range) {\n this.range = range;\n }\n\n /**\n * Clear the currently selected cell.\n */\n clearRange() {\n this.range = {};\n }\n\n /**\n * Check if the event target is a cell containing a comment.\n *\n * @param {Event} event DOM event\n * @returns {Boolean}\n */\n targetIsCellWithComment(event) {\n const closestCell = closest(event.target, 'TD', 'TBODY');\n\n return !!(closestCell && hasClass(closestCell, 'htCommentCell') && closest(closestCell, [this.hot.rootElement]));\n }\n\n /**\n * Check if the event target is a comment textarea.\n *\n * @param {Event} event DOM event.\n * @returns {Boolean}\n */\n targetIsCommentTextArea(event) {\n return this.editor.getInputElement() === event.target;\n }\n\n /**\n * Set a comment for a cell according to the previously set range (see {@link Comments#setRange}).\n *\n * @param {String} value Comment contents.\n */\n setComment(value) {\n if (!this.range.from) {\n throw new Error('Before using this method, first set cell range (hot.getPlugin(\"comment\").setRange())');\n }\n const editorValue = this.editor.getValue();\n let comment = '';\n\n if (value != null) {\n comment = value;\n } else if (editorValue != null) {\n comment = editorValue;\n }\n\n let row = this.range.from.row;\n let col = this.range.from.col;\n\n this.updateCommentMeta(row, col, {[META_COMMENT_VALUE]: comment});\n this.hot.render();\n }\n\n /**\n * Set a comment for a cell.\n *\n * @param {Number} row Visual row index.\n * @param {Number} col Visual column index.\n * @param {String} value Comment contents.\n */\n setCommentAtCell(row, col, value) {\n this.setRange({\n from: new CellCoords(row, col)\n });\n this.setComment(value);\n }\n\n /**\n * Remove a comment from a cell according to previously set range (see {@link Comments#setRange}).\n *\n * @param {Boolean} [forceRender = true] If set to `true`, the table will be re-rendered at the end of the operation.\n */\n removeComment(forceRender = true) {\n if (!this.range.from) {\n throw new Error('Before using this method, first set cell range (hot.getPlugin(\"comment\").setRange())');\n }\n\n this.hot.setCellMeta(this.range.from.row, this.range.from.col, META_COMMENT, void 0);\n\n if (forceRender) {\n this.hot.render();\n }\n\n this.hide();\n }\n\n /**\n * Remove comment from a cell.\n *\n * @param {Number} row Visual row index.\n * @param {Number} col Visual column index.\n * @param {Boolean} [forceRender = true] If `true`, the table will be re-rendered at the end of the operation.\n */\n removeCommentAtCell(row, col, forceRender = true) {\n this.setRange({\n from: new CellCoords(row, col)\n });\n this.removeComment(forceRender);\n }\n\n /**\n * Get comment from a cell at the predefined range.\n */\n getComment() {\n const row = this.range.from.row;\n const column = this.range.from.col;\n\n return this.getCommentMeta(row, column, META_COMMENT_VALUE);\n }\n\n /**\n * Get comment from a cell at the provided coordinates.\n *\n * @param {Number} row Visual row index.\n * @param {Number} column Visual column index.\n */\n getCommentAtCell(row, column) {\n return this.getCommentMeta(row, column, META_COMMENT_VALUE);\n }\n\n /**\n * Show the comment editor accordingly to the previously set range (see {@link Comments#setRange}).\n *\n * @returns {Boolean} Returns `true` if comment editor was shown.\n */\n show() {\n if (!this.range.from) {\n throw new Error('Before using this method, first set cell range (hot.getPlugin(\"comment\").setRange())');\n }\n let meta = this.hot.getCellMeta(this.range.from.row, this.range.from.col);\n\n this.refreshEditor(true);\n this.editor.setValue(meta[META_COMMENT] ? meta[META_COMMENT][META_COMMENT_VALUE] : null || '');\n\n if (this.editor.hidden) {\n this.editor.show();\n }\n\n return true;\n }\n\n /**\n * Show comment editor according to cell coordinates.\n *\n * @param {Number} row Visual row index.\n * @param {Number} col Visual column index.\n * @returns {Boolean} Returns `true` if comment editor was shown.\n */\n showAtCell(row, col) {\n this.setRange({\n from: new CellCoords(row, col)\n });\n\n return this.show();\n }\n\n /**\n * Hide the comment editor.\n */\n hide() {\n if (!this.editor.hidden) {\n this.editor.hide();\n }\n }\n\n /**\n * Refresh comment editor position and styling.\n *\n * @param {Boolean} [force=false] If `true` then recalculation will be forced.\n */\n refreshEditor(force = false) {\n if (!force && (!this.range.from || !this.editor.isVisible())) {\n return;\n }\n const scrollableElement = getScrollableElement(this.hot.view.wt.wtTable.TABLE);\n const TD = this.hot.view.wt.wtTable.getCell(this.range.from);\n const row = this.range.from.row;\n const column = this.range.from.col;\n let cellOffset = offset(TD);\n let lastColWidth = this.hot.view.wt.wtTable.getStretchedColumnWidth(column);\n let cellTopOffset = cellOffset.top < 0 ? 0 : cellOffset.top;\n let cellLeftOffset = cellOffset.left;\n\n if (this.hot.view.wt.wtViewport.hasVerticalScroll() && scrollableElement !== window) {\n cellTopOffset -= this.hot.view.wt.wtOverlays.topOverlay.getScrollPosition();\n }\n\n if (this.hot.view.wt.wtViewport.hasHorizontalScroll() && scrollableElement !== window) {\n cellLeftOffset -= this.hot.view.wt.wtOverlays.leftOverlay.getScrollPosition();\n }\n\n let x = cellLeftOffset + lastColWidth;\n let y = cellTopOffset;\n\n const commentStyle = this.getCommentMeta(row, column, META_STYLE);\n const readOnly = this.getCommentMeta(row, column, META_READONLY);\n\n if (commentStyle) {\n this.editor.setSize(commentStyle.width, commentStyle.height);\n } else {\n this.editor.resetSize();\n }\n\n this.editor.setReadOnlyState(readOnly);\n\n this.editor.setPosition(x, y);\n }\n\n /**\n * Check if there is a comment for selected range.\n *\n * @private\n * @returns {Boolean}\n */\n checkSelectionCommentsConsistency() {\n const selected = this.hot.getSelectedRangeLast();\n\n if (!selected) {\n return false;\n }\n let hasComment = false;\n let cell = selected.from; // IN EXCEL THERE IS COMMENT ONLY FOR TOP LEFT CELL IN SELECTION\n\n if (this.getCommentMeta(cell.row, cell.col, META_COMMENT_VALUE)) {\n hasComment = true;\n }\n\n return hasComment;\n }\n\n /**\n * Set or update the comment-related cell meta.\n *\n * @param {Number} row Visual row index.\n * @param {Number} column Visual column index.\n * @param {Object} metaObject Object defining all the comment-related meta information.\n */\n updateCommentMeta(row, column, metaObject) {\n const oldComment = this.hot.getCellMeta(row, column)[META_COMMENT];\n let newComment;\n\n if (oldComment) {\n newComment = deepClone(oldComment);\n deepExtend(newComment, metaObject);\n } else {\n newComment = metaObject;\n }\n\n this.hot.setCellMeta(row, column, META_COMMENT, newComment);\n }\n\n /**\n * Get the comment related meta information.\n *\n * @param {Number} row Visual row index.\n * @param {Number} column Visual column index.\n * @param {String} property Cell meta property.\n * @returns {Mixed}\n */\n getCommentMeta(row, column, property) {\n const cellMeta = this.hot.getCellMeta(row, column);\n\n if (!cellMeta[META_COMMENT]) {\n return void 0;\n }\n\n return cellMeta[META_COMMENT][property];\n }\n\n /**\n * `mousedown` event callback.\n *\n * @private\n * @param {MouseEvent} event The `mousedown` event.\n */\n onMouseDown(event) {\n this.mouseDown = true;\n\n if (!this.hot.view || !this.hot.view.wt) {\n return;\n }\n\n if (!this.contextMenuEvent && !this.targetIsCommentTextArea(event)) {\n const eventCell = closest(event.target, 'TD', 'TBODY');\n let coordinates = null;\n\n if (eventCell) {\n coordinates = this.hot.view.wt.wtTable.getCoords(eventCell);\n }\n\n if (!eventCell || ((this.range.from && coordinates) && (this.range.from.row !== coordinates.row || this.range.from.col !== coordinates.col))) {\n this.hide();\n }\n }\n this.contextMenuEvent = false;\n }\n\n /**\n * `mouseover` event callback.\n *\n * @private\n * @param {MouseEvent} event The `mouseover` event.\n */\n onMouseOver(event) {\n const priv = privatePool.get(this);\n\n priv.cellBelowCursor = document.elementFromPoint(event.clientX, event.clientY);\n\n if (this.mouseDown || this.editor.isFocused() || hasClass(event.target, 'wtBorder')\n || priv.cellBelowCursor !== event.target || !this.editor) {\n return;\n }\n\n if (this.targetIsCellWithComment(event)) {\n const coordinates = this.hot.view.wt.wtTable.getCoords(event.target);\n const range = {\n from: new CellCoords(coordinates.row, coordinates.col)\n };\n\n this.displaySwitch.show(range);\n\n } else if (isChildOf(event.target, document) && !this.targetIsCommentTextArea(event)) {\n this.displaySwitch.hide();\n }\n }\n\n /**\n * `mouseup` event callback.\n *\n * @private\n * @param {MouseEvent} event The `mouseup` event.\n */\n onMouseUp(event) {\n this.mouseDown = false;\n }\n\n /** *\n * The `afterRenderer` hook callback..\n *\n * @private\n * @param {HTMLTableCellElement} TD The rendered `TD` element.\n * @param {Object} cellProperties The rendered cell's property object.\n */\n onAfterRenderer(TD, cellProperties) {\n if (cellProperties[META_COMMENT] && cellProperties[META_COMMENT][META_COMMENT_VALUE]) {\n addClass(TD, cellProperties.commentedCellClassName);\n }\n }\n\n /**\n * `blur` event callback for the comment editor.\n *\n * @private\n * @param {Event} event The `blur` event.\n */\n onEditorBlur(event) {\n this.setComment();\n }\n\n /**\n * `mousedown` hook. Along with `onEditorMouseUp` used to simulate the textarea resizing event.\n *\n * @private\n * @param {MouseEvent} event The `mousedown` event.\n */\n onEditorMouseDown(event) {\n const priv = privatePool.get(this);\n\n priv.tempEditorDimensions = {\n width: outerWidth(event.target),\n height: outerHeight(event.target)\n };\n }\n\n /**\n * `mouseup` hook. Along with `onEditorMouseDown` used to simulate the textarea resizing event.\n *\n * @private\n * @param {MouseEvent} event The `mouseup` event.\n */\n onEditorMouseUp(event) {\n const priv = privatePool.get(this);\n const currentWidth = outerWidth(event.target);\n const currentHeight = outerHeight(event.target);\n\n if (currentWidth !== priv.tempEditorDimensions.width + 1 || currentHeight !== priv.tempEditorDimensions.height + 2) {\n this.updateCommentMeta(this.range.from.row, this.range.from.col, {\n [META_STYLE]: {\n width: currentWidth,\n height: currentHeight\n }\n });\n }\n }\n\n /**\n * Context Menu's \"Add comment\" callback. Results in showing the comment editor.\n *\n * @private\n */\n onContextMenuAddComment() {\n this.displaySwitch.cancelHiding();\n let coords = this.hot.getSelectedRangeLast();\n\n this.contextMenuEvent = true;\n this.setRange({\n from: coords.from\n });\n this.show();\n setTimeout(() => {\n if (this.hot) {\n this.hot.deselectCell();\n this.editor.focus();\n }\n }, 10);\n }\n\n /**\n * Context Menu's \"remove comment\" callback.\n *\n * @private\n */\n onContextMenuRemoveComment() {\n this.contextMenuEvent = true;\n\n let {from, to} = this.hot.getSelectedRangeLast();\n\n for (let i = from.row; i <= to.row; i++) {\n for (let j = from.col; j <= to.col; j++) {\n this.removeCommentAtCell(i, j, false);\n }\n }\n\n this.hot.render();\n }\n\n /**\n * Context Menu's \"make comment read-only\" callback.\n *\n * @private\n */\n onContextMenuMakeReadOnly() {\n this.contextMenuEvent = true;\n\n let {from, to} = this.hot.getSelectedRangeLast();\n\n for (let i = from.row; i <= to.row; i++) {\n for (let j = from.col; j <= to.col; j++) {\n let currentState = !!this.getCommentMeta(i, j, META_READONLY);\n\n this.updateCommentMeta(i, j, {[META_READONLY]: !currentState});\n }\n }\n }\n\n /**\n * Add Comments plugin options to the Context Menu.\n *\n * @private\n * @param {Object} defaultOptions\n */\n addToContextMenu(defaultOptions) {\n defaultOptions.items.push(\n {\n name: '---------',\n },\n {\n key: 'commentsAddEdit',\n name: () => {\n if (this.checkSelectionCommentsConsistency()) {\n return this.hot.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_EDIT_COMMENT);\n }\n\n return this.hot.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_ADD_COMMENT);\n },\n callback: () => this.onContextMenuAddComment(),\n disabled() {\n return !(this.getSelectedLast() && !this.selection.isSelectedByCorner());\n }\n },\n {\n key: 'commentsRemove',\n name() {\n return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_REMOVE_COMMENT);\n },\n callback: () => this.onContextMenuRemoveComment(),\n disabled: () => this.hot.selection.isSelectedByCorner()\n },\n {\n key: 'commentsReadOnly',\n name() {\n let label = this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_READ_ONLY_COMMENT);\n let hasProperty = checkSelectionConsistency(this.getSelectedRangeLast(), (row, col) => {\n let readOnlyProperty = this.getCellMeta(row, col)[META_COMMENT];\n if (readOnlyProperty) {\n readOnlyProperty = readOnlyProperty[META_READONLY];\n }\n\n if (readOnlyProperty) {\n return true;\n }\n });\n\n if (hasProperty) {\n label = markLabelAsSelected(label);\n }\n\n return label;\n },\n callback: () => this.onContextMenuMakeReadOnly(),\n disabled: () => this.hot.selection.isSelectedByCorner() || !this.checkSelectionCommentsConsistency()\n }\n );\n }\n\n /**\n * Get `displayDelay` setting of comment plugin.\n *\n * @returns {Number|undefined}\n */\n getDisplayDelaySetting() {\n const commentSetting = this.hot.getSettings().comments;\n\n if (isObject(commentSetting)) {\n return commentSetting.displayDelay;\n }\n\n return void 0;\n }\n\n /**\n * `afterBeginEditing` hook callback.\n *\n * @private\n * @param {Number} row Visual row index of the currently edited cell.\n * @param {Number} column Visual column index of the currently edited cell.\n */\n onAfterBeginEditing(row, column) {\n this.hide();\n }\n\n /**\n * Destroy plugin instance.\n */\n destroy() {\n if (this.editor) {\n this.editor.destroy();\n }\n\n if (this.displaySwitch) {\n this.displaySwitch.destroy();\n }\n\n super.destroy();\n }\n}\n\nregisterPlugin('comments', Comments);\n\nexport default Comments;\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/comments/comments.js","import {addClass} from './../../helpers/dom/element';\n\n/**\n * Comment editor for the Comments plugin.\n *\n * @class CommentEditor\n * @plugin Comments\n */\nclass CommentEditor {\n static get CLASS_EDITOR_CONTAINER() {\n return 'htCommentsContainer';\n }\n\n static get CLASS_EDITOR() {\n return 'htComments';\n }\n\n static get CLASS_INPUT() {\n return 'htCommentTextArea';\n }\n\n static get CLASS_CELL() {\n return 'htCommentCell';\n }\n\n constructor() {\n this.editor = this.createEditor();\n this.editorStyle = this.editor.style;\n\n this.hidden = true;\n\n this.hide();\n }\n\n /**\n * Set position of the comments editor according to the provided x and y coordinates.\n *\n * @param {Number} x X position (in pixels).\n * @param {Number} y Y position (in pixels).\n */\n setPosition(x, y) {\n this.editorStyle.left = `${x}px`;\n this.editorStyle.top = `${y}px`;\n }\n\n /**\n * Set the editor size according to the provided arguments.\n *\n * @param {Number} width Width in pixels.\n * @param {Number} height Height in pixels.\n */\n setSize(width, height) {\n if (width && height) {\n const input = this.getInputElement();\n\n input.style.width = `${width}px`;\n input.style.height = `${height}px`;\n }\n }\n\n /**\n * Reset the editor size to its initial state.\n */\n resetSize() {\n const input = this.getInputElement();\n\n input.style.width = '';\n input.style.height = '';\n }\n\n /**\n * Set the read-only state for the comments editor.\n *\n * @param {Boolean} state The new read only state.\n */\n setReadOnlyState(state) {\n const input = this.getInputElement();\n\n input.readOnly = state;\n }\n\n /**\n * Show the comments editor.\n */\n show() {\n this.editorStyle.display = 'block';\n this.hidden = false;\n }\n\n /**\n * Hide the comments editor.\n */\n hide() {\n this.editorStyle.display = 'none';\n this.hidden = true;\n }\n\n /**\n * Checks if the editor is visible.\n *\n * @returns {Boolean}\n */\n isVisible() {\n return this.editorStyle.display === 'block';\n }\n\n /**\n * Set the comment value.\n *\n * @param {String} [value] The value to use.\n */\n setValue(value = '') {\n value = value || '';\n this.getInputElement().value = value;\n }\n\n /**\n * Get the comment value.\n *\n * @returns {String}\n */\n getValue() {\n return this.getInputElement().value;\n }\n\n /**\n * Checks if the comment input element is focused.\n *\n * @returns {Boolean}\n */\n isFocused() {\n return document.activeElement === this.getInputElement();\n }\n\n /**\n * Focus the comments input element.\n */\n focus() {\n this.getInputElement().focus();\n }\n\n /**\n * Create the `textarea` to be used as a comments editor.\n *\n * @returns {HTMLElement}\n */\n createEditor() {\n let container = document.querySelector(`.${CommentEditor.CLASS_EDITOR_CONTAINER}`);\n let editor;\n let textArea;\n\n if (!container) {\n container = document.createElement('div');\n addClass(container, CommentEditor.CLASS_EDITOR_CONTAINER);\n document.body.appendChild(container);\n }\n editor = document.createElement('div');\n addClass(editor, CommentEditor.CLASS_EDITOR);\n\n textArea = document.createElement('textarea');\n addClass(textArea, CommentEditor.CLASS_INPUT);\n\n editor.appendChild(textArea);\n container.appendChild(editor);\n\n return editor;\n }\n\n /**\n * Get the input element.\n *\n * @returns {HTMLElement}\n */\n getInputElement() {\n return this.editor.querySelector(`.${CommentEditor.CLASS_INPUT}`);\n }\n\n /**\n * Destroy the comments editor.\n */\n destroy() {\n this.editor.parentNode.removeChild(this.editor);\n this.editor = null;\n this.editorStyle = null;\n }\n}\n\nexport default CommentEditor;\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/comments/commentEditor.js","import {debounce} from '../../helpers/function';\nimport {mixin} from '../../helpers/object';\nimport localHooks from '../../mixins/localHooks';\n\nconst DEFAULT_DISPLAY_DELAY = 250;\nconst DEFAULT_HIDE_DELAY = 250;\n\n/**\n * Display switch for the Comments plugin. Manages the time of delayed displaying / hiding comments.\n *\n * @class DisplaySwitch\n * @plugin Comments\n */\nclass DisplaySwitch {\n constructor(displayDelay) {\n /**\n * Flag to determine if comment can be showed or hidden. State `true` mean that last performed action\n * was an attempt to show comment element. State `false` mean that it was attempt to hide comment element.\n *\n * @type {Boolean}\n */\n this.wasLastActionShow = true;\n /**\n * Show comment after predefined delay. It keeps reference to immutable `debounce` function.\n *\n * @type {Function}\n */\n this.showDebounced = null;\n /**\n * Reference to timer, run by `setTimeout`, which is hiding comment\n *\n * @type {Number}\n */\n this.hidingTimer = null;\n\n this.updateDelay(displayDelay);\n }\n\n /**\n * Responsible for hiding comment after proper delay.\n */\n hide() {\n this.wasLastActionShow = false;\n\n this.hidingTimer = setTimeout(() => {\n if (this.wasLastActionShow === false) {\n this.runLocalHooks('hide');\n }\n }, DEFAULT_HIDE_DELAY);\n }\n\n /**\n * Responsible for showing comment after proper delay.\n *\n * @param {Object} range Coordinates of selected cell.\n */\n show(range) {\n this.wasLastActionShow = true;\n this.showDebounced(range);\n };\n\n /**\n * Cancel hiding comment.\n */\n cancelHiding() {\n this.wasLastActionShow = true;\n\n clearTimeout(this.hidingTimer);\n this.hidingTimer = null;\n }\n\n /**\n * Update the switch settings.\n *\n * @param {Number} displayDelay Delay of showing the comments (in milliseconds).\n */\n updateDelay(displayDelay = DEFAULT_DISPLAY_DELAY) {\n this.showDebounced = debounce((range) => {\n if (this.wasLastActionShow) {\n this.runLocalHooks('show', range.from.row, range.from.col);\n }\n }, displayDelay);\n }\n\n /**\n * Destroy the switcher.\n */\n destroy() {\n this.clearLocalHooks();\n }\n}\n\nmixin(DisplaySwitch, localHooks);\n\nexport default DisplaySwitch;\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/comments/displaySwitch.js","// removed by extract-text-webpack-plugin\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/plugins/comments/comments.css\n// module id = 296\n// module chunks = 0","import BasePlugin from './../_base';\nimport Hooks from './../../pluginHooks';\nimport {arrayEach} from './../../helpers/array';\nimport CommandExecutor from './commandExecutor';\nimport EventManager from './../../eventManager';\nimport ItemsFactory from './itemsFactory';\nimport Menu from './menu';\nimport {registerPlugin} from './../../plugins';\nimport {stopPropagation, pageX, pageY} from './../../helpers/dom/event';\nimport {getWindowScrollLeft, getWindowScrollTop, hasClass} from './../../helpers/dom/element';\nimport {\n ROW_ABOVE,\n ROW_BELOW,\n COLUMN_LEFT,\n COLUMN_RIGHT,\n REMOVE_ROW,\n REMOVE_COLUMN,\n UNDO,\n REDO,\n READ_ONLY,\n ALIGNMENT,\n SEPARATOR\n} from './predefinedItems';\n\nimport './contextMenu.css';\n\nHooks.getSingleton().register('afterContextMenuDefaultOptions');\nHooks.getSingleton().register('beforeContextMenuShow');\nHooks.getSingleton().register('afterContextMenuShow');\nHooks.getSingleton().register('afterContextMenuHide');\nHooks.getSingleton().register('afterContextMenuExecute');\n\n/**\n * @description\n * This plugin creates the Handsontable Context Menu. It allows to create a new row or\n * column at any place in the grid among [other features](http://docs.handsontable.com/demo-context-menu.html).\n * Possible values:\n * * `true` (to enable default options),\n * * `false` (to disable completely)\n *\n * or array of any available strings:\n * * `[\"row_above\", \"row_below\", \"col_left\", \"col_right\",\n * \"remove_row\", \"remove_col\", \"---------\", \"undo\", \"redo\"]`.\n *\n * See [the context menu demo](http://docs.handsontable.com/demo-context-menu.html) for examples.\n *\n * @example\n * ```js\n * ...\n * // as a boolean\n * contextMenu: true\n * ...\n * // as a array\n * contextMenu: ['row_above', 'row_below', '---------', 'undo', 'redo']\n * ...\n * ```\n *\n * @plugin ContextMenu\n */\nclass ContextMenu extends BasePlugin {\n /**\n * Default menu items order when `contextMenu` is enabled by `true`.\n *\n * @returns {Array}\n */\n static get DEFAULT_ITEMS() {\n return [\n ROW_ABOVE, ROW_BELOW,\n SEPARATOR,\n COLUMN_LEFT, COLUMN_RIGHT,\n SEPARATOR,\n REMOVE_ROW, REMOVE_COLUMN,\n SEPARATOR,\n UNDO, REDO,\n SEPARATOR,\n READ_ONLY,\n SEPARATOR,\n ALIGNMENT,\n ];\n }\n\n constructor(hotInstance) {\n super(hotInstance);\n /**\n * Instance of {@link EventManager}.\n *\n * @type {EventManager}\n */\n this.eventManager = new EventManager(this);\n /**\n * Instance of {@link CommandExecutor}.\n *\n * @type {CommandExecutor}\n */\n this.commandExecutor = new CommandExecutor(this.hot);\n /**\n * Instance of {@link ItemsFactory}.\n *\n * @type {ItemsFactory}\n */\n this.itemsFactory = null;\n /**\n * Instance of {@link Menu}.\n *\n * @type {Menu}\n */\n this.menu = null;\n }\n\n /**\n * Check if the plugin is enabled in the Handsontable settings.\n *\n * @returns {Boolean}\n */\n isEnabled() {\n return this.hot.getSettings().contextMenu;\n }\n\n /**\n * Enable plugin for this Handsontable instance.\n */\n enablePlugin() {\n if (this.enabled) {\n return;\n }\n this.itemsFactory = new ItemsFactory(this.hot, ContextMenu.DEFAULT_ITEMS);\n\n const settings = this.hot.getSettings().contextMenu;\n let predefinedItems = {\n items: this.itemsFactory.getItems(settings)\n };\n this.registerEvents();\n\n if (typeof settings.callback === 'function') {\n this.commandExecutor.setCommonCallback(settings.callback);\n }\n super.enablePlugin();\n\n const delayedInitialization = () => {\n if (!this.hot) {\n return;\n }\n\n this.hot.runHooks('afterContextMenuDefaultOptions', predefinedItems);\n\n this.itemsFactory.setPredefinedItems(predefinedItems.items);\n let menuItems = this.itemsFactory.getItems(settings);\n\n this.menu = new Menu(this.hot, {\n className: 'htContextMenu',\n keepInViewport: true\n });\n this.hot.runHooks('beforeContextMenuSetItems', menuItems);\n\n this.menu.setMenuItems(menuItems);\n\n this.menu.addLocalHook('beforeOpen', () => this.onMenuBeforeOpen());\n this.menu.addLocalHook('afterOpen', () => this.onMenuAfterOpen());\n this.menu.addLocalHook('afterClose', () => this.onMenuAfterClose());\n this.menu.addLocalHook('executeCommand', (...params) => this.executeCommand.apply(this, params));\n\n // Register all commands. Predefined and added by user or by plugins\n arrayEach(menuItems, (command) => this.commandExecutor.registerCommand(command.key, command));\n };\n\n this.callOnPluginsReady(() => {\n if (this.isPluginsReady) {\n setTimeout(delayedInitialization, 0);\n } else {\n delayedInitialization();\n }\n });\n }\n\n /**\n * Updates the plugin to use the latest options you have specified.\n */\n updatePlugin() {\n this.disablePlugin();\n this.enablePlugin();\n\n super.updatePlugin();\n }\n\n /**\n * Disable plugin for this Handsontable instance.\n */\n disablePlugin() {\n this.close();\n\n if (this.menu) {\n this.menu.destroy();\n this.menu = null;\n }\n super.disablePlugin();\n }\n\n /**\n * Register dom listeners.\n *\n * @private\n */\n registerEvents() {\n this.eventManager.addEventListener(this.hot.rootElement, 'contextmenu', (event) => this.onContextMenu(event));\n }\n\n /**\n * Open menu and re-position it based on dom event object.\n *\n * @param {Event} event The event object.\n */\n open(event) {\n if (!this.menu) {\n return;\n }\n this.menu.open();\n this.menu.setPosition({\n top: parseInt(pageY(event), 10) - getWindowScrollTop(),\n left: parseInt(pageX(event), 10) - getWindowScrollLeft(),\n });\n\n // ContextMenu is not detected HotTableEnv correctly because is injected outside hot-table\n this.menu.hotMenu.isHotTableEnv = this.hot.isHotTableEnv;\n // Handsontable.eventManager.isHotTableEnv = this.hot.isHotTableEnv;\n }\n\n /**\n * Close menu.\n */\n close() {\n if (!this.menu) {\n return;\n }\n this.menu.close();\n }\n\n /**\n * Execute context menu command.\n *\n * You can execute all predefined commands:\n * * `'row_above'` - Insert row above\n * * `'row_below'` - Insert row below\n * * `'col_left'` - Insert column left\n * * `'col_right'` - Insert column right\n * * `'clear_column'` - Clear selected column\n * * `'remove_row'` - Remove row\n * * `'remove_col'` - Remove column\n * * `'undo'` - Undo last action\n * * `'redo'` - Redo last action\n * * `'make_read_only'` - Make cell read only\n * * `'alignment:left'` - Alignment to the left\n * * `'alignment:top'` - Alignment to the top\n * * `'alignment:right'` - Alignment to the right\n * * `'alignment:bottom'` - Alignment to the bottom\n * * `'alignment:middle'` - Alignment to the middle\n * * `'alignment:center'` - Alignment to the center (justify)\n *\n * Or you can execute command registered in settings where `key` is your command name.\n *\n * @param {String} commandName\n * @param {*} params\n */\n executeCommand(...params) {\n this.commandExecutor.execute.apply(this.commandExecutor, params);\n }\n\n /**\n * On context menu listener.\n *\n * @private\n * @param {Event} event\n */\n onContextMenu(event) {\n let settings = this.hot.getSettings();\n let showRowHeaders = settings.rowHeaders;\n let showColHeaders = settings.colHeaders;\n\n function isValidElement(element) {\n return element.nodeName === 'TD' || element.parentNode.nodeName === 'TD';\n }\n // if event is from hot-table we must get web component element not element inside him\n let element = event.realTarget;\n this.close();\n\n if (hasClass(element, 'handsontableInput')) {\n return;\n }\n\n event.preventDefault();\n stopPropagation(event);\n\n if (!(showRowHeaders || showColHeaders)) {\n if (!isValidElement(element) && !(hasClass(element, 'current') && hasClass(element, 'wtBorder'))) {\n return;\n }\n }\n\n this.open(event);\n }\n\n /**\n * On menu before open listener.\n *\n * @private\n */\n onMenuBeforeOpen() {\n this.hot.runHooks('beforeContextMenuShow', this);\n }\n\n /**\n * On menu after open listener.\n *\n * @private\n */\n onMenuAfterOpen() {\n this.hot.runHooks('afterContextMenuShow', this);\n }\n\n /**\n * On menu after close listener.\n *\n * @private\n */\n onMenuAfterClose() {\n this.hot.listen();\n this.hot.runHooks('afterContextMenuHide', this);\n }\n\n /**\n * Destroy instance.\n */\n destroy() {\n this.close();\n\n if (this.menu) {\n this.menu.destroy();\n }\n super.destroy();\n }\n}\n\nContextMenu.SEPARATOR = {\n name: SEPARATOR\n};\n\nregisterPlugin('contextMenu', ContextMenu);\n\nexport default ContextMenu;\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/contextMenu/contextMenu.js","import {arrayEach} from './../../helpers/array';\nimport {hasOwnProperty} from './../../helpers/object';\n\n/**\n * Command executor for ContextMenu.\n *\n * @class CommandExecutor\n * @plugin ContextMenu\n */\nclass CommandExecutor {\n constructor(hotInstance) {\n this.hot = hotInstance;\n this.commands = {};\n this.commonCallback = null;\n }\n\n /**\n * Register command.\n *\n * @param {String} name Command name.\n * @param {Object} commandDescriptor Command descriptor object with properties like `key` (command id),\n * `callback` (task to execute), `name` (command name), `disabled` (command availability).\n */\n registerCommand(name, commandDescriptor) {\n this.commands[name] = commandDescriptor;\n }\n\n /**\n * Set common callback which will be trigger on every executed command.\n *\n * @param {Function} callback Function which will be fired on every command execute.\n */\n setCommonCallback(callback) {\n this.commonCallback = callback;\n }\n\n /**\n * Execute command by its name.\n *\n * @param {String} commandName Command id.\n * @param {*} params Arguments passed to command task.\n */\n execute(commandName, ...params) {\n let commandSplit = commandName.split(':');\n commandName = commandSplit[0];\n\n let subCommandName = commandSplit.length === 2 ? commandSplit[1] : null;\n let command = this.commands[commandName];\n\n if (!command) {\n throw new Error(`Menu command '${commandName}' not exists.`);\n }\n if (subCommandName && command.submenu) {\n command = findSubCommand(subCommandName, command.submenu.items);\n }\n if (command.disabled === true) {\n return;\n }\n if (typeof command.disabled == 'function' && command.disabled.call(this.hot) === true) {\n return;\n }\n if (hasOwnProperty(command, 'submenu')) {\n return;\n }\n let callbacks = [];\n\n if (typeof command.callback === 'function') {\n callbacks.push(command.callback);\n }\n if (typeof this.commonCallback === 'function') {\n callbacks.push(this.commonCallback);\n }\n params.unshift(commandSplit.join(':'));\n arrayEach(callbacks, (callback) => callback.apply(this.hot, params));\n }\n}\n\nfunction findSubCommand(subCommandName, subCommands) {\n let command;\n\n arrayEach(subCommands, (cmd) => {\n let cmds = cmd.key ? cmd.key.split(':') : null;\n\n if (Array.isArray(cmds) && cmds[1] === subCommandName) {\n command = cmd;\n\n return false;\n }\n });\n\n return command;\n}\n\nexport default CommandExecutor;\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/contextMenu/commandExecutor.js","import {objectEach, isObject, extend} from './../../helpers/object';\nimport {arrayEach} from './../../helpers/array';\nimport {\n SEPARATOR,\n ITEMS,\n predefinedItems\n} from './predefinedItems';\n\n/**\n * Predefined items class factory for menu items.\n *\n * @class ItemsFactory\n * @plugin ContextMenu\n */\nclass ItemsFactory {\n constructor(hotInstance, orderPattern = null) {\n this.hot = hotInstance;\n this.predefinedItems = predefinedItems();\n this.defaultOrderPattern = orderPattern;\n }\n\n /**\n * Set predefined items.\n *\n * @param {Array} predefinedItems Array of predefined items.\n */\n setPredefinedItems(predefinedItems) {\n let items = {};\n\n this.defaultOrderPattern.length = 0;\n\n objectEach(predefinedItems, (value, key) => {\n let menuItemKey = '';\n\n if (value.name === SEPARATOR) {\n items[SEPARATOR] = value;\n menuItemKey = SEPARATOR;\n\n // Menu item added as a property to array\n } else if (isNaN(parseInt(key, 10))) {\n value.key = value.key === void 0 ? key : value.key;\n items[key] = value;\n menuItemKey = value.key;\n\n } else {\n items[value.key] = value;\n menuItemKey = value.key;\n }\n this.defaultOrderPattern.push(menuItemKey);\n });\n this.predefinedItems = items;\n }\n\n /**\n * Get all menu items based on pattern.\n *\n * @param {Array|Object|Boolean} pattern Pattern which you can define by displaying menu items order. If `true` default\n * pattern will be used.\n * @returns {Array}\n */\n getItems(pattern = null) {\n return getItems(pattern, this.defaultOrderPattern, this.predefinedItems);\n }\n}\n\nfunction getItems(pattern = null, defaultPattern = [], items = {}) {\n let result = [];\n\n if (pattern && pattern.items) {\n pattern = pattern.items;\n\n } else if (!Array.isArray(pattern)) {\n pattern = defaultPattern;\n }\n if (isObject(pattern)) {\n objectEach(pattern, (value, key) => {\n let item = items[typeof value === 'string' ? value : key];\n\n if (!item) {\n item = value;\n }\n if (isObject(value)) {\n extend(item, value);\n\n } else if (typeof item === 'string') {\n item = {name: item};\n }\n if (item.key === void 0) {\n item.key = key;\n }\n result.push(item);\n });\n } else {\n arrayEach(pattern, (name, key) => {\n let item = items[name];\n\n // Item deleted from settings `allowInsertRow: false` etc.\n if (!item && ITEMS.indexOf(name) >= 0) {\n return;\n }\n if (!item) {\n item = {name, key: `${key}`};\n }\n if (isObject(name)) {\n extend(item, name);\n }\n if (item.key === void 0) {\n item.key = key;\n }\n result.push(item);\n });\n }\n\n return result;\n}\n\nexport default ItemsFactory;\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/contextMenu/itemsFactory.js","import {align, getAlignmentClasses, checkSelectionConsistency, markLabelAsSelected} from './../utils';\nimport {KEY as SEPARATOR} from './separator';\nimport * as C from './../../../i18n/constants';\n\nexport const KEY = 'alignment';\n\nexport default function alignmentItem() {\n return {\n key: KEY,\n name() {\n return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_ALIGNMENT);\n },\n disabled() {\n return !(this.getSelectedRange() && !this.selection.isSelectedByCorner());\n },\n submenu: {\n items: [\n {\n key: `${KEY}:left`,\n name() {\n let label = this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_ALIGNMENT_LEFT);\n let hasClass = checkSelectionConsistency(this.getSelectedRange(), (row, col) => {\n let className = this.getCellMeta(row, col).className;\n\n if (className && className.indexOf('htLeft') !== -1) {\n return true;\n }\n });\n\n if (hasClass) {\n label = markLabelAsSelected(label);\n }\n\n return label;\n },\n callback() {\n const selectedRange = this.getSelectedRange();\n const stateBefore = getAlignmentClasses(selectedRange, (row, col) => this.getCellMeta(row, col).className);\n const type = 'horizontal';\n const alignment = 'htLeft';\n\n this.runHooks('beforeCellAlignment', stateBefore, selectedRange, type, alignment);\n align(selectedRange, type, alignment, (row, col) => this.getCellMeta(row, col),\n (row, col, key, value) => this.setCellMeta(row, col, key, value));\n this.render();\n },\n disabled: false\n },\n {\n key: `${KEY}:center`,\n name() {\n let label = this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_ALIGNMENT_CENTER);\n let hasClass = checkSelectionConsistency(this.getSelectedRange(), (row, col) => {\n let className = this.getCellMeta(row, col).className;\n\n if (className && className.indexOf('htCenter') !== -1) {\n return true;\n }\n });\n\n if (hasClass) {\n label = markLabelAsSelected(label);\n }\n\n return label;\n },\n callback(key, selection) {\n const selectedRange = this.getSelectedRange();\n let stateBefore = getAlignmentClasses(selectedRange, (row, col) => this.getCellMeta(row, col).className);\n let type = 'horizontal';\n let alignment = 'htCenter';\n\n this.runHooks('beforeCellAlignment', stateBefore, selectedRange, type, alignment);\n align(selectedRange, type, alignment, (row, col) => this.getCellMeta(row, col),\n (row, col, key, value) => this.setCellMeta(row, col, key, value));\n this.render();\n },\n disabled: false\n },\n {\n key: `${KEY}:right`,\n name() {\n let label = this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_ALIGNMENT_RIGHT);\n let hasClass = checkSelectionConsistency(this.getSelectedRange(), (row, col) => {\n let className = this.getCellMeta(row, col).className;\n\n if (className && className.indexOf('htRight') !== -1) {\n return true;\n }\n });\n\n if (hasClass) {\n label = markLabelAsSelected(label);\n }\n\n return label;\n },\n callback() {\n const selectedRange = this.getSelectedRange();\n let stateBefore = getAlignmentClasses(selectedRange, (row, col) => this.getCellMeta(row, col).className);\n let type = 'horizontal';\n let alignment = 'htRight';\n\n this.runHooks('beforeCellAlignment', stateBefore, selectedRange, type, alignment);\n align(selectedRange, type, alignment, (row, col) => this.getCellMeta(row, col),\n (row, col, key, value) => this.setCellMeta(row, col, key, value));\n this.render();\n },\n disabled: false\n },\n {\n key: `${KEY}:justify`,\n name() {\n let label = this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_ALIGNMENT_JUSTIFY);\n let hasClass = checkSelectionConsistency(this.getSelectedRange(), (row, col) => {\n let className = this.getCellMeta(row, col).className;\n\n if (className && className.indexOf('htJustify') !== -1) {\n return true;\n }\n });\n\n if (hasClass) {\n label = markLabelAsSelected(label);\n }\n\n return label;\n },\n callback() {\n const selectedRange = this.getSelectedRange();\n let stateBefore = getAlignmentClasses(selectedRange, (row, col) => this.getCellMeta(row, col).className);\n let type = 'horizontal';\n let alignment = 'htJustify';\n\n this.runHooks('beforeCellAlignment', stateBefore, selectedRange, type, alignment);\n align(selectedRange, type, alignment, (row, col) => this.getCellMeta(row, col),\n (row, col, key, value) => this.setCellMeta(row, col, key, value));\n this.render();\n },\n disabled: false\n },\n {\n name: SEPARATOR\n },\n {\n key: `${KEY}:top`,\n name() {\n let label = this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_ALIGNMENT_TOP);\n let hasClass = checkSelectionConsistency(this.getSelectedRange(), (row, col) => {\n let className = this.getCellMeta(row, col).className;\n\n if (className && className.indexOf('htTop') !== -1) {\n return true;\n }\n });\n\n if (hasClass) {\n label = markLabelAsSelected(label);\n }\n return label;\n },\n callback() {\n const selectedRange = this.getSelectedRange();\n let stateBefore = getAlignmentClasses(selectedRange, (row, col) => this.getCellMeta(row, col).className);\n let type = 'vertical';\n let alignment = 'htTop';\n\n this.runHooks('beforeCellAlignment', stateBefore, selectedRange, type, alignment);\n align(selectedRange, type, alignment, (row, col) => this.getCellMeta(row, col),\n (row, col, key, value) => this.setCellMeta(row, col, key, value));\n this.render();\n },\n disabled: false\n },\n {\n key: `${KEY}:middle`,\n name() {\n let label = this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_ALIGNMENT_MIDDLE);\n let hasClass = checkSelectionConsistency(this.getSelectedRange(), (row, col) => {\n let className = this.getCellMeta(row, col).className;\n\n if (className && className.indexOf('htMiddle') !== -1) {\n return true;\n }\n });\n\n if (hasClass) {\n label = markLabelAsSelected(label);\n }\n\n return label;\n },\n callback() {\n const selectedRange = this.getSelectedRange();\n let stateBefore = getAlignmentClasses(selectedRange, (row, col) => this.getCellMeta(row, col).className);\n let type = 'vertical';\n let alignment = 'htMiddle';\n\n this.runHooks('beforeCellAlignment', stateBefore, selectedRange, type, alignment);\n align(selectedRange, type, alignment, (row, col) => this.getCellMeta(row, col),\n (row, col, key, value) => this.setCellMeta(row, col, key, value));\n this.render();\n },\n disabled: false\n },\n {\n key: `${KEY}:bottom`,\n name() {\n let label = this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_ALIGNMENT_BOTTOM);\n let hasClass = checkSelectionConsistency(this.getSelectedRange(), (row, col) => {\n let className = this.getCellMeta(row, col).className;\n\n if (className && className.indexOf('htBottom') !== -1) {\n return true;\n }\n });\n\n if (hasClass) {\n label = markLabelAsSelected(label);\n }\n\n return label;\n },\n callback() {\n const selectedRange = this.getSelectedRange();\n let stateBefore = getAlignmentClasses(selectedRange, (row, col) => this.getCellMeta(row, col).className);\n let type = 'vertical';\n let alignment = 'htBottom';\n\n this.runHooks('beforeCellAlignment', stateBefore, selectedRange, type, alignment);\n align(selectedRange, type, alignment, (row, col) => this.getCellMeta(row, col),\n (row, col, key, value) => this.setCellMeta(row, col, key, value));\n this.render();\n },\n disabled: false\n }\n ]\n }\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/contextMenu/predefinedItems/alignment.js","import {getValidSelection} from './../utils';\nimport * as C from './../../../i18n/constants';\n\nexport const KEY = 'clear_column';\n\nexport default function clearColumnItem() {\n return {\n key: KEY,\n name() {\n return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_CLEAR_COLUMN);\n },\n callback(key, selection) {\n let column = selection[0].start.col;\n\n if (this.countRows()) {\n this.populateFromArray(0, column, [[null]], Math.max(selection[0].start.row, selection[0].end.row), column, 'ContextMenu.clearColumn');\n }\n },\n disabled() {\n const selected = getValidSelection(this);\n\n if (!selected) {\n return true;\n }\n const [startRow, startColumn, endRow, endColumn] = selected[0];\n const entireRowSelection = [startRow, 0, endRow, this.countCols() - 1];\n const rowSelected = entireRowSelection.join(',') === selected.join(',');\n\n return startColumn < 0 || this.countCols() >= this.getSettings().maxCols || rowSelected;\n }\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/contextMenu/predefinedItems/clearColumn.js","import {getValidSelection} from './../utils';\nimport * as C from './../../../i18n/constants';\n\nexport const KEY = 'col_left';\n\nexport default function columnLeftItem() {\n return {\n key: KEY,\n name() {\n return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_INSERT_LEFT);\n },\n callback(key, normalizedSelection) {\n const latestSelection = normalizedSelection[Math.max(normalizedSelection.length - 1, 0)];\n\n this.alter('insert_col', latestSelection.start.col, 1, 'ContextMenu.columnLeft');\n },\n disabled() {\n const selected = getValidSelection(this);\n\n if (!selected) {\n return true;\n }\n if (!this.isColumnModificationAllowed()) {\n return true;\n }\n const [startRow, startColumn, endRow, endColumn] = selected[0];\n const entireRowSelection = [startRow, 0, endRow, this.countCols() - 1];\n const rowSelected = entireRowSelection.join(',') === selected.join(',');\n const onlyOneColumn = this.countCols() === 1;\n\n return startColumn < 0 || this.countCols() >= this.getSettings().maxCols || (!onlyOneColumn && rowSelected);\n },\n hidden() {\n return !this.getSettings().allowInsertColumn;\n }\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/contextMenu/predefinedItems/columnLeft.js","import {getValidSelection} from './../utils';\nimport * as C from './../../../i18n/constants';\n\nexport const KEY = 'col_right';\n\nexport default function columnRightItem() {\n return {\n key: KEY,\n name() {\n return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_INSERT_RIGHT);\n },\n callback(key, normalizedSelection) {\n const latestSelection = normalizedSelection[Math.max(normalizedSelection.length - 1, 0)];\n\n this.alter('insert_col', latestSelection.end.col + 1, 1, 'ContextMenu.columnRight');\n },\n disabled() {\n const selected = getValidSelection(this);\n\n if (!selected) {\n return true;\n }\n if (!this.isColumnModificationAllowed()) {\n return true;\n }\n const [startRow, startColumn, endRow, endColumn] = selected[0];\n const entireRowSelection = [startRow, 0, endRow, this.countCols() - 1];\n const rowSelected = entireRowSelection.join(',') === selected.join(',');\n const onlyOneColumn = this.countCols() === 1;\n\n return startColumn < 0 || this.countCols() >= this.getSettings().maxCols || (!onlyOneColumn && rowSelected);\n },\n hidden() {\n return !this.getSettings().allowInsertColumn;\n }\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/contextMenu/predefinedItems/columnRight.js","import {checkSelectionConsistency, markLabelAsSelected} from './../utils';\nimport {arrayEach} from './../../../helpers/array';\nimport * as C from './../../../i18n/constants';\n\nexport const KEY = 'make_read_only';\n\nexport default function readOnlyItem() {\n return {\n key: KEY,\n name() {\n let label = this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_READ_ONLY);\n let atLeastOneReadOnly = checkSelectionConsistency(this.getSelectedRange(), (row, col) => this.getCellMeta(row, col).readOnly);\n\n if (atLeastOneReadOnly) {\n label = markLabelAsSelected(label);\n }\n\n return label;\n },\n callback() {\n const ranges = this.getSelectedRange();\n const atLeastOneReadOnly = checkSelectionConsistency(ranges, (row, col) => this.getCellMeta(row, col).readOnly);\n\n arrayEach(ranges, (range) => {\n range.forAll((row, col) => {\n this.setCellMeta(row, col, 'readOnly', !atLeastOneReadOnly);\n });\n });\n\n this.render();\n },\n disabled() {\n return !(this.getSelectedRange() && !this.selection.isSelectedByCorner());\n }\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/contextMenu/predefinedItems/readOnly.js","import * as C from './../../../i18n/constants';\n\nexport const KEY = 'redo';\n\nexport default function redoItem() {\n return {\n key: KEY,\n name() {\n return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_REDO);\n },\n callback() {\n this.redo();\n },\n disabled() {\n return this.undoRedo && !this.undoRedo.isRedoAvailable();\n }\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/contextMenu/predefinedItems/redo.js","import {getValidSelection} from './../utils';\nimport {arrayEach} from './../../../helpers/array';\nimport {transformSelectionToColumnDistance} from './../../../selection/utils';\nimport * as C from './../../../i18n/constants';\n\nexport const KEY = 'remove_col';\n\nexport default function removeColumnItem() {\n return {\n key: KEY,\n name() {\n const selection = this.getSelected();\n let pluralForm = 0;\n\n if (selection) {\n if (selection.length > 1) {\n pluralForm = 1;\n } else {\n const [, fromColumn, , toColumn] = selection[0];\n\n if (fromColumn - toColumn !== 0) {\n pluralForm = 1;\n }\n }\n }\n\n return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_REMOVE_COLUMN, pluralForm);\n },\n callback() {\n this.alter('remove_col', transformSelectionToColumnDistance(this.getSelected()), null, 'ContextMenu.removeColumn');\n },\n disabled() {\n const selected = getValidSelection(this);\n const totalColumns = this.countCols();\n\n if (!selected) {\n return true;\n }\n\n return this.selection.isSelectedByRowHeader() || this.selection.isSelectedByCorner() ||\n !this.isColumnModificationAllowed() || !totalColumns;\n },\n hidden() {\n return !this.getSettings().allowRemoveColumn;\n }\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/contextMenu/predefinedItems/removeColumn.js","import {getValidSelection} from './../utils';\nimport {arrayEach} from './../../../helpers/array';\nimport {transformSelectionToRowDistance} from './../../../selection/utils';\nimport * as C from './../../../i18n/constants';\n\nexport const KEY = 'remove_row';\n\nexport default function removeRowItem() {\n return {\n key: KEY,\n name() {\n const selection = this.getSelected();\n let pluralForm = 0;\n\n if (selection) {\n if (selection.length > 1) {\n pluralForm = 1;\n } else {\n const [fromRow, , toRow] = selection[0];\n\n if (fromRow - toRow !== 0) {\n pluralForm = 1;\n }\n }\n }\n\n return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_REMOVE_ROW, pluralForm);\n },\n callback() {\n this.alter('remove_row', transformSelectionToRowDistance(this.getSelected()), null, 'ContextMenu.removeRow');\n },\n disabled() {\n const selected = getValidSelection(this);\n const totalRows = this.countRows();\n\n if (!selected) {\n return true;\n }\n\n return this.selection.isSelectedByColumnHeader() || this.selection.isSelectedByCorner() || !totalRows;\n },\n hidden() {\n return !this.getSettings().allowRemoveRow;\n }\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/contextMenu/predefinedItems/removeRow.js","import {getValidSelection} from './../utils';\nimport * as C from './../../../i18n/constants';\n\nexport const KEY = 'row_above';\n\nexport default function rowAboveItem() {\n return {\n key: KEY,\n name() {\n return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_ROW_ABOVE);\n },\n callback(key, normalizedSelection) {\n const latestSelection = normalizedSelection[Math.max(normalizedSelection.length - 1, 0)];\n\n this.alter('insert_row', latestSelection.start.row, 1, 'ContextMenu.rowAbove');\n },\n disabled() {\n let selected = getValidSelection(this);\n\n if (!selected) {\n return true;\n }\n\n return this.selection.isSelectedByColumnHeader() || this.countRows() >= this.getSettings().maxRows;\n },\n hidden() {\n return !this.getSettings().allowInsertRow;\n }\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/contextMenu/predefinedItems/rowAbove.js","import {getValidSelection} from './../utils';\nimport * as C from './../../../i18n/constants';\n\nexport const KEY = 'row_below';\n\nexport default function rowBelowItem() {\n return {\n key: KEY,\n name() {\n return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_ROW_BELOW);\n },\n callback(key, normalizedSelection) {\n const latestSelection = normalizedSelection[Math.max(normalizedSelection.length - 1, 0)];\n\n this.alter('insert_row', latestSelection.end.row + 1, 1, 'ContextMenu.rowBelow');\n },\n disabled() {\n let selected = getValidSelection(this);\n\n if (!selected) {\n return true;\n }\n\n return this.selection.isSelectedByColumnHeader() || this.countRows() >= this.getSettings().maxRows;\n },\n hidden() {\n return !this.getSettings().allowInsertRow;\n }\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/contextMenu/predefinedItems/rowBelow.js","import * as C from './../../../i18n/constants';\n\nexport const KEY = 'undo';\n\nexport default function undoItem() {\n return {\n key: KEY,\n name() {\n return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_UNDO);\n },\n callback() {\n this.undo();\n },\n disabled() {\n return this.undoRedo && !this.undoRedo.isUndoAvailable();\n }\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/contextMenu/predefinedItems/undo.js","import Core from './../../core';\nimport {\n addClass,\n empty,\n fastInnerHTML,\n getScrollbarWidth,\n isChildOf,\n removeClass,\n} from './../../helpers/dom/element';\nimport {arrayEach, arrayFilter, arrayReduce} from './../../helpers/array';\nimport Cursor from './cursor';\nimport EventManager from './../../eventManager';\nimport {mixin, hasOwnProperty} from './../../helpers/object';\nimport {isUndefined, isDefined} from './../../helpers/mixed';\nimport {debounce, isFunction} from './../../helpers/function';\nimport {filterSeparators, hasSubMenu, isDisabled, isItemHidden, isSeparator, isSelectionDisabled, normalizeSelection} from './utils';\nimport {KEY_CODES} from './../../helpers/unicode';\nimport localHooks from './../../mixins/localHooks';\nimport {SEPARATOR} from './predefinedItems';\nimport {stopImmediatePropagation} from './../../helpers/dom/event';\n\nconst MIN_WIDTH = 215;\n\n/**\n * @class Menu\n * @plugin ContextMenu\n */\nclass Menu {\n constructor(hotInstance, options) {\n this.hot = hotInstance;\n this.options = options || {\n parent: null,\n name: null,\n className: '',\n keepInViewport: true,\n standalone: false,\n minWidth: MIN_WIDTH,\n };\n this.eventManager = new EventManager(this);\n this.container = this.createContainer(this.options.name);\n this.hotMenu = null;\n this.hotSubMenus = {};\n this.parentMenu = this.options.parent || null;\n this.menuItems = null;\n this.origOutsideClickDeselects = null;\n this.keyEvent = false;\n\n this.offset = {\n above: 0,\n below: 0,\n left: 0,\n right: 0\n };\n this._afterScrollCallback = null;\n\n this.registerEvents();\n }\n\n /**\n * Register event listeners.\n *\n * @private\n */\n registerEvents() {\n this.eventManager.addEventListener(document.documentElement, 'mousedown', (event) => this.onDocumentMouseDown(event));\n }\n\n /**\n * Set array of objects which defines menu items.\n *\n * @param {Array} menuItems Menu items to display.\n */\n setMenuItems(menuItems) {\n this.menuItems = menuItems;\n }\n\n /**\n * Set offset menu position for specified area (`above`, `below`, `left` or `right`).\n *\n * @param {String} area Specified area name (`above`, `below`, `left` or `right`).\n * @param {Number} offset Offset value.\n */\n setOffset(area, offset = 0) {\n this.offset[area] = offset;\n }\n\n /**\n * Check if menu is using as sub-menu.\n *\n * @returns {Boolean}\n */\n isSubMenu() {\n return this.parentMenu !== null;\n }\n\n /**\n * Open menu.\n *\n * @fires Hooks#beforeContextMenuShow\n * @fires Hooks#afterContextMenuShow\n */\n open() {\n this.runLocalHooks('beforeOpen');\n\n this.container.removeAttribute('style');\n this.container.style.display = 'block';\n\n const delayedOpenSubMenu = debounce((row) => this.openSubMenu(row), 300);\n const minWidthOfMenu = this.options.minWidth || MIN_WIDTH;\n\n let filteredItems = arrayFilter(this.menuItems, (item) => isItemHidden(item, this.hot));\n\n filteredItems = filterSeparators(filteredItems, SEPARATOR);\n\n let settings = {\n data: filteredItems,\n colHeaders: false,\n autoColumnSize: true,\n modifyColWidth(width) {\n if (isDefined(width) && width < minWidthOfMenu) {\n return minWidthOfMenu;\n }\n\n return width;\n },\n autoRowSize: false,\n readOnly: true,\n copyPaste: false,\n columns: [{\n data: 'name',\n renderer: (hot, TD, row, col, prop, value) => this.menuItemRenderer(hot, TD, row, col, prop, value)\n }],\n renderAllRows: true,\n fragmentSelection: 'cell',\n disableVisualSelection: 'area',\n beforeKeyDown: (event) => this.onBeforeKeyDown(event),\n afterOnCellMouseOver: (event, coords, TD) => {\n if (this.isAllSubMenusClosed()) {\n delayedOpenSubMenu(coords.row);\n } else {\n this.openSubMenu(coords.row);\n }\n },\n rowHeights: (row) => (filteredItems[row].name === SEPARATOR ? 1 : 23)\n };\n this.origOutsideClickDeselects = this.hot.getSettings().outsideClickDeselects;\n this.hot.getSettings().outsideClickDeselects = false;\n this.hotMenu = new Core(this.container, settings);\n this.hotMenu.addHook('afterInit', () => this.onAfterInit());\n this.hotMenu.addHook('afterSelection', (...args) => this.onAfterSelection(...args));\n this.hotMenu.init();\n this.hotMenu.listen();\n this.blockMainTableCallbacks();\n this.runLocalHooks('afterOpen');\n }\n\n /**\n * Close menu.\n *\n * @param {Boolean} [closeParent=false] if `true` try to close parent menu if exists.\n */\n close(closeParent = false) {\n if (!this.isOpened()) {\n return;\n }\n if (closeParent && this.parentMenu) {\n this.parentMenu.close();\n } else {\n this.closeAllSubMenus();\n this.container.style.display = 'none';\n this.releaseMainTableCallbacks();\n this.hotMenu.destroy();\n this.hotMenu = null;\n this.hot.getSettings().outsideClickDeselects = this.origOutsideClickDeselects;\n this.runLocalHooks('afterClose');\n\n if (this.parentMenu) {\n this.parentMenu.hotMenu.listen();\n }\n }\n }\n\n /**\n * Open sub menu at the provided row index.\n *\n * @param {Number} row Row index.\n * @returns {Menu|Boolean} Returns created menu or `false` if no one menu was created.\n */\n openSubMenu(row) {\n if (!this.hotMenu) {\n return false;\n }\n let cell = this.hotMenu.getCell(row, 0);\n\n this.closeAllSubMenus();\n\n if (!cell || !hasSubMenu(cell)) {\n return false;\n }\n let dataItem = this.hotMenu.getSourceDataAtRow(row);\n let subMenu = new Menu(this.hot, {\n parent: this,\n name: dataItem.name,\n className: this.options.className,\n keepInViewport: true\n });\n subMenu.setMenuItems(dataItem.submenu.items);\n subMenu.open();\n subMenu.setPosition(cell.getBoundingClientRect());\n this.hotSubMenus[dataItem.key] = subMenu;\n\n return subMenu;\n }\n\n /**\n * Close sub menu at row index.\n *\n * @param {Number} row Row index.\n */\n closeSubMenu(row) {\n let dataItem = this.hotMenu.getSourceDataAtRow(row);\n let menus = this.hotSubMenus[dataItem.key];\n\n if (menus) {\n menus.destroy();\n delete this.hotSubMenus[dataItem.key];\n }\n }\n\n /**\n * Close all opened sub menus.\n */\n closeAllSubMenus() {\n arrayEach(this.hotMenu.getData(), (value, row) => this.closeSubMenu(row));\n }\n\n /**\n * Checks if all created and opened sub menus are closed.\n *\n * @returns {Boolean}\n */\n isAllSubMenusClosed() {\n return Object.keys(this.hotSubMenus).length === 0;\n }\n\n /**\n * Destroy instance.\n */\n destroy() {\n this.clearLocalHooks();\n this.close();\n this.parentMenu = null;\n this.eventManager.destroy();\n }\n\n /**\n * Checks if menu was opened.\n *\n * @returns {Boolean} Returns `true` if menu was opened.\n */\n isOpened() {\n return this.hotMenu !== null;\n }\n\n /**\n * Execute menu command.\n *\n * @param {Event} [event]\n */\n executeCommand(event) {\n if (!this.isOpened() || !this.hotMenu.getSelectedLast()) {\n return;\n }\n const selectedItem = this.hotMenu.getSourceDataAtRow(this.hotMenu.getSelectedLast()[0]);\n\n this.runLocalHooks('select', selectedItem, event);\n\n if (selectedItem.isCommand === false || selectedItem.name === SEPARATOR) {\n return;\n }\n const selRanges = this.hot.getSelectedRange();\n const normalizedSelection = selRanges ? normalizeSelection(selRanges) : [];\n let autoClose = true;\n\n // Don't close context menu if item is disabled or it has submenu\n if (selectedItem.disabled === true ||\n (typeof selectedItem.disabled === 'function' && selectedItem.disabled.call(this.hot) === true) ||\n selectedItem.submenu) {\n autoClose = false;\n }\n\n this.runLocalHooks('executeCommand', selectedItem.key, normalizedSelection, event);\n\n if (this.isSubMenu()) {\n this.parentMenu.runLocalHooks('executeCommand', selectedItem.key, normalizedSelection, event);\n }\n\n if (autoClose) {\n this.close(true);\n }\n }\n\n /**\n * Set menu position based on dom event or based on literal object.\n *\n * @param {Event|Object} coords Event or literal Object with coordinates.\n */\n setPosition(coords) {\n const cursor = new Cursor(coords);\n\n if (this.options.keepInViewport) {\n if (cursor.fitsBelow(this.container)) {\n this.setPositionBelowCursor(cursor);\n\n } else if (cursor.fitsAbove(this.container)) {\n this.setPositionAboveCursor(cursor);\n\n } else {\n this.setPositionBelowCursor(cursor);\n }\n if (cursor.fitsOnRight(this.container)) {\n this.setPositionOnRightOfCursor(cursor);\n } else {\n this.setPositionOnLeftOfCursor(cursor);\n }\n } else {\n this.setPositionBelowCursor(cursor);\n this.setPositionOnRightOfCursor(cursor);\n }\n }\n\n /**\n * Set menu position above cursor object.\n *\n * @param {Cursor} cursor `Cursor` object.\n */\n setPositionAboveCursor(cursor) {\n let top = this.offset.above + cursor.top - this.container.offsetHeight;\n\n if (this.isSubMenu()) {\n top = cursor.top + cursor.cellHeight - this.container.offsetHeight + 3;\n }\n this.container.style.top = `${top}px`;\n }\n\n /**\n * Set menu position below cursor object.\n *\n * @param {Cursor} cursor `Cursor` object.\n */\n setPositionBelowCursor(cursor) {\n let top = this.offset.below + cursor.top;\n\n if (this.isSubMenu()) {\n top = cursor.top - 1;\n }\n this.container.style.top = `${top}px`;\n }\n\n /**\n * Set menu position on the right of cursor object.\n *\n * @param {Cursor} cursor `Cursor` object.\n */\n setPositionOnRightOfCursor(cursor) {\n let left;\n\n if (this.isSubMenu()) {\n left = 1 + cursor.left + cursor.cellWidth;\n } else {\n left = this.offset.right + 1 + cursor.left;\n }\n\n this.container.style.left = `${left}px`;\n }\n\n /**\n * Set menu position on the left of cursor object.\n *\n * @param {Cursor} cursor `Cursor` object.\n */\n setPositionOnLeftOfCursor(cursor) {\n let left = this.offset.left + cursor.left - this.container.offsetWidth + getScrollbarWidth() + 4;\n\n this.container.style.left = `${left}px`;\n }\n\n /**\n * Select first cell in opened menu.\n */\n selectFirstCell() {\n let cell = this.hotMenu.getCell(0, 0);\n\n if (isSeparator(cell) || isDisabled(cell) || isSelectionDisabled(cell)) {\n this.selectNextCell(0, 0);\n } else {\n this.hotMenu.selectCell(0, 0);\n }\n }\n\n /**\n * Select last cell in opened menu.\n */\n selectLastCell() {\n let lastRow = this.hotMenu.countRows() - 1;\n let cell = this.hotMenu.getCell(lastRow, 0);\n\n if (isSeparator(cell) || isDisabled(cell) || isSelectionDisabled(cell)) {\n this.selectPrevCell(lastRow, 0);\n } else {\n this.hotMenu.selectCell(lastRow, 0);\n }\n }\n\n /**\n * Select next cell in opened menu.\n *\n * @param {Number} row Row index.\n * @param {Number} col Column index.\n */\n selectNextCell(row, col) {\n let nextRow = row + 1;\n let cell = nextRow < this.hotMenu.countRows() ? this.hotMenu.getCell(nextRow, col) : null;\n\n if (!cell) {\n return;\n }\n if (isSeparator(cell) || isDisabled(cell) || isSelectionDisabled(cell)) {\n this.selectNextCell(nextRow, col);\n } else {\n this.hotMenu.selectCell(nextRow, col);\n }\n }\n\n /**\n * Select previous cell in opened menu.\n *\n * @param {Number} row Row index.\n * @param {Number} col Column index.\n */\n selectPrevCell(row, col) {\n let prevRow = row - 1;\n let cell = prevRow >= 0 ? this.hotMenu.getCell(prevRow, col) : null;\n\n if (!cell) {\n return;\n }\n if (isSeparator(cell) || isDisabled(cell) || isSelectionDisabled(cell)) {\n this.selectPrevCell(prevRow, col);\n } else {\n this.hotMenu.selectCell(prevRow, col);\n }\n }\n\n /**\n * Menu item renderer.\n *\n * @private\n */\n menuItemRenderer(hot, TD, row, col, prop, value) {\n let item = hot.getSourceDataAtRow(row);\n let wrapper = document.createElement('div');\n\n let isSubMenu = (item) => hasOwnProperty(item, 'submenu');\n let itemIsSeparator = (item) => new RegExp(SEPARATOR, 'i').test(item.name);\n let itemIsDisabled = (item) => item.disabled === true || (typeof item.disabled == 'function' && item.disabled.call(this.hot) === true);\n let itemIsSelectionDisabled = (item) => item.disableSelection;\n\n if (typeof value === 'function') {\n value = value.call(this.hot);\n }\n empty(TD);\n addClass(wrapper, 'htItemWrapper');\n TD.appendChild(wrapper);\n\n if (itemIsSeparator(item)) {\n addClass(TD, 'htSeparator');\n\n } else if (typeof item.renderer === 'function') {\n addClass(TD, 'htCustomMenuRenderer');\n TD.appendChild(item.renderer(hot, wrapper, row, col, prop, value));\n\n } else {\n fastInnerHTML(wrapper, value);\n }\n if (itemIsDisabled(item)) {\n addClass(TD, 'htDisabled');\n this.eventManager.addEventListener(TD, 'mouseenter', () => hot.deselectCell());\n\n } else if (itemIsSelectionDisabled(item)) {\n addClass(TD, 'htSelectionDisabled');\n this.eventManager.addEventListener(TD, 'mouseenter', () => hot.deselectCell());\n\n } else if (isSubMenu(item)) {\n addClass(TD, 'htSubmenu');\n\n if (itemIsSelectionDisabled(item)) {\n this.eventManager.addEventListener(TD, 'mouseenter', () => hot.deselectCell());\n } else {\n this.eventManager.addEventListener(TD, 'mouseenter', () => hot.selectCell(row, col, void 0, void 0, false, false));\n }\n } else {\n removeClass(TD, 'htSubmenu');\n removeClass(TD, 'htDisabled');\n\n if (itemIsSelectionDisabled(item)) {\n this.eventManager.addEventListener(TD, 'mouseenter', () => hot.deselectCell());\n } else {\n this.eventManager.addEventListener(TD, 'mouseenter', () => hot.selectCell(row, col, void 0, void 0, false, false));\n }\n }\n }\n\n /**\n * Create container/wrapper for handsontable.\n *\n * @private\n * @param {String} [name] Class name.\n * @returns {HTMLElement}\n */\n createContainer(name = null) {\n let container;\n\n if (name) {\n if (isFunction(name)) {\n name = name.call(this.hot);\n\n if (name === null || isUndefined(name)) {\n name = '';\n\n } else {\n name = name.toString();\n }\n }\n\n name = name.replace(/[^A-z0-9]/g, '_');\n name = `${this.options.className}Sub_${name}`;\n\n container = document.querySelector(`.${this.options.className}.${name}`);\n\n } else {\n container = document.querySelector(`.${this.options.className}`);\n }\n\n if (!container) {\n container = document.createElement('div');\n\n addClass(container, `htMenu ${this.options.className}`);\n\n if (name) {\n addClass(container, name);\n }\n document.getElementsByTagName('body')[0].appendChild(container);\n }\n\n return container;\n }\n\n /**\n * @private\n */\n blockMainTableCallbacks() {\n this._afterScrollCallback = function() {};\n this.hot.addHook('afterScrollVertically', this._afterScrollCallback);\n this.hot.addHook('afterScrollHorizontally', this._afterScrollCallback);\n }\n\n /**\n * @private\n */\n releaseMainTableCallbacks() {\n if (this._afterScrollCallback) {\n this.hot.removeHook('afterScrollVertically', this._afterScrollCallback);\n this.hot.removeHook('afterScrollHorizontally', this._afterScrollCallback);\n this._afterScrollCallback = null;\n }\n }\n\n /**\n * On before key down listener.\n *\n * @private\n * @param {Event} event\n */\n onBeforeKeyDown(event) {\n let selection = this.hotMenu.getSelectedLast();\n let stopEvent = false;\n this.keyEvent = true;\n\n switch (event.keyCode) {\n case KEY_CODES.ESCAPE:\n this.close();\n stopEvent = true;\n break;\n\n case KEY_CODES.ENTER:\n if (selection) {\n if (this.hotMenu.getSourceDataAtRow(selection[0]).submenu) {\n stopEvent = true;\n } else {\n this.executeCommand(event);\n this.close(true);\n }\n }\n break;\n\n case KEY_CODES.ARROW_DOWN:\n if (selection) {\n this.selectNextCell(selection[0], selection[1]);\n } else {\n this.selectFirstCell();\n }\n stopEvent = true;\n break;\n\n case KEY_CODES.ARROW_UP:\n if (selection) {\n this.selectPrevCell(selection[0], selection[1]);\n } else {\n this.selectLastCell();\n }\n stopEvent = true;\n break;\n\n case KEY_CODES.ARROW_RIGHT:\n if (selection) {\n let menu = this.openSubMenu(selection[0]);\n\n if (menu) {\n menu.selectFirstCell();\n }\n }\n stopEvent = true;\n\n break;\n\n case KEY_CODES.ARROW_LEFT:\n if (selection && this.isSubMenu()) {\n this.close();\n\n if (this.parentMenu) {\n this.parentMenu.hotMenu.listen();\n }\n stopEvent = true;\n }\n break;\n default:\n break;\n }\n if (stopEvent) {\n event.preventDefault();\n stopImmediatePropagation(event);\n }\n\n this.keyEvent = false;\n }\n\n /**\n * On after init listener.\n *\n * @private\n */\n onAfterInit() {\n const data = this.hotMenu.getSettings().data;\n const hiderStyle = this.hotMenu.view.wt.wtTable.hider.style;\n const holderStyle = this.hotMenu.view.wt.wtTable.holder.style;\n let currentHiderWidth = parseInt(hiderStyle.width, 10);\n\n let realHeight = arrayReduce(data, (accumulator, value) => accumulator + (value.name === SEPARATOR ? 1 : 26), 0);\n\n holderStyle.width = `${currentHiderWidth + 22}px`;\n holderStyle.height = `${realHeight + 4}px`;\n hiderStyle.height = holderStyle.height;\n }\n\n /**\n * On after selection listener.\n *\n * @param {Number} r Selection start row index.\n * @param {Number} c Selection start column index.\n * @param {Number} r2 Selection end row index.\n * @param {Number} c2 Selection end column index.\n * @param {Object} preventScrolling Object with `value` property where its value change will be observed.\n * @param {Number} selectionLayerLevel The number which indicates what selection layer is currently modified.\n */\n onAfterSelection(r, c, r2, c2, preventScrolling) {\n if (this.keyEvent === false) {\n preventScrolling.value = true;\n }\n }\n\n /**\n * Document mouse down listener.\n *\n * @private\n * @param {Event} event\n */\n onDocumentMouseDown(event) {\n if (!this.isOpened()) {\n return;\n }\n if (this.container && isChildOf(event.target, this.container)) {\n this.executeCommand(event);\n }\n // Close menu when clicked element is not belongs to menu itself\n if (this.options.standalone && this.hotMenu && !isChildOf(event.target, this.hotMenu.rootElement)) {\n this.close(true);\n\n // Automatically close menu when clicked element is not belongs to menu or submenu (not necessarily to itself)\n } else if ((this.isAllSubMenusClosed() || this.isSubMenu()) &&\n (!isChildOf(event.target, '.htMenu') && isChildOf(event.target, document))) {\n this.close(true);\n }\n }\n}\n\nmixin(Menu, localHooks);\n\nexport default Menu;\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/contextMenu/menu.js","import {getWindowScrollLeft, getWindowScrollTop} from './../../helpers/dom/element';\nimport {pageX, pageY} from './../../helpers/dom/event';\n\n/**\n * Helper class for checking if element will fit at the desired side of cursor.\n *\n * @class Cursor\n * @plugin ContextMenu\n */\nclass Cursor {\n constructor(object) {\n let windowScrollTop = getWindowScrollTop();\n let windowScrollLeft = getWindowScrollLeft();\n let top,\n topRelative;\n let left,\n leftRelative;\n let cellHeight,\n cellWidth;\n\n this.type = this.getSourceType(object);\n\n if (this.type === 'literal') {\n top = parseInt(object.top, 10);\n left = parseInt(object.left, 10);\n cellHeight = object.height || 0;\n cellWidth = object.width || 0;\n topRelative = top;\n leftRelative = left;\n top += windowScrollTop;\n left += windowScrollLeft;\n\n } else if (this.type === 'event') {\n top = parseInt(pageY(object), 10);\n left = parseInt(pageX(object), 10);\n cellHeight = object.target.clientHeight;\n cellWidth = object.target.clientWidth;\n topRelative = top - windowScrollTop;\n leftRelative = left - windowScrollLeft;\n }\n\n this.top = top;\n this.topRelative = topRelative;\n this.left = left;\n this.leftRelative = leftRelative;\n this.scrollTop = windowScrollTop;\n this.scrollLeft = windowScrollLeft;\n this.cellHeight = cellHeight;\n this.cellWidth = cellWidth;\n }\n\n /**\n * Get source type name.\n *\n * @param {*} object Event or Object with coordinates.\n * @returns {String} Returns one of this values: `'literal'`, `'event'`.\n */\n getSourceType(object) {\n let type = 'literal';\n\n if (object instanceof Event) {\n type = 'event';\n }\n\n return type;\n }\n\n /**\n * Checks if element can be placed above the cursor.\n *\n * @param {HTMLElement} element Element to check if it's size will fit above the cursor.\n * @returns {Boolean}\n */\n fitsAbove(element) {\n return this.topRelative >= element.offsetHeight;\n }\n\n /**\n * Checks if element can be placed below the cursor.\n *\n * @param {HTMLElement} element Element to check if it's size will fit below the cursor.\n * @param {Number} [viewportHeight] The viewport height.\n * @returns {Boolean}\n */\n fitsBelow(element, viewportHeight = window.innerHeight) {\n return this.topRelative + element.offsetHeight <= viewportHeight;\n }\n\n /**\n * Checks if element can be placed on the right of the cursor.\n *\n * @param {HTMLElement} element Element to check if it's size will fit on the right of the cursor.\n * @param {Number} [viewportWidth] The viewport width.\n * @returns {Boolean}\n */\n fitsOnRight(element, viewportWidth = window.innerWidth) {\n return this.leftRelative + this.cellWidth + element.offsetWidth <= viewportWidth;\n }\n\n /**\n * Checks if element can be placed on the left on the cursor.\n *\n * @param {HTMLElement} element Element to check if it's size will fit on the left of the cursor.\n * @returns {Boolean}\n */\n fitsOnLeft(element) {\n return this.leftRelative >= element.offsetWidth;\n }\n}\n\nexport default Cursor;\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/contextMenu/cursor.js","// removed by extract-text-webpack-plugin\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/plugins/contextMenu/contextMenu.css\n// module id = 313\n// module chunks = 0","import BasePlugin from './../_base.js';\nimport Hooks from './../../pluginHooks';\nimport SheetClip from './../../../lib/SheetClip/SheetClip';\nimport {CellCoords, CellRange} from './../../3rdparty/walkontable/src';\nimport {getSelectionText} from './../../helpers/dom/element';\nimport {arrayEach} from './../../helpers/array';\nimport {rangeEach} from './../../helpers/number';\nimport {registerPlugin} from './../../plugins';\nimport Textarea from './textarea';\nimport copyItem from './contextMenuItem/copy';\nimport cutItem from './contextMenuItem/cut';\nimport EventManager from './../../eventManager';\nimport PasteEvent from './pasteEvent';\n\nimport './copyPaste.css';\n\nHooks.getSingleton().register('afterCopyLimit');\nHooks.getSingleton().register('modifyCopyableRange');\nHooks.getSingleton().register('beforeCut');\nHooks.getSingleton().register('afterCut');\nHooks.getSingleton().register('beforePaste');\nHooks.getSingleton().register('afterPaste');\nHooks.getSingleton().register('beforeCopy');\nHooks.getSingleton().register('afterCopy');\n\nconst ROWS_LIMIT = 1000;\nconst COLUMNS_LIMIT = 1000;\nconst privatePool = new WeakMap();\n\n/**\n * @description\n * This plugin enables the copy/paste functionality in the Handsontable.\n *\n * @example\n * ```js\n * ...\n * copyPaste: true,\n * ...\n * ```\n * @class CopyPaste\n * @plugin CopyPaste\n */\nclass CopyPaste extends BasePlugin {\n constructor(hotInstance) {\n super(hotInstance);\n /**\n * Event manager\n *\n * @type {EventManager}\n */\n this.eventManager = new EventManager(this);\n /**\n * Maximum number of columns than can be copied to clipboard using <kbd>CTRL</kbd> + <kbd>C</kbd>.\n *\n * @private\n * @type {Number}\n * @default 1000\n */\n this.columnsLimit = COLUMNS_LIMIT;\n /**\n * Ranges of the cells coordinates, which should be used to copy/cut/paste actions.\n *\n * @private\n * @type {Array}\n */\n this.copyableRanges = [];\n /**\n * Defines paste (<kbd>CTRL</kbd> + <kbd>V</kbd>) behavior.\n * * Default value `\"overwrite\"` will paste clipboard value over current selection.\n * * When set to `\"shift_down\"`, clipboard data will be pasted in place of current selection, while all selected cells are moved down.\n * * When set to `\"shift_right\"`, clipboard data will be pasted in place of current selection, while all selected cells are moved right.\n *\n * @private\n * @type {String}\n * @default 'overwrite'\n */\n this.pasteMode = 'overwrite';\n /**\n * Maximum number of rows than can be copied to clipboard using <kbd>CTRL</kbd> + <kbd>C</kbd>.\n *\n * @private\n * @type {Number}\n * @default 1000\n */\n this.rowsLimit = ROWS_LIMIT;\n /**\n * The `textarea` element which is necessary to process copying, cutting off and pasting.\n *\n * @private\n * @type {HTMLElement}\n * @default undefined\n */\n this.textarea = void 0;\n\n privatePool.set(this, {\n isTriggeredByCopy: false,\n isTriggeredByCut: false,\n isBeginEditing: false,\n isFragmentSelectionEnabled: false,\n });\n }\n\n /**\n * Check if plugin is enabled.\n *\n * @returns {Boolean}\n */\n isEnabled() {\n return !!this.hot.getSettings().copyPaste;\n }\n\n /**\n * Enable the plugin.\n */\n enablePlugin() {\n if (this.enabled) {\n return;\n }\n const settings = this.hot.getSettings();\n const priv = privatePool.get(this);\n\n this.textarea = Textarea.getSingleton();\n priv.isFragmentSelectionEnabled = settings.fragmentSelection;\n\n if (typeof settings.copyPaste === 'object') {\n this.pasteMode = settings.copyPaste.pasteMode || this.pasteMode;\n this.rowsLimit = settings.copyPaste.rowsLimit || this.rowsLimit;\n this.columnsLimit = settings.copyPaste.columnsLimit || this.columnsLimit;\n }\n\n this.addHook('afterContextMenuDefaultOptions', (options) => this.onAfterContextMenuDefaultOptions(options));\n this.addHook('afterSelectionEnd', () => this.onAfterSelectionEnd());\n\n this.registerEvents();\n\n super.enablePlugin();\n }\n\n /**\n * Updates the plugin to use the latest options you have specified.\n */\n updatePlugin() {\n this.disablePlugin();\n this.enablePlugin();\n\n super.updatePlugin();\n }\n\n /**\n * Disable plugin for this Handsontable instance.\n */\n disablePlugin() {\n if (this.textarea) {\n this.textarea.destroy();\n }\n\n super.disablePlugin();\n }\n\n /**\n * Prepares copyable text from the cells selection in the invisible textarea.\n *\n * @function setCopyable\n * @memberof CopyPaste#\n */\n setCopyableText() {\n const selRange = this.hot.getSelectedRangeLast();\n\n if (!selRange) {\n return;\n }\n const topLeft = selRange.getTopLeftCorner();\n const bottomRight = selRange.getBottomRightCorner();\n const startRow = topLeft.row;\n const startCol = topLeft.col;\n const endRow = bottomRight.row;\n const endCol = bottomRight.col;\n const finalEndRow = Math.min(endRow, startRow + this.rowsLimit - 1);\n const finalEndCol = Math.min(endCol, startCol + this.columnsLimit - 1);\n\n this.copyableRanges.length = 0;\n\n this.copyableRanges.push({\n startRow,\n startCol,\n endRow: finalEndRow,\n endCol: finalEndCol\n });\n\n this.copyableRanges = this.hot.runHooks('modifyCopyableRange', this.copyableRanges);\n\n if (endRow !== finalEndRow || endCol !== finalEndCol) {\n this.hot.runHooks('afterCopyLimit', endRow - startRow + 1, endCol - startCol + 1, this.rowsLimit, this.columnsLimit);\n }\n }\n\n /**\n * Create copyable text releated to range objects.\n *\n * @since 0.19.0\n * @param {Array} ranges Array of Objects with properties `startRow`, `endRow`, `startCol` and `endCol`.\n * @returns {String} Returns string which will be copied into clipboard.\n */\n getRangedCopyableData(ranges) {\n let dataSet = [];\n let copyableRows = [];\n let copyableColumns = [];\n\n // Count all copyable rows and columns\n arrayEach(ranges, (range) => {\n rangeEach(range.startRow, range.endRow, (row) => {\n if (copyableRows.indexOf(row) === -1) {\n copyableRows.push(row);\n }\n });\n rangeEach(range.startCol, range.endCol, (column) => {\n if (copyableColumns.indexOf(column) === -1) {\n copyableColumns.push(column);\n }\n });\n });\n // Concat all rows and columns data defined in ranges into one copyable string\n arrayEach(copyableRows, (row) => {\n let rowSet = [];\n\n arrayEach(copyableColumns, (column) => {\n rowSet.push(this.hot.getCopyableData(row, column));\n });\n\n dataSet.push(rowSet);\n });\n\n return SheetClip.stringify(dataSet);\n }\n\n /**\n * Create copyable text releated to range objects.\n *\n * @since 0.31.1\n * @param {Array} ranges Array of Objects with properties `startRow`, `startCol`, `endRow` and `endCol`.\n * @returns {Array} Returns array of arrays which will be copied into clipboard.\n */\n getRangedData(ranges) {\n const dataSet = [];\n const copyableRows = [];\n const copyableColumns = [];\n\n // Count all copyable rows and columns\n arrayEach(ranges, (range) => {\n rangeEach(range.startRow, range.endRow, (row) => {\n if (copyableRows.indexOf(row) === -1) {\n copyableRows.push(row);\n }\n });\n rangeEach(range.startCol, range.endCol, (column) => {\n if (copyableColumns.indexOf(column) === -1) {\n copyableColumns.push(column);\n }\n });\n });\n // Concat all rows and columns data defined in ranges into one copyable string\n arrayEach(copyableRows, (row) => {\n let rowSet = [];\n\n arrayEach(copyableColumns, (column) => {\n rowSet.push(this.hot.getCopyableData(row, column));\n });\n\n dataSet.push(rowSet);\n });\n\n return dataSet;\n }\n\n /**\n * Copy action.\n */\n copy() {\n const priv = privatePool.get(this);\n\n priv.isTriggeredByCopy = true;\n\n this.textarea.select();\n document.execCommand('copy');\n }\n\n /**\n * Cut action.\n */\n cut() {\n const priv = privatePool.get(this);\n\n priv.isTriggeredByCut = true;\n\n this.textarea.select();\n document.execCommand('cut');\n }\n\n /**\n * Simulated paste action.\n *\n * @param {String} [value=''] New value, which should be `pasted`.\n */\n paste(value = '') {\n let pasteData = new PasteEvent();\n pasteData.clipboardData.setData('text/plain', value);\n\n this.onPaste(pasteData);\n }\n\n /**\n * Register event listeners.\n *\n * @private\n */\n registerEvents() {\n this.eventManager.addEventListener(this.textarea.element, 'paste', (event) => this.onPaste(event));\n this.eventManager.addEventListener(this.textarea.element, 'cut', (event) => this.onCut(event));\n this.eventManager.addEventListener(this.textarea.element, 'copy', (event) => this.onCopy(event));\n }\n\n /**\n * `copy` event callback on textarea element.\n *\n * @param {Event} event ClipboardEvent.\n * @private\n */\n onCopy(event) {\n const priv = privatePool.get(this);\n\n if (!this.hot.isListening() && !priv.isTriggeredByCopy) {\n return;\n }\n\n this.setCopyableText();\n priv.isTriggeredByCopy = false;\n\n let rangedData = this.getRangedData(this.copyableRanges);\n let allowCopying = !!this.hot.runHooks('beforeCopy', rangedData, this.copyableRanges);\n let value = '';\n\n if (allowCopying) {\n value = SheetClip.stringify(rangedData);\n\n if (event && event.clipboardData) {\n event.clipboardData.setData('text/plain', value);\n\n } else if (typeof ClipboardEvent === 'undefined') {\n window.clipboardData.setData('Text', value);\n }\n\n this.hot.runHooks('afterCopy', rangedData, this.copyableRanges);\n }\n\n event.preventDefault();\n }\n\n /**\n * `cut` event callback on textarea element.\n *\n * @param {Event} event ClipboardEvent.\n * @private\n */\n onCut(event) {\n const priv = privatePool.get(this);\n\n if (!this.hot.isListening() && !priv.isTriggeredByCut) {\n return;\n }\n\n this.setCopyableText();\n priv.isTriggeredByCut = false;\n\n let rangedData = this.getRangedData(this.copyableRanges);\n let allowCuttingOut = !!this.hot.runHooks('beforeCut', rangedData, this.copyableRanges);\n let value;\n\n if (allowCuttingOut) {\n value = SheetClip.stringify(rangedData);\n\n if (event && event.clipboardData) {\n event.clipboardData.setData('text/plain', value);\n\n } else if (typeof ClipboardEvent === 'undefined') {\n window.clipboardData.setData('Text', value);\n }\n\n this.hot.emptySelectedCells();\n this.hot.runHooks('afterCut', rangedData, this.copyableRanges);\n }\n\n event.preventDefault();\n }\n\n /**\n * `paste` event callback on textarea element.\n *\n * @param {Event} event ClipboardEvent or pseudo ClipboardEvent, if paste was called manually.\n * @private\n */\n onPaste(event) {\n if (!this.hot.isListening()) {\n return;\n }\n if (event && event.preventDefault) {\n event.preventDefault();\n }\n\n let inputArray;\n\n if (event && typeof event.clipboardData !== 'undefined') {\n this.textarea.setValue(event.clipboardData.getData('text/plain'));\n\n } else if (typeof ClipboardEvent === 'undefined' && typeof window.clipboardData !== 'undefined') {\n this.textarea.setValue(window.clipboardData.getData('Text'));\n }\n\n inputArray = SheetClip.parse(this.textarea.getValue());\n this.textarea.setValue(' ');\n\n if (inputArray.length === 0) {\n return;\n }\n\n let allowPasting = !!this.hot.runHooks('beforePaste', inputArray, this.copyableRanges);\n\n if (!allowPasting) {\n return;\n }\n\n let selected = this.hot.getSelectedLast();\n let coordsFrom = new CellCoords(selected[0], selected[1]);\n let coordsTo = new CellCoords(selected[2], selected[3]);\n let cellRange = new CellRange(coordsFrom, coordsFrom, coordsTo);\n let topLeftCorner = cellRange.getTopLeftCorner();\n let bottomRightCorner = cellRange.getBottomRightCorner();\n let areaStart = topLeftCorner;\n let areaEnd = new CellCoords(\n Math.max(bottomRightCorner.row, inputArray.length - 1 + topLeftCorner.row),\n Math.max(bottomRightCorner.col, inputArray[0].length - 1 + topLeftCorner.col));\n\n let isSelRowAreaCoverInputValue = coordsTo.row - coordsFrom.row >= inputArray.length - 1;\n let isSelColAreaCoverInputValue = coordsTo.col - coordsFrom.col >= inputArray[0].length - 1;\n\n this.hot.addHookOnce('afterChange', (changes) => {\n let changesLength = changes ? changes.length : 0;\n\n if (changesLength) {\n let offset = {row: 0, col: 0};\n let highestColumnIndex = -1;\n\n arrayEach(changes, (change, index) => {\n let nextChange = changesLength > index + 1 ? changes[index + 1] : null;\n\n if (nextChange) {\n if (!isSelRowAreaCoverInputValue) {\n offset.row += Math.max(nextChange[0] - change[0] - 1, 0);\n }\n if (!isSelColAreaCoverInputValue && change[1] > highestColumnIndex) {\n highestColumnIndex = change[1];\n offset.col += Math.max(nextChange[1] - change[1] - 1, 0);\n }\n }\n });\n this.hot.selectCell(areaStart.row, areaStart.col, areaEnd.row + offset.row, areaEnd.col + offset.col);\n }\n });\n\n this.hot.populateFromArray(areaStart.row, areaStart.col, inputArray, areaEnd.row, areaEnd.col, 'CopyPaste.paste', this.pasteMode);\n this.hot.runHooks('afterPaste', inputArray, this.copyableRanges);\n }\n\n /**\n * Add copy, cut and paste options to the Context Menu.\n *\n * @private\n * @param {Object} options Contains default added options of the Context Menu.\n */\n onAfterContextMenuDefaultOptions(options) {\n options.items.push(\n {\n name: '---------',\n },\n copyItem(this),\n cutItem(this)\n );\n }\n\n /**\n * We have to keep focus on textarea element, to make possible use of the browser tools (copy, cut, paste).\n *\n * @private\n */\n onAfterSelectionEnd() {\n const priv = privatePool.get(this);\n const editor = this.hot.getActiveEditor();\n\n if (editor && typeof editor.isOpened !== 'undefined' && editor.isOpened()) {\n return;\n }\n if (priv.isFragmentSelectionEnabled && !this.textarea.isActive() && getSelectionText()) {\n return;\n }\n\n this.setCopyableText();\n this.textarea.select();\n }\n\n /**\n * Destroy plugin instance.\n */\n destroy() {\n if (this.textarea) {\n this.textarea.destroy();\n }\n\n super.destroy();\n }\n}\n\nregisterPlugin('CopyPaste', CopyPaste);\n\nexport default CopyPaste;\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/copyPaste/copyPaste.js","/**\n * @class Textarea\n *\n * @plugin CopyPaste\n */\nclass Textarea {\n static getSingleton() {\n globalSingleton.append();\n\n return globalSingleton;\n }\n\n constructor() {\n /**\n * Main textarea element.\n *\n * @type {HTMLElement}\n */\n this.element = void 0;\n /**\n * Store information about append to the document.body.\n *\n * @type {Boolean}\n */\n this.isAppended = false;\n /**\n * Reference counter.\n *\n * @type {Number}\n */\n this.refCounter = 0;\n }\n\n /**\n * Apends textarea element to the `body`\n */\n append() {\n if (this.hasBeenDestroyed()) {\n this.create();\n }\n\n this.refCounter++;\n\n if (!this.isAppended && document.body) {\n if (document.body) {\n this.isAppended = true;\n document.body.appendChild(this.element);\n }\n }\n }\n\n /**\n * Prepares textarea element with proper attributes.\n */\n create() {\n this.element = document.createElement('textarea');\n this.element.id = 'HandsontableCopyPaste';\n this.element.className = 'copyPaste';\n this.element.tabIndex = -1;\n this.element.autocomplete = 'off';\n this.element.wrap = 'hard';\n this.element.value = ' ';\n }\n\n /**\n * Deselects textarea element if is active.\n */\n deselect() {\n if (this.element === document.activeElement) {\n document.activeElement.blur();\n }\n }\n\n /**\n * Destroy instance\n */\n destroy() {\n this.refCounter--;\n this.refCounter = this.refCounter < 0 ? 0 : this.refCounter;\n\n if (this.hasBeenDestroyed() && this.element && this.element.parentNode) {\n this.element.parentNode.removeChild(this.element);\n this.element = null;\n this.isAppended = false;\n }\n }\n\n /**\n * Getter for the element.\n *\n * @returns {String}\n */\n getValue() {\n return this.element.value;\n }\n\n /**\n * Check if instance has been destroyed\n *\n * @returns {Boolean}\n */\n hasBeenDestroyed() {\n return this.refCounter < 1;\n }\n\n /**\n * Check if the element is an active element in frame.\n *\n * @returns {Boolean}\n */\n isActive() {\n return this.element === document.activeElement;\n }\n\n /**\n * Sets focus on the element and select content.\n */\n select() {\n this.element.focus();\n this.element.select();\n }\n\n /**\n * Setter for the element.\n *\n * @param {String} data Value which should be insert into the element.\n */\n setValue(data) {\n this.element.value = data;\n }\n}\n\nconst globalSingleton = new Textarea();\n\nexport default Textarea;\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/copyPaste/textarea.js","import * as C from './../../../i18n/constants';\n\nexport default function copyItem(copyPastePlugin) {\n return {\n key: 'copy',\n name() {\n return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_COPY);\n },\n callback() {\n copyPastePlugin.copy();\n },\n disabled() {\n const selected = this.getSelected();\n\n if (!selected || selected.length > 1) {\n return true;\n }\n\n return false;\n },\n hidden: false\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/copyPaste/contextMenuItem/copy.js","import * as C from './../../../i18n/constants';\n\nexport default function cutItem(copyPastePlugin) {\n return {\n key: 'cut',\n name() {\n return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_CUT);\n },\n callback() {\n copyPastePlugin.cut();\n },\n disabled() {\n const selected = this.getSelected();\n\n if (!selected || selected.length > 1) {\n return true;\n }\n\n return false;\n },\n hidden: false\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/copyPaste/contextMenuItem/cut.js","import ClipboardData from './clipboardData';\n\nexport default class PasteEvent {\n constructor() {\n this.clipboardData = new ClipboardData();\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/copyPaste/pasteEvent.js","export default class ClipboardData {\n constructor() {\n this.data = {};\n }\n setData(type, value) {\n this.data[type] = value;\n }\n getData(type) {\n return this.data[type] || void 0;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/copyPaste/clipboardData.js","// removed by extract-text-webpack-plugin\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/plugins/copyPaste/copyPaste.css\n// module id = 320\n// module chunks = 0","import BasePlugin from './../_base';\nimport { registerPlugin } from './../../plugins';\nimport { hasOwnProperty } from './../../helpers/object';\nimport { rangeEach } from './../../helpers/number';\nimport {\n CellRange,\n Selection\n} from './../../3rdparty/walkontable/src';\nimport Hooks from './../../pluginHooks';\nimport {arrayEach} from './../../helpers/array';\nimport * as C from './../../i18n/constants';\nimport bottom from './contextMenuItem/bottom';\nimport left from './contextMenuItem/left';\nimport noBorders from './contextMenuItem/noBorders';\nimport right from './contextMenuItem/right';\nimport top from './contextMenuItem/top';\nimport {\n createClassName,\n createDefaultCustomBorder,\n createSingleEmptyBorder,\n createEmptyBorders,\n extendDefaultBorder\n} from './utils';\n/**\n * @plugin CustomBorders\n *\n * @description\n * This plugin enables an option to apply custom borders through the context menu (configurable with context menu key `borders`).\n *\n * To initialize Handsontable with predefined custom borders, provide cell coordinates and border styles in a form of an array.\n *\n * See [Custom Borders](http://docs.handsontable.com/demo-custom-borders.html) demo for more examples.\n *\n * @example\n * ```js\n * ...\n * customBorders: [\n * {\n * range: {\n * from: {\n * row: 1,\n * col: 1\n * },\n * to: {\n * row: 3,\n * col: 4\n * },\n * },\n * left: {},\n * right: {},\n * top: {},\n * bottom: {},\n * },\n * ],\n * ...\n *\n * // or\n * ...\n * customBorders: [\n * { row: 2,\n * col: 2,\n * left: {\n * width: 2,\n * color: 'red',\n * },\n * right: {\n * width: 1,\n * color: 'green',\n * },\n * top: '',\n * bottom: '',\n * }.\n * ],\n * ...\n * ```\n * @private\n * @class CustomBorders\n */\nclass CustomBorders extends BasePlugin {\n constructor(hotInstance) {\n super(hotInstance);\n\n /**\n * Saved borders settings.\n *\n * @type {Array}\n */\n this.savedBorderSettings = void 0;\n }\n\n /**\n * Check if the plugin is enabled in the handsontable settings.\n *\n * @returns {Boolean}\n */\n isEnabled() {\n return !!this.hot.getSettings().customBorders;\n }\n\n /**\n * Enable plugin for this Handsontable instance.\n */\n enablePlugin() {\n if (this.enabled) {\n return;\n }\n\n this.addHook('afterContextMenuDefaultOptions', (options) => this.onAfterContextMenuDefaultOptions(options));\n this.addHook('afterInit', () => this.onAfterInit());\n\n super.enablePlugin();\n }\n\n /**\n * Disable plugin for this Handsontable instance.\n */\n disablePlugin() {\n this.clearBorders();\n\n super.disablePlugin();\n }\n\n /**\n * Updates the plugin to use the latest options you have specified.\n */\n updatePlugin() {\n this.disablePlugin();\n this.enablePlugin();\n\n this.changeBorderSettings();\n\n super.updatePlugin();\n }\n\n /**\n * Get index of border from the settings.\n *\n * @param {String} className Class name as string.\n * @returns {Number}\n */\n getSettingIndex(className) {\n let index = -1;\n\n arrayEach(this.hot.selection.highlight.borders, (selection, i) => {\n if (selection.settings.className === className) {\n index = i;\n\n return false;\n }\n });\n\n return index;\n }\n\n /**\n * Insert WalkontableSelection instance into Walkontable settings.\n *\n * @param {Object} border Object with `row` and `col`, `left`, `right`, `top` and `bottom`, `className` and `border` ({Object} with `color`, `width` and `cornerVisible` property) properties.\n */\n insertBorderIntoSettings(border) {\n let coordinates = {\n row: border.row,\n col: border.col\n };\n let selection = new Selection(border, new CellRange(coordinates, coordinates, coordinates));\n let index = this.getSettingIndex(border.className);\n\n if (index >= 0) {\n this.hot.selection.highlight.borders[index] = selection;\n } else {\n this.hot.selection.highlight.borders.push(selection);\n }\n }\n\n /**\n * Prepare borders from setting (single cell).\n *\n * @param {Number} row Visual row index.\n * @param {Number} col Visual column index.\n * @param {Object} borderObj Object with `row` and `col`, `left`, `right`, `top` and `bottom` properties.\n */\n prepareBorderFromCustomAdded(row, col, borderObj) {\n let border = createEmptyBorders(row, col);\n\n border = extendDefaultBorder(border, borderObj);\n this.hot.setCellMeta(row, col, 'borders', border);\n\n this.insertBorderIntoSettings(border);\n }\n\n /** *\n * Prepare borders from setting (object).\n *\n * @param {Object} rowObj Object with `range`, `left`, `right`, `top` and `bottom` properties.\n */\n prepareBorderFromCustomAddedRange(rowObj) {\n let range = rowObj.range;\n\n rangeEach(range.from.row, range.to.row, (rowIndex) => {\n rangeEach(range.from.col, range.to.col, (colIndex) => {\n let border = createEmptyBorders(rowIndex, colIndex);\n let add = 0;\n\n if (rowIndex === range.from.row) {\n add += 1;\n\n if (hasOwnProperty(rowObj, 'top')) {\n border.top = rowObj.top;\n }\n }\n\n if (rowIndex === range.to.row) {\n add += 1;\n\n if (hasOwnProperty(rowObj, 'bottom')) {\n border.bottom = rowObj.bottom;\n }\n }\n\n if (colIndex === range.from.col) {\n add += 1;\n\n if (hasOwnProperty(rowObj, 'left')) {\n border.left = rowObj.left;\n }\n }\n\n if (colIndex === range.to.col) {\n add += 1;\n\n if (hasOwnProperty(rowObj, 'right')) {\n border.right = rowObj.right;\n }\n }\n\n if (add > 0) {\n this.hot.setCellMeta(rowIndex, colIndex, 'borders', border);\n this.insertBorderIntoSettings(border);\n }\n });\n });\n }\n\n /**\n * Remove borders divs from DOM.\n *\n * @param {String} borderClassName Border class name as string.\n */\n removeBordersFromDom(borderClassName) {\n let borders = this.hot.rootElement.querySelectorAll(`.${borderClassName}:not(td)`);\n\n rangeEach(0, borders.length - 1, (index) => {\n let parent = borders[index].parentNode;\n\n if (parent.parentNode) {\n parent.parentNode.removeChild(parent);\n }\n });\n }\n\n /**\n * Remove border (triggered from context menu).\n *\n * @param {Number} row Visual row index.\n * @param {Number} col Visual column index.\n */\n removeAllBorders(row, col) {\n let borderClassName = createClassName(row, col);\n\n this.removeBordersFromDom(borderClassName);\n this.hot.removeCellMeta(row, col, 'borders');\n }\n\n /**\n * Set borders for each cell re. to border position.\n *\n * @param {Number} row Visual row index.\n * @param {Number} col Visual column index.\n * @param {String} place Coordinate where add/remove border - `top`, `bottom`, `left`, `right` and `noBorders`.\n * @param {Boolean} remove True when remove borders, and false when add borders.\n */\n setBorder(row, col, place, remove) {\n let bordersMeta = this.hot.getCellMeta(row, col).borders;\n\n if (!bordersMeta || bordersMeta.border === void 0) {\n bordersMeta = createEmptyBorders(row, col);\n }\n\n if (remove) {\n bordersMeta[place] = createSingleEmptyBorder();\n } else {\n bordersMeta[place] = createDefaultCustomBorder();\n }\n\n this.hot.setCellMeta(row, col, 'borders', bordersMeta);\n\n let borderClassName = createClassName(row, col);\n this.removeBordersFromDom(borderClassName);\n this.insertBorderIntoSettings(bordersMeta);\n\n this.hot.render();\n }\n\n /**\n * Prepare borders based on cell and border position.\n *\n * @param {Object} selected\n * @param {String} place Coordinate where add/remove border - `top`, `bottom`, `left`, `right` and `noBorders`.\n * @param {Boolean} remove True when remove borders, and false when add borders.\n */\n prepareBorder(selected, place, remove) {\n arrayEach(selected, ({start, end}) => {\n if (start.row === end.row && start.col === end.col) {\n if (place === 'noBorders') {\n this.removeAllBorders(start.row, start.col);\n } else {\n this.setBorder(start.row, start.col, place, remove);\n }\n\n } else {\n switch (place) {\n case 'noBorders':\n rangeEach(start.col, end.col, (colIndex) => {\n rangeEach(start.row, end.row, (rowIndex) => {\n this.removeAllBorders(rowIndex, colIndex);\n });\n });\n break;\n\n case 'top':\n rangeEach(start.col, end.col, (topCol) => {\n this.setBorder(start.row, topCol, place, remove);\n });\n break;\n\n case 'right':\n rangeEach(start.row, end.row, (rowRight) => {\n this.setBorder(rowRight, end.col, place, remove);\n });\n break;\n\n case 'bottom':\n rangeEach(start.col, end.col, (bottomCol) => {\n this.setBorder(end.row, bottomCol, place, remove);\n });\n break;\n\n case 'left':\n rangeEach(start.row, end.row, (rowLeft) => {\n this.setBorder(rowLeft, start.col, place, remove);\n });\n break;\n default:\n break;\n }\n }\n });\n }\n\n /**\n * Create borders from settings.\n *\n * @private\n * @param {Array} customBorders Object with `row` and `col`, `left`, `right`, `top` and `bottom` properties.\n */\n createCustomBorders(customBorders) {\n rangeEach(0, customBorders.length - 1, (index) => {\n if (customBorders[index].range) {\n this.prepareBorderFromCustomAddedRange(customBorders[index]);\n\n } else {\n this.prepareBorderFromCustomAdded(customBorders[index].row, customBorders[index].col, customBorders[index]);\n }\n });\n\n this.hot.render();\n this.hot.view.wt.draw(true);\n }\n\n /**\n * Add border options to context menu.\n *\n * @private\n * @param {Object} defaultOptions Context menu items.\n */\n onAfterContextMenuDefaultOptions(defaultOptions) {\n if (!this.hot.getSettings().customBorders) {\n return;\n }\n\n defaultOptions.items.push({\n name: '---------',\n }, {\n key: 'borders',\n name() {\n return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_BORDERS);\n },\n disabled() {\n return this.selection.isSelectedByCorner();\n },\n submenu: {\n items: [\n top(this),\n right(this),\n bottom(this),\n left(this),\n noBorders(this)\n ]\n }\n });\n }\n\n /**\n * Clear borders.\n *\n * @private\n */\n clearBorders() {\n let bordersFromTable = this.hot.rootElement.querySelectorAll('td[class^=\"border\"]');\n\n rangeEach(0, bordersFromTable.length - 1, (index) => {\n this.removeBordersFromDom(bordersFromTable[index].className);\n });\n }\n\n /**\n * Change borders from settings.\n *\n * @private\n */\n changeBorderSettings() {\n let customBorders = this.hot.getSettings().customBorders;\n\n if (customBorders) {\n if (Array.isArray(customBorders)) {\n this.savedBorderSettings = customBorders;\n this.createCustomBorders(customBorders);\n\n } else if (customBorders !== void 0) {\n let borders = this.savedBorderSettings ? this.savedBorderSettings : customBorders;\n\n this.createCustomBorders(borders);\n }\n }\n }\n\n /**\n * `afterInit` hook callback.\n *\n * @private\n */\n onAfterInit() {\n this.changeBorderSettings();\n }\n\n /**\n * Destroy plugin instance.\n */\n destroy() {\n super.destroy();\n }\n}\n\nregisterPlugin('customBorders', CustomBorders);\n\nexport default CustomBorders;\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/customBorders/customBorders.js","import * as C from './../../../i18n/constants';\nimport {checkSelectionBorders, markSelected} from './../utils';\n\nexport default function bottom(customBordersPlugin) {\n return {\n key: 'borders:bottom',\n name() {\n let label = this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_BORDERS_BOTTOM);\n let hasBorder = checkSelectionBorders(this, 'bottom');\n if (hasBorder) {\n label = markSelected(label);\n }\n return label;\n },\n callback(key, selected) {\n let hasBorder = checkSelectionBorders(this, 'bottom');\n customBordersPlugin.prepareBorder(selected, 'bottom', hasBorder);\n }\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/customBorders/contextMenuItem/bottom.js","import * as C from './../../../i18n/constants';\nimport {checkSelectionBorders, markSelected} from './../utils';\n\nexport default function left(customBordersPlugin) {\n return {\n key: 'borders:left',\n name() {\n let label = this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_BORDERS_LEFT);\n let hasBorder = checkSelectionBorders(this, 'left');\n if (hasBorder) {\n label = markSelected(label);\n }\n\n return label;\n },\n callback(key, selected) {\n let hasBorder = checkSelectionBorders(this, 'left');\n customBordersPlugin.prepareBorder(selected, 'left', hasBorder);\n }\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/customBorders/contextMenuItem/left.js","import * as C from './../../../i18n/constants';\nimport {checkSelectionBorders} from './../utils';\n\nexport default function noBorders(customBordersPlugin) {\n return {\n key: 'borders:no_borders',\n name() {\n return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_REMOVE_BORDERS);\n },\n callback(key, selected) {\n customBordersPlugin.prepareBorder(selected, 'noBorders');\n },\n disabled() {\n return !checkSelectionBorders(this);\n }\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/customBorders/contextMenuItem/noBorders.js","import * as C from './../../../i18n/constants';\nimport {checkSelectionBorders, markSelected} from './../utils';\n\nexport default function right(customBordersPlugin) {\n return {\n key: 'borders:right',\n name() {\n let label = this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_BORDERS_RIGHT);\n let hasBorder = checkSelectionBorders(this, 'right');\n if (hasBorder) {\n label = markSelected(label);\n }\n return label;\n },\n callback(key, selected) {\n let hasBorder = checkSelectionBorders(this, 'right');\n customBordersPlugin.prepareBorder(selected, 'right', hasBorder);\n }\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/customBorders/contextMenuItem/right.js","import * as C from './../../../i18n/constants';\nimport {checkSelectionBorders, markSelected} from './../utils';\n\nexport default function top(customBordersPlugin) {\n return {\n key: 'borders:top',\n name() {\n let label = this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_BORDERS_TOP);\n let hasBorder = checkSelectionBorders(this, 'top');\n if (hasBorder) {\n label = markSelected(label);\n }\n\n return label;\n },\n callback(key, selected) {\n let hasBorder = checkSelectionBorders(this, 'top');\n customBordersPlugin.prepareBorder(selected, 'top', hasBorder);\n }\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/customBorders/contextMenuItem/top.js","import BasePlugin from './../_base';\nimport EventManager from './../../eventManager';\nimport {registerPlugin} from './../../plugins';\n\n/**\n * @description\n * Plugin used to scroll Handsontable by selecting a cell and dragging outside of the visible viewport.\n *\n *\n * @class DragToScroll\n * @plugin DragToScroll\n */\nclass DragToScroll extends BasePlugin {\n constructor(hotInstance) {\n super(hotInstance);\n /**\n * Instance of {@link EventManager}.\n *\n * @type {EventManager}\n */\n this.eventManager = new EventManager(this);\n /**\n * DOMRect - size of an element and its position relative to the viewport,\n * e.g. {bottom: 449, height: 441, left: 8, right: 814, top: 8, width: 806, x: 8, y:8}.\n *\n * @type {Object}\n */\n this.boundaries = null;\n /**\n * Callback function.\n *\n * @type {Function}\n */\n this.callback = null;\n /**\n * Flag indicates mouseDown/mouseUp.\n *\n * @type {Boolean}\n */\n this.listening = false;\n }\n\n /**\n * Check if the plugin is enabled in the Handsontable settings.\n *\n * @returns {Boolean}\n */\n isEnabled() {\n return !!this.hot.getSettings().dragToScroll;\n }\n\n /**\n * Enable plugin for this Handsontable instance.\n */\n enablePlugin() {\n if (this.enabled) {\n return;\n }\n\n this.addHook('afterOnCellMouseDown', () => this.setupListening());\n this.addHook('afterOnCellCornerMouseDown', () => this.setupListening());\n\n this.registerEvents();\n\n super.enablePlugin();\n }\n\n /**\n * Updates the plugin to use the latest options you have specified.\n */\n updatePlugin() {\n this.disablePlugin();\n this.enablePlugin();\n\n super.updatePlugin();\n }\n\n /**\n * Disable plugin for this Handsontable instance.\n */\n disablePlugin() {\n this.unregisterEvents();\n\n super.disablePlugin();\n }\n\n /**\n * Sets the value of the visible element.\n *\n * @param boundaries {Object} compatible with getBoundingClientRect\n */\n setBoundaries(boundaries) {\n this.boundaries = boundaries;\n }\n\n /**\n * Change callback function.\n *\n * @param callback {Function}\n */\n setCallback(callback) {\n this.callback = callback;\n }\n\n /**\n * Check if mouse position (x, y) is outside of the viewport.\n *\n * @param {Number} x\n * @param {Number} y\n */\n check(x, y) {\n let diffX = 0;\n let diffY = 0;\n\n if (y < this.boundaries.top) {\n // y is less than top\n diffY = y - this.boundaries.top;\n\n } else if (y > this.boundaries.bottom) {\n // y is more than bottom\n diffY = y - this.boundaries.bottom;\n }\n\n if (x < this.boundaries.left) {\n // x is less than left\n diffX = x - this.boundaries.left;\n\n } else if (x > this.boundaries.right) {\n // x is more than right\n diffX = x - this.boundaries.right;\n }\n\n this.callback(diffX, diffY);\n }\n\n /**\n * Register dom listeners.\n *\n * @private\n */\n registerEvents() {\n this.eventManager.addEventListener(document, 'mouseup', () => this.onMouseUp());\n this.eventManager.addEventListener(document, 'mousemove', (event) => this.onMouseMove(event));\n }\n\n /**\n * Unbind the events used by the plugin.\n *\n * @private\n */\n unregisterEvents() {\n this.eventManager.clear();\n }\n\n /**\n * On after on cell/cellCorner mouse down listener.\n *\n * @private\n */\n setupListening() {\n let scrollHandler = this.hot.view.wt.wtTable.holder; // native scroll\n\n if (scrollHandler === window) {\n // not much we can do currently\n return;\n }\n\n this.setBoundaries(scrollHandler.getBoundingClientRect());\n this.setCallback((scrollX, scrollY) => {\n if (scrollX < 0) {\n scrollHandler.scrollLeft -= 50;\n\n } else if (scrollX > 0) {\n scrollHandler.scrollLeft += 50;\n }\n\n if (scrollY < 0) {\n scrollHandler.scrollTop -= 20;\n\n } else if (scrollY > 0) {\n scrollHandler.scrollTop += 20;\n }\n });\n\n this.listening = true;\n }\n\n /**\n * 'mouseMove' event callback.\n *\n * @private\n * @param {MouseEvent} event `mousemove` event properties.\n */\n onMouseMove(event) {\n if (this.listening) {\n this.check(event.clientX, event.clientY);\n }\n }\n\n /**\n * `onMouseUp` hook callback.\n *\n * @private\n */\n onMouseUp() {\n this.listening = false;\n }\n\n /**\n * Destroy instance.\n */\n destroy() {\n super.destroy();\n }\n}\n\nregisterPlugin('dragToScroll', DragToScroll);\n\nexport default DragToScroll;\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/dragToScroll/dragToScroll.js","import BasePlugin from './../_base';\nimport {registerPlugin} from './../../plugins';\nimport {arrayEach} from './../../helpers/array';\nimport freezeColumnItem from './contextMenuItem/freezeColumn';\nimport unfreezeColumnItem from './contextMenuItem/unfreezeColumn';\n\nimport './manualColumnFreeze.css';\n\nconst privatePool = new WeakMap();\n/**\n * This plugin allows to manually \"freeze\" and \"unfreeze\" a column using an entry in the Context Menu.\n * You can turn it on by setting a `manualColumnFreeze` property to `true`.\n *\n * @plugin ManualColumnFreeze\n * @dependencies ManualColumnMove\n */\nclass ManualColumnFreeze extends BasePlugin {\n constructor(hotInstance) {\n super(hotInstance);\n\n privatePool.set(this, {\n moveByFreeze: false,\n afterFirstUse: false,\n });\n /**\n * Original column positions\n *\n * @type {Array}\n */\n this.frozenColumnsBasePositions = [];\n /**\n * Reference to the `ManualColumnMove` plugin.\n */\n this.manualColumnMovePlugin = void 0;\n }\n\n /**\n * Check if the plugin is enabled in the Handsontable settings.\n *\n * @returns {Boolean}\n */\n isEnabled() {\n return !!this.hot.getSettings().manualColumnFreeze;\n }\n\n /**\n * Enable plugin for this Handsontable instance.\n */\n enablePlugin() {\n if (this.enabled) {\n return;\n }\n\n this.addHook('afterContextMenuDefaultOptions', (options) => this.addContextMenuEntry(options));\n this.addHook('afterInit', () => this.onAfterInit());\n this.addHook('beforeColumnMove', (rows, target) => this.onBeforeColumnMove(rows, target));\n\n super.enablePlugin();\n }\n\n /**\n * Disable plugin for this Handsontable instance.\n */\n disablePlugin() {\n let priv = privatePool.get(this);\n\n priv.afterFirstUse = false;\n priv.moveByFreeze = false;\n\n super.disablePlugin();\n }\n\n /**\n * Updates the plugin to use the latest options you have specified.\n */\n updatePlugin() {\n this.disablePlugin();\n this.enablePlugin();\n\n super.updatePlugin();\n }\n\n /**\n * Freeze the given column (add it to fixed columns).\n *\n * @param {Number} column Visual column index.\n */\n freezeColumn(column) {\n let priv = privatePool.get(this);\n let settings = this.hot.getSettings();\n\n if (!priv.afterFirstUse) {\n priv.afterFirstUse = true;\n }\n\n if (settings.fixedColumnsLeft === this.hot.countCols() || column <= settings.fixedColumnsLeft - 1) {\n return; // already fixed\n }\n\n priv.moveByFreeze = true;\n\n if (column !== this.getMovePlugin().columnsMapper.getValueByIndex(column)) {\n this.frozenColumnsBasePositions[settings.fixedColumnsLeft] = column;\n }\n\n this.getMovePlugin().moveColumn(column, settings.fixedColumnsLeft++);\n\n }\n\n /**\n * Unfreeze the given column (remove it from fixed columns and bring to it's previous position).\n *\n * @param {Number} column Visual column index.\n */\n unfreezeColumn(column) {\n let priv = privatePool.get(this);\n let settings = this.hot.getSettings();\n\n if (!priv.afterFirstUse) {\n priv.afterFirstUse = true;\n }\n\n if (settings.fixedColumnsLeft <= 0 || (column > settings.fixedColumnsLeft - 1)) {\n return; // not fixed\n }\n\n let returnCol = this.getBestColumnReturnPosition(column);\n\n priv.moveByFreeze = true;\n settings.fixedColumnsLeft--;\n\n this.getMovePlugin().moveColumn(column, returnCol + 1);\n }\n\n /**\n * Get the reference to the ManualColumnMove plugin.\n *\n * @private\n * @returns {Object}\n */\n getMovePlugin() {\n if (!this.manualColumnMovePlugin) {\n this.manualColumnMovePlugin = this.hot.getPlugin('manualColumnMove');\n }\n\n return this.manualColumnMovePlugin;\n }\n\n /**\n * Estimates the most fitting return position for unfrozen column.\n *\n * @private\n * @param {Number} column Visual column index.\n */\n getBestColumnReturnPosition(column) {\n let movePlugin = this.getMovePlugin();\n let settings = this.hot.getSettings();\n let i = settings.fixedColumnsLeft;\n let j = movePlugin.columnsMapper.getValueByIndex(i);\n let initialCol;\n\n if (this.frozenColumnsBasePositions[column] === null || this.frozenColumnsBasePositions[column] === void 0) {\n initialCol = movePlugin.columnsMapper.getValueByIndex(column);\n\n while (j !== null && j <= initialCol) {\n i++;\n j = movePlugin.columnsMapper.getValueByIndex(i);\n }\n\n } else {\n initialCol = this.frozenColumnsBasePositions[column];\n this.frozenColumnsBasePositions[column] = void 0;\n\n while (j !== null && j <= initialCol) {\n i++;\n j = movePlugin.columnsMapper.getValueByIndex(i);\n }\n i = j;\n }\n\n return i - 1;\n }\n /**\n * Add the manualColumnFreeze context menu entries.\n *\n * @private\n * @param {Object} options Context menu options.\n */\n addContextMenuEntry(options) {\n options.items.push(\n {name: '---------'},\n freezeColumnItem(this),\n unfreezeColumnItem(this)\n );\n }\n\n /**\n * Enabling `manualColumnMove` plugin on `afterInit` hook.\n *\n * @private\n */\n onAfterInit() {\n if (!this.getMovePlugin().isEnabled()) {\n this.getMovePlugin().enablePlugin();\n }\n }\n\n /**\n * Prevent moving the rows from/to fixed area.\n *\n * @private\n * @param {Array} rows\n * @param {Number} target\n */\n onBeforeColumnMove(rows, target) {\n let priv = privatePool.get(this);\n\n if (priv.afterFirstUse && !priv.moveByFreeze) {\n let frozenLen = this.hot.getSettings().fixedColumnsLeft;\n let disallowMoving = target < frozenLen;\n\n if (!disallowMoving) {\n arrayEach(rows, (value, index, array) => {\n if (value < frozenLen) {\n disallowMoving = true;\n return false;\n }\n });\n }\n\n if (disallowMoving) {\n return false;\n }\n }\n\n if (priv.moveByFreeze) {\n priv.moveByFreeze = false;\n }\n }\n\n /**\n * Destroy plugin instance.\n */\n destroy() {\n super.destroy();\n }\n\n}\n\nregisterPlugin('manualColumnFreeze', ManualColumnFreeze);\n\nexport default ManualColumnFreeze;\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/manualColumnFreeze/manualColumnFreeze.js","import * as C from './../../../i18n/constants';\n\nexport default function freezeColumnItem(manualColumnFreezePlugin) {\n return {\n key: 'freeze_column',\n name() {\n return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_FREEZE_COLUMN);\n },\n callback(key, selected) {\n const [{start: {col: selectedColumn}}] = selected;\n\n manualColumnFreezePlugin.freezeColumn(selectedColumn);\n\n this.render();\n this.view.wt.wtOverlays.adjustElementsSize(true);\n },\n hidden() {\n let selection = this.getSelectedRange();\n let hide = false;\n\n if (selection === void 0) {\n hide = true;\n\n } else if (selection.length > 1) {\n hide = true;\n\n } else if ((selection[0].from.col !== selection[0].to.col) || (selection[0].from.col <= this.getSettings().fixedColumnsLeft - 1)) {\n hide = true;\n }\n\n return hide;\n },\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/manualColumnFreeze/contextMenuItem/freezeColumn.js","import * as C from './../../../i18n/constants';\n\nexport default function unfreezeColumnItem(manualColumnFreezePlugin) {\n return {\n key: 'unfreeze_column',\n name() {\n return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_UNFREEZE_COLUMN);\n },\n callback(key, selected) {\n const [{start: {col: selectedColumn}}] = selected;\n\n manualColumnFreezePlugin.unfreezeColumn(selectedColumn);\n\n this.render();\n this.view.wt.wtOverlays.adjustElementsSize(true);\n },\n hidden() {\n let selection = this.getSelectedRange();\n let hide = false;\n\n if (selection === void 0) {\n hide = true;\n\n } else if (selection.length > 1) {\n hide = true;\n\n } else if ((selection[0].from.col !== selection[0].to.col) || selection[0].from.col >= this.getSettings().fixedColumnsLeft) {\n hide = true;\n }\n\n return hide;\n },\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/manualColumnFreeze/contextMenuItem/unfreezeColumn.js","// removed by extract-text-webpack-plugin\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/plugins/manualColumnFreeze/manualColumnFreeze.css\n// module id = 331\n// module chunks = 0","import BasePlugin from './../_base.js';\nimport Hooks from './../../pluginHooks';\nimport {arrayEach} from './../../helpers/array';\nimport {addClass, removeClass, offset} from './../../helpers/dom/element';\nimport {rangeEach} from './../../helpers/number';\nimport EventManager from './../../eventManager';\nimport {registerPlugin} from './../../plugins';\nimport ColumnsMapper from './columnsMapper';\nimport BacklightUI from './ui/backlight';\nimport GuidelineUI from './ui/guideline';\nimport {CellCoords} from './../../3rdparty/walkontable/src';\n\nimport './manualColumnMove.css';\n\nHooks.getSingleton().register('beforeColumnMove');\nHooks.getSingleton().register('afterColumnMove');\nHooks.getSingleton().register('unmodifyCol');\n\nconst privatePool = new WeakMap();\nconst CSS_PLUGIN = 'ht__manualColumnMove';\nconst CSS_SHOW_UI = 'show-ui';\nconst CSS_ON_MOVING = 'on-moving--columns';\nconst CSS_AFTER_SELECTION = 'after-selection--columns';\n\n/**\n * @plugin ManualColumnMove\n *\n * @description\n * This plugin allows to change columns order.\n *\n * API:\n * - moveColumn - move single column to the new position.\n * - moveColumns - move many columns (as an array of indexes) to the new position.\n *\n * If you want apply visual changes, you have to call manually the render() method on the instance of Handsontable.\n *\n * UI components:\n * - backlight - highlight of selected columns.\n * - guideline - line which shows where rows has been moved.\n *\n * @class ManualColumnMove\n * @plugin ManualColumnMove\n */\nclass ManualColumnMove extends BasePlugin {\n constructor(hotInstance) {\n super(hotInstance);\n\n /**\n * Set up WeakMap of plugin to sharing private parameters;\n */\n privatePool.set(this, {\n columnsToMove: [],\n countCols: 0,\n fixedColumns: 0,\n pressed: void 0,\n disallowMoving: void 0,\n target: {\n eventPageX: void 0,\n coords: void 0,\n TD: void 0,\n col: void 0\n }\n });\n\n /**\n * List of last removed row indexes.\n *\n * @type {Array}\n */\n this.removedColumns = [];\n /**\n * Object containing visual row indexes mapped to data source indexes.\n *\n * @type {RowsMapper}\n */\n this.columnsMapper = new ColumnsMapper(this);\n /**\n * Event Manager object.\n *\n * @type {Object}\n */\n this.eventManager = new EventManager(this);\n /**\n * Backlight UI object.\n *\n * @type {Object}\n */\n this.backlight = new BacklightUI(hotInstance);\n /**\n * Guideline UI object.\n *\n * @type {Object}\n */\n this.guideline = new GuidelineUI(hotInstance);\n }\n\n /**\n * Check if plugin is enabled.\n *\n * @returns {Boolean}\n */\n isEnabled() {\n return !!this.hot.getSettings().manualColumnMove;\n }\n\n /**\n * Enable the plugin.\n */\n enablePlugin() {\n if (this.enabled) {\n return;\n }\n\n this.addHook('beforeOnCellMouseDown', (event, coords, TD, blockCalculations) => this.onBeforeOnCellMouseDown(event, coords, TD, blockCalculations));\n this.addHook('beforeOnCellMouseOver', (event, coords, TD, blockCalculations) => this.onBeforeOnCellMouseOver(event, coords, TD, blockCalculations));\n this.addHook('afterScrollVertically', () => this.onAfterScrollVertically());\n this.addHook('modifyCol', (row, source) => this.onModifyCol(row, source));\n this.addHook('beforeRemoveCol', (index, amount) => this.onBeforeRemoveCol(index, amount));\n this.addHook('afterRemoveCol', () => this.onAfterRemoveCol());\n this.addHook('afterCreateCol', (index, amount) => this.onAfterCreateCol(index, amount));\n this.addHook('afterLoadData', () => this.onAfterLoadData());\n this.addHook('unmodifyCol', (column) => this.onUnmodifyCol(column));\n\n this.registerEvents();\n\n // TODO: move adding plugin classname to BasePlugin.\n addClass(this.hot.rootElement, CSS_PLUGIN);\n\n super.enablePlugin();\n }\n\n /**\n * Updates the plugin to use the latest options you have specified.\n */\n updatePlugin() {\n this.disablePlugin();\n this.enablePlugin();\n\n this.onAfterPluginsInitialized();\n\n super.updatePlugin();\n }\n\n /**\n * Disable plugin for this Handsontable instance.\n */\n disablePlugin() {\n let pluginSettings = this.hot.getSettings().manualColumnMove;\n\n if (Array.isArray(pluginSettings)) {\n this.columnsMapper.clearMap();\n }\n\n removeClass(this.hot.rootElement, CSS_PLUGIN);\n\n this.unregisterEvents();\n this.backlight.destroy();\n this.guideline.destroy();\n\n super.disablePlugin();\n }\n\n /**\n * Move a single column.\n *\n * @param {Number} column Visual column index to be moved.\n * @param {Number} target Visual column index being a target for the moved column.\n */\n moveColumn(column, target) {\n this.moveColumns([column], target);\n }\n\n /**\n * Move multiple columns.\n *\n * @param {Array} columns Array of visual column indexes to be moved.\n * @param {Number} target Visual column index being a target for the moved columns.\n */\n moveColumns(columns, target) {\n const visualColumns = [...columns];\n let priv = privatePool.get(this);\n let beforeColumnHook = this.hot.runHooks('beforeColumnMove', visualColumns, target);\n\n priv.disallowMoving = !beforeColumnHook;\n\n if (beforeColumnHook !== false) {\n // first we need to rewrite an visual indexes to physical for save reference after move\n arrayEach(columns, (column, index, array) => {\n array[index] = this.columnsMapper.getValueByIndex(column);\n });\n\n // next, when we have got an physical indexes, we can move columns\n arrayEach(columns, (column, index) => {\n let actualPosition = this.columnsMapper.getIndexByValue(column);\n\n if (actualPosition !== target) {\n this.columnsMapper.moveColumn(actualPosition, target + index);\n }\n });\n\n // after moving we have to clear columnsMapper from null entries\n this.columnsMapper.clearNull();\n }\n\n this.hot.runHooks('afterColumnMove', visualColumns, target);\n }\n\n /**\n * Correct the cell selection after the move action. Fired only when action was made with a mouse.\n * That means that changing the column order using the API won't correct the selection.\n *\n * @private\n * @param {Number} startColumn Visual column index for the start of the selection.\n * @param {Number} endColumn Visual column index for the end of the selection.\n */\n changeSelection(startColumn, endColumn) {\n this.hot.selectColumns(startColumn, endColumn);\n }\n\n /**\n * Get the sum of the widths of columns in the provided range.\n *\n * @private\n * @param {Number} from Visual column index.\n * @param {Number} to Visual column index.\n * @returns {Number}\n */\n getColumnsWidth(from, to) {\n let width = 0;\n\n for (let i = from; i < to; i++) {\n let columnWidth = 0;\n\n if (i < 0) {\n columnWidth = this.hot.view.wt.wtViewport.getRowHeaderWidth() || 0;\n } else {\n columnWidth = this.hot.view.wt.wtTable.getStretchedColumnWidth(i) || 0;\n }\n\n width += columnWidth;\n }\n\n return width;\n }\n\n /**\n * Load initial settings when persistent state is saved or when plugin was initialized as an array.\n *\n * @private\n */\n initialSettings() {\n let pluginSettings = this.hot.getSettings().manualColumnMove;\n\n if (Array.isArray(pluginSettings)) {\n this.moveColumns(pluginSettings, 0);\n\n } else if (pluginSettings !== void 0) {\n this.persistentStateLoad();\n }\n }\n\n /**\n * Check if the provided column is in the fixedColumnsLeft section.\n *\n * @private\n * @param {Number} column Visual column index to check.\n * @returns {Boolean}\n */\n isFixedColumnsLeft(column) {\n return column < this.hot.getSettings().fixedColumnsLeft;\n }\n\n /**\n * Save the manual column positions to the persistent state.\n *\n * @private\n */\n persistentStateSave() {\n this.hot.runHooks('persistentStateSave', 'manualColumnMove', this.columnsMapper._arrayMap);\n }\n\n /**\n * Load the manual column positions from the persistent state.\n *\n * @private\n */\n persistentStateLoad() {\n let storedState = {};\n\n this.hot.runHooks('persistentStateLoad', 'manualColumnMove', storedState);\n\n if (storedState.value) {\n this.columnsMapper._arrayMap = storedState.value;\n }\n }\n\n /**\n * Prepare array of indexes based on actual selection.\n *\n * @private\n * @returns {Array}\n */\n prepareColumnsToMoving(start, end) {\n let selectedColumns = [];\n\n rangeEach(start, end, (i) => {\n selectedColumns.push(i);\n });\n\n return selectedColumns;\n }\n\n /**\n * Update the UI visual position.\n *\n * @private\n */\n refreshPositions() {\n let priv = privatePool.get(this);\n let firstVisible = this.hot.view.wt.wtTable.getFirstVisibleColumn();\n let lastVisible = this.hot.view.wt.wtTable.getLastVisibleColumn();\n let wtTable = this.hot.view.wt.wtTable;\n let scrollableElement = this.hot.view.wt.wtOverlays.scrollableElement;\n let scrollLeft = typeof scrollableElement.scrollX === 'number' ? scrollableElement.scrollX : scrollableElement.scrollLeft;\n let tdOffsetLeft = this.hot.view.THEAD.offsetLeft + this.getColumnsWidth(0, priv.coordsColumn);\n let mouseOffsetLeft = priv.target.eventPageX - (priv.rootElementOffset - (scrollableElement.scrollX === void 0 ? scrollLeft : 0));\n let hiderWidth = wtTable.hider.offsetWidth;\n let tbodyOffsetLeft = wtTable.TBODY.offsetLeft;\n let backlightElemMarginLeft = this.backlight.getOffset().left;\n let backlightElemWidth = this.backlight.getSize().width;\n let rowHeaderWidth = 0;\n\n if ((priv.rootElementOffset + wtTable.holder.offsetWidth + scrollLeft) < priv.target.eventPageX) {\n if (priv.coordsColumn < priv.countCols) {\n priv.coordsColumn++;\n }\n }\n\n if (priv.hasRowHeaders) {\n rowHeaderWidth = this.hot.view.wt.wtOverlays.leftOverlay.clone.wtTable.getColumnHeader(-1).offsetWidth;\n }\n if (this.isFixedColumnsLeft(priv.coordsColumn)) {\n tdOffsetLeft += scrollLeft;\n }\n tdOffsetLeft += rowHeaderWidth;\n\n if (priv.coordsColumn < 0) {\n // if hover on rowHeader\n if (priv.fixedColumns > 0) {\n priv.target.col = 0;\n } else {\n priv.target.col = firstVisible > 0 ? firstVisible - 1 : firstVisible;\n }\n\n } else if (((priv.target.TD.offsetWidth / 2) + tdOffsetLeft) <= mouseOffsetLeft) {\n let newCoordsCol = priv.coordsColumn >= priv.countCols ? priv.countCols - 1 : priv.coordsColumn;\n // if hover on right part of TD\n priv.target.col = newCoordsCol + 1;\n // unfortunately first column is bigger than rest\n tdOffsetLeft += priv.target.TD.offsetWidth;\n\n if (priv.target.col > lastVisible) {\n this.hot.scrollViewportTo(void 0, lastVisible + 1, void 0, true);\n }\n\n } else {\n // elsewhere on table\n priv.target.col = priv.coordsColumn;\n\n if (priv.target.col <= firstVisible && priv.target.col >= priv.fixedColumns) {\n this.hot.scrollViewportTo(void 0, firstVisible - 1);\n }\n }\n\n if (priv.target.col <= firstVisible && priv.target.col >= priv.fixedColumns) {\n this.hot.scrollViewportTo(void 0, firstVisible - 1);\n }\n\n let backlightLeft = mouseOffsetLeft;\n let guidelineLeft = tdOffsetLeft;\n\n if (mouseOffsetLeft + backlightElemWidth + backlightElemMarginLeft >= hiderWidth) {\n // prevent display backlight on the right side of the table\n backlightLeft = hiderWidth - backlightElemWidth - backlightElemMarginLeft;\n\n } else if (mouseOffsetLeft + backlightElemMarginLeft < tbodyOffsetLeft + rowHeaderWidth) {\n // prevent display backlight on the left side of the table\n backlightLeft = tbodyOffsetLeft + rowHeaderWidth + Math.abs(backlightElemMarginLeft);\n }\n\n if (tdOffsetLeft >= hiderWidth - 1) {\n // prevent display guideline outside the table\n guidelineLeft = hiderWidth - 1;\n\n } else if (guidelineLeft === 0) {\n // guideline has got `margin-left: -1px` as default\n guidelineLeft = 1;\n\n } else if (scrollableElement.scrollX !== void 0 && priv.coordsColumn < priv.fixedColumns) {\n guidelineLeft -= ((priv.rootElementOffset <= scrollableElement.scrollX) ? priv.rootElementOffset : 0);\n }\n\n this.backlight.setPosition(null, backlightLeft);\n this.guideline.setPosition(null, guidelineLeft);\n }\n\n /**\n * This method checks arrayMap from columnsMapper and updates the columnsMapper if it's necessary.\n *\n * @private\n */\n updateColumnsMapper() {\n let countCols = this.hot.countSourceCols();\n let columnsMapperLen = this.columnsMapper._arrayMap.length;\n\n if (columnsMapperLen === 0) {\n this.columnsMapper.createMap(countCols || this.hot.getSettings().startCols);\n\n } else if (columnsMapperLen < countCols) {\n let diff = countCols - columnsMapperLen;\n\n this.columnsMapper.insertItems(columnsMapperLen, diff);\n\n } else if (columnsMapperLen > countCols) {\n let maxIndex = countCols - 1;\n let columnsToRemove = [];\n\n arrayEach(this.columnsMapper._arrayMap, (value, index) => {\n if (value > maxIndex) {\n columnsToRemove.push(index);\n }\n });\n\n this.columnsMapper.removeItems(columnsToRemove);\n }\n }\n\n /**\n * Bind the events used by the plugin.\n *\n * @private\n */\n registerEvents() {\n this.eventManager.addEventListener(document.documentElement, 'mousemove', (event) => this.onMouseMove(event));\n this.eventManager.addEventListener(document.documentElement, 'mouseup', () => this.onMouseUp());\n }\n\n /**\n * Unbind the events used by the plugin.\n *\n * @private\n */\n unregisterEvents() {\n this.eventManager.clear();\n }\n\n /**\n * Change the behavior of selection / dragging.\n *\n * @private\n * @param {MouseEvent} event `mousedown` event properties.\n * @param {CellCoords} coords Visual cell coordinates where was fired event.\n * @param {HTMLElement} TD Cell represented as HTMLElement.\n * @param {Object} blockCalculations Object which contains information about blockCalculation for row, column or cells.\n */\n onBeforeOnCellMouseDown(event, coords, TD, blockCalculations) {\n let wtTable = this.hot.view.wt.wtTable;\n let isHeaderSelection = this.hot.selection.isSelectedByColumnHeader();\n let selection = this.hot.getSelectedRangeLast();\n let priv = privatePool.get(this);\n let isSortingElement = event.realTarget.className.indexOf('columnSorting') > -1;\n\n if (!selection || !isHeaderSelection || priv.pressed || event.button !== 0 || isSortingElement) {\n priv.pressed = false;\n priv.columnsToMove.length = 0;\n removeClass(this.hot.rootElement, [CSS_ON_MOVING, CSS_SHOW_UI]);\n return;\n }\n\n let guidelineIsNotReady = this.guideline.isBuilt() && !this.guideline.isAppended();\n let backlightIsNotReady = this.backlight.isBuilt() && !this.backlight.isAppended();\n\n if (guidelineIsNotReady && backlightIsNotReady) {\n this.guideline.appendTo(wtTable.hider);\n this.backlight.appendTo(wtTable.hider);\n }\n\n let {from, to} = selection;\n let start = Math.min(from.col, to.col);\n let end = Math.max(from.col, to.col);\n\n if (coords.row < 0 && (coords.col >= start && coords.col <= end)) {\n blockCalculations.column = true;\n priv.pressed = true;\n priv.target.eventPageX = event.pageX;\n priv.coordsColumn = coords.col;\n priv.target.TD = TD;\n priv.target.col = coords.col;\n priv.columnsToMove = this.prepareColumnsToMoving(start, end);\n priv.hasRowHeaders = !!this.hot.getSettings().rowHeaders;\n priv.countCols = this.hot.countCols();\n priv.fixedColumns = this.hot.getSettings().fixedColumnsLeft;\n priv.rootElementOffset = offset(this.hot.rootElement).left;\n\n let countColumnsFrom = priv.hasRowHeaders ? -1 : 0;\n let topPos = wtTable.holder.scrollTop + wtTable.getColumnHeaderHeight(0) + 1;\n let fixedColumns = coords.col < priv.fixedColumns;\n let scrollableElement = this.hot.view.wt.wtOverlays.scrollableElement;\n let wrapperIsWindow = scrollableElement.scrollX ? scrollableElement.scrollX - priv.rootElementOffset : 0;\n\n let mouseOffset = event.layerX - (fixedColumns ? wrapperIsWindow : 0);\n let leftOffset = Math.abs(this.getColumnsWidth(start, coords.col) + mouseOffset);\n\n this.backlight.setPosition(topPos, this.getColumnsWidth(countColumnsFrom, start) + leftOffset);\n this.backlight.setSize(this.getColumnsWidth(start, end + 1), wtTable.hider.offsetHeight - topPos);\n this.backlight.setOffset(null, leftOffset * -1);\n\n addClass(this.hot.rootElement, CSS_ON_MOVING);\n\n } else {\n removeClass(this.hot.rootElement, CSS_AFTER_SELECTION);\n priv.pressed = false;\n priv.columnsToMove.length = 0;\n }\n }\n\n /**\n * 'mouseMove' event callback. Fired when pointer move on document.documentElement.\n *\n * @private\n * @param {MouseEvent} event `mousemove` event properties.\n */\n onMouseMove(event) {\n let priv = privatePool.get(this);\n\n if (!priv.pressed) {\n return;\n }\n\n // callback for browser which doesn't supports CSS pointer-event: none\n if (event.realTarget === this.backlight.element) {\n let width = this.backlight.getSize().width;\n this.backlight.setSize(0);\n\n setTimeout(function() {\n this.backlight.setPosition(width);\n });\n }\n\n priv.target.eventPageX = event.pageX;\n this.refreshPositions();\n }\n\n /**\n * 'beforeOnCellMouseOver' hook callback. Fired when pointer was over cell.\n *\n * @private\n * @param {MouseEvent} event `mouseover` event properties.\n * @param {CellCoords} coords Visual cell coordinates where was fired event.\n * @param {HTMLElement} TD Cell represented as HTMLElement.\n * @param {Object} blockCalculations Object which contains information about blockCalculation for row, column or cells.\n */\n onBeforeOnCellMouseOver(event, coords, TD, blockCalculations) {\n let selectedRange = this.hot.getSelectedRangeLast();\n let priv = privatePool.get(this);\n\n if (!selectedRange || !priv.pressed) {\n return;\n }\n\n if (priv.columnsToMove.indexOf(coords.col) > -1) {\n removeClass(this.hot.rootElement, CSS_SHOW_UI);\n\n } else {\n addClass(this.hot.rootElement, CSS_SHOW_UI);\n }\n\n blockCalculations.row = true;\n blockCalculations.column = true;\n blockCalculations.cell = true;\n priv.coordsColumn = coords.col;\n priv.target.TD = TD;\n }\n\n /**\n * `onMouseUp` hook callback.\n *\n * @private\n */\n onMouseUp() {\n let priv = privatePool.get(this);\n\n priv.coordsColumn = void 0;\n priv.pressed = false;\n priv.backlightWidth = 0;\n\n removeClass(this.hot.rootElement, [CSS_ON_MOVING, CSS_SHOW_UI, CSS_AFTER_SELECTION]);\n\n if (this.hot.selection.isSelectedByColumnHeader()) {\n addClass(this.hot.rootElement, CSS_AFTER_SELECTION);\n }\n if (priv.columnsToMove.length < 1 || priv.target.col === void 0 || priv.columnsToMove.indexOf(priv.target.col) > -1) {\n return;\n }\n\n this.moveColumns(priv.columnsToMove, priv.target.col);\n this.persistentStateSave();\n this.hot.render();\n this.hot.view.wt.wtOverlays.adjustElementsSize(true);\n\n if (!priv.disallowMoving) {\n let selectionStart = this.columnsMapper.getIndexByValue(priv.columnsToMove[0]);\n let selectionEnd = this.columnsMapper.getIndexByValue(priv.columnsToMove[priv.columnsToMove.length - 1]);\n this.changeSelection(selectionStart, selectionEnd);\n }\n\n priv.columnsToMove.length = 0;\n }\n\n /**\n * `afterScrollHorizontally` hook callback. Fired the table was scrolled horizontally.\n *\n * @private\n */\n onAfterScrollVertically() {\n let wtTable = this.hot.view.wt.wtTable;\n let headerHeight = wtTable.getColumnHeaderHeight(0) + 1;\n let scrollTop = wtTable.holder.scrollTop;\n let posTop = headerHeight + scrollTop;\n\n this.backlight.setPosition(posTop);\n this.backlight.setSize(null, wtTable.hider.offsetHeight - posTop);\n }\n\n /**\n * `afterCreateCol` hook callback.\n *\n * @private\n * @param {Number} index Visual index of the created column.\n * @param {Number} amount Amount of created columns.\n */\n onAfterCreateCol(index, amount) {\n this.columnsMapper.shiftItems(index, amount);\n }\n\n /**\n * On before remove column listener.\n *\n * @private\n * @param {Number} index Visual column index.\n * @param {Number} amount Defines how many columns removed.\n */\n onBeforeRemoveCol(index, amount) {\n this.removedColumns.length = 0;\n\n if (index !== false) {\n // Collect physical row index.\n rangeEach(index, index + amount - 1, (removedIndex) => {\n this.removedColumns.push(this.hot.runHooks('modifyCol', removedIndex, this.pluginName));\n });\n }\n }\n\n /**\n * `afterRemoveCol` hook callback.\n *\n * @private\n */\n onAfterRemoveCol() {\n this.columnsMapper.unshiftItems(this.removedColumns);\n }\n\n /**\n * `afterLoadData` hook callback.\n *\n * @private\n */\n onAfterLoadData() {\n this.updateColumnsMapper();\n }\n\n /**\n * 'modifyRow' hook callback.\n *\n * @private\n * @param {Number} column Visual column index.\n * @returns {Number} Physical column index.\n */\n onModifyCol(column, source) {\n if (source !== this.pluginName) {\n // ugly fix for try to insert new, needed columns after pasting data\n let columnInMapper = this.columnsMapper.getValueByIndex(column);\n column = columnInMapper === null ? column : columnInMapper;\n }\n\n return column;\n }\n\n /**\n * 'unmodifyCol' hook callback.\n *\n * @private\n * @param {Number} column Physical column index.\n * @returns {Number} Visual column index.\n */\n onUnmodifyCol(column) {\n let indexInMapper = this.columnsMapper.getIndexByValue(column);\n\n return indexInMapper === null ? column : indexInMapper;\n }\n\n /**\n * `afterPluginsInitialized` hook callback.\n *\n * @private\n */\n onAfterPluginsInitialized() {\n this.updateColumnsMapper();\n this.initialSettings();\n this.backlight.build();\n this.guideline.build();\n }\n\n /**\n * Destroy plugin instance.\n */\n destroy() {\n this.backlight.destroy();\n this.guideline.destroy();\n\n super.destroy();\n }\n}\n\nregisterPlugin('ManualColumnMove', ManualColumnMove);\n\nexport default ManualColumnMove;\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/manualColumnMove/manualColumnMove.js","import arrayMapper from './../../mixins/arrayMapper';\nimport {arrayFilter} from './../../helpers/array';\nimport {mixin} from './../../helpers/object';\nimport {rangeEach} from './../../helpers/number';\n\n/**\n * @class ColumnsMapper\n * @plugin ManualColumnMove\n */\nclass ColumnsMapper {\n constructor(manualColumnMove) {\n /**\n * Instance of ManualColumnMove plugin.\n *\n * @type {ManualColumnMove}\n */\n this.manualColumnMove = manualColumnMove;\n }\n\n /**\n * Reset current map array and create new one.\n *\n * @param {Number} [length] Custom generated map length.\n */\n createMap(length) {\n let originLength = length === void 0 ? this._arrayMap.length : length;\n\n this._arrayMap.length = 0;\n\n rangeEach(originLength - 1, (itemIndex) => {\n this._arrayMap[itemIndex] = itemIndex;\n });\n }\n\n /**\n * Destroy class.\n */\n destroy() {\n this._arrayMap = null;\n }\n\n /**\n * Moving elements in columnsMapper.\n *\n * @param {Number} from Column index to move.\n * @param {Number} to Target index.\n */\n moveColumn(from, to) {\n let indexToMove = this._arrayMap[from];\n this._arrayMap[from] = null;\n this._arrayMap.splice(to, 0, indexToMove);\n }\n\n /**\n * Clearing arrayMap from `null` entries.\n */\n clearNull() {\n this._arrayMap = arrayFilter(this._arrayMap, (i) => i !== null);\n }\n}\n\nmixin(ColumnsMapper, arrayMapper);\n\nexport default ColumnsMapper;\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/manualColumnMove/columnsMapper.js","import BaseUI from './_base';\nimport {addClass} from './../../../helpers/dom/element';\n\nconst CSS_CLASSNAME = 'ht__manualColumnMove--backlight';\n\n/**\n * @class BacklightUI\n * @util\n */\nclass BacklightUI extends BaseUI {\n /**\n * Custom className on build process.\n */\n build() {\n super.build();\n\n addClass(this._element, CSS_CLASSNAME);\n }\n}\n\nexport default BacklightUI;\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/manualColumnMove/ui/backlight.js","import BaseUI from './_base';\nimport {addClass} from './../../../helpers/dom/element';\n\nconst CSS_CLASSNAME = 'ht__manualColumnMove--guideline';\n\n/**\n * @class GuidelineUI\n * @util\n */\nclass GuidelineUI extends BaseUI {\n /**\n * Custom className on build process.\n */\n build() {\n super.build();\n\n addClass(this._element, CSS_CLASSNAME);\n }\n}\n\nexport default GuidelineUI;\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/manualColumnMove/ui/guideline.js","// removed by extract-text-webpack-plugin\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/plugins/manualColumnMove/manualColumnMove.css\n// module id = 336\n// module chunks = 0","import BasePlugin from './../_base.js';\nimport {addClass, hasClass, removeClass, outerHeight} from './../../helpers/dom/element';\nimport EventManager from './../../eventManager';\nimport {pageX, pageY} from './../../helpers/dom/event';\nimport {arrayEach} from './../../helpers/array';\nimport {rangeEach} from './../../helpers/number';\nimport {registerPlugin} from './../../plugins';\n\n// Developer note! Whenever you make a change in this file, make an analogous change in manualRowResize.js\n\n/**\n * @description\n * ManualColumnResize Plugin.\n *\n * Has 2 UI components:\n * - handle - the draggable element that sets the desired width of the column.\n * - guide - the helper guide that shows the desired width as a vertical guide.\n *\n * @plugin ManualColumnResize\n */\nclass ManualColumnResize extends BasePlugin {\n\n constructor(hotInstance) {\n super(hotInstance);\n\n this.currentTH = null;\n this.currentCol = null;\n this.selectedCols = [];\n this.currentWidth = null;\n this.newSize = null;\n this.startY = null;\n this.startWidth = null;\n this.startOffset = null;\n this.handle = document.createElement('DIV');\n this.guide = document.createElement('DIV');\n this.eventManager = new EventManager(this);\n this.pressed = null;\n this.dblclick = 0;\n this.autoresizeTimeout = null;\n this.manualColumnWidths = [];\n\n addClass(this.handle, 'manualColumnResizer');\n addClass(this.guide, 'manualColumnResizerGuide');\n }\n\n /**\n * Check if the plugin is enabled in the handsontable settings.\n *\n * @returns {Boolean}\n */\n isEnabled() {\n return this.hot.getSettings().manualColumnResize;\n }\n\n /**\n * Enable plugin for this Handsontable instance.\n */\n enablePlugin() {\n if (this.enabled) {\n return;\n }\n\n this.manualColumnWidths = [];\n let initialColumnWidth = this.hot.getSettings().manualColumnResize;\n let loadedManualColumnWidths = this.loadManualColumnWidths();\n\n this.addHook('modifyColWidth', (width, col) => this.onModifyColWidth(width, col));\n this.addHook('beforeStretchingColumnWidth', (stretchedWidth, column) => this.onBeforeStretchingColumnWidth(stretchedWidth, column));\n this.addHook('beforeColumnResize', (currentColumn, newSize, isDoubleClick) => this.onBeforeColumnResize(currentColumn, newSize, isDoubleClick));\n\n if (typeof loadedManualColumnWidths != 'undefined') {\n this.manualColumnWidths = loadedManualColumnWidths;\n } else if (Array.isArray(initialColumnWidth)) {\n this.manualColumnWidths = initialColumnWidth;\n } else {\n this.manualColumnWidths = [];\n }\n\n // Handsontable.hooks.register('beforeColumnResize');\n // Handsontable.hooks.register('afterColumnResize');\n\n this.bindEvents();\n\n super.enablePlugin();\n }\n\n /**\n * Updates the plugin to use the latest options you have specified.\n */\n updatePlugin() {\n let initialColumnWidth = this.hot.getSettings().manualColumnResize;\n\n if (Array.isArray(initialColumnWidth)) {\n this.manualColumnWidths = initialColumnWidth;\n\n } else if (!initialColumnWidth) {\n this.manualColumnWidths = [];\n }\n }\n\n /**\n * Disable plugin for this Handsontable instance.\n */\n disablePlugin() {\n super.disablePlugin();\n }\n\n /**\n * Save the current sizes using the persistentState plugin.\n */\n saveManualColumnWidths() {\n this.hot.runHooks('persistentStateSave', 'manualColumnWidths', this.manualColumnWidths);\n }\n\n /**\n * Load the previously saved sizes using the persistentState plugin.\n *\n * @returns {Array}\n */\n loadManualColumnWidths() {\n let storedState = {};\n\n this.hot.runHooks('persistentStateLoad', 'manualColumnWidths', storedState);\n\n return storedState.value;\n }\n\n /**\n * Set the resize handle position.\n *\n * @param {HTMLCellElement} TH TH HTML element.\n */\n setupHandlePosition(TH) {\n if (!TH.parentNode) {\n return false;\n }\n\n this.currentTH = TH;\n\n let col = this.hot.view.wt.wtTable.getCoords(TH).col; // getCoords returns CellCoords\n let headerHeight = outerHeight(this.currentTH);\n\n if (col >= 0) { // if not col header\n let box = this.currentTH.getBoundingClientRect();\n\n this.currentCol = col;\n this.selectedCols = [];\n\n if (this.hot.selection.isSelected() && this.hot.selection.isSelectedByColumnHeader()) {\n let {from, to} = this.hot.getSelectedRangeLast();\n let start = from.col;\n let end = to.col;\n\n if (start >= end) {\n start = to.col;\n end = from.col;\n }\n\n if (this.currentCol >= start && this.currentCol <= end) {\n rangeEach(start, end, (i) => this.selectedCols.push(i));\n\n } else {\n this.selectedCols.push(this.currentCol);\n }\n } else {\n this.selectedCols.push(this.currentCol);\n }\n\n this.startOffset = box.left - 6;\n this.startWidth = parseInt(box.width, 10);\n this.handle.style.top = `${box.top}px`;\n this.handle.style.left = `${this.startOffset + this.startWidth}px`;\n this.handle.style.height = `${headerHeight}px`;\n this.hot.rootElement.appendChild(this.handle);\n }\n }\n\n /**\n * Refresh the resize handle position.\n */\n refreshHandlePosition() {\n this.handle.style.left = `${this.startOffset + this.currentWidth}px`;\n }\n\n /**\n * Set the resize guide position.\n */\n setupGuidePosition() {\n let handleHeight = parseInt(outerHeight(this.handle), 10);\n let handleBottomPosition = parseInt(this.handle.style.top, 10) + handleHeight;\n let maximumVisibleElementHeight = parseInt(this.hot.view.maximumVisibleElementHeight(0), 10);\n\n addClass(this.handle, 'active');\n addClass(this.guide, 'active');\n\n this.guide.style.top = `${handleBottomPosition}px`;\n this.guide.style.left = this.handle.style.left;\n this.guide.style.height = `${maximumVisibleElementHeight - handleHeight}px`;\n this.hot.rootElement.appendChild(this.guide);\n }\n\n /**\n * Refresh the resize guide position.\n */\n refreshGuidePosition() {\n this.guide.style.left = this.handle.style.left;\n }\n\n /**\n * Hide both the resize handle and resize guide.\n */\n hideHandleAndGuide() {\n removeClass(this.handle, 'active');\n removeClass(this.guide, 'active');\n }\n\n /**\n * Check if provided element is considered a column header.\n *\n * @param {HTMLElement} element HTML element.\n * @returns {Boolean}\n */\n checkIfColumnHeader(element) {\n if (element != this.hot.rootElement) {\n let parent = element.parentNode;\n\n if (parent.tagName === 'THEAD') {\n return true;\n }\n\n return this.checkIfColumnHeader(parent);\n }\n\n return false;\n }\n\n /**\n * Get the TH element from the provided element.\n *\n * @param {HTMLElement} element HTML element.\n * @returns {HTMLElement}\n */\n getTHFromTargetElement(element) {\n if (element.tagName != 'TABLE') {\n if (element.tagName == 'TH') {\n return element;\n }\n return this.getTHFromTargetElement(element.parentNode);\n\n }\n\n return null;\n }\n\n /**\n * 'mouseover' event callback - set the handle position.\n *\n * @private\n * @param {MouseEvent} event\n */\n onMouseOver(event) {\n if (this.checkIfColumnHeader(event.target)) {\n let th = this.getTHFromTargetElement(event.target);\n\n if (!th) {\n return;\n }\n\n let colspan = th.getAttribute('colspan');\n\n if (th && (colspan === null || colspan === 1)) {\n if (!this.pressed) {\n this.setupHandlePosition(th);\n }\n }\n }\n }\n\n /**\n * Auto-size row after doubleclick - callback.\n *\n * @private\n */\n afterMouseDownTimeout() {\n const render = () => {\n this.hot.forceFullRender = true;\n this.hot.view.render(); // updates all\n this.hot.view.wt.wtOverlays.adjustElementsSize(true);\n };\n const resize = (selectedCol, forceRender) => {\n let hookNewSize = this.hot.runHooks('beforeColumnResize', selectedCol, this.newSize, true);\n\n if (hookNewSize !== void 0) {\n this.newSize = hookNewSize;\n }\n\n if (this.hot.getSettings().stretchH === 'all') {\n this.clearManualSize(selectedCol);\n } else {\n this.setManualSize(selectedCol, this.newSize); // double click sets by auto row size plugin\n }\n\n if (forceRender) {\n render();\n }\n\n this.saveManualColumnWidths();\n\n this.hot.runHooks('afterColumnResize', selectedCol, this.newSize, true);\n };\n\n if (this.dblclick >= 2) {\n let selectedColsLength = this.selectedCols.length;\n\n if (selectedColsLength > 1) {\n arrayEach(this.selectedCols, (selectedCol) => {\n resize(selectedCol);\n });\n render();\n } else {\n arrayEach(this.selectedCols, (selectedCol) => {\n resize(selectedCol, true);\n });\n }\n }\n this.dblclick = 0;\n this.autoresizeTimeout = null;\n }\n\n /**\n * 'mousedown' event callback.\n *\n * @private\n * @param {MouseEvent} e\n */\n onMouseDown(event) {\n if (hasClass(event.target, 'manualColumnResizer')) {\n this.setupGuidePosition();\n this.pressed = this.hot;\n\n if (this.autoresizeTimeout === null) {\n this.autoresizeTimeout = setTimeout(() => this.afterMouseDownTimeout(), 500);\n\n this.hot._registerTimeout(this.autoresizeTimeout);\n }\n this.dblclick++;\n\n this.startX = pageX(event);\n this.newSize = this.startWidth;\n }\n }\n\n /**\n * 'mousemove' event callback - refresh the handle and guide positions, cache the new column width.\n *\n * @private\n * @param {MouseEvent} e\n */\n onMouseMove(event) {\n if (this.pressed) {\n this.currentWidth = this.startWidth + (pageX(event) - this.startX);\n\n arrayEach(this.selectedCols, (selectedCol) => {\n this.newSize = this.setManualSize(selectedCol, this.currentWidth);\n });\n\n this.refreshHandlePosition();\n this.refreshGuidePosition();\n }\n }\n\n /**\n * 'mouseup' event callback - apply the column resizing.\n *\n * @private\n * @param {MouseEvent} e\n */\n onMouseUp(event) {\n const render = () => {\n this.hot.forceFullRender = true;\n this.hot.view.render(); // updates all\n this.hot.view.wt.wtOverlays.adjustElementsSize(true);\n };\n const resize = (selectedCol, forceRender) => {\n this.hot.runHooks('beforeColumnResize', selectedCol, this.newSize);\n\n if (forceRender) {\n render();\n }\n\n this.saveManualColumnWidths();\n\n this.hot.runHooks('afterColumnResize', selectedCol, this.newSize);\n };\n\n if (this.pressed) {\n this.hideHandleAndGuide();\n this.pressed = false;\n\n if (this.newSize != this.startWidth) {\n let selectedColsLength = this.selectedCols.length;\n\n if (selectedColsLength > 1) {\n arrayEach(this.selectedCols, (selectedCol) => {\n resize(selectedCol);\n });\n render();\n } else {\n arrayEach(this.selectedCols, (selectedCol) => {\n resize(selectedCol, true);\n });\n }\n }\n\n this.setupHandlePosition(this.currentTH);\n }\n }\n\n /**\n * Bind the mouse events.\n *\n * @private\n */\n bindEvents() {\n this.eventManager.addEventListener(this.hot.rootElement, 'mouseover', (e) => this.onMouseOver(e));\n this.eventManager.addEventListener(this.hot.rootElement, 'mousedown', (e) => this.onMouseDown(e));\n this.eventManager.addEventListener(window, 'mousemove', (e) => this.onMouseMove(e));\n this.eventManager.addEventListener(window, 'mouseup', (e) => this.onMouseUp(e));\n }\n\n /**\n * Cache the current column width.\n *\n * @param {Number} column Visual column index.\n * @param {Number} width Column width.\n * @returns {Number}\n */\n setManualSize(column, width) {\n width = Math.max(width, 20);\n\n /**\n * We need to run col through modifyCol hook, in case the order of displayed columns is different than the order\n * in data source. For instance, this order can be modified by manualColumnMove plugin.\n */\n column = this.hot.runHooks('modifyCol', column);\n\n this.manualColumnWidths[column] = width;\n\n return width;\n }\n\n /**\n * Clear cache for the current column index.\n *\n * @param {Number} column Visual column index.\n */\n clearManualSize(column) {\n column = this.hot.runHooks('modifyCol', column);\n\n this.manualColumnWidths[column] = void 0;\n }\n\n /**\n * Modify the provided column width, based on the plugin settings\n *\n * @private\n * @param {Number} width Column width.\n * @param {Number} column Visual column index.\n * @returns {Number}\n */\n onModifyColWidth(width, column) {\n if (this.enabled) {\n column = this.hot.runHooks('modifyCol', column);\n\n if (this.hot.getSettings().manualColumnResize && this.manualColumnWidths[column]) {\n return this.manualColumnWidths[column];\n }\n }\n\n return width;\n }\n\n /**\n * Modify the provided column stretched width. This hook decides if specified column should be stretched or not.\n *\n * @private\n * @param {Number} stretchedWidth Stretched width.\n * @param {Number} column Physical column index.\n * @returns {Number}\n */\n onBeforeStretchingColumnWidth(stretchedWidth, column) {\n let width = this.manualColumnWidths[column];\n\n if (width === void 0) {\n width = stretchedWidth;\n }\n\n return width;\n }\n\n /**\n * `beforeColumnResize` hook callback.\n *\n * @private\n * @param {Number} currentColumn Index of the resized column.\n * @param {Number} newSize Calculated new column width.\n * @param {Boolean} isDoubleClick Flag that determines whether there was a double-click.\n */\n onBeforeColumnResize() {\n // clear the header height cache information\n this.hot.view.wt.wtViewport.hasOversizedColumnHeadersMarked = {};\n }\n}\n\nregisterPlugin('manualColumnResize', ManualColumnResize);\n\nexport default ManualColumnResize;\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/manualColumnResize/manualColumnResize.js","import BasePlugin from './../_base.js';\nimport Hooks from './../../pluginHooks';\nimport {arrayEach} from './../../helpers/array';\nimport {addClass, removeClass, offset} from './../../helpers/dom/element';\nimport {rangeEach} from './../../helpers/number';\nimport EventManager from './../../eventManager';\nimport {registerPlugin} from './../../plugins';\nimport RowsMapper from './rowsMapper';\nimport BacklightUI from './ui/backlight';\nimport GuidelineUI from './ui/guideline';\nimport {CellCoords} from './../../3rdparty/walkontable/src';\n\nimport './manualRowMove.css';\n\nHooks.getSingleton().register('beforeRowMove');\nHooks.getSingleton().register('afterRowMove');\nHooks.getSingleton().register('unmodifyRow');\n\nconst privatePool = new WeakMap();\nconst CSS_PLUGIN = 'ht__manualRowMove';\nconst CSS_SHOW_UI = 'show-ui';\nconst CSS_ON_MOVING = 'on-moving--rows';\nconst CSS_AFTER_SELECTION = 'after-selection--rows';\n\n/**\n * @plugin ManualRowMove\n *\n * @description\n * This plugin allows to change rows order.\n *\n * API:\n * - moveRow - move single row to the new position.\n * - moveRows - move many rows (as an array of indexes) to the new position.\n *\n * If you want apply visual changes, you have to call manually the render() method on the instance of handsontable.\n *\n * UI components:\n * - backlight - highlight of selected rows.\n * - guideline - line which shows where rows has been moved.\n *\n * @class ManualRowMove\n * @plugin ManualRowMove\n */\nclass ManualRowMove extends BasePlugin {\n constructor(hotInstance) {\n super(hotInstance);\n\n /**\n * Set up WeakMap of plugin to sharing private parameters;\n */\n privatePool.set(this, {\n rowsToMove: [],\n pressed: void 0,\n disallowMoving: void 0,\n target: {\n eventPageY: void 0,\n coords: void 0,\n TD: void 0,\n row: void 0\n }\n });\n\n /**\n * List of last removed row indexes.\n *\n * @type {Array}\n */\n this.removedRows = [];\n /**\n * Object containing visual row indexes mapped to data source indexes.\n *\n * @type {RowsMapper}\n */\n this.rowsMapper = new RowsMapper(this);\n /**\n * Event Manager object.\n *\n * @type {Object}\n */\n this.eventManager = new EventManager(this);\n /**\n * Backlight UI object.\n *\n * @type {Object}\n */\n this.backlight = new BacklightUI(hotInstance);\n /**\n * Guideline UI object.\n *\n * @type {Object}\n */\n this.guideline = new GuidelineUI(hotInstance);\n }\n\n /**\n * Check if plugin is enabled.\n *\n * @returns {Boolean}\n */\n isEnabled() {\n return !!this.hot.getSettings().manualRowMove;\n }\n\n /**\n * Enable the plugin.\n */\n enablePlugin() {\n if (this.enabled) {\n return;\n }\n\n this.addHook('beforeOnCellMouseDown', (event, coords, TD, blockCalculations) => this.onBeforeOnCellMouseDown(event, coords, TD, blockCalculations));\n this.addHook('beforeOnCellMouseOver', (event, coords, TD, blockCalculations) => this.onBeforeOnCellMouseOver(event, coords, TD, blockCalculations));\n this.addHook('afterScrollHorizontally', () => this.onAfterScrollHorizontally());\n this.addHook('modifyRow', (row, source) => this.onModifyRow(row, source));\n this.addHook('beforeRemoveRow', (index, amount) => this.onBeforeRemoveRow(index, amount));\n this.addHook('afterRemoveRow', () => this.onAfterRemoveRow());\n this.addHook('afterCreateRow', (index, amount) => this.onAfterCreateRow(index, amount));\n this.addHook('afterLoadData', () => this.onAfterLoadData());\n this.addHook('beforeColumnSort', (column, order) => this.onBeforeColumnSort(column, order));\n this.addHook('unmodifyRow', (row) => this.onUnmodifyRow(row));\n\n this.registerEvents();\n\n // TODO: move adding plugin classname to BasePlugin.\n addClass(this.hot.rootElement, CSS_PLUGIN);\n\n super.enablePlugin();\n }\n\n /**\n * Updates the plugin to use the latest options you have specified.\n */\n updatePlugin() {\n this.disablePlugin();\n this.enablePlugin();\n\n this.onAfterPluginsInitialized();\n\n super.updatePlugin();\n }\n\n /**\n * Disable plugin for this Handsontable instance.\n */\n disablePlugin() {\n let pluginSettings = this.hot.getSettings().manualRowMove;\n\n if (Array.isArray(pluginSettings)) {\n this.rowsMapper.clearMap();\n }\n\n removeClass(this.hot.rootElement, CSS_PLUGIN);\n\n this.unregisterEvents();\n this.backlight.destroy();\n this.guideline.destroy();\n\n super.disablePlugin();\n }\n\n /**\n * Move a single row.\n *\n * @param {Number} row Visual row index to be moved.\n * @param {Number} target Visual row index being a target for the moved row.\n */\n moveRow(row, target) {\n this.moveRows([row], target);\n }\n\n /**\n * Move multiple rows.\n *\n * @param {Array} rows Array of visual row indexes to be moved.\n * @param {Number} target Visual row index being a target for the moved rows.\n */\n moveRows(rows, target) {\n const visualRows = [...rows];\n let priv = privatePool.get(this);\n let beforeMoveHook = this.hot.runHooks('beforeRowMove', visualRows, target);\n\n priv.disallowMoving = beforeMoveHook === false;\n\n if (!priv.disallowMoving) {\n // first we need to rewrite an visual indexes to physical for save reference after move\n arrayEach(rows, (row, index, array) => {\n array[index] = this.rowsMapper.getValueByIndex(row);\n });\n\n // next, when we have got an physical indexes, we can move rows\n arrayEach(rows, (row, index) => {\n let actualPosition = this.rowsMapper.getIndexByValue(row);\n\n if (actualPosition !== target) {\n this.rowsMapper.moveRow(actualPosition, target + index);\n }\n });\n\n // after moving we have to clear rowsMapper from null entries\n this.rowsMapper.clearNull();\n }\n\n this.hot.runHooks('afterRowMove', visualRows, target);\n }\n\n /**\n * Correct the cell selection after the move action. Fired only when action was made with a mouse.\n * That means that changing the row order using the API won't correct the selection.\n *\n * @private\n * @param {Number} startRow Visual row index for the start of the selection.\n * @param {Number} endRow Visual row index for the end of the selection.\n */\n changeSelection(startRow, endRow) {\n this.hot.selectRows(startRow, endRow);\n }\n\n /**\n * Get the sum of the heights of rows in the provided range.\n *\n * @private\n * @param {Number} from Visual row index.\n * @param {Number} to Visual row index.\n * @returns {Number}\n */\n getRowsHeight(from, to) {\n let height = 0;\n\n for (let i = from; i < to; i++) {\n let rowHeight = this.hot.view.wt.wtTable.getRowHeight(i) || 23;\n\n height += rowHeight;\n }\n\n return height;\n }\n\n /**\n * Load initial settings when persistent state is saved or when plugin was initialized as an array.\n *\n * @private\n */\n initialSettings() {\n let pluginSettings = this.hot.getSettings().manualRowMove;\n\n if (Array.isArray(pluginSettings)) {\n this.moveRows(pluginSettings, 0);\n\n } else if (pluginSettings !== void 0) {\n let persistentState = this.persistentStateLoad();\n\n if (persistentState.length) {\n this.moveRows(persistentState, 0);\n }\n }\n }\n\n /**\n * Check if the provided row is in the fixedRowsTop section.\n *\n * @private\n * @param {Number} row Visual row index to check.\n * @returns {Boolean}\n */\n isFixedRowTop(row) {\n return row < this.hot.getSettings().fixedRowsTop;\n }\n\n /**\n * Check if the provided row is in the fixedRowsBottom section.\n *\n * @private\n * @param {Number} row Visual row index to check.\n * @returns {Boolean}\n */\n isFixedRowBottom(row) {\n return row > this.hot.getSettings().fixedRowsBottom;\n }\n\n /**\n * Save the manual row positions to the persistent state.\n *\n * @private\n */\n persistentStateSave() {\n this.hot.runHooks('persistentStateSave', 'manualRowMove', this.rowsMapper._arrayMap);\n }\n\n /**\n * Load the manual row positions from the persistent state.\n *\n * @private\n * @returns {Array} Stored state.\n */\n persistentStateLoad() {\n let storedState = {};\n\n this.hot.runHooks('persistentStateLoad', 'manualRowMove', storedState);\n\n return storedState.value ? storedState.value : [];\n }\n\n /**\n * Prepare array of indexes based on actual selection.\n *\n * @private\n * @returns {Array}\n */\n prepareRowsToMoving() {\n let selection = this.hot.getSelectedRangeLast();\n let selectedRows = [];\n\n if (!selection) {\n return selectedRows;\n }\n\n let {from, to} = selection;\n let start = Math.min(from.row, to.row);\n let end = Math.max(from.row, to.row);\n\n rangeEach(start, end, (i) => {\n selectedRows.push(i);\n });\n\n return selectedRows;\n }\n\n /**\n * Update the UI visual position.\n *\n * @private\n */\n refreshPositions() {\n let priv = privatePool.get(this);\n let coords = priv.target.coords;\n let firstVisible = this.hot.view.wt.wtTable.getFirstVisibleRow();\n let lastVisible = this.hot.view.wt.wtTable.getLastVisibleRow();\n let fixedRows = this.hot.getSettings().fixedRowsTop;\n let countRows = this.hot.countRows();\n\n if (coords.row < fixedRows && firstVisible > 0) {\n this.hot.scrollViewportTo(firstVisible - 1);\n }\n if (coords.row >= lastVisible && lastVisible < countRows) {\n this.hot.scrollViewportTo(lastVisible + 1, undefined, true);\n }\n\n let wtTable = this.hot.view.wt.wtTable;\n let TD = priv.target.TD;\n let rootElementOffset = offset(this.hot.rootElement);\n let tdOffsetTop = this.hot.view.THEAD.offsetHeight + this.getRowsHeight(0, coords.row);\n let mouseOffsetTop = priv.target.eventPageY - rootElementOffset.top + wtTable.holder.scrollTop;\n let hiderHeight = wtTable.hider.offsetHeight;\n let tbodyOffsetTop = wtTable.TBODY.offsetTop;\n let backlightElemMarginTop = this.backlight.getOffset().top;\n let backlightElemHeight = this.backlight.getSize().height;\n\n if (this.isFixedRowTop(coords.row)) {\n tdOffsetTop += wtTable.holder.scrollTop;\n }\n\n // todo: fixedRowsBottom\n // if (this.isFixedRowBottom(coords.row)) {\n //\n // }\n\n if (coords.row < 0) {\n // if hover on colHeader\n priv.target.row = firstVisible > 0 ? firstVisible - 1 : firstVisible;\n } else if ((TD.offsetHeight / 2) + tdOffsetTop <= mouseOffsetTop) {\n // if hover on lower part of TD\n priv.target.row = coords.row + 1;\n // unfortunately first row is bigger than rest\n tdOffsetTop += coords.row === 0 ? TD.offsetHeight - 1 : TD.offsetHeight;\n\n } else {\n // elsewhere on table\n priv.target.row = coords.row;\n }\n\n let backlightTop = mouseOffsetTop;\n let guidelineTop = tdOffsetTop;\n\n if (mouseOffsetTop + backlightElemHeight + backlightElemMarginTop >= hiderHeight) {\n // prevent display backlight below table\n backlightTop = hiderHeight - backlightElemHeight - backlightElemMarginTop;\n\n } else if (mouseOffsetTop + backlightElemMarginTop < tbodyOffsetTop) {\n // prevent display above below table\n backlightTop = tbodyOffsetTop + Math.abs(backlightElemMarginTop);\n }\n\n if (tdOffsetTop >= hiderHeight - 1) {\n // prevent display guideline below table\n guidelineTop = hiderHeight - 1;\n }\n\n let topOverlayHeight = 0;\n if (this.hot.view.wt.wtOverlays.topOverlay) {\n topOverlayHeight = this.hot.view.wt.wtOverlays.topOverlay.clone.wtTable.TABLE.offsetHeight;\n }\n\n if (coords.row >= fixedRows && (guidelineTop - wtTable.holder.scrollTop) < topOverlayHeight) {\n this.hot.scrollViewportTo(coords.row);\n }\n\n this.backlight.setPosition(backlightTop);\n this.guideline.setPosition(guidelineTop);\n }\n\n /**\n * This method checks arrayMap from rowsMapper and updates the rowsMapper if it's necessary.\n *\n * @private\n */\n updateRowsMapper() {\n let countRows = this.hot.countSourceRows();\n let rowsMapperLen = this.rowsMapper._arrayMap.length;\n\n if (rowsMapperLen === 0) {\n this.rowsMapper.createMap(countRows || this.hot.getSettings().startRows);\n\n } else if (rowsMapperLen < countRows) {\n let diff = countRows - rowsMapperLen;\n\n this.rowsMapper.insertItems(rowsMapperLen, diff);\n\n } else if (rowsMapperLen > countRows) {\n let maxIndex = countRows - 1;\n let rowsToRemove = [];\n\n arrayEach(this.rowsMapper._arrayMap, (value, index) => {\n if (value > maxIndex) {\n rowsToRemove.push(index);\n }\n });\n\n this.rowsMapper.removeItems(rowsToRemove);\n }\n }\n\n /**\n * Bind the events used by the plugin.\n *\n * @private\n */\n registerEvents() {\n this.eventManager.addEventListener(document.documentElement, 'mousemove', (event) => this.onMouseMove(event));\n this.eventManager.addEventListener(document.documentElement, 'mouseup', () => this.onMouseUp());\n }\n\n /**\n * Unbind the events used by the plugin.\n *\n * @private\n */\n unregisterEvents() {\n this.eventManager.clear();\n }\n\n /**\n * `beforeColumnSort` hook callback. If user uses the sorting, manual row moving is disabled.\n *\n * @private\n * @param {Number} column Column index where soring is present\n * @param {*} order State of sorting. ASC/DESC/None\n */\n onBeforeColumnSort(column, order) {\n let priv = privatePool.get(this);\n\n priv.disallowMoving = order !== void 0;\n }\n\n /**\n * Change the behavior of selection / dragging.\n *\n * @private\n * @param {MouseEvent} event\n * @param {CellCoords} coords Visual coordinates.\n * @param {HTMLElement} TD\n * @param {Object} blockCalculations\n */\n onBeforeOnCellMouseDown(event, coords, TD, blockCalculations) {\n let wtTable = this.hot.view.wt.wtTable;\n let isHeaderSelection = this.hot.selection.isSelectedByRowHeader();\n let selection = this.hot.getSelectedRangeLast();\n let priv = privatePool.get(this);\n\n if (!selection || !isHeaderSelection || priv.pressed || event.button !== 0) {\n priv.pressed = false;\n priv.rowsToMove.length = 0;\n removeClass(this.hot.rootElement, [CSS_ON_MOVING, CSS_SHOW_UI]);\n return;\n }\n\n let guidelineIsNotReady = this.guideline.isBuilt() && !this.guideline.isAppended();\n let backlightIsNotReady = this.backlight.isBuilt() && !this.backlight.isAppended();\n\n if (guidelineIsNotReady && backlightIsNotReady) {\n this.guideline.appendTo(wtTable.hider);\n this.backlight.appendTo(wtTable.hider);\n }\n\n let {from, to} = selection;\n let start = Math.min(from.row, to.row);\n let end = Math.max(from.row, to.row);\n\n if (coords.col < 0 && (coords.row >= start && coords.row <= end)) {\n blockCalculations.row = true;\n priv.pressed = true;\n priv.target.eventPageY = event.pageY;\n priv.target.coords = coords;\n priv.target.TD = TD;\n priv.rowsToMove = this.prepareRowsToMoving();\n\n let leftPos = wtTable.holder.scrollLeft + this.hot.view.wt.wtViewport.getRowHeaderWidth();\n\n this.backlight.setPosition(null, leftPos);\n this.backlight.setSize(wtTable.hider.offsetWidth - leftPos, this.getRowsHeight(start, end + 1));\n this.backlight.setOffset((this.getRowsHeight(start, coords.row) + event.layerY) * -1, null);\n\n addClass(this.hot.rootElement, CSS_ON_MOVING);\n\n this.refreshPositions();\n\n } else {\n removeClass(this.hot.rootElement, CSS_AFTER_SELECTION);\n priv.pressed = false;\n priv.rowsToMove.length = 0;\n }\n }\n\n /**\n * 'mouseMove' event callback. Fired when pointer move on document.documentElement.\n *\n * @private\n * @param {MouseEvent} event `mousemove` event properties.\n */\n onMouseMove(event) {\n let priv = privatePool.get(this);\n\n if (!priv.pressed) {\n return;\n }\n\n // callback for browser which doesn't supports CSS pointer-event: none\n if (event.realTarget === this.backlight.element) {\n let height = this.backlight.getSize().height;\n this.backlight.setSize(null, 0);\n\n setTimeout(function() {\n this.backlight.setPosition(null, height);\n });\n }\n\n priv.target.eventPageY = event.pageY;\n this.refreshPositions();\n }\n\n /**\n * 'beforeOnCellMouseOver' hook callback. Fired when pointer was over cell.\n *\n * @private\n * @param {MouseEvent} event `mouseover` event properties.\n * @param {CellCoords} coords Visual cell coordinates where was fired event.\n * @param {HTMLElement} TD Cell represented as HTMLElement.\n * @param {Object} blockCalculations Object which contains information about blockCalculation for row, column or cells.\n */\n onBeforeOnCellMouseOver(event, coords, TD, blockCalculations) {\n let selectedRange = this.hot.getSelectedRangeLast();\n let priv = privatePool.get(this);\n\n if (!selectedRange || !priv.pressed) {\n return;\n }\n\n if (priv.rowsToMove.indexOf(coords.row) > -1) {\n removeClass(this.hot.rootElement, CSS_SHOW_UI);\n\n } else {\n addClass(this.hot.rootElement, CSS_SHOW_UI);\n }\n\n blockCalculations.row = true;\n blockCalculations.column = true;\n blockCalculations.cell = true;\n priv.target.coords = coords;\n priv.target.TD = TD;\n }\n\n /**\n * `onMouseUp` hook callback.\n *\n * @private\n */\n onMouseUp() {\n let priv = privatePool.get(this);\n let target = priv.target.row;\n let rowsLen = priv.rowsToMove.length;\n\n priv.pressed = false;\n priv.backlightHeight = 0;\n\n removeClass(this.hot.rootElement, [CSS_ON_MOVING, CSS_SHOW_UI, CSS_AFTER_SELECTION]);\n\n if (this.hot.selection.isSelectedByRowHeader()) {\n addClass(this.hot.rootElement, CSS_AFTER_SELECTION);\n }\n\n if (rowsLen < 1 || target === void 0 || priv.rowsToMove.indexOf(target) > -1 ||\n (priv.rowsToMove[rowsLen - 1] === target - 1)) {\n return;\n }\n\n this.moveRows(priv.rowsToMove, target);\n\n this.persistentStateSave();\n this.hot.render();\n\n if (!priv.disallowMoving) {\n let selectionStart = this.rowsMapper.getIndexByValue(priv.rowsToMove[0]);\n let selectionEnd = this.rowsMapper.getIndexByValue(priv.rowsToMove[rowsLen - 1]);\n this.changeSelection(selectionStart, selectionEnd);\n }\n\n priv.rowsToMove.length = 0;\n }\n\n /**\n * `afterScrollHorizontally` hook callback. Fired the table was scrolled horizontally.\n *\n * @private\n */\n onAfterScrollHorizontally() {\n let wtTable = this.hot.view.wt.wtTable;\n let headerWidth = this.hot.view.wt.wtViewport.getRowHeaderWidth();\n let scrollLeft = wtTable.holder.scrollLeft;\n let posLeft = headerWidth + scrollLeft;\n\n this.backlight.setPosition(null, posLeft);\n this.backlight.setSize(wtTable.hider.offsetWidth - posLeft);\n }\n\n /**\n * `afterCreateRow` hook callback.\n *\n * @private\n * @param {Number} index Visual index of the created row.\n * @param {Number} amount Amount of created rows.\n */\n onAfterCreateRow(index, amount) {\n this.rowsMapper.shiftItems(index, amount);\n }\n\n /**\n * On before remove row listener.\n *\n * @private\n * @param {Number} index Visual row index.\n * @param {Number} amount Defines how many rows removed.\n */\n onBeforeRemoveRow(index, amount) {\n this.removedRows.length = 0;\n\n if (index !== false) {\n // Collect physical row index.\n rangeEach(index, index + amount - 1, (removedIndex) => {\n this.removedRows.push(this.hot.runHooks('modifyRow', removedIndex, this.pluginName));\n });\n }\n }\n\n /**\n * `afterRemoveRow` hook callback.\n *\n * @private\n */\n onAfterRemoveRow() {\n this.rowsMapper.unshiftItems(this.removedRows);\n }\n\n /**\n * `afterLoadData` hook callback.\n *\n * @private\n */\n onAfterLoadData() {\n this.updateRowsMapper();\n }\n\n /**\n * 'modifyRow' hook callback.\n *\n * @private\n * @param {Number} row Visual Row index.\n * @returns {Number} Physical row index.\n */\n onModifyRow(row, source) {\n if (source !== this.pluginName) {\n let rowInMapper = this.rowsMapper.getValueByIndex(row);\n row = rowInMapper === null ? row : rowInMapper;\n }\n\n return row;\n }\n\n /**\n * 'unmodifyRow' hook callback.\n *\n * @private\n * @param {Number} row Physical row index.\n * @returns {Number} Visual row index.\n */\n onUnmodifyRow(row) {\n let indexInMapper = this.rowsMapper.getIndexByValue(row);\n\n return indexInMapper === null ? row : indexInMapper;\n }\n\n /**\n * `afterPluginsInitialized` hook callback.\n *\n * @private\n */\n onAfterPluginsInitialized() {\n this.updateRowsMapper();\n this.initialSettings();\n this.backlight.build();\n this.guideline.build();\n }\n\n /**\n * Destroy plugin instance.\n */\n destroy() {\n this.backlight.destroy();\n this.guideline.destroy();\n\n super.destroy();\n }\n}\n\nregisterPlugin('ManualRowMove', ManualRowMove);\n\nexport default ManualRowMove;\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/manualRowMove/manualRowMove.js","import arrayMapper from './../../mixins/arrayMapper';\nimport {arrayFilter} from './../../helpers/array';\nimport {mixin} from './../../helpers/object';\nimport {rangeEach} from './../../helpers/number';\n\n/**\n * @class RowsMapper\n * @plugin ManualRowMove\n */\nclass RowsMapper {\n constructor(manualRowMove) {\n /**\n * Instance of ManualRowMove plugin.\n *\n * @type {ManualRowMove}\n */\n this.manualRowMove = manualRowMove;\n }\n\n /**\n * Reset current map array and create new one.\n *\n * @param {Number} [length] Custom generated map length.\n */\n createMap(length) {\n let originLength = length === void 0 ? this._arrayMap.length : length;\n\n this._arrayMap.length = 0;\n\n rangeEach(originLength - 1, (itemIndex) => {\n this._arrayMap[itemIndex] = itemIndex;\n });\n }\n\n /**\n * Destroy class.\n */\n destroy() {\n this._arrayMap = null;\n }\n\n /**\n *\n * Moving elements in rowsMapper.\n * @param {Number} from Row index to move.\n * @param {Number} to Target index.\n */\n moveRow(from, to) {\n let indexToMove = this._arrayMap[from];\n this._arrayMap[from] = null;\n this._arrayMap.splice(to, 0, indexToMove);\n }\n\n /**\n * Clearing arrayMap from `null` entries.\n */\n clearNull() {\n this._arrayMap = arrayFilter(this._arrayMap, (i) => i !== null);\n }\n}\n\nmixin(RowsMapper, arrayMapper);\n\nexport default RowsMapper;\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/manualRowMove/rowsMapper.js","import BaseUI from './_base';\nimport {addClass} from './../../../helpers/dom/element';\n\nconst CSS_CLASSNAME = 'ht__manualRowMove--backlight';\n\n/**\n * @class BacklightUI\n * @util\n */\nclass BacklightUI extends BaseUI {\n /**\n * Custom className on build process.\n */\n build() {\n super.build();\n\n addClass(this._element, CSS_CLASSNAME);\n }\n}\n\nexport default BacklightUI;\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/manualRowMove/ui/backlight.js","import BaseUI from './_base';\nimport {addClass} from './../../../helpers/dom/element';\n\nconst CSS_CLASSNAME = 'ht__manualRowMove--guideline';\n\n/**\n * @class GuidelineUI\n * @util\n */\nclass GuidelineUI extends BaseUI {\n /**\n * Custom className on build process.\n */\n build() {\n super.build();\n\n addClass(this._element, CSS_CLASSNAME);\n }\n}\n\nexport default GuidelineUI;\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/manualRowMove/ui/guideline.js","// removed by extract-text-webpack-plugin\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/plugins/manualRowMove/manualRowMove.css\n// module id = 342\n// module chunks = 0","import BasePlugin from './../_base';\nimport {addClass, hasClass, removeClass, outerWidth} from './../../helpers/dom/element';\nimport EventManager from './../../eventManager';\nimport {pageX, pageY} from './../../helpers/dom/event';\nimport {arrayEach} from './../../helpers/array';\nimport {rangeEach} from './../../helpers/number';\nimport {registerPlugin} from './../../plugins';\n\n// Developer note! Whenever you make a change in this file, make an analogous change in manualRowResize.js\n\n/**\n * @description\n * ManualRowResize Plugin.\n *\n * Has 2 UI components:\n * - handle - the draggable element that sets the desired height of the row.\n * - guide - the helper guide that shows the desired height as a horizontal guide.\n *\n * @plugin ManualRowResize\n */\nclass ManualRowResize extends BasePlugin {\n\n constructor(hotInstance) {\n super(hotInstance);\n\n this.currentTH = null;\n this.currentRow = null;\n this.selectedRows = [];\n this.currentHeight = null;\n this.newSize = null;\n this.startY = null;\n this.startHeight = null;\n this.startOffset = null;\n this.handle = document.createElement('DIV');\n this.guide = document.createElement('DIV');\n this.eventManager = new EventManager(this);\n this.pressed = null;\n this.dblclick = 0;\n this.autoresizeTimeout = null;\n this.manualRowHeights = [];\n\n addClass(this.handle, 'manualRowResizer');\n addClass(this.guide, 'manualRowResizerGuide');\n }\n\n /**\n * Check if the plugin is enabled in the handsontable settings.\n *\n * @returns {Boolean}\n */\n isEnabled() {\n return this.hot.getSettings().manualRowResize;\n }\n\n /**\n * Enable plugin for this Handsontable instance.\n */\n enablePlugin() {\n if (this.enabled) {\n return;\n }\n\n this.manualRowHeights = [];\n\n let initialRowHeights = this.hot.getSettings().manualRowResize;\n let loadedManualRowHeights = this.loadManualRowHeights();\n\n if (typeof loadedManualRowHeights != 'undefined') {\n this.manualRowHeights = loadedManualRowHeights;\n } else if (Array.isArray(initialRowHeights)) {\n this.manualRowHeights = initialRowHeights;\n } else {\n this.manualRowHeights = [];\n }\n\n this.addHook('modifyRowHeight', (height, row) => this.onModifyRowHeight(height, row));\n\n // Handsontable.hooks.register('beforeRowResize');\n // Handsontable.hooks.register('afterRowResize');\n\n this.bindEvents();\n\n super.enablePlugin();\n }\n\n /**\n * Updates the plugin to use the latest options you have specified.\n */\n updatePlugin() {\n let initialRowHeights = this.hot.getSettings().manualRowResize;\n\n if (Array.isArray(initialRowHeights)) {\n this.manualRowHeights = initialRowHeights;\n\n } else if (!initialRowHeights) {\n this.manualRowHeights = [];\n }\n }\n\n /**\n * Disable plugin for this Handsontable instance.\n */\n disablePlugin() {\n super.disablePlugin();\n }\n\n /**\n * Save the current sizes using the persistentState plugin.\n */\n saveManualRowHeights() {\n this.hot.runHooks('persistentStateSave', 'manualRowHeights', this.manualRowHeights);\n }\n\n /**\n * Load the previously saved sizes using the persistentState plugin.\n *\n * @returns {Array}\n */\n loadManualRowHeights() {\n let storedState = {};\n\n this.hot.runHooks('persistentStateLoad', 'manualRowHeights', storedState);\n\n return storedState.value;\n }\n\n /**\n * Set the resize handle position.\n *\n * @param {HTMLCellElement} TH TH HTML element.\n */\n setupHandlePosition(TH) {\n this.currentTH = TH;\n let row = this.hot.view.wt.wtTable.getCoords(TH).row; // getCoords returns CellCoords\n let headerWidth = outerWidth(this.currentTH);\n\n if (row >= 0) { // if not col header\n let box = this.currentTH.getBoundingClientRect();\n\n this.currentRow = row;\n this.selectedRows = [];\n\n if (this.hot.selection.isSelected() && this.hot.selection.isSelectedByRowHeader()) {\n let {from, to} = this.hot.getSelectedRangeLast();\n let start = from.row;\n let end = to.row;\n\n if (start >= end) {\n start = to.row;\n end = from.row;\n }\n\n if (this.currentRow >= start && this.currentRow <= end) {\n rangeEach(start, end, (i) => this.selectedRows.push(i));\n\n } else {\n this.selectedRows.push(this.currentRow);\n }\n } else {\n this.selectedRows.push(this.currentRow);\n }\n\n this.startOffset = box.top - 6;\n this.startHeight = parseInt(box.height, 10);\n this.handle.style.left = `${box.left}px`;\n this.handle.style.top = `${this.startOffset + this.startHeight}px`;\n this.handle.style.width = `${headerWidth}px`;\n this.hot.rootElement.appendChild(this.handle);\n }\n }\n\n /**\n * Refresh the resize handle position.\n */\n refreshHandlePosition() {\n this.handle.style.top = `${this.startOffset + this.currentHeight}px`;\n }\n\n /**\n * Set the resize guide position.\n */\n setupGuidePosition() {\n let handleWidth = parseInt(outerWidth(this.handle), 10);\n let handleRightPosition = parseInt(this.handle.style.left, 10) + handleWidth;\n let maximumVisibleElementWidth = parseInt(this.hot.view.maximumVisibleElementWidth(0), 10);\n addClass(this.handle, 'active');\n addClass(this.guide, 'active');\n\n this.guide.style.top = this.handle.style.top;\n this.guide.style.left = `${handleRightPosition}px`;\n this.guide.style.width = `${maximumVisibleElementWidth - handleWidth}px`;\n this.hot.rootElement.appendChild(this.guide);\n }\n\n /**\n * Refresh the resize guide position.\n */\n refreshGuidePosition() {\n this.guide.style.top = this.handle.style.top;\n }\n\n /**\n * Hide both the resize handle and resize guide.\n */\n hideHandleAndGuide() {\n removeClass(this.handle, 'active');\n removeClass(this.guide, 'active');\n }\n\n /**\n * Check if provided element is considered as a row header.\n *\n * @param {HTMLElement} element HTML element.\n * @returns {Boolean}\n */\n checkIfRowHeader(element) {\n if (element != this.hot.rootElement) {\n let parent = element.parentNode;\n\n if (parent.tagName === 'TBODY') {\n return true;\n }\n\n return this.checkIfRowHeader(parent);\n }\n\n return false;\n }\n\n /**\n * Get the TH element from the provided element.\n *\n * @param {HTMLElement} element HTML element.\n * @returns {HTMLElement}\n */\n getTHFromTargetElement(element) {\n if (element.tagName != 'TABLE') {\n if (element.tagName == 'TH') {\n return element;\n }\n return this.getTHFromTargetElement(element.parentNode);\n\n }\n\n return null;\n }\n\n /**\n * 'mouseover' event callback - set the handle position.\n *\n * @private\n * @param {MouseEvent} event\n */\n onMouseOver(event) {\n if (this.checkIfRowHeader(event.target)) {\n let th = this.getTHFromTargetElement(event.target);\n\n if (th) {\n if (!this.pressed) {\n this.setupHandlePosition(th);\n }\n }\n }\n }\n\n /**\n * Auto-size row after doubleclick - callback.\n *\n * @private\n */\n afterMouseDownTimeout() {\n const render = () => {\n this.hot.forceFullRender = true;\n this.hot.view.render(); // updates all\n this.hot.view.wt.wtOverlays.adjustElementsSize(true);\n };\n const resize = (selectedRow, forceRender) => {\n let hookNewSize = this.hot.runHooks('beforeRowResize', selectedRow, this.newSize, true);\n\n if (hookNewSize !== void 0) {\n this.newSize = hookNewSize;\n }\n\n this.setManualSize(selectedRow, this.newSize); // double click sets auto row size\n\n if (forceRender) {\n render();\n }\n\n this.hot.runHooks('afterRowResize', selectedRow, this.newSize, true);\n };\n\n if (this.dblclick >= 2) {\n let selectedRowsLength = this.selectedRows.length;\n\n if (selectedRowsLength > 1) {\n arrayEach(this.selectedRows, (selectedRow) => {\n resize(selectedRow);\n });\n render();\n } else {\n arrayEach(this.selectedRows, (selectedRow) => {\n resize(selectedRow, true);\n });\n }\n }\n this.dblclick = 0;\n this.autoresizeTimeout = null;\n }\n\n /**\n * 'mousedown' event callback.\n *\n * @private\n * @param {MouseEvent} event\n */\n onMouseDown(event) {\n if (hasClass(event.target, 'manualRowResizer')) {\n this.setupGuidePosition();\n this.pressed = this.hot;\n\n if (this.autoresizeTimeout == null) {\n this.autoresizeTimeout = setTimeout(() => this.afterMouseDownTimeout(), 500);\n\n this.hot._registerTimeout(this.autoresizeTimeout);\n }\n this.dblclick++;\n\n this.startY = pageY(event);\n this.newSize = this.startHeight;\n }\n }\n\n /**\n * 'mousemove' event callback - refresh the handle and guide positions, cache the new row height.\n *\n * @private\n * @param {MouseEvent} event\n */\n onMouseMove(event) {\n if (this.pressed) {\n this.currentHeight = this.startHeight + (pageY(event) - this.startY);\n\n arrayEach(this.selectedRows, (selectedRow) => {\n this.newSize = this.setManualSize(selectedRow, this.currentHeight);\n });\n\n this.refreshHandlePosition();\n this.refreshGuidePosition();\n }\n }\n\n /**\n * 'mouseup' event callback - apply the row resizing.\n *\n * @private\n * @param {MouseEvent} event\n */\n onMouseUp(event) {\n const render = () => {\n this.hot.forceFullRender = true;\n this.hot.view.render(); // updates all\n this.hot.view.wt.wtOverlays.adjustElementsSize(true);\n };\n const runHooks = (selectedRow, forceRender) => {\n this.hot.runHooks('beforeRowResize', selectedRow, this.newSize);\n\n if (forceRender) {\n render();\n }\n\n this.saveManualRowHeights();\n\n this.hot.runHooks('afterRowResize', selectedRow, this.newSize);\n };\n if (this.pressed) {\n this.hideHandleAndGuide();\n this.pressed = false;\n\n if (this.newSize != this.startHeight) {\n let selectedRowsLength = this.selectedRows.length;\n\n if (selectedRowsLength > 1) {\n arrayEach(this.selectedRows, (selectedRow) => {\n runHooks(selectedRow);\n });\n render();\n } else {\n arrayEach(this.selectedRows, (selectedRow) => {\n runHooks(selectedRow, true);\n });\n }\n }\n\n this.setupHandlePosition(this.currentTH);\n }\n }\n\n /**\n * Bind the mouse events.\n *\n * @private\n */\n bindEvents() {\n this.eventManager.addEventListener(this.hot.rootElement, 'mouseover', (e) => this.onMouseOver(e));\n this.eventManager.addEventListener(this.hot.rootElement, 'mousedown', (e) => this.onMouseDown(e));\n this.eventManager.addEventListener(window, 'mousemove', (e) => this.onMouseMove(e));\n this.eventManager.addEventListener(window, 'mouseup', (e) => this.onMouseUp(e));\n }\n\n /**\n * Cache the current row height.\n *\n * @param {Number} row Visual row index.\n * @param {Number} height Row height.\n * @returns {Number}\n */\n setManualSize(row, height) {\n row = this.hot.runHooks('modifyRow', row);\n this.manualRowHeights[row] = height;\n\n return height;\n }\n\n /**\n * Modify the provided row height, based on the plugin settings.\n *\n * @private\n * @param {Number} height Row height.\n * @param {Number} row Visual row index.\n * @returns {Number}\n */\n onModifyRowHeight(height, row) {\n if (this.enabled) {\n let autoRowSizePlugin = this.hot.getPlugin('autoRowSize');\n let autoRowHeightResult = autoRowSizePlugin ? autoRowSizePlugin.heights[row] : null;\n\n row = this.hot.runHooks('modifyRow', row);\n\n let manualRowHeight = this.manualRowHeights[row];\n\n if (manualRowHeight !== void 0 && (manualRowHeight === autoRowHeightResult || manualRowHeight > (height || 0))) {\n return manualRowHeight;\n }\n }\n\n return height;\n }\n}\n\nregisterPlugin('manualRowResize', ManualRowResize);\n\nexport default ManualRowResize;\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/manualRowResize/manualRowResize.js","import BasePlugin from './../_base';\nimport Hooks from './../../pluginHooks';\nimport {registerPlugin} from './../../plugins';\nimport {stopImmediatePropagation} from './../../helpers/dom/event';\nimport {CellCoords, CellRange} from './../../3rdparty/walkontable/src';\nimport MergedCellsCollection from './cellsCollection';\nimport MergedCellCoords from './cellCoords';\nimport AutofillCalculations from './calculations/autofill';\nimport SelectionCalculations from './calculations/selection';\nimport toggleMergeItem from './contextMenuItem/toggleMerge';\nimport {arrayEach} from '../../helpers/array';\nimport {clone} from '../../helpers/object';\nimport {warn} from '../../helpers/console';\nimport {rangeEach} from '../../helpers/number';\nimport {applySpanProperties} from './utils';\nimport './mergeCells.css';\n\nHooks.getSingleton().register('beforeMergeCells');\nHooks.getSingleton().register('afterMergeCells');\nHooks.getSingleton().register('beforeUnmergeCells');\nHooks.getSingleton().register('afterUnmergeCells');\n\nconst privatePool = new WeakMap();\n\n/**\n * @plugin MergeCells\n *\n * @description Plugin, which allows merging cells in the table (using the initial configuration, API or context menu).\n *\n * @example\n *\n * ```js\n * ...\n * let hot = new Handsontable(document.getElementById('example'), {\n * data: getData(),\n * mergeCells: [\n * {row: 0, col: 3, rowspan: 3, colspan: 3},\n * {row: 2, col: 6, rowspan: 2, colspan: 2},\n * {row: 4, col: 8, rowspan: 3, colspan: 3}\n * ],\n * ...\n * ```\n */\nclass MergeCells extends BasePlugin {\n constructor(hotInstance) {\n super(hotInstance);\n\n privatePool.set(this, {\n lastDesiredCoords: null\n });\n\n /**\n * A container for all the merged cells.\n *\n * @type {MergedCellsCollection}\n */\n this.mergedCellsCollection = null;\n /**\n * Instance of the class responsible for all the autofill-related calculations.\n *\n * @private\n * @type {AutofillCalculations}\n */\n this.autofillCalculations = null;\n /**\n * Instance of the class responsible for the selection-related calculations.\n *\n * @private\n * @type {SelectionCalculations}\n */\n this.selectionCalculations = null;\n }\n\n /**\n * Check if the plugin is enabled in the Handsontable settings.\n *\n * @returns {Boolean}\n */\n isEnabled() {\n return !!this.hot.getSettings().mergeCells;\n }\n\n /**\n * Enable the plugin.\n */\n enablePlugin() {\n if (this.enabled) {\n return;\n }\n\n this.mergedCellsCollection = new MergedCellsCollection(this);\n this.autofillCalculations = new AutofillCalculations(this);\n this.selectionCalculations = new SelectionCalculations(this);\n\n this.addHook('afterInit', (...args) => this.onAfterInit(...args));\n this.addHook('beforeKeyDown', (...args) => this.onBeforeKeyDown(...args));\n this.addHook('modifyTransformStart', (...args) => this.onModifyTransformStart(...args));\n this.addHook('afterModifyTransformStart', (...args) => this.onAfterModifyTransformStart(...args));\n this.addHook('modifyTransformEnd', (...args) => this.onModifyTransformEnd(...args));\n this.addHook('modifyGetCellCoords', (...args) => this.onModifyGetCellCoords(...args));\n this.addHook('beforeSetRangeEnd', (...args) => this.onBeforeSetRangeEnd(...args));\n this.addHook('afterIsMultipleSelection', (...args) => this.onAfterIsMultipleSelection(...args));\n this.addHook('afterRenderer', (...args) => this.onAfterRenderer(...args));\n this.addHook('afterContextMenuDefaultOptions', (...args) => this.addMergeActionsToContextMenu(...args));\n this.addHook('afterGetCellMeta', (...args) => this.onAfterGetCellMeta(...args));\n this.addHook('afterViewportRowCalculatorOverride', (...args) => this.onAfterViewportRowCalculatorOverride(...args));\n this.addHook('afterViewportColumnCalculatorOverride', (...args) => this.onAfterViewportColumnCalculatorOverride(...args));\n this.addHook('modifyAutofillRange', (...args) => this.onModifyAutofillRange(...args));\n this.addHook('afterCreateCol', (...args) => this.onAfterCreateCol(...args));\n this.addHook('afterRemoveCol', (...args) => this.onAfterRemoveCol(...args));\n this.addHook('afterCreateRow', (...args) => this.onAfterCreateRow(...args));\n this.addHook('afterRemoveRow', (...args) => this.onAfterRemoveRow(...args));\n this.addHook('afterChange', (...args) => this.onAfterChange(...args));\n this.addHook('beforeDrawBorders', (...args) => this.onBeforeDrawAreaBorders(...args));\n this.addHook('afterDrawSelection', (...args) => this.onAfterDrawSelection(...args));\n this.addHook('beforeRemoveCellClassNames', (...args) => this.onBeforeRemoveCellClassNames(...args));\n\n super.enablePlugin();\n }\n\n /**\n * Disable the plugin.\n */\n disablePlugin() {\n this.clearCollections();\n this.hot.render();\n super.disablePlugin();\n }\n\n /**\n * Update the plugin (after using the `updateSettings` method)\n */\n updatePlugin() {\n const settings = this.hot.getSettings().mergeCells;\n\n this.clearCollections();\n this.disablePlugin();\n this.enablePlugin();\n\n this.generateFromSettings(settings);\n\n super.updatePlugin();\n }\n\n /**\n * Validate a single setting object, represented by a single merged cell information object.\n *\n * @private\n * @param {Object} setting An object with `row`, `col`, `rowspan` and `colspan` properties.\n * @return {Boolean}\n */\n validateSetting(setting) {\n let valid = true;\n\n if (!setting) {\n return false;\n }\n\n if (MergedCellCoords.containsNegativeValues(setting)) {\n warn(MergedCellCoords.NEGATIVE_VALUES_WARNING(setting));\n\n valid = false;\n\n } else if (MergedCellCoords.isOutOfBounds(setting, this.hot.countRows(), this.hot.countCols())) {\n warn(MergedCellCoords.IS_OUT_OF_BOUNDS_WARNING(setting));\n\n valid = false;\n\n } else if (MergedCellCoords.isSingleCell(setting)) {\n warn(MergedCellCoords.IS_SINGLE_CELL(setting));\n\n valid = false;\n\n } else if (MergedCellCoords.containsZeroSpan(setting)) {\n warn(MergedCellCoords.ZERO_SPAN_WARNING(setting));\n\n valid = false;\n }\n\n return valid;\n }\n\n /**\n * Generate the merged cells from the settings provided to the plugin.\n *\n * @private\n * @param {Array|Boolean} settings The settings provided to the plugin.\n */\n generateFromSettings(settings) {\n if (Array.isArray(settings)) {\n let populationArgumentsList = [];\n\n arrayEach(settings, (setting) => {\n if (!this.validateSetting(setting)) {\n return;\n }\n\n const highlight = new CellCoords(setting.row, setting.col);\n const rangeEnd = new CellCoords(setting.row + setting.rowspan - 1, setting.col + setting.colspan - 1);\n const mergeRange = new CellRange(highlight, highlight, rangeEnd);\n\n populationArgumentsList.push(this.mergeRange(mergeRange, true, true));\n });\n\n // remove 'empty' setting objects, caused by improper merge range declarations\n populationArgumentsList = populationArgumentsList.filter((value) => value !== true);\n\n const bulkPopulationData = this.getBulkCollectionData(populationArgumentsList);\n\n this.hot.populateFromArray(...bulkPopulationData);\n }\n }\n\n /**\n * Generates a bulk set of all the data to be populated to fill the data \"under\" the added merged cells.\n *\n * @private\n * @param {Array} populationArgumentsList Array in a form of `[row, column, dataUnderCollection]`.\n * @return {Array} Array in a form of `[row, column, dataOfAllCollections]`.\n */\n getBulkCollectionData(populationArgumentsList) {\n const populationDataRange = this.getBulkCollectionDataRange(populationArgumentsList);\n const dataAtRange = this.hot.getData(...populationDataRange);\n const newDataAtRange = dataAtRange.splice(0);\n\n arrayEach(populationArgumentsList, (mergedCellArguments) => {\n const [mergedCellRowIndex, mergedCellColumnIndex, mergedCellData] = mergedCellArguments;\n\n arrayEach(mergedCellData, (mergedCellRow, rowIndex) => {\n arrayEach(mergedCellRow, (mergedCellElement, columnIndex) => {\n newDataAtRange[mergedCellRowIndex - populationDataRange[0] + rowIndex][mergedCellColumnIndex - populationDataRange[1] + columnIndex] = mergedCellElement;\n });\n });\n });\n\n return [populationDataRange[0], populationDataRange[1], newDataAtRange];\n }\n\n /**\n * Get the range of combined data ranges provided in a form of an array of arrays ([row, column, dataUnderCollection])\n *\n * @private\n * @param {Array} populationArgumentsList Array containing argument lists for the `populateFromArray` method - row, column and data for population.\n * @return {Array[]} Start and end coordinates of the merged cell range. (in a form of [rowIndex, columnIndex])\n */\n getBulkCollectionDataRange(populationArgumentsList) {\n let start = [0, 0];\n let end = [0, 0];\n let mergedCellRow = null;\n let mergedCellColumn = null;\n let mergedCellData = null;\n\n arrayEach(populationArgumentsList, (mergedCellArguments) => {\n mergedCellRow = mergedCellArguments[0];\n mergedCellColumn = mergedCellArguments[1];\n mergedCellData = mergedCellArguments[2];\n\n start[0] = Math.min(mergedCellRow, start[0]);\n start[1] = Math.min(mergedCellColumn, start[1]);\n end[0] = Math.max(mergedCellRow + mergedCellData.length - 1, end[0]);\n end[1] = Math.max(mergedCellColumn + mergedCellData[0].length - 1, end[1]);\n });\n\n return [...start, ...end];\n }\n\n /**\n * Clear the merged cells from the merged cell container.\n */\n clearCollections() {\n this.mergedCellsCollection.clear();\n }\n\n /**\n * Returns `true` if a range is mergeable.\n *\n * @private\n * @param {Object} newMergedCellInfo Merged cell information object to test.\n * @param {Boolean} [auto=false] `true` if triggered at initialization.\n * @returns {Boolean}\n */\n canMergeRange(newMergedCellInfo, auto = false) {\n return auto ? true : this.validateSetting(newMergedCellInfo);\n }\n\n /**\n * Merge or unmerge, based on last selected range.\n *\n * @private\n */\n toggleMergeOnSelection() {\n const currentRange = this.hot.getSelectedRangeLast();\n\n if (!currentRange) {\n return;\n }\n\n currentRange.setDirection('NW-SE');\n\n const {from, to} = currentRange;\n\n this.toggleMerge(currentRange);\n this.hot.selectCell(from.row, from.col, to.row, to.col, false);\n }\n\n /**\n * Merge the selection provided as a cell range.\n *\n * @param {CellRange} [cellRange] Selection cell range.\n */\n mergeSelection(cellRange = this.hot.getSelectedRangeLast()) {\n if (!cellRange) {\n return;\n }\n\n cellRange.setDirection('NW-SE');\n\n const {from, to} = cellRange;\n\n this.unmergeRange(cellRange, true);\n this.mergeRange(cellRange);\n this.hot.selectCell(from.row, from.col, to.row, to.col, false);\n }\n\n /**\n * Unmerge the selection provided as a cell range.\n *\n * @param {CellRange} [cellRange] Selection cell range.\n */\n unmergeSelection(cellRange = this.hot.getSelectedRangeLast()) {\n if (!cellRange) {\n return;\n }\n\n const {from, to} = cellRange;\n\n this.unmergeRange(cellRange, true);\n this.hot.selectCell(from.row, from.col, to.row, to.col, false);\n }\n\n /**\n * Merge cells in the provided cell range.\n *\n * @private\n * @param {CellRange} cellRange Cell range to merge.\n * @param {Boolean} [auto=false] `true` if is called automatically, e.g. at initialization.\n * @param {Boolean} [preventPopulation=false] `true`, if the method should not run `populateFromArray` at the end, but rather return its arguments.\n * @returns {Array|Boolean} Returns an array of [row, column, dataUnderCollection] if preventPopulation is set to true. If the the merging process went successful, it returns `true`, otherwise - `false`.\n * @fires Hooks#beforeMergeCells\n * @fires Hooks#afterMergeCells\n */\n mergeRange(cellRange, auto = false, preventPopulation = false) {\n const topLeft = cellRange.getTopLeftCorner();\n const bottomRight = cellRange.getBottomRightCorner();\n const mergeParent = {\n row: topLeft.row,\n col: topLeft.col,\n rowspan: bottomRight.row - topLeft.row + 1,\n colspan: bottomRight.col - topLeft.col + 1\n };\n const clearedData = [];\n let populationInfo = null;\n\n if (!this.canMergeRange(mergeParent, auto)) {\n return false;\n }\n\n this.hot.runHooks('beforeMergeCells', cellRange, auto);\n\n rangeEach(0, mergeParent.rowspan - 1, (i) => {\n rangeEach(0, mergeParent.colspan - 1, (j) => {\n let clearedValue = null;\n\n if (!clearedData[i]) {\n clearedData[i] = [];\n }\n\n if (i === 0 && j === 0) {\n clearedValue = this.hot.getDataAtCell(mergeParent.row, mergeParent.col);\n\n } else {\n this.hot.setCellMeta(mergeParent.row + i, mergeParent.col + j, 'hidden', true);\n }\n\n clearedData[i][j] = clearedValue;\n });\n });\n\n this.hot.setCellMeta(mergeParent.row, mergeParent.col, 'spanned', true);\n\n let mergedCellAdded = this.mergedCellsCollection.add(mergeParent);\n\n if (mergedCellAdded) {\n if (preventPopulation) {\n populationInfo = [mergeParent.row, mergeParent.col, clearedData];\n\n } else {\n this.hot.populateFromArray(mergeParent.row, mergeParent.col, clearedData, void 0, void 0, this.pluginName);\n }\n\n this.hot.runHooks('afterMergeCells', cellRange, mergeParent, auto);\n\n return populationInfo;\n }\n\n return true;\n }\n\n /**\n * Unmerge the selection provided as a cell range. If no cell range is provided, it uses the current selection.\n *\n * @private\n * @param {CellRange} cellRange Selection cell range.\n * @param {Boolean} [auto=false] `true` if called automatically by the plugin.\n */\n unmergeRange(cellRange, auto = false) {\n const mergedCells = this.mergedCellsCollection.getWithinRange(cellRange);\n\n if (!mergedCells) {\n return;\n }\n\n this.hot.runHooks('beforeUnmergeCells', cellRange, auto);\n\n arrayEach(mergedCells, (currentCollection) => {\n this.mergedCellsCollection.remove(currentCollection.row, currentCollection.col);\n\n rangeEach(0, currentCollection.rowspan - 1, (i) => {\n rangeEach(0, currentCollection.colspan - 1, (j) => {\n this.hot.removeCellMeta(currentCollection.row + i, currentCollection.col + j, 'hidden');\n });\n });\n\n this.hot.removeCellMeta(currentCollection.row, currentCollection.col, 'spanned');\n });\n\n this.hot.render();\n this.hot.runHooks('afterUnmergeCells', cellRange, auto);\n }\n\n /**\n * Merge or unmerge, based on the cell range provided as `cellRange`.\n *\n * @private\n * @param {CellRange} cellRange The cell range to merge or unmerged.\n */\n toggleMerge(cellRange) {\n const mergedCell = this.mergedCellsCollection.get(cellRange.from.row, cellRange.from.col);\n const mergedCellCoversWholeRange = mergedCell.row === cellRange.from.row && mergedCell.col === cellRange.from.col &&\n mergedCell.row + mergedCell.rowspan - 1 === cellRange.to.row && mergedCell.col + mergedCell.colspan - 1 === cellRange.to.col;\n\n if (mergedCellCoversWholeRange) {\n this.unmergeRange(cellRange);\n\n } else {\n this.mergeSelection(cellRange);\n }\n }\n\n /**\n * Merge the specified range.\n *\n * @param {Number} startRow Start row of the merged cell.\n * @param {Number} startColumn Start column of the merged cell.\n * @param {Number} endRow End row of the merged cell.\n * @param {Number} endColumn End column of the merged cell.\n */\n merge(startRow, startColumn, endRow, endColumn) {\n const start = new CellCoords(startRow, startColumn);\n const end = new CellCoords(endRow, endColumn);\n\n this.mergeRange(new CellRange(start, start, end));\n }\n\n /**\n * Unmerge the merged cell in the provided range.\n *\n * @param {Number} startRow Start row of the merged cell.\n * @param {Number} startColumn Start column of the merged cell.\n * @param {Number} endRow End row of the merged cell.\n * @param {Number} endColumn End column of the merged cell.\n */\n unmerge(startRow, startColumn, endRow, endColumn) {\n const start = new CellCoords(startRow, startColumn);\n const end = new CellCoords(endRow, endColumn);\n\n this.unmergeRange(new CellRange(start, start, end));\n }\n\n /**\n * `afterInit` hook callback.\n *\n * @private\n */\n onAfterInit() {\n this.generateFromSettings(this.hot.getSettings().mergeCells);\n this.hot.render();\n }\n\n /**\n * `beforeKeyDown` hook callback.\n *\n * @private\n * @param {KeyboardEvent} event The `keydown` event object.\n */\n onBeforeKeyDown(event) {\n const ctrlDown = (event.ctrlKey || event.metaKey) && !event.altKey;\n\n if (ctrlDown && event.keyCode === 77) { // CTRL + M\n this.toggleMerge(this.hot.getSelectedRangeLast());\n\n this.hot.render();\n stopImmediatePropagation(event);\n }\n }\n\n /**\n * Modify the information on whether the current selection contains multiple cells. The `afterIsMultipleSelection` hook callback.\n *\n * @private\n * @param {Boolean} isMultiple\n * @returns {Boolean}\n */\n onAfterIsMultipleSelection(isMultiple) {\n if (isMultiple) {\n let mergedCells = this.mergedCellsCollection.mergedCells;\n let selectionRange = this.hot.getSelectedRangeLast();\n\n for (let group = 0; group < mergedCells.length; group += 1) {\n if (selectionRange.highlight.row === mergedCells[group].row &&\n selectionRange.highlight.col === mergedCells[group].col &&\n selectionRange.to.row === mergedCells[group].row + mergedCells[group].rowspan - 1 &&\n selectionRange.to.col === mergedCells[group].col + mergedCells[group].colspan - 1) {\n return false;\n }\n }\n }\n\n return isMultiple;\n }\n\n /**\n * `modifyTransformStart` hook callback.\n *\n * @private\n * @param {Object} delta The transformation delta.\n */\n onModifyTransformStart(delta) {\n const priv = privatePool.get(this);\n const currentlySelectedRange = this.hot.getSelectedRangeLast();\n let newDelta = {\n row: delta.row,\n col: delta.col,\n };\n let nextPosition = null;\n let currentPosition = new CellCoords(currentlySelectedRange.highlight.row, currentlySelectedRange.highlight.col);\n let mergedParent = this.mergedCellsCollection.get(currentPosition.row, currentPosition.col);\n\n if (!priv.lastDesiredCoords) {\n priv.lastDesiredCoords = new CellCoords(null, null);\n }\n\n if (mergedParent) { // only merge selected\n let mergeTopLeft = new CellCoords(mergedParent.row, mergedParent.col);\n let mergeBottomRight = new CellCoords(mergedParent.row + mergedParent.rowspan - 1, mergedParent.col + mergedParent.colspan - 1);\n let mergeRange = new CellRange(mergeTopLeft, mergeTopLeft, mergeBottomRight);\n\n if (!mergeRange.includes(priv.lastDesiredCoords)) {\n priv.lastDesiredCoords = new CellCoords(null, null); // reset outdated version of lastDesiredCoords\n }\n\n newDelta.row = priv.lastDesiredCoords.row ? priv.lastDesiredCoords.row - currentPosition.row : newDelta.row;\n newDelta.col = priv.lastDesiredCoords.col ? priv.lastDesiredCoords.col - currentPosition.col : newDelta.col;\n\n if (delta.row > 0) { // moving down\n newDelta.row = mergedParent.row + mergedParent.rowspan - 1 - currentPosition.row + delta.row;\n\n } else if (delta.row < 0) { // moving up\n newDelta.row = currentPosition.row - mergedParent.row + delta.row;\n }\n\n if (delta.col > 0) { // moving right\n newDelta.col = mergedParent.col + mergedParent.colspan - 1 - currentPosition.col + delta.col;\n\n } else if (delta.col < 0) { // moving left\n newDelta.col = currentPosition.col - mergedParent.col + delta.col;\n }\n }\n\n nextPosition = new CellCoords(currentlySelectedRange.highlight.row + newDelta.row, currentlySelectedRange.highlight.col + newDelta.col);\n\n let nextParentIsMerged = this.mergedCellsCollection.get(nextPosition.row, nextPosition.col);\n\n if (nextParentIsMerged) { // skipping the invisible cells in the merge range\n priv.lastDesiredCoords = nextPosition;\n newDelta = {\n row: nextParentIsMerged.row - currentPosition.row,\n col: nextParentIsMerged.col - currentPosition.col\n };\n }\n\n if (newDelta.row !== 0) {\n delta.row = newDelta.row;\n }\n if (newDelta.col !== 0) {\n delta.col = newDelta.col;\n }\n }\n\n /**\n * `modifyTransformEnd` hook callback. Needed to handle \"jumping over\" merged merged cells, while selecting.\n *\n * @private\n * @param {Object} delta The transformation delta.\n */\n onModifyTransformEnd(delta) {\n let currentSelectionRange = this.hot.getSelectedRangeLast();\n let newDelta = clone(delta);\n let newSelectionRange = this.selectionCalculations.getUpdatedSelectionRange(currentSelectionRange, delta);\n let tempDelta = clone(newDelta);\n\n const mergedCellsWithinRange = this.mergedCellsCollection.getWithinRange(newSelectionRange, true);\n\n do {\n tempDelta = clone(newDelta);\n this.selectionCalculations.getUpdatedSelectionRange(currentSelectionRange, newDelta);\n\n arrayEach(mergedCellsWithinRange, (mergedCell) => {\n this.selectionCalculations.snapDelta(newDelta, currentSelectionRange, mergedCell);\n });\n\n } while (newDelta.row !== tempDelta.row || newDelta.col !== tempDelta.col);\n\n delta.row = newDelta.row;\n delta.col = newDelta.col;\n }\n\n /**\n * `modifyGetCellCoords` hook callback. Swaps the `getCell` coords with the merged parent coords.\n *\n * @private\n * @param {Number} row Row index.\n * @param {Number} column Column index.\n * @returns {Array}\n */\n onModifyGetCellCoords(row, column) {\n const mergeParent = this.mergedCellsCollection.get(row, column);\n\n return mergeParent ? [\n mergeParent.row, mergeParent.col,\n mergeParent.row + mergeParent.rowspan - 1,\n mergeParent.col + mergeParent.colspan - 1] : void 0;\n }\n\n /**\n * `afterContextMenuDefaultOptions` hook callback.\n *\n * @private\n * @param {Object} defaultOptions The default context menu options.\n */\n addMergeActionsToContextMenu(defaultOptions) {\n defaultOptions.items.push(\n {\n name: '---------',\n },\n toggleMergeItem(this)\n );\n }\n\n /**\n * `afterRenderer` hook callback.\n *\n * @private\n * @param {HTMLElement} TD The cell to be modified.\n * @param {Number} row Row index.\n * @param {Number} col Column index.\n */\n onAfterRenderer(TD, row, col) {\n let mergedCell = this.mergedCellsCollection.get(row, col);\n\n applySpanProperties(TD, mergedCell, row, col);\n }\n\n /**\n * `beforeSetRangeEnd` hook callback.\n * While selecting cells with keyboard or mouse, make sure that rectangular area is expanded to the extent of the merged cell\n *\n * @private\n * @param {Object} coords Cell coords.\n */\n onBeforeSetRangeEnd(coords) {\n let selRange = this.hot.getSelectedRangeLast();\n selRange.highlight = new CellCoords(selRange.highlight.row, selRange.highlight.col); // clone in case we will modify its reference\n selRange.to = coords;\n let rangeExpanded = false;\n\n if ((selRange.from.row === 0 && selRange.to.row === this.hot.countRows() - 1) || (selRange.from.col === 0 && selRange.to.col === this.hot.countCols() - 1)) {\n return;\n }\n\n do {\n rangeExpanded = false;\n\n for (let i = 0; i < this.mergedCellsCollection.mergedCells.length; i += 1) {\n let cellInfo = this.mergedCellsCollection.mergedCells[i];\n let mergedCellRange = cellInfo.getRange();\n\n if (selRange.expandByRange(mergedCellRange)) {\n coords.row = selRange.to.row;\n coords.col = selRange.to.col;\n\n rangeExpanded = true;\n }\n }\n } while (rangeExpanded);\n }\n\n /**\n * The `afterGetCellMeta` hook callback.\n *\n * @private\n * @param {Number} row Row index.\n * @param {Number} col Column index.\n * @param {Object} cellProperties The cell properties object.\n */\n onAfterGetCellMeta(row, col, cellProperties) {\n let mergeParent = this.mergedCellsCollection.get(row, col);\n\n if (mergeParent && (mergeParent.row !== row || mergeParent.col !== col)) {\n cellProperties.copyable = false;\n }\n }\n\n /**\n * `afterViewportRowCalculatorOverride` hook callback.\n *\n * @private\n * @param {Object} calc The row calculator object.\n */\n onAfterViewportRowCalculatorOverride(calc) {\n let colCount = this.hot.countCols();\n let mergeParent;\n\n rangeEach(0, colCount - 1, (c) => {\n mergeParent = this.mergedCellsCollection.get(calc.startRow, c);\n if (mergeParent) {\n if (mergeParent.row < calc.startRow) {\n calc.startRow = mergeParent.row;\n return this.onAfterViewportRowCalculatorOverride.call(this, calc); // recursively search upwards\n }\n }\n\n mergeParent = this.mergedCellsCollection.get(calc.endRow, c);\n\n if (mergeParent) {\n let mergeEnd = mergeParent.row + mergeParent.rowspan - 1;\n if (mergeEnd > calc.endRow) {\n calc.endRow = mergeEnd;\n return this.onAfterViewportRowCalculatorOverride.call(this, calc); // recursively search upwards\n }\n }\n\n return true;\n });\n }\n\n /**\n * `afterViewportColumnCalculatorOverride` hook callback.\n *\n * @private\n * @param {Object} calc The column calculator object.\n */\n onAfterViewportColumnCalculatorOverride(calc) {\n let rowCount = this.hot.countRows();\n let mergeParent;\n\n rangeEach(0, rowCount - 1, (r) => {\n mergeParent = this.mergedCellsCollection.get(r, calc.startColumn);\n\n if (mergeParent && mergeParent.col < calc.startColumn) {\n calc.startColumn = mergeParent.col;\n return this.onAfterViewportColumnCalculatorOverride.call(this, calc); // recursively search upwards\n }\n\n mergeParent = this.mergedCellsCollection.get(r, calc.endColumn);\n\n if (mergeParent) {\n let mergeEnd = mergeParent.col + mergeParent.colspan - 1;\n if (mergeEnd > calc.endColumn) {\n calc.endColumn = mergeEnd;\n return this.onAfterViewportColumnCalculatorOverride.call(this, calc); // recursively search upwards\n }\n }\n\n return true;\n });\n }\n\n /**\n * The `modifyAutofillRange` hook callback.\n *\n * @private\n * @param {Array} drag The drag area coordinates.\n * @param {Array} select The selection information.\n * @return {Array} The new drag area.\n */\n onModifyAutofillRange(drag, select) {\n this.autofillCalculations.correctSelectionAreaSize(select);\n const dragDirection = this.autofillCalculations.getDirection(select, drag);\n\n if (this.autofillCalculations.dragAreaOverlapsCollections(select, drag, dragDirection)) {\n drag = select;\n return drag;\n }\n\n const mergedCellsWithinSelectionArea = this.mergedCellsCollection.getWithinRange({\n from: {row: select[0], col: select[1]},\n to: {row: select[2], col: select[3]}\n });\n\n if (!mergedCellsWithinSelectionArea) {\n return drag;\n }\n\n drag = this.autofillCalculations.snapDragArea(select, drag, dragDirection, mergedCellsWithinSelectionArea);\n\n return drag;\n }\n\n /**\n * `afterCreateCol` hook callback.\n *\n * @private\n * @param {Number} column Column index.\n * @param {Number} count Number of created columns.\n */\n onAfterCreateCol(column, count) {\n this.mergedCellsCollection.shiftCollections('right', column, count);\n }\n\n /**\n * `afterRemoveCol` hook callback.\n *\n * @private\n * @param {Number} column Column index.\n * @param {Number} count Number of removed columns.\n */\n onAfterRemoveCol(column, count) {\n this.mergedCellsCollection.shiftCollections('left', column, count);\n }\n\n /**\n * `afterCreateRow` hook callback.\n *\n * @private\n * @param {Number} row Row index.\n * @param {Number} count Number of created rows.\n * @param {String} source Source of change.\n */\n onAfterCreateRow(row, count, source) {\n if (source === 'auto') {\n return;\n }\n\n this.mergedCellsCollection.shiftCollections('down', row, count);\n }\n\n /**\n * `afterRemoveRow` hook callback.\n *\n * @private\n * @param {Number} row Row index.\n * @param {Number} count Number of removed rows.\n */\n onAfterRemoveRow(row, count) {\n this.mergedCellsCollection.shiftCollections('up', row, count);\n }\n\n /**\n * `afterChange` hook callback. Used to propagate merged cells after using Autofill.\n *\n * @private\n * @param {Array} changes The changes array.\n * @param {String} source Determines the source of the change.\n */\n onAfterChange(changes, source) {\n if (source !== 'Autofill.fill') {\n return;\n }\n\n this.autofillCalculations.recreateAfterDataPopulation(changes);\n }\n\n /**\n * `beforeDrawAreaBorders` hook callback.\n *\n * @private\n * @param {Array} corners Coordinates of the area corners.\n * @param {String} className Class name for the area.\n */\n onBeforeDrawAreaBorders(corners, className) {\n if (className && className === 'area') {\n const selectedRange = this.hot.getSelectedRangeLast();\n const mergedCellsWithinRange = this.mergedCellsCollection.getWithinRange(selectedRange);\n\n arrayEach(mergedCellsWithinRange, (mergedCell) => {\n if (selectedRange.getBottomRightCorner().row === mergedCell.getLastRow() && selectedRange.getBottomRightCorner().col === mergedCell.getLastColumn()) {\n corners[2] = mergedCell.row;\n corners[3] = mergedCell.col;\n }\n });\n }\n }\n\n /**\n * `afterModifyTransformStart` hook callback. Fixes a problem with navigating through merged cells at the edges of the table\n * with the ENTER/SHIFT+ENTER/TAB/SHIFT+TAB keys.\n *\n * @private\n * @param {CellCoords} coords Coordinates of the to-be-selected cell.\n * @param {Number} rowTransformDir Row transformation direction (negative value = up, 0 = none, positive value = down)\n * @param {Number} colTransformDir Column transformation direction (negative value = up, 0 = none, positive value = down)\n */\n onAfterModifyTransformStart(coords, rowTransformDir, colTransformDir) {\n if (!this.enabled) {\n return;\n }\n\n const mergedCellAtCoords = this.mergedCellsCollection.get(coords.row, coords.col);\n\n if (!mergedCellAtCoords) {\n return;\n }\n\n const goingDown = rowTransformDir > 0;\n const goingUp = rowTransformDir < 0;\n const goingLeft = colTransformDir < 0;\n const goingRight = colTransformDir > 0;\n const mergedCellOnBottomEdge = mergedCellAtCoords.row + mergedCellAtCoords.rowspan - 1 === this.hot.countRows() - 1;\n const mergedCellOnTopEdge = mergedCellAtCoords.row === 0;\n const mergedCellOnRightEdge = mergedCellAtCoords.col + mergedCellAtCoords.colspan - 1 === this.hot.countCols() - 1;\n const mergedCellOnLeftEdge = mergedCellAtCoords.col === 0;\n\n if (((goingDown && mergedCellOnBottomEdge) || (goingUp && mergedCellOnTopEdge)) ||\n ((goingRight && mergedCellOnRightEdge) || (goingLeft && mergedCellOnLeftEdge))) {\n coords.row = mergedCellAtCoords.row;\n coords.col = mergedCellAtCoords.col;\n }\n }\n\n /**\n * `afterDrawSelection` hook callback. Used to add the additional class name for the entirely-selected merged cells.\n *\n * @private\n * @param {Number} currentRow Row index of the currently processed cell.\n * @param {Number} currentColumn Column index of the currently cell.\n * @param {Array} cornersOfSelection Array of the current selection in a form of `[startRow, startColumn, endRow, endColumn]`.\n * @param {Number|undefined} layerLevel Number indicating which layer of selection is currently processed.\n * @returns {String|undefined} A `String`, which will act as an additional `className` to be added to the currently processed cell.\n */\n onAfterDrawSelection(currentRow, currentColumn, cornersOfSelection, layerLevel) {\n return this.selectionCalculations.getSelectedMergedCellClassName(currentRow, currentColumn, cornersOfSelection, layerLevel);\n }\n\n /**\n * `beforeRemoveCellClassNames` hook callback. Used to remove additional class name from all cells in the table.\n *\n * @private\n * @returns {String[]} An `Array` of `String`s. Each of these strings will act like class names to be removed from all the cells in the table.\n */\n onBeforeRemoveCellClassNames() {\n return this.selectionCalculations.getSelectedMergedCellClassNameToRemove();\n }\n}\n\nregisterPlugin('mergeCells', MergeCells);\n\nexport default MergeCells;\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/mergeCells/mergeCells.js","import MergedCellCoords from './cellCoords';\nimport {CellCoords, CellRange} from '../../3rdparty/walkontable/src/index';\nimport {rangeEach, rangeEachReverse} from '../../helpers/number';\nimport {warn} from '../../helpers/console';\nimport {arrayEach} from '../../helpers/array';\nimport {applySpanProperties} from './utils';\nimport {toSingleLine} from './../../helpers/templateLiteralTag';\n\n/**\n * Defines a container object for the merged cells.\n *\n * @class MergedCellsCollection\n * @plugin MergeCells\n */\nclass MergedCellsCollection {\n constructor(plugin) {\n /**\n * Reference to the Merge Cells plugin.\n *\n * @type {MergeCells}\n */\n this.plugin = plugin;\n /**\n * Array of merged cells.\n *\n * @type {Array}\n */\n this.mergedCells = [];\n /**\n * The Handsontable instance.\n *\n * @type {Handsontable}\n */\n this.hot = plugin.hot;\n }\n\n /**\n * Get a warning message for when the declared merged cell data overlaps already existing merged cells.\n *\n * @param {Object} newMergedCell Object containg information about the merged cells that was about to be added.\n * @return {String}\n */\n static IS_OVERLAPPING_WARNING(newMergedCell) {\n return toSingleLine`The merged cell declared at [${newMergedCell.row}, ${newMergedCell.col}] overlaps with the other declared merged \n cell. The overlapping merged cell was not added to the table, please fix your setup.`;\n }\n\n /**\n * Get a merged cell from the container, based on the provided arguments. You can provide either the \"starting coordinates\"\n * of a merged cell, or any coordinates from the body of the merged cell.\n *\n * @param {Number} row Row index.\n * @param {Number} column Column index.\n * @returns {MergedCellCoords|Boolean} Returns a wanted merged cell on success and `false` on failure.\n */\n get(row, column) {\n const mergedCells = this.mergedCells;\n let result = false;\n\n arrayEach(mergedCells, (mergedCell) => {\n if (mergedCell.row <= row && mergedCell.row + mergedCell.rowspan - 1 >= row &&\n mergedCell.col <= column && mergedCell.col + mergedCell.colspan - 1 >= column) {\n result = mergedCell;\n return false;\n }\n\n return true;\n });\n\n return result;\n }\n\n /**\n * Get a merged cell containing the provided range.\n *\n * @param {CellRange|Object} range The range to search merged cells for.\n * @return {MergedCellCoords|Boolean}\n */\n getByRange(range) {\n const mergedCells = this.mergedCells;\n let result = false;\n\n arrayEach(mergedCells, (mergedCell) => {\n if (mergedCell.row <= range.from.row && mergedCell.row + mergedCell.rowspan - 1 >= range.to.row &&\n mergedCell.col <= range.from.col && mergedCell.col + mergedCell.colspan - 1 >= range.to.col) {\n result = mergedCell;\n return result;\n }\n\n return true;\n });\n\n return result;\n }\n\n /**\n * Get a merged cell contained in the provided range.\n *\n * @param {CellRange|Object} range The range to search merged cells in.\n * @param [countPartials=false] If set to `true`, all the merged cells overlapping the range will be taken into calculation.\n * @return {Array|Boolean} Array of found merged cells of `false` if none were found.\n */\n getWithinRange(range, countPartials = false) {\n const mergedCells = this.mergedCells;\n const foundMergedCells = [];\n\n if (!range.includesRange) {\n let from = new CellCoords(range.from.row, range.from.col);\n let to = new CellCoords(range.to.row, range.to.col);\n range = new CellRange(from, from, to);\n }\n\n arrayEach(mergedCells, (mergedCell) => {\n let mergedCellTopLeft = new CellCoords(mergedCell.row, mergedCell.col);\n let mergedCellBottomRight = new CellCoords(mergedCell.row + mergedCell.rowspan - 1, mergedCell.col + mergedCell.colspan - 1);\n let mergedCellRange = new CellRange(mergedCellTopLeft, mergedCellTopLeft, mergedCellBottomRight);\n\n if (countPartials) {\n if (range.overlaps(mergedCellRange)) {\n foundMergedCells.push(mergedCell);\n }\n\n } else if (range.includesRange(mergedCellRange)) {\n foundMergedCells.push(mergedCell);\n }\n });\n\n return foundMergedCells.length ? foundMergedCells : false;\n }\n\n /**\n * Add a merged cell to the container.\n *\n * @param {Object} mergedCellInfo The merged cell information object. Has to contain `row`, `col`, `colspan` and `rowspan` properties.\n * @return {MergedCellCoords|Boolean} Returns the new merged cell on success and `false` on failure.\n */\n add(mergedCellInfo) {\n const mergedCells = this.mergedCells;\n const row = mergedCellInfo.row;\n const column = mergedCellInfo.col;\n const rowspan = mergedCellInfo.rowspan;\n const colspan = mergedCellInfo.colspan;\n const newMergedCell = new MergedCellCoords(row, column, rowspan, colspan);\n const alreadyExists = this.get(row, column);\n const isOverlapping = this.isOverlapping(newMergedCell);\n\n if (!alreadyExists && !isOverlapping) {\n if (this.hot) {\n newMergedCell.normalize(this.hot);\n }\n\n mergedCells.push(newMergedCell);\n\n return newMergedCell;\n }\n\n warn(MergedCellsCollection.IS_OVERLAPPING_WARNING(newMergedCell));\n\n return false;\n }\n\n /**\n * Remove a merged cell from the container. You can provide either the \"starting coordinates\"\n * of a merged cell, or any coordinates from the body of the merged cell.\n *\n * @param {Number} row Row index.\n * @param {Number} column Column index.\n * @return {MergedCellCoords|Boolean} Returns the removed merged cell on success and `false` on failure.\n */\n remove(row, column) {\n const mergedCells = this.mergedCells;\n const wantedCollection = this.get(row, column);\n const wantedCollectionIndex = wantedCollection ? this.mergedCells.indexOf(wantedCollection) : null;\n\n if (wantedCollection && wantedCollectionIndex !== false) {\n mergedCells.splice(wantedCollectionIndex, 1);\n return wantedCollection;\n }\n\n return false;\n }\n\n /**\n * Clear all the merged cells.\n */\n clear() {\n const mergedCells = this.mergedCells;\n const mergedCellParentsToClear = [];\n const hiddenCollectionElements = [];\n\n arrayEach(mergedCells, (mergedCell) => {\n mergedCellParentsToClear.push([this.hot.getCell(mergedCell.row, mergedCell.col), this.get(mergedCell.row, mergedCell.col), mergedCell.row, mergedCell.col]);\n });\n\n this.mergedCells.length = 0;\n\n arrayEach(mergedCellParentsToClear, (mergedCell, i) => {\n rangeEach(0, mergedCell.rowspan - 1, (j) => {\n rangeEach(0, mergedCell.colspan - 1, (k) => {\n if (k !== 0 || j !== 0) {\n hiddenCollectionElements.push([this.hot.getCell(mergedCell.row + j, mergedCell.col + k), null, null, null]);\n }\n });\n });\n\n mergedCellParentsToClear[i][1] = null;\n });\n\n arrayEach(mergedCellParentsToClear, (mergedCellParents) => {\n applySpanProperties(...mergedCellParents);\n });\n\n arrayEach(hiddenCollectionElements, (hiddenCollectionElement) => {\n applySpanProperties(...hiddenCollectionElement);\n });\n }\n\n /**\n * Check if the provided merged cell overlaps with the others in the container.\n *\n * @param {MergedCellCoords} mergedCell The merged cell to check against all others in the container.\n * @return {Boolean} `true` if the provided merged cell overlaps with the others, `false` otherwise.\n */\n isOverlapping(mergedCell) {\n const mergedCellRange = new CellRange(null, new CellCoords(mergedCell.row, mergedCell.col),\n new CellCoords(mergedCell.row + mergedCell.rowspan - 1, mergedCell.col + mergedCell.colspan - 1));\n let result = false;\n\n arrayEach(this.mergedCells, (col) => {\n let currentRange = new CellRange(null, new CellCoords(col.row, col.col), new CellCoords(col.row + col.rowspan - 1, col.col + col.colspan - 1));\n\n if (currentRange.overlaps(mergedCellRange)) {\n result = true;\n return false;\n }\n\n return true;\n });\n\n return result;\n }\n\n /**\n * Check whether the provided row/col coordinates direct to a merged parent.\n *\n * @param {Number} row Row index.\n * @param {Number} column Column index.\n * @return {Boolean}\n */\n isMergedParent(row, column) {\n const mergedCells = this.mergedCells;\n let result = false;\n\n arrayEach(mergedCells, (mergedCell) => {\n if (mergedCell.row === row && mergedCell.col === column) {\n result = true;\n return false;\n }\n\n return true;\n });\n\n return result;\n }\n\n /**\n * Shift the merged cell in the direction and by an offset defined in the arguments.\n *\n * @param {String} direction `right`, `left`, `up` or `down`.\n * @param {Number} index Index where the change, which caused the shifting took place.\n * @param {Number} count Number of rows/columns added/removed in the preceding action.\n */\n shiftCollections(direction, index, count) {\n const shiftVector = [0, 0];\n\n switch (direction) {\n case 'right':\n shiftVector[0] += count;\n break;\n\n case 'left':\n shiftVector[0] -= count;\n break;\n\n case 'down':\n shiftVector[1] += count;\n break;\n\n case 'up':\n shiftVector[1] -= count;\n break;\n\n default:\n }\n\n arrayEach(this.mergedCells, (currentMerge) => {\n currentMerge.shift(shiftVector, index);\n });\n\n rangeEachReverse(this.mergedCells.length - 1, 0, (i) => {\n let currentMerge = this.mergedCells[i];\n\n if (currentMerge && currentMerge.removed) {\n this.mergedCells.splice(this.mergedCells.indexOf(currentMerge), 1);\n }\n });\n }\n}\n\nexport default MergedCellsCollection;\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/mergeCells/cellsCollection.js","import {extend} from '../../../helpers/object';\nimport {CellCoords, CellRange} from './../../../3rdparty/walkontable/src';\nimport {arrayEach} from './../../../helpers/array';\n\n/**\n * Class responsible for all of the Autofill-related operations on merged cells.\n *\n * @class AutofillCalculations\n * @plugin MergeCells\n * @util\n */\nclass AutofillCalculations {\n constructor(plugin) {\n /**\n * Reference to the Merge Cells plugin.\n *\n * @type {MergeCells}\n */\n this.plugin = plugin;\n /**\n * Reference to the MergedCellsCollection class instance.\n *\n * @type {MergedCellsCollection}\n */\n this.mergedCellsCollection = this.plugin.mergedCellsCollection;\n /**\n * Cache of the currently processed autofill data.\n *\n * @private\n * @type {Object}\n */\n this.currentFillData = null;\n }\n\n /**\n * Correct the provided selection area, so it's not selecting only a part of a merged cell.\n *\n * @param {Array} selectionArea\n */\n correctSelectionAreaSize(selectionArea) {\n if (selectionArea[0] === selectionArea[2] && selectionArea[1] === selectionArea[3]) {\n let mergedCell = this.mergedCellsCollection.get(selectionArea[0], selectionArea[1]);\n\n if (mergedCell) {\n selectionArea[2] = selectionArea[0] + mergedCell.rowspan - 1;\n selectionArea[3] = selectionArea[1] + mergedCell.colspan - 1;\n }\n }\n }\n\n /**\n * Get the direction of the autofill process.\n *\n * @param {Array} selectionArea The selection area.\n * @param {Array} finalArea The final area (base + drag).\n * @return {String} `up`, `down`, `left` or `right`.\n */\n getDirection(selectionArea, finalArea) {\n let direction = null;\n\n if (finalArea[0] === selectionArea[0] && finalArea[1] === selectionArea[1] && finalArea[3] === selectionArea[3]) {\n direction = 'down';\n\n } else if (finalArea[2] === selectionArea[2] && finalArea[1] === selectionArea[1] && finalArea[3] === selectionArea[3]) {\n direction = 'up';\n\n } else if (finalArea[1] === selectionArea[1] && finalArea[2] === selectionArea[2]) {\n direction = 'right';\n\n } else {\n direction = 'left';\n }\n\n return direction;\n }\n\n /**\n * Snap the drag area to the farthest merged cell, so it won't clip any of the merged cells.\n *\n * @param {Array} baseArea The base selected area.\n * @param {Array} dragArea The drag area.\n * @param {String} dragDirection The autofill drag direction.\n * @param {Array} foundMergedCells MergeCellCoords found in the base selection area.\n * @return {Array} The new drag area\n */\n snapDragArea(baseArea, dragArea, dragDirection, foundMergedCells) {\n let newDragArea = dragArea.slice(0);\n let fillSize = this.getAutofillSize(baseArea, dragArea, dragDirection);\n const [baseAreaStartRow, baseAreaStartColumn, baseAreaEndRow, baseAreaEndColumn] = baseArea;\n const verticalDirection = ['up', 'down'].indexOf(dragDirection) > -1;\n const fullCycle = verticalDirection ? baseAreaEndRow - baseAreaStartRow + 1 : baseAreaEndColumn - baseAreaStartColumn + 1;\n const fulls = Math.floor(fillSize / fullCycle) * fullCycle;\n const partials = fillSize - fulls;\n let farthestCollection = this.getFarthestCollection(baseArea, dragArea, dragDirection, foundMergedCells);\n\n if (farthestCollection) {\n if (dragDirection === 'down') {\n let fill = farthestCollection.row + farthestCollection.rowspan - baseAreaStartRow - partials;\n let newLimit = newDragArea[2] + fill;\n\n if (newLimit >= this.plugin.hot.countRows()) {\n newDragArea[2] -= partials;\n\n } else {\n newDragArea[2] += partials ? fill : 0;\n }\n\n } else if (dragDirection === 'right') {\n let fill = farthestCollection.col + farthestCollection.colspan - baseAreaStartColumn - partials;\n let newLimit = newDragArea[3] + fill;\n\n if (newLimit >= this.plugin.hot.countCols()) {\n newDragArea[3] -= partials;\n\n } else {\n newDragArea[3] += partials ? fill : 0;\n }\n\n } else if (dragDirection === 'up') {\n let fill = baseAreaEndRow - partials - farthestCollection.row + 1;\n let newLimit = newDragArea[0] + fill;\n\n if (newLimit < 0) {\n newDragArea[0] += partials;\n\n } else {\n newDragArea[0] -= partials ? fill : 0;\n }\n\n } else if (dragDirection === 'left') {\n let fill = baseAreaEndColumn - partials - farthestCollection.col + 1;\n let newLimit = newDragArea[1] + fill;\n\n if (newLimit < 0) {\n newDragArea[1] += partials;\n\n } else {\n newDragArea[1] -= partials ? fill : 0;\n }\n }\n }\n\n this.updateCurrentFillCache({\n baseArea,\n dragDirection,\n foundMergedCells,\n fillSize,\n dragArea: newDragArea,\n cycleLength: fullCycle,\n });\n\n return newDragArea;\n }\n\n /**\n * Update the current fill cache with the provided object.\n *\n * @private\n * @param {Object} updateObject\n */\n updateCurrentFillCache(updateObject) {\n if (!this.currentFillData) {\n this.currentFillData = {};\n }\n\n extend(this.currentFillData, updateObject);\n }\n\n /**\n * Get the \"length\" of the drag area.\n *\n * @private\n * @param {Array} baseArea The base selection area.\n * @param {Array} dragArea The drag area (containing the base area).\n * @param {String} direction The drag direction.\n * @return {Number|null} The \"length\" (height or width, depending on the direction) of the drag.\n */\n getAutofillSize(baseArea, dragArea, direction) {\n const [baseAreaStartRow, baseAreaStartColumn, baseAreaEndRow, baseAreaEndColumn] = baseArea;\n const [dragAreaStartRow, dragAreaStartColumn, dragAreaEndRow, dragAreaEndColumn] = dragArea;\n\n switch (direction) {\n case 'up':\n return baseAreaStartRow - dragAreaStartRow;\n case 'down':\n return dragAreaEndRow - baseAreaEndRow;\n case 'left':\n return baseAreaStartColumn - dragAreaStartColumn;\n case 'right':\n return dragAreaEndColumn - baseAreaEndColumn;\n default:\n return null;\n }\n }\n\n /**\n * Trim the default drag area (containing the selection area) to the drag-only area.\n *\n * @private\n * @param {Array} baseArea The base selection area.\n * @param {Array} dragArea The base selection area extended by the drag area.\n * @param {String} direction Drag direction.\n * @return {Array|null} Array representing the drag area coordinates.\n */\n getDragArea(baseArea, dragArea, direction) {\n const [baseAreaStartRow, baseAreaStartColumn, baseAreaEndRow, baseAreaEndColumn] = baseArea;\n const [dragAreaStartRow, dragAreaStartColumn, dragAreaEndRow, dragAreaEndColumn] = dragArea;\n\n switch (direction) {\n case 'up':\n return [dragAreaStartRow, dragAreaStartColumn, baseAreaStartRow - 1, baseAreaEndColumn];\n case 'down':\n return [baseAreaEndRow + 1, baseAreaStartColumn, dragAreaEndRow, baseAreaEndColumn];\n case 'left':\n return [dragAreaStartRow, dragAreaStartColumn, baseAreaEndRow, baseAreaStartColumn - 1];\n case 'right':\n return [baseAreaStartRow, baseAreaEndColumn + 1, dragAreaEndRow, dragAreaEndColumn];\n default:\n return null;\n }\n }\n\n /**\n * Get the to-be-farthest merged cell in the newly filled area.\n *\n * @private\n * @param {Array} baseArea The base selection area.\n * @param {Array} dragArea The drag area (containing the base area).\n * @param {String} direction The drag direction.\n * @param {Array} mergedCellArray Array of the merged cells found in the base area.\n * @return {MergedCellCoords|null}\n */\n getFarthestCollection(baseArea, dragArea, direction, mergedCellArray) {\n const [baseAreaStartRow, baseAreaStartColumn, baseAreaEndRow, baseAreaEndColumn] = baseArea;\n const verticalDirection = ['up', 'down'].indexOf(direction) > -1;\n const baseEnd = verticalDirection ? baseAreaEndRow : baseAreaEndColumn;\n const baseStart = verticalDirection ? baseAreaStartRow : baseAreaStartColumn;\n const fillSize = this.getAutofillSize(baseArea, dragArea, direction);\n const fullCycle = verticalDirection ? baseAreaEndRow - baseAreaStartRow + 1 : baseAreaEndColumn - baseAreaStartColumn + 1;\n const fulls = Math.floor(fillSize / fullCycle) * fullCycle;\n const partials = fillSize - fulls;\n let inclusionFunctionName = null;\n let farthestCollection = null;\n let endOfDragRecreationIndex = null;\n\n switch (direction) {\n case 'up':\n inclusionFunctionName = 'includesVertically';\n endOfDragRecreationIndex = baseEnd - partials + 1;\n break;\n\n case 'left':\n inclusionFunctionName = 'includesHorizontally';\n endOfDragRecreationIndex = baseEnd - partials + 1;\n break;\n\n case 'down':\n inclusionFunctionName = 'includesVertically';\n endOfDragRecreationIndex = baseStart + partials - 1;\n break;\n\n case 'right':\n inclusionFunctionName = 'includesHorizontally';\n endOfDragRecreationIndex = baseStart + partials - 1;\n break;\n\n default:\n }\n\n arrayEach(mergedCellArray, (currentCollection) => {\n if (currentCollection[inclusionFunctionName](endOfDragRecreationIndex) &&\n currentCollection.isFarther(farthestCollection, direction)) {\n farthestCollection = currentCollection;\n }\n });\n\n return farthestCollection;\n }\n\n /**\n * Recreate the merged cells after the autofill process.\n *\n * @param {Array} changes Changes made.\n */\n recreateAfterDataPopulation(changes) {\n if (!this.currentFillData) {\n return;\n }\n\n const fillRange = this.getRangeFromChanges(changes);\n const foundMergedCells = this.currentFillData.foundMergedCells;\n const dragDirection = this.currentFillData.dragDirection;\n const inBounds = (current, offset) => {\n switch (dragDirection) {\n case 'up':\n return current.row - offset >= fillRange.from.row;\n case 'down':\n return current.row + current.rowspan - 1 + offset <= fillRange.to.row;\n case 'left':\n return current.col - offset >= fillRange.from.column;\n case 'right':\n return current.col + current.colspan - 1 + offset <= fillRange.to.column;\n default:\n return null;\n }\n };\n let fillOffset = 0;\n let current = null;\n let multiplier = 1;\n\n do {\n for (let j = 0; j < foundMergedCells.length; j += 1) {\n current = foundMergedCells[j];\n\n fillOffset = multiplier * this.currentFillData.cycleLength;\n\n if (inBounds(current, fillOffset)) {\n switch (dragDirection) {\n case 'up':\n this.plugin.mergedCellsCollection.add({\n row: current.row - fillOffset,\n rowspan: current.rowspan,\n col: current.col,\n colspan: current.colspan\n });\n break;\n\n case 'down':\n this.plugin.mergedCellsCollection.add({\n row: current.row + fillOffset,\n rowspan: current.rowspan,\n col: current.col,\n colspan: current.colspan\n });\n break;\n\n case 'left':\n this.plugin.mergedCellsCollection.add({\n row: current.row,\n rowspan: current.rowspan,\n col: current.col - fillOffset,\n colspan: current.colspan\n });\n break;\n\n case 'right':\n this.plugin.mergedCellsCollection.add({\n row: current.row,\n rowspan: current.rowspan,\n col: current.col + fillOffset,\n colspan: current.colspan\n });\n break;\n\n default:\n }\n }\n\n if (j === foundMergedCells.length - 1) {\n multiplier += 1;\n }\n }\n\n } while (inBounds(current, fillOffset));\n\n this.currentFillData = null;\n this.plugin.hot.render();\n }\n\n /**\n * Get the drag range from the changes made.\n *\n * @private\n * @param {Array} changes The changes made.\n * @returns {Object} Object with `from` and `to` properties, both containing `row` and `column` keys.\n */\n getRangeFromChanges(changes) {\n const rows = {min: null, max: null};\n const columns = {min: null, max: null};\n\n arrayEach(changes, (change) => {\n if (rows.min === null || change[0] < rows.min) {\n rows.min = change[0];\n }\n\n if (rows.max === null || change[0] > rows.max) {\n rows.max = change[0];\n }\n\n if (columns.min === null || change[1] < columns.min) {\n columns.min = change[1];\n }\n\n if (columns.max === null || change[1] > columns.max) {\n columns.max = change[1];\n }\n });\n\n return {\n from: {\n row: rows.min,\n column: columns.min\n },\n to: {\n row: rows.max,\n column: columns.max\n }\n };\n }\n\n /**\n * Check if the drag area contains any merged cells.\n *\n * @param {Array} baseArea The base selection area.\n * @param {Array} fullArea The base area extended by the drag area.\n * @param {String} direction Drag direction.\n * @returns {Boolean}\n */\n dragAreaOverlapsCollections(baseArea, fullArea, direction) {\n const dragArea = this.getDragArea(baseArea, fullArea, direction);\n const [dragAreaStartRow, dragAreaStartColumn, dragAreaEndRow, dragAreaEndColumn] = dragArea;\n let topLeft = new CellCoords(dragAreaStartRow, dragAreaStartColumn);\n let bottomRight = new CellCoords(dragAreaEndRow, dragAreaEndColumn);\n let dragRange = new CellRange(topLeft, topLeft, bottomRight);\n\n return !!this.mergedCellsCollection.getWithinRange(dragRange, true);\n }\n}\n\nexport default AutofillCalculations;\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/mergeCells/calculations/autofill.js","import {CellCoords, CellRange} from './../../../3rdparty/walkontable/src';\n\n/**\n * Class responsible for all of the Selection-related operations on merged cells.\n *\n * @class SelectionCalculations\n * @plugin MergeCells\n * @util\n */\nclass SelectionCalculations {\n constructor(plugin) {\n /**\n * Reference to the Merge Cells plugin.\n *\n * @type {MergeCells}\n */\n this.plugin = plugin;\n /**\n * Class name used for fully selected merged cells.\n *\n * @type {String}\n */\n this.fullySelectedMergedCellClassName = 'fullySelectedMergedCell';\n\n }\n\n /**\n * \"Snap\" the delta value according to defined merged cells. (In other words, compensate the rowspan -\n * e.g. going up with `delta.row = -1` over a merged cell with `rowspan = 3`, `delta.row` should change to `-3`.)\n *\n * @param {Object} delta The delta object containing `row` and `col` properties.\n * @param {CellRange} selectionRange The selection range.\n * @param {Object} mergedCell A merged cell object.\n */\n snapDelta(delta, selectionRange, mergedCell) {\n const cellCoords = selectionRange.to;\n const newRow = cellCoords.row + delta.row;\n const newColumn = cellCoords.col + delta.col;\n\n if (delta.row) {\n this.jumpOverMergedCell(delta, mergedCell, newRow);\n\n } else if (delta.col) {\n this.jumpOverMergedCell(delta, mergedCell, newColumn);\n }\n }\n\n /**\n * \"Jump\" over the merged cell (compensate for the indexes within the merged cell to get past it)\n *\n * @private\n * @param {Object} delta The delta object.\n * @param {MergedCellCoords} mergedCell The merge cell object.\n * @param {Number} newIndex New row/column index, created with the delta.\n */\n jumpOverMergedCell(delta, mergedCell, newIndex) {\n let flatDelta = delta.row || delta.col;\n let includesIndex = null;\n let firstIndex = null;\n let lastIndex = null;\n\n if (delta.row) {\n includesIndex = mergedCell.includesVertically(newIndex);\n firstIndex = mergedCell.row;\n lastIndex = mergedCell.getLastRow();\n\n } else if (delta.col) {\n includesIndex = mergedCell.includesHorizontally(newIndex);\n firstIndex = mergedCell.col;\n lastIndex = mergedCell.getLastColumn();\n }\n\n if (flatDelta === 0) {\n return;\n\n } else if (flatDelta > 0) {\n if (includesIndex && newIndex !== firstIndex) {\n flatDelta += (lastIndex - newIndex + 1);\n }\n\n } else if (includesIndex && newIndex !== lastIndex) {\n flatDelta -= (newIndex - firstIndex + 1);\n }\n\n if (delta.row) {\n delta.row = flatDelta;\n } else if (delta.col) {\n delta.col = flatDelta;\n }\n }\n\n /**\n * Get a selection range with `to` property incremented by the provided delta.\n *\n * @param {CellRange} oldSelectionRange The base selection range.\n * @param {Object} delta The delta object with `row` and `col` properties.\n * @returns {CellRange} A new `CellRange` object.\n */\n getUpdatedSelectionRange(oldSelectionRange, delta) {\n return new CellRange(oldSelectionRange.highlight, oldSelectionRange.from, new CellCoords(oldSelectionRange.to.row + delta.row, oldSelectionRange.to.col + delta.col));\n }\n\n /**\n * Generate an additional class name for the entirely-selected merged cells.\n *\n * @param {Number} currentRow Row index of the currently processed cell.\n * @param {Number} currentColumn Column index of the currently cell.\n * @param {Array} cornersOfSelection Array of the current selection in a form of `[startRow, startColumn, endRow, endColumn]`.\n * @param {Number|undefined} layerLevel Number indicating which layer of selection is currently processed.\n * @returns {String|undefined} A `String`, which will act as an additional `className` to be added to the currently processed cell.\n */\n getSelectedMergedCellClassName(currentRow, currentColumn, cornersOfSelection, layerLevel) {\n const [startRow, startColumn, endRow, endColumn] = cornersOfSelection;\n\n if (layerLevel === void 0) {\n return;\n }\n\n if (currentRow >= startRow &&\n currentRow <= endRow &&\n currentColumn >= startColumn &&\n currentColumn <= endColumn) {\n\n let isMergedCellParent = this.plugin.mergedCellsCollection.isMergedParent(currentRow, currentColumn);\n\n if (!isMergedCellParent) {\n return;\n }\n\n let mergedCell = this.plugin.mergedCellsCollection.get(currentRow, currentColumn);\n\n if (!mergedCell) {\n return;\n }\n\n if (mergedCell.row + mergedCell.rowspan - 1 <= endRow && mergedCell.col + mergedCell.colspan - 1 <= endColumn) {\n return `${this.fullySelectedMergedCellClassName}-${layerLevel}`;\n\n } else if (this.plugin.selectionCalculations.isMergeCellFullySelected(mergedCell, this.plugin.hot.getSelectedRange())) {\n return `${this.fullySelectedMergedCellClassName}-multiple`;\n }\n }\n }\n\n /**\n * Check if the provided merged cell is fully selected (by one or many layers of selection)\n *\n * @param {MergedCellCoords} mergedCell The merged cell to be processed.\n * @param {CellRange[]} selectionRangesArray Array of selection ranges.\n * @returns {Boolean}\n */\n isMergeCellFullySelected(mergedCell, selectionRangesArray) {\n const mergedCellIndividualCoords = [];\n\n if (!selectionRangesArray || !mergedCell) {\n return false;\n }\n\n for (let r = 0; r < mergedCell.rowspan; r += 1) {\n for (let c = 0; c < mergedCell.colspan; c += 1) {\n mergedCellIndividualCoords.push(new CellCoords(mergedCell.row + r, mergedCell.col + c));\n }\n }\n\n for (let i = 0; i < mergedCellIndividualCoords.length; i += 1) {\n let insideSelections = [];\n\n for (let s = 0; s < selectionRangesArray.length; s += 1) {\n insideSelections[s] = selectionRangesArray[s].includes(mergedCellIndividualCoords[i]);\n }\n\n if (!insideSelections.includes(true)) {\n return false;\n }\n }\n\n return true;\n }\n\n /**\n * Generate an array of the entirely-selected merged cells' class names.\n *\n * @returns {String[]} An `Array` of `String`s. Each of these strings will act like class names to be removed from all the cells in the table.\n */\n getSelectedMergedCellClassNameToRemove() {\n const classNames = [];\n\n for (let i = 0; i <= 7; i += 1) {\n classNames.push(`${this.fullySelectedMergedCellClassName}-${i}`);\n }\n\n classNames.push(`${this.fullySelectedMergedCellClassName}-multiple`);\n\n return classNames;\n }\n}\n\nexport default SelectionCalculations;\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/mergeCells/calculations/selection.js","import * as C from '../../../i18n/constants';\nimport MergedCellCoords from '../cellCoords';\n\nexport default function toggleMergeItem(plugin) {\n return {\n key: 'mergeCells',\n name() {\n const sel = this.getSelectedLast();\n\n if (sel) {\n const info = plugin.mergedCellsCollection.get(sel[0], sel[1]);\n\n if (info.row === sel[0] && info.col === sel[1] && info.row + info.rowspan - 1 === sel[2] && info.col + info.colspan - 1 === sel[3]) {\n return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_UNMERGE_CELLS);\n }\n }\n\n return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_MERGE_CELLS);\n },\n callback() {\n plugin.toggleMergeOnSelection();\n },\n disabled() {\n const sel = this.getSelectedLast();\n\n if (!sel) {\n return true;\n }\n\n const isSingleCell = MergedCellCoords.isSingleCell({\n row: sel[0],\n col: sel[1],\n rowspan: sel[2] - sel[0] + 1,\n colspan: sel[3] - sel[1] + 1\n });\n\n return isSingleCell || this.selection.isSelectedByCorner();\n },\n hidden: false\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/mergeCells/contextMenuItem/toggleMerge.js","// removed by extract-text-webpack-plugin\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/plugins/mergeCells/mergeCells.css\n// module id = 349\n// module chunks = 0","import Hooks from './../../pluginHooks';\nimport {getWindowScrollTop, hasClass, getWindowScrollLeft} from './../../helpers/dom/element';\nimport {isMobileBrowser} from './../../helpers/browser';\nimport BasePlugin from './../_base';\nimport EventManager from './../../eventManager';\nimport {registerPlugin} from './../../plugins';\nimport {CellCoords} from './../../3rdparty/walkontable/src';\n\n/**\n * @private\n * @plugin MultipleSelectionHandles\n */\nclass MultipleSelectionHandles extends BasePlugin {\n /**\n * @param {Object} hotInstance\n */\n constructor(hotInstance) {\n super(hotInstance);\n /**\n * @type {Array}\n */\n this.dragged = [];\n /**\n * Instance of EventManager.\n *\n * @type {EventManager}\n */\n this.eventManager = null;\n /**\n * @type {null}\n */\n this.lastSetCell = null;\n }\n\n /**\n * Check if the plugin is enabled in the handsontable settings.\n *\n * @returns {Boolean}\n */\n isEnabled() {\n return isMobileBrowser();\n }\n\n /**\n * Enable plugin for this Handsontable instance.\n */\n enablePlugin() {\n if (this.enabled) {\n return;\n }\n if (!this.eventManager) {\n this.eventManager = new EventManager(this);\n }\n this.registerListeners();\n super.enablePlugin();\n }\n\n /**\n * Bind the touch events\n * @private\n */\n registerListeners() {\n var _this = this;\n\n function removeFromDragged(query) {\n\n if (_this.dragged.length === 1) {\n // clear array\n _this.dragged.splice(0, _this.dragged.length);\n\n return true;\n }\n\n var entryPosition = _this.dragged.indexOf(query);\n\n if (entryPosition == -1) {\n return false;\n } else if (entryPosition === 0) {\n _this.dragged = _this.dragged.slice(0, 1);\n } else if (entryPosition == 1) {\n _this.dragged = _this.dragged.slice(-1);\n }\n }\n\n this.eventManager.addEventListener(this.hot.rootElement, 'touchstart', (event) => {\n let selectedRange;\n\n if (hasClass(event.target, 'topLeftSelectionHandle-HitArea')) {\n selectedRange = _this.hot.getSelectedRangeLast();\n\n _this.dragged.push('topLeft');\n\n _this.touchStartRange = {\n width: selectedRange.getWidth(),\n height: selectedRange.getHeight(),\n direction: selectedRange.getDirection()\n };\n\n event.preventDefault();\n return false;\n\n } else if (hasClass(event.target, 'bottomRightSelectionHandle-HitArea')) {\n selectedRange = _this.hot.getSelectedRangeLast();\n\n _this.dragged.push('bottomRight');\n\n _this.touchStartRange = {\n width: selectedRange.getWidth(),\n height: selectedRange.getHeight(),\n direction: selectedRange.getDirection()\n };\n\n event.preventDefault();\n return false;\n }\n });\n\n this.eventManager.addEventListener(this.hot.rootElement, 'touchend', (event) => {\n if (hasClass(event.target, 'topLeftSelectionHandle-HitArea')) {\n removeFromDragged.call(_this, 'topLeft');\n\n _this.touchStartRange = void 0;\n\n event.preventDefault();\n return false;\n\n } else if (hasClass(event.target, 'bottomRightSelectionHandle-HitArea')) {\n removeFromDragged.call(_this, 'bottomRight');\n\n _this.touchStartRange = void 0;\n\n event.preventDefault();\n return false;\n }\n });\n\n this.eventManager.addEventListener(this.hot.rootElement, 'touchmove', (event) => {\n let scrollTop = getWindowScrollTop(),\n scrollLeft = getWindowScrollLeft(),\n endTarget,\n targetCoords,\n selectedRange,\n rangeWidth,\n rangeHeight,\n rangeDirection,\n newRangeCoords;\n\n if (_this.dragged.length === 0) {\n return;\n }\n\n endTarget = document.elementFromPoint(\n event.touches[0].screenX - scrollLeft,\n event.touches[0].screenY - scrollTop);\n\n if (!endTarget || endTarget === _this.lastSetCell) {\n return;\n }\n\n if (endTarget.nodeName == 'TD' || endTarget.nodeName == 'TH') {\n targetCoords = _this.hot.getCoords(endTarget);\n\n if (targetCoords.col == -1) {\n targetCoords.col = 0;\n }\n\n selectedRange = _this.hot.getSelectedRangeLast();\n rangeWidth = selectedRange.getWidth();\n rangeHeight = selectedRange.getHeight();\n rangeDirection = selectedRange.getDirection();\n\n if (rangeWidth == 1 && rangeHeight == 1) {\n _this.hot.selection.setRangeEnd(targetCoords);\n }\n\n newRangeCoords = _this.getCurrentRangeCoords(selectedRange, targetCoords, _this.touchStartRange.direction, rangeDirection, _this.dragged[0]);\n\n if (newRangeCoords.start !== null) {\n _this.hot.selection.setRangeStart(newRangeCoords.start);\n }\n\n _this.hot.selection.setRangeEnd(newRangeCoords.end);\n\n _this.lastSetCell = endTarget;\n\n }\n\n event.preventDefault();\n });\n }\n\n getCurrentRangeCoords(selectedRange, currentTouch, touchStartDirection, currentDirection, draggedHandle) {\n var topLeftCorner = selectedRange.getTopLeftCorner(),\n bottomRightCorner = selectedRange.getBottomRightCorner(),\n bottomLeftCorner = selectedRange.getBottomLeftCorner(),\n topRightCorner = selectedRange.getTopRightCorner();\n\n var newCoords = {\n start: null,\n end: null\n };\n\n switch (touchStartDirection) {\n case 'NE-SW':\n switch (currentDirection) {\n case 'NE-SW':\n case 'NW-SE':\n if (draggedHandle == 'topLeft') {\n newCoords = {\n start: new CellCoords(currentTouch.row, selectedRange.highlight.col),\n end: new CellCoords(bottomLeftCorner.row, currentTouch.col)\n };\n } else {\n newCoords = {\n start: new CellCoords(selectedRange.highlight.row, currentTouch.col),\n end: new CellCoords(currentTouch.row, topLeftCorner.col)\n };\n }\n break;\n case 'SE-NW':\n if (draggedHandle == 'bottomRight') {\n newCoords = {\n start: new CellCoords(bottomRightCorner.row, currentTouch.col),\n end: new CellCoords(currentTouch.row, topLeftCorner.col)\n };\n }\n break;\n default:\n break;\n }\n break;\n case 'NW-SE':\n switch (currentDirection) {\n case 'NE-SW':\n if (draggedHandle == 'topLeft') {\n newCoords = {\n start: currentTouch,\n end: bottomLeftCorner\n };\n } else {\n newCoords.end = currentTouch;\n }\n break;\n case 'NW-SE':\n if (draggedHandle == 'topLeft') {\n newCoords = {\n start: currentTouch,\n end: bottomRightCorner\n };\n } else {\n newCoords.end = currentTouch;\n }\n break;\n case 'SE-NW':\n if (draggedHandle == 'topLeft') {\n newCoords = {\n start: currentTouch,\n end: topLeftCorner\n };\n } else {\n newCoords.end = currentTouch;\n }\n break;\n case 'SW-NE':\n if (draggedHandle == 'topLeft') {\n newCoords = {\n start: currentTouch,\n end: topRightCorner\n };\n } else {\n newCoords.end = currentTouch;\n }\n break;\n default:\n break;\n }\n break;\n case 'SW-NE':\n switch (currentDirection) {\n case 'NW-SE':\n if (draggedHandle == 'bottomRight') {\n newCoords = {\n start: new CellCoords(currentTouch.row, topLeftCorner.col),\n end: new CellCoords(bottomLeftCorner.row, currentTouch.col)\n };\n } else {\n newCoords = {\n start: new CellCoords(topLeftCorner.row, currentTouch.col),\n end: new CellCoords(currentTouch.row, bottomRightCorner.col)\n };\n }\n break;\n // case 'NE-SW':\n //\n // break;\n case 'SW-NE':\n if (draggedHandle == 'topLeft') {\n newCoords = {\n start: new CellCoords(selectedRange.highlight.row, currentTouch.col),\n end: new CellCoords(currentTouch.row, bottomRightCorner.col)\n };\n } else {\n newCoords = {\n start: new CellCoords(currentTouch.row, topLeftCorner.col),\n end: new CellCoords(topLeftCorner.row, currentTouch.col)\n };\n }\n break;\n case 'SE-NW':\n if (draggedHandle == 'bottomRight') {\n newCoords = {\n start: new CellCoords(currentTouch.row, topRightCorner.col),\n end: new CellCoords(topLeftCorner.row, currentTouch.col)\n };\n } else if (draggedHandle == 'topLeft') {\n newCoords = {\n start: bottomLeftCorner,\n end: currentTouch\n };\n }\n break;\n default:\n break;\n }\n break;\n case 'SE-NW':\n switch (currentDirection) {\n case 'NW-SE':\n case 'NE-SW':\n case 'SW-NE':\n if (draggedHandle == 'topLeft') {\n newCoords.end = currentTouch;\n }\n break;\n case 'SE-NW':\n if (draggedHandle == 'topLeft') {\n newCoords.end = currentTouch;\n } else {\n newCoords = {\n start: currentTouch,\n end: topLeftCorner\n };\n }\n break;\n default:\n break;\n }\n break;\n default:\n break;\n }\n\n return newCoords;\n }\n\n /**\n * Check if user is currently dragging the handle.\n *\n * @returns {boolean} Dragging state\n */\n isDragged() {\n return this.dragged.length > 0;\n }\n}\n\nregisterPlugin('multipleSelectionHandles', MultipleSelectionHandles);\n\nexport default MultipleSelectionHandles;\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/multipleSelectionHandles/multipleSelectionHandles.js","import BasePlugin from './../_base';\nimport jsonpatch from './../../../lib/jsonpatch/json-patch-duplex';\nimport DataObserver from './dataObserver';\nimport {arrayEach} from './../../helpers/array';\nimport {registerPlugin} from './../../plugins';\n\n// Handsontable.hooks.register('afterChangesObserved');\n\n/**\n * @plugin ObserveChanges\n *\n * @description\n * This plugin allows to observe data source changes.\n *\n * By default, the plugin is declared as `undefined`, which makes it disabled.\n * Enabling this plugin switches the table into one-way data binding where changes are applied into the data source (outside from the table)\n * will be automatically reflected in the table.\n *\n * ```js\n * ...\n * // as a boolean\n * observeChanges: true,\n * ...\n * ```\n *\n * To configure this plugin see {@link Options#observeChanges}.\n */\nclass ObserveChanges extends BasePlugin {\n constructor(hotInstance) {\n super(hotInstance);\n /**\n * Instance of {@link DataObserver}.\n *\n * @type {DataObserver}\n */\n this.observer = null;\n }\n\n /**\n * Check if the plugin is enabled in the handsontable settings.\n *\n * @returns {Boolean}\n */\n isEnabled() {\n return this.hot.getSettings().observeChanges;\n }\n\n /**\n * Enable plugin for this Handsontable instance.\n */\n enablePlugin() {\n if (this.enabled) {\n return;\n }\n if (!this.observer) {\n this.observer = new DataObserver(this.hot.getSourceData());\n this._exposePublicApi();\n }\n\n this.observer.addLocalHook('change', (patches) => this.onDataChange(patches));\n this.addHook('afterCreateRow', () => this.onAfterTableAlter());\n this.addHook('afterRemoveRow', () => this.onAfterTableAlter());\n this.addHook('afterCreateCol', () => this.onAfterTableAlter());\n this.addHook('afterRemoveCol', () => this.onAfterTableAlter());\n this.addHook('afterChange', (changes, source) => this.onAfterTableAlter(source));\n this.addHook('afterLoadData', (firstRun) => this.onAfterLoadData(firstRun));\n\n super.enablePlugin();\n }\n\n /**\n * Disable plugin for this Handsontable instance.\n */\n disablePlugin() {\n if (this.observer) {\n this.observer.destroy();\n this.observer = null;\n this._deletePublicApi();\n }\n\n super.disablePlugin();\n }\n\n /**\n * Data change observer.\n *\n * @private\n * @param {Array} patches An array of objects which every item defines coordinates where data was changed.\n */\n onDataChange(patches) {\n if (!this.observer.isPaused()) {\n const sourceName = `${this.pluginName}.change`;\n const actions = {\n add: (patch) => {\n if (isNaN(patch.col)) {\n this.hot.runHooks('afterCreateRow', patch.row, 1, sourceName);\n } else {\n this.hot.runHooks('afterCreateCol', patch.col, 1, sourceName);\n }\n },\n remove: (patch) => {\n if (isNaN(patch.col)) {\n this.hot.runHooks('afterRemoveRow', patch.row, 1, sourceName);\n } else {\n this.hot.runHooks('afterRemoveCol', patch.col, 1, sourceName);\n }\n },\n replace: (patch) => {\n this.hot.runHooks('afterChange', [[patch.row, patch.col, null, patch.value]], sourceName);\n },\n };\n\n arrayEach(patches, (patch) => {\n if (actions[patch.op]) {\n actions[patch.op](patch);\n }\n });\n this.hot.render();\n }\n\n this.hot.runHooks('afterChangesObserved');\n }\n\n /**\n * On after table alter listener. Prevents infinity loop between internal and external data changing.\n *\n * @private\n * @param source\n */\n onAfterTableAlter(source) {\n if (source !== 'loadData') {\n this.observer.pause();\n this.hot.addHookOnce('afterChangesObserved', () => this.observer.resume());\n }\n }\n\n /**\n * On after load data listener.\n *\n * @private\n * @param {Boolean} firstRun `true` if event was fired first time.\n */\n onAfterLoadData(firstRun) {\n if (!firstRun) {\n this.observer.setObservedData(this.hot.getSourceData());\n }\n }\n\n /**\n * Destroy plugin instance.\n */\n destroy() {\n if (this.observer) {\n this.observer.destroy();\n this._deletePublicApi();\n }\n super.destroy();\n }\n\n /**\n * Expose plugins methods to the core.\n *\n * @private\n */\n _exposePublicApi() {\n const hot = this.hot;\n\n hot.pauseObservingChanges = () => this.observer.pause();\n hot.resumeObservingChanges = () => this.observer.resume();\n hot.isPausedObservingChanges = () => this.observer.isPaused();\n }\n\n /**\n * Delete all previously exposed methods.\n *\n * @private\n */\n _deletePublicApi() {\n const hot = this.hot;\n\n delete hot.pauseObservingChanges;\n delete hot.resumeObservingChanges;\n delete hot.isPausedObservingChanges;\n }\n}\n\nexport default ObserveChanges;\n\nregisterPlugin('observeChanges', ObserveChanges);\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/observeChanges/observeChanges.js","import jsonpatch from './../../../lib/jsonpatch/json-patch-duplex';\nimport localHooks from '../../mixins/localHooks';\nimport {mixin} from '../../helpers/object';\nimport {cleanPatches} from './utils';\n\n/**\n * @class DataObserver\n * @plugin ObserveChanges\n */\nclass DataObserver {\n constructor(observedData) {\n /**\n * Observed source data.\n *\n * @type {Array}\n */\n this.observedData = null;\n /**\n * JsonPatch observer.\n *\n * @type {Object}\n */\n this.observer = null;\n /**\n * Flag which determines if observer is paused or not. Paused observer doesn't emit `change` hooks.\n *\n * @type {Boolean}\n * @default false\n */\n this.paused = false;\n\n this.setObservedData(observedData);\n }\n\n /**\n * Set data to observe.\n *\n * @param {*} observedData\n */\n setObservedData(observedData) {\n if (this.observer) {\n jsonpatch.unobserve(this.observedData, this.observer);\n }\n this.observedData = observedData;\n this.observer = jsonpatch.observe(this.observedData, (patches) => this.onChange(patches));\n }\n\n /**\n * Check if observer was paused.\n *\n * @returns {Boolean}\n */\n isPaused() {\n return this.paused;\n }\n\n /**\n * Pause observer (stop emitting all detected changes).\n */\n pause() {\n this.paused = true;\n }\n\n /**\n * Resume observer (emit all detected changes).\n */\n resume() {\n this.paused = false;\n }\n\n /**\n * JsonPatch on change listener.\n *\n * @private\n * @param {Array} patches An array of object passed from jsonpatch.\n */\n onChange(patches) {\n this.runLocalHooks('change', cleanPatches(patches));\n }\n\n /**\n * Destroy observer instance.\n */\n destroy() {\n jsonpatch.unobserve(this.observedData, this.observer);\n this.observedData = null;\n this.observer = null;\n }\n}\n\nmixin(DataObserver, localHooks);\n\nexport default DataObserver;\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/observeChanges/dataObserver.js","import {arrayFilter, arrayMap} from '../../helpers/array';\n\n/**\n * Clean and extend patches from jsonpatch observer.\n *\n * @param {Array} patches\n * @returns {Array}\n */\nexport function cleanPatches(patches) {\n const newOrRemovedColumns = [];\n\n /**\n * If observeChanges uses native Object.observe method, then it produces patches for length property. Filter them.\n * If path can't be parsed. Filter it.\n */\n patches = arrayFilter(patches, (patch) => {\n if (/[/]length/ig.test(patch.path)) {\n return false;\n }\n if (!parsePath(patch.path)) {\n return false;\n }\n\n return true;\n });\n /**\n * Extend patches with changed cells coords\n */\n patches = arrayMap(patches, (patch) => {\n const coords = parsePath(patch.path);\n\n patch.row = coords.row;\n patch.col = coords.col;\n\n return patch;\n });\n /**\n * Removing or adding column will produce one patch for each table row.\n * Leaves only one patch for each column add/remove operation.\n */\n patches = arrayFilter(patches, (patch) => {\n if (['add', 'remove'].indexOf(patch.op) !== -1 && !isNaN(patch.col)) {\n if (newOrRemovedColumns.indexOf(patch.col) !== -1) {\n return false;\n }\n newOrRemovedColumns.push(patch.col);\n }\n\n return true;\n });\n newOrRemovedColumns.length = 0;\n\n return patches;\n}\n\n/**\n * Extract coordinates from path where data was changed.\n *\n * @param {String} path Path describing where data was changed.\n * @returns {Object|null} Returns an object with `row` and `col` properties or `null` if path doesn't have necessary information.\n */\nexport function parsePath(path) {\n const match = path.match(/^\\/(\\d+)\\/?(.*)?$/);\n\n if (!match) {\n return null;\n }\n const [, row, column] = match;\n\n return {\n row: parseInt(row, 10),\n col: /^\\d*$/.test(column) ? parseInt(column, 10) : column\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/observeChanges/utils.js","import BasePlugin from './../_base';\nimport {registerPlugin} from './../../plugins';\nimport {isObject} from './../../helpers/object';\nimport {rangeEach} from './../../helpers/number';\nimport {isUndefined} from './../../helpers/mixed';\n\nconst DEFAULT_SEARCH_RESULT_CLASS = 'htSearchResult';\n\nconst DEFAULT_CALLBACK = function(instance, row, col, data, testResult) {\n instance.getCellMeta(row, col).isSearchResult = testResult;\n};\n\nconst DEFAULT_QUERY_METHOD = function(query, value) {\n if (isUndefined(query) || query === null || !query.toLowerCase || query.length === 0) {\n return false;\n }\n if (isUndefined(value) || value === null) {\n return false;\n }\n\n return value.toString().toLowerCase().indexOf(query.toLowerCase()) !== -1;\n};\n\n/**\n * @plugin Search\n *\n * @example\n *\n * ```js\n * ...\n * // as boolean\n * search: true\n *\n * // as a object with one or more options\n * search: {\n * callback: myNewCallbackFunction,\n * queryMethod: myNewQueryMethod,\n * searchResultClass: 'customClass'\n * }\n *\n * // Access to search plugin instance:\n * var searchPlugin = hot.getPlugin('search');\n *\n * // Set callback programmatically:\n * searchPlugin.setCallback(myNewCallbackFunction);\n * // Set query method programmatically:\n * searchPlugin.setQueryMethod(myNewQueryMethod);\n * // Set search result cells class programmatically:\n * searchPlugin.setSearchResultClass(customClass);\n * ...\n * ```\n */\nclass Search extends BasePlugin {\n constructor(hotInstance) {\n super(hotInstance);\n /**\n * Function called during querying for each cell from the {@link DataMap}.\n *\n * @type {Function}\n */\n this.callback = DEFAULT_CALLBACK;\n /**\n * Query function is responsible for determining whether a query matches the value stored in a cell.\n *\n * @type {Function}\n */\n this.queryMethod = DEFAULT_QUERY_METHOD;\n /**\n * Class name added to each cell that belongs to the searched query.\n *\n * @type {String}\n */\n this.searchResultClass = DEFAULT_SEARCH_RESULT_CLASS;\n }\n\n /**\n * Check if the plugin is enabled in the Handsontable settings.\n *\n * @returns {Boolean}\n */\n isEnabled() {\n return this.hot.getSettings().search;\n }\n\n /**\n * Enable plugin for this Handsontable instance.\n */\n enablePlugin() {\n if (this.enabled) {\n return;\n }\n\n const searchSettings = this.hot.getSettings().search;\n this.updatePluginSettings(searchSettings);\n\n this.addHook('beforeRenderer', (...args) => this.onBeforeRenderer(...args));\n\n super.enablePlugin();\n }\n\n /**\n * Disable plugin for this Handsontable instance.\n */\n disablePlugin() {\n const beforeRendererCallback = (...args) => this.onBeforeRenderer(...args);\n\n this.hot.addHook('beforeRenderer', beforeRendererCallback);\n this.hot.addHookOnce('afterRender', () => {\n this.hot.removeHook('beforeRenderer', beforeRendererCallback);\n });\n\n super.disablePlugin();\n }\n\n /**\n * Updates the plugin to use the latest options you have specified.\n */\n updatePlugin() {\n this.disablePlugin();\n this.enablePlugin();\n\n super.updatePlugin();\n }\n\n /**\n * Query method - used inside search input listener.\n *\n * @param {String} queryStr Searched value.\n * @param {Function} [callback] Callback function performed on cells with values which matches to the searched query.\n * @param {Function} [queryMethod] Query function responsible for determining whether a query matches the value stored in a cell.\n *\n * @returns {Array} Return array of objects with `row`, `col`, `data` properties or empty array.\n */\n query(queryStr, callback = this.getCallback(), queryMethod = this.getQueryMethod()) {\n const rowCount = this.hot.countRows();\n const colCount = this.hot.countCols();\n const queryResult = [];\n const instance = this.hot;\n\n rangeEach(0, rowCount - 1, (rowIndex) => {\n rangeEach(0, colCount - 1, (colIndex) => {\n const cellData = this.hot.getDataAtCell(rowIndex, colIndex);\n const cellProperties = this.hot.getCellMeta(rowIndex, colIndex);\n const cellCallback = cellProperties.search.callback || callback;\n const cellQueryMethod = cellProperties.search.queryMethod || queryMethod;\n const testResult = cellQueryMethod(queryStr, cellData);\n\n if (testResult) {\n const singleResult = {\n row: rowIndex,\n col: colIndex,\n data: cellData,\n };\n\n queryResult.push(singleResult);\n }\n\n if (cellCallback) {\n cellCallback(instance, rowIndex, colIndex, cellData, testResult);\n }\n });\n });\n\n return queryResult;\n };\n\n /**\n * Get callback function.\n *\n * @returns {Function} Return the callback function.\n */\n getCallback() {\n return this.callback;\n }\n\n /**\n * Set callback function.\n *\n * @param {Function} newCallback\n */\n setCallback(newCallback) {\n this.callback = newCallback;\n }\n\n /**\n * Get queryMethod function.\n *\n * @returns {Function} Return the query method.\n */\n getQueryMethod() {\n return this.queryMethod;\n }\n\n /**\n * Set queryMethod function.\n *\n * @param {Function} newQueryMethod\n */\n setQueryMethod(newQueryMethod) {\n this.queryMethod = newQueryMethod;\n }\n\n /**\n * Get search result cells class.\n *\n * @returns {Function} Return the cell class.\n */\n getSearchResultClass() {\n return this.searchResultClass;\n }\n\n /**\n * Set search result cells class.\n *\n * @param {String} newElementClass\n */\n setSearchResultClass(newElementClass) {\n this.searchResultClass = newElementClass;\n }\n\n /**\n * Updates the settings of the plugin.\n *\n * @param {Object} searchSettings The plugin settings, taken from Handsontable configuration.\n * @private\n */\n updatePluginSettings(searchSettings) {\n if (isObject(searchSettings)) {\n if (searchSettings.searchResultClass) {\n this.setSearchResultClass(searchSettings.searchResultClass);\n }\n\n if (searchSettings.queryMethod) {\n this.setQueryMethod(searchSettings.queryMethod);\n }\n\n if (searchSettings.callback) {\n this.setCallback(searchSettings.callback);\n }\n }\n }\n\n /** *\n * The `beforeRenderer` hook callback.\n *\n * @private\n * @param {HTMLTableCellElement} TD The rendered `TD` element.\n * @param {Number} row Visual row index.\n * @param {Number} col Visual column index.\n * @param {String | Number} prop Column property name or a column index, if datasource is an array of arrays.\n * @param {String} value Value of the rendered cell.\n * @param {Object} cellProperties Object containing the cell's properties.\n */\n onBeforeRenderer(TD, row, col, prop, value, cellProperties) {\n // TODO: #4972\n const className = cellProperties.className || [];\n let classArray = [];\n\n if (typeof className === 'string') {\n classArray = className.split(' ');\n\n } else {\n classArray.push(...className);\n }\n\n if (this.isEnabled() && cellProperties.isSearchResult) {\n if (!classArray.includes(this.searchResultClass)) {\n classArray.push(`${this.searchResultClass}`);\n }\n\n } else if (classArray.includes(this.searchResultClass)) {\n classArray.splice(classArray.indexOf(this.searchResultClass), 1);\n }\n\n cellProperties.className = classArray.join(' ');\n }\n\n /**\n * Destroy plugin instance.\n */\n destroy() {\n super.destroy();\n }\n}\n\nregisterPlugin('search', Search);\n\nexport default Search;\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/search/search.js","import {addClass, removeClass} from './../../helpers/dom/element';\nimport {arrayEach} from './../../helpers/array';\nimport BasePlugin from './../_base';\nimport {registerPlugin} from './../../plugins';\nimport {isTouchSupported} from './../../helpers/feature';\n\n/**\n * @private\n * @plugin TouchScroll\n * @class TouchScroll\n */\nclass TouchScroll extends BasePlugin {\n constructor(hotInstance) {\n super(hotInstance);\n\n /**\n * Collection of scrollbars to update.\n *\n * @type {Array}\n */\n this.scrollbars = [];\n /**\n * Collection of overlays to update.\n *\n * @type {Array}\n */\n this.clones = [];\n /**\n * Flag which determines if collection of overlays should be refilled on every table render.\n *\n * @type {Boolean}\n * @default false\n */\n this.lockedCollection = false;\n /**\n * Flag which determines if walkontable should freeze overlays while scrolling.\n *\n * @type {Boolean}\n * @default false\n */\n this.freezeOverlays = false;\n }\n\n /**\n * Check if plugin is enabled.\n *\n * @returns {Boolean}\n */\n isEnabled() {\n return isTouchSupported();\n }\n\n /**\n * Enable the plugin.\n */\n enablePlugin() {\n if (this.enabled) {\n return;\n }\n\n this.addHook('afterRender', () => this.onAfterRender());\n this.registerEvents();\n\n super.enablePlugin();\n }\n\n /**\n * Updates the plugin to use the latest options you have specified.\n */\n updatePlugin() {\n this.lockedCollection = false;\n\n super.updatePlugin();\n }\n\n /**\n * Disable plugin for this Handsontable instance.\n */\n disablePlugin() {\n super.disablePlugin();\n }\n\n /**\n * Register all necessary events.\n *\n * @private\n */\n registerEvents() {\n this.addHook('beforeTouchScroll', () => this.onBeforeTouchScroll());\n this.addHook('afterMomentumScroll', () => this.onAfterMomentumScroll());\n }\n\n /**\n * After render listener.\n *\n * @private\n */\n onAfterRender() {\n if (this.lockedCollection) {\n return;\n }\n\n const {topOverlay, bottomOverlay, leftOverlay, topLeftCornerOverlay, bottomLeftCornerOverlay} = this.hot.view.wt.wtOverlays;\n\n this.lockedCollection = true;\n this.scrollbars.length = 0;\n this.scrollbars.push(topOverlay);\n\n if (bottomOverlay.clone) {\n this.scrollbars.push(bottomOverlay);\n }\n this.scrollbars.push(leftOverlay);\n\n if (topLeftCornerOverlay) {\n this.scrollbars.push(topLeftCornerOverlay);\n }\n if (bottomLeftCornerOverlay && bottomLeftCornerOverlay.clone) {\n this.scrollbars.push(bottomLeftCornerOverlay);\n }\n\n this.clones.length = 0;\n\n if (topOverlay.needFullRender) {\n this.clones.push(topOverlay.clone.wtTable.holder.parentNode);\n }\n if (bottomOverlay.needFullRender) {\n this.clones.push(bottomOverlay.clone.wtTable.holder.parentNode);\n }\n if (leftOverlay.needFullRender) {\n this.clones.push(leftOverlay.clone.wtTable.holder.parentNode);\n }\n if (topLeftCornerOverlay) {\n this.clones.push(topLeftCornerOverlay.clone.wtTable.holder.parentNode);\n }\n if (bottomLeftCornerOverlay && bottomLeftCornerOverlay.clone) {\n this.clones.push(bottomLeftCornerOverlay.clone.wtTable.holder.parentNode);\n }\n }\n\n /**\n * Touch scroll listener.\n *\n * @private\n */\n onBeforeTouchScroll() {\n this.freezeOverlays = true;\n\n arrayEach(this.clones, (clone) => {\n addClass(clone, 'hide-tween');\n });\n }\n\n /**\n * After momentum scroll listener.\n *\n * @private\n */\n onAfterMomentumScroll() {\n this.freezeOverlays = false;\n\n arrayEach(this.clones, (clone) => {\n removeClass(clone, 'hide-tween');\n addClass(clone, 'show-tween');\n });\n\n setTimeout(() => {\n arrayEach(this.clones, (clone) => {\n removeClass(clone, 'show-tween');\n });\n }, 400);\n\n arrayEach(this.scrollbars, (scrollbar) => {\n scrollbar.refresh();\n scrollbar.resetFixedPosition();\n });\n\n this.hot.view.wt.wtOverlays.syncScrollWithMaster();\n }\n}\n\nregisterPlugin('touchScroll', TouchScroll);\n\nexport default TouchScroll;\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/touchScroll/touchScroll.js","/**\n * Handsontable UndoRedo class\n */\nimport Hooks from './../../pluginHooks';\nimport {arrayMap, arrayEach} from './../../helpers/array';\nimport {rangeEach} from './../../helpers/number';\nimport {inherit, deepClone} from './../../helpers/object';\nimport {stopImmediatePropagation} from './../../helpers/dom/event';\nimport {CellCoords} from './../../3rdparty/walkontable/src';\nimport {align} from './../contextMenu/utils';\n\n/**\n * @description\n * Handsontable UndoRedo plugin. It allows to undo and redo certain actions done in the table.\n * Please note, that not all actions are currently undo-able.\n *\n * @example\n * ```js\n * ...\n * undo: true\n * ...\n * ```\n * @class UndoRedo\n * @plugin UndoRedo\n */\nfunction UndoRedo(instance) {\n let plugin = this;\n this.instance = instance;\n this.doneActions = [];\n this.undoneActions = [];\n this.ignoreNewActions = false;\n\n instance.addHook('afterChange', (changes, source) => {\n if (changes && source !== 'UndoRedo.undo' && source !== 'UndoRedo.redo' && source !== 'MergeCells') {\n plugin.done(new UndoRedo.ChangeAction(changes));\n }\n });\n\n instance.addHook('afterCreateRow', (index, amount, source) => {\n if (source === 'UndoRedo.undo' || source === 'UndoRedo.undo' || source === 'auto') {\n return;\n }\n\n let action = new UndoRedo.CreateRowAction(index, amount);\n plugin.done(action);\n });\n\n instance.addHook('beforeRemoveRow', (index, amount, logicRows, source) => {\n if (source === 'UndoRedo.undo' || source === 'UndoRedo.redo' || source === 'auto') {\n return;\n }\n\n var originalData = plugin.instance.getSourceDataArray();\n\n index = (originalData.length + index) % originalData.length;\n\n var removedData = deepClone(originalData.slice(index, index + amount));\n\n plugin.done(new UndoRedo.RemoveRowAction(index, removedData));\n });\n\n instance.addHook('afterCreateCol', (index, amount, source) => {\n if (source === 'UndoRedo.undo' || source === 'UndoRedo.redo' || source === 'auto') {\n return;\n }\n\n plugin.done(new UndoRedo.CreateColumnAction(index, amount));\n });\n\n instance.addHook('beforeRemoveCol', (index, amount, logicColumns, source) => {\n if (source === 'UndoRedo.undo' || source === 'UndoRedo.redo' || source === 'auto') {\n return;\n }\n\n let originalData = plugin.instance.getSourceDataArray();\n\n index = (plugin.instance.countCols() + index) % plugin.instance.countCols();\n\n let removedData = [];\n let headers = [];\n let indexes = [];\n\n rangeEach(originalData.length - 1, (i) => {\n let column = [];\n let origRow = originalData[i];\n\n rangeEach(index, index + (amount - 1), (j) => {\n column.push(origRow[instance.runHooks('modifyCol', j)]);\n });\n removedData.push(column);\n });\n\n rangeEach(amount - 1, (i) => {\n indexes.push(instance.runHooks('modifyCol', index + i));\n });\n\n if (Array.isArray(instance.getSettings().colHeaders)) {\n rangeEach(amount - 1, (i) => {\n headers.push(instance.getSettings().colHeaders[instance.runHooks('modifyCol', index + i)] || null);\n });\n }\n\n let manualColumnMovePlugin = plugin.instance.getPlugin('manualColumnMove');\n\n let columnsMap = manualColumnMovePlugin.isEnabled() ? manualColumnMovePlugin.columnsMapper.__arrayMap : [];\n let action = new UndoRedo.RemoveColumnAction(index, indexes, removedData, headers, columnsMap);\n\n plugin.done(action);\n });\n\n instance.addHook('beforeCellAlignment', (stateBefore, range, type, alignment) => {\n let action = new UndoRedo.CellAlignmentAction(stateBefore, range, type, alignment);\n plugin.done(action);\n });\n\n instance.addHook('beforeFilter', (conditionsStack) => {\n plugin.done(new UndoRedo.FiltersAction(conditionsStack));\n });\n\n instance.addHook('beforeRowMove', (movedRows, target) => {\n if (movedRows === false) {\n return;\n }\n\n plugin.done(new UndoRedo.RowMoveAction(movedRows, target));\n });\n\n instance.addHook('beforeMergeCells', (cellRange, auto) => {\n if (auto) {\n return;\n }\n\n plugin.done(new UndoRedo.MergeCellsAction(instance, cellRange));\n });\n\n instance.addHook('afterUnmergeCells', (cellRange, auto) => {\n if (auto) {\n return;\n }\n\n plugin.done(new UndoRedo.UnmergeCellsAction(instance, cellRange));\n });\n\n}\n\nUndoRedo.prototype.done = function(action) {\n if (!this.ignoreNewActions) {\n this.doneActions.push(action);\n this.undoneActions.length = 0;\n }\n};\n\n/**\n * Undo last edit.\n *\n * @function undo\n * @memberof UndoRedo#\n */\nUndoRedo.prototype.undo = function() {\n if (this.isUndoAvailable()) {\n let action = this.doneActions.pop();\n let actionClone = deepClone(action);\n let instance = this.instance;\n\n let continueAction = instance.runHooks('beforeUndo', actionClone);\n\n if (continueAction === false) {\n return;\n }\n\n this.ignoreNewActions = true;\n let that = this;\n action.undo(this.instance, () => {\n that.ignoreNewActions = false;\n that.undoneActions.push(action);\n });\n\n instance.runHooks('afterUndo', actionClone);\n }\n};\n\n/**\n * Redo edit (used to reverse an undo).\n *\n * @function redo\n * @memberof UndoRedo#\n */\nUndoRedo.prototype.redo = function() {\n if (this.isRedoAvailable()) {\n let action = this.undoneActions.pop();\n let actionClone = deepClone(action);\n let instance = this.instance;\n\n let continueAction = instance.runHooks('beforeRedo', actionClone);\n\n if (continueAction === false) {\n return;\n }\n\n this.ignoreNewActions = true;\n let that = this;\n action.redo(this.instance, () => {\n that.ignoreNewActions = false;\n that.doneActions.push(action);\n });\n\n instance.runHooks('afterRedo', actionClone);\n }\n};\n\n/**\n * Check if undo action is available.\n *\n * @function isUndoAvailable\n * @memberof UndoRedo#\n * @return {Boolean} Return `true` if undo can be performed, `false` otherwise\n */\nUndoRedo.prototype.isUndoAvailable = function() {\n return this.doneActions.length > 0;\n};\n\n/**\n * Check if redo action is available.\n *\n * @function isRedoAvailable\n * @memberof UndoRedo#\n * @return {Boolean} Return `true` if redo can be performed, `false` otherwise.\n */\nUndoRedo.prototype.isRedoAvailable = function() {\n return this.undoneActions.length > 0;\n};\n\n/**\n * Clears undo history.\n *\n * @function clear\n * @memberof UndoRedo#\n */\nUndoRedo.prototype.clear = function() {\n this.doneActions.length = 0;\n this.undoneActions.length = 0;\n};\n\nUndoRedo.Action = function() {};\nUndoRedo.Action.prototype.undo = function() {};\nUndoRedo.Action.prototype.redo = function() {};\n\n/**\n * Change action.\n */\nUndoRedo.ChangeAction = function(changes) {\n this.changes = changes;\n this.actionType = 'change';\n};\ninherit(UndoRedo.ChangeAction, UndoRedo.Action);\n\nUndoRedo.ChangeAction.prototype.undo = function(instance, undoneCallback) {\n let data = deepClone(this.changes),\n emptyRowsAtTheEnd = instance.countEmptyRows(true),\n emptyColsAtTheEnd = instance.countEmptyCols(true);\n\n for (let i = 0, len = data.length; i < len; i++) {\n data[i].splice(3, 1);\n }\n\n instance.addHookOnce('afterChange', undoneCallback);\n\n instance.setDataAtRowProp(data, null, null, 'UndoRedo.undo');\n\n for (let i = 0, len = data.length; i < len; i++) {\n if (instance.getSettings().minSpareRows && data[i][0] + 1 + instance.getSettings().minSpareRows === instance.countRows() &&\n emptyRowsAtTheEnd === instance.getSettings().minSpareRows) {\n\n instance.alter('remove_row', parseInt(data[i][0] + 1, 10), instance.getSettings().minSpareRows);\n instance.undoRedo.doneActions.pop();\n\n }\n\n if (instance.getSettings().minSpareCols && data[i][1] + 1 + instance.getSettings().minSpareCols === instance.countCols() &&\n emptyColsAtTheEnd === instance.getSettings().minSpareCols) {\n\n instance.alter('remove_col', parseInt(data[i][1] + 1, 10), instance.getSettings().minSpareCols);\n instance.undoRedo.doneActions.pop();\n }\n }\n\n};\nUndoRedo.ChangeAction.prototype.redo = function(instance, onFinishCallback) {\n let data = deepClone(this.changes);\n\n for (let i = 0, len = data.length; i < len; i++) {\n data[i].splice(2, 1);\n }\n\n instance.addHookOnce('afterChange', onFinishCallback);\n instance.setDataAtRowProp(data, null, null, 'UndoRedo.redo');\n};\n\n/**\n * Create row action.\n */\nUndoRedo.CreateRowAction = function(index, amount) {\n this.index = index;\n this.amount = amount;\n this.actionType = 'insert_row';\n};\ninherit(UndoRedo.CreateRowAction, UndoRedo.Action);\n\nUndoRedo.CreateRowAction.prototype.undo = function(instance, undoneCallback) {\n let rowCount = instance.countRows(),\n minSpareRows = instance.getSettings().minSpareRows;\n\n if (this.index >= rowCount && this.index - minSpareRows < rowCount) {\n this.index -= minSpareRows; // work around the situation where the needed row was removed due to an 'undo' of a made change\n }\n\n instance.addHookOnce('afterRemoveRow', undoneCallback);\n instance.alter('remove_row', this.index, this.amount, 'UndoRedo.undo');\n};\nUndoRedo.CreateRowAction.prototype.redo = function(instance, redoneCallback) {\n instance.addHookOnce('afterCreateRow', redoneCallback);\n instance.alter('insert_row', this.index, this.amount, 'UndoRedo.redo');\n};\n\n/**\n * Remove row action.\n */\nUndoRedo.RemoveRowAction = function(index, data) {\n this.index = index;\n this.data = data;\n this.actionType = 'remove_row';\n};\ninherit(UndoRedo.RemoveRowAction, UndoRedo.Action);\n\nUndoRedo.RemoveRowAction.prototype.undo = function(instance, undoneCallback) {\n instance.alter('insert_row', this.index, this.data.length, 'UndoRedo.undo');\n instance.addHookOnce('afterRender', undoneCallback);\n instance.populateFromArray(this.index, 0, this.data, void 0, void 0, 'UndoRedo.undo');\n};\nUndoRedo.RemoveRowAction.prototype.redo = function(instance, redoneCallback) {\n instance.addHookOnce('afterRemoveRow', redoneCallback);\n instance.alter('remove_row', this.index, this.data.length, 'UndoRedo.redo');\n};\n\n/**\n * Create column action.\n */\nUndoRedo.CreateColumnAction = function(index, amount) {\n this.index = index;\n this.amount = amount;\n this.actionType = 'insert_col';\n};\ninherit(UndoRedo.CreateColumnAction, UndoRedo.Action);\n\nUndoRedo.CreateColumnAction.prototype.undo = function(instance, undoneCallback) {\n instance.addHookOnce('afterRemoveCol', undoneCallback);\n instance.alter('remove_col', this.index, this.amount, 'UndoRedo.undo');\n};\nUndoRedo.CreateColumnAction.prototype.redo = function(instance, redoneCallback) {\n instance.addHookOnce('afterCreateCol', redoneCallback);\n instance.alter('insert_col', this.index, this.amount, 'UndoRedo.redo');\n};\n\n/**\n * Remove column action.\n */\nUndoRedo.RemoveColumnAction = function(index, indexes, data, headers, columnPositions) {\n this.index = index;\n this.indexes = indexes;\n this.data = data;\n this.amount = this.data[0].length;\n this.headers = headers;\n this.columnPositions = columnPositions.slice(0);\n this.actionType = 'remove_col';\n};\ninherit(UndoRedo.RemoveColumnAction, UndoRedo.Action);\n\nUndoRedo.RemoveColumnAction.prototype.undo = function(instance, undoneCallback) {\n let row;\n let ascendingIndexes = this.indexes.slice(0).sort();\n let sortByIndexes = (elem, j, arr) => arr[this.indexes.indexOf(ascendingIndexes[j])];\n\n let sortedData = [];\n rangeEach(this.data.length - 1, (i) => {\n sortedData[i] = arrayMap(this.data[i], sortByIndexes);\n });\n\n let sortedHeaders = [];\n sortedHeaders = arrayMap(this.headers, sortByIndexes);\n\n var changes = [];\n\n // TODO: Temporary hook for undo/redo mess\n instance.runHooks('beforeCreateCol', this.indexes[0], this.indexes.length, 'UndoRedo.undo');\n\n rangeEach(this.data.length - 1, (i) => {\n row = instance.getSourceDataAtRow(i);\n\n rangeEach(ascendingIndexes.length - 1, (j) => {\n row.splice(ascendingIndexes[j], 0, sortedData[i][j]);\n changes.push([i, ascendingIndexes[j], null, sortedData[i][j]]);\n });\n });\n\n // TODO: Temporary hook for undo/redo mess\n if (instance.getPlugin('formulas')) {\n instance.getPlugin('formulas').onAfterSetDataAtCell(changes);\n }\n\n if (typeof this.headers !== 'undefined') {\n rangeEach(sortedHeaders.length - 1, (j) => {\n instance.getSettings().colHeaders.splice(ascendingIndexes[j], 0, sortedHeaders[j]);\n });\n }\n\n if (instance.getPlugin('manualColumnMove')) {\n instance.getPlugin('manualColumnMove').columnsMapper.__arrayMap = this.columnPositions;\n }\n\n instance.addHookOnce('afterRender', undoneCallback);\n\n // TODO: Temporary hook for undo/redo mess\n instance.runHooks('afterCreateCol', this.indexes[0], this.indexes.length, 'UndoRedo.undo');\n\n if (instance.getPlugin('formulas')) {\n instance.getPlugin('formulas').recalculateFull();\n }\n\n instance.render();\n};\n\nUndoRedo.RemoveColumnAction.prototype.redo = function(instance, redoneCallback) {\n instance.addHookOnce('afterRemoveCol', redoneCallback);\n instance.alter('remove_col', this.index, this.amount, 'UndoRedo.redo');\n};\n\n/**\n * Cell alignment action.\n */\nUndoRedo.CellAlignmentAction = function(stateBefore, range, type, alignment) {\n this.stateBefore = stateBefore;\n this.range = range;\n this.type = type;\n this.alignment = alignment;\n};\nUndoRedo.CellAlignmentAction.prototype.undo = function(instance, undoneCallback) {\n arrayEach(this.range, ({from, to}) => {\n for (let row = from.row; row <= to.row; row += 1) {\n for (let col = from.col; col <= to.col; col += 1) {\n instance.setCellMeta(row, col, 'className', this.stateBefore[row][col] || ' htLeft');\n }\n }\n });\n\n instance.addHookOnce('afterRender', undoneCallback);\n instance.render();\n};\nUndoRedo.CellAlignmentAction.prototype.redo = function(instance, undoneCallback) {\n align(this.range, this.type, this.alignment, (row, col) => instance.getCellMeta(row, col),\n (row, col, key, value) => instance.setCellMeta(row, col, key, value));\n\n instance.addHookOnce('afterRender', undoneCallback);\n instance.render();\n};\n\n/**\n * Filters action.\n */\nUndoRedo.FiltersAction = function(conditionsStack) {\n this.conditionsStack = conditionsStack;\n this.actionType = 'filter';\n};\ninherit(UndoRedo.FiltersAction, UndoRedo.Action);\n\nUndoRedo.FiltersAction.prototype.undo = function(instance, undoneCallback) {\n let filters = instance.getPlugin('filters');\n\n instance.addHookOnce('afterRender', undoneCallback);\n\n filters.conditionCollection.importAllConditions(this.conditionsStack.slice(0, this.conditionsStack.length - 1));\n filters.filter();\n};\nUndoRedo.FiltersAction.prototype.redo = function(instance, redoneCallback) {\n let filters = instance.getPlugin('filters');\n\n instance.addHookOnce('afterRender', redoneCallback);\n\n filters.conditionCollection.importAllConditions(this.conditionsStack);\n filters.filter();\n};\n\n/**\n * Merge Cells action.\n * @util\n */\nclass MergeCellsAction extends UndoRedo.Action {\n constructor(instance, cellRange) {\n super();\n this.cellRange = cellRange;\n this.rangeData = instance.getData(cellRange.from.row, cellRange.from.col, cellRange.to.row, cellRange.to.col);\n }\n\n undo(instance, undoneCallback) {\n const mergeCellsPlugin = instance.getPlugin('mergeCells');\n instance.addHookOnce('afterRender', undoneCallback);\n\n mergeCellsPlugin.unmergeRange(this.cellRange, true);\n instance.populateFromArray(this.cellRange.from.row, this.cellRange.from.col, this.rangeData, void 0, void 0, 'MergeCells');\n }\n\n redo(instance, redoneCallback) {\n const mergeCellsPlugin = instance.getPlugin('mergeCells');\n instance.addHookOnce('afterRender', redoneCallback);\n\n mergeCellsPlugin.mergeRange(this.cellRange);\n }\n}\nUndoRedo.MergeCellsAction = MergeCellsAction;\n\n/**\n * Unmerge Cells action.\n * @util\n */\nclass UnmergeCellsAction extends UndoRedo.Action {\n constructor(instance, cellRange) {\n super();\n this.cellRange = cellRange;\n }\n\n undo(instance, undoneCallback) {\n const mergeCellsPlugin = instance.getPlugin('mergeCells');\n instance.addHookOnce('afterRender', undoneCallback);\n\n mergeCellsPlugin.mergeRange(this.cellRange, true);\n }\n\n redo(instance, redoneCallback) {\n const mergeCellsPlugin = instance.getPlugin('mergeCells');\n instance.addHookOnce('afterRender', redoneCallback);\n\n mergeCellsPlugin.unmergeRange(this.cellRange, true);\n instance.render();\n }\n}\nUndoRedo.UnmergeCellsAction = UnmergeCellsAction;\n\n/**\n * ManualRowMove action.\n * @TODO: removeRow undo should works on logical index\n */\nUndoRedo.RowMoveAction = function(movedRows, target) {\n this.rows = movedRows.slice();\n this.target = target;\n};\ninherit(UndoRedo.RowMoveAction, UndoRedo.Action);\n\nUndoRedo.RowMoveAction.prototype.undo = function(instance, undoneCallback) {\n let manualRowMove = instance.getPlugin('manualRowMove');\n\n instance.addHookOnce('afterRender', undoneCallback);\n\n let mod = this.rows[0] < this.target ? -1 * this.rows.length : 0;\n let newTarget = this.rows[0] > this.target ? this.rows[0] + this.rows.length : this.rows[0];\n let newRows = [];\n let rowsLen = this.rows.length + mod;\n\n for (let i = mod; i < rowsLen; i += 1) {\n newRows.push(this.target + i);\n }\n\n manualRowMove.moveRows(newRows.slice(), newTarget);\n instance.render();\n\n instance.selectCell(this.rows[0], 0, this.rows[this.rows.length - 1], instance.countCols() - 1, false, false);\n};\nUndoRedo.RowMoveAction.prototype.redo = function(instance, redoneCallback) {\n let manualRowMove = instance.getPlugin('manualRowMove');\n\n instance.addHookOnce('afterRender', redoneCallback);\n manualRowMove.moveRows(this.rows.slice(), this.target);\n instance.render();\n let startSelection = this.rows[0] < this.target ? this.target - this.rows.length : this.target;\n\n instance.selectCell(startSelection, 0, startSelection + this.rows.length - 1, instance.countCols() - 1, false, false);\n};\n\nfunction init() {\n let instance = this;\n let pluginEnabled = typeof instance.getSettings().undo == 'undefined' || instance.getSettings().undo;\n\n if (pluginEnabled) {\n if (!instance.undoRedo) {\n /**\n * Instance of Handsontable.UndoRedo Plugin {@link Handsontable.UndoRedo}\n *\n * @alias undoRedo\n * @memberof! Handsontable.Core#\n * @type {UndoRedo}\n */\n instance.undoRedo = new UndoRedo(instance);\n\n exposeUndoRedoMethods(instance);\n\n instance.addHook('beforeKeyDown', onBeforeKeyDown);\n instance.addHook('afterChange', onAfterChange);\n }\n } else if (instance.undoRedo) {\n delete instance.undoRedo;\n\n removeExposedUndoRedoMethods(instance);\n\n instance.removeHook('beforeKeyDown', onBeforeKeyDown);\n instance.removeHook('afterChange', onAfterChange);\n }\n}\n\nfunction onBeforeKeyDown(event) {\n let instance = this;\n\n let ctrlDown = (event.ctrlKey || event.metaKey) && !event.altKey;\n\n if (ctrlDown) {\n if (event.keyCode === 89 || (event.shiftKey && event.keyCode === 90)) { // CTRL + Y or CTRL + SHIFT + Z\n instance.undoRedo.redo();\n stopImmediatePropagation(event);\n } else if (event.keyCode === 90) { // CTRL + Z\n instance.undoRedo.undo();\n stopImmediatePropagation(event);\n }\n }\n}\n\nfunction onAfterChange(changes, source) {\n let instance = this;\n if (source === 'loadData') {\n return instance.undoRedo.clear();\n }\n}\n\nfunction exposeUndoRedoMethods(instance) {\n /**\n * {@link UndoRedo#undo}\n * @alias undo\n * @memberof! Handsontable.Core#\n */\n instance.undo = function() {\n return instance.undoRedo.undo();\n };\n\n /**\n * {@link UndoRedo#redo}\n * @alias redo\n * @memberof! Handsontable.Core#\n */\n instance.redo = function() {\n return instance.undoRedo.redo();\n };\n\n /**\n * {@link UndoRedo#isUndoAvailable}\n * @alias isUndoAvailable\n * @memberof! Handsontable.Core#\n */\n instance.isUndoAvailable = function() {\n return instance.undoRedo.isUndoAvailable();\n };\n\n /**\n * {@link UndoRedo#isRedoAvailable}\n * @alias isRedoAvailable\n * @memberof! Handsontable.Core#\n */\n instance.isRedoAvailable = function() {\n return instance.undoRedo.isRedoAvailable();\n };\n\n /**\n * {@link UndoRedo#clear}\n * @alias clearUndo\n * @memberof! Handsontable.Core#\n */\n instance.clearUndo = function() {\n return instance.undoRedo.clear();\n };\n}\n\nfunction removeExposedUndoRedoMethods(instance) {\n delete instance.undo;\n delete instance.redo;\n delete instance.isUndoAvailable;\n delete instance.isRedoAvailable;\n delete instance.clearUndo;\n}\n\nconst hook = Hooks.getSingleton();\n\nhook.add('afterInit', init);\nhook.add('afterUpdateSettings', init);\n\nhook.register('beforeUndo');\nhook.register('afterUndo');\nhook.register('beforeRedo');\nhook.register('afterRedo');\n\nexport default UndoRedo;\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/undoRedo/undoRedo.js"],"sourceRoot":""}
|