UNPKG

handsontable

Version:

Handsontable is a JavaScript Data Grid available for React, Angular and Vue.

35 lines • 1.78 MB
/*! * Copyright (c) HANDSONCODE sp. z o. o. * * HANDSONTABLE is a software distributed by HANDSONCODE sp. z o. o., a Polish corporation based in * Gdynia, Poland, at Aleja Zwyciestwa 96-98, registered by the District Court in Gdansk under number * 538651, EU tax ID number: PL5862294002, share capital: PLN 62,800.00. * * This software is protected by applicable copyright laws, including international treaties, and dual- * licensed - depending on whether your use for commercial purposes, meaning intended for or * resulting in commercial advantage or monetary compensation, or not. * * If your use is strictly personal or solely for evaluation purposes, meaning for the purposes of testing * the suitability, performance, and usefulness of this software outside the production environment, * you agree to be bound by the terms included in the "handsontable-non-commercial-license.pdf" file. * * Your use of this software for commercial purposes is subject to the terms included in an applicable * license agreement. * * In any case, you must not make any such use of this software as to develop software which may be * considered competitive with this software. * * UNLESS EXPRESSLY AGREED OTHERWISE, HANDSONCODE PROVIDES THIS SOFTWARE ON AN "AS IS" * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, AND IN NO EVENT AND UNDER NO * LEGAL THEORY, SHALL HANDSONCODE BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY DIRECT, * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER ARISING FROM * USE OR INABILITY TO USE THIS SOFTWARE. * * Version: 16.0.1 * Release date: 10/07/2025 (built at 10/07/2025 10:59:13) */ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Handsontable",[],t):"object"==typeof exports?exports.Handsontable=t():e.Handsontable=t()}("undefined"!=typeof self?self:this,()=>(()=>{var e={57:(e,t,r)=>{"use strict";r(44065),r(56060)},214:e=>{"use strict";e.exports=function(e){return null==e}},250:(e,t,r)=>{"use strict";var n=r(60423);t.__esModule=!0,t.condition=l;var s=n(r(37539)),o=function(e,t){if("function"==typeof WeakMap)var r=new WeakMap,n=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var s,o,i={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return i;if(s=t?n:r){if(s.has(e))return s.get(e);s.set(e,i)}for(const t in e)"default"!==t&&{}.hasOwnProperty.call(e,t)&&((o=(s=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(o.get||o.set)?s(i,t,o):i[t]=e[t]);return i}(e,t)}(r(86679)),i=r(9945);const a=t.CONDITION_NAME="date_before";function l(e,t){let[r]=t;const n=(0,s.default)(e.value,e.meta.dateFormat),o=(0,s.default)(r,e.meta.dateFormat);return!(!n.isValid()||!o.isValid())&&n.diff(o)<=0}(0,i.registerCondition)(a,l,{name:o.FILTERS_CONDITIONS_BEFORE,inputsCount:1,showOperators:!0})},281:(e,t,r)=>{"use strict";var n=r(39157),s=r(9370),o=r(96891);e.exports=function(e,t,r){n?s.f(e,t,o(0,r)):e[t]=r}},323:(e,t,r)=>{"use strict";var n=r(60423);t.__esModule=!0;var s=n(r(53726)),o=r(45367),i=r(7244),a=n(r(65187));class l{constructor(e){(0,s.default)(this,"wasLastActionShow",!0),(0,s.default)(this,"showDebounced",null),(0,s.default)(this,"hidingTimer",null),this.updateDelay(e)}hide(){this.wasLastActionShow=!1,this.hidingTimer=setTimeout(()=>{!1===this.wasLastActionShow&&this.runLocalHooks("hide")},250)}show(e){this.wasLastActionShow=!0,this.showDebounced(e)}cancelHiding(){this.wasLastActionShow=!0,clearTimeout(this.hidingTimer),this.hidingTimer=null}updateDelay(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:250;this.showDebounced=(0,o.debounce)(e=>{this.wasLastActionShow&&this.runLocalHooks("show",e.from.row,e.from.col)},e)}destroy(){this.clearLocalHooks()}}(0,i.mixin)(l,a.default);t.default=l},469:()=>{},594:()=>{},615:(e,t,r)=>{"use strict";var n=r(60423);t.__esModule=!0,r(88443);var s=n(r(53726)),o=r(18158),i=r(19256),a=r(23728);function l(e,t){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.add(e)}function h(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}const u=t.PLUGIN_KEY="dragToScroll",c=t.PLUGIN_PRIORITY=100;var d=new WeakSet;class p extends o.BasePlugin{constructor(){super(...arguments),l(this,d),(0,s.default)(this,"boundaries",null),(0,s.default)(this,"callback",null),(0,s.default)(this,"listening",!1)}static get PLUGIN_KEY(){return u}static get PLUGIN_PRIORITY(){return c}isEnabled(){return!!this.hot.getSettings()[u]}enablePlugin(){this.enabled||(this.addHook("afterOnCellMouseDown",e=>h(d,this,g).call(this,e)),this.addHook("afterOnCellCornerMouseDown",e=>h(d,this,g).call(this,e)),this.registerEvents(),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.unregisterEvents(),super.disablePlugin()}setBoundaries(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{left:0,right:this.hot.rootWindow.innerWidth,top:0,bottom:this.hot.rootWindow.innerHeight};this.boundaries=e}setCallback(e){this.callback=e}check(e,t){let r=0,n=0;t<this.boundaries.top?n=t-this.boundaries.top:t>this.boundaries.bottom&&(n=t-this.boundaries.bottom),e<this.boundaries.left?r=e-this.boundaries.left:e>this.boundaries.right&&(r=e-this.boundaries.right),this.callback(r,n)}listen(){this.listening=!0}unlisten(){this.listening=!1}isListening(){return this.listening}registerEvents(){const{rootWindow:e}=this.hot;let t=e;for(;t;)this.eventManager.addEventListener(t.document,"contextmenu",()=>this.unlisten()),this.eventManager.addEventListener(t.document,"mouseup",()=>this.unlisten()),this.eventManager.addEventListener(t.document,"mousemove",e=>this.onMouseMove(e)),t=(0,a.getParentWindow)(t)}unregisterEvents(){this.eventManager.clear()}onMouseMove(e){this.isListening()&&this.check(e.clientX,e.clientY)}destroy(){super.destroy()}}function g(e){if((0,i.isRightClick)(e))return;const t=this.hot.view._wt.wtOverlays.topOverlay.mainTableScrollableElement;this.setBoundaries(t!==this.hot.rootWindow?t.getBoundingClientRect():void 0),this.setCallback((e,r)=>{var n,s;const o=null!==(n=t.scrollLeft)&&void 0!==n?n:t.scrollX,i=null!==(s=t.scrollTop)&&void 0!==s?s:t.scrollY;t.scroll(o+50*Math.sign(e),i+20*Math.sign(r))}),this.listen()}t.DragToScroll=p},642:(e,t,r)=>{"use strict";var n=r(21313),s=r(14499).has,o=r(30845),i=r(18622),a=r(98304),l=r(78016),h=r(63884);e.exports=function(e){var t=n(this),r=i(e);if(o(t)<=r.size)return!1!==a(t,function(e){if(r.includes(e))return!1},!0);var u=r.getIterator();return!1!==l(u,function(e){if(s(t,e))return h(u,"normal",!1)})}},721:(e,t,r)=>{"use strict";var n,s=r(77618),o=r(65126),i=r(60370),a=r(13884),l=r(3034),h=r(4158),u=r(86224),c="prototype",d="script",p=u("IE_PROTO"),g=function(){},f=function(e){return"<"+d+">"+e+"</"+d+">"},m=function(e){e.write(f("")),e.close();var t=e.parentWindow.Object;return e=null,t},E=function(){try{n=new ActiveXObject("htmlfile")}catch(e){}var e,t,r;E="undefined"!=typeof document?document.domain&&n?m(n):(t=h("iframe"),r="java"+d+":",t.style.display="none",l.appendChild(t),t.src=String(r),(e=t.contentWindow.document).open(),e.write(f("document.F=Object")),e.close(),e.F):m(n);for(var s=i.length;s--;)delete E[c][i[s]];return E()};a[p]=!0,e.exports=Object.create||function(e,t){var r;return null!==e?(g[c]=s(e),r=new g,g[c]=null,r[p]=e):r=E(),void 0===t?r:o.f(r,t)}},749:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(97003);t.RENDERER_TYPE=n.RENDERER_TYPE,t.htmlRenderer=n.htmlRenderer},763:()=>{},829:(e,t,r)=>{"use strict";var n=r(60423);t.__esModule=!0,r(85639);var s=n(r(53726)),o=r(23728),i=r(22135),a=r(18158);const l=t.PLUGIN_KEY="multipleSelectionHandles",h=t.PLUGIN_PRIORITY=160;class u extends a.BasePlugin{constructor(){super(...arguments),(0,s.default)(this,"dragged",[]),(0,s.default)(this,"lastSetCell",null)}static get PLUGIN_KEY(){return l}static get PLUGIN_PRIORITY(){return h}isEnabled(){return(0,i.isMobileBrowser)()}enablePlugin(){this.enabled||(this.registerListeners(),super.enablePlugin())}registerListeners(){const e=this,{rootElement:t}=this.hot;function r(t){if(1===e.dragged.length)return e.dragged.splice(0,e.dragged.length),!0;const r=e.dragged.indexOf(t);if(-1===r)return!1;0===r?e.dragged=e.dragged.slice(0,1):1===r&&(e.dragged=e.dragged.slice(-1))}this.eventManager.addEventListener(t,"touchstart",t=>{let r;return(0,o.hasClass)(t.target,"topSelectionHandle-HitArea")?(r=e.hot.getSelectedRangeLast(),e.dragged.push("top"),e.touchStartRange={width:r.getWidth(),height:r.getHeight(),direction:r.getDirection()},t.preventDefault(),!1):(0,o.hasClass)(t.target,"bottomSelectionHandle-HitArea")?(r=e.hot.getSelectedRangeLast(),e.dragged.push("bottom"),e.touchStartRange={width:r.getWidth(),height:r.getHeight(),direction:r.getDirection()},t.preventDefault(),!1):void 0}),this.eventManager.addEventListener(t,"touchend",t=>(0,o.hasClass)(t.target,"topSelectionHandle-HitArea")?(r.call(e,"top"),e.touchStartRange=void 0,t.preventDefault(),!1):(0,o.hasClass)(t.target,"bottomSelectionHandle-HitArea")?(r.call(e,"bottom"),e.touchStartRange=void 0,t.preventDefault(),!1):void 0),this.eventManager.addEventListener(t,"touchmove",t=>{const{rootDocument:r}=this.hot;let n,s,o,i,a,l;if(0===e.dragged.length)return;const h=r.elementFromPoint(t.touches[0].clientX,t.touches[0].clientY);h&&h!==e.lastSetCell&&("TD"!==h.nodeName&&"TH"!==h.nodeName||(n=e.hot.getCoords(h),-1===n.col&&(n.col=0),s=e.hot.getSelectedRangeLast(),o=s.getWidth(),i=s.getHeight(),a=s.getDirection(),1===o&&1===i&&e.hot.selection.setRangeEnd(n),l=e.getCurrentRangeCoords(s,n,e.touchStartRange.direction,a,e.dragged[0]),null!==l.start&&e.hot.selection.setRangeStart(l.start),e.hot.selection.setRangeEnd(l.end),e.lastSetCell=h),t.preventDefault())})}getCurrentRangeCoords(e,t,r,n,s){const o=e.getTopStartCorner(),i=e.getBottomEndCorner(),a=e.getBottomStartCorner(),l=e.getTopEndCorner();let h={start:null,end:null};switch(r){case"NE-SW":switch(n){case"NE-SW":case"NW-SE":h="top"===s?{start:this.hot._createCellCoords(t.row,e.highlight.col),end:this.hot._createCellCoords(a.row,t.col)}:{start:this.hot._createCellCoords(e.highlight.row,t.col),end:this.hot._createCellCoords(t.row,o.col)};break;case"SE-NW":"bottom"===s&&(h={start:this.hot._createCellCoords(i.row,t.col),end:this.hot._createCellCoords(t.row,o.col)})}break;case"NW-SE":switch(n){case"NE-SW":"top"===s?h={start:t,end:a}:h.end=t;break;case"NW-SE":"top"===s?h={start:t,end:i}:h.end=t;break;case"SE-NW":"top"===s?h={start:t,end:o}:h.end=t;break;case"SW-NE":"top"===s?h={start:t,end:l}:h.end=t}break;case"SW-NE":switch(n){case"NW-SE":h="bottom"===s?{start:this.hot._createCellCoords(t.row,o.col),end:this.hot._createCellCoords(a.row,t.col)}:{start:this.hot._createCellCoords(o.row,t.col),end:this.hot._createCellCoords(t.row,i.col)};break;case"SW-NE":h="top"===s?{start:this.hot._createCellCoords(e.highlight.row,t.col),end:this.hot._createCellCoords(t.row,i.col)}:{start:this.hot._createCellCoords(t.row,o.col),end:this.hot._createCellCoords(o.row,t.col)};break;case"SE-NW":"bottom"===s?h={start:this.hot._createCellCoords(t.row,l.col),end:this.hot._createCellCoords(o.row,t.col)}:"top"===s&&(h={start:a,end:t})}break;case"SE-NW":switch(n){case"NW-SE":case"NE-SW":case"SW-NE":"top"===s&&(h.end=t);break;case"SE-NW":"top"===s?h.end=t:h={start:t,end:o}}}return h}isDragged(){return this.dragged.length>0}}t.MultipleSelectionHandles=u},839:(e,t,r)=>{"use strict";var n=r(60423);t.__esModule=!0,r(88443),r(85639),r(73741),r(7307),r(37782),r(89663);var s=n(r(53726)),o=r(35921),i=r(7894),a=r(23728),l=r(15876),h=r(8266),u=r(5784),c=r(60775),d=r(31115),p=r(45367);function g(e,t,r){f(e,t),t.set(e,r)}function f(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function m(e,t){return e.get(E(e,t))}function E(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}const w=t.EDITOR_TYPE="autocomplete";var y=new WeakMap,C=new WeakMap,R=new WeakSet;class S extends o.HandsontableEditor{constructor(){var e,t;super(...arguments),f(e=this,t=R),t.add(e),(0,s.default)(this,"query",null),(0,s.default)(this,"strippedChoices",[]),(0,s.default)(this,"rawChoices",[]),g(this,y,this.hot.guid.slice(0,9)),g(this,C,(0,p.debounce)(()=>{this.focus()},100)),(0,s.default)(this,"sortByRelevance",function(e,t,r){const n=[],s=[],o=e.length;let i,a,u,c,d=t.length;if(0===o){for(u=0;u<d;u++)s.push(u);return s}for(u=0;u<d;u++){if(a=(0,h.stripTags)((0,l.stringify)(t[u])),r)c=a.indexOf(e);else{const t=this.cellProperties.locale;c=a.toLocaleLowerCase(t).indexOf(e.toLocaleLowerCase(t))}-1!==c&&(i=a.length-c-o,n.push({baseIndex:u,index:c,charsLeft:i,value:a}))}for(n.sort((e,t)=>{if(-1===t.index)return-1;if(-1===e.index)return 1;if(e.index<t.index)return-1;if(t.index<e.index)return 1;if(e.index===t.index){if(e.charsLeft<t.charsLeft)return-1;if(e.charsLeft>t.charsLeft)return 1}return 0}),u=0,d=n.length;u<d;u++)s.push(n[u].baseIndex);return s})}static get EDITOR_TYPE(){return w}getValue(){const e=this.rawChoices.find(e=>this.stripValueIfNeeded(e)===this.TEXTAREA.value);return(0,l.isDefined)(e)?e:this.TEXTAREA.value}createElements(){super.createElements(),(0,a.addClass)(this.htContainer,"autocompleteEditor"),(0,a.addClass)(this.htContainer,-1===this.hot.rootWindow.navigator.platform.indexOf("Mac")?"":"htMacScroll"),this.hot.getSettings().ariaTags&&(0,a.setAttribute)(this.TEXTAREA,[(0,d.A11Y_TEXT)(),(0,d.A11Y_COMBOBOX)(),(0,d.A11Y_HASPOPUP)("listbox"),(0,d.A11Y_AUTOCOMPLETE)()])}prepare(e,t,r,n,s,o){super.prepare(e,t,r,n,s,o),this.hot.getSettings().ariaTags&&(0,a.setAttribute)(this.TEXTAREA,[(0,d.A11Y_EXPANDED)("false"),(0,d.A11Y_CONTROLS)(`${m(y,this)}-listbox-${e}-${t}`)])}open(){super.open();const e=void 0===this.cellProperties.trimDropdown||this.cellProperties.trimDropdown,t=this.hot.getSettings().ariaTags,r=Array.isArray(this.cellProperties.source)?this.cellProperties.source:null,n=null==r?void 0:r.length,{row:s,col:o}=this;this.showEditableElement(),this.focus(),this.addHook("beforeKeyDown",e=>this.onBeforeKeyDown(e)),this.htEditor.addHook("afterScroll",m(C,this)),this.htEditor.updateSettings({colWidths:e?[(0,a.outerWidth)(this.TEXTAREA)-2]:void 0,autoColumnSize:!0,renderer:(e,s,o,i,h,u,p)=>{(0,c.textRenderer)(e,s,o,i,h,u,p);const{filteringCaseSensitive:g,allowHtml:f,locale:m}=this.cellProperties,E=this.query;let w,y,C=(0,l.stringify)(u);C&&!f&&(w=!0===g?C.indexOf(E):C.toLocaleLowerCase(m).indexOf(E.toLocaleLowerCase(m)),-1!==w&&(y=C.substr(w,E.length),C=C.replace(y,`<strong>${y}</strong>`))),t&&(0,a.setAttribute)(s,[(0,d.A11Y_OPTION)(),...r?[(0,d.A11Y_SETSIZE)(n)]:[],...r?[(0,d.A11Y_POSINSET)(r.indexOf(u)+1)]:[],["id",`${this.htEditor.rootElement.id}_${o}-${i}`]]),s.innerHTML=C},afterSelectionEnd:(e,r)=>{if(t){const t=e=>{(0,a.setAttribute)(e,[(0,d.A11Y_SELECTED)()]),(0,a.setAttribute)(this.TEXTAREA,...(0,d.A11Y_ACTIVEDESCENDANT)(e.id))},n=this.htEditor.getCell(e,r,!0);null!==n?t(n):this.htEditor.addHookOnce("afterScrollVertically",()=>{const n=this.htEditor.getCell(e,r,!0);t(n)})}}}),t&&((0,a.setAttribute)(this.htEditor.view._wt.wtOverlays.wtTable.TABLE,...(0,d.A11Y_PRESENTATION)()),(0,a.setAttribute)(this.htEditor.rootElement,[(0,d.A11Y_LISTBOX)(),(0,d.A11Y_LIVE)("polite"),(0,d.A11Y_RELEVANT)("text"),["id",`${m(y,this)}-listbox-${s}-${o}`]]),(0,a.setAttribute)(this.TEXTAREA,...(0,d.A11Y_EXPANDED)("true"))),this.hot._registerTimeout(()=>{this.queryChoices(this.TEXTAREA.value)})}close(){this.removeHooksByKey("beforeKeyDown"),super.close(),this.hot.getSettings().ariaTags&&(0,a.setAttribute)(this.TEXTAREA,[(0,d.A11Y_EXPANDED)("false")])}discardEditor(e){super.discardEditor(e),this.hot.view.render()}queryChoices(e){const t=this.cellProperties.source;this.query=e,"function"==typeof t?t.call(this.cellProperties,e,e=>{this.rawChoices=e,this.updateChoicesList(this.stripValuesIfNeeded(e))}):Array.isArray(t)?(this.rawChoices=t,this.updateChoicesList(this.stripValuesIfNeeded(t))):this.updateChoicesList([])}updateChoicesList(e){const t=(0,a.getCaretPosition)(this.TEXTAREA),r=(0,a.getSelectionEndPosition)(this.TEXTAREA),n=this.cellProperties.sortByRelevance,s=this.cellProperties.filter;let o=null,l=null,h=e;n&&(o=this.sortByRelevance(this.stripValueIfNeeded(this.getValue()),h,this.cellProperties.filteringCaseSensitive));const u=Array.isArray(o)?o.length:0;if(!1===s)u&&(l=o[0]);else{const e=[];for(let t=0,r=h.length;t<r&&!(n&&u<=t);t++)u?e.push(h[o[t]]):e.push(h[t]);l=0,h=e}this.strippedChoices=h,0===h.length?this.htEditor.rootElement.style.display="none":this.htEditor.rootElement.style.display="",this.htEditor.loadData((0,i.pivot)([h])),h.length>0&&(this.updateDropdownDimensions(),this.flipDropdownVerticallyIfNeeded(),!0===this.cellProperties.strict&&this.highlightBestMatchingChoice(l)),this.hot.listen(),(0,a.setCaretPosition)(this.TEXTAREA,t,t===r?void 0:r)}flipDropdownVerticallyIfNeeded(){const e=super.flipDropdownVerticallyIfNeeded(),{isFlipped:t,spaceAbove:r,spaceBelow:n}=e;return this.limitDropdownIfNeeded(t?r:n),e}limitDropdownIfNeeded(e){const t=this.getDropdownHeight();if(t>e){let r=0,n=0,s=null;do{n=this.htEditor.stylesHandler.getDefaultRowHeight(),r+=n}while(r<e);s=r-n,this.isFlippedVertically&&(this.htEditor.rootElement.style.top=parseInt(this.htEditor.rootElement.style.top,10)+t-s+"px"),this.setDropdownHeight(r-n)}}updateDropdownDimensions(){const e=(0,a.getFractionalScalingCompensation)(),t=this.getTargetEditorWidth()+e,r=this.getTargetEditorHeight()+e;this.htEditor.updateSettings({width:t,height:r}),E(R,this,v).call(this),this.htEditor.view._wt.wtTable.alignOverlaysWithTrimmingContainer()}setDropdownHeight(e){this.htEditor.updateSettings({height:e}),E(R,this,v).call(this),this.htEditor.view._wt.wtTable.alignOverlaysWithTrimmingContainer()}highlightBestMatchingChoice(e){"number"==typeof e?this.htEditor.selectCell(e,0,void 0,void 0,void 0,!1):this.htEditor.deselectCell()}getTargetEditorHeight(){let e=0;if(!this.hot.getCurrentThemeName()){const t=this.hot.rootWindow.getComputedStyle(this.htContainer.querySelector(".htCore"));e=parseInt(t.borderTopWidth,10)+parseInt(t.borderBottomWidth,10)}const t=Math.min(this.cellProperties.visibleRows,this.strippedChoices.length);return Array.from({length:t},(e,t)=>t).reduce((e,t)=>e+(this.hot.stylesHandler.getDefaultRowHeight()+(0===t?1:0)),0)+e}getTargetEditorWidth(){let e=0;if(!this.hot.getCurrentThemeName()){const t=this.hot.rootWindow.getComputedStyle(this.htContainer.querySelector(".htCore"));e=parseInt(t.borderInlineStartWidth,10)+parseInt(t.borderInlineEndWidth,10)}return this.htEditor.getColWidth(0)+e}stripValueIfNeeded(e){return this.stripValuesIfNeeded([e])[0]}stripValuesIfNeeded(e){const{allowHtml:t}=this.cellProperties,r=(0,i.arrayMap)(e,e=>(0,l.stringify)(e));return(0,i.arrayMap)(r,e=>t?e:(0,h.stripTags)(e))}allowKeyEventPropagation(e){const t=this.htEditor.getSelectedRangeLast(),r=t?t.from.row:-1;let n=!1;return e===u.KEY_CODES.ARROW_DOWN&&r>0&&r<this.htEditor.countRows()-1&&(n=!0),e===u.KEY_CODES.ARROW_UP&&r>-1&&(n=!0),n}onBeforeKeyDown(e){if((0,u.isPrintableChar)(e.keyCode)||e.keyCode===u.KEY_CODES.BACKSPACE||e.keyCode===u.KEY_CODES.DELETE||e.keyCode===u.KEY_CODES.INSERT){let t=10;if(e.keyCode===u.KEY_CODES.C&&(e.ctrlKey||e.metaKey))return;this.isOpened()||(t+=10),this.htEditor&&this.hot._registerTimeout(()=>{this.queryChoices(this.TEXTAREA.value)},t)}}}function v(){this.htEditor.view.hasVerticalScroll()&&this.htEditor.updateSettings({width:this.getTargetEditorWidth()+(0,a.getScrollbarWidth)(this.hot.rootDocument)})}t.AutocompleteEditor=S},1181:()=>{},1325:(e,t,r)=>{"use strict";var n=r(25225),s=r(6996),o=r(30334),i=n(Function.toString);s(o.inspectSource)||(o.inspectSource=function(e){return i(e)}),e.exports=o.inspectSource},1872:()=>{},1995:(e,t,r)=>{"use strict";t.__esModule=!0,r(88443),r(73741),r(69326);var n=r(18158),s=r(48167);function o(e,t,r){i(e,t),t.set(e,r)}function i(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function a(e,t,r){return e.set(h(e,t),r),r}function l(e,t){return e.get(h(e,t))}function h(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}const u=t.PLUGIN_KEY="stretchColumns",c=t.PLUGIN_PRIORITY=155;var d=new WeakMap,p=new WeakMap,g=new WeakMap,f=new WeakSet;class m extends n.BasePlugin{constructor(){var e,t;super(...arguments),i(e=this,t=f),t.add(e),o(this,d,new s.StretchCalculator(this.hot)),o(this,p,null),o(this,g,new ResizeObserver(e=>{requestAnimationFrame(()=>{var t;null!==(t=this.hot)&&void 0!==t&&t.view.isHorizontallyScrollableByWindow()&&e.forEach(e=>{let{contentRect:t}=e;null!==l(p,this)&&l(p,this)!==t.width&&(this.hot.refreshDimensions(),this.hot.view.adjustElementsSize()),a(p,this,t.width)})})}))}static get PLUGIN_KEY(){return u}static get PLUGIN_PRIORITY(){return c}static get SETTING_KEYS(){return!0}isEnabled(){return["all","last"].includes(this.hot.getSettings().stretchH)}enablePlugin(){var e=this;this.enabled||(l(d,this).useStrategy(this.hot.getSettings().stretchH),l(g,this).observe(this.hot.rootElement),this.addHook("beforeRender",function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return h(f,e,w).call(e,...r)}),this.addHook("modifyColWidth",function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return h(f,e,E).call(e,...r)},10),super.enablePlugin())}updatePlugin(){l(d,this).useStrategy(this.hot.getSettings().stretchH),super.updatePlugin()}disablePlugin(){super.disablePlugin(),l(g,this).unobserve(this.hot.rootElement)}getColumnWidth(e){return l(d,this).getStretchedWidth(e)}destroy(){l(g,this).disconnect(),a(g,this,null),a(d,this,null),super.destroy()}}function E(e,t,r){if(r===this.pluginName)return;const n=this.getColumnWidth(t);return"number"==typeof n?n:e}function w(e){e&&l(d,this).refreshStretching()}t.StretchColumns=m},2149:(e,t,r)=>{"use strict";t.__esModule=!0,t.registerActions=function(e,t){[n.CellAlignmentAction,s.ColumnMoveAction,o.ColumnSortAction,i.CreateColumnAction,a.CreateRowAction,l.DataChangeAction,h.FiltersAction,u.MergeCellsAction,c.RemoveColumnAction,d.RemoveRowAction,p.RowMoveAction,g.UnmergeCellsAction].forEach(r=>r.startRegisteringEvents(e,t))};var n=r(96648),s=r(84546),o=r(26279),i=r(67927),a=r(78001),l=r(10357),h=r(96690),u=r(71796),c=r(79271),d=r(3297),p=r(64788),g=r(11223)},2151:(e,t,r)=>{"use strict";var n=r(60423);t.__esModule=!0;var s=n(r(53726)),o=r(23728);t.default=class{constructor(e,t){(0,s.default)(this,"hot",void 0),(0,s.default)(this,"nestedHeaderSettingsGetter",void 0),(0,s.default)(this,"layersCount",0),(0,s.default)(this,"container",void 0),(0,s.default)(this,"widthsMap",void 0),this.hot=e,this.nestedHeaderSettingsGetter=t,this.widthsMap=this.hot.columnIndexMapper.createAndRegisterIndexMap("nestedHeaders.widthsMap","physicalIndexToValue")}setLayersCount(e){return this.layersCount=e,this}getWidth(e){return this.widthsMap.getValueAtIndex(this.hot.toPhysicalColumn(e))}buildWidthsMap(){const e=this.hot.getCurrentThemeName();this.container=this.hot.rootDocument.createElement("div"),this.container.classList.add("handsontable","htGhostTable","htAutoSize"),e&&this.container.classList.add(e),this._buildGhostTable(this.container),this.hot.rootDocument.body.appendChild(this.container);const t=this.container.querySelectorAll("tr:last-of-type th"),r=t.length;this.widthsMap.clear();for(let e=0;e<r;e++){const r=this.hot.columnIndexMapper.getVisualFromRenderableIndex(e),n=this.hot.toPhysicalColumn(r);this.widthsMap.setValueAtIndex(n,t[e].offsetWidth)}this.container.parentNode.removeChild(this.container),this.container=null}_buildGhostTable(e){const{rootDocument:t,columnIndexMapper:r}=this.hot,n=t.createDocumentFragment(),s=t.createElement("table"),i=!!this.hot.getSettings().dropdownMenu,a=r.getRenderableIndexesLength();for(let e=0;e<this.layersCount;e++){const n=t.createElement("tr");for(let s=0;s<a;s++){let a=r.getVisualFromRenderableIndex(s);null===a&&(a=s);const l=t.createElement("th"),h=this.nestedHeaderSettingsGetter(e,a);if(h&&(!h.isPlaceholder||h.isHidden)){let e=h.label;i&&(e+='<button class="changeType"></button>'),(0,o.fastInnerHTML)(l,e),l.colSpan=h.colspan,n.appendChild(l)}}s.appendChild(n)}n.appendChild(s),e.appendChild(n)}clear(){this.widthsMap.clear(),this.container=null}}},2163:(e,t,r)=>{"use strict";var n=r(30784),s=Math.min;e.exports=function(e){var t=n(e);return t>0?s(t,9007199254740991):0}},2306:(e,t,r)=>{"use strict";t.__esModule=!0,t.default=function(e){return{key:"copy_with_column_headers",name(){const e=this.getSelectedRangeLast(),t=e?(0,s.clamp)(e.getWidth()-1,0,1):0;return this.getTranslatedPhrase(n.CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_HEADERS,t)},callback(){e.copyWithColumnHeaders()},disabled(){if(!this.hasColHeaders())return!0;const e=this.getSelectedRangeLast();if(!e)return!0;if(e.isSingleHeader())return!0;const t=this.getSelected();return!t||t.length>1},hidden:!1}};var n=r(86679),s=r(29786)},2417:(e,t,r)=>{"use strict";t.__esModule=!0,r(88443),r(85639),r(73741),r(7307),r(69326),r(90795);var n=r(23728),s=r(7244),o=r(5784),i=r(45367),a=r(23063),l=function(e,t){if("function"==typeof WeakMap)var r=new WeakMap,n=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var s,o,i={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return i;if(s=t?n:r){if(s.has(e))return s.get(e);s.set(e,i)}for(const t in e)"default"!==t&&{}.hasOwnProperty.call(e,t)&&((o=(s=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(o.get||o.set)?s(i,t,o):i[t]=e[t]);return i}(e,t)}(r(86679)),h=r(19256),u=r(21749),c=r(84689),d=r(96973),p=r(82691);function g(e,t,r){f(e,t),t.set(e,r)}function f(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function m(e,t){return e.get(w(e,t))}function E(e,t,r){return e.set(w(e,t),r),r}function w(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}const y="multipleSelect.itemBox";var C=new WeakMap,R=new WeakMap,S=new WeakMap,v=new WeakMap,T=new WeakMap,N=new WeakMap,M=new WeakSet;class _ extends u.BaseUI{static get DEFAULTS(){return(0,s.clone)({className:"htUIMultipleSelect",value:[]})}constructor(e,t){var r,n;super(e,(0,s.extend)(_.DEFAULTS,t)),f(r=this,n=M),n.add(r),g(this,C,[]),g(this,R,void 0),g(this,S,void 0),g(this,v,void 0),g(this,T,void 0),g(this,N,void 0),E(v,this,new c.InputUI(this.hot,{placeholder:l.FILTERS_BUTTONS_PLACEHOLDER_SEARCH,className:"htUIMultipleSelectSearch"})),E(T,this,new d.LinkUI(this.hot,{textContent:l.FILTERS_BUTTONS_SELECT_ALL,className:"htUISelectAll"})),E(N,this,new d.LinkUI(this.hot,{textContent:l.FILTERS_BUTTONS_CLEAR,className:"htUIClearAll"})),this.registerHooks()}getItemsBox(){return m(R,this)}registerHooks(){m(v,this).addLocalHook("keydown",e=>w(M,this,A).call(this,e)),m(v,this).addLocalHook("input",e=>w(M,this,b).call(this,e)),m(T,this).addLocalHook("click",e=>w(M,this,I).call(this,e)),m(N,this).addLocalHook("click",e=>w(M,this,O).call(this,e))}setItems(e){var t;E(C,this,e),null===(t=m(R,this))||void 0===t||t.loadData(m(C,this))}setLocale(e){E(S,this,e)}getLocale(){return m(S,this)}getItems(){return[...m(C,this)]}getValue(){return function(e){const t=[];return e.forEach(e=>{e.checked&&t.push(e.value)}),t}(m(C,this))}getSearchInputElement(){return m(v,this)}getSelectAllElement(){return m(T,this)}getClearAllElement(){return m(N,this)}isSelectedAllValues(){return m(C,this).length===this.getValue().length}build(){super.build();const{rootDocument:e}=this.hot,t=e.createElement("div"),r=new u.BaseUI(this.hot,{className:"htUISelectionControls",children:[m(T,this),m(N,this)]});this._element.appendChild(m(v,this).element),this._element.appendChild(r.element),this._element.appendChild(t);const s=t=>{var r;if(!this._element)return;null===(r=m(R,this))||void 0===r||r.destroy(),(0,n.addClass)(t,"htUIMultipleSelectHot"),E(R,this,new this.hot.constructor(t,{data:m(C,this),columns:[{data:"checked",type:"checkbox",label:{property:"visualValue",position:"after"}}],beforeRenderer:(e,t,r,n,s,o)=>{e.title=o.instance.getDataAtRowProp(t,o.label.property)},afterListen:()=>{this.runLocalHooks("focus",this)},beforeOnCellMouseUp:()=>{m(R,this).listen()},modifyColWidth:t=>{const r=m(R,this).container.scrollWidth-(0,n.getScrollbarWidth)(e);return void 0!==t&&t<r?r:t},maxCols:1,autoWrapCol:!0,height:110,copyPaste:!1,disableVisualSelection:"area",fillHandle:!1,fragmentSelection:"cell",tabMoves:{row:1,col:0},themeName:this.hot.getCurrentThemeName(),layoutDirection:this.hot.isRtl()?"rtl":"ltr"})),m(R,this).init();const s=m(R,this).getShortcutManager().getContext("grid");s.removeShortcutsByKeys(["Tab"]),s.removeShortcutsByKeys(["Shift","Tab"]),s.addShortcut({keys:[["Escape"]],callback:e=>{this.runLocalHooks("keydown",e,this)},group:y}),s.addShortcut({keys:[["Tab"],["Shift","Tab"]],callback:e=>{m(R,this).deselectCell(),this.runLocalHooks("keydown",e,this),this.runLocalHooks("listTabKeydown",e,this)},group:y})};s(t),this.hot._registerTimeout(()=>s(t),100)}focus(){this.isBuilt()&&m(R,this).listen()}reset(){m(v,this).reset(),m(T,this).reset(),m(N,this).reset()}update(){this.isBuilt()&&(m(R,this).loadData(function(e,t){const r=(0,p.createArrayAssertion)(t);return e.map(e=>(e.checked=r(e.value),e))}(m(C,this),this.options.value)),super.update())}destroy(){var e;null===(e=m(R,this))||void 0===e||e.destroy(),m(v,this).destroy(),m(N,this).destroy(),m(T,this).destroy(),E(v,this,null),E(N,this,null),E(T,this,null),E(R,this,null),E(C,this,null),super.destroy()}}function b(e){const t=e.target.value.toLocaleLowerCase(this.getLocale());let r;r=""===t?[...m(C,this)]:m(C,this).filter(e=>`${e.value}`.toLocaleLowerCase(this.getLocale()).indexOf(t)>=0),m(R,this).loadData(r)}function A(e){this.runLocalHooks("keydown",e,this);(0,i.partial)(o.isKey,e.keyCode)("ARROW_DOWN")&&(e.preventDefault(),(0,h.stopImmediatePropagation)(e),m(R,this).listen(),m(R,this).selectCell(0,0))}function I(e){const t=[];e.preventDefault(),m(R,this).getSourceData().forEach((e,r)=>{e.checked=!0,t.push((0,a.dataRowToChangesArray)(e,r)[0])}),m(R,this).setSourceDataAtCell(t)}function O(e){const t=[];e.preventDefault(),m(R,this).getSourceData().forEach((e,r)=>{e.checked=!1,t.push((0,a.dataRowToChangesArray)(e,r)[0])}),m(R,this).setSourceDataAtCell(t)}t.MultipleSelectUI=_;t.default=_},2509:()=>{},2527:()=>{},2598:(e,t,r)=>{"use strict";t.__esModule=!0,t.getOperationFunc=function(e){if(!n[e])throw Error(`Operation with id "${e}" does not exist.`);const t=n[e].func;return function(e,r){return t(e,r)}},t.getOperationName=function(e){return n[e].name},t.registerOperation=function(e,t,r){n[e]={name:t,func:r}},r(88443);const n=t.operations={}},2732:()=>{},2737:(e,t,r)=>{"use strict";var n=r(19895),s=r(53385),o=r(92754)("match");e.exports=function(e){var t;return n(e)&&(void 0!==(t=e[o])?!!t:"RegExp"===s(e))}},2760:(e,t,r)=>{"use strict";var n=r(60423);t.__esModule=!0,r(73741),r(90795);var s=n(r(53726)),o=r(7244),i=r(51398),a=r(15876);const l=["sortEmptyCells","indicator","headerAction","compareFunctionFactory"];t.ColumnStatesManager=class{constructor(e,t){(0,s.default)(this,"hot",void 0),(0,s.default)(this,"sortingStates",new i.LinkedPhysicalIndexToValueMap),(0,s.default)(this,"sortEmptyCells",false),(0,s.default)(this,"indicator",true),(0,s.default)(this,"headerAction",true),(0,s.default)(this,"compareFunctionFactory",void 0),(0,s.default)(this,"mapName",void 0),this.hot=e,this.mapName=t,this.hot.columnIndexMapper.registerMap(t,this.sortingStates)}updateAllColumnsProperties(e){(0,o.isObject)(e)&&(0,o.objectEach)(e,(e,t)=>{l.includes(t)&&(this[t]=e)})}getAllColumnsProperties(){const e={sortEmptyCells:this.sortEmptyCells,indicator:this.indicator,headerAction:this.headerAction};return"function"==typeof this.compareFunctionFactory&&(e.compareFunctionFactory=this.compareFunctionFactory),e}getSortOrderOfColumn(e){var t;return null===(t=this.sortingStates.getValueAtIndex(this.hot.toPhysicalColumn(e)))||void 0===t?void 0:t.sortOrder}getIndexOfColumnInSortQueue(e){return e=this.hot.toPhysicalColumn(e),this.sortingStates.getEntries().findIndex(t=>{let[r]=t;return r===e})}getNumberOfSortedColumns(){return this.sortingStates.getLength()}isListOfSortedColumnsEmpty(){return 0===this.getNumberOfSortedColumns()}isColumnSorted(e){return(0,o.isObject)(this.sortingStates.getValueAtIndex(this.hot.toPhysicalColumn(e)))}getSortStates(){if(null===this.sortingStates)return[];return this.sortingStates.getEntries().map(e=>{let[t,r]=e;return{column:this.hot.toVisualColumn(t),...r}})}getColumnSortState(e){const t=this.getSortOrderOfColumn(e);if((0,a.isDefined)(t))return{column:e,sortOrder:t}}setSortStates(e){this.sortingStates.clear();for(let t=0;t<e.length;t+=1)this.sortingStates.setValueAtIndex(this.hot.toPhysicalColumn(e[t].column),{sortOrder:e[t].sortOrder})}destroy(){this.hot.columnIndexMapper.unregisterMap(this.mapName),this.sortingStates=null}}},2943:()=>{},2955:(e,t,r)=>{"use strict";t.__esModule=!0,r(85639);var n=r(4391),s=r(7894);class o extends n.PhysicalIndexToValueMap{constructor(){super(arguments.length>0&&void 0!==arguments[0]&&arguments[0])}getHiddenIndexes(){return(0,s.arrayReduce)(this.getValues(),(e,t,r)=>(t&&e.push(r),e),[])}}t.HidingMap=o},3011:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(37816);t.PLUGIN_KEY=n.PLUGIN_KEY,t.PLUGIN_PRIORITY=n.PLUGIN_PRIORITY,t.AutoColumnSize=n.AutoColumnSize},3034:(e,t,r)=>{"use strict";var n=r(10028);e.exports=n("document","documentElement")},3235:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(8638);t.VALIDATOR_TYPE=n.VALIDATOR_TYPE,t.timeValidator=n.timeValidator},3297:(e,t,r)=>{"use strict";var n=r(60423);t.__esModule=!0,r(85639),r(73741),r(69326);var s=n(r(53726)),o=r(26897),i=r(6784),a=r(7244);class l extends o.BaseAction{constructor(e){let{index:t,data:r,fixedRowsBottom:n,fixedRowsTop:o,rowIndexesSequence:i,removedCellMetas:a}=e;super("remove_row"),(0,s.default)(this,"index",void 0),(0,s.default)(this,"data",void 0),(0,s.default)(this,"fixedRowsBottom",void 0),(0,s.default)(this,"fixedRowsTop",void 0),(0,s.default)(this,"rowIndexesSequence",void 0),(0,s.default)(this,"removedCellMetas",void 0),this.index=t,this.data=r,this.fixedRowsBottom=n,this.fixedRowsTop=o,this.rowIndexesSequence=i,this.removedCellMetas=a}static startRegisteringEvents(e,t){e.addHook("beforeRemoveRow",(r,n,s,o)=>{t.done(()=>{const t=e.toPhysicalRow(r),s=t+n-1,o=(0,a.deepClone)(e.getSourceData(t,0,t+n-1,e.countSourceCols()-1));return new l({index:t,data:o,fixedRowsBottom:e.getSettings().fixedRowsBottom,fixedRowsTop:e.getSettings().fixedRowsTop,rowIndexesSequence:e.rowIndexMapper.getIndexesSequence(),removedCellMetas:(0,i.getCellMetas)(e,t,s,0,e.countCols()-1)})},o)})}undo(e,t){const r=e.getSettings(),n=[];r.fixedRowsBottom=this.fixedRowsBottom,r.fixedRowsTop=this.fixedRowsTop,this.data.forEach((e,t)=>{Object.keys(e).forEach(r=>{const s=parseInt(r,10);n.push([this.index+t,isNaN(s)?r:s,e[r]])})}),e.rowIndexMapper.setIndexesSequence(this.rowIndexesSequence),e.alter("insert_row_above",e.toVisualRow(this.index),this.data.length,"UndoRedo.undo"),e.rowIndexMapper.setIndexesSequence(this.rowIndexesSequence),this.removedCellMetas.forEach(t=>{let[r,n,s]=t;e.setCellMetaObject(r,n,s)}),e.addHookOnce("afterViewRender",t),e.setSourceDataAtCell(n,null,null,"UndoRedo.undo")}redo(e,t){e.addHookOnce("afterRemoveRow",t),e.alter("remove_row",e.toVisualRow(this.index),this.data.length,"UndoRedo.redo")}}t.RemoveRowAction=l},3344:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(65017),s=r(22313),o=r(71723);const i=t.CELL_TYPE="dropdown";t.DropdownCellType={CELL_TYPE:i,editor:n.DropdownEditor,renderer:s.dropdownRenderer,validator:o.dropdownValidator,filter:!1,strict:!0}},3474:(e,t,r)=>{"use strict";t.__esModule=!0,t.assert=function(e,t){if(!e())throw new Error(`Assertion failed: ${t}`)},t.columnFactory=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];function r(){}(0,n.inherit)(r,e);for(let e=0;e<t.length;e++)r.prototype[t[e]]=void 0;return r},t.extendByMetaType=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e;const o="string"==typeof t.type?(0,s.getCellType)(t.type):t.type;e._automaticallyAssignedMetaProps&&(0,n.objectEach)(t,(t,r)=>{e._automaticallyAssignedMetaProps.delete(r)});if(!(0,n.isObject)(o))return;r!==e||e._automaticallyAssignedMetaProps||(e._automaticallyAssignedMetaProps=new Set);const i={};(0,n.objectEach)(o,(t,s)=>{var o;(function(e,t){var r;if("CELL_TYPE"===e)return!1;return(null===(r=t._automaticallyAssignedMetaProps)||void 0===r?void 0:r.has(e))||!(0,n.hasOwnProperty)(t,e)})(s,r)&&(i[s]=t,null===(o=e._automaticallyAssignedMetaProps)||void 0===o||o.add(s))}),(0,n.extend)(e,i)},t.isNullish=function(e){return null==e},t.isUnsignedNumber=function(e){return Number.isInteger(e)&&e>=0},r(88443),r(62705),r(78495),r(43554),r(15247),r(18472),r(89711),r(78675);var n=r(7244),s=r(45632)},3490:(e,t,r)=>{"use strict";t.__esModule=!0,t.isContextObject=u,r(88443),r(85639),r(73741),r(7307),r(69326);var n=r(20877),s=r(65584),o=r(15876),i=r(45367),a=r(7244),l=r(67804);const h=Symbol("shortcut-context");function u(e){return(0,a.isObject)(e)&&e.__kindOf===h}t.createContext=e=>{const t=(0,n.createUniqueMap)({errorIdExists:t=>`The "${t}" shortcut is already registered in the "${e}" context.`}),r=function(){let{keys:e,callback:r,group:n,runOnlyIf:a=()=>!0,captureCtrl:h=!1,preventDefault:c=!0,stopPropagation:d=!1,relativeToGroup:p,position:g,forwardToContext:f}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if((0,o.isUndefined)(n))throw new Error("You need to define the shortcut's group.");if(!1===(0,i.isFunction)(r))throw new Error("The shortcut's callback needs to be a function.");if(!1===Array.isArray(e))throw new Error(l.toSingleLine`Pass the shortcut\'s keys as an array of arrays,\x20 using the KeyboardEvent.key properties:\x20 https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values.`);const m={callback:r,group:n,runOnlyIf:a,captureCtrl:h,preventDefault:c,stopPropagation:d};(0,o.isDefined)(p)&&(m.relativeToGroup=p,m.position=g),u(f)&&(m.forwardToContext=f),e.forEach(e=>{const r=(0,s.normalizeKeys)(e);if(t.hasItem(r)){const e=t.getItem(r);let n=e.findIndex(e=>e.group===p);-1!==n?"before"===g?n-=1:n+=1:n=e.length,e.splice(n,0,m)}else t.addItem(r,[m])})},c=e=>{const r=(0,s.normalizeKeys)(e);t.removeItem(r)};return{__kindOf:h,addShortcut:r,addShortcuts:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.forEach(e=>{(0,a.objectEach)(t,(r,n)=>{!1===Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=t[n])}),r(e)})},getShortcuts:e=>{const r=(0,s.normalizeKeys)(e),n=t.getItem(r);return(0,o.isDefined)(n)?n.slice():[]},hasShortcut:e=>{const r=(0,s.normalizeKeys)(e);return t.hasItem(r)},removeShortcutsByKeys:c,removeShortcutsByGroup:e=>{t.getItems().forEach(t=>{let[r,n]=t;const o=n.filter(t=>t.group!==e);0===o.length?c((0,s.getKeysList)(r)):(n.length=0,n.push(...o))})}}}},3538:()=>{},3732:e=>{function t(){}t.prototype={on:function(e,t,r){var n=this.e||(this.e={});return(n[e]||(n[e]=[])).push({fn:t,ctx:r}),this},once:function(e,t,r){var n=this;function s(){n.off(e,s),t.apply(r,arguments)}return s._=t,this.on(e,s,r)},emit:function(e){for(var t=[].slice.call(arguments,1),r=((this.e||(this.e={}))[e]||[]).slice(),n=0,s=r.length;n<s;n++)r[n].fn.apply(r[n].ctx,t);return this},off:function(e,t){var r=this.e||(this.e={}),n=r[e],s=[];if(n&&t)for(var o=0,i=n.length;o<i;o++)n[o].fn!==t&&n[o].fn._!==t&&s.push(n[o]);return s.length?r[e]=s:delete r[e],this}},e.exports=t,e.exports.TinyEmitter=t},3781:(e,t,r)=>{"use strict";var n=r(60423);t.__esModule=!0,r(88443),r(85639),r(73741),r(69326);var s=n(r(53726)),o=r(23728),i=r(29786),a=r(67804),l=r(19256),h=r(61906),u=r(72380),c=r(18158),d=n(r(58783)),p=n(r(2151));function g(e,t,r){f(e,t),t.set(e,r)}function f(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function m(e,t,r){return e.set(w(e,t),r),r}function E(e,t){return e.get(w(e,t))}function w(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}const y=t.PLUGIN_KEY="nestedHeaders",C=t.PLUGIN_PRIORITY=280;var R=new WeakMap,S=new WeakMap,v=new WeakMap,T=new WeakMap,N=new WeakMap,M=new WeakSet;class _ extends c.BasePlugin{constructor(){var e,t;super(...arguments),f(e=this,t=M),t.add(e),g(this,R,new d.default),g(this,S,null),g(this,v,null),g(this,T,!1),g(this,N,null),(0,s.default)(this,"ghostTable",new p.default(this.hot,(e,t)=>this.getHeaderSettings(e,t))),(0,s.default)(this,"detectedOverlappedHeaders",!1)}static get PLUGIN_KEY(){return y}static get PLUGIN_PRIORITY(){return C}isEnabled(){return!!this.hot.getSettings()[y]}enablePlugin(){var e=this;if(this.enabled)return;const{nestedHeaders:t}=this.hot.getSettings();Array.isArray(t)&&Array.isArray(t[0])||(0,h.warn)(a.toSingleLine`Your Nested Headers plugin configuration is invalid. The settings has to be\x20 passed as an array of arrays e.q. [['A1', { label: 'A2', colspan: 2 }]]`),this.addHook("init",()=>w(M,this,G).call(this)),this.addHook("afterLoadData",function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return w(M,e,j).call(e,...r)}),this.addHook("beforeOnCellMouseDown",function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return w(M,e,x).call(e,...r)}),this.addHook("afterOnCellMouseDown",function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return w(M,e,P).call(e,...r)}),this.addHook("beforeOnCellMouseOver",function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return w(M,e,L).call(e,...r)}),this.addHook("beforeOnCellMouseUp",function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return w(M,e,D).call(e,...r)}),this.addHook("beforeSelectionHighlightSet",function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return w(M,e,k).call(e,...r)}),this.addHook("modifyTransformStart",function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return w(M,e,H).call(e,...r)}),this.addHook("afterSelection",()=>w(M,this,b).call(this)),this.addHook("afterSelectionFocusSet",()=>w(M,this,b).call(this)),this.addHook("beforeViewportScrollHorizontally",function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return w(M,e,A).call(e,...r)}),this.addHook("afterGetColumnHeaderRenderers",e=>w(M,this,U).call(this,e)),this.addHook("modifyColWidth",function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return w(M,e,B).call(e,...r)}),this.addHook("modifyColumnHeaderValue",function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return w(M,e,W).call(e,...r)}),this.addHook("beforeHighlightingColumnHeader",function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return w(M,e,I).call(e,...r)}),this.addHook("beforeCopy",function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return w(M,e,O).call(e,...r)}),this.addHook("beforeSelectColumns",function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return w(M,e,F).call(e,...r)}),this.addHook("afterViewportColumnCalculatorOverride",function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return w(M,e,V).call(e,...r)}),this.addHook("modifyFocusedElement",function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return w(M,e,Y).call(e,...r)}),this.hot.columnIndexMapper.addLocalHook("cacheUpdated",()=>w(M,this,b).call(this)),this.hot.rowIndexMapper.addLocalHook("cacheUpdated",()=>w(M,this,b).call(this)),super.enablePlugin(),this.updatePlugin()}updatePlugin(){if(!this.hot.view)return;const{nestedHeaders:e}=this.hot.getSettings();E(R,this).setColumnsLimit(this.hot.countCols()),Array.isArray(e)&&(this.detectedOverlappedHeaders=E(R,this).setState(e)),this.detectedOverlappedHeaders&&(0,h.warn)(a.toSingleLine`Your Nested Headers plugin setup contains overlapping headers. This kind of configuration\x20 is currently not supported.`),this.enabled&&this.hot.columnIndexMapper.hidingMapsCollection.getMergedValues().forEach((e,t)=>{const r=!0===e?"hide-column":"show-column";E(R,this).triggerColumnModification(r,t)}),!E(S,this)&&this.enabled&&m(S,this,this.hot.columnIndexMapper.createChangesObserver("hiding").subscribe(e=>{e.forEach(e=>{let{op:t,index:r,newValue:n}=e;if("replace"===t){const e=!0===n?"hide-column":"show-column";E(R,this).triggerColumnModification(e,r)}}),this.ghostTable.buildWidthsMap()})),this.ghostTable.setLayersCount(this.getLayersCount()).buildWidthsMap(),super.updatePlugin()}disablePlugin(){this.clearColspans(),E(R,this).clear(),E(S,this).unsubscribe(),m(S,this,null),this.ghostTable.clear(),super.disablePlugin()}getStateManager(){return E(R,this)}getLayersCount(){return E(R,this).getLayersCount()}getHeaderSettings(e,t){return E(R,this).getHeaderSettings(e,t)}clearColspans(){if(!this.hot.view)return;const{_wt:e}=this.hot.view,t=e.getSetting("columnHeaders").length,r=e.wtTable.THEAD,n=e.wtOverlays.topOverlay.clone.wtTable.THEAD,s=e.wtOverlays.topInlineStartCornerOverlay?e.wtOverlays.topInlineStartCornerOverlay.clone.wtTable.THEAD:null;for(let e=0;e<t;e++){const t=r.childNodes[e];if(!t)break;const i=n.childNodes[e],a=s?s.childNodes[e]:null;for(let e=0,r=t.childNodes.length;e<r;e++)t.childNodes[e].removeAttribute("colspan"),(0,o.removeClass)(t.childNodes[e],"hiddenHeader"),i&&i.childNodes[e]&&(i.childNodes[e].removeAttribute("colspan"),(0,o.removeClass)(i.childNodes[e],"hiddenHeader")),s&&a&&a.childNodes[e]&&(a.childNodes[e].removeAttribute("colspan"),(0,o.removeClass)(a.childNodes[e],"hiddenHeader"))}}headerRendererFactory(e){var t=this;const r=this.hot.view._wt.getSetting("fixedColumnsStart");return(n,s)=>{var i;const{columnIndexMapper:a,view:l}=this.hot;let h=a.getVisualFromRenderableIndex(n);null===h&&(h=n),s.removeAttribute("colspan"),(0,o.removeClass)(s,"hiddenHeader"),(0,o.removeClass)(s,"hiddenHeaderText");const{colspan:u,isHidden:c,isPlaceholder:d,headerClassNames:p}=null!==(i=E(R,this).getHeaderSettings(e,h))&&void 0!==i?i:{label:""};if(d||c)(0,o.addClass)(s,"hiddenHeader");else if(u>1){var g,f,m;const{wtOverlays:e}=l._wt,t=null===(g=e.topInlineStartCornerOverlay)||void 0===g?void 0:g.clone.wtTable.THEAD.contains(s),i=null===(f=e.inlineStartOverlay)||void 0===f?void 0:f.clone.wtTable.THEAD.contains(s);(null===(m=e.topOverlay)||void 0===m?void 0:m.clone.wtTable.THEAD.contains(s))&&h<r&&(0,o.addClass)(s,"hiddenHeaderText");const a=t||i?Math.min(u,r-n):u;a>1&&s.setAttribute("colspan",a)}if(this.hot.view.appendColHeader(h,s,function(){return t.getColumnHeaderValue(...arguments)},e),!d&&!c){const e=s.querySelector("div.relative");e&&p&&p.length>0&&((0,o.removeClass)(e,this.hot.getColumnMeta(h).headerClassName),(0,o.addClass)(e,p))}}}getColumnHeaderValue(e,t){var r;const{isHidden:n,isPlaceholder:s}=null!==(r=E(R,this).getHeaderSettings(t,e))&&void 0!==r?r:{};return s||n?"":this.hot.getColHeader(e,t)}destroy(){m(R,this,null),null!==E(S,this)&&(E(S,this).unsubscribe(),m(S,this,null)),super.destroy()}_getHeaderTreeNodeDataByCoords(e){if(!(e.row>=0||e.col<0))return E(R,this).getHeaderTreeNodeData(e.row,e.col)}}function b(){var e;const t=null===(e=this.hot)||void 0===e?void 0:e.getSelectedRangeLast();if(!t)return;const{highlight:r}=t;if(r.isHeader()&&r.col>=0){const e=E(R,this).findLeftMostColumnIndex(r.row,r.col),t=this.hot.selection.highlight.getFocus();t.visualCellRange.highlight.col=e,t.visualCellRange.from.col=e,t.visualCellRange.to.col=e,t.commit()}}function A(e,t){var r;const n=this.hot.getSelectedRangeLast();if(!n)return e;const{highlight:s}=n,{navigableHeaders:o}=this.hot.getSettings(),i=this.hot.selection.isSelectedByColumnHeader(),a=o?s.row:null===(r=E(N,this))||void 0===r?void 0:r.row,l=i?e:s.col,h=a<0&&l>=0;if(m(N,this,null),!h)return e;const u=this.hot.getFirstFullyVisibleColumn(),c=this.hot.getLastFullyVisibleColumn(),d=c-u+1,p=E(R,this).findLeftMostColumnIndex(a,l),g=E(R,this).findRightMostColumnIndex(a,l),f=g-p+1;if(p<u&&g>c)return p;if(i){let e=null;return p>=u&&g>c?f>d?(t.value="start",e=p):(t.value="end",e=g):p<u&&g<=c&&(f>d?(t.value="end",e=g):(t.value="start",e=p)),e}return p<=u?p:g}function I(e,t,r){const n=E(R,this).getHeaderTreeNodeData(t,e);if(!n)return e;const{columnCursor:s,selectionType:o,selectionWidth:i}=r,{isRoot:a,colspan:l}=E(R,this).getHeaderSettings(t,e);if(o===u.HEADER_TYPE){if(!a)return n.columnIndex}else if(o===u.ACTIVE_HEADER_TYPE&&(l>i-s||!a))return null;return e}function O(e,t,r){let{columnHeadersCount:n}=r;if(0!==n)for(let r=0;r<t.length;r++){const{startRow:n,startCol:o,endRow:i,endCol:a}=t[r],l=i-n+1;if(n>=0||1===o-a+1)break;for(let t=o;t<=a;t++)for(let r=n;r<=i;r++){var s;const n=l+r,i=t-o;if(0===i)continue;!1===(null===(s=E(R,this).getHeaderTreeNodeData(r,t))||void 0===s?void 0:s.isRoot)&&(e[n][i]="")}}}function x(e,t,r,n){this._getHeaderTreeNodeDataByCoords(t)&&(n.column=!0)}function P(e,t){const r=this._getHeaderTreeNodeDataByCoords(t);if(!r)return;m(v,this,t.clone()),m(T,this,!0);const{selection:n}=this.hot,s=n.isSelected()?n.getSelectedRange().current():null,o=[],{columnIndex:i,origColspan:a}=r,h=!n.inInSelection(t);e.shiftKey&&s?t.col<s.from.col?o.push(s.getTopEndCorner().col,i,t.row):t.col>s.from.col?o.push(s.getTopStartCorner().col,i+a-1,t.row):o.push(i,i+a-1,t.row):((0,l.isLeftClick)(e)||(0,l.isRightClick)(e)&&h||(0,l.isTouchEvent)(e))&&o.push(i,i+a-1,t.row),n.selectColumns(...o)