adminizer 4.3.0-build.76 → 4.3.0-build.78
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/add-DSapOiv0.js +1 -0
- package/assets/add-form-C04ZI5LT.js +1 -0
- package/assets/add-group-DWR7SBTO.js +1 -0
- package/assets/add-group-form-CyRwxTs3.js +1 -0
- package/assets/add-user-acATGxUL.js +1 -0
- package/assets/add-user-form-yp020h4r.js +1 -0
- package/assets/app-layout-BmT5KQwc.js +1 -0
- package/assets/app-shell-xEVbINZV.js +1 -0
- package/assets/app-sidebar-4lm9f_CG.js +1 -0
- package/assets/app-sidebar-header-CxXmzszq.js +1 -0
- package/assets/app.js +1640 -5786
- package/assets/breadcrumbs-livOfa2Z.js +1 -0
- package/assets/catalog-CG_EB2kz.js +6 -0
- package/assets/dashboard-CsmJfdLb.js +3 -0
- package/assets/date-picker-By3kj-Rx.js +1 -0
- package/assets/del-modal-DlcbcdR5.js +1 -0
- package/assets/dynamic-controls-PxBg8yMz.js +1 -0
- package/assets/{field-renderer-BP9UmRzN.js → field-renderer-Bp1lfm0v.js} +136 -136
- package/assets/form-CSTeMDf5.js +1 -0
- package/assets/form-CxHRGp7p.js +1 -0
- package/assets/geo-json-CCgjEQfu.js +4 -0
- package/assets/handsontable-D6MvFmcM.js +281 -0
- package/assets/home-D00XjLjD.js +2 -0
- package/assets/icon-ButfCBrt.js +1 -0
- package/assets/init-user-L-oxFTOv.js +1 -0
- package/assets/input-error-CHsDLcK0.js +1 -0
- package/assets/jsoneditor-CBqATVR0.js +3833 -0
- package/assets/list-4TOTsjqE.js +1 -0
- package/assets/list-table-vIvydJV2.js +22 -0
- package/assets/login-DLMJ6l_r.js +1 -0
- package/assets/manifest.json +298 -108
- package/assets/material-icon-sXk4BK-N.js +1 -0
- package/assets/media-manager-ASGJ4PcS.js +14 -0
- package/assets/module-mxngd2cA.js +1 -0
- package/assets/monaco-B1uVVM7f.js +11 -0
- package/assets/nav-footer-DbGCtmmN.js +1 -0
- package/assets/nav-main-BcWhl71g.js +1 -0
- package/assets/nav-user-BN2veV3l.js +1 -0
- package/assets/notification-BEfA5sT6.js +1 -0
- package/assets/pagination-render-BceTnewI.js +1 -0
- package/assets/register-C_W_hOmq.js +1 -0
- package/assets/tabs-CgZW_LLn.js +1 -0
- package/assets/theme-switcher-D1G6OSMc.js +1 -0
- package/assets/toast-editor-CfgZXoQZ.js +845 -0
- package/assets/user-info-BrWerGLc.js +1 -0
- package/assets/user-menu-content-D61_auxX.js +1 -0
- package/assets/vendor-DoC2WAmd.js +17 -0
- package/assets/welcome-FHRCdke0.js +1 -0
- package/package.json +1 -1
- package/ui/components/VanillaJSONEditor.d.ts +2 -0
- package/ui/components/VanillaJSONEditor.js +101 -0
- package/ui/components/handsontable.d.ts +10 -0
- package/ui/components/handsontable.js +51 -0
- package/ui/components/monaco-editor.d.ts +11 -0
- package/ui/components/monaco-editor.js +57 -0
- package/ui/hooks/form-state.d.ts +4 -0
- package/ui/hooks/form-state.js +45 -0
- package/ui/hooks/use-appearance.d.ts +7 -0
- package/ui/hooks/use-appearance.js +76 -0
- package/ui/hooks/use-window-size.d.ts +5 -0
- package/ui/hooks/use-window-size.js +21 -0
- package/assets/add-CCznNk7p.js +0 -1
- package/assets/add-form-Cujvebyq.js +0 -1
- package/assets/add-group-KxM-aCt4.js +0 -1
- package/assets/add-group-form-BrDR-i0l.js +0 -1
- package/assets/add-user-form-CrfboTix.js +0 -1
- package/assets/add-user-uiWxY8Il.js +0 -1
- package/assets/app-layout-DlouPwk2.js +0 -1
- package/assets/app-shell-B969C0PB.js +0 -1
- package/assets/app-sidebar-DBaEEAgj.js +0 -1
- package/assets/app-sidebar-header-DAKTYE0g.js +0 -1
- package/assets/breadcrumbs-DHQ3AkEO.js +0 -1
- package/assets/catalog-Dt5pVGyH.js +0 -6
- package/assets/dashboard-SxHpjYT5.js +0 -3
- package/assets/date-picker--zSt9NKp.js +0 -1
- package/assets/del-modal-B73-X7Bm.js +0 -1
- package/assets/dynamic-controls-CSVVCONh.js +0 -1
- package/assets/form-NLJGRnF1.js +0 -1
- package/assets/form-lSJpGHTy.js +0 -1
- package/assets/geo-json-Dq8ViYH4.js +0 -4
- package/assets/home-C5a2kMDP.js +0 -2
- package/assets/icon-BbhNOU2o.js +0 -1
- package/assets/init-user--zYviDj5.js +0 -1
- package/assets/input-error-1aQ9bwyz.js +0 -1
- package/assets/list-D-3gH3Qy.js +0 -1
- package/assets/list-table-D6PqwSh1.js +0 -22
- package/assets/login-BQhUl8bB.js +0 -1
- package/assets/material-icon-8nTeT-mJ.js +0 -1
- package/assets/media-manager-D1nqMyHv.js +0 -14
- package/assets/module-DvUc6HiL.js +0 -1
- package/assets/nav-footer-xpg-_O5z.js +0 -1
- package/assets/nav-main-FLS_mh3K.js +0 -1
- package/assets/nav-user-CfXR0Kcu.js +0 -1
- package/assets/notification-DsrY4egH.js +0 -1
- package/assets/pagination-render-rZ5_6g0n.js +0 -1
- package/assets/register-DQ_hsYCS.js +0 -1
- package/assets/tabs-DD2mZktY.js +0 -1
- package/assets/theme-switcher-BKpJx2Op.js +0 -1
- package/assets/toast-editor-CexR_aza.js +0 -845
- package/assets/user-info-obJxhBMF.js +0 -1
- package/assets/user-menu-content-Bs0bmqDB.js +0 -1
- package/assets/welcome-DOcJbFZS.js +0 -1
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
import{e as Dt}from"./monaco-B1uVVM7f.js";import{a as A$,g as H$,c as WT}from"./vendor-DoC2WAmd.js";var N$=A$();const zH=H$(N$);var BT={},ic,jT;function on(){if(jT)return ic;jT=1;var t=function(e){return e&&e.Math===Math&&e};return ic=t(typeof globalThis=="object"&&globalThis)||t(typeof window=="object"&&window)||t(typeof self=="object"&&self)||t(typeof WT=="object"&&WT)||t(typeof ic=="object"&&ic)||function(){return this}()||Function("return this")(),ic}var Fp={},Vp,UT;function Cn(){return UT||(UT=1,Vp=function(t){try{return!!t()}catch{return!0}}),Vp}var Wp,zT;function Kr(){if(zT)return Wp;zT=1;var t=Cn();return Wp=!t(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),Wp}var Bp,YT;function Fm(){if(YT)return Bp;YT=1;var t=Cn();return Bp=!t(function(){var e=(function(){}).bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),Bp}var jp,GT;function sn(){if(GT)return jp;GT=1;var t=Fm(),e=Function.prototype.call;return jp=t?e.bind(e):function(){return e.apply(e,arguments)},jp}var Up={},qT;function D$(){if(qT)return Up;qT=1;var t={}.propertyIsEnumerable,e=Object.getOwnPropertyDescriptor,n=e&&!t.call({1:2},1);return Up.f=n?function(i){var o=e(this,i);return!!o&&o.enumerable}:t,Up}var zp,KT;function Vm(){return KT||(KT=1,zp=function(t,e){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:e}}),zp}var Yp,XT;function Kt(){if(XT)return Yp;XT=1;var t=Fm(),e=Function.prototype,n=e.call,r=t&&e.bind.bind(n,n);return Yp=t?r:function(i){return function(){return n.apply(i,arguments)}},Yp}var Gp,ZT;function fl(){if(ZT)return Gp;ZT=1;var t=Kt(),e=t({}.toString),n=t("".slice);return Gp=function(r){return n(e(r),8,-1)},Gp}var qp,QT;function k$(){if(QT)return qp;QT=1;var t=Kt(),e=Cn(),n=fl(),r=Object,i=t("".split);return qp=e(function(){return!r("z").propertyIsEnumerable(0)})?function(o){return n(o)==="String"?i(o,""):r(o)}:r,qp}var Kp,JT;function BS(){return JT||(JT=1,Kp=function(t){return t==null}),Kp}var Xp,e_;function sd(){if(e_)return Xp;e_=1;var t=BS(),e=TypeError;return Xp=function(n){if(t(n))throw new e("Can't call method on "+n);return n},Xp}var Zp,t_;function ad(){if(t_)return Zp;t_=1;var t=k$(),e=sd();return Zp=function(n){return t(e(n))},Zp}var Qp,n_;function an(){if(n_)return Qp;n_=1;var t=typeof document=="object"&&document.all;return Qp=typeof t>"u"&&t!==void 0?function(e){return typeof e=="function"||e===t}:function(e){return typeof e=="function"},Qp}var Jp,r_;function Xr(){if(r_)return Jp;r_=1;var t=an();return Jp=function(e){return typeof e=="object"?e!==null:t(e)},Jp}var ew,i_;function Vu(){if(i_)return ew;i_=1;var t=on(),e=an(),n=function(r){return e(r)?r:void 0};return ew=function(r,i){return arguments.length<2?n(t[r]):t[r]&&t[r][i]},ew}var tw,o_;function ld(){if(o_)return tw;o_=1;var t=Kt();return tw=t({}.isPrototypeOf),tw}var nw,s_;function Wm(){if(s_)return nw;s_=1;var t=on(),e=t.navigator,n=e&&e.userAgent;return nw=n?String(n):"",nw}var rw,a_;function L$(){if(a_)return rw;a_=1;var t=on(),e=Wm(),n=t.process,r=t.Deno,i=n&&n.versions||r&&r.version,o=i&&i.v8,s,a;return o&&(s=o.split("."),a=s[0]>0&&s[0]<4?1:+(s[0]+s[1])),!a&&e&&(s=e.match(/Edge\/(\d+)/),(!s||s[1]>=74)&&(s=e.match(/Chrome\/(\d+)/),s&&(a=+s[1]))),rw=a,rw}var iw,l_;function jS(){if(l_)return iw;l_=1;var t=L$(),e=Cn(),n=on(),r=n.String;return iw=!!Object.getOwnPropertySymbols&&!e(function(){var i=Symbol("symbol detection");return!r(i)||!(Object(i)instanceof Symbol)||!Symbol.sham&&t&&t<41}),iw}var ow,u_;function YH(){if(u_)return ow;u_=1;var t=jS();return ow=t&&!Symbol.sham&&typeof Symbol.iterator=="symbol",ow}var sw,c_;function US(){if(c_)return sw;c_=1;var t=Vu(),e=an(),n=ld(),r=YH(),i=Object;return sw=r?function(o){return typeof o=="symbol"}:function(o){var s=t("Symbol");return e(s)&&n(s.prototype,i(o))},sw}var aw,h_;function Bm(){if(h_)return aw;h_=1;var t=String;return aw=function(e){try{return t(e)}catch{return"Object"}},aw}var lw,d_;function dr(){if(d_)return lw;d_=1;var t=an(),e=Bm(),n=TypeError;return lw=function(r){if(t(r))return r;throw new n(e(r)+" is not a function")},lw}var uw,f_;function ud(){if(f_)return uw;f_=1;var t=dr(),e=BS();return uw=function(n,r){var i=n[r];return e(i)?void 0:t(i)},uw}var cw,g_;function $$(){if(g_)return cw;g_=1;var t=sn(),e=an(),n=Xr(),r=TypeError;return cw=function(i,o){var s,a;if(o==="string"&&e(s=i.toString)&&!n(a=t(s,i))||e(s=i.valueOf)&&!n(a=t(s,i))||o!=="string"&&e(s=i.toString)&&!n(a=t(s,i)))return a;throw new r("Can't convert object to primitive value")},cw}var hw={exports:{}},dw,m_;function Gs(){return m_||(m_=1,dw=!1),dw}var fw,p_;function zS(){if(p_)return fw;p_=1;var t=on(),e=Object.defineProperty;return fw=function(n,r){try{e(t,n,{value:r,configurable:!0,writable:!0})}catch{t[n]=r}return r},fw}var w_;function YS(){if(w_)return hw.exports;w_=1;var t=Gs(),e=on(),n=zS(),r="__core-js_shared__",i=hw.exports=e[r]||n(r,{});return(i.versions||(i.versions=[])).push({version:"3.42.0",mode:t?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.42.0/LICENSE",source:"https://github.com/zloirock/core-js"}),hw.exports}var gw,v_;function GH(){if(v_)return gw;v_=1;var t=YS();return gw=function(e,n){return t[e]||(t[e]=n||{})},gw}var mw,C_;function Wu(){if(C_)return mw;C_=1;var t=sd(),e=Object;return mw=function(n){return e(t(n))},mw}var pw,y_;function Zr(){if(y_)return pw;y_=1;var t=Kt(),e=Wu(),n=t({}.hasOwnProperty);return pw=Object.hasOwn||function(i,o){return n(e(i),o)},pw}var ww,b_;function qH(){if(b_)return ww;b_=1;var t=Kt(),e=0,n=Math.random(),r=t(1 .toString);return ww=function(i){return"Symbol("+(i===void 0?"":i)+")_"+r(++e+n,36)},ww}var vw,S_;function Mi(){if(S_)return vw;S_=1;var t=on(),e=GH(),n=Zr(),r=qH(),i=jS(),o=YH(),s=t.Symbol,a=e("wks"),l=o?s.for||s:s&&s.withoutSetter||r;return vw=function(u){return n(a,u)||(a[u]=i&&n(s,u)?s[u]:l("Symbol."+u)),a[u]},vw}var Cw,R_;function F$(){if(R_)return Cw;R_=1;var t=sn(),e=Xr(),n=US(),r=ud(),i=$$(),o=Mi(),s=TypeError,a=o("toPrimitive");return Cw=function(l,u){if(!e(l)||n(l))return l;var c=r(l,a),h;if(c){if(u===void 0&&(u="default"),h=t(c,l,u),!e(h)||n(h))return h;throw new s("Can't convert object to primitive value")}return u===void 0&&(u="number"),i(l,u)},Cw}var yw,E_;function KH(){if(E_)return yw;E_=1;var t=F$(),e=US();return yw=function(n){var r=t(n,"string");return e(r)?r:r+""},yw}var bw,T_;function GS(){if(T_)return bw;T_=1;var t=on(),e=Xr(),n=t.document,r=e(n)&&e(n.createElement);return bw=function(i){return r?n.createElement(i):{}},bw}var Sw,__;function XH(){if(__)return Sw;__=1;var t=Kr(),e=Cn(),n=GS();return Sw=!t&&!e(function(){return Object.defineProperty(n("div"),"a",{get:function(){return 7}}).a!==7}),Sw}var M_;function ZH(){if(M_)return Fp;M_=1;var t=Kr(),e=sn(),n=D$(),r=Vm(),i=ad(),o=KH(),s=Zr(),a=XH(),l=Object.getOwnPropertyDescriptor;return Fp.f=t?l:function(c,h){if(c=i(c),h=o(h),a)try{return l(c,h)}catch{}if(s(c,h))return r(!e(n.f,c,h),c[h])},Fp}var Rw={},Ew,I_;function QH(){if(I_)return Ew;I_=1;var t=Kr(),e=Cn();return Ew=t&&e(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),Ew}var Tw,P_;function ln(){if(P_)return Tw;P_=1;var t=Xr(),e=String,n=TypeError;return Tw=function(r){if(t(r))return r;throw new n(e(r)+" is not an object")},Tw}var O_;function qs(){if(O_)return Rw;O_=1;var t=Kr(),e=XH(),n=QH(),r=ln(),i=KH(),o=TypeError,s=Object.defineProperty,a=Object.getOwnPropertyDescriptor,l="enumerable",u="configurable",c="writable";return Rw.f=t?n?function(d,f,g){if(r(d),f=i(f),r(g),typeof d=="function"&&f==="prototype"&&"value"in g&&c in g&&!g[c]){var C=a(d,f);C&&C[c]&&(d[f]=g.value,g={configurable:u in g?g[u]:C[u],enumerable:l in g?g[l]:C[l],writable:!1})}return s(d,f,g)}:s:function(d,f,g){if(r(d),f=i(f),r(g),e)try{return s(d,f,g)}catch{}if("get"in g||"set"in g)throw new o("Accessors not supported");return"value"in g&&(d[f]=g.value),d},Rw}var _w,x_;function Bu(){if(x_)return _w;x_=1;var t=Kr(),e=qs(),n=Vm();return _w=t?function(r,i,o){return e.f(r,i,n(1,o))}:function(r,i,o){return r[i]=o,r},_w}var Mw={exports:{}},Iw,A_;function V$(){if(A_)return Iw;A_=1;var t=Kr(),e=Zr(),n=Function.prototype,r=t&&Object.getOwnPropertyDescriptor,i=e(n,"name"),o=i&&(function(){}).name==="something",s=i&&(!t||t&&r(n,"name").configurable);return Iw={EXISTS:i,PROPER:o,CONFIGURABLE:s},Iw}var Pw,H_;function W$(){if(H_)return Pw;H_=1;var t=Kt(),e=an(),n=YS(),r=t(Function.toString);return e(n.inspectSource)||(n.inspectSource=function(i){return r(i)}),Pw=n.inspectSource,Pw}var Ow,N_;function B$(){if(N_)return Ow;N_=1;var t=on(),e=an(),n=t.WeakMap;return Ow=e(n)&&/native code/.test(String(n)),Ow}var xw,D_;function qS(){if(D_)return xw;D_=1;var t=GH(),e=qH(),n=t("keys");return xw=function(r){return n[r]||(n[r]=e(r))},xw}var Aw,k_;function KS(){return k_||(k_=1,Aw={}),Aw}var Hw,L_;function JH(){if(L_)return Hw;L_=1;var t=B$(),e=on(),n=Xr(),r=Bu(),i=Zr(),o=YS(),s=qS(),a=KS(),l="Object already initialized",u=e.TypeError,c=e.WeakMap,h,d,f,g=function(v){return f(v)?d(v):h(v,{})},C=function(v){return function(P){var O;if(!n(P)||(O=d(P)).type!==v)throw new u("Incompatible receiver, "+v+" required");return O}};if(t||o.state){var y=o.state||(o.state=new c);y.get=y.get,y.has=y.has,y.set=y.set,h=function(v,P){if(y.has(v))throw new u(l);return P.facade=v,y.set(v,P),P},d=function(v){return y.get(v)||{}},f=function(v){return y.has(v)}}else{var E=s("state");a[E]=!0,h=function(v,P){if(i(v,E))throw new u(l);return P.facade=v,r(v,E,P),P},d=function(v){return i(v,E)?v[E]:{}},f=function(v){return i(v,E)}}return Hw={set:h,get:d,has:f,enforce:g,getterFor:C},Hw}var $_;function e1(){if($_)return Mw.exports;$_=1;var t=Kt(),e=Cn(),n=an(),r=Zr(),i=Kr(),o=V$().CONFIGURABLE,s=W$(),a=JH(),l=a.enforce,u=a.get,c=String,h=Object.defineProperty,d=t("".slice),f=t("".replace),g=t([].join),C=i&&!e(function(){return h(function(){},"length",{value:8}).length!==8}),y=String(String).split("String"),E=Mw.exports=function(v,P,O){d(c(P),0,7)==="Symbol("&&(P="["+f(c(P),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),O&&O.getter&&(P="get "+P),O&&O.setter&&(P="set "+P),(!r(v,"name")||o&&v.name!==P)&&(i?h(v,"name",{value:P,configurable:!0}):v.name=P),C&&O&&r(O,"arity")&&v.length!==O.arity&&h(v,"length",{value:O.arity});try{O&&r(O,"constructor")&&O.constructor?i&&h(v,"prototype",{writable:!1}):v.prototype&&(v.prototype=void 0)}catch{}var L=l(v);return r(L,"source")||(L.source=g(y,typeof P=="string"?P:"")),v};return Function.prototype.toString=E(function(){return n(this)&&u(this).source||s(this)},"toString"),Mw.exports}var Nw,F_;function XS(){if(F_)return Nw;F_=1;var t=an(),e=qs(),n=e1(),r=zS();return Nw=function(i,o,s,a){a||(a={});var l=a.enumerable,u=a.name!==void 0?a.name:o;if(t(s)&&n(s,u,a),a.global)l?i[o]=s:r(o,s);else{try{a.unsafe?i[o]&&(l=!0):delete i[o]}catch{}l?i[o]=s:e.f(i,o,{value:s,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return i},Nw}var Dw={},kw,V_;function j$(){if(V_)return kw;V_=1;var t=Math.ceil,e=Math.floor;return kw=Math.trunc||function(r){var i=+r;return(i>0?e:t)(i)},kw}var Lw,W_;function cd(){if(W_)return Lw;W_=1;var t=j$();return Lw=function(e){var n=+e;return n!==n||n===0?0:t(n)},Lw}var $w,B_;function U$(){if(B_)return $w;B_=1;var t=cd(),e=Math.max,n=Math.min;return $w=function(r,i){var o=t(r);return o<0?e(o+i,0):n(o,i)},$w}var Fw,j_;function z$(){if(j_)return Fw;j_=1;var t=cd(),e=Math.min;return Fw=function(n){var r=t(n);return r>0?e(r,9007199254740991):0},Fw}var Vw,U_;function ju(){if(U_)return Vw;U_=1;var t=z$();return Vw=function(e){return t(e.length)},Vw}var Ww,z_;function Y$(){if(z_)return Ww;z_=1;var t=ad(),e=U$(),n=ju(),r=function(i){return function(o,s,a){var l=t(o),u=n(l);if(u===0)return!i&&-1;var c=e(a,u),h;if(i&&s!==s){for(;u>c;)if(h=l[c++],h!==h)return!0}else for(;u>c;c++)if((i||c in l)&&l[c]===s)return i||c||0;return!i&&-1}};return Ww={includes:r(!0),indexOf:r(!1)},Ww}var Bw,Y_;function t1(){if(Y_)return Bw;Y_=1;var t=Kt(),e=Zr(),n=ad(),r=Y$().indexOf,i=KS(),o=t([].push);return Bw=function(s,a){var l=n(s),u=0,c=[],h;for(h in l)!e(i,h)&&e(l,h)&&o(c,h);for(;a.length>u;)e(l,h=a[u++])&&(~r(c,h)||o(c,h));return c},Bw}var jw,G_;function ZS(){return G_||(G_=1,jw=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]),jw}var q_;function G$(){if(q_)return Dw;q_=1;var t=t1(),e=ZS(),n=e.concat("length","prototype");return Dw.f=Object.getOwnPropertyNames||function(i){return t(i,n)},Dw}var Uw={},K_;function q$(){return K_||(K_=1,Uw.f=Object.getOwnPropertySymbols),Uw}var zw,X_;function K$(){if(X_)return zw;X_=1;var t=Vu(),e=Kt(),n=G$(),r=q$(),i=ln(),o=e([].concat);return zw=t("Reflect","ownKeys")||function(a){var l=n.f(i(a)),u=r.f;return u?o(l,u(a)):l},zw}var Yw,Z_;function n1(){if(Z_)return Yw;Z_=1;var t=Zr(),e=K$(),n=ZH(),r=qs();return Yw=function(i,o,s){for(var a=e(o),l=r.f,u=n.f,c=0;c<a.length;c++){var h=a[c];!t(i,h)&&!(s&&t(s,h))&&l(i,h,u(o,h))}},Yw}var Gw,Q_;function X$(){if(Q_)return Gw;Q_=1;var t=Cn(),e=an(),n=/#|\.prototype\./,r=function(l,u){var c=o[i(l)];return c===a?!0:c===s?!1:e(u)?t(u):!!u},i=r.normalize=function(l){return String(l).replace(n,".").toLowerCase()},o=r.data={},s=r.NATIVE="N",a=r.POLYFILL="P";return Gw=r,Gw}var qw,J_;function dt(){if(J_)return qw;J_=1;var t=on(),e=ZH().f,n=Bu(),r=XS(),i=zS(),o=n1(),s=X$();return qw=function(a,l){var u=a.target,c=a.global,h=a.stat,d,f,g,C,y,E;if(c?f=t:h?f=t[u]||i(u,{}):f=t[u]&&t[u].prototype,f)for(g in l){if(y=l[g],a.dontCallGetSet?(E=e(f,g),C=E&&E.value):C=f[g],d=s(c?g:u+(h?".":"#")+g,a.forced),!d&&C!==void 0){if(typeof y==typeof C)continue;o(y,C)}(a.sham||C&&C.sham)&&n(y,"sham",!0),r(f,g,y,a)}},qw}var Kw,eM;function hd(){if(eM)return Kw;eM=1;var t=Fm(),e=Function.prototype,n=e.apply,r=e.call;return Kw=typeof Reflect=="object"&&Reflect.apply||(t?r.bind(n):function(){return r.apply(n,arguments)}),Kw}var Xw,tM;function r1(){if(tM)return Xw;tM=1;var t=Kt(),e=dr();return Xw=function(n,r,i){try{return t(e(Object.getOwnPropertyDescriptor(n,r)[i]))}catch{}},Xw}var Zw,nM;function Z$(){if(nM)return Zw;nM=1;var t=Xr();return Zw=function(e){return t(e)||e===null},Zw}var Qw,rM;function Q$(){if(rM)return Qw;rM=1;var t=Z$(),e=String,n=TypeError;return Qw=function(r){if(t(r))return r;throw new n("Can't set "+e(r)+" as a prototype")},Qw}var Jw,iM;function i1(){if(iM)return Jw;iM=1;var t=r1(),e=Xr(),n=sd(),r=Q$();return Jw=Object.setPrototypeOf||("__proto__"in{}?function(){var i=!1,o={},s;try{s=t(Object.prototype,"__proto__","set"),s(o,[]),i=o instanceof Array}catch{}return function(l,u){return n(l),r(u),e(l)&&(i?s(l,u):l.__proto__=u),l}}():void 0),Jw}var ev,oM;function J$(){if(oM)return ev;oM=1;var t=qs().f;return ev=function(e,n,r){r in e||t(e,r,{configurable:!0,get:function(){return n[r]},set:function(i){n[r]=i}})},ev}var tv,sM;function eF(){if(sM)return tv;sM=1;var t=an(),e=Xr(),n=i1();return tv=function(r,i,o){var s,a;return n&&t(s=i.constructor)&&s!==o&&e(a=s.prototype)&&a!==o.prototype&&n(r,a),r},tv}var nv,aM;function tF(){if(aM)return nv;aM=1;var t=Mi(),e=t("toStringTag"),n={};return n[e]="z",nv=String(n)==="[object z]",nv}var rv,lM;function o1(){if(lM)return rv;lM=1;var t=tF(),e=an(),n=fl(),r=Mi(),i=r("toStringTag"),o=Object,s=n(function(){return arguments}())==="Arguments",a=function(l,u){try{return l[u]}catch{}};return rv=t?n:function(l){var u,c,h;return l===void 0?"Undefined":l===null?"Null":typeof(c=a(u=o(l),i))=="string"?c:s?n(u):(h=n(u))==="Object"&&e(u.callee)?"Arguments":h},rv}var iv,uM;function jm(){if(uM)return iv;uM=1;var t=o1(),e=String;return iv=function(n){if(t(n)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return e(n)},iv}var ov,cM;function nF(){if(cM)return ov;cM=1;var t=jm();return ov=function(e,n){return e===void 0?arguments.length<2?"":n:t(e)},ov}var sv,hM;function rF(){if(hM)return sv;hM=1;var t=Xr(),e=Bu();return sv=function(n,r){t(r)&&"cause"in r&&e(n,"cause",r.cause)},sv}var av,dM;function iF(){if(dM)return av;dM=1;var t=Kt(),e=Error,n=t("".replace),r=function(s){return String(new e(s).stack)}("zxcasd"),i=/\n\s*at [^:]*:[^\n]*/,o=i.test(r);return av=function(s,a){if(o&&typeof s=="string"&&!e.prepareStackTrace)for(;a--;)s=n(s,i,"");return s},av}var lv,fM;function oF(){if(fM)return lv;fM=1;var t=Cn(),e=Vm();return lv=!t(function(){var n=new Error("a");return"stack"in n?(Object.defineProperty(n,"stack",e(1,7)),n.stack!==7):!0}),lv}var uv,gM;function sF(){if(gM)return uv;gM=1;var t=Bu(),e=iF(),n=oF(),r=Error.captureStackTrace;return uv=function(i,o,s,a){n&&(r?r(i,o):t(i,"stack",e(s,a)))},uv}var cv,mM;function aF(){if(mM)return cv;mM=1;var t=Vu(),e=Zr(),n=Bu(),r=ld(),i=i1(),o=n1(),s=J$(),a=eF(),l=nF(),u=rF(),c=sF(),h=Kr(),d=Gs();return cv=function(f,g,C,y){var E="stackTraceLimit",v=y?2:1,P=f.split("."),O=P[P.length-1],L=t.apply(null,P);if(L){var T=L.prototype;if(!d&&e(T,"cause")&&delete T.cause,!C)return L;var A=t("Error"),q=g(function(U,j){var Z=l(y?j:U,void 0),J=y?new L(U):new L;return Z!==void 0&&n(J,"message",Z),c(J,q,J.stack,2),this&&r(T,this)&&a(J,this,q),arguments.length>v&&u(J,arguments[v]),J});if(q.prototype=T,O!=="Error"?i?i(q,A):o(q,A,{name:!0}):h&&E in L&&(s(q,L,E),s(q,L,"prepareStackTrace")),o(q,L),!d)try{T.name!==O&&n(T,"name",O),T.constructor=q}catch{}return q}},cv}var pM;function lF(){if(pM)return BT;pM=1;var t=dt(),e=on(),n=hd(),r=aF(),i="WebAssembly",o=e[i],s=new Error("e",{cause:7}).cause!==7,a=function(u,c){var h={};h[u]=r(u,c,s),t({global:!0,constructor:!0,arity:1,forced:s},h)},l=function(u,c){if(o&&o[u]){var h={};h[u]=r(i+"."+u,c,s),t({target:i,stat:!0,constructor:!0,arity:1,forced:s},h)}};return a("Error",function(u){return function(h){return n(u,this,arguments)}}),a("EvalError",function(u){return function(h){return n(u,this,arguments)}}),a("RangeError",function(u){return function(h){return n(u,this,arguments)}}),a("ReferenceError",function(u){return function(h){return n(u,this,arguments)}}),a("SyntaxError",function(u){return function(h){return n(u,this,arguments)}}),a("TypeError",function(u){return function(h){return n(u,this,arguments)}}),a("URIError",function(u){return function(h){return n(u,this,arguments)}}),l("CompileError",function(u){return function(h){return n(u,this,arguments)}}),l("LinkError",function(u){return function(h){return n(u,this,arguments)}}),l("RuntimeError",function(u){return function(h){return n(u,this,arguments)}}),BT}lF();var wM={},hv,vM;function s1(){if(vM)return hv;vM=1;var t=fl();return hv=Array.isArray||function(n){return t(n)==="Array"},hv}var dv,CM;function a1(){if(CM)return dv;CM=1;var t=Kr(),e=s1(),n=TypeError,r=Object.getOwnPropertyDescriptor,i=t&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(o){return o instanceof TypeError}}();return dv=i?function(o,s){if(e(o)&&!r(o,"length").writable)throw new n("Cannot set read only .length");return o.length=s}:function(o,s){return o.length=s},dv}var fv,yM;function l1(){if(yM)return fv;yM=1;var t=TypeError,e=9007199254740991;return fv=function(n){if(n>e)throw t("Maximum allowed index exceeded");return n},fv}var bM;function uF(){if(bM)return wM;bM=1;var t=dt(),e=Wu(),n=ju(),r=a1(),i=l1(),o=Cn(),s=o(function(){return[].push.call({length:4294967296},1)!==4294967297}),a=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(u){return u instanceof TypeError}},l=s||!a();return t({target:"Array",proto:!0,arity:1,forced:l},{push:function(c){var h=e(this),d=n(h),f=arguments.length;i(d+f);for(var g=0;g<f;g++)h[d]=arguments[g],d++;return r(h,d),d}}),wM}uF();var SM={},gv,RM;function cF(){if(RM)return gv;RM=1;var t=fl(),e=Kt();return gv=function(n){if(t(n)==="Function")return e(n)},gv}var mv,EM;function u1(){if(EM)return mv;EM=1;var t=cF(),e=dr(),n=Fm(),r=t(t.bind);return mv=function(i,o){return e(i),o===void 0?i:n?r(i,o):function(){return i.apply(o,arguments)}},mv}var pv,TM;function c1(){return TM||(TM=1,pv={}),pv}var wv,_M;function hF(){if(_M)return wv;_M=1;var t=Mi(),e=c1(),n=t("iterator"),r=Array.prototype;return wv=function(i){return i!==void 0&&(e.Array===i||r[n]===i)},wv}var vv,MM;function QS(){if(MM)return vv;MM=1;var t=o1(),e=ud(),n=BS(),r=c1(),i=Mi(),o=i("iterator");return vv=function(s){if(!n(s))return e(s,o)||e(s,"@@iterator")||r[t(s)]},vv}var Cv,IM;function dF(){if(IM)return Cv;IM=1;var t=sn(),e=dr(),n=ln(),r=Bm(),i=QS(),o=TypeError;return Cv=function(s,a){var l=arguments.length<2?i(s):a;if(e(l))return n(t(l,s));throw new o(r(s)+" is not iterable")},Cv}var yv,PM;function Ir(){if(PM)return yv;PM=1;var t=sn(),e=ln(),n=ud();return yv=function(r,i,o){var s,a;e(r);try{if(s=n(r,"return"),!s){if(i==="throw")throw o;return o}s=t(s,r)}catch(l){a=!0,s=l}if(i==="throw")throw o;if(a)throw s;return e(s),o},yv}var bv,OM;function Uu(){if(OM)return bv;OM=1;var t=u1(),e=sn(),n=ln(),r=Bm(),i=hF(),o=ju(),s=ld(),a=dF(),l=QS(),u=Ir(),c=TypeError,h=function(f,g){this.stopped=f,this.result=g},d=h.prototype;return bv=function(f,g,C){var y=C&&C.that,E=!!(C&&C.AS_ENTRIES),v=!!(C&&C.IS_RECORD),P=!!(C&&C.IS_ITERATOR),O=!!(C&&C.INTERRUPTED),L=t(g,y),T,A,q,U,j,Z,J,se=function(ue){return T&&u(T,"normal",ue),new h(!0,ue)},te=function(ue){return E?(n(ue),O?L(ue[0],ue[1],se):L(ue[0],ue[1])):O?L(ue,se):L(ue)};if(v)T=f.iterator;else if(P)T=f;else{if(A=l(f),!A)throw new c(r(f)+" is not iterable");if(i(A)){for(q=0,U=o(f);U>q;q++)if(j=te(f[q]),j&&s(d,j))return j;return new h(!1)}T=a(f,A)}for(Z=v?f.next:T.next;!(J=e(Z,T)).done;){try{j=te(J.value)}catch(ue){u(T,"throw",ue)}if(typeof j=="object"&&j&&s(d,j))return j}return new h(!1)},bv}var Sv,xM;function h1(){if(xM)return Sv;xM=1;var t=Kr(),e=qs(),n=Vm();return Sv=function(r,i,o){t?e.f(r,i,n(0,o)):r[i]=o},Sv}var AM;function fF(){if(AM)return SM;AM=1;var t=dt(),e=Uu(),n=h1();return t({target:"Object",stat:!0},{fromEntries:function(i){var o={};return e(i,function(s,a){n(o,s,a)},{AS_ENTRIES:!0}),o}}),SM}fF();var HM={},Rv,NM;function co(){if(NM)return Rv;NM=1;var t=Kt(),e=Set.prototype;return Rv={Set,add:t(e.add),has:t(e.has),remove:t(e.delete),proto:e},Rv}var Ev,DM;function gl(){if(DM)return Ev;DM=1;var t=co().has;return Ev=function(e){return t(e),e},Ev}var Tv,kM;function ml(){if(kM)return Tv;kM=1;var t=sn();return Tv=function(e,n,r){for(var i=r?e:e.iterator,o=e.next,s,a;!(s=t(o,i)).done;)if(a=n(s.value),a!==void 0)return a},Tv}var _v,LM;function dd(){if(LM)return _v;LM=1;var t=Kt(),e=ml(),n=co(),r=n.Set,i=n.proto,o=t(i.forEach),s=t(i.keys),a=s(new r).next;return _v=function(l,u,c){return c?e({iterator:s(l),next:a},u):o(l,u)},_v}var Mv,$M;function JS(){if($M)return Mv;$M=1;var t=co(),e=dd(),n=t.Set,r=t.add;return Mv=function(i){var o=new n;return e(i,function(s){r(o,s)}),o},Mv}var Iv,FM;function fd(){if(FM)return Iv;FM=1;var t=r1(),e=co();return Iv=t(e.proto,"size","get")||function(n){return n.size},Iv}var Pv,VM;function ho(){return VM||(VM=1,Pv=function(t){return{iterator:t,next:t.next,done:!1}}),Pv}var Ov,WM;function pl(){if(WM)return Ov;WM=1;var t=dr(),e=ln(),n=sn(),r=cd(),i=ho(),o="Invalid size",s=RangeError,a=TypeError,l=Math.max,u=function(c,h){this.set=c,this.size=l(h,0),this.has=t(c.has),this.keys=t(c.keys)};return u.prototype={getIterator:function(){return i(e(n(this.keys,this.set)))},includes:function(c){return n(this.has,this.set,c)}},Ov=function(c){e(c);var h=+c.size;if(h!==h)throw new a(o);var d=r(h);if(d<0)throw new s(o);return new u(c,d)},Ov}var xv,BM;function gF(){if(BM)return xv;BM=1;var t=gl(),e=co(),n=JS(),r=fd(),i=pl(),o=dd(),s=ml(),a=e.has,l=e.remove;return xv=function(c){var h=t(this),d=i(c),f=n(h);return r(h)<=d.size?o(h,function(g){d.includes(g)&&l(f,g)}):s(d.getIterator(),function(g){a(h,g)&&l(f,g)}),f},xv}var Av,jM;function wl(){if(jM)return Av;jM=1;var t=Vu(),e=function(r){return{size:r,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}},n=function(r){return{size:r,has:function(){return!0},keys:function(){throw new Error("e")}}};return Av=function(r,i){var o=t("Set");try{new o()[r](e(0));try{return new o()[r](e(-1)),!1}catch{if(!i)return!0;try{return new o()[r](n(-1/0)),!1}catch{var s=new o;return s.add(1),s.add(2),i(s[r](n(1/0)))}}}catch{return!1}},Av}var UM;function mF(){if(UM)return HM;UM=1;var t=dt(),e=gF(),n=wl(),r=!n("difference",function(i){return i.size===0});return t({target:"Set",proto:!0,real:!0,forced:r},{difference:e}),HM}mF();var zM={},Hv,YM;function pF(){if(YM)return Hv;YM=1;var t=gl(),e=co(),n=fd(),r=pl(),i=dd(),o=ml(),s=e.Set,a=e.add,l=e.has;return Hv=function(c){var h=t(this),d=r(c),f=new s;return n(h)>d.size?o(d.getIterator(),function(g){l(h,g)&&a(f,g)}):i(h,function(g){d.includes(g)&&a(f,g)}),f},Hv}var GM;function wF(){if(GM)return zM;GM=1;var t=dt(),e=Cn(),n=pF(),r=wl(),i=!r("intersection",function(o){return o.size===2&&o.has(1)&&o.has(2)})||e(function(){return String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))!=="3,2"});return t({target:"Set",proto:!0,real:!0,forced:i},{intersection:n}),zM}wF();var qM={},Nv,KM;function vF(){if(KM)return Nv;KM=1;var t=gl(),e=co().has,n=fd(),r=pl(),i=dd(),o=ml(),s=Ir();return Nv=function(l){var u=t(this),c=r(l);if(n(u)<=c.size)return i(u,function(d){if(c.includes(d))return!1},!0)!==!1;var h=c.getIterator();return o(h,function(d){if(e(u,d))return s(h,"normal",!1)})!==!1},Nv}var XM;function CF(){if(XM)return qM;XM=1;var t=dt(),e=vF(),n=wl(),r=!n("isDisjointFrom",function(i){return!i});return t({target:"Set",proto:!0,real:!0,forced:r},{isDisjointFrom:e}),qM}CF();var ZM={},Dv,QM;function yF(){if(QM)return Dv;QM=1;var t=gl(),e=fd(),n=dd(),r=pl();return Dv=function(o){var s=t(this),a=r(o);return e(s)>a.size?!1:n(s,function(l){if(!a.includes(l))return!1},!0)!==!1},Dv}var JM;function bF(){if(JM)return ZM;JM=1;var t=dt(),e=yF(),n=wl(),r=!n("isSubsetOf",function(i){return i});return t({target:"Set",proto:!0,real:!0,forced:r},{isSubsetOf:e}),ZM}bF();var eI={},kv,tI;function SF(){if(tI)return kv;tI=1;var t=gl(),e=co().has,n=fd(),r=pl(),i=ml(),o=Ir();return kv=function(a){var l=t(this),u=r(a);if(n(l)<u.size)return!1;var c=u.getIterator();return i(c,function(h){if(!e(l,h))return o(c,"normal",!1)})!==!1},kv}var nI;function RF(){if(nI)return eI;nI=1;var t=dt(),e=SF(),n=wl(),r=!n("isSupersetOf",function(i){return!i});return t({target:"Set",proto:!0,real:!0,forced:r},{isSupersetOf:e}),eI}RF();var rI={},Lv,iI;function EF(){if(iI)return Lv;iI=1;var t=gl(),e=co(),n=JS(),r=pl(),i=ml(),o=e.add,s=e.has,a=e.remove;return Lv=function(u){var c=t(this),h=r(u).getIterator(),d=n(c);return i(h,function(f){s(c,f)?a(d,f):o(d,f)}),d},Lv}var oI;function TF(){if(oI)return rI;oI=1;var t=dt(),e=EF(),n=wl();return t({target:"Set",proto:!0,real:!0,forced:!n("symmetricDifference")},{symmetricDifference:e}),rI}TF();var sI={},$v,aI;function _F(){if(aI)return $v;aI=1;var t=gl(),e=co().add,n=JS(),r=pl(),i=ml();return $v=function(s){var a=t(this),l=r(s).getIterator(),u=n(a);return i(l,function(c){e(u,c)}),u},$v}var lI;function MF(){if(lI)return sI;lI=1;var t=dt(),e=_F(),n=wl();return t({target:"Set",proto:!0,real:!0,forced:!n("union")},{union:e}),sI}MF();var uI={},cI={},Fv,hI;function IF(){if(hI)return Fv;hI=1;var t=ld(),e=TypeError;return Fv=function(n,r){if(t(r,n))return n;throw new e("Incorrect invocation")},Fv}var Vv,dI;function PF(){if(dI)return Vv;dI=1;var t=Cn();return Vv=!t(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),Vv}var Wv,fI;function d1(){if(fI)return Wv;fI=1;var t=Zr(),e=an(),n=Wu(),r=qS(),i=PF(),o=r("IE_PROTO"),s=Object,a=s.prototype;return Wv=i?s.getPrototypeOf:function(l){var u=n(l);if(t(u,o))return u[o];var c=u.constructor;return e(c)&&u instanceof c?c.prototype:u instanceof s?a:null},Wv}var Bv,gI;function OF(){if(gI)return Bv;gI=1;var t=e1(),e=qs();return Bv=function(n,r,i){return i.get&&t(i.get,r,{getter:!0}),i.set&&t(i.set,r,{setter:!0}),e.f(n,r,i)},Bv}var jv={},Uv,mI;function xF(){if(mI)return Uv;mI=1;var t=t1(),e=ZS();return Uv=Object.keys||function(r){return t(r,e)},Uv}var pI;function AF(){if(pI)return jv;pI=1;var t=Kr(),e=QH(),n=qs(),r=ln(),i=ad(),o=xF();return jv.f=t&&!e?Object.defineProperties:function(a,l){r(a);for(var u=i(l),c=o(l),h=c.length,d=0,f;h>d;)n.f(a,f=c[d++],u[f]);return a},jv}var zv,wI;function f1(){if(wI)return zv;wI=1;var t=Vu();return zv=t("document","documentElement"),zv}var Yv,vI;function eR(){if(vI)return Yv;vI=1;var t=ln(),e=AF(),n=ZS(),r=KS(),i=f1(),o=GS(),s=qS(),a=">",l="<",u="prototype",c="script",h=s("IE_PROTO"),d=function(){},f=function(v){return l+c+a+v+l+"/"+c+a},g=function(v){v.write(f("")),v.close();var P=v.parentWindow.Object;return v=null,P},C=function(){var v=o("iframe"),P="java"+c+":",O;return v.style.display="none",i.appendChild(v),v.src=String(P),O=v.contentWindow.document,O.open(),O.write(f("document.F=Object")),O.close(),O.F},y,E=function(){try{y=new ActiveXObject("htmlfile")}catch{}E=typeof document<"u"?document.domain&&y?g(y):C():g(y);for(var v=n.length;v--;)delete E[u][n[v]];return E()};return r[h]=!0,Yv=Object.create||function(P,O){var L;return P!==null?(d[u]=t(P),L=new d,d[u]=null,L[h]=P):L=E(),O===void 0?L:e.f(L,O)},Yv}var Gv,CI;function g1(){if(CI)return Gv;CI=1;var t=Cn(),e=an(),n=Xr(),r=eR(),i=d1(),o=XS(),s=Mi(),a=Gs(),l=s("iterator"),u=!1,c,h,d;[].keys&&(d=[].keys(),"next"in d?(h=i(i(d)),h!==Object.prototype&&(c=h)):u=!0);var f=!n(c)||t(function(){var g={};return c[l].call(g)!==g});return f?c={}:a&&(c=r(c)),e(c[l])||o(c,l,function(){return this}),Gv={IteratorPrototype:c,BUGGY_SAFARI_ITERATORS:u},Gv}var yI;function HF(){if(yI)return cI;yI=1;var t=dt(),e=on(),n=IF(),r=ln(),i=an(),o=d1(),s=OF(),a=h1(),l=Cn(),u=Zr(),c=Mi(),h=g1().IteratorPrototype,d=Kr(),f=Gs(),g="constructor",C="Iterator",y=c("toStringTag"),E=TypeError,v=e[C],P=f||!i(v)||v.prototype!==h||!l(function(){v({})}),O=function(){if(n(this,h),o(this)===h)throw new E("Abstract class Iterator not directly constructable")},L=function(T,A){d?s(h,T,{configurable:!0,get:function(){return A},set:function(q){if(r(this),this===h)throw new E("You can't redefine this property");u(this,T)?this[T]=q:a(this,T,q)}}):h[T]=A};return u(h,y)||L(y,C),(P||!u(h,g)||h[g]===Object)&&L(g,O),O.prototype=h,t({global:!0,constructor:!0,forced:P},{Iterator:O}),cI}var bI;function NF(){return bI||(bI=1,HF()),uI}NF();var SI={},RI={},qv,EI;function DF(){if(EI)return qv;EI=1;var t=XS();return qv=function(e,n,r){for(var i in n)t(e,i,n[i],r);return e},qv}var Kv,TI;function kF(){return TI||(TI=1,Kv=function(t,e){return{value:t,done:e}}),Kv}var Xv,_I;function tR(){if(_I)return Xv;_I=1;var t=sn(),e=eR(),n=Bu(),r=DF(),i=Mi(),o=JH(),s=ud(),a=g1().IteratorPrototype,l=kF(),u=Ir(),c=i("toStringTag"),h="IteratorHelper",d="WrapForValidIterator",f=o.set,g=function(E){var v=o.getterFor(E?d:h);return r(e(a),{next:function(){var O=v(this);if(E)return O.nextHandler();if(O.done)return l(void 0,!0);try{var L=O.nextHandler();return O.returnHandlerResult?L:l(L,O.done)}catch(T){throw O.done=!0,T}},return:function(){var P=v(this),O=P.iterator;if(P.done=!0,E){var L=s(O,"return");return L?t(L,O):l(void 0,!0)}if(P.inner)try{u(P.inner.iterator,"normal")}catch(T){return u(O,"throw",T)}return O&&u(O,"normal"),l(void 0,!0)}})},C=g(!0),y=g(!1);return n(y,c,"Iterator Helper"),Xv=function(E,v,P){var O=function(T,A){A?(A.iterator=T.iterator,A.next=T.next):A=T,A.type=v?d:h,A.returnHandlerResult=!!P,A.nextHandler=E,A.counter=0,A.done=!1,f(this,A)};return O.prototype=v?C:y,O},Xv}var Zv,MI;function m1(){if(MI)return Zv;MI=1;var t=ln(),e=Ir();return Zv=function(n,r,i,o){try{return o?r(t(i)[0],i[1]):r(i)}catch(s){e(n,"throw",s)}},Zv}var Qv,II;function Ks(){if(II)return Qv;II=1;var t=on();return Qv=function(e,n){var r=t.Iterator,i=r&&r.prototype,o=i&&i[e],s=!1;if(o)try{o.call({next:function(){return{done:!0}},return:function(){s=!0}},-1)}catch(a){a instanceof n||(s=!1)}if(!s)return o},Qv}var PI;function LF(){if(PI)return RI;PI=1;var t=dt(),e=sn(),n=dr(),r=ln(),i=ho(),o=tR(),s=m1(),a=Gs(),l=Ir(),u=Ks(),c=!a&&u("filter",TypeError),h=o(function(){for(var d=this.iterator,f=this.predicate,g=this.next,C,y,E;;){if(C=r(e(g,d)),y=this.done=!!C.done,y)return;if(E=C.value,s(d,f,[E,this.counter++],!0))return E}});return t({target:"Iterator",proto:!0,real:!0,forced:a||c},{filter:function(f){r(this);try{n(f)}catch(g){l(this,"throw",g)}return c?e(c,this,f):new h(i(this),{predicate:f})}}),RI}var OI;function $F(){return OI||(OI=1,LF()),SI}$F();var xI={},AI={},HI;function FF(){if(HI)return AI;HI=1;var t=dt(),e=sn(),n=Uu(),r=dr(),i=ln(),o=ho(),s=Ir(),a=Ks(),l=a("forEach",TypeError);return t({target:"Iterator",proto:!0,real:!0,forced:l},{forEach:function(c){i(this);try{r(c)}catch(f){s(this,"throw",f)}if(l)return e(l,this,c);var h=o(this),d=0;n(h,function(f){c(f,d++)},{IS_RECORD:!0})}}),AI}var NI;function VF(){return NI||(NI=1,FF()),xI}VF();var DI={},kI={},LI;function WF(){if(LI)return kI;LI=1;var t=dt(),e=sn(),n=dr(),r=ln(),i=ho(),o=tR(),s=m1(),a=Ir(),l=Ks(),u=Gs(),c=!u&&l("map",TypeError),h=o(function(){var d=this.iterator,f=r(e(this.next,d)),g=this.done=!!f.done;if(!g)return s(d,this.mapper,[f.value,this.counter++],!0)});return t({target:"Iterator",proto:!0,real:!0,forced:u||c},{map:function(f){r(this);try{n(f)}catch(g){a(this,"throw",g)}return c?e(c,this,f):new h(i(this),{mapper:f})}}),kI}var $I;function BF(){return $I||($I=1,WF()),DI}BF();var FI={},VI={},Jv,WI;function nR(){if(WI)return Jv;WI=1;var t=Kt();return Jv=t([].slice),Jv}var eC,BI;function p1(){if(BI)return eC;BI=1;var t=TypeError;return eC=function(e,n){if(e<n)throw new t("Not enough arguments");return e},eC}var tC,jI;function jF(){if(jI)return tC;jI=1;var t=Wm();return tC=/(?:ipad|iphone|ipod).*applewebkit/i.test(t),tC}var nC,UI;function w1(){if(UI)return nC;UI=1;var t=on(),e=Wm(),n=fl(),r=function(i){return e.slice(0,i.length)===i};return nC=function(){return r("Bun/")?"BUN":r("Cloudflare-Workers")?"CLOUDFLARE":r("Deno/")?"DENO":r("Node.js/")?"NODE":t.Bun&&typeof Bun.version=="string"?"BUN":t.Deno&&typeof Deno.version=="object"?"DENO":n(t.process)==="process"?"NODE":t.window&&t.document?"BROWSER":"REST"}(),nC}var rC,zI;function UF(){if(zI)return rC;zI=1;var t=w1();return rC=t==="NODE",rC}var iC,YI;function v1(){if(YI)return iC;YI=1;var t=on(),e=hd(),n=u1(),r=an(),i=Zr(),o=Cn(),s=f1(),a=nR(),l=GS(),u=p1(),c=jF(),h=UF(),d=t.setImmediate,f=t.clearImmediate,g=t.process,C=t.Dispatch,y=t.Function,E=t.MessageChannel,v=t.String,P=0,O={},L="onreadystatechange",T,A,q,U;o(function(){T=t.location});var j=function(te){if(i(O,te)){var ue=O[te];delete O[te],ue()}},Z=function(te){return function(){j(te)}},J=function(te){j(te.data)},se=function(te){t.postMessage(v(te),T.protocol+"//"+T.host)};return(!d||!f)&&(d=function(ue){u(arguments.length,1);var pt=r(ue)?ue:y(ue),be=a(arguments,1);return O[++P]=function(){e(pt,void 0,be)},A(P),P},f=function(ue){delete O[ue]},h?A=function(te){g.nextTick(Z(te))}:C&&C.now?A=function(te){C.now(Z(te))}:E&&!c?(q=new E,U=q.port2,q.port1.onmessage=J,A=n(U.postMessage,U)):t.addEventListener&&r(t.postMessage)&&!t.importScripts&&T&&T.protocol!=="file:"&&!o(se)?(A=se,t.addEventListener("message",J,!1)):L in l("script")?A=function(te){s.appendChild(l("script"))[L]=function(){s.removeChild(this),j(te)}}:A=function(te){setTimeout(Z(te),0)}),iC={set:d,clear:f},iC}var GI;function zF(){if(GI)return VI;GI=1;var t=dt(),e=on(),n=v1().clear;return t({global:!0,bind:!0,enumerable:!0,forced:e.clearImmediate!==n},{clearImmediate:n}),VI}var qI={},oC,KI;function YF(){if(KI)return oC;KI=1;var t=on(),e=hd(),n=an(),r=w1(),i=Wm(),o=nR(),s=p1(),a=t.Function,l=/MSIE .\./.test(i)||r==="BUN"&&function(){var u=t.Bun.version.split(".");return u.length<3||u[0]==="0"&&(u[1]<3||u[1]==="3"&&u[2]==="0")}();return oC=function(u,c){var h=c?2:1;return l?function(d,f){var g=s(arguments.length,1)>h,C=n(d)?d:a(d),y=g?o(arguments,h):[],E=g?function(){e(C,this,y)}:C;return c?u(E,f):u(E)}:u},oC}var XI;function GF(){if(XI)return qI;XI=1;var t=dt(),e=on(),n=v1().set,r=YF(),i=e.setImmediate?r(n,!1):n;return t({global:!0,bind:!0,enumerable:!0,forced:e.setImmediate!==i},{setImmediate:i}),qI}var ZI;function qF(){return ZI||(ZI=1,zF(),GF()),FI}qF();/*! @license DOMPurify 3.2.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.5/LICENSE */const{entries:C1,setPrototypeOf:QI,isFrozen:KF,getPrototypeOf:XF,getOwnPropertyDescriptor:ZF}=Object;let{freeze:zn,seal:qr,create:y1}=Object,{apply:Vb,construct:Wb}=typeof Reflect<"u"&&Reflect;zn||(zn=function(e){return e});qr||(qr=function(e){return e});Vb||(Vb=function(e,n,r){return e.apply(n,r)});Wb||(Wb=function(e,n){return new e(...n)});const Dd=Yn(Array.prototype.forEach),QF=Yn(Array.prototype.lastIndexOf),JI=Yn(Array.prototype.pop),oc=Yn(Array.prototype.push),JF=Yn(Array.prototype.splice),Cg=Yn(String.prototype.toLowerCase),sC=Yn(String.prototype.toString),eP=Yn(String.prototype.match),sc=Yn(String.prototype.replace),eV=Yn(String.prototype.indexOf),tV=Yn(String.prototype.trim),di=Yn(Object.prototype.hasOwnProperty),Dn=Yn(RegExp.prototype.test),ac=nV(TypeError);function Yn(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return Vb(t,e,r)}}function nV(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return Wb(t,n)}}function Fe(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Cg;QI&&QI(t,null);let r=e.length;for(;r--;){let i=e[r];if(typeof i=="string"){const o=n(i);o!==i&&(KF(e)||(e[r]=o),i=o)}t[i]=!0}return t}function rV(t){for(let e=0;e<t.length;e++)di(t,e)||(t[e]=null);return t}function Wa(t){const e=y1(null);for(const[n,r]of C1(t))di(t,n)&&(Array.isArray(r)?e[n]=rV(r):r&&typeof r=="object"&&r.constructor===Object?e[n]=Wa(r):e[n]=r);return e}function lc(t,e){for(;t!==null;){const r=ZF(t,e);if(r){if(r.get)return Yn(r.get);if(typeof r.value=="function")return Yn(r.value)}t=XF(t)}function n(){return null}return n}const tP=zn(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),aC=zn(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),lC=zn(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),iV=zn(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),uC=zn(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),oV=zn(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),nP=zn(["#text"]),rP=zn(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),cC=zn(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),iP=zn(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),kd=zn(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),sV=qr(/\{\{[\w\W]*|[\w\W]*\}\}/gm),aV=qr(/<%[\w\W]*|[\w\W]*%>/gm),lV=qr(/\$\{[\w\W]*/gm),uV=qr(/^data-[\-\w.\u00B7-\uFFFF]+$/),cV=qr(/^aria-[\-\w]+$/),b1=qr(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),hV=qr(/^(?:\w+script|data):/i),dV=qr(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),S1=qr(/^html$/i),fV=qr(/^[a-z][.\w]*(-[.\w]+)+$/i);var oP=Object.freeze({__proto__:null,ARIA_ATTR:cV,ATTR_WHITESPACE:dV,CUSTOM_ELEMENT:fV,DATA_ATTR:uV,DOCTYPE_NAME:S1,ERB_EXPR:aV,IS_ALLOWED_URI:b1,IS_SCRIPT_OR_DATA:hV,MUSTACHE_EXPR:sV,TMPLIT_EXPR:lV});const uc={element:1,text:3,progressingInstruction:7,comment:8,document:9},gV=function(){return typeof window>"u"?null:window},mV=function(e,n){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(r=n.getAttribute(i));const o="dompurify"+(r?"#"+r:"");try{return e.createPolicy(o,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},sP=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function R1(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:gV();const e=we=>R1(we);if(e.version="3.2.5",e.removed=[],!t||!t.document||t.document.nodeType!==uc.document||!t.Element)return e.isSupported=!1,e;let{document:n}=t;const r=n,i=r.currentScript,{DocumentFragment:o,HTMLTemplateElement:s,Node:a,Element:l,NodeFilter:u,NamedNodeMap:c=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:h,DOMParser:d,trustedTypes:f}=t,g=l.prototype,C=lc(g,"cloneNode"),y=lc(g,"remove"),E=lc(g,"nextSibling"),v=lc(g,"childNodes"),P=lc(g,"parentNode");if(typeof s=="function"){const we=n.createElement("template");we.content&&we.content.ownerDocument&&(n=we.content.ownerDocument)}let O,L="";const{implementation:T,createNodeIterator:A,createDocumentFragment:q,getElementsByTagName:U}=n,{importNode:j}=r;let Z=sP();e.isSupported=typeof C1=="function"&&typeof P=="function"&&T&&T.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:J,ERB_EXPR:se,TMPLIT_EXPR:te,DATA_ATTR:ue,ARIA_ATTR:pt,IS_SCRIPT_OR_DATA:be,ATTR_WHITESPACE:ke,CUSTOM_ELEMENT:wt}=oP;let{IS_ALLOWED_URI:fn}=oP,et=null;const m=Fe({},[...tP,...aC,...lC,...uC,...nP]);let w=null;const p=Fe({},[...rP,...cC,...iP,...kd]);let I=Object.seal(y1(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),$=null,B=null,Y=!0,K=!0,b=!1,R=!0,S=!1,k=!0,_=!1,H=!1,W=!1,x=!1,N=!1,V=!1,F=!0,z=!1;const oe="user-content-";let ce=!0,Re=!1,Ne={},We=null;const Se=Fe({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Le=null;const vt=Fe({},["audio","video","img","source","image","track"]);let ti=null;const po=Fe({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Or="http://www.w3.org/1998/Math/MathML",Ct="http://www.w3.org/2000/svg",Zt="http://www.w3.org/1999/xhtml";let ft=Zt,yt=!1,$e=null;const xr=Fe({},[Or,Ct,Zt],sC);let Js=Fe({},["mi","mo","mn","ms","mtext"]),ea=Fe({},["annotation-xml"]);const _$=Fe({},["title","style","font","a","script"]);let nc=null;const M$=["application/xhtml+xml","text/html"],I$="text/html";let gn=null,Rl=null;const P$=n.createElement("form"),PT=function(D){return D instanceof RegExp||D instanceof Function},Lp=function(){let D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Rl&&Rl===D)){if((!D||typeof D!="object")&&(D={}),D=Wa(D),nc=M$.indexOf(D.PARSER_MEDIA_TYPE)===-1?I$:D.PARSER_MEDIA_TYPE,gn=nc==="application/xhtml+xml"?sC:Cg,et=di(D,"ALLOWED_TAGS")?Fe({},D.ALLOWED_TAGS,gn):m,w=di(D,"ALLOWED_ATTR")?Fe({},D.ALLOWED_ATTR,gn):p,$e=di(D,"ALLOWED_NAMESPACES")?Fe({},D.ALLOWED_NAMESPACES,sC):xr,ti=di(D,"ADD_URI_SAFE_ATTR")?Fe(Wa(po),D.ADD_URI_SAFE_ATTR,gn):po,Le=di(D,"ADD_DATA_URI_TAGS")?Fe(Wa(vt),D.ADD_DATA_URI_TAGS,gn):vt,We=di(D,"FORBID_CONTENTS")?Fe({},D.FORBID_CONTENTS,gn):Se,$=di(D,"FORBID_TAGS")?Fe({},D.FORBID_TAGS,gn):{},B=di(D,"FORBID_ATTR")?Fe({},D.FORBID_ATTR,gn):{},Ne=di(D,"USE_PROFILES")?D.USE_PROFILES:!1,Y=D.ALLOW_ARIA_ATTR!==!1,K=D.ALLOW_DATA_ATTR!==!1,b=D.ALLOW_UNKNOWN_PROTOCOLS||!1,R=D.ALLOW_SELF_CLOSE_IN_ATTR!==!1,S=D.SAFE_FOR_TEMPLATES||!1,k=D.SAFE_FOR_XML!==!1,_=D.WHOLE_DOCUMENT||!1,x=D.RETURN_DOM||!1,N=D.RETURN_DOM_FRAGMENT||!1,V=D.RETURN_TRUSTED_TYPE||!1,W=D.FORCE_BODY||!1,F=D.SANITIZE_DOM!==!1,z=D.SANITIZE_NAMED_PROPS||!1,ce=D.KEEP_CONTENT!==!1,Re=D.IN_PLACE||!1,fn=D.ALLOWED_URI_REGEXP||b1,ft=D.NAMESPACE||Zt,Js=D.MATHML_TEXT_INTEGRATION_POINTS||Js,ea=D.HTML_INTEGRATION_POINTS||ea,I=D.CUSTOM_ELEMENT_HANDLING||{},D.CUSTOM_ELEMENT_HANDLING&&PT(D.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(I.tagNameCheck=D.CUSTOM_ELEMENT_HANDLING.tagNameCheck),D.CUSTOM_ELEMENT_HANDLING&&PT(D.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(I.attributeNameCheck=D.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),D.CUSTOM_ELEMENT_HANDLING&&typeof D.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(I.allowCustomizedBuiltInElements=D.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),S&&(K=!1),N&&(x=!0),Ne&&(et=Fe({},nP),w=[],Ne.html===!0&&(Fe(et,tP),Fe(w,rP)),Ne.svg===!0&&(Fe(et,aC),Fe(w,cC),Fe(w,kd)),Ne.svgFilters===!0&&(Fe(et,lC),Fe(w,cC),Fe(w,kd)),Ne.mathMl===!0&&(Fe(et,uC),Fe(w,iP),Fe(w,kd))),D.ADD_TAGS&&(et===m&&(et=Wa(et)),Fe(et,D.ADD_TAGS,gn)),D.ADD_ATTR&&(w===p&&(w=Wa(w)),Fe(w,D.ADD_ATTR,gn)),D.ADD_URI_SAFE_ATTR&&Fe(ti,D.ADD_URI_SAFE_ATTR,gn),D.FORBID_CONTENTS&&(We===Se&&(We=Wa(We)),Fe(We,D.FORBID_CONTENTS,gn)),ce&&(et["#text"]=!0),_&&Fe(et,["html","head","body"]),et.table&&(Fe(et,["tbody"]),delete $.tbody),D.TRUSTED_TYPES_POLICY){if(typeof D.TRUSTED_TYPES_POLICY.createHTML!="function")throw ac('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof D.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ac('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');O=D.TRUSTED_TYPES_POLICY,L=O.createHTML("")}else O===void 0&&(O=mV(f,i)),O!==null&&typeof L=="string"&&(L=O.createHTML(""));zn&&zn(D),Rl=D}},OT=Fe({},[...aC,...lC,...iV]),xT=Fe({},[...uC,...oV]),O$=function(D){let ee=P(D);(!ee||!ee.tagName)&&(ee={namespaceURI:ft,tagName:"template"});const ge=Cg(D.tagName),_t=Cg(ee.tagName);return $e[D.namespaceURI]?D.namespaceURI===Ct?ee.namespaceURI===Zt?ge==="svg":ee.namespaceURI===Or?ge==="svg"&&(_t==="annotation-xml"||Js[_t]):!!OT[ge]:D.namespaceURI===Or?ee.namespaceURI===Zt?ge==="math":ee.namespaceURI===Ct?ge==="math"&&ea[_t]:!!xT[ge]:D.namespaceURI===Zt?ee.namespaceURI===Ct&&!ea[_t]||ee.namespaceURI===Or&&!Js[_t]?!1:!xT[ge]&&(_$[ge]||!OT[ge]):!!(nc==="application/xhtml+xml"&&$e[D.namespaceURI]):!1},xi=function(D){oc(e.removed,{element:D});try{P(D).removeChild(D)}catch{y(D)}},Nd=function(D,ee){try{oc(e.removed,{attribute:ee.getAttributeNode(D),from:ee})}catch{oc(e.removed,{attribute:null,from:ee})}if(ee.removeAttribute(D),D==="is")if(x||N)try{xi(ee)}catch{}else try{ee.setAttribute(D,"")}catch{}},AT=function(D){let ee=null,ge=null;if(W)D="<remove></remove>"+D;else{const yn=eP(D,/^[\r\n\t ]+/);ge=yn&&yn[0]}nc==="application/xhtml+xml"&&ft===Zt&&(D='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+D+"</body></html>");const _t=O?O.createHTML(D):D;if(ft===Zt)try{ee=new d().parseFromString(_t,nc)}catch{}if(!ee||!ee.documentElement){ee=T.createDocument(ft,"template",null);try{ee.documentElement.innerHTML=yt?L:_t}catch{}}const En=ee.body||ee.documentElement;return D&&ge&&En.insertBefore(n.createTextNode(ge),En.childNodes[0]||null),ft===Zt?U.call(ee,_?"html":"body")[0]:_?ee.documentElement:En},HT=function(D){return A.call(D.ownerDocument||D,D,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},$p=function(D){return D instanceof h&&(typeof D.nodeName!="string"||typeof D.textContent!="string"||typeof D.removeChild!="function"||!(D.attributes instanceof c)||typeof D.removeAttribute!="function"||typeof D.setAttribute!="function"||typeof D.namespaceURI!="string"||typeof D.insertBefore!="function"||typeof D.hasChildNodes!="function")},NT=function(D){return typeof a=="function"&&D instanceof a};function wo(we,D,ee){Dd(we,ge=>{ge.call(e,D,ee,Rl)})}const DT=function(D){let ee=null;if(wo(Z.beforeSanitizeElements,D,null),$p(D))return xi(D),!0;const ge=gn(D.nodeName);if(wo(Z.uponSanitizeElement,D,{tagName:ge,allowedTags:et}),D.hasChildNodes()&&!NT(D.firstElementChild)&&Dn(/<[/\w!]/g,D.innerHTML)&&Dn(/<[/\w!]/g,D.textContent)||D.nodeType===uc.progressingInstruction||k&&D.nodeType===uc.comment&&Dn(/<[/\w]/g,D.data))return xi(D),!0;if(!et[ge]||$[ge]){if(!$[ge]&<(ge)&&(I.tagNameCheck instanceof RegExp&&Dn(I.tagNameCheck,ge)||I.tagNameCheck instanceof Function&&I.tagNameCheck(ge)))return!1;if(ce&&!We[ge]){const _t=P(D)||D.parentNode,En=v(D)||D.childNodes;if(En&&_t){const yn=En.length;for(let Kn=yn-1;Kn>=0;--Kn){const Ai=C(En[Kn],!0);Ai.__removalCount=(D.__removalCount||0)+1,_t.insertBefore(Ai,E(D))}}}return xi(D),!0}return D instanceof l&&!O$(D)||(ge==="noscript"||ge==="noembed"||ge==="noframes")&&Dn(/<\/no(script|embed|frames)/i,D.innerHTML)?(xi(D),!0):(S&&D.nodeType===uc.text&&(ee=D.textContent,Dd([J,se,te],_t=>{ee=sc(ee,_t," ")}),D.textContent!==ee&&(oc(e.removed,{element:D.cloneNode()}),D.textContent=ee)),wo(Z.afterSanitizeElements,D,null),!1)},kT=function(D,ee,ge){if(F&&(ee==="id"||ee==="name")&&(ge in n||ge in P$))return!1;if(!(K&&!B[ee]&&Dn(ue,ee))){if(!(Y&&Dn(pt,ee))){if(!w[ee]||B[ee]){if(!(LT(D)&&(I.tagNameCheck instanceof RegExp&&Dn(I.tagNameCheck,D)||I.tagNameCheck instanceof Function&&I.tagNameCheck(D))&&(I.attributeNameCheck instanceof RegExp&&Dn(I.attributeNameCheck,ee)||I.attributeNameCheck instanceof Function&&I.attributeNameCheck(ee))||ee==="is"&&I.allowCustomizedBuiltInElements&&(I.tagNameCheck instanceof RegExp&&Dn(I.tagNameCheck,ge)||I.tagNameCheck instanceof Function&&I.tagNameCheck(ge))))return!1}else if(!ti[ee]){if(!Dn(fn,sc(ge,ke,""))){if(!((ee==="src"||ee==="xlink:href"||ee==="href")&&D!=="script"&&eV(ge,"data:")===0&&Le[D])){if(!(b&&!Dn(be,sc(ge,ke,"")))){if(ge)return!1}}}}}}return!0},LT=function(D){return D!=="annotation-xml"&&eP(D,wt)},$T=function(D){wo(Z.beforeSanitizeAttributes,D,null);const{attributes:ee}=D;if(!ee||$p(D))return;const ge={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:w,forceKeepAttr:void 0};let _t=ee.length;for(;_t--;){const En=ee[_t],{name:yn,namespaceURI:Kn,value:Ai}=En,rc=gn(yn);let Nn=yn==="value"?Ai:tV(Ai);if(ge.attrName=rc,ge.attrValue=Nn,ge.keepAttr=!0,ge.forceKeepAttr=void 0,wo(Z.uponSanitizeAttribute,D,ge),Nn=ge.attrValue,z&&(rc==="id"||rc==="name")&&(Nd(yn,D),Nn=oe+Nn),k&&Dn(/((--!?|])>)|<\/(style|title)/i,Nn)){Nd(yn,D);continue}if(ge.forceKeepAttr||(Nd(yn,D),!ge.keepAttr))continue;if(!R&&Dn(/\/>/i,Nn)){Nd(yn,D);continue}S&&Dd([J,se,te],VT=>{Nn=sc(Nn,VT," ")});const FT=gn(D.nodeName);if(kT(FT,rc,Nn)){if(O&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!Kn)switch(f.getAttributeType(FT,rc)){case"TrustedHTML":{Nn=O.createHTML(Nn);break}case"TrustedScriptURL":{Nn=O.createScriptURL(Nn);break}}try{Kn?D.setAttributeNS(Kn,yn,Nn):D.setAttribute(yn,Nn),$p(D)?xi(D):JI(e.removed)}catch{}}}wo(Z.afterSanitizeAttributes,D,null)},x$=function we(D){let ee=null;const ge=HT(D);for(wo(Z.beforeSanitizeShadowDOM,D,null);ee=ge.nextNode();)wo(Z.uponSanitizeShadowNode,ee,null),DT(ee),$T(ee),ee.content instanceof o&&we(ee.content);wo(Z.afterSanitizeShadowDOM,D,null)};return e.sanitize=function(we){let D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ee=null,ge=null,_t=null,En=null;if(yt=!we,yt&&(we="<!-->"),typeof we!="string"&&!NT(we))if(typeof we.toString=="function"){if(we=we.toString(),typeof we!="string")throw ac("dirty is not a string, aborting")}else throw ac("toString is not a function");if(!e.isSupported)return we;if(H||Lp(D),e.removed=[],typeof we=="string"&&(Re=!1),Re){if(we.nodeName){const Ai=gn(we.nodeName);if(!et[Ai]||$[Ai])throw ac("root node is forbidden and cannot be sanitized in-place")}}else if(we instanceof a)ee=AT("<!---->"),ge=ee.ownerDocument.importNode(we,!0),ge.nodeType===uc.element&&ge.nodeName==="BODY"||ge.nodeName==="HTML"?ee=ge:ee.appendChild(ge);else{if(!x&&!S&&!_&&we.indexOf("<")===-1)return O&&V?O.createHTML(we):we;if(ee=AT(we),!ee)return x?null:V?L:""}ee&&W&&xi(ee.firstChild);const yn=HT(Re?we:ee);for(;_t=yn.nextNode();)DT(_t),$T(_t),_t.content instanceof o&&x$(_t.content);if(Re)return we;if(x){if(N)for(En=q.call(ee.ownerDocument);ee.firstChild;)En.appendChild(ee.firstChild);else En=ee;return(w.shadowroot||w.shadowrootmode)&&(En=j.call(r,En,!0)),En}let Kn=_?ee.outerHTML:ee.innerHTML;return _&&et["!doctype"]&&ee.ownerDocument&&ee.ownerDocument.doctype&&ee.ownerDocument.doctype.name&&Dn(S1,ee.ownerDocument.doctype.name)&&(Kn="<!DOCTYPE "+ee.ownerDocument.doctype.name+`>
|
|
2
|
+
`+Kn),S&&Dd([J,se,te],Ai=>{Kn=sc(Kn,Ai," ")}),O&&V?O.createHTML(Kn):Kn},e.setConfig=function(){let we=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Lp(we),H=!0},e.clearConfig=function(){Rl=null,H=!1},e.isValidAttribute=function(we,D,ee){Rl||Lp({});const ge=gn(we),_t=gn(D);return kT(ge,_t,ee)},e.addHook=function(we,D){typeof D=="function"&&oc(Z[we],D)},e.removeHook=function(we,D){if(D!==void 0){const ee=QF(Z[we],D);return ee===-1?void 0:JF(Z[we],ee,1)[0]}return JI(Z[we])},e.removeHooks=function(we){Z[we]=[]},e.removeAllHooks=function(){Z=sP()},e}var pV=R1();//! moment.js
|
|
3
|
+
//! version : 2.30.1
|
|
4
|
+
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
|
|
5
|
+
//! license : MIT
|
|
6
|
+
//! momentjs.com
|
|
7
|
+
var E1;function X(){return E1.apply(null,arguments)}function wV(t){E1=t}function Ri(t){return t instanceof Array||Object.prototype.toString.call(t)==="[object Array]"}function el(t){return t!=null&&Object.prototype.toString.call(t)==="[object Object]"}function Qe(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function rR(t){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(t).length===0;var e;for(e in t)if(Qe(t,e))return!1;return!0}function or(t){return t===void 0}function Jo(t){return typeof t=="number"||Object.prototype.toString.call(t)==="[object Number]"}function gd(t){return t instanceof Date||Object.prototype.toString.call(t)==="[object Date]"}function T1(t,e){var n=[],r,i=t.length;for(r=0;r<i;++r)n.push(e(t[r],r));return n}function Ns(t,e){for(var n in e)Qe(e,n)&&(t[n]=e[n]);return Qe(e,"toString")&&(t.toString=e.toString),Qe(e,"valueOf")&&(t.valueOf=e.valueOf),t}function fo(t,e,n,r){return q1(t,e,n,r,!0).utc()}function vV(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function Pe(t){return t._pf==null&&(t._pf=vV()),t._pf}var Bb;Array.prototype.some?Bb=Array.prototype.some:Bb=function(t){var e=Object(this),n=e.length>>>0,r;for(r=0;r<n;r++)if(r in e&&t.call(this,e[r],r,e))return!0;return!1};function iR(t){var e=null,n=!1,r=t._d&&!isNaN(t._d.getTime());if(r&&(e=Pe(t),n=Bb.call(e.parsedDateParts,function(i){return i!=null}),r=e.overflow<0&&!e.empty&&!e.invalidEra&&!e.invalidMonth&&!e.invalidWeekday&&!e.weekdayMismatch&&!e.nullInput&&!e.invalidFormat&&!e.userInvalidated&&(!e.meridiem||e.meridiem&&n),t._strict&&(r=r&&e.charsLeftOver===0&&e.unusedTokens.length===0&&e.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(t))t._isValid=r;else return r;return t._isValid}function Um(t){var e=fo(NaN);return t!=null?Ns(Pe(e),t):Pe(e).userInvalidated=!0,e}var aP=X.momentProperties=[],hC=!1;function oR(t,e){var n,r,i,o=aP.length;if(or(e._isAMomentObject)||(t._isAMomentObject=e._isAMomentObject),or(e._i)||(t._i=e._i),or(e._f)||(t._f=e._f),or(e._l)||(t._l=e._l),or(e._strict)||(t._strict=e._strict),or(e._tzm)||(t._tzm=e._tzm),or(e._isUTC)||(t._isUTC=e._isUTC),or(e._offset)||(t._offset=e._offset),or(e._pf)||(t._pf=Pe(e)),or(e._locale)||(t._locale=e._locale),o>0)for(n=0;n<o;n++)r=aP[n],i=e[r],or(i)||(t[r]=i);return t}function md(t){oR(this,t),this._d=new Date(t._d!=null?t._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),hC===!1&&(hC=!0,X.updateOffset(this),hC=!1)}function Ei(t){return t instanceof md||t!=null&&t._isAMomentObject!=null}function _1(t){X.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+t)}function Qr(t,e){var n=!0;return Ns(function(){if(X.deprecationHandler!=null&&X.deprecationHandler(null,t),n){var r=[],i,o,s,a=arguments.length;for(o=0;o<a;o++){if(i="",typeof arguments[o]=="object"){i+=`
|
|
8
|
+
[`+o+"] ";for(s in arguments[0])Qe(arguments[0],s)&&(i+=s+": "+arguments[0][s]+", ");i=i.slice(0,-2)}else i=arguments[o];r.push(i)}_1(t+`
|
|
9
|
+
Arguments: `+Array.prototype.slice.call(r).join("")+`
|
|
10
|
+
`+new Error().stack),n=!1}return e.apply(this,arguments)},e)}var lP={};function M1(t,e){X.deprecationHandler!=null&&X.deprecationHandler(t,e),lP[t]||(_1(e),lP[t]=!0)}X.suppressDeprecationWarnings=!1;X.deprecationHandler=null;function go(t){return typeof Function<"u"&&t instanceof Function||Object.prototype.toString.call(t)==="[object Function]"}function CV(t){var e,n;for(n in t)Qe(t,n)&&(e=t[n],go(e)?this[n]=e:this["_"+n]=e);this._config=t,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function jb(t,e){var n=Ns({},t),r;for(r in e)Qe(e,r)&&(el(t[r])&&el(e[r])?(n[r]={},Ns(n[r],t[r]),Ns(n[r],e[r])):e[r]!=null?n[r]=e[r]:delete n[r]);for(r in t)Qe(t,r)&&!Qe(e,r)&&el(t[r])&&(n[r]=Ns({},n[r]));return n}function sR(t){t!=null&&this.set(t)}var Ub;Object.keys?Ub=Object.keys:Ub=function(t){var e,n=[];for(e in t)Qe(t,e)&&n.push(e);return n};var yV={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function bV(t,e,n){var r=this._calendar[t]||this._calendar.sameElse;return go(r)?r.call(e,n):r}function lo(t,e,n){var r=""+Math.abs(t),i=e-r.length,o=t>=0;return(o?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+r}var aR=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Ld=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,dC={},Ru={};function Ce(t,e,n,r){var i=r;typeof r=="string"&&(i=function(){return this[r]()}),t&&(Ru[t]=i),e&&(Ru[e[0]]=function(){return lo(i.apply(this,arguments),e[1],e[2])}),n&&(Ru[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),t)})}function SV(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function RV(t){var e=t.match(aR),n,r;for(n=0,r=e.length;n<r;n++)Ru[e[n]]?e[n]=Ru[e[n]]:e[n]=SV(e[n]);return function(i){var o="",s;for(s=0;s<r;s++)o+=go(e[s])?e[s].call(i,t):e[s];return o}}function yg(t,e){return t.isValid()?(e=I1(e,t.localeData()),dC[e]=dC[e]||RV(e),dC[e](t)):t.localeData().invalidDate()}function I1(t,e){var n=5;function r(i){return e.longDateFormat(i)||i}for(Ld.lastIndex=0;n>=0&&Ld.test(t);)t=t.replace(Ld,r),Ld.lastIndex=0,n-=1;return t}var EV={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function TV(t){var e=this._longDateFormat[t],n=this._longDateFormat[t.toUpperCase()];return e||!n?e:(this._longDateFormat[t]=n.match(aR).map(function(r){return r==="MMMM"||r==="MM"||r==="DD"||r==="dddd"?r.slice(1):r}).join(""),this._longDateFormat[t])}var _V="Invalid date";function MV(){return this._invalidDate}var IV="%d",PV=/\d{1,2}/;function OV(t){return this._ordinal.replace("%d",t)}var xV={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function AV(t,e,n,r){var i=this._relativeTime[n];return go(i)?i(t,e,n,r):i.replace(/%d/i,t)}function HV(t,e){var n=this._relativeTime[t>0?"future":"past"];return go(n)?n(e):n.replace(/%s/i,e)}var uP={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function Jr(t){return typeof t=="string"?uP[t]||uP[t.toLowerCase()]:void 0}function lR(t){var e={},n,r;for(r in t)Qe(t,r)&&(n=Jr(r),n&&(e[n]=t[r]));return e}var NV={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function DV(t){var e=[],n;for(n in t)Qe(t,n)&&e.push({unit:n,priority:NV[n]});return e.sort(function(r,i){return r.priority-i.priority}),e}var P1=/\d/,Pr=/\d\d/,O1=/\d{3}/,uR=/\d{4}/,zm=/[+-]?\d{6}/,Tt=/\d\d?/,x1=/\d\d\d\d?/,A1=/\d\d\d\d\d\d?/,Ym=/\d{1,3}/,cR=/\d{1,4}/,Gm=/[+-]?\d{1,6}/,zu=/\d+/,qm=/[+-]?\d+/,kV=/Z|[+-]\d\d:?\d\d/gi,Km=/Z|[+-]\d\d(?::?\d\d)?/gi,LV=/[+-]?\d+(\.\d{1,3})?/,pd=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Yu=/^[1-9]\d?/,hR=/^([1-9]\d|\d)/,Bg;Bg={};function le(t,e,n){Bg[t]=go(e)?e:function(r,i){return r&&n?n:e}}function $V(t,e){return Qe(Bg,t)?Bg[t](e._strict,e._locale):new RegExp(FV(t))}function FV(t){return Xo(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,n,r,i,o){return n||r||i||o}))}function Xo(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Ur(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function je(t){var e=+t,n=0;return e!==0&&isFinite(e)&&(n=Ur(e)),n}var zb={};function ct(t,e){var n,r=e,i;for(typeof t=="string"&&(t=[t]),Jo(e)&&(r=function(o,s){s[e]=je(o)}),i=t.length,n=0;n<i;n++)zb[t[n]]=r}function wd(t,e){ct(t,function(n,r,i,o){i._w=i._w||{},e(n,i._w,i,o)})}function VV(t,e,n){e!=null&&Qe(zb,t)&&zb[t](e,n._a,n,t)}function Xm(t){return t%4===0&&t%100!==0||t%400===0}var Hn=0,Bo=1,ro=2,dn=3,yi=4,jo=5,qa=6,WV=7,BV=8;Ce("Y",0,0,function(){var t=this.year();return t<=9999?lo(t,4):"+"+t});Ce(0,["YY",2],0,function(){return this.year()%100});Ce(0,["YYYY",4],0,"year");Ce(0,["YYYYY",5],0,"year");Ce(0,["YYYYYY",6,!0],0,"year");le("Y",qm);le("YY",Tt,Pr);le("YYYY",cR,uR);le("YYYYY",Gm,zm);le("YYYYYY",Gm,zm);ct(["YYYYY","YYYYYY"],Hn);ct("YYYY",function(t,e){e[Hn]=t.length===2?X.parseTwoDigitYear(t):je(t)});ct("YY",function(t,e){e[Hn]=X.parseTwoDigitYear(t)});ct("Y",function(t,e){e[Hn]=parseInt(t,10)});function mh(t){return Xm(t)?366:365}X.parseTwoDigitYear=function(t){return je(t)+(je(t)>68?1900:2e3)};var H1=Gu("FullYear",!0);function jV(){return Xm(this.year())}function Gu(t,e){return function(n){return n!=null?(N1(this,t,n),X.updateOffset(this,e),this):$h(this,t)}}function $h(t,e){if(!t.isValid())return NaN;var n=t._d,r=t._isUTC;switch(e){case"Milliseconds":return r?n.getUTCMilliseconds():n.getMilliseconds();case"Seconds":return r?n.getUTCSeconds():n.getSeconds();case"Minutes":return r?n.getUTCMinutes():n.getMinutes();case"Hours":return r?n.getUTCHours():n.getHours();case"Date":return r?n.getUTCDate():n.getDate();case"Day":return r?n.getUTCDay():n.getDay();case"Month":return r?n.getUTCMonth():n.getMonth();case"FullYear":return r?n.getUTCFullYear():n.getFullYear();default:return NaN}}function N1(t,e,n){var r,i,o,s,a;if(!(!t.isValid()||isNaN(n))){switch(r=t._d,i=t._isUTC,e){case"Milliseconds":return void(i?r.setUTCMilliseconds(n):r.setMilliseconds(n));case"Seconds":return void(i?r.setUTCSeconds(n):r.setSeconds(n));case"Minutes":return void(i?r.setUTCMinutes(n):r.setMinutes(n));case"Hours":return void(i?r.setUTCHours(n):r.setHours(n));case"Date":return void(i?r.setUTCDate(n):r.setDate(n));case"FullYear":break;default:return}o=n,s=t.month(),a=t.date(),a=a===29&&s===1&&!Xm(o)?28:a,i?r.setUTCFullYear(o,s,a):r.setFullYear(o,s,a)}}function UV(t){return t=Jr(t),go(this[t])?this[t]():this}function zV(t,e){if(typeof t=="object"){t=lR(t);var n=DV(t),r,i=n.length;for(r=0;r<i;r++)this[n[r].unit](t[n[r].unit])}else if(t=Jr(t),go(this[t]))return this[t](e);return this}function YV(t,e){return(t%e+e)%e}var Gt;Array.prototype.indexOf?Gt=Array.prototype.indexOf:Gt=function(t){var e;for(e=0;e<this.length;++e)if(this[e]===t)return e;return-1};function dR(t,e){if(isNaN(t)||isNaN(e))return NaN;var n=YV(e,12);return t+=(e-n)/12,n===1?Xm(t)?29:28:31-n%7%2}Ce("M",["MM",2],"Mo",function(){return this.month()+1});Ce("MMM",0,0,function(t){return this.localeData().monthsShort(this,t)});Ce("MMMM",0,0,function(t){return this.localeData().months(this,t)});le("M",Tt,Yu);le("MM",Tt,Pr);le("MMM",function(t,e){return e.monthsShortRegex(t)});le("MMMM",function(t,e){return e.monthsRegex(t)});ct(["M","MM"],function(t,e){e[Bo]=je(t)-1});ct(["MMM","MMMM"],function(t,e,n,r){var i=n._locale.monthsParse(t,r,n._strict);i!=null?e[Bo]=i:Pe(n).invalidMonth=t});var GV="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),D1="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),k1=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,qV=pd,KV=pd;function XV(t,e){return t?Ri(this._months)?this._months[t.month()]:this._months[(this._months.isFormat||k1).test(e)?"format":"standalone"][t.month()]:Ri(this._months)?this._months:this._months.standalone}function ZV(t,e){return t?Ri(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[k1.test(e)?"format":"standalone"][t.month()]:Ri(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function QV(t,e,n){var r,i,o,s=t.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],r=0;r<12;++r)o=fo([2e3,r]),this._shortMonthsParse[r]=this.monthsShort(o,"").toLocaleLowerCase(),this._longMonthsParse[r]=this.months(o,"").toLocaleLowerCase();return n?e==="MMM"?(i=Gt.call(this._shortMonthsParse,s),i!==-1?i:null):(i=Gt.call(this._longMonthsParse,s),i!==-1?i:null):e==="MMM"?(i=Gt.call(this._shortMonthsParse,s),i!==-1?i:(i=Gt.call(this._longMonthsParse,s),i!==-1?i:null)):(i=Gt.call(this._longMonthsParse,s),i!==-1?i:(i=Gt.call(this._shortMonthsParse,s),i!==-1?i:null))}function JV(t,e,n){var r,i,o;if(this._monthsParseExact)return QV.call(this,t,e,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;r<12;r++){if(i=fo([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),!n&&!this._monthsParse[r]&&(o="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[r]=new RegExp(o.replace(".",""),"i")),n&&e==="MMMM"&&this._longMonthsParse[r].test(t))return r;if(n&&e==="MMM"&&this._shortMonthsParse[r].test(t))return r;if(!n&&this._monthsParse[r].test(t))return r}}function L1(t,e){if(!t.isValid())return t;if(typeof e=="string"){if(/^\d+$/.test(e))e=je(e);else if(e=t.localeData().monthsParse(e),!Jo(e))return t}var n=e,r=t.date();return r=r<29?r:Math.min(r,dR(t.year(),n)),t._isUTC?t._d.setUTCMonth(n,r):t._d.setMonth(n,r),t}function $1(t){return t!=null?(L1(this,t),X.updateOffset(this,!0),this):$h(this,"Month")}function eW(){return dR(this.year(),this.month())}function tW(t){return this._monthsParseExact?(Qe(this,"_monthsRegex")||F1.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):(Qe(this,"_monthsShortRegex")||(this._monthsShortRegex=qV),this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex)}function nW(t){return this._monthsParseExact?(Qe(this,"_monthsRegex")||F1.call(this),t?this._monthsStrictRegex:this._monthsRegex):(Qe(this,"_monthsRegex")||(this._monthsRegex=KV),this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex)}function F1(){function t(l,u){return u.length-l.length}var e=[],n=[],r=[],i,o,s,a;for(i=0;i<12;i++)o=fo([2e3,i]),s=Xo(this.monthsShort(o,"")),a=Xo(this.months(o,"")),e.push(s),n.push(a),r.push(a),r.push(s);e.sort(t),n.sort(t),r.sort(t),this._monthsRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+e.join("|")+")","i")}function rW(t,e,n,r,i,o,s){var a;return t<100&&t>=0?(a=new Date(t+400,e,n,r,i,o,s),isFinite(a.getFullYear())&&a.setFullYear(t)):a=new Date(t,e,n,r,i,o,s),a}function Fh(t){var e,n;return t<100&&t>=0?(n=Array.prototype.slice.call(arguments),n[0]=t+400,e=new Date(Date.UTC.apply(null,n)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t)):e=new Date(Date.UTC.apply(null,arguments)),e}function jg(t,e,n){var r=7+e-n,i=(7+Fh(t,0,r).getUTCDay()-e)%7;return-i+r-1}function V1(t,e,n,r,i){var o=(7+n-r)%7,s=jg(t,r,i),a=1+7*(e-1)+o+s,l,u;return a<=0?(l=t-1,u=mh(l)+a):a>mh(t)?(l=t+1,u=a-mh(t)):(l=t,u=a),{year:l,dayOfYear:u}}function Vh(t,e,n){var r=jg(t.year(),e,n),i=Math.floor((t.dayOfYear()-r-1)/7)+1,o,s;return i<1?(s=t.year()-1,o=i+Zo(s,e,n)):i>Zo(t.year(),e,n)?(o=i-Zo(t.year(),e,n),s=t.year()+1):(s=t.year(),o=i),{week:o,year:s}}function Zo(t,e,n){var r=jg(t,e,n),i=jg(t+1,e,n);return(mh(t)-r+i)/7}Ce("w",["ww",2],"wo","week");Ce("W",["WW",2],"Wo","isoWeek");le("w",Tt,Yu);le("ww",Tt,Pr);le("W",Tt,Yu);le("WW",Tt,Pr);wd(["w","ww","W","WW"],function(t,e,n,r){e[r.substr(0,1)]=je(t)});function iW(t){return Vh(t,this._week.dow,this._week.doy).week}var oW={dow:0,doy:6};function sW(){return this._week.dow}function aW(){return this._week.doy}function lW(t){var e=this.localeData().week(this);return t==null?e:this.add((t-e)*7,"d")}function uW(t){var e=Vh(this,1,4).week;return t==null?e:this.add((t-e)*7,"d")}Ce("d",0,"do","day");Ce("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)});Ce("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)});Ce("dddd",0,0,function(t){return this.localeData().weekdays(this,t)});Ce("e",0,0,"weekday");Ce("E",0,0,"isoWeekday");le("d",Tt);le("e",Tt);le("E",Tt);le("dd",function(t,e){return e.weekdaysMinRegex(t)});le("ddd",function(t,e){return e.weekdaysShortRegex(t)});le("dddd",function(t,e){return e.weekdaysRegex(t)});wd(["dd","ddd","dddd"],function(t,e,n,r){var i=n._locale.weekdaysParse(t,r,n._strict);i!=null?e.d=i:Pe(n).invalidWeekday=t});wd(["d","e","E"],function(t,e,n,r){e[r]=je(t)});function cW(t,e){return typeof t!="string"?t:isNaN(t)?(t=e.weekdaysParse(t),typeof t=="number"?t:null):parseInt(t,10)}function hW(t,e){return typeof t=="string"?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}function fR(t,e){return t.slice(e,7).concat(t.slice(0,e))}var dW="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),W1="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),fW="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),gW=pd,mW=pd,pW=pd;function wW(t,e){var n=Ri(this._weekdays)?this._weekdays:this._weekdays[t&&t!==!0&&this._weekdays.isFormat.test(e)?"format":"standalone"];return t===!0?fR(n,this._week.dow):t?n[t.day()]:n}function vW(t){return t===!0?fR(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort}function CW(t){return t===!0?fR(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin}function yW(t,e,n){var r,i,o,s=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)o=fo([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(o,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(o,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(o,"").toLocaleLowerCase();return n?e==="dddd"?(i=Gt.call(this._weekdaysParse,s),i!==-1?i:null):e==="ddd"?(i=Gt.call(this._shortWeekdaysParse,s),i!==-1?i:null):(i=Gt.call(this._minWeekdaysParse,s),i!==-1?i:null):e==="dddd"?(i=Gt.call(this._weekdaysParse,s),i!==-1||(i=Gt.call(this._shortWeekdaysParse,s),i!==-1)?i:(i=Gt.call(this._minWeekdaysParse,s),i!==-1?i:null)):e==="ddd"?(i=Gt.call(this._shortWeekdaysParse,s),i!==-1||(i=Gt.call(this._weekdaysParse,s),i!==-1)?i:(i=Gt.call(this._minWeekdaysParse,s),i!==-1?i:null)):(i=Gt.call(this._minWeekdaysParse,s),i!==-1||(i=Gt.call(this._weekdaysParse,s),i!==-1)?i:(i=Gt.call(this._shortWeekdaysParse,s),i!==-1?i:null))}function bW(t,e,n){var r,i,o;if(this._weekdaysParseExact)return yW.call(this,t,e,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(i=fo([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[r]||(o="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[r]=new RegExp(o.replace(".",""),"i")),n&&e==="dddd"&&this._fullWeekdaysParse[r].test(t))return r;if(n&&e==="ddd"&&this._shortWeekdaysParse[r].test(t))return r;if(n&&e==="dd"&&this._minWeekdaysParse[r].test(t))return r;if(!n&&this._weekdaysParse[r].test(t))return r}}function SW(t){if(!this.isValid())return t!=null?this:NaN;var e=$h(this,"Day");return t!=null?(t=cW(t,this.localeData()),this.add(t-e,"d")):e}function RW(t){if(!this.isValid())return t!=null?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return t==null?e:this.add(t-e,"d")}function EW(t){if(!this.isValid())return t!=null?this:NaN;if(t!=null){var e=hW(t,this.localeData());return this.day(this.day()%7?e:e-7)}else return this.day()||7}function TW(t){return this._weekdaysParseExact?(Qe(this,"_weekdaysRegex")||gR.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(Qe(this,"_weekdaysRegex")||(this._weekdaysRegex=gW),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)}function _W(t){return this._weekdaysParseExact?(Qe(this,"_weekdaysRegex")||gR.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(Qe(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=mW),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function MW(t){return this._weekdaysParseExact?(Qe(this,"_weekdaysRegex")||gR.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(Qe(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=pW),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function gR(){function t(c,h){return h.length-c.length}var e=[],n=[],r=[],i=[],o,s,a,l,u;for(o=0;o<7;o++)s=fo([2e3,1]).day(o),a=Xo(this.weekdaysMin(s,"")),l=Xo(this.weekdaysShort(s,"")),u=Xo(this.weekdays(s,"")),e.push(a),n.push(l),r.push(u),i.push(a),i.push(l),i.push(u);e.sort(t),n.sort(t),r.sort(t),i.sort(t),this._weekdaysRegex=new RegExp("^("+i.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+e.join("|")+")","i")}function mR(){return this.hours()%12||12}function IW(){return this.hours()||24}Ce("H",["HH",2],0,"hour");Ce("h",["hh",2],0,mR);Ce("k",["kk",2],0,IW);Ce("hmm",0,0,function(){return""+mR.apply(this)+lo(this.minutes(),2)});Ce("hmmss",0,0,function(){return""+mR.apply(this)+lo(this.minutes(),2)+lo(this.seconds(),2)});Ce("Hmm",0,0,function(){return""+this.hours()+lo(this.minutes(),2)});Ce("Hmmss",0,0,function(){return""+this.hours()+lo(this.minutes(),2)+lo(this.seconds(),2)});function B1(t,e){Ce(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}B1("a",!0);B1("A",!1);function j1(t,e){return e._meridiemParse}le("a",j1);le("A",j1);le("H",Tt,hR);le("h",Tt,Yu);le("k",Tt,Yu);le("HH",Tt,Pr);le("hh",Tt,Pr);le("kk",Tt,Pr);le("hmm",x1);le("hmmss",A1);le("Hmm",x1);le("Hmmss",A1);ct(["H","HH"],dn);ct(["k","kk"],function(t,e,n){var r=je(t);e[dn]=r===24?0:r});ct(["a","A"],function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t});ct(["h","hh"],function(t,e,n){e[dn]=je(t),Pe(n).bigHour=!0});ct("hmm",function(t,e,n){var r=t.length-2;e[dn]=je(t.substr(0,r)),e[yi]=je(t.substr(r)),Pe(n).bigHour=!0});ct("hmmss",function(t,e,n){var r=t.length-4,i=t.length-2;e[dn]=je(t.substr(0,r)),e[yi]=je(t.substr(r,2)),e[jo]=je(t.substr(i)),Pe(n).bigHour=!0});ct("Hmm",function(t,e,n){var r=t.length-2;e[dn]=je(t.substr(0,r)),e[yi]=je(t.substr(r))});ct("Hmmss",function(t,e,n){var r=t.length-4,i=t.length-2;e[dn]=je(t.substr(0,r)),e[yi]=je(t.substr(r,2)),e[jo]=je(t.substr(i))});function PW(t){return(t+"").toLowerCase().charAt(0)==="p"}var OW=/[ap]\.?m?\.?/i,xW=Gu("Hours",!0);function AW(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"}var U1={calendar:yV,longDateFormat:EV,invalidDate:_V,ordinal:IV,dayOfMonthOrdinalParse:PV,relativeTime:xV,months:GV,monthsShort:D1,week:oW,weekdays:dW,weekdaysMin:fW,weekdaysShort:W1,meridiemParse:OW},Mt={},cc={},Wh;function HW(t,e){var n,r=Math.min(t.length,e.length);for(n=0;n<r;n+=1)if(t[n]!==e[n])return n;return r}function cP(t){return t&&t.toLowerCase().replace("_","-")}function NW(t){for(var e=0,n,r,i,o;e<t.length;){for(o=cP(t[e]).split("-"),n=o.length,r=cP(t[e+1]),r=r?r.split("-"):null;n>0;){if(i=Zm(o.slice(0,n).join("-")),i)return i;if(r&&r.length>=n&&HW(o,r)>=n-1)break;n--}e++}return Wh}function DW(t){return!!(t&&t.match("^[^/\\\\]*$"))}function Zm(t){var e=null,n;if(Mt[t]===void 0&&typeof module<"u"&&module&&module.exports&&DW(t))try{e=Wh._abbr,n=require,n("./locale/"+t),Ws(e)}catch{Mt[t]=null}return Mt[t]}function Ws(t,e){var n;return t&&(or(e)?n=is(t):n=pR(t,e),n?Wh=n:typeof console<"u"&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),Wh._abbr}function pR(t,e){if(e!==null){var n,r=U1;if(e.abbr=t,Mt[t]!=null)M1("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),r=Mt[t]._config;else if(e.parentLocale!=null)if(Mt[e.parentLocale]!=null)r=Mt[e.parentLocale]._config;else if(n=Zm(e.parentLocale),n!=null)r=n._config;else return cc[e.parentLocale]||(cc[e.parentLocale]=[]),cc[e.parentLocale].push({name:t,config:e}),null;return Mt[t]=new sR(jb(r,e)),cc[t]&&cc[t].forEach(function(i){pR(i.name,i.config)}),Ws(t),Mt[t]}else return delete Mt[t],null}function kW(t,e){if(e!=null){var n,r,i=U1;Mt[t]!=null&&Mt[t].parentLocale!=null?Mt[t].set(jb(Mt[t]._config,e)):(r=Zm(t),r!=null&&(i=r._config),e=jb(i,e),r==null&&(e.abbr=t),n=new sR(e),n.parentLocale=Mt[t],Mt[t]=n),Ws(t)}else Mt[t]!=null&&(Mt[t].parentLocale!=null?(Mt[t]=Mt[t].parentLocale,t===Ws()&&Ws(t)):Mt[t]!=null&&delete Mt[t]);return Mt[t]}function is(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return Wh;if(!Ri(t)){if(e=Zm(t),e)return e;t=[t]}return NW(t)}function LW(){return Ub(Mt)}function wR(t){var e,n=t._a;return n&&Pe(t).overflow===-2&&(e=n[Bo]<0||n[Bo]>11?Bo:n[ro]<1||n[ro]>dR(n[Hn],n[Bo])?ro:n[dn]<0||n[dn]>24||n[dn]===24&&(n[yi]!==0||n[jo]!==0||n[qa]!==0)?dn:n[yi]<0||n[yi]>59?yi:n[jo]<0||n[jo]>59?jo:n[qa]<0||n[qa]>999?qa:-1,Pe(t)._overflowDayOfYear&&(e<Hn||e>ro)&&(e=ro),Pe(t)._overflowWeeks&&e===-1&&(e=WV),Pe(t)._overflowWeekday&&e===-1&&(e=BV),Pe(t).overflow=e),t}var $W=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,FW=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,VW=/Z|[+-]\d\d(?::?\d\d)?/,$d=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],fC=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],WW=/^\/?Date\((-?\d+)/i,BW=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,jW={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function z1(t){var e,n,r=t._i,i=$W.exec(r)||FW.exec(r),o,s,a,l,u=$d.length,c=fC.length;if(i){for(Pe(t).iso=!0,e=0,n=u;e<n;e++)if($d[e][1].exec(i[1])){s=$d[e][0],o=$d[e][2]!==!1;break}if(s==null){t._isValid=!1;return}if(i[3]){for(e=0,n=c;e<n;e++)if(fC[e][1].exec(i[3])){a=(i[2]||" ")+fC[e][0];break}if(a==null){t._isValid=!1;return}}if(!o&&a!=null){t._isValid=!1;return}if(i[4])if(VW.exec(i[4]))l="Z";else{t._isValid=!1;return}t._f=s+(a||"")+(l||""),CR(t)}else t._isValid=!1}function UW(t,e,n,r,i,o){var s=[zW(t),D1.indexOf(e),parseInt(n,10),parseInt(r,10),parseInt(i,10)];return o&&s.push(parseInt(o,10)),s}function zW(t){var e=parseInt(t,10);return e<=49?2e3+e:e<=999?1900+e:e}function YW(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function GW(t,e,n){if(t){var r=W1.indexOf(t),i=new Date(e[0],e[1],e[2]).getDay();if(r!==i)return Pe(n).weekdayMismatch=!0,n._isValid=!1,!1}return!0}function qW(t,e,n){if(t)return jW[t];if(e)return 0;var r=parseInt(n,10),i=r%100,o=(r-i)/100;return o*60+i}function Y1(t){var e=BW.exec(YW(t._i)),n;if(e){if(n=UW(e[4],e[3],e[2],e[5],e[6],e[7]),!GW(e[1],n,t))return;t._a=n,t._tzm=qW(e[8],e[9],e[10]),t._d=Fh.apply(null,t._a),t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),Pe(t).rfc2822=!0}else t._isValid=!1}function KW(t){var e=WW.exec(t._i);if(e!==null){t._d=new Date(+e[1]);return}if(z1(t),t._isValid===!1)delete t._isValid;else return;if(Y1(t),t._isValid===!1)delete t._isValid;else return;t._strict?t._isValid=!1:X.createFromInputFallback(t)}X.createFromInputFallback=Qr("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))});function lu(t,e,n){return t??e??n}function XW(t){var e=new Date(X.now());return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}function vR(t){var e,n,r=[],i,o,s;if(!t._d){for(i=XW(t),t._w&&t._a[ro]==null&&t._a[Bo]==null&&ZW(t),t._dayOfYear!=null&&(s=lu(t._a[Hn],i[Hn]),(t._dayOfYear>mh(s)||t._dayOfYear===0)&&(Pe(t)._overflowDayOfYear=!0),n=Fh(s,0,t._dayOfYear),t._a[Bo]=n.getUTCMonth(),t._a[ro]=n.getUTCDate()),e=0;e<3&&t._a[e]==null;++e)t._a[e]=r[e]=i[e];for(;e<7;e++)t._a[e]=r[e]=t._a[e]==null?e===2?1:0:t._a[e];t._a[dn]===24&&t._a[yi]===0&&t._a[jo]===0&&t._a[qa]===0&&(t._nextDay=!0,t._a[dn]=0),t._d=(t._useUTC?Fh:rW).apply(null,r),o=t._useUTC?t._d.getUTCDay():t._d.getDay(),t._tzm!=null&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[dn]=24),t._w&&typeof t._w.d<"u"&&t._w.d!==o&&(Pe(t).weekdayMismatch=!0)}}function ZW(t){var e,n,r,i,o,s,a,l,u;e=t._w,e.GG!=null||e.W!=null||e.E!=null?(o=1,s=4,n=lu(e.GG,t._a[Hn],Vh(Et(),1,4).year),r=lu(e.W,1),i=lu(e.E,1),(i<1||i>7)&&(l=!0)):(o=t._locale._week.dow,s=t._locale._week.doy,u=Vh(Et(),o,s),n=lu(e.gg,t._a[Hn],u.year),r=lu(e.w,u.week),e.d!=null?(i=e.d,(i<0||i>6)&&(l=!0)):e.e!=null?(i=e.e+o,(e.e<0||e.e>6)&&(l=!0)):i=o),r<1||r>Zo(n,o,s)?Pe(t)._overflowWeeks=!0:l!=null?Pe(t)._overflowWeekday=!0:(a=V1(n,r,i,o,s),t._a[Hn]=a.year,t._dayOfYear=a.dayOfYear)}X.ISO_8601=function(){};X.RFC_2822=function(){};function CR(t){if(t._f===X.ISO_8601){z1(t);return}if(t._f===X.RFC_2822){Y1(t);return}t._a=[],Pe(t).empty=!0;var e=""+t._i,n,r,i,o,s,a=e.length,l=0,u,c;for(i=I1(t._f,t._locale).match(aR)||[],c=i.length,n=0;n<c;n++)o=i[n],r=(e.match($V(o,t))||[])[0],r&&(s=e.substr(0,e.indexOf(r)),s.length>0&&Pe(t).unusedInput.push(s),e=e.slice(e.indexOf(r)+r.length),l+=r.length),Ru[o]?(r?Pe(t).empty=!1:Pe(t).unusedTokens.push(o),VV(o,r,t)):t._strict&&!r&&Pe(t).unusedTokens.push(o);Pe(t).charsLeftOver=a-l,e.length>0&&Pe(t).unusedInput.push(e),t._a[dn]<=12&&Pe(t).bigHour===!0&&t._a[dn]>0&&(Pe(t).bigHour=void 0),Pe(t).parsedDateParts=t._a.slice(0),Pe(t).meridiem=t._meridiem,t._a[dn]=QW(t._locale,t._a[dn],t._meridiem),u=Pe(t).era,u!==null&&(t._a[Hn]=t._locale.erasConvertYear(u,t._a[Hn])),vR(t),wR(t)}function QW(t,e,n){var r;return n==null?e:t.meridiemHour!=null?t.meridiemHour(e,n):(t.isPM!=null&&(r=t.isPM(n),r&&e<12&&(e+=12),!r&&e===12&&(e=0)),e)}function JW(t){var e,n,r,i,o,s,a=!1,l=t._f.length;if(l===0){Pe(t).invalidFormat=!0,t._d=new Date(NaN);return}for(i=0;i<l;i++)o=0,s=!1,e=oR({},t),t._useUTC!=null&&(e._useUTC=t._useUTC),e._f=t._f[i],CR(e),iR(e)&&(s=!0),o+=Pe(e).charsLeftOver,o+=Pe(e).unusedTokens.length*10,Pe(e).score=o,a?o<r&&(r=o,n=e):(r==null||o<r||s)&&(r=o,n=e,s&&(a=!0));Ns(t,n||e)}function eB(t){if(!t._d){var e=lR(t._i),n=e.day===void 0?e.date:e.day;t._a=T1([e.year,e.month,n,e.hour,e.minute,e.second,e.millisecond],function(r){return r&&parseInt(r,10)}),vR(t)}}function tB(t){var e=new md(wR(G1(t)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function G1(t){var e=t._i,n=t._f;return t._locale=t._locale||is(t._l),e===null||n===void 0&&e===""?Um({nullInput:!0}):(typeof e=="string"&&(t._i=e=t._locale.preparse(e)),Ei(e)?new md(wR(e)):(gd(e)?t._d=e:Ri(n)?JW(t):n?CR(t):nB(t),iR(t)||(t._d=null),t))}function nB(t){var e=t._i;or(e)?t._d=new Date(X.now()):gd(e)?t._d=new Date(e.valueOf()):typeof e=="string"?KW(t):Ri(e)?(t._a=T1(e.slice(0),function(n){return parseInt(n,10)}),vR(t)):el(e)?eB(t):Jo(e)?t._d=new Date(e):X.createFromInputFallback(t)}function q1(t,e,n,r,i){var o={};return(e===!0||e===!1)&&(r=e,e=void 0),(n===!0||n===!1)&&(r=n,n=void 0),(el(t)&&rR(t)||Ri(t)&&t.length===0)&&(t=void 0),o._isAMomentObject=!0,o._useUTC=o._isUTC=i,o._l=n,o._i=t,o._f=e,o._strict=r,tB(o)}function Et(t,e,n,r){return q1(t,e,n,r,!1)}var rB=Qr("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=Et.apply(null,arguments);return this.isValid()&&t.isValid()?t<this?this:t:Um()}),iB=Qr("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=Et.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:Um()});function K1(t,e){var n,r;if(e.length===1&&Ri(e[0])&&(e=e[0]),!e.length)return Et();for(n=e[0],r=1;r<e.length;++r)(!e[r].isValid()||e[r][t](n))&&(n=e[r]);return n}function oB(){var t=[].slice.call(arguments,0);return K1("isBefore",t)}function sB(){var t=[].slice.call(arguments,0);return K1("isAfter",t)}var aB=function(){return Date.now?Date.now():+new Date},hc=["year","quarter","month","week","day","hour","minute","second","millisecond"];function lB(t){var e,n=!1,r,i=hc.length;for(e in t)if(Qe(t,e)&&!(Gt.call(hc,e)!==-1&&(t[e]==null||!isNaN(t[e]))))return!1;for(r=0;r<i;++r)if(t[hc[r]]){if(n)return!1;parseFloat(t[hc[r]])!==je(t[hc[r]])&&(n=!0)}return!0}function uB(){return this._isValid}function cB(){return Ii(NaN)}function Qm(t){var e=lR(t),n=e.year||0,r=e.quarter||0,i=e.month||0,o=e.week||e.isoWeek||0,s=e.day||0,a=e.hour||0,l=e.minute||0,u=e.second||0,c=e.millisecond||0;this._isValid=lB(e),this._milliseconds=+c+u*1e3+l*6e4+a*1e3*60*60,this._days=+s+o*7,this._months=+i+r*3+n*12,this._data={},this._locale=is(),this._bubble()}function bg(t){return t instanceof Qm}function Yb(t){return t<0?Math.round(-1*t)*-1:Math.round(t)}function hB(t,e,n){var r=Math.min(t.length,e.length),i=Math.abs(t.length-e.length),o=0,s;for(s=0;s<r;s++)je(t[s])!==je(e[s])&&o++;return o+i}function X1(t,e){Ce(t,0,0,function(){var n=this.utcOffset(),r="+";return n<0&&(n=-n,r="-"),r+lo(~~(n/60),2)+e+lo(~~n%60,2)})}X1("Z",":");X1("ZZ","");le("Z",Km);le("ZZ",Km);ct(["Z","ZZ"],function(t,e,n){n._useUTC=!0,n._tzm=yR(Km,t)});var dB=/([\+\-]|\d\d)/gi;function yR(t,e){var n=(e||"").match(t),r,i,o;return n===null?null:(r=n[n.length-1]||[],i=(r+"").match(dB)||["-",0,0],o=+(i[1]*60)+je(i[2]),o===0?0:i[0]==="+"?o:-o)}function bR(t,e){var n,r;return e._isUTC?(n=e.clone(),r=(Ei(t)||gd(t)?t.valueOf():Et(t).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+r),X.updateOffset(n,!1),n):Et(t).local()}function Gb(t){return-Math.round(t._d.getTimezoneOffset())}X.updateOffset=function(){};function fB(t,e,n){var r=this._offset||0,i;if(!this.isValid())return t!=null?this:NaN;if(t!=null){if(typeof t=="string"){if(t=yR(Km,t),t===null)return this}else Math.abs(t)<16&&!n&&(t=t*60);return!this._isUTC&&e&&(i=Gb(this)),this._offset=t,this._isUTC=!0,i!=null&&this.add(i,"m"),r!==t&&(!e||this._changeInProgress?J1(this,Ii(t-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,X.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?r:Gb(this)}function gB(t,e){return t!=null?(typeof t!="string"&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}function mB(t){return this.utcOffset(0,t)}function pB(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(Gb(this),"m")),this}function wB(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var t=yR(kV,this._i);t!=null?this.utcOffset(t):this.utcOffset(0,!0)}return this}function vB(t){return this.isValid()?(t=t?Et(t).utcOffset():0,(this.utcOffset()-t)%60===0):!1}function CB(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function yB(){if(!or(this._isDSTShifted))return this._isDSTShifted;var t={},e;return oR(t,this),t=G1(t),t._a?(e=t._isUTC?fo(t._a):Et(t._a),this._isDSTShifted=this.isValid()&&hB(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function bB(){return this.isValid()?!this._isUTC:!1}function SB(){return this.isValid()?this._isUTC:!1}function Z1(){return this.isValid()?this._isUTC&&this._offset===0:!1}var RB=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,EB=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Ii(t,e){var n=t,r=null,i,o,s;return bg(t)?n={ms:t._milliseconds,d:t._days,M:t._months}:Jo(t)||!isNaN(+t)?(n={},e?n[e]=+t:n.milliseconds=+t):(r=RB.exec(t))?(i=r[1]==="-"?-1:1,n={y:0,d:je(r[ro])*i,h:je(r[dn])*i,m:je(r[yi])*i,s:je(r[jo])*i,ms:je(Yb(r[qa]*1e3))*i}):(r=EB.exec(t))?(i=r[1]==="-"?-1:1,n={y:ta(r[2],i),M:ta(r[3],i),w:ta(r[4],i),d:ta(r[5],i),h:ta(r[6],i),m:ta(r[7],i),s:ta(r[8],i)}):n==null?n={}:typeof n=="object"&&("from"in n||"to"in n)&&(s=TB(Et(n.from),Et(n.to)),n={},n.ms=s.milliseconds,n.M=s.months),o=new Qm(n),bg(t)&&Qe(t,"_locale")&&(o._locale=t._locale),bg(t)&&Qe(t,"_isValid")&&(o._isValid=t._isValid),o}Ii.fn=Qm.prototype;Ii.invalid=cB;function ta(t,e){var n=t&&parseFloat(t.replace(",","."));return(isNaN(n)?0:n)*e}function hP(t,e){var n={};return n.months=e.month()-t.month()+(e.year()-t.year())*12,t.clone().add(n.months,"M").isAfter(e)&&--n.months,n.milliseconds=+e-+t.clone().add(n.months,"M"),n}function TB(t,e){var n;return t.isValid()&&e.isValid()?(e=bR(e,t),t.isBefore(e)?n=hP(t,e):(n=hP(e,t),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function Q1(t,e){return function(n,r){var i,o;return r!==null&&!isNaN(+r)&&(M1(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),o=n,n=r,r=o),i=Ii(n,r),J1(this,i,t),this}}function J1(t,e,n,r){var i=e._milliseconds,o=Yb(e._days),s=Yb(e._months);t.isValid()&&(r=r??!0,s&&L1(t,$h(t,"Month")+s*n),o&&N1(t,"Date",$h(t,"Date")+o*n),i&&t._d.setTime(t._d.valueOf()+i*n),r&&X.updateOffset(t,o||s))}var _B=Q1(1,"add"),MB=Q1(-1,"subtract");function eN(t){return typeof t=="string"||t instanceof String}function IB(t){return Ei(t)||gd(t)||eN(t)||Jo(t)||OB(t)||PB(t)||t===null||t===void 0}function PB(t){var e=el(t)&&!rR(t),n=!1,r=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],i,o,s=r.length;for(i=0;i<s;i+=1)o=r[i],n=n||Qe(t,o);return e&&n}function OB(t){var e=Ri(t),n=!1;return e&&(n=t.filter(function(r){return!Jo(r)&&eN(t)}).length===0),e&&n}function xB(t){var e=el(t)&&!rR(t),n=!1,r=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],i,o;for(i=0;i<r.length;i+=1)o=r[i],n=n||Qe(t,o);return e&&n}function AB(t,e){var n=t.diff(e,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"}function HB(t,e){arguments.length===1&&(arguments[0]?IB(arguments[0])?(t=arguments[0],e=void 0):xB(arguments[0])&&(e=arguments[0],t=void 0):(t=void 0,e=void 0));var n=t||Et(),r=bR(n,this).startOf("day"),i=X.calendarFormat(this,r)||"sameElse",o=e&&(go(e[i])?e[i].call(this,n):e[i]);return this.format(o||this.localeData().calendar(i,this,Et(n)))}function NB(){return new md(this)}function DB(t,e){var n=Ei(t)?t:Et(t);return this.isValid()&&n.isValid()?(e=Jr(e)||"millisecond",e==="millisecond"?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(e).valueOf()):!1}function kB(t,e){var n=Ei(t)?t:Et(t);return this.isValid()&&n.isValid()?(e=Jr(e)||"millisecond",e==="millisecond"?this.valueOf()<n.valueOf():this.clone().endOf(e).valueOf()<n.valueOf()):!1}function LB(t,e,n,r){var i=Ei(t)?t:Et(t),o=Ei(e)?e:Et(e);return this.isValid()&&i.isValid()&&o.isValid()?(r=r||"()",(r[0]==="("?this.isAfter(i,n):!this.isBefore(i,n))&&(r[1]===")"?this.isBefore(o,n):!this.isAfter(o,n))):!1}function $B(t,e){var n=Ei(t)?t:Et(t),r;return this.isValid()&&n.isValid()?(e=Jr(e)||"millisecond",e==="millisecond"?this.valueOf()===n.valueOf():(r=n.valueOf(),this.clone().startOf(e).valueOf()<=r&&r<=this.clone().endOf(e).valueOf())):!1}function FB(t,e){return this.isSame(t,e)||this.isAfter(t,e)}function VB(t,e){return this.isSame(t,e)||this.isBefore(t,e)}function WB(t,e,n){var r,i,o;if(!this.isValid())return NaN;if(r=bR(t,this),!r.isValid())return NaN;switch(i=(r.utcOffset()-this.utcOffset())*6e4,e=Jr(e),e){case"year":o=Sg(this,r)/12;break;case"month":o=Sg(this,r);break;case"quarter":o=Sg(this,r)/3;break;case"second":o=(this-r)/1e3;break;case"minute":o=(this-r)/6e4;break;case"hour":o=(this-r)/36e5;break;case"day":o=(this-r-i)/864e5;break;case"week":o=(this-r-i)/6048e5;break;default:o=this-r}return n?o:Ur(o)}function Sg(t,e){if(t.date()<e.date())return-Sg(e,t);var n=(e.year()-t.year())*12+(e.month()-t.month()),r=t.clone().add(n,"months"),i,o;return e-r<0?(i=t.clone().add(n-1,"months"),o=(e-r)/(r-i)):(i=t.clone().add(n+1,"months"),o=(e-r)/(i-r)),-(n+o)||0}X.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";X.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function BB(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function jB(t){if(!this.isValid())return null;var e=t!==!0,n=e?this.clone().utc():this;return n.year()<0||n.year()>9999?yg(n,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):go(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",yg(n,"Z")):yg(n,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function UB(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t="moment",e="",n,r,i,o;return this.isLocal()||(t=this.utcOffset()===0?"moment.utc":"moment.parseZone",e="Z"),n="["+t+'("]',r=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",i="-MM-DD[T]HH:mm:ss.SSS",o=e+'[")]',this.format(n+r+i+o)}function zB(t){t||(t=this.isUtc()?X.defaultFormatUtc:X.defaultFormat);var e=yg(this,t);return this.localeData().postformat(e)}function YB(t,e){return this.isValid()&&(Ei(t)&&t.isValid()||Et(t).isValid())?Ii({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function GB(t){return this.from(Et(),t)}function qB(t,e){return this.isValid()&&(Ei(t)&&t.isValid()||Et(t).isValid())?Ii({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function KB(t){return this.to(Et(),t)}function tN(t){var e;return t===void 0?this._locale._abbr:(e=is(t),e!=null&&(this._locale=e),this)}var nN=Qr("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return t===void 0?this.localeData():this.locale(t)});function rN(){return this._locale}var Ug=1e3,Eu=60*Ug,zg=60*Eu,iN=(365*400+97)*24*zg;function Tu(t,e){return(t%e+e)%e}function oN(t,e,n){return t<100&&t>=0?new Date(t+400,e,n)-iN:new Date(t,e,n).valueOf()}function sN(t,e,n){return t<100&&t>=0?Date.UTC(t+400,e,n)-iN:Date.UTC(t,e,n)}function XB(t){var e,n;if(t=Jr(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?sN:oN,t){case"year":e=n(this.year(),0,1);break;case"quarter":e=n(this.year(),this.month()-this.month()%3,1);break;case"month":e=n(this.year(),this.month(),1);break;case"week":e=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":e=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":e=n(this.year(),this.month(),this.date());break;case"hour":e=this._d.valueOf(),e-=Tu(e+(this._isUTC?0:this.utcOffset()*Eu),zg);break;case"minute":e=this._d.valueOf(),e-=Tu(e,Eu);break;case"second":e=this._d.valueOf(),e-=Tu(e,Ug);break}return this._d.setTime(e),X.updateOffset(this,!0),this}function ZB(t){var e,n;if(t=Jr(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?sN:oN,t){case"year":e=n(this.year()+1,0,1)-1;break;case"quarter":e=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":e=n(this.year(),this.month()+1,1)-1;break;case"week":e=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":e=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":e=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":e=this._d.valueOf(),e+=zg-Tu(e+(this._isUTC?0:this.utcOffset()*Eu),zg)-1;break;case"minute":e=this._d.valueOf(),e+=Eu-Tu(e,Eu)-1;break;case"second":e=this._d.valueOf(),e+=Ug-Tu(e,Ug)-1;break}return this._d.setTime(e),X.updateOffset(this,!0),this}function QB(){return this._d.valueOf()-(this._offset||0)*6e4}function JB(){return Math.floor(this.valueOf()/1e3)}function ej(){return new Date(this.valueOf())}function tj(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]}function nj(){var t=this;return{years:t.year(),months:t.month(),date:t.date(),hours:t.hours(),minutes:t.minutes(),seconds:t.seconds(),milliseconds:t.milliseconds()}}function rj(){return this.isValid()?this.toISOString():null}function ij(){return iR(this)}function oj(){return Ns({},Pe(this))}function sj(){return Pe(this).overflow}function aj(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}Ce("N",0,0,"eraAbbr");Ce("NN",0,0,"eraAbbr");Ce("NNN",0,0,"eraAbbr");Ce("NNNN",0,0,"eraName");Ce("NNNNN",0,0,"eraNarrow");Ce("y",["y",1],"yo","eraYear");Ce("y",["yy",2],0,"eraYear");Ce("y",["yyy",3],0,"eraYear");Ce("y",["yyyy",4],0,"eraYear");le("N",SR);le("NN",SR);le("NNN",SR);le("NNNN",vj);le("NNNNN",Cj);ct(["N","NN","NNN","NNNN","NNNNN"],function(t,e,n,r){var i=n._locale.erasParse(t,r,n._strict);i?Pe(n).era=i:Pe(n).invalidEra=t});le("y",zu);le("yy",zu);le("yyy",zu);le("yyyy",zu);le("yo",yj);ct(["y","yy","yyy","yyyy"],Hn);ct(["yo"],function(t,e,n,r){var i;n._locale._eraYearOrdinalRegex&&(i=t.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?e[Hn]=n._locale.eraYearOrdinalParse(t,i):e[Hn]=parseInt(t,10)});function lj(t,e){var n,r,i,o=this._eras||is("en")._eras;for(n=0,r=o.length;n<r;++n){switch(typeof o[n].since){case"string":i=X(o[n].since).startOf("day"),o[n].since=i.valueOf();break}switch(typeof o[n].until){case"undefined":o[n].until=1/0;break;case"string":i=X(o[n].until).startOf("day").valueOf(),o[n].until=i.valueOf();break}}return o}function uj(t,e,n){var r,i,o=this.eras(),s,a,l;for(t=t.toUpperCase(),r=0,i=o.length;r<i;++r)if(s=o[r].name.toUpperCase(),a=o[r].abbr.toUpperCase(),l=o[r].narrow.toUpperCase(),n)switch(e){case"N":case"NN":case"NNN":if(a===t)return o[r];break;case"NNNN":if(s===t)return o[r];break;case"NNNNN":if(l===t)return o[r];break}else if([s,a,l].indexOf(t)>=0)return o[r]}function cj(t,e){var n=t.since<=t.until?1:-1;return e===void 0?X(t.since).year():X(t.since).year()+(e-t.offset)*n}function hj(){var t,e,n,r=this.localeData().eras();for(t=0,e=r.length;t<e;++t)if(n=this.clone().startOf("day").valueOf(),r[t].since<=n&&n<=r[t].until||r[t].until<=n&&n<=r[t].since)return r[t].name;return""}function dj(){var t,e,n,r=this.localeData().eras();for(t=0,e=r.length;t<e;++t)if(n=this.clone().startOf("day").valueOf(),r[t].since<=n&&n<=r[t].until||r[t].until<=n&&n<=r[t].since)return r[t].narrow;return""}function fj(){var t,e,n,r=this.localeData().eras();for(t=0,e=r.length;t<e;++t)if(n=this.clone().startOf("day").valueOf(),r[t].since<=n&&n<=r[t].until||r[t].until<=n&&n<=r[t].since)return r[t].abbr;return""}function gj(){var t,e,n,r,i=this.localeData().eras();for(t=0,e=i.length;t<e;++t)if(n=i[t].since<=i[t].until?1:-1,r=this.clone().startOf("day").valueOf(),i[t].since<=r&&r<=i[t].until||i[t].until<=r&&r<=i[t].since)return(this.year()-X(i[t].since).year())*n+i[t].offset;return this.year()}function mj(t){return Qe(this,"_erasNameRegex")||RR.call(this),t?this._erasNameRegex:this._erasRegex}function pj(t){return Qe(this,"_erasAbbrRegex")||RR.call(this),t?this._erasAbbrRegex:this._erasRegex}function wj(t){return Qe(this,"_erasNarrowRegex")||RR.call(this),t?this._erasNarrowRegex:this._erasRegex}function SR(t,e){return e.erasAbbrRegex(t)}function vj(t,e){return e.erasNameRegex(t)}function Cj(t,e){return e.erasNarrowRegex(t)}function yj(t,e){return e._eraYearOrdinalRegex||zu}function RR(){var t=[],e=[],n=[],r=[],i,o,s,a,l,u=this.eras();for(i=0,o=u.length;i<o;++i)s=Xo(u[i].name),a=Xo(u[i].abbr),l=Xo(u[i].narrow),e.push(s),t.push(a),n.push(l),r.push(s),r.push(a),r.push(l);this._erasRegex=new RegExp("^("+r.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+e.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+t.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+n.join("|")+")","i")}Ce(0,["gg",2],0,function(){return this.weekYear()%100});Ce(0,["GG",2],0,function(){return this.isoWeekYear()%100});function Jm(t,e){Ce(0,[t,t.length],0,e)}Jm("gggg","weekYear");Jm("ggggg","weekYear");Jm("GGGG","isoWeekYear");Jm("GGGGG","isoWeekYear");le("G",qm);le("g",qm);le("GG",Tt,Pr);le("gg",Tt,Pr);le("GGGG",cR,uR);le("gggg",cR,uR);le("GGGGG",Gm,zm);le("ggggg",Gm,zm);wd(["gggg","ggggg","GGGG","GGGGG"],function(t,e,n,r){e[r.substr(0,2)]=je(t)});wd(["gg","GG"],function(t,e,n,r){e[r]=X.parseTwoDigitYear(t)});function bj(t){return aN.call(this,t,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function Sj(t){return aN.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)}function Rj(){return Zo(this.year(),1,4)}function Ej(){return Zo(this.isoWeekYear(),1,4)}function Tj(){var t=this.localeData()._week;return Zo(this.year(),t.dow,t.doy)}function _j(){var t=this.localeData()._week;return Zo(this.weekYear(),t.dow,t.doy)}function aN(t,e,n,r,i){var o;return t==null?Vh(this,r,i).year:(o=Zo(t,r,i),e>o&&(e=o),Mj.call(this,t,e,n,r,i))}function Mj(t,e,n,r,i){var o=V1(t,e,n,r,i),s=Fh(o.year,0,o.dayOfYear);return this.year(s.getUTCFullYear()),this.month(s.getUTCMonth()),this.date(s.getUTCDate()),this}Ce("Q",0,"Qo","quarter");le("Q",P1);ct("Q",function(t,e){e[Bo]=(je(t)-1)*3});function Ij(t){return t==null?Math.ceil((this.month()+1)/3):this.month((t-1)*3+this.month()%3)}Ce("D",["DD",2],"Do","date");le("D",Tt,Yu);le("DD",Tt,Pr);le("Do",function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient});ct(["D","DD"],ro);ct("Do",function(t,e){e[ro]=je(t.match(Tt)[0])});var lN=Gu("Date",!0);Ce("DDD",["DDDD",3],"DDDo","dayOfYear");le("DDD",Ym);le("DDDD",O1);ct(["DDD","DDDD"],function(t,e,n){n._dayOfYear=je(t)});function Pj(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return t==null?e:this.add(t-e,"d")}Ce("m",["mm",2],0,"minute");le("m",Tt,hR);le("mm",Tt,Pr);ct(["m","mm"],yi);var Oj=Gu("Minutes",!1);Ce("s",["ss",2],0,"second");le("s",Tt,hR);le("ss",Tt,Pr);ct(["s","ss"],jo);var xj=Gu("Seconds",!1);Ce("S",0,0,function(){return~~(this.millisecond()/100)});Ce(0,["SS",2],0,function(){return~~(this.millisecond()/10)});Ce(0,["SSS",3],0,"millisecond");Ce(0,["SSSS",4],0,function(){return this.millisecond()*10});Ce(0,["SSSSS",5],0,function(){return this.millisecond()*100});Ce(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3});Ce(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4});Ce(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5});Ce(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6});le("S",Ym,P1);le("SS",Ym,Pr);le("SSS",Ym,O1);var Ds,uN;for(Ds="SSSS";Ds.length<=9;Ds+="S")le(Ds,zu);function Aj(t,e){e[qa]=je(("0."+t)*1e3)}for(Ds="S";Ds.length<=9;Ds+="S")ct(Ds,Aj);uN=Gu("Milliseconds",!1);Ce("z",0,0,"zoneAbbr");Ce("zz",0,0,"zoneName");function Hj(){return this._isUTC?"UTC":""}function Nj(){return this._isUTC?"Coordinated Universal Time":""}var Q=md.prototype;Q.add=_B;Q.calendar=HB;Q.clone=NB;Q.diff=WB;Q.endOf=ZB;Q.format=zB;Q.from=YB;Q.fromNow=GB;Q.to=qB;Q.toNow=KB;Q.get=UV;Q.invalidAt=sj;Q.isAfter=DB;Q.isBefore=kB;Q.isBetween=LB;Q.isSame=$B;Q.isSameOrAfter=FB;Q.isSameOrBefore=VB;Q.isValid=ij;Q.lang=nN;Q.locale=tN;Q.localeData=rN;Q.max=iB;Q.min=rB;Q.parsingFlags=oj;Q.set=zV;Q.startOf=XB;Q.subtract=MB;Q.toArray=tj;Q.toObject=nj;Q.toDate=ej;Q.toISOString=jB;Q.inspect=UB;typeof Symbol<"u"&&Symbol.for!=null&&(Q[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"});Q.toJSON=rj;Q.toString=BB;Q.unix=JB;Q.valueOf=QB;Q.creationData=aj;Q.eraName=hj;Q.eraNarrow=dj;Q.eraAbbr=fj;Q.eraYear=gj;Q.year=H1;Q.isLeapYear=jV;Q.weekYear=bj;Q.isoWeekYear=Sj;Q.quarter=Q.quarters=Ij;Q.month=$1;Q.daysInMonth=eW;Q.week=Q.weeks=lW;Q.isoWeek=Q.isoWeeks=uW;Q.weeksInYear=Tj;Q.weeksInWeekYear=_j;Q.isoWeeksInYear=Rj;Q.isoWeeksInISOWeekYear=Ej;Q.date=lN;Q.day=Q.days=SW;Q.weekday=RW;Q.isoWeekday=EW;Q.dayOfYear=Pj;Q.hour=Q.hours=xW;Q.minute=Q.minutes=Oj;Q.second=Q.seconds=xj;Q.millisecond=Q.milliseconds=uN;Q.utcOffset=fB;Q.utc=mB;Q.local=pB;Q.parseZone=wB;Q.hasAlignedHourOffset=vB;Q.isDST=CB;Q.isLocal=bB;Q.isUtcOffset=SB;Q.isUtc=Z1;Q.isUTC=Z1;Q.zoneAbbr=Hj;Q.zoneName=Nj;Q.dates=Qr("dates accessor is deprecated. Use date instead.",lN);Q.months=Qr("months accessor is deprecated. Use month instead",$1);Q.years=Qr("years accessor is deprecated. Use year instead",H1);Q.zone=Qr("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",gB);Q.isDSTShifted=Qr("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",yB);function Dj(t){return Et(t*1e3)}function kj(){return Et.apply(null,arguments).parseZone()}function cN(t){return t}var Je=sR.prototype;Je.calendar=bV;Je.longDateFormat=TV;Je.invalidDate=MV;Je.ordinal=OV;Je.preparse=cN;Je.postformat=cN;Je.relativeTime=AV;Je.pastFuture=HV;Je.set=CV;Je.eras=lj;Je.erasParse=uj;Je.erasConvertYear=cj;Je.erasAbbrRegex=pj;Je.erasNameRegex=mj;Je.erasNarrowRegex=wj;Je.months=XV;Je.monthsShort=ZV;Je.monthsParse=JV;Je.monthsRegex=nW;Je.monthsShortRegex=tW;Je.week=iW;Je.firstDayOfYear=aW;Je.firstDayOfWeek=sW;Je.weekdays=wW;Je.weekdaysMin=CW;Je.weekdaysShort=vW;Je.weekdaysParse=bW;Je.weekdaysRegex=TW;Je.weekdaysShortRegex=_W;Je.weekdaysMinRegex=MW;Je.isPM=PW;Je.meridiem=AW;function Yg(t,e,n,r){var i=is(),o=fo().set(r,e);return i[n](o,t)}function hN(t,e,n){if(Jo(t)&&(e=t,t=void 0),t=t||"",e!=null)return Yg(t,e,n,"month");var r,i=[];for(r=0;r<12;r++)i[r]=Yg(t,r,n,"month");return i}function ER(t,e,n,r){typeof t=="boolean"?(Jo(e)&&(n=e,e=void 0),e=e||""):(e=t,n=e,t=!1,Jo(e)&&(n=e,e=void 0),e=e||"");var i=is(),o=t?i._week.dow:0,s,a=[];if(n!=null)return Yg(e,(n+o)%7,r,"day");for(s=0;s<7;s++)a[s]=Yg(e,(s+o)%7,r,"day");return a}function Lj(t,e){return hN(t,e,"months")}function $j(t,e){return hN(t,e,"monthsShort")}function Fj(t,e,n){return ER(t,e,n,"weekdays")}function Vj(t,e,n){return ER(t,e,n,"weekdaysShort")}function Wj(t,e,n){return ER(t,e,n,"weekdaysMin")}Ws("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10,n=je(t%100/10)===1?"th":e===1?"st":e===2?"nd":e===3?"rd":"th";return t+n}});X.lang=Qr("moment.lang is deprecated. Use moment.locale instead.",Ws);X.langData=Qr("moment.langData is deprecated. Use moment.localeData instead.",is);var vo=Math.abs;function Bj(){var t=this._data;return this._milliseconds=vo(this._milliseconds),this._days=vo(this._days),this._months=vo(this._months),t.milliseconds=vo(t.milliseconds),t.seconds=vo(t.seconds),t.minutes=vo(t.minutes),t.hours=vo(t.hours),t.months=vo(t.months),t.years=vo(t.years),this}function dN(t,e,n,r){var i=Ii(e,n);return t._milliseconds+=r*i._milliseconds,t._days+=r*i._days,t._months+=r*i._months,t._bubble()}function jj(t,e){return dN(this,t,e,1)}function Uj(t,e){return dN(this,t,e,-1)}function dP(t){return t<0?Math.floor(t):Math.ceil(t)}function zj(){var t=this._milliseconds,e=this._days,n=this._months,r=this._data,i,o,s,a,l;return t>=0&&e>=0&&n>=0||t<=0&&e<=0&&n<=0||(t+=dP(qb(n)+e)*864e5,e=0,n=0),r.milliseconds=t%1e3,i=Ur(t/1e3),r.seconds=i%60,o=Ur(i/60),r.minutes=o%60,s=Ur(o/60),r.hours=s%24,e+=Ur(s/24),l=Ur(fN(e)),n+=l,e-=dP(qb(l)),a=Ur(n/12),n%=12,r.days=e,r.months=n,r.years=a,this}function fN(t){return t*4800/146097}function qb(t){return t*146097/4800}function Yj(t){if(!this.isValid())return NaN;var e,n,r=this._milliseconds;if(t=Jr(t),t==="month"||t==="quarter"||t==="year")switch(e=this._days+r/864e5,n=this._months+fN(e),t){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(e=this._days+Math.round(qb(this._months)),t){case"week":return e/7+r/6048e5;case"day":return e+r/864e5;case"hour":return e*24+r/36e5;case"minute":return e*1440+r/6e4;case"second":return e*86400+r/1e3;case"millisecond":return Math.floor(e*864e5)+r;default:throw new Error("Unknown unit "+t)}}function os(t){return function(){return this.as(t)}}var gN=os("ms"),Gj=os("s"),qj=os("m"),Kj=os("h"),Xj=os("d"),Zj=os("w"),Qj=os("M"),Jj=os("Q"),eU=os("y"),tU=gN;function nU(){return Ii(this)}function rU(t){return t=Jr(t),this.isValid()?this[t+"s"]():NaN}function vl(t){return function(){return this.isValid()?this._data[t]:NaN}}var iU=vl("milliseconds"),oU=vl("seconds"),sU=vl("minutes"),aU=vl("hours"),lU=vl("days"),uU=vl("months"),cU=vl("years");function hU(){return Ur(this.days()/7)}var ko=Math.round,wu={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function dU(t,e,n,r,i){return i.relativeTime(e||1,!!n,t,r)}function fU(t,e,n,r){var i=Ii(t).abs(),o=ko(i.as("s")),s=ko(i.as("m")),a=ko(i.as("h")),l=ko(i.as("d")),u=ko(i.as("M")),c=ko(i.as("w")),h=ko(i.as("y")),d=o<=n.ss&&["s",o]||o<n.s&&["ss",o]||s<=1&&["m"]||s<n.m&&["mm",s]||a<=1&&["h"]||a<n.h&&["hh",a]||l<=1&&["d"]||l<n.d&&["dd",l];return n.w!=null&&(d=d||c<=1&&["w"]||c<n.w&&["ww",c]),d=d||u<=1&&["M"]||u<n.M&&["MM",u]||h<=1&&["y"]||["yy",h],d[2]=e,d[3]=+t>0,d[4]=r,dU.apply(null,d)}function gU(t){return t===void 0?ko:typeof t=="function"?(ko=t,!0):!1}function mU(t,e){return wu[t]===void 0?!1:e===void 0?wu[t]:(wu[t]=e,t==="s"&&(wu.ss=e-1),!0)}function pU(t,e){if(!this.isValid())return this.localeData().invalidDate();var n=!1,r=wu,i,o;return typeof t=="object"&&(e=t,t=!1),typeof t=="boolean"&&(n=t),typeof e=="object"&&(r=Object.assign({},wu,e),e.s!=null&&e.ss==null&&(r.ss=e.s-1)),i=this.localeData(),o=fU(this,!n,r,i),n&&(o=i.pastFuture(+this,o)),i.postformat(o)}var gC=Math.abs;function El(t){return(t>0)-(t<0)||+t}function ep(){if(!this.isValid())return this.localeData().invalidDate();var t=gC(this._milliseconds)/1e3,e=gC(this._days),n=gC(this._months),r,i,o,s,a=this.asSeconds(),l,u,c,h;return a?(r=Ur(t/60),i=Ur(r/60),t%=60,r%=60,o=Ur(n/12),n%=12,s=t?t.toFixed(3).replace(/\.?0+$/,""):"",l=a<0?"-":"",u=El(this._months)!==El(a)?"-":"",c=El(this._days)!==El(a)?"-":"",h=El(this._milliseconds)!==El(a)?"-":"",l+"P"+(o?u+o+"Y":"")+(n?u+n+"M":"")+(e?c+e+"D":"")+(i||r||t?"T":"")+(i?h+i+"H":"")+(r?h+r+"M":"")+(t?h+s+"S":"")):"P0D"}var qe=Qm.prototype;qe.isValid=uB;qe.abs=Bj;qe.add=jj;qe.subtract=Uj;qe.as=Yj;qe.asMilliseconds=gN;qe.asSeconds=Gj;qe.asMinutes=qj;qe.asHours=Kj;qe.asDays=Xj;qe.asWeeks=Zj;qe.asMonths=Qj;qe.asQuarters=Jj;qe.asYears=eU;qe.valueOf=tU;qe._bubble=zj;qe.clone=nU;qe.get=rU;qe.milliseconds=iU;qe.seconds=oU;qe.minutes=sU;qe.hours=aU;qe.days=lU;qe.weeks=hU;qe.months=uU;qe.years=cU;qe.humanize=pU;qe.toISOString=ep;qe.toString=ep;qe.toJSON=ep;qe.locale=tN;qe.localeData=rN;qe.toIsoString=Qr("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",ep);qe.lang=nN;Ce("X",0,0,"unix");Ce("x",0,0,"valueOf");le("x",qm);le("X",LV);ct("X",function(t,e,n){n._d=new Date(parseFloat(t)*1e3)});ct("x",function(t,e,n){n._d=new Date(je(t))});//! moment.js
|
|
11
|
+
X.version="2.30.1";wV(Et);X.fn=Q;X.min=oB;X.max=sB;X.now=aB;X.utc=fo;X.unix=Dj;X.months=Lj;X.isDate=gd;X.locale=Ws;X.invalid=Um;X.duration=Ii;X.isMoment=Ei;X.weekdays=Fj;X.parseZone=kj;X.localeData=is;X.isDuration=bg;X.monthsShort=$j;X.weekdaysMin=Wj;X.defineLocale=pR;X.updateLocale=kW;X.locales=LW;X.weekdaysShort=Vj;X.normalizeUnits=Jr;X.relativeTimeRounding=gU;X.relativeTimeThreshold=mU;X.calendarFormat=AB;X.prototype=Q;X.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};function wU(t){const e=t.length;let n=0;for(;n<e;)t[n]=[t[n]],n+=1}function fP(t,e){const n=e.length;let r=0;for(;r<n;)t.push(e[r]),r+=1}function Rg(t){const e=[];if(!t||t.length===0||!t[0]||t[0].length===0)return e;const n=t.length,r=t[0].length;for(let i=0;i<n;i++)for(let o=0;o<r;o++)e[o]||(e[o]=[]),e[o][i]=t[i][o];return e}function fr(t,e,n,r){let i=-1,o=t,s=n;Array.isArray(t)||(o=Array.from(t));const a=o.length;for(i+=1;i<a;)s=e(s,o[i],i,o),i+=1;return s}function rl(t,e){let n=0,r=t;Array.isArray(t)||(r=Array.from(t));const i=r.length,o=[];let s=-1;for(;n<i;){const a=r[n];e(a,n,r)&&(s+=1,o[s]=a),n+=1}return o}function Be(t,e){let n=0,r=t;Array.isArray(t)||(r=Array.from(t));const i=r.length,o=[];let s=-1;for(;n<i;){const a=r[n];s+=1,o[s]=e(a,n,r),n+=1}return o}function M(t,e){let n=0,r=t;Array.isArray(t)||(r=Array.from(t));const i=r.length;for(;n<i&&e(r[n],n,r)!==!1;)n+=1;return t}function vU(t){const e=[];return M(t,n=>{e.indexOf(n)===-1&&e.push(n)}),e}function gP(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];const[r,...i]=[...e];let o=r;return M(i,s=>{o=o.filter(a=>!s.includes(a))}),o}function mP(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:" ";return t.split(e)}function nt(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return fr(t,(o,s,a)=>{const l=s.replace(/\r?\n\s*/g,""),u=n[a]?n[a]:"";return o+l+u},"").trim()}function Pt(t){let e;switch(typeof t){case"string":case"number":e=`${t}`;break;case"object":e=t===null?"":t.toString();break;case"undefined":e="";break;default:e=t.toString();break}return e}function ae(t){return typeof t<"u"}function It(t){return typeof t>"u"}function Ut(t){return t===null||t===""||It(t)}function CU(t){return Object.prototype.toString.call(t)==="[object RegExp]"}const lh="length",ph=t=>parseInt(t,16),pP=t=>parseInt(t,10),Gg=(t,e,n)=>t.substr(e,n),wh=t=>t.codePointAt(0)-65,Kb=t=>`${t}`.replace(/\-/g,""),yU=t=>ph(Gg(Kb(t),ph("12"),wh("F")))/(ph(Gg(Kb(t),wh("B"),~~![][lh]))||9),bU=()=>typeof location<"u"&&/^([a-z0-9\-]+\.)?\x68\x61\x6E\x64\x73\x6F\x6E\x74\x61\x62\x6C\x65\x2E\x63\x6F\x6D$/i.test(location.host);let wP=!1;const vP={invalid:()=>nt`
|
|
12
|
+
The license key for Handsontable is invalid.\x20
|
|
13
|
+
If you need any help, contact us at support@handsontable.com.`,expired:t=>{let{keyValidityDate:e,hotVersion:n}=t;return nt`
|
|
14
|
+
The license key for Handsontable expired on ${e}, and is not valid for the installed\x20
|
|
15
|
+
version ${n}. Renew your license key at handsontable.com or downgrade to a version released prior\x20
|
|
16
|
+
to ${e}. If you need any help, contact us at sales@handsontable.com.`},missing:()=>nt`
|
|
17
|
+
The license key for Handsontable is missing. Use your purchased key to activate the product.\x20
|
|
18
|
+
Alternatively, you can activate Handsontable to use for non-commercial purposes by\x20
|
|
19
|
+
passing the key: 'non-commercial-and-evaluation'. If you need any help, contact\x20
|
|
20
|
+
us at support@handsontable.com.`,non_commercial:()=>""},CP={invalid:()=>nt`
|
|
21
|
+
The license key for Handsontable is invalid.\x20
|
|
22
|
+
<a href="https://handsontable.com/docs/tutorial-license-key.html" target="_blank">Read more</a> on how to\x20
|
|
23
|
+
install it properly or contact us at <a href="mailto:support@handsontable.com">support@handsontable.com</a>.`,expired:t=>{let{keyValidityDate:e,hotVersion:n}=t;return nt`
|
|
24
|
+
The license key for Handsontable expired on ${e}, and is not valid for the installed\x20
|
|
25
|
+
version ${n}. <a href="https://handsontable.com/pricing" target="_blank">Renew</a> your\x20
|
|
26
|
+
license key or downgrade to a version released prior to ${e}. If you need any\x20
|
|
27
|
+
help, contact us at <a href="mailto:sales@handsontable.com">sales@handsontable.com</a>.`},missing:()=>nt`
|
|
28
|
+
The license key for Handsontable is missing. Use your purchased key to activate the product.\x20
|
|
29
|
+
Alternatively, you can activate Handsontable to use for non-commercial purposes by\x20
|
|
30
|
+
passing the key: 'non-commercial-and-evaluation'.\x20
|
|
31
|
+
<a href="https://handsontable.com/docs/tutorial-license-key.html" target="_blank">Read more</a> about it in\x20
|
|
32
|
+
the documentation or contact us at <a href="mailto:support@handsontable.com">support@handsontable.com</a>.`,non_commercial:()=>""};function SU(t,e){const n=!Ut(t),r=typeof t=="string"&&t.toLowerCase()==="non-commercial-and-evaluation",i="15.3.0";let o,s="invalid",a="invalid";t=Kb(t||"");const l=RU(t);if(n||r||l)if(l){const u=X("29/04/2025","DD/MM/YYYY"),c=Math.floor(u.toDate().getTime()/864e5),h=yU(t);o=X((h+1)*864e5,"x").format("MMMM DD, YYYY"),c>h?(s="expired",a="expired"):(s="valid",a="valid")}else r?(s="non_commercial",a="valid"):(s="invalid",a="invalid");else s="missing",a="missing";if(bU()&&(s="valid",a="valid"),!wP&&s!=="valid"&&(vP[s]({keyValidityDate:o,hotVersion:i})&&console[s==="non_commercial"?"info":"warn"](vP[s]({keyValidityDate:o,hotVersion:i})),wP=!0),a!=="valid"&&e.parentNode&&CP[a]({keyValidityDate:o,hotVersion:i})){const c=document.createElement("div");c.className="handsontable hot-display-license-info",c.innerHTML=CP[a]({keyValidityDate:o,hotVersion:i}),e.parentNode.insertBefore(c,e.nextSibling)}}function RU(t){let e=[][lh],n=e;if(t[lh]!==wh("Z"))return!1;for(let r="",i="B<H4P+".split(""),o=wh(i.shift());o;o=wh(i.shift()||"A"))--o<""[lh]?n=n|(pP(`${pP(ph(r)+(ph(Gg(t,Math.abs(o),2))+[]).padStart(2,"0"))}`)%97||2)>>1:r=Gg(t,o,o?i[lh]===1?9:8:6);return n===e}function Ti(t){return t[0].toUpperCase()+t.substr(1)}function mN(){function t(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}return t()+t()+t()+t()}function pN(t){return/^([0-9][0-9]?%$)|(^100%$)/.test(t)}function wN(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return`${t}`.replace(/(?:\\)?\[([^[\]]+)]/g,(n,r)=>n.charAt(0)==="\\"?n.substr(1,n.length-1):e[r]===void 0?"":e[r])}function yP(t){return TR(`${t}`,{ALLOWED_TAGS:[]})}function TR(t,e){return pV.sanitize(t,e)}const Cl=t=>["tabindex",t],EU=()=>["role","treegrid"],Uo=()=>["role","presentation"],TU=()=>["role","gridcell"],_U=()=>["role","rowheader"],vN=()=>["role","rowgroup"],MU=()=>["role","columnheader"],Xb=()=>["role","row"],IU=()=>["role","menu"],PU=()=>["role","menuitem"],OU=()=>["role","menuitemcheckbox"],xU=()=>["role","combobox"],CN=()=>["role","listbox"],AU=()=>["role","option"],HU=()=>["role","checkbox"],NU=()=>["scope","col"],DU=()=>["scope","row"],kU=()=>["type","text"],Bh=t=>["aria-label",t],yl=()=>["aria-hidden","true"],LU=()=>["aria-disabled","true"],$U=()=>["aria-multiselectable","true"],yN=t=>["aria-haspopup",t],bN=t=>["aria-rowcount",t],tp=t=>["aria-colcount",t],SN=t=>["aria-rowindex",t],_R=t=>["aria-colindex",t],Gr=t=>["aria-expanded",t],FU=t=>["aria-sort",t],bP=()=>["aria-readonly","true"],SP=()=>["aria-invalid","true"],RN=t=>["aria-checked",t],MR=()=>["aria-selected","true"],VU=()=>["aria-autocomplete","list"],WU=t=>["aria-controls",t],BU=t=>["aria-activedescendant",t],jU=t=>["aria-live",t],UU=t=>["aria-relevant",t],zU=t=>["aria-setsize",t],YU=t=>["aria-posinset",t];function GU(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=null,i=t;for(;i!==null;){if(n===e){r=i;break}i.host&&i.nodeType===Node.DOCUMENT_FRAGMENT_NODE?i=i.host:(n+=1,i=i.parentNode)}return r}function Eg(t,e){const n=t.closest(".handsontable");return!!n&&(n.parentNode===e||n===e)}function qU(t){return Object.getPrototypeOf(t.parent)&&t.frameElement}function xu(t){return qU(t)&&t.parent}function il(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0;const{ELEMENT_NODE:r,DOCUMENT_FRAGMENT_NODE:i}=Node;let o=t;for(;o!=null&&o!==n;){const{nodeType:s,nodeName:a}=o;if(s===r&&(e.includes(a)||e.includes(o)))return o;const{host:l}=o;l&&s===i?o=l:o=o.parentNode}return null}function Fd(t,e,n){const r=[];let i=t;for(;i&&(i=il(i,e,n),!(!i||n&&!n.contains(i)));)r.push(i),i.host&&i.nodeType===Node.DOCUMENT_FRAGMENT_NODE?i=i.host:i=i.parentNode;const o=r.length;return o?r[o-1]:null}function KU(t,e){const n={element:void 0,classNames:[]};let r=t;for(;r!==null&&r!==t.ownerDocument.documentElement&&!n.element;){if(typeof e=="string"&&r.classList.contains(e))n.element=r,n.classNames.push(e);else if(e instanceof RegExp){const i=Array.from(r.classList).filter(o=>e.test(o));i.length&&(n.element=r,n.classNames.push(...i))}r=r.parentElement}return n}function tl(t,e){let n=t.parentNode,r=[];for(typeof e=="string"?t.defaultView?r=Array.prototype.slice.call(t.querySelectorAll(e),0):r=Array.prototype.slice.call(t.ownerDocument.querySelectorAll(e),0):r.push(e);n!==null;){if(r.indexOf(n)>-1)return!0;n=n.parentNode}return!1}function XU(t){let e=0,n=t;if(n.previousSibling)for(;n=n.previousSibling;)e+=1;return e}function na(t,e,n){const r=n.parentElement.querySelector(`.ht_clone_${t}`);return r?r.contains(e):null}function EN(t){return!t||!t.length?[]:t.filter(e=>!!e)}function TN(t,e){if(!t||!t.length)return{regexFree:[],regexes:[]};const n=[],r=[];return r.push(...t.filter(i=>{const o=i instanceof RegExp;return o&&e&&n.push(i),!o})),{regexFree:r,regexes:n}}function ve(t,e){return t.classList===void 0||typeof e!="string"||e===""?!1:t.classList.contains(e)}function G(t,e){typeof e=="string"&&(e=e.split(" ")),e=EN(e),e.length>0&&t.classList.add(...e)}function pe(t,e){typeof e=="string"?e=e.split(" "):e instanceof RegExp&&(e=[e]);let{regexFree:n,regexes:r}=TN(e,!0);n=EN(n),n.length>0&&t.classList.remove(...n),r.forEach(i=>{t.classList.forEach(o=>{i.test(o)&&t.classList.remove(o)})})}function ye(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0;Array.isArray(e)||(e=[[e,n]]),e.forEach(r=>{Array.isArray(r)&&r[0]!==""&&t.setAttribute(...r)})}function qu(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];typeof e=="string"?e=e.split(" "):e instanceof RegExp&&(e=[e]);const{regexFree:n,regexes:r}=TN(e,!0);n.forEach(i=>{i!==""&&t.removeAttribute(i)}),r.forEach(i=>{t.getAttributeNames().forEach(o=>{i.test(o)&&t.removeAttribute(o)})})}function _N(t){if(t.nodeType===3)t.parentNode.removeChild(t);else if(["TABLE","THEAD","TBODY","TFOOT","TR"].indexOf(t.nodeName)>-1){const e=t.childNodes;for(let n=e.length-1;n>=0;n--)_N(e[n])}}function es(t){let e;for(;e=t.lastChild;)t.removeChild(e)}const ZU=/(<(.*)>|&(.*);)/;function Ku(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;ZU.test(e)?t.innerHTML=n?TR(e):e:ol(t,e)}function ol(t,e){const n=t.firstChild;n&&n.nodeType===3&&n.nextSibling===null?n.textContent=e:(es(t),t.appendChild(t.ownerDocument.createTextNode(e)))}function Au(t){const e=t.ownerDocument.documentElement,n=t.ownerDocument.defaultView;let r=t;for(;r!==e;){if(r===null)return!1;if(r.nodeType===Node.DOCUMENT_FRAGMENT_NODE)if(r.host){if(r.host.impl)return Au(r.host.impl);if(r.host)return Au(r.host);throw new Error("Lost in Web Components world")}else return!1;else if(n.getComputedStyle(r).display==="none")return!1;r=r.parentNode}return!0}function QU(t){const n=t.ownerDocument.defaultView;let r=t;for(;r.parentNode;){if(r.style.height==="0px"||r.style.height==="0")return n.getComputedStyle(r).overflow==="hidden";r=r.parentNode}return!1}function An(t){const e=t.ownerDocument,n=e.defaultView,r=e.documentElement;let i=t,o,s,a;for(o=i.offsetLeft,s=i.offsetTop,a=i;(i=i.offsetParent)&&!(i===e.body||!("offsetLeft"in i));)o+=i.offsetLeft,s+=i.offsetTop,a=i;return a&&a.style.position==="fixed"&&(o+=n.pageXOffset||r.scrollLeft,s+=n.pageYOffset||r.scrollTop),{left:o,top:s}}function MN(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:window).scrollY}function IR(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:window).scrollX}function PR(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:window;return t===e?MN(e):t.scrollTop}function IN(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:window;return t===e?IR(e):t.scrollLeft}function qg(t){let e=t.ownerDocument,n=e?e.defaultView:void 0;e||(e=t.document?t.document:t,n=e.defaultView);const r=["auto","scroll"];let i=t.parentNode;for(;i&&i.style&&e.body!==i;){let{overflow:o,overflowX:s,overflowY:a}=i.style;if([o,s,a].includes("scroll"))return i;if({overflow:o,overflowX:s,overflowY:a}=n.getComputedStyle(i),r.includes(o)||r.includes(s)||r.includes(a)||i.clientHeight<=i.scrollHeight+1&&(r.includes(a)||r.includes(o))||i.clientWidth<=i.scrollWidth+1&&(r.includes(s)||r.includes(o)))return i;i=i.parentNode}return n}function JU(t){return t.scrollHeight-t.clientHeight}function ez(t){return t.scrollWidth-t.clientWidth}function jh(t){const e=t.ownerDocument,n=e.defaultView;let r=t.parentNode;for(;r&&r.style&&e.body!==r;){if(r.style.overflow!=="visible"&&r.style.overflow!=="")return r;const i=n.getComputedStyle(r),o=["scroll","hidden","auto"],s=i.getPropertyValue("overflow"),a=i.getPropertyValue("overflow-y"),l=i.getPropertyValue("overflow-x");if(o.includes(s)||o.includes(a)||o.includes(l))return r;r=r.parentNode}return n}function Kg(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:window;if(t){if(t===n)return e==="width"?`${n.innerWidth}px`:e==="height"?`${n.innerHeight}px`:void 0}else return;const r=t.style[e];if(r!==""&&r!==void 0)return r;const i=n.getComputedStyle(t);if(i[e]!==""&&i[e]!==void 0)return i[e]}function qt(t){return t.offsetWidth}function nn(t){return t.offsetHeight}function vh(t){return t.clientHeight||t.innerHeight}function PN(t){return t.clientWidth||t.innerWidth}function ON(t){return t.selectionStart?t.selectionStart:0}function tz(t){return t.selectionEnd?t.selectionEnd:0}function RP(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window;t.getSelection&&(t.getSelection().empty?t.getSelection().empty():t.getSelection().removeAllRanges&&t.getSelection().removeAllRanges())}function np(t,e,n){if(n===void 0&&(n=e),t.setSelectionRange){t.focus();try{t.setSelectionRange(e,n)}catch{const i=t.parentNode,o=i.style.display;i.style.display="block",t.setSelectionRange(e,n),i.style.display=o}}}let mC;function nz(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;const e=t.createElement("div");e.style.height="200px",e.style.width="100%";const n=t.createElement("div");n.style.boxSizing="content-box",n.style.height="150px",n.style.left="0px",n.style.overflow="hidden",n.style.position="absolute",n.style.top="0px",n.style.width="200px",n.style.visibility="hidden",n.appendChild(e),(t.body||t.documentElement).appendChild(n);const r=e.offsetWidth;n.style.overflow="scroll";let i=e.offsetWidth;return r===i&&(i=n.clientWidth),(t.body||t.documentElement).removeChild(n),r-i}function vn(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;return mC===void 0&&(mC=nz(t)),mC}function xN(t){return t instanceof Window?t.document.body.scrollHeight>t.innerHeight:t.offsetWidth!==t.clientWidth}function AN(t){return t instanceof Window?t.document.body.scrollWidth>t.innerWidth:t.offsetHeight!==t.clientHeight}function OR(t,e,n){t.style.transform=`translate3d(${e},${n},0)`}function rp(t){t.style.transform&&t.style.transform!==""&&(t.style.transform="")}function Tg(t){return t&&(["INPUT","SELECT","TEXTAREA"].indexOf(t.nodeName)>-1||t.contentEditable==="true")}function HN(t){return Tg(t)&&t.hasAttribute("data-hot-input")===!1}function NN(t){return!t.parentNode}function rz(t,e){new IntersectionObserver((r,i)=>{r.forEach(o=>{o.isIntersecting&&t.offsetParent!==null&&(e(),i.unobserve(t))})},{root:t.ownerDocument.body}).observe(t)}function DN(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;const r=t.ownerDocument,i=r.createRange(),o=r.defaultView.getSelection();ye(t,"contenteditable",!0),n&&ye(t,...yl()),e&&G(t,"invisibleSelection"),i.selectNodeContents(t),o.removeAllRanges(),o.addRange(i)}function kN(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;const n=t.ownerDocument.defaultView.getSelection();t.hasAttribute("aria-hidden")&&t.removeAttribute("aria-hidden"),n.removeAllRanges(),e&&pe(t,"invisibleSelection"),t.removeAttribute("contenteditable")}function iz(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;DN(t,n),e(),kN(t,n)}function Qo(t){var e;const n=t==null||(e=t.ownerDocument)===null||e===void 0?void 0:e.defaultView.Element;return!!(n&&n!==null&&t instanceof n)}function ot(t){return typeof t=="function"}function ip(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:200,n=null,r;function i(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return n&&clearTimeout(n),n=setTimeout(()=>{r=t.apply(this,s)},e),r}return i}function LN(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return t.apply(this,n.concat(s))}}function oz(t){const e=t.length;function n(r){return function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];const l=r.concat(s);let u;return l.length>=e?u=t.apply(this,l):u=n(l),u}}return n([])}function Zb(t,e,n,r,i,o,s,a){return ae(a)?t.call(e,n,r,i,o,s,a):ae(s)?t.call(e,n,r,i,o,s):ae(o)?t.call(e,n,r,i,o):ae(i)?t.call(e,n,r,i):ae(r)?t.call(e,n,r):ae(n)?t.call(e,n):t.call(e)}var EP={},pC,TP;function sz(){if(TP)return pC;TP=1;var t=Kt(),e=s1(),n=an(),r=fl(),i=jm(),o=t([].push);return pC=function(s){if(n(s))return s;if(e(s)){for(var a=s.length,l=[],u=0;u<a;u++){var c=s[u];typeof c=="string"?o(l,c):(typeof c=="number"||r(c)==="Number"||r(c)==="String")&&o(l,i(c))}var h=l.length,d=!0;return function(f,g){if(d)return d=!1,g;if(e(this))return g;for(var C=0;C<h;C++)if(l[C]===f)return g}}},pC}var _P;function az(){if(_P)return EP;_P=1;var t=dt(),e=Vu(),n=hd(),r=sn(),i=Kt(),o=Cn(),s=an(),a=US(),l=nR(),u=sz(),c=jS(),h=String,d=e("JSON","stringify"),f=i(/./.exec),g=i("".charAt),C=i("".charCodeAt),y=i("".replace),E=i(1 .toString),v=/[\uD800-\uDFFF]/g,P=/^[\uD800-\uDBFF]$/,O=/^[\uDC00-\uDFFF]$/,L=!c||o(function(){var U=e("Symbol")("stringify detection");return d([U])!=="[null]"||d({a:U})!=="{}"||d(Object(U))!=="{}"}),T=o(function(){return d("\uDF06\uD834")!=='"\\udf06\\ud834"'||d("\uDEAD")!=='"\\udead"'}),A=function(U,j){var Z=l(arguments),J=u(j);if(!(!s(J)&&(U===void 0||a(U))))return Z[1]=function(se,te){if(s(J)&&(te=r(J,this,h(se),te)),!a(te))return te},n(d,null,Z)},q=function(U,j,Z){var J=g(Z,j-1),se=g(Z,j+1);return f(P,U)&&!f(O,se)||f(O,U)&&!f(P,J)?"\\u"+E(C(U,0),16):U};return d&&t({target:"JSON",stat:!0,arity:3,forced:L||T},{stringify:function(j,Z,J){var se=l(arguments),te=n(L?A:d,null,se);return T&&typeof te=="string"?y(te,v,q):te}}),EP}az();function Uh(t){let e;return Array.isArray(t)?e=t.length?new Array(t.length).fill(null):[]:(e={},He(t,(n,r)=>{r!=="__children"&&(n&&typeof n=="object"&&!Array.isArray(n)?e[r]=Uh(n):Array.isArray(n)?n.length&&typeof n[0]=="object"&&!Array.isArray(n[0])?e[r]=[Uh(n[0])]:e[r]=[]:e[r]=null)})),e}function lz(t,e){return e.prototype.constructor=e,t.prototype=new e,t.prototype.constructor=t,t}function rn(t,e,n){const r=Array.isArray(n);return He(e,(i,o)=>{(r===!1||n.includes(o))&&(t[o]=i)}),t}function op(t,e){He(e,(n,r)=>{e[r]&&typeof e[r]=="object"?(t[r]||(Array.isArray(e[r])?t[r]=[]:Object.prototype.toString.call(e[r])==="[object Date]"?t[r]=e[r]:t[r]={}),op(t[r],e[r])):t[r]=e[r]})}function Gn(t){return typeof t=="object"?JSON.parse(JSON.stringify(t)):t}function uo(t){const e={};return He(t,(n,r)=>{e[r]=n}),e}function ut(t){t.MIXINS||(t.MIXINS=[]);for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return M(n,i=>{t.MIXINS.push(i.MIXIN_NAME),He(i,(o,s)=>{if(t.prototype[s]!==void 0)throw new Error(`Mixin conflict. Property '${s}' already exist and cannot be overwritten.`);if(typeof o=="function")t.prototype[s]=o;else{const a=function(c,h){const d=`_${c}`,f=g=>{let C=g;return(Array.isArray(C)||Ae(C))&&(C=Gn(C)),C};return function(){return this[d]===void 0&&(this[d]=f(h)),this[d]}},l=function(c){const h=`_${c}`;return function(d){this[h]=d}};Object.defineProperty(t.prototype,s,{get:a(s,o),set:l(s),configurable:!0})}})}),t}function xR(t,e){return JSON.stringify(t)===JSON.stringify(e)}function Ae(t){return Object.prototype.toString.call(t)==="[object Object]"}function ss(t,e,n,r){r.value=n,r.writable=r.writable!==!1,r.enumerable=r.enumerable!==!1,r.configurable=r.configurable!==!1,Object.defineProperty(t,e,r)}function He(t,e){for(const n in t)if((!t.hasOwnProperty||t.hasOwnProperty&&Object.prototype.hasOwnProperty.call(t,n))&&e(t[n],n,t)===!1)break;return t}function uz(t,e){const n=e.split(".");let r=t;return He(n,i=>{if(r=r[i],r===void 0)return r=void 0,!1}),r}function wC(t,e,n){if(typeof e!="string")return;const r=e.split(".");let i=t;r.forEach((o,s)=>{o==="__proto__"||o==="constructor"||o==="prototype"||(s!==r.length-1?(tn(i,o)||(i[o]={}),i=i[o]):i[o]=n)})}function AR(t){if(!Ae(t))return 0;const e=function(n){let r=0;return Ae(n)?He(n,(i,o)=>{o!=="__children"&&(r+=e(i))}):r+=1,r};return e(t)}function Mr(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"value";const n=`_${e}`,r={_touched:!1,[n]:t,isTouched(){return this._touched}};return Object.defineProperty(r,e,{get(){return this[n]},set(i){this._touched=!0,this[n]=i},enumerable:!0,configurable:!0}),r}function tn(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Xg(t){return window.requestAnimationFrame(t)}function Zg(t){window.cancelAnimationFrame(t)}function $N(){return"ontouchstart"in window}function cz(){return typeof window<"u"}let Tl;function hz(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Tl||(typeof Intl=="object"?Tl=new Intl.Collator(t,e).compare:typeof String.prototype.localeCompare=="function"?Tl=(n,r)=>`${n}`.localeCompare(r):Tl=(n,r)=>n===r?0:n>r?-1:1,Tl)}const Fr=t=>{const e={value:!1};return e.test=(n,r)=>{e.value=t(n,r)},e},Xs={chrome:Fr((t,e)=>/Chrome/.test(t)&&/Google/.test(e)),chromeWebKit:Fr(t=>/CriOS/.test(t)),edge:Fr(t=>/Edge/.test(t)),edgeWebKit:Fr(t=>/EdgiOS/.test(t)),firefox:Fr(t=>/Firefox/.test(t)),firefoxWebKit:Fr(t=>/FxiOS/.test(t)),mobile:Fr(t=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(t)),safari:Fr((t,e)=>/Safari/.test(t)&&/Apple Computer/.test(e))},vd={mac:Fr(t=>/^Mac/.test(t)),win:Fr(t=>/^Win/.test(t)),linux:Fr(t=>/^Linux/.test(t)),ios:Fr(t=>/iPhone|iPad|iPod/i.test(t))};function dz(){let{userAgent:t=navigator.userAgent,vendor:e=navigator.vendor}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};He(Xs,n=>{let{test:r}=n;return void r(t,e)})}function fz(){let{platform:t=navigator.platform}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};He(vd,e=>{let{test:n}=e;return void n(t)})}cz()&&(dz(),fz());function FN(){return Xs.chrome.value}function gz(){return Xs.chromeWebKit.value}function vC(){return Xs.firefox.value}function mz(){return Xs.firefoxWebKit.value}function Qg(){return Xs.safari.value}function pz(){return Xs.edge.value}function zo(){return Xs.mobile.value}function VN(){return vd.ios.value}function WN(){let{maxTouchPoints:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:navigator;return t>2&&vd.mac.value}function MP(){return vd.win.value}function IP(){return vd.mac.value}const me={ALT:18,ARROW_DOWN:40,ARROW_LEFT:37,ARROW_RIGHT:39,ARROW_UP:38,AUDIO_DOWN:vC()?182:174,AUDIO_MUTE:vC()?181:173,AUDIO_UP:vC()?183:175,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND_LEFT:91,COMMAND_RIGHT:93,COMMAND_FIREFOX:224,CONTROL:17,DELETE:46,END:35,ENTER:13,ESCAPE:27,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,F13:124,F14:125,F15:126,F16:127,F17:128,F18:129,F19:130,HOME:36,INSERT:45,MEDIA_NEXT:176,MEDIA_PLAY_PAUSE:179,MEDIA_PREV:177,MEDIA_STOP:178,NULL:0,NUM_LOCK:144,PAGE_DOWN:34,PAGE_UP:33,PAUSE:19,PERIOD:190,SCROLL_LOCK:145,SHIFT:16,SPACE:32,TAB:9,A:65,C:67,D:68,F:70,L:76,O:79,P:80,S:83,V:86,X:88,Y:89,Z:90},wz=[me.ALT,me.ARROW_DOWN,me.ARROW_LEFT,me.ARROW_RIGHT,me.ARROW_UP,me.AUDIO_DOWN,me.AUDIO_MUTE,me.AUDIO_UP,me.BACKSPACE,me.CAPS_LOCK,me.DELETE,me.END,me.ENTER,me.ESCAPE,me.F1,me.F2,me.F3,me.F4,me.F5,me.F6,me.F7,me.F8,me.F9,me.F10,me.F11,me.F12,me.F13,me.F14,me.F15,me.F16,me.F17,me.F18,me.F19,me.HOME,me.INSERT,me.MEDIA_NEXT,me.MEDIA_PLAY_PAUSE,me.MEDIA_PREV,me.MEDIA_STOP,me.NULL,me.NUM_LOCK,me.PAGE_DOWN,me.PAGE_UP,me.PAUSE,me.SCROLL_LOCK,me.SHIFT,me.TAB];function vz(t){return t===32||t>=48&&t<=57||t>=96&&t<=111||t>=186&&t<=192||t>=219&&t<=222||t>=226||t>=65&&t<=90}function BN(t){return wz.includes(t)}function Cz(t){return[me.CONTROL,me.COMMAND_LEFT,me.COMMAND_RIGHT,me.COMMAND_FIREFOX].includes(t)}function Cd(t,e){const n=e.split("|");let r=!1;return M(n,i=>{if(t===me[i])return r=!0,!1}),r}function Pi(t){t.isImmediatePropagationEnabled=!1,t.cancelBubble=!0}function za(t){return t.isImmediatePropagationEnabled===!1}function sl(t){return t.button===2}function HR(t){return t.button===0}function yz(t){return t instanceof TouchEvent}function bz(t,e){const n={x:t.offsetX,y:t.offsetY};let r=t.target;if(!Qo(e)||r!==e&&r.contains(e))return n;for(;r!==e;)n.x+=r.offsetLeft,n.y+=r.offsetTop,r=r.offsetParent;return n}function Ze(){ae(console)&&console.warn(...arguments)}function NR(){ae(console)&&console.error(...arguments)}const Ya=["afterCellMetaReset","afterChange","afterContextMenuDefaultOptions","beforeContextMenuSetItems","afterDropdownMenuDefaultOptions","beforeDropdownMenuSetItems","afterContextMenuHide","beforeContextMenuShow","afterContextMenuShow","afterCopyLimit","beforeCreateCol","afterColumnSequenceChange","afterCreateCol","beforeCreateRow","afterCreateRow","afterDeselect","afterDestroy","afterDocumentKeyDown","afterDrawSelection","beforeRemoveCellClassNames","beforeCompositionStart","afterGetCellMeta","afterGetColHeader","afterGetRowHeader","afterInit","afterLoadData","afterUpdateData","afterMomentumScroll","afterOnCellCornerMouseDown","afterOnCellCornerDblClick","afterOnCellMouseDown","afterOnCellMouseUp","afterOnCellContextMenu","afterOnCellMouseOver","afterOnCellMouseOut","afterRemoveCol","afterRemoveRow","beforeRenderer","afterRenderer","afterRowSequenceChange","beforeViewportScrollVertically","beforeViewportScrollHorizontally","beforeViewportScroll","afterScrollHorizontally","afterScrollVertically","afterScroll","afterSelection","afterSelectionByProp","afterSelectionEnd","afterSelectionEndByProp","afterSelectionFocusSet","beforeSelectColumns","afterSelectColumns","beforeSelectRows","afterSelectRows","afterSetCellMeta","afterRemoveCellMeta","afterSetDataAtCell","afterSetDataAtRowProp","afterSetSourceDataAtCell","afterSetTheme","afterUpdateSettings","afterValidate","beforeLanguageChange","afterLanguageChange","beforeAutofill","afterAutofill","beforeCellAlignment","beforeChange","beforeChangeRender","beforeDrawBorders","beforeGetCellMeta","beforeRemoveCellMeta","beforeInit","beforeInitWalkontable","beforeLoadData","beforeUpdateData","beforeKeyDown","beforeOnCellMouseDown","beforeOnCellMouseUp","beforeOnCellContextMenu","beforeOnCellMouseOver","beforeOnCellMouseOut","beforeRemoveCol","beforeRemoveRow","beforeViewRender","afterViewRender","beforeRender","afterRender","beforeRowWrap","beforeColumnWrap","beforeSetCellMeta","beforeSelectionFocusSet","beforeSetRangeStartOnly","beforeSetRangeStart","beforeSetRangeEnd","beforeSelectionHighlightSet","beforeTouchScroll","beforeValidate","beforeValueRender","construct","init","modifyColHeader","modifyColWidth","modifyFiltersMultiSelectValue","modifyFocusedElement","modifyRowHeader","modifyRowHeight","modifyRowHeightByOverlayName","modifyData","modifySourceData","modifyRowData","modifyGetCellCoords","modifyGetCoordsElement","modifyFocusOnTabNavigation","beforeHighlightingRowHeader","beforeHighlightingColumnHeader","persistentStateLoad","persistentStateReset","persistentStateSave","beforeColumnSort","afterColumnSort","modifyAutofillRange","modifyCopyableRange","beforeCut","afterCut","beforeCopy","afterCopy","beforePaste","afterPaste","beforeColumnFreeze","afterColumnFreeze","beforeColumnMove","afterColumnMove","beforeColumnUnfreeze","afterColumnUnfreeze","beforeRowMove","afterRowMove","beforeColumnResize","afterColumnResize","beforeRowResize","afterRowResize","afterGetColumnHeaderRenderers","afterGetRowHeaderRenderers","beforeStretchingColumnWidth","beforeFilter","afterFilter","afterFormulasValuesUpdate","afterNamedExpressionAdded","afterNamedExpressionRemoved","afterSheetAdded","afterSheetRenamed","afterSheetRemoved","modifyColumnHeaderHeight","modifyColumnHeaderValue","beforeUndo","beforeUndoStackChange","afterUndo","afterUndoStackChange","beforeRedo","beforeRedoStackChange","afterRedo","afterRedoStackChange","modifyRowHeaderWidth","modifyTransformFocus","modifyTransformStart","modifyTransformEnd","afterModifyTransformFocus","afterModifyTransformStart","afterModifyTransformEnd","afterViewportRowCalculatorOverride","afterViewportColumnCalculatorOverride","afterPluginsInitialized","beforeHideRows","afterHideRows","beforeUnhideRows","afterUnhideRows","beforeHideColumns","afterHideColumns","beforeUnhideColumns","afterUnhideColumns","beforeTrimRow","afterTrimRow","beforeUntrimRow","afterUntrimRow","beforeDropdownMenuShow","afterDropdownMenuShow","afterDropdownMenuHide","beforeAddChild","afterAddChild","beforeDetachChild","afterDetachChild","beforeBeginEditing","afterBeginEditing","beforeMergeCells","afterMergeCells","beforeUnmergeCells","afterUnmergeCells","afterListen","afterUnlisten","afterRefreshDimensions","beforeRefreshDimensions","beforeColumnCollapse","afterColumnCollapse","beforeColumnExpand","afterColumnExpand","modifyAutoColumnSizeSeed"],CC=new Map([["modifyRow","8.0.0"],["modifyCol","8.0.0"],["unmodifyRow","8.0.0"],["unmodifyCol","8.0.0"],["skipLengthCache","8.0.0"],["hiddenColumn","8.0.0"],["hiddenRow","8.0.0"]]),yC=new Map([[]]);var PP={},bC,OP;function Sz(){if(OP)return bC;OP=1;var t=ju();return bC=function(e,n,r){for(var i=0,o=arguments.length>2?r:t(n),s=new e(o);o>i;)s[i]=n[i++];return s},bC}var SC,xP;function Rz(){if(xP)return SC;xP=1;var t=on();return SC=function(e,n){var r=t[e],i=r&&r.prototype;return i&&i[n]},SC}var RC,AP;function sp(){if(AP)return RC;AP=1;var t=Mi(),e=eR(),n=qs().f,r=t("unscopables"),i=Array.prototype;return i[r]===void 0&&n(i,r,{configurable:!0,value:e(null)}),RC=function(o){i[r][o]=!0},RC}var HP;function Ez(){if(HP)return PP;HP=1;var t=dt(),e=Kt(),n=dr(),r=ad(),i=Sz(),o=Rz(),s=sp(),a=Array,l=e(o("Array","sort"));return t({target:"Array",proto:!0},{toSorted:function(c){c!==void 0&&n(c);var h=r(this),d=i(a,h);return l(d,c)}}),s("toSorted"),PP}Ez();var NP={},DP={},kP;function Tz(){if(kP)return DP;kP=1;var t=dt(),e=sn(),n=Uu(),r=dr(),i=ln(),o=ho(),s=Ir(),a=Ks(),l=a("find",TypeError);return t({target:"Iterator",proto:!0,real:!0,forced:l},{find:function(c){i(this);try{r(c)}catch(f){s(this,"throw",f)}if(l)return e(l,this,c);var h=o(this),d=0;return n(h,function(f,g){if(c(f,d++))return g(f)},{IS_RECORD:!0,INTERRUPTED:!0}).result}}),DP}var LP;function _z(){return LP||(LP=1,Tz()),NP}_z();function Mz(t,e){jN(t,e),e.add(t)}function EC(t,e,n){jN(t,e),e.set(t,n)}function jN(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function $P(t,e,n){return t.set(Jg(t,e),n),n}function Sn(t,e){return t.get(Jg(t,e))}function Jg(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const Iz=100;var vr=new WeakMap,uu=new WeakMap,TC=new WeakMap,_C=new WeakSet;class FP{constructor(){Mz(this,_C),EC(this,vr,new Map),EC(this,uu,new Map),EC(this,TC,new Set),Ya.forEach(e=>Jg(_C,this,VP).call(this,e))}getHooks(e){var n;return(n=Sn(vr,this).get(e))!==null&&n!==void 0?n:[]}add(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Sn(vr,this).has(e)||(Jg(_C,this,VP).call(this,e),Ya.push(e));const i=Sn(vr,this).get(e);if(i.find(u=>u.callback===n))return;const o=Number.isInteger(r.orderIndex)?r.orderIndex:0,s=!!r.runOnce,a=!!r.initialHook;let l=!1;if(a){const u=i.find(c=>c.initialHook);u&&(u.callback=n,l=!0)}if(!l){i.push({callback:n,orderIndex:o,runOnce:s,initialHook:a,skip:!1});let u=Sn(TC,this).has(e);!u&&o!==0&&(u=!0,Sn(TC,this).add(e)),u&&i.length>1&&Sn(vr,this).set(e,i.toSorted((c,h)=>c.orderIndex-h.orderIndex))}}has(e){return Sn(vr,this).has(e)&&Sn(vr,this).get(e).length>0}remove(e,n){if(!Sn(vr,this).has(e))return!1;const r=Sn(vr,this).get(e),i=r.find(o=>o.callback===n);if(i){let o=Sn(uu,this).get(e);return i.skip=!0,o+=1,o>Iz&&(Sn(vr,this).set(e,r.filter(s=>!s.skip)),o=0),Sn(uu,this).set(e,o),!0}return!1}destroy(){Sn(vr,this).clear(),Sn(uu,this).clear(),$P(vr,this,null),$P(uu,this,null)}}function VP(t){Sn(vr,this).set(t,[]),Sn(uu,this).set(t,0)}function Pz(t,e,n){return(e=Oz(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Oz(t){var e=xz(t,"string");return typeof e=="symbol"?e:e+""}function xz(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const Az=nt`The plugin hook "[hookName]" was removed in Handsontable [removedInVersion].\x20
|
|
33
|
+
Please consult release notes https://github.com/handsontable/handsontable/releases/tag/[removedInVersion] to\x20
|
|
34
|
+
learn about the migration path.`;class re{constructor(){Pz(this,"globalBucket",new FP)}static getSingleton(){return Nz()}getBucket(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return e?(e.pluginHookBucket||(e.pluginHookBucket=new FP),e.pluginHookBucket):this.globalBucket}add(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,i=arguments.length>3?arguments[3]:void 0;return Array.isArray(n)?M(n,o=>this.add(e,o,r)):(CC.has(e)&&Ze(wN(Az,{hookName:e,removedInVersion:CC.get(e)})),yC.has(e)&&Ze(yC.get(e)),this.getBucket(r).add(e,n,{orderIndex:i,runOnce:!1})),this}once(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,i=arguments.length>3?arguments[3]:void 0;return Array.isArray(n)?M(n,o=>this.once(e,o,r)):this.getBucket(r).add(e,n,{orderIndex:i,runOnce:!0}),this}addAsFixed(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;return Array.isArray(n)?M(n,i=>this.addAsFixed(e,i,r)):this.getBucket(r).add(e,n,{initialHook:!0}),this}remove(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;return this.getBucket(r).remove(e,n)}has(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return this.getBucket(n).has(e)}run(e,n,r,i,o,s,a,l){{const u=this.getBucket().getHooks(n),c=u?u.length:0;let h=0;if(c)for(;h<c;){if(!u[h]||u[h].skip){h+=1;continue}const d=Zb(u[h].callback,e,r,i,o,s,a,l);d!==void 0&&(r=d),u[h]&&u[h].runOnce&&this.remove(n,u[h].callback),h+=1}}{const u=this.getBucket(e).getHooks(n),c=u?u.length:0;let h=0;if(c)for(;h<c;){if(!u[h]||u[h].skip){h+=1;continue}const d=Zb(u[h].callback,e,r,i,o,s,a,l);d!==void 0&&(r=d),u[h]&&u[h].runOnce&&this.remove(n,u[h].callback,e),h+=1}}return r}destroy(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;this.getBucket(e).destroy()}register(e){this.isRegistered(e)||Ya.push(e)}deregister(e){this.isRegistered(e)&&Ya.splice(Ya.indexOf(e),1)}isDeprecated(e){return yC.has(e)||CC.has(e)}isRegistered(e){return Ya.indexOf(e)>=0}getRegistered(){return Ya}}const Hz=new re;function Nz(){return Hz}const MC=new Map;function Oi(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"common";MC.has(t)||MC.set(t,new Map);const e=MC.get(t);function n(a,l){e.set(a,l)}function r(a){return e.get(a)}function i(a){return e.has(a)}function o(){return[...e.keys()]}function s(){return[...e.values()]}return{register:n,getItem:r,hasItem:i,getNames:o,getValues:s}}const Qb=new WeakMap,{register:Dz,getItem:UN,hasItem:zN,getNames:vle,getValues:Cle}=Oi("editors");function kz(t){const e={},n=t;this.getConstructor=function(){return t},this.getInstance=function(r){return r.guid in e||(e[r.guid]=new n(r)),e[r.guid]},re.getSingleton().add("afterDestroy",function(){e[this.guid]=null})}function YN(t,e){let n;if(typeof t=="function")Qb.get(t)||yr(null,t),n=Qb.get(t);else if(typeof t=="string")n=UN(t);else throw Error('Only strings and functions can be passed as "editor" parameter');if(!n)throw Error(`No editor registered under name "${t}"`);return n.getInstance(e)}function Jb(t){if(typeof t=="function")return t;if(!zN(t))throw Error(`No registered editor found under "${t}" name`);return UN(t).getConstructor()}function yr(t,e){t&&typeof t!="string"&&(e=t,t=e.EDITOR_TYPE);const n=new kz(e);typeof t=="string"&&Dz(t,n),Qb.set(e,n)}function Lz(t,e,n){return(e=$z(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function $z(t){var e=Fz(t,"string");return typeof e=="symbol"?e:e+""}function Fz(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class _i{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;Lz(this,"context",void 0),this.context=e||this,this.context.eventListeners||(this.context.eventListeners=[])}addEventListener(e,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;function o(s){r.call(this,Vz(s))}return this.context.eventListeners.push({element:e,event:n,callback:r,callbackProxy:o,options:i,eventManager:this}),e.addEventListener(n,o,i),()=>{this.removeEventListener(e,n,r)}}removeEventListener(e,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,o=this.context.eventListeners.length,s;for(;o;)if(o-=1,s=this.context.eventListeners[o],s.event===n&&s.element===e){if(r&&r!==s.callback||i&&s.eventManager!==this)continue;this.context.eventListeners.splice(o,1),s.element.removeEventListener(s.event,s.callbackProxy,s.options)}}clearEvents(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(!this.context)return;let n=this.context.eventListeners.length;for(;n;){n-=1;const r=this.context.eventListeners[n];e&&r.eventManager!==this||(this.context.eventListeners.splice(n,1),r.element.removeEventListener(r.event,r.callbackProxy,r.options))}}clear(){this.clearEvents()}destroy(){this.clearEvents(),this.context=null}destroyWithOwnEventsOnly(){this.clearEvents(!0),this.context=null}fireEvent(e,n){let r=e.document,i=e;r||(r=e.ownerDocument?e.ownerDocument:e,i=r.defaultView);const o={bubbles:!0,cancelable:n!=="mousemove",view:i,detail:0,screenX:0,screenY:0,clientX:1,clientY:1,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0};let s;r.createEvent?(s=r.createEvent("MouseEvents"),s.initMouseEvent(n,o.bubbles,o.cancelable,o.view,o.detail,o.screenX,o.screenY,o.clientX,o.clientY,o.ctrlKey,o.altKey,o.shiftKey,o.metaKey,o.button,r.body.parentNode)):s=r.createEventObject(),e.dispatchEvent?e.dispatchEvent(s):e.fireEvent(`on${n}`,s)}}function Vz(t){const e=t.stopImmediatePropagation;return t.stopImmediatePropagation=function(){e.apply(this),Pi(this)},t}function Wz(t,e){Bz(t,e),e.add(t)}function Bz(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ra(t,e,n){return(e=jz(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function jz(t){var e=Uz(t,"string");return typeof e=="symbol"?e:e+""}function Uz(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function IC(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Vd=new WeakSet;class eS{constructor(e,n,r){Wz(this,Vd),ra(this,"hot",void 0),ra(this,"tableMeta",void 0),ra(this,"selection",void 0),ra(this,"eventManager",void 0),ra(this,"destroyed",!1),ra(this,"activeEditor",void 0),ra(this,"cellProperties",void 0),this.hot=e,this.tableMeta=n,this.selection=r,this.eventManager=new _i(e),this.hot.addHook("afterDocumentKeyDown",i=>IC(Vd,this,WP).call(this,i)),this.hot.addHook("beforeCompositionStart",i=>IC(Vd,this,WP).call(this,i)),this.hot.view._wt.update("onCellDblClick",(i,o,s)=>IC(Vd,this,zz).call(this,i,o,s))}getActiveEditor(){return this.activeEditor}prepareEditor(){var e;if(this.activeEditor&&this.activeEditor.isWaiting()){this.closeEditor(!1,!1,u=>{u&&this.prepareEditor()});return}const n=(e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;if(!n||n.isHeader())return;const{row:r,col:i}=n,o=this.hot.runHooks("modifyGetCellCoords",r,i,!1,"meta");let s=r,a=i;if(Array.isArray(o)&&([s,a]=o),this.cellProperties=this.hot.getCellMeta(s,a),!this.isCellEditable()){this.clearActiveEditor();return}const l=this.hot.getCell(r,i,!0);if(l){const u=this.hot.getCellEditor(this.cellProperties),c=this.hot.colToProp(a),h=this.hot.getSourceDataAtCell(this.hot.toPhysicalRow(s),a);this.activeEditor=YN(u,this.hot),this.activeEditor.prepare(r,i,c,l,h,this.cellProperties)}}isEditorOpened(){return this.activeEditor&&this.activeEditor.isOpened()}openEditor(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(!this.isCellEditable()){this.clearActiveEditor();return}const i=this.hot.getSelectedRangeLast();let o=this.hot.runHooks("beforeBeginEditing",i.highlight.row,i.highlight.col,e,n,r);if(n instanceof MouseEvent&&typeof o!="boolean"&&(o=this.hot.selection.getLayerLevel()===0&&i.isSingle()),o===!1){this.clearActiveEditor();return}this.activeEditor||(this.hot.scrollToFocusedCell(),this.prepareEditor()),this.activeEditor&&(r&&this.activeEditor.enableFullEditMode(),this.activeEditor.beginEditing(e,n))}closeEditor(e,n,r){this.activeEditor?this.activeEditor.finishEditing(e,n,r):r&&r(!1)}closeEditorAndSaveChanges(e){this.closeEditor(!1,e)}closeEditorAndRestoreOriginalValue(e){this.closeEditor(!0,e)}clearActiveEditor(){this.activeEditor=void 0}isCellEditable(){const e=this.hot.getSelectedRangeLast();if(!e)return!1;const n=this.hot.getCellEditor(this.cellProperties),{row:r,col:i}=e.highlight,{rowIndexMapper:o,columnIndexMapper:s}=this.hot,a=o.isHidden(this.hot.toPhysicalRow(r))||s.isHidden(this.hot.toPhysicalColumn(i));return!(this.cellProperties.readOnly||!n||a)}moveSelectionAfterEnter(e){const n={...typeof this.tableMeta.enterMoves=="function"?this.tableMeta.enterMoves(e):this.tableMeta.enterMoves};e.shiftKey&&(n.row=-n.row,n.col=-n.col),this.hot.selection.isMultiple()?this.selection.transformFocus(n.row,n.col):this.selection.transformStart(n.row,n.col,!0)}destroy(){this.destroyed=!0,this.eventManager.destroy()}}function WP(t){const e=this.hot.getSelectedRangeLast();if(!this.hot.isListening()||!e||e.highlight.isHeader()||za(t))return;const{keyCode:n}=t,r=(t.ctrlKey||t.metaKey)&&!t.altKey;(!this.activeEditor||this.activeEditor&&!this.activeEditor.isWaiting())&&!BN(n)&&!Cz(n)&&!r&&!this.isEditorOpened()&&this.openEditor("",t)}function zz(t,e){e.isCell()&&this.openEditor(null,t,!0)}const BP=new WeakMap;eS.getInstance=function(t,e,n){let r=BP.get(t);return r||(r=new eS(t,e,n),BP.set(t,r)),r};function Yz(t,e){GN(t,e),e.add(t)}function dc(t,e,n){GN(t,e),e.set(t,n)}function GN(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function gt(t,e){return t.get(Vo(t,e))}function fc(t,e,n){return t.set(Vo(t,e),n),n}function Vo(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const _u=Object.freeze({CELL:"cell",MIXED:"mixed"});var en=new WeakMap,Wd=new WeakMap,Bd=new WeakMap,jd=new WeakMap,Ud=new WeakMap,_s=new WeakSet;class Gz{constructor(e){var n=this;Yz(this,_s),dc(this,en,void 0),dc(this,Wd,void 0),dc(this,Bd,1),dc(this,jd,null),dc(this,Ud,new Map);const r=e.getSettings();fc(en,this,e),fc(Wd,this,r.imeFastEdit?_u.MIXED:_u.CELL),gt(en,this).addHook("afterUpdateSettings",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return Vo(_s,n,Kz).call(n,...o)}),gt(en,this).addHook("afterSelection",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return Vo(_s,n,jP).call(n,...o)}),gt(en,this).addHook("afterSelectionFocusSet",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return Vo(_s,n,jP).call(n,...o)}),gt(en,this).addHook("afterSelectionEnd",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return Vo(_s,n,qz).call(n,...o)})}getFocusMode(){return gt(Wd,this)}setFocusMode(e){Object.values(_u).includes(e)?fc(Wd,this,e):Ze(`"${e}" is not a valid focus mode.`)}getRefocusDelay(){return gt(Bd,this)}setRefocusDelay(e){fc(Bd,this,e)}setRefocusElementGetter(e){fc(jd,this,e)}getRefocusElement(){var e;return typeof gt(jd,this)=="function"?gt(jd,this).call(this):(e=gt(en,this).getActiveEditor())===null||e===void 0?void 0:e.TEXTAREA}focusOnHighlightedCell(e){const n=r=>{var i,o;const s=(i=gt(en,this).getSelectedRangeLast())===null||i===void 0?void 0:i.highlight;if(!s)return;let a=gt(en,this).runHooks("modifyFocusedElement",s.row,s.col,r);Qo(a)||(a=r),a&&!((o=gt(en,this).getActiveEditor())!==null&&o!==void 0&&o.isOpened())&&a.focus({preventScroll:!0})};e?n(e):Vo(_s,this,DR).call(this,r=>n(r))}refocusToEditorTextarea(){var e;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:gt(Bd,this);if(gt(en,this).getSettings().imeFastEdit&&!((e=gt(en,this).getActiveEditor())!==null&&e!==void 0&&e.isOpened())){var r,i;(r=gt(en,this).getActiveEditor())===null||r===void 0||(i=r.refreshValue)===null||i===void 0||i.call(r),gt(Ud,this).has(n)||gt(Ud,this).set(n,ip(()=>{if(!gt(en,this).isDestroyed){var o;(o=this.getRefocusElement())===null||o===void 0||o.select()}},n)),gt(Ud,this).get(n)()}}}function DR(t){var e;const n=(e=gt(en,this).getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;if(!n||!gt(en,this).selection.isCellVisible(n)){t(null);return}const r=gt(en,this).getCell(n.row,n.col,!0);r===null?gt(en,this).addHookOnce("afterScroll",()=>{t(gt(en,this).getCell(n.row,n.col,!0))}):t(r)}function jP(){Vo(_s,this,DR).call(this,t=>{const{activeElement:e}=gt(en,this).rootDocument;e&&HN(e)&&e.blur(),this.focusOnHighlightedCell(t)})}function qz(){Vo(_s,this,DR).call(this,t=>{this.getFocusMode()===_u.MIXED&&(t==null?void 0:t.nodeName)==="TD"&&this.refocusToEditorTextarea()})}function Kz(t){typeof t.imeFastEdit=="boolean"&&this.setFocusMode(t.imeFastEdit?_u.MIXED:_u.CELL)}var UP={},PC,zP;function Xz(){if(zP)return PC;zP=1;var t=Xr(),e=fl(),n=Mi(),r=n("match");return PC=function(i){var o;return t(i)&&((o=i[r])!==void 0?!!o:e(i)==="RegExp")},PC}var OC,YP;function Zz(){if(YP)return OC;YP=1;var t=ln();return OC=function(){var e=t(this),n="";return e.hasIndices&&(n+="d"),e.global&&(n+="g"),e.ignoreCase&&(n+="i"),e.multiline&&(n+="m"),e.dotAll&&(n+="s"),e.unicode&&(n+="u"),e.unicodeSets&&(n+="v"),e.sticky&&(n+="y"),n},OC}var xC,GP;function Qz(){if(GP)return xC;GP=1;var t=sn(),e=Zr(),n=ld(),r=Zz(),i=RegExp.prototype;return xC=function(o){var s=o.flags;return s===void 0&&!("flags"in i)&&!e(o,"flags")&&n(i,o)?t(r,o):s},xC}var AC,qP;function Jz(){if(qP)return AC;qP=1;var t=Kt(),e=Wu(),n=Math.floor,r=t("".charAt),i=t("".replace),o=t("".slice),s=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,a=/\$([$&'`]|\d{1,2})/g;return AC=function(l,u,c,h,d,f){var g=c+l.length,C=h.length,y=a;return d!==void 0&&(d=e(d),y=s),i(f,y,function(E,v){var P;switch(r(v,0)){case"$":return"$";case"&":return l;case"`":return o(u,0,c);case"'":return o(u,g);case"<":P=d[o(v,1,-1)];break;default:var O=+v;if(O===0)return E;if(O>C){var L=n(O/10);return L===0?E:L<=C?h[L-1]===void 0?r(v,1):h[L-1]+r(v,1):E}P=h[O-1]}return P===void 0?"":P})},AC}var KP;function eY(){if(KP)return UP;KP=1;var t=dt(),e=sn(),n=Kt(),r=sd(),i=an(),o=Xr(),s=Xz(),a=jm(),l=ud(),u=Qz(),c=Jz(),h=Mi(),d=Gs(),f=h("replace"),g=TypeError,C=n("".indexOf),y=n("".replace),E=n("".slice),v=Math.max;return t({target:"String",proto:!0},{replaceAll:function(O,L){var T=r(this),A,q,U,j,Z,J,se,te,ue,pt,be=0,ke="";if(o(O)){if(A=s(O),A&&(q=a(r(u(O))),!~C(q,"g")))throw new g("`.replaceAll` does not allow non-global regexes");if(U=l(O,f),U)return e(U,O,T,L);if(d&&A)return y(a(T),O,L)}for(j=a(T),Z=a(O),J=i(L),J||(L=a(L)),se=Z.length,te=v(1,se),ue=C(j,Z);ue!==-1;)pt=J?a(L(Z,ue,j)):c(Z,j,ue,[],void 0,L),ke+=E(j,be,ue)+pt,be=ue+se,ue=ue+te>j.length?-1:C(j,Z,ue+te);return be<j.length&&(ke+=E(j,be)),ke}}),UP}eY();var XP={},ZP={},QP;function tY(){if(QP)return ZP;QP=1;var t=dt(),e=Uu(),n=dr(),r=ln(),i=ho(),o=Ir(),s=Ks(),a=hd(),l=Cn(),u=TypeError,c=l(function(){[].keys().reduce(function(){},void 0)}),h=!c&&s("reduce",u);return t({target:"Iterator",proto:!0,real:!0,forced:c||h},{reduce:function(f){r(this);try{n(f)}catch(v){o(this,"throw",v)}var g=arguments.length<2,C=g?void 0:arguments[1];if(h)return a(h,this,g?[f]:[f,C]);var y=i(this),E=0;if(e(y,function(v){g?(g=!1,C=v):C=f(C,v,E),E++},{IS_RECORD:!0}),g)throw new u("Reduce of empty iterator with no initial value");return C}}),ZP}var JP;function nY(){return JP||(JP=1,tY()),XP}nY();const qN={" ":" ","&":"&","<":"<",">":">"},rY=new RegExp(Object.keys(qN).map(t=>`(${t})`).join("|"),"gi");function iY(t){return(t&&t.nodeName||"")==="TABLE"}function eO(t){const e=t.hasColHeaders(),n=t.hasRowHeaders(),r=[e?-1:0,n?-1:0,t.countRows()-1,t.countCols()-1],i=t.getData(...r),o=i.length,s=o>0?i[0].length:0,a=["<table>","</table>"],l=e?["<thead>","</thead>"]:[],u=["<tbody>","</tbody>"],c=n?1:0,h=e?1:0;for(let d=0;d<o;d+=1){const f=e&&d===0,g=[];for(let y=0;y<s;y+=1){const E=!f&&n&&y===0;let v="";if(f)v=`<th>${t.getColHeader(y-c)}</th>`;else if(E)v=`<th>${t.getRowHeader(d-h)}</th>`;else{const P=i[d][y],{hidden:O,rowspan:L,colspan:T}=t.getCellMeta(d-h,y-c);if(!O){const A=[];if(L&&A.push(`rowspan="${L}"`),T&&A.push(`colspan="${T}"`),Ut(P))v=`<td ${A.join(" ")}></td>`;else{const q=P.toString().replace(/</g,"<").replace(/>/g,">").replace(/(<br(\s*|\/)>(\r\n|\n)?|\r\n|\n)/g,`<br>\r
|
|
35
|
+
`).replace(/\x20/gi," ").replace(/\t/gi,"	");v=`<td ${A.join(" ")}>${q}</td>`}}}g.push(v)}const C=["<tr>",...g,"</tr>"].join("");f?l.splice(1,0,C):u.splice(-1,0,C)}return a.splice(1,0,l.join(""),u.join("")),a.join("")}function tO(t){const e=t.length,n=["<table>"];for(let r=0;r<e;r+=1){const i=t[r],o=i.length,s=[];r===0&&n.push("<tbody>");for(let a=0;a<o;a+=1){const l=i[a],u=Ut(l)?"":l.toString().replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/(<br(\s*|\/)>(\r\n|\n)?|\r\n|\n)/g,`<br>\r
|
|
36
|
+
`).replace(/\x20{2,}/gi,c=>`<span style="mso-spacerun: yes">${" ".repeat(c.length-1)} </span>`).replace(/\t/gi,"	");s.push(`<td>${u}</td>`)}n.push("<tr>",...s,"</tr>"),r+1===e&&n.push("</tbody>")}return n.push("</table>"),n.join("")}function oY(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:document;const n={},r=e.createDocumentFragment(),i=e.createElement("div");r.appendChild(i);let o=t;if(typeof o=="string"){const P=o.replace(/<td\b[^>]*?>([\s\S]*?)<\/\s*td>/g,O=>{const L=O.match(/<td\b[^>]*?>/g)[0],T=/<p.*?>/g,A=O.substring(L.length,O.lastIndexOf("<")).trim().replaceAll(/\n\s+/g," ").replaceAll(T,`
|
|
37
|
+
`).replace(`
|
|
38
|
+
`,"").replaceAll(/<\/(.*)>\s+$/mg,"</$1>").replace(/(<(?!br)([^>]+)>)/gi,"").replaceAll(/^ $/mg,"");return`${L}${A}</td>`});i.insertAdjacentHTML("afterbegin",`${P}`),o=i.querySelector("table")}if(!o||!iY(o))return;const s=i.querySelector('meta[name$="enerator"]'),a=o.querySelector("tbody th")!==null,l=o.querySelector("tr"),u=l?Array.from(l.cells).reduce((P,O)=>P+O.colSpan,0)-(a?1:0):0,c=o.tFoot&&Array.from(o.tFoot.rows)||[],h=[];let d=!1,f=0,g=0;if(o.tHead){const P=Array.from(o.tHead.rows).filter(O=>{const L=O.querySelector("td")!==null;return L&&h.push(O),!L});f=P.length,d=f>0,f>1?n.nestedHeaders=Array.from(P).reduce((O,L)=>{const T=Array.from(L.cells).reduce((A,q,U)=>{if(a&&U===0)return A;const{colSpan:j,innerHTML:Z}=q,J=j>1?{label:Z,colspan:j}:Z;return A.push(J),A},[]);return O.push(T),O},[]):d&&(n.colHeaders=Array.from(P[0].children).reduce((O,L,T)=>(a&&T===0||O.push(L.innerHTML),O),[]))}h.length&&(n.fixedRowsTop=h.length),c.length&&(n.fixedRowsBottom=c.length);const C=[...h,...Array.from(o.tBodies).reduce((P,O)=>(P.push(...Array.from(O.rows)),P),[]),...c];g=C.length;const y=new Array(g);for(let P=0;P<g;P++)y[P]=new Array(u);const E=[],v=[];for(let P=0;P<g;P++){const O=C[P],L=Array.from(O.cells),T=L.length;for(let A=0;A<T;A++){const q=L[A],{nodeName:U,innerHTML:j,rowSpan:Z,colSpan:J}=q,se=y[P].findIndex(te=>te===void 0);if(U==="TD"){if(Z>1||J>1){for(let be=P;be<P+Z;be++)if(be<g)for(let ke=se;ke<se+J;ke++)y[be][ke]=null;const ue=q.getAttribute("style");ue&&ue.includes("mso-ignore:colspan")||E.push({col:se,row:P,rowspan:Z,colspan:J})}let te="";s&&/excel/gi.test(s.content)?te=j.replace(/[\r\n][\x20]{0,2}/g," ").replace(/<br(\s*|\/)>[\r\n]?[\x20]{0,3}/gim,`\r
|
|
39
|
+
`):te=j.replace(/<br(\s*|\/)>[\r\n]?/gim,`\r
|
|
40
|
+
`),y[P][se]=te.replace(rY,ue=>qN[ue])}else v.push(j)}}return E.length&&(n.mergeCells=E),v.length&&(n.rowHeaders=v),y.length&&(n.data=y),n}function Un(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const n=typeof t;if(n==="number")return!isNaN(t)&&isFinite(t);if(n==="string"){if(t.length===0)return!1;if(t.length===1)return/\d/.test(t);const r=Array.from(new Set([".",...e])).map(i=>`\\${i}`).join("|");return new RegExp(`^[+-]?(((${r})?\\d+((${r})\\d+)?(e[+-]?\\d+)?)|(0x[a-f\\d]+))$`,"i").test(t.trim())}else if(n==="object")return!!t&&typeof t.valueOf()=="number"&&!(t instanceof Date);return!1}function sY(t){return Un(t,[","])}function de(t,e,n){let r=-1;for(typeof e=="function"?(n=e,e=t):r=t-1;++r<=e&&n(r)!==!1;);}function nO(t,e,n){let r=t+1;for(typeof e=="function"&&(n=e,e=0);--r>=e&&n(r)!==!1;);}function KN(t,e){return e=parseInt(e.toString().replace("%",""),10),e=isNaN(e)?0:e,parseInt(t*e/100,10)}function Ue(t,e,n){return Math.min(t,e)===t?e:Math.max(t,n)===t?n:t}const tS="asc",aY="desc",rO=new Map([[tS,[-1,1]],[aY,[1,-1]]]),lY=t=>`The priority '${t}' is already declared in a map.`,uY=t=>`The priority '${t}' is not a number.`;function cY(){let{errorPriorityExists:t,errorPriorityNaN:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=new Map;t=ot(t)?t:lY,e=ot(e)?e:uY;function r(o,s){if(!Un(o))throw new Error(e(o));if(n.has(o))throw new Error(t(o));n.set(o,s)}function i(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:tS;const[s,a]=rO.get(o)||rO.get(tS);return[...n].sort((l,u)=>l[0]<u[0]?s:a).map(l=>l[1])}return{addItem:r,getItems:i}}const hY=t=>`The id '${t}' is already declared in a map.`;function ap(){let{errorIdExists:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const e=new Map;t=ot(t)?t:hY;function n(u,c){if(l(u))throw new Error(t(u));e.set(u,c)}function r(u){return e.delete(u)}function i(){e.clear()}function o(u){const[c]=a().find(h=>{let[d,f]=h;return u===f?d:!1})||[null];return c}function s(u){return e.get(u)}function a(){return[...e]}function l(u){return e.has(u)}return{addItem:n,clear:i,getId:o,getItem:s,getItems:a,hasItem:l,removeItem:r}}const dY=t=>`'${t}' value is already declared in a unique set.`;function fY(){let{errorItemExists:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const e=new Set;t=ot(t)?t:dY;function n(o){if(e.has(o))throw new Error(t(o));e.add(o)}function r(){return[...e]}function i(){e.clear()}return{addItem:n,clear:i,getItems:r}}const kR=t=>`There is already registered "${t}" plugin.`,gY=t=>`There is already registered plugin on priority "${t}".`,mY=t=>`The priority "${t}" is not a number.`,XN=cY({errorPriorityExists:gY,errorPriorityNaN:mY}),ZN=fY({errorItemExists:kR}),nS=ap({errorIdExists:kR});function QN(){return[...XN.getItems(),...ZN.getItems()]}function LR(t){const e=Ti(t);return nS.getItem(e)}function pY(t){return!!LR(t)}function ze(t,e,n){[t,e,n]=vY(t,e,n),LR(t)===void 0&&wY(t,e,n)}function wY(t,e,n){const r=Ti(t);if(nS.hasItem(r))throw new Error(kR(r));n===void 0?ZN.addItem(r):XN.addItem(n,r),nS.addItem(r,e)}function vY(t,e,n){return typeof t=="function"&&(e=t,t=e.PLUGIN_KEY,n=e.PLUGIN_PRIORITY),[t,e,n]}const{register:CY,getItem:yY,hasItem:JN,getNames:yle,getValues:ble}=Oi("renderers");function rS(t){if(typeof t=="function")return t;if(!JN(t))throw Error(`No registered renderer found under "${t}" name`);return yY(t)}function Lr(t,e){typeof t!="string"&&(e=t,t=e.RENDERER_TYPE),CY(t,e)}const{register:bY,getItem:SY,hasItem:eD,getNames:Sle,getValues:Rle}=Oi("validators");function RY(t){if(typeof t=="function")return t;if(!eD(t))throw Error(`No registered validator found under "${t}" name`);return SY(t)}function cu(t,e){typeof t!="string"&&(e=t,t=e.VALIDATOR_TYPE),bY(t,e)}var iO={},oO;function EY(){if(oO)return iO;oO=1;var t=dt(),e=Wu(),n=ju(),r=cd(),i=sp();return t({target:"Array",proto:!0},{at:function(s){var a=e(this),l=n(a),u=r(s),c=u>=0?u:l+u;return c<0||c>=l?void 0:a[c]}}),i("at"),iO}EY();var sO={},aO;function TY(){if(aO)return sO;aO=1;var t=dt(),e=Kt(),n=sd(),r=cd(),i=jm(),o=Cn(),s=e("".charAt),a=o(function(){return"𠮷".at(-2)!=="\uD842"});return t({target:"String",proto:!0,forced:a},{at:function(u){var c=i(n(this)),h=c.length,d=r(u),f=d>=0?d:h+d;return f<0||f>=h?void 0:s(c,f)}}),sO}TY();function gc(t,e,n){return(e=_Y(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _Y(t){var e=MY(t,"string");return typeof e=="symbol"?e:e+""}function MY(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class IY{constructor(){gc(this,"count",0),gc(this,"startColumn",null),gc(this,"endColumn",null),gc(this,"startPosition",null),gc(this,"isVisibleInTrimmingContainer",!1)}initialize(){}process(e,n){const{totalCalculatedWidth:r,zeroBasedScrollOffset:i,viewportWidth:o,columnWidth:s}=n,a=i>0?o+1:o;r>=i&&r+s<=i+a&&((this.startColumn===null||this.startColumn===void 0)&&(this.startColumn=e),this.endColumn=e)}finalize(e){var n;const{scrollOffset:r,viewportWidth:i,inlineStartOffset:o,zeroBasedScrollOffset:s,totalColumns:a,needReverse:l,startPositions:u,columnWidth:c}=e;if(this.endColumn===a-1&&l)for(this.startColumn=this.endColumn;this.startColumn>0;){const g=u[this.endColumn]+c-u[this.startColumn-1];if(g<=i&&(this.startColumn-=1),g>=i)break}this.startPosition=(n=u[this.startColumn])!==null&&n!==void 0?n:null;const h=s>0?i+1:i,d=r+i-h,f=this.startColumn===null?0:e.getColumnWidth(this.startColumn);d<-1*o||r>u.at(-1)||-1*r-i>-1*f?this.isVisibleInTrimmingContainer=!1:this.isVisibleInTrimmingContainer=!0,a<this.endColumn&&(this.endColumn=a-1),this.startColumn!==null&&(this.count=this.endColumn-this.startColumn+1)}}function mc(t,e,n){return(e=PY(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function PY(t){var e=OY(t,"string");return typeof e=="symbol"?e:e+""}function OY(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class xY{constructor(){mc(this,"count",0),mc(this,"startRow",null),mc(this,"endRow",null),mc(this,"startPosition",null),mc(this,"isVisibleInTrimmingContainer",!1)}initialize(){}process(e,n){const{totalCalculatedHeight:r,zeroBasedScrollOffset:i,innerViewportHeight:o,rowHeight:s}=n;r>=i&&r+s<=o&&(this.startRow===null&&(this.startRow=e),this.endRow=e)}finalize(e){var n;const{scrollOffset:r,viewportHeight:i,horizontalScrollbarHeight:o,totalRows:s,needReverse:a,startPositions:l,rowHeight:u}=e;if(this.endRow===s-1&&a)for(this.startRow=this.endRow;this.startRow>0;){const d=l[this.endRow]+u-l[this.startRow-1];if(d<=i-o&&(this.startRow-=1),d>=i-o)break}this.startPosition=(n=l[this.startRow])!==null&&n!==void 0?n:null;const c=r+i-o,h=this.startRow===null?0:e.getRowHeight(this.startRow);c<h||r>l.at(-1)?this.isVisibleInTrimmingContainer=!1:this.isVisibleInTrimmingContainer=!0,s<this.endRow&&(this.endRow=s-1),this.startRow!==null&&(this.count=this.endRow-this.startRow+1)}}function pc(t,e,n){return(e=AY(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function AY(t){var e=HY(t,"string");return typeof e=="symbol"?e:e+""}function HY(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class tD{constructor(){pc(this,"count",0),pc(this,"startColumn",null),pc(this,"endColumn",null),pc(this,"startPosition",null),pc(this,"isVisibleInTrimmingContainer",!1)}initialize(){}process(e,n){const{totalCalculatedWidth:r,zeroBasedScrollOffset:i,viewportWidth:o}=n;r<=i&&(this.startColumn=e);const s=i>0?o+1:o;r>=i&&r<=i+s&&(this.startColumn===null||this.startColumn===void 0)&&(this.startColumn=e),this.endColumn=e}finalize(e){var n;const{scrollOffset:r,viewportWidth:i,inlineStartOffset:o,zeroBasedScrollOffset:s,totalColumns:a,needReverse:l,startPositions:u,columnWidth:c}=e;if(this.endColumn===a-1&&l)for(this.startColumn=this.endColumn;this.startColumn>0;){const f=u[this.endColumn]+c-u[this.startColumn-1];if(this.startColumn-=1,f>i)break}this.startPosition=(n=u[this.startColumn])!==null&&n!==void 0?n:null;const h=s>0?i+1:i;r+i-h<-1*o||r>u.at(-1)+c||-1*r-i>0?this.isVisibleInTrimmingContainer=!1:this.isVisibleInTrimmingContainer=!0,a<this.endColumn&&(this.endColumn=a-1),this.startColumn!==null&&(this.count=this.endColumn-this.startColumn+1)}}function wc(t,e,n){return(e=NY(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function NY(t){var e=DY(t,"string");return typeof e=="symbol"?e:e+""}function DY(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class nD{constructor(){wc(this,"count",0),wc(this,"startRow",null),wc(this,"endRow",null),wc(this,"startPosition",null),wc(this,"isVisibleInTrimmingContainer",!1)}initialize(){}process(e,n){const{totalCalculatedHeight:r,zeroBasedScrollOffset:i,innerViewportHeight:o}=n;r<=i&&(this.startRow=e),r>=i&&r<=o&&this.startRow===null&&(this.startRow=e),this.endRow=e}finalize(e){var n;const{scrollOffset:r,viewportHeight:i,horizontalScrollbarHeight:o,totalRows:s,needReverse:a,startPositions:l,rowHeight:u}=e;if(this.endRow===s-1&&a)for(this.startRow=this.endRow;this.startRow>0;){const h=l[this.endRow]+u-l[this.startRow-1];if(this.startRow-=1,h>=i-o)break}this.startPosition=(n=l[this.startRow])!==null&&n!==void 0?n:null,r+i-o<0||r>l.at(-1)+u?this.isVisibleInTrimmingContainer=!1:this.isVisibleInTrimmingContainer=!0,s<this.endRow&&(this.endRow=s-1),this.startRow!==null&&(this.count=this.endRow-this.startRow+1)}}function vc(t,e,n){return(e=kY(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function kY(t){var e=LY(t,"string");return typeof e=="symbol"?e:e+""}function LY(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class $Y{constructor(){vc(this,"count",0),vc(this,"startColumn",0),vc(this,"endColumn",0),vc(this,"startPosition",0),vc(this,"isVisibleInTrimmingContainer",!0)}initialize(e){let{totalColumns:n}=e;this.count=n,this.endColumn=this.count-1}process(){}finalize(){}}function Cc(t,e,n){return(e=FY(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function FY(t){var e=VY(t,"string");return typeof e=="symbol"?e:e+""}function VY(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class WY{constructor(){Cc(this,"count",0),Cc(this,"startRow",0),Cc(this,"endRow",0),Cc(this,"startPosition",0),Cc(this,"isVisibleInTrimmingContainer",!0)}initialize(e){let{totalRows:n}=e;this.count=n,this.endRow=this.count-1}process(){}finalize(){}}function lO(t,e,n){return(e=BY(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function BY(t){var e=jY(t,"string");return typeof e=="symbol"?e:e+""}function jY(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class UY extends tD{constructor(){super(...arguments),lO(this,"columnStartOffset",0),lO(this,"columnEndOffset",0)}finalize(e){var n;super.finalize(e);const{overrideFn:r,totalColumns:i,startPositions:o}=e;if(this.startColumn!==null&&typeof r=="function"){const s=this.startColumn,a=this.endColumn;r(this),this.columnStartOffset=s-this.startColumn,this.columnEndOffset=this.endColumn-a}this.startColumn<0&&(this.startColumn=0),this.startPosition=(n=o[this.startColumn])!==null&&n!==void 0?n:null,i<this.endColumn&&(this.endColumn=i-1),this.startColumn!==null&&(this.count=this.endColumn-this.startColumn+1)}}function uO(t,e,n){return(e=zY(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function zY(t){var e=YY(t,"string");return typeof e=="symbol"?e:e+""}function YY(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class GY extends nD{constructor(){super(...arguments),uO(this,"rowStartOffset",0),uO(this,"rowEndOffset",0)}finalize(e){var n;super.finalize(e);const{overrideFn:r,totalRows:i,startPositions:o}=e;if(this.startRow!==null&&typeof r=="function"){const s=this.startRow,a=this.endRow;r(this),this.rowStartOffset=s-this.startRow,this.rowEndOffset=this.endRow-a}this.startRow<0&&(this.startRow=0),this.startPosition=(n=o[this.startRow])!==null&&n!==void 0?n:null,i<this.endRow&&(this.endRow=i-1),this.startRow!==null&&(this.count=this.endRow-this.startRow+1)}}function cO(t,e,n){return(e=qY(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function qY(t){var e=KY(t,"string");return typeof e=="symbol"?e:e+""}function KY(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class rD{constructor(e){cO(this,"calculationTypes",[]),cO(this,"calculationResults",new Map),this.calculationTypes=e}_initialize(e){this.calculationTypes.forEach(n=>{let[r,i]=n;this.calculationResults.set(r,i),i.initialize(e)})}_process(e,n){this.calculationTypes.forEach(r=>{let[,i]=r;return i.process(e,n)})}_finalize(e){this.calculationTypes.forEach(n=>{let[,r]=n;return r.finalize(e)})}getResultsFor(e){return this.calculationResults.get(e)}}function ni(t,e,n){return(e=XY(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function XY(t){var e=ZY(t,"string");return typeof e=="symbol"?e:e+""}function ZY(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const Hu=50;class QY extends rD{constructor(e){let{calculationTypes:n,viewportWidth:r,scrollOffset:i,totalColumns:o,columnWidthFn:s,overrideFn:a,inlineStartOffset:l}=e;super(n),ni(this,"viewportWidth",0),ni(this,"scrollOffset",0),ni(this,"zeroBasedScrollOffset",0),ni(this,"totalColumns",0),ni(this,"columnWidthFn",null),ni(this,"columnWidth",0),ni(this,"overrideFn",null),ni(this,"inlineStartOffset",0),ni(this,"totalCalculatedWidth",0),ni(this,"startPositions",[]),ni(this,"needReverse",!0),this.viewportWidth=r,this.scrollOffset=i,this.zeroBasedScrollOffset=Math.max(i,0),this.totalColumns=o,this.columnWidthFn=s,this.overrideFn=a,this.inlineStartOffset=l,this.calculate()}calculate(){this._initialize(this);for(let e=0;e<this.totalColumns;e++)if(this.columnWidth=this.getColumnWidth(e),this._process(e,this),this.startPositions.push(this.totalCalculatedWidth),this.totalCalculatedWidth+=this.columnWidth,this.totalCalculatedWidth>=this.zeroBasedScrollOffset+this.viewportWidth){this.needReverse=!1;break}this._finalize(this)}getColumnWidth(e){const n=this.columnWidthFn(e);return isNaN(n)?Hu:n}}function Ar(t,e,n){return(e=JY(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function JY(t){var e=eG(t,"string");return typeof e=="symbol"?e:e+""}function eG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class tG extends rD{constructor(e){let{calculationTypes:n,viewportHeight:r,scrollOffset:i,totalRows:o,defaultRowHeight:s,rowHeightFn:a,overrideFn:l,horizontalScrollbarHeight:u}=e;super(n),Ar(this,"viewportHeight",0),Ar(this,"scrollOffset",0),Ar(this,"zeroBasedScrollOffset",0),Ar(this,"totalRows",0),Ar(this,"rowHeightFn",null),Ar(this,"rowHeight",0),Ar(this,"overrideFn",null),Ar(this,"horizontalScrollbarHeight",0),Ar(this,"innerViewportHeight",0),Ar(this,"totalCalculatedHeight",0),Ar(this,"startPositions",[]),Ar(this,"needReverse",!0),this.defaultHeight=s,this.viewportHeight=r,this.scrollOffset=i,this.zeroBasedScrollOffset=Math.max(i,0),this.totalRows=o,this.rowHeightFn=a,this.overrideFn=l,this.horizontalScrollbarHeight=u??0,this.innerViewportHeight=this.zeroBasedScrollOffset+this.viewportHeight-this.horizontalScrollbarHeight,this.calculate()}calculate(){this._initialize(this);for(let e=0;e<this.totalRows;e++)if(this.rowHeight=this.getRowHeight(e),this._process(e,this),this.startPositions.push(this.totalCalculatedHeight),this.totalCalculatedHeight+=this.rowHeight,this.totalCalculatedHeight>=this.innerViewportHeight){this.needReverse=!1;break}this._finalize(this)}getRowHeight(e){const n=this.rowHeightFn(e);return isNaN(n)?this.defaultHeight:n}}function nG(t,e,n){rG(t,e),e.set(t,n)}function rG(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function hO(t,e,n){return(e=iG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function iG(t){var e=oG(t,"string");return typeof e=="symbol"?e:e+""}function oG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function _l(t,e){return t.get(iD(t,e))}function dO(t,e,n){return t.set(iD(t,e),n),n}function iD(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Co=new WeakMap;class al{constructor(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;hO(this,"row",null),hO(this,"col",null),nG(this,Co,!1),dO(Co,this,r),typeof e<"u"&&typeof n<"u"&&(this.row=e,this.col=n)}isValid(e){const{countRows:n,countCols:r,countRowHeaders:i,countColHeaders:o}={countRows:0,countCols:0,countRowHeaders:0,countColHeaders:0,...e};return!(!Number.isInteger(this.row)||!Number.isInteger(this.col)||this.row<-o||this.col<-i||this.row>=n||this.col>=r)}isEqual(e){return e===this?!0:this.row===e.row&&this.col===e.col}isHeader(){return!this.isCell()}isCell(){return this.row>=0&&this.col>=0}isRtl(){return _l(Co,this)}isSouthEastOf(e){return this.row>=e.row&&(_l(Co,this)?this.col<=e.col:this.col>=e.col)}isNorthWestOf(e){return this.row<=e.row&&(_l(Co,this)?this.col>=e.col:this.col<=e.col)}isSouthWestOf(e){return this.row>=e.row&&(_l(Co,this)?this.col>=e.col:this.col<=e.col)}isNorthEastOf(e){return this.row<=e.row&&(_l(Co,this)?this.col<=e.col:this.col>=e.col)}normalize(){return this.row=this.row===null?this.row:Math.max(this.row,0),this.col=this.col===null?this.col:Math.max(this.col,0),this}assign(e){return Number.isInteger(e==null?void 0:e.row)&&(this.row=e.row),Number.isInteger(e==null?void 0:e.col)&&(this.col=e.col),e instanceof al&&dO(Co,this,e.isRtl()),this}clone(){return new al(this.row,this.col,_l(Co,this))}toObject(){return{row:this.row,col:this.col}}}function sG(t,e,n){aG(t,e),e.set(t,n)}function aG(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function HC(t,e,n){return(e=lG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function lG(t){var e=uG(t,"string");return typeof e=="symbol"?e:e+""}function uG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Hr(t,e){return t.get(oD(t,e))}function cG(t,e,n){return t.set(oD(t,e),n),n}function oD(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Xn=new WeakMap;class yd{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;HC(this,"highlight",null),HC(this,"from",null),HC(this,"to",null),sG(this,Xn,!1),this.highlight=e.clone(),this.from=n.clone(),this.to=r.clone(),cG(Xn,this,i)}setHighlight(e){return this.highlight=e.clone(),this}setFrom(e){return this.from=e.clone(),this}setTo(e){return this.to=e.clone(),this}normalize(){return this.highlight.normalize(),this.from.normalize(),this.to.normalize(),this}isValid(e){return this.from.isValid(e)&&this.to.isValid(e)}isSingle(){return this.isSingleCell()||this.isSingleHeader()}isSingleCell(){return this.from.row>=0&&this.from.row===this.to.row&&this.from.col>=0&&this.from.col===this.to.col}isSingleHeader(){return(this.from.row<0||this.from.col<0)&&this.from.row===this.to.row&&this.from.col===this.to.col}isHeader(){return this.from.isHeader()&&this.to.isHeader()?!0:this.from.col<0&&this.to.col<0||this.from.row<0&&this.to.row<0}containsHeaders(){return this.from.isHeader()||this.to.isHeader()}getOuterHeight(){return Math.max(this.from.row,this.to.row)-Math.min(this.from.row,this.to.row)+1}getOuterWidth(){return Math.max(this.from.col,this.to.col)-Math.min(this.from.col,this.to.col)+1}getHeight(){if(this.from.row<0&&this.to.row<0)return 0;const e=Math.max(this.from.row,0),n=Math.max(this.to.row,0);return Math.max(e,n)-Math.min(e,n)+1}getWidth(){if(this.from.col<0&&this.to.col<0)return 0;const e=Math.max(this.from.col,0),n=Math.max(this.to.col,0);return Math.max(e,n)-Math.min(e,n)+1}getCellsCount(){return this.getWidth()*this.getHeight()}includes(e){const{row:n,col:r}=e,i=this.getOuterTopStartCorner(),o=this.getOuterBottomEndCorner();return i.row<=n&&o.row>=n&&i.col<=r&&o.col>=r}includesRange(e){return this.includes(e.getOuterTopStartCorner())&&this.includes(e.getOuterBottomEndCorner())}isEqual(e){return Math.min(this.from.row,this.to.row)===Math.min(e.from.row,e.to.row)&&Math.max(this.from.row,this.to.row)===Math.max(e.from.row,e.to.row)&&Math.min(this.from.col,this.to.col)===Math.min(e.from.col,e.to.col)&&Math.max(this.from.col,this.to.col)===Math.max(e.from.col,e.to.col)}overlaps(e){return e.isSouthEastOf(this.getOuterTopLeftCorner())&&e.isNorthWestOf(this.getOuterBottomRightCorner())}isSouthEastOf(e){return this.getOuterTopLeftCorner().isSouthEastOf(e)||this.getOuterBottomRightCorner().isSouthEastOf(e)}isNorthWestOf(e){return this.getOuterTopLeftCorner().isNorthWestOf(e)||this.getOuterBottomRightCorner().isNorthWestOf(e)}isOverlappingHorizontally(e){return this.getOuterTopEndCorner().col>=e.getOuterTopStartCorner().col&&this.getOuterTopEndCorner().col<=e.getOuterTopEndCorner().col||this.getOuterTopStartCorner().col<=e.getOuterTopEndCorner().col&&this.getOuterTopStartCorner().col>=e.getOuterTopStartCorner().col}isOverlappingVertically(e){return this.getOuterBottomStartCorner().row>=e.getOuterTopRightCorner().row&&this.getOuterBottomStartCorner().row<=e.getOuterBottomStartCorner().row||this.getOuterTopEndCorner().row<=e.getOuterBottomStartCorner().row&&this.getOuterTopEndCorner().row>=e.getOuterTopRightCorner().row}expand(e){const n=this.getOuterTopStartCorner(),r=this.getOuterBottomEndCorner();return e.row<n.row||e.col<n.col||e.row>r.row||e.col>r.col?(this.from=this._createCellCoords(Math.min(n.row,e.row),Math.min(n.col,e.col)),this.to=this._createCellCoords(Math.max(r.row,e.row),Math.max(r.col,e.col)),!0):!1}expandByRange(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(this.includesRange(e)||!this.overlaps(e))return!1;const r=this.getOuterTopStartCorner(),i=this.getOuterBottomEndCorner(),o=this.getDirection(),s=e.getOuterTopStartCorner(),a=e.getOuterBottomEndCorner(),l=Math.min(r.row,s.row),u=Math.min(r.col,s.col),c=Math.max(i.row,a.row),h=Math.max(i.col,a.col),d=this._createCellCoords(l,u),f=this._createCellCoords(c,h);return this.from=d,this.to=f,this.setDirection(o),n&&(this.highlight.row===this.getOuterBottomRightCorner().row&&this.getVerticalDirection()==="N-S"&&this.flipDirectionVertically(),this.highlight.col===this.getOuterTopRightCorner().col&&this.getHorizontalDirection()==="W-E"&&this.flipDirectionHorizontally()),!0}getDirection(){if(this.from.isNorthWestOf(this.to))return"NW-SE";if(this.from.isNorthEastOf(this.to))return"NE-SW";if(this.from.isSouthEastOf(this.to))return"SE-NW";if(this.from.isSouthWestOf(this.to))return"SW-NE"}setDirection(e){switch(e){case"NW-SE":[this.from,this.to]=[this.getOuterTopLeftCorner(),this.getOuterBottomRightCorner()];break;case"NE-SW":[this.from,this.to]=[this.getOuterTopRightCorner(),this.getOuterBottomLeftCorner()];break;case"SE-NW":[this.from,this.to]=[this.getOuterBottomRightCorner(),this.getOuterTopLeftCorner()];break;case"SW-NE":[this.from,this.to]=[this.getOuterBottomLeftCorner(),this.getOuterTopRightCorner()];break}}getVerticalDirection(){return["NE-SW","NW-SE"].indexOf(this.getDirection())>-1?"N-S":"S-N"}getHorizontalDirection(){return["NW-SE","SW-NE"].indexOf(this.getDirection())>-1?"W-E":"E-W"}flipDirectionVertically(){switch(this.getDirection()){case"NW-SE":this.setDirection("SW-NE");break;case"NE-SW":this.setDirection("SE-NW");break;case"SE-NW":this.setDirection("NE-SW");break;case"SW-NE":this.setDirection("NW-SE");break}}flipDirectionHorizontally(){switch(this.getDirection()){case"NW-SE":this.setDirection("NE-SW");break;case"NE-SW":this.setDirection("NW-SE");break;case"SE-NW":this.setDirection("SW-NE");break;case"SW-NE":this.setDirection("SE-NW");break}}getTopStartCorner(){return this._createCellCoords(Math.min(this.from.row,this.to.row),Math.min(this.from.col,this.to.col)).normalize()}getTopLeftCorner(){return Hr(Xn,this)?this.getTopEndCorner():this.getTopStartCorner()}getBottomEndCorner(){return this._createCellCoords(Math.max(this.from.row,this.to.row),Math.max(this.from.col,this.to.col)).normalize()}getBottomRightCorner(){return Hr(Xn,this)?this.getBottomStartCorner():this.getBottomEndCorner()}getTopEndCorner(){return this._createCellCoords(Math.min(this.from.row,this.to.row),Math.max(this.from.col,this.to.col)).normalize()}getTopRightCorner(){return Hr(Xn,this)?this.getTopStartCorner():this.getTopEndCorner()}getBottomStartCorner(){return this._createCellCoords(Math.max(this.from.row,this.to.row),Math.min(this.from.col,this.to.col)).normalize()}getBottomLeftCorner(){return Hr(Xn,this)?this.getBottomEndCorner():this.getBottomStartCorner()}getOuterTopStartCorner(){return this._createCellCoords(Math.min(this.from.row,this.to.row),Math.min(this.from.col,this.to.col))}getOuterTopLeftCorner(){return Hr(Xn,this)?this.getOuterTopEndCorner():this.getOuterTopStartCorner()}getOuterBottomEndCorner(){return this._createCellCoords(Math.max(this.from.row,this.to.row),Math.max(this.from.col,this.to.col))}getOuterBottomRightCorner(){return Hr(Xn,this)?this.getOuterBottomStartCorner():this.getOuterBottomEndCorner()}getOuterTopEndCorner(){return this._createCellCoords(Math.min(this.from.row,this.to.row),Math.max(this.from.col,this.to.col))}getOuterTopRightCorner(){return Hr(Xn,this)?this.getOuterTopStartCorner():this.getOuterTopEndCorner()}getOuterBottomStartCorner(){return this._createCellCoords(Math.max(this.from.row,this.to.row),Math.min(this.from.col,this.to.col))}getOuterBottomLeftCorner(){return Hr(Xn,this)?this.getOuterBottomEndCorner():this.getOuterBottomStartCorner()}isCorner(e){return e.isEqual(this.getOuterTopLeftCorner())||e.isEqual(this.getOuterTopRightCorner())||e.isEqual(this.getOuterBottomLeftCorner())||e.isEqual(this.getOuterBottomRightCorner())}getOppositeCorner(e){if(!(e instanceof al))return!1;if(e.isEqual(this.getOuterBottomEndCorner()))return this.getOuterTopStartCorner();if(e.isEqual(this.getOuterTopStartCorner()))return this.getOuterBottomEndCorner();if(e.isEqual(this.getOuterTopEndCorner()))return this.getOuterBottomStartCorner();if(e.isEqual(this.getOuterBottomStartCorner()))return this.getOuterTopEndCorner()}getBordersSharedWith(e){if(!this.includesRange(e))return[];const n={top:Math.min(this.from.row,this.to.row),bottom:Math.max(this.from.row,this.to.row),left:Math.min(this.from.col,this.to.col),right:Math.max(this.from.col,this.to.col)},r={top:Math.min(e.from.row,e.to.row),bottom:Math.max(e.from.row,e.to.row),left:Math.min(e.from.col,e.to.col),right:Math.max(e.from.col,e.to.col)},i=[];return n.top===r.top&&i.push("top"),n.right===r.right&&i.push(Hr(Xn,this)?"left":"right"),n.bottom===r.bottom&&i.push("bottom"),n.left===r.left&&i.push(Hr(Xn,this)?"right":"left"),i}getInner(){const e=this.getOuterTopStartCorner(),n=this.getOuterBottomEndCorner(),r=[];for(let i=e.row;i<=n.row;i++)for(let o=e.col;o<=n.col;o++)!(this.from.row===i&&this.from.col===o)&&!(this.to.row===i&&this.to.col===o)&&r.push(this._createCellCoords(i,o));return r}getAll(){const e=this.getOuterTopStartCorner(),n=this.getOuterBottomEndCorner(),r=[];for(let i=e.row;i<=n.row;i++)for(let o=e.col;o<=n.col;o++)e.row===i&&e.col===o?r.push(e):n.row===i&&n.col===o?r.push(n):r.push(this._createCellCoords(i,o));return r}forAll(e){const n=this.getOuterTopStartCorner(),r=this.getOuterBottomEndCorner();for(let i=n.row;i<=r.row;i++)for(let o=n.col;o<=r.col;o++)if(e(i,o)===!1)return}clone(){return new yd(this.highlight,this.from,this.to,Hr(Xn,this))}toObject(){return{from:this.from.toObject(),to:this.to.toObject()}}_createCellCoords(e,n){return new al(e,n,Hr(Xn,this))}}function Hi(t,e,n){hG(t,e),e.set(t,n)}function hG(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function fe(t,e){return t.get(sD(t,e))}function us(t,e,n){return t.set(sD(t,e),n),n}function sD(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Nr=new WeakMap,NC=new WeakMap,mn=new WeakMap,Ml=new WeakMap,zd=new WeakMap,ri=new WeakMap,DC=new WeakMap,yc=new WeakMap,ia=new WeakMap,Ni=new WeakMap;let aD=class{constructor(e,n,r,i,o,s){let a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:null;Hi(this,Nr,void 0),Hi(this,NC,void 0),Hi(this,mn,void 0),Hi(this,Ml,void 0),Hi(this,zd,void 0),Hi(this,ri,void 0),Hi(this,DC,void 0),Hi(this,yc,void 0),Hi(this,ia,[null,null]),Hi(this,Ni,[null,null]),us(Nr,this,r),us(NC,this,n),us(mn,this,o),us(Ml,this,s),us(zd,this,a),us(ri,this,i),us(DC,this,e),this.registerEvents()}registerEvents(){fe(ri,this).addEventListener(fe(mn,this).holder,"contextmenu",r=>this.onContextMenu(r)),fe(ri,this).addEventListener(fe(mn,this).TABLE,"mouseover",r=>this.onMouseOver(r)),fe(ri,this).addEventListener(fe(mn,this).TABLE,"mouseout",r=>this.onMouseOut(r));const e=()=>{fe(ri,this).addEventListener(fe(mn,this).holder,"touchstart",r=>this.onTouchStart(r)),fe(ri,this).addEventListener(fe(mn,this).holder,"touchend",r=>this.onTouchEnd(r)),this.momentumScrolling||(this.momentumScrolling={}),fe(ri,this).addEventListener(fe(mn,this).holder,"scroll",()=>{clearTimeout(this.momentumScrolling._timeout),this.momentumScrolling.ongoing||fe(Nr,this).getSetting("onBeforeTouchScroll"),this.momentumScrolling.ongoing=!0,this.momentumScrolling._timeout=setTimeout(()=>{this.touchApplied||(this.momentumScrolling.ongoing=!1,fe(Nr,this).getSetting("onAfterMomentumScroll"))},200)})},n=()=>{fe(ri,this).addEventListener(fe(mn,this).holder,"mouseup",r=>this.onMouseUp(r)),fe(ri,this).addEventListener(fe(mn,this).holder,"mousedown",r=>this.onMouseDown(r))};zo()?e():($N()&&e(),n())}selectedCellWasTouched(e){const r=this.parentCell(e).coords;if(fe(yc,this)&&r){const[i,o]=[r.row,fe(yc,this).from.row],[s,a]=[r.col,fe(yc,this).from.col];return i===o&&s===a}return!1}parentCell(e){const n={},r=fe(mn,this).TABLE,i=Fd(e,["TD","TH"],r);return i?(n.coords=fe(mn,this).getCoords(i),n.TD=i):ve(e,"wtBorder")&&ve(e,"current")?(n.coords=fe(Ml,this).getFocusSelection().cellRange.highlight,n.TD=fe(mn,this).getCell(n.coords)):ve(e,"wtBorder")&&ve(e,"area")&&fe(Ml,this).getAreaSelection().cellRange&&(n.coords=fe(Ml,this).getAreaSelection().cellRange.to,n.TD=fe(mn,this).getCell(n.coords)),n}onMouseDown(e){const n=fe(NC,this).rootDocument.activeElement,r=LN(GU,e.target),i=e.target;if(!["TD","TH"].includes(n.nodeName)&&(i===n||r(0)===n||r(1)===n))return;const o=this.parentCell(i);ve(i,"corner")?fe(Nr,this).getSetting("onCellCornerMouseDown",e,i):o.TD&&fe(Nr,this).has("onCellMouseDown")&&this.callListener("onCellMouseDown",e,o.coords,o.TD),(e.button===0||this.touchApplied)&&o.TD&&(fe(Ni,this)[0]=o.TD,clearTimeout(fe(ia,this)[0]),fe(ia,this)[0]=setTimeout(()=>{fe(Ni,this)[0]=null},1e3))}onContextMenu(e){if(fe(Nr,this).has("onCellContextMenu")){const n=this.parentCell(e.target);n.TD&&this.callListener("onCellContextMenu",e,n.coords,n.TD)}}onMouseOver(e){if(!fe(Nr,this).has("onCellMouseOver"))return;const n=fe(mn,this).TABLE,r=Fd(e.target,["TD","TH"],n),i=fe(zd,this)||this;r&&r!==i.lastMouseOver&&tl(r,n)&&(i.lastMouseOver=r,this.callListener("onCellMouseOver",e,fe(mn,this).getCoords(r),r))}onMouseOut(e){if(!fe(Nr,this).has("onCellMouseOut"))return;const n=fe(mn,this).TABLE,r=Fd(e.target,["TD","TH"],n),i=Fd(e.relatedTarget,["TD","TH"],n),o=fe(zd,this)||this;r&&r!==i&&tl(r,n)&&(this.callListener("onCellMouseOut",e,fe(mn,this).getCoords(r),r),i===null&&(o.lastMouseOver=null))}onMouseUp(e){const n=this.parentCell(e.target);n.TD&&fe(Nr,this).has("onCellMouseUp")&&this.callListener("onCellMouseUp",e,n.coords,n.TD),!(e.button!==0&&!this.touchApplied)&&(n.TD===fe(Ni,this)[0]&&n.TD===fe(Ni,this)[1]?(ve(e.target,"corner")?this.callListener("onCellCornerDblClick",e,n.coords,n.TD):this.callListener("onCellDblClick",e,n.coords,n.TD),fe(Ni,this)[0]=null,fe(Ni,this)[1]=null):n.TD===fe(Ni,this)[0]&&(fe(Ni,this)[1]=n.TD,clearTimeout(fe(ia,this)[1]),fe(ia,this)[1]=setTimeout(()=>{fe(Ni,this)[1]=null},500)))}onTouchStart(e){us(yc,this,fe(Ml,this).getFocusSelection().cellRange),this.touchApplied=!0,this.onMouseDown(e)}onTouchEnd(e){var n;const r=e.target,i=(n=this.parentCell(r))===null||n===void 0?void 0:n.coords,o=ae(i)&&i.row>=0&&i.col>=0;if(e.cancelable&&o&&fe(Nr,this).getSetting("isDataViewInstance")){const a=["A","BUTTON","INPUT"];VN()&&(gz()||mz())&&this.selectedCellWasTouched(r)&&!a.includes(r.tagName)?e.preventDefault():this.selectedCellWasTouched(r)||e.preventDefault()}this.onMouseUp(e),this.touchApplied=!1}callListener(e,n,r,i){const o=fe(Nr,this).getSettingPure(e);o&&o(n,r,i,fe(DC,this).call(this))}destroy(){clearTimeout(fe(ia,this)[0]),clearTimeout(fe(ia,this)[1]),fe(ri,this).destroy()}};function kC(t,e,n){return(e=dG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function dG(t){var e=fG(t,"string");return typeof e=="symbol"?e:e+""}function fG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class gG{constructor(e,n,r){kC(this,"offset",void 0),kC(this,"total",void 0),kC(this,"countTH",void 0),this.offset=e,this.total=n,this.countTH=r}offsetted(e){return e+this.offset}unOffsetted(e){return e-this.offset}renderedToSource(e){return this.offsetted(e)}sourceToRendered(e){return this.unOffsetted(e)}offsettedTH(e){return e-this.countTH}unOffsettedTH(e){return e+this.countTH}visibleRowHeadedColumnToSourceColumn(e){return this.renderedToSource(this.offsettedTH(e))}sourceColumnToVisibleRowHeadedColumn(e){return this.unOffsettedTH(this.sourceToRendered(e))}}function LC(t,e,n){return(e=mG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function mG(t){var e=pG(t,"string");return typeof e=="symbol"?e:e+""}function pG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class wG{constructor(e,n,r){LC(this,"offset",void 0),LC(this,"total",void 0),LC(this,"countTH",void 0),this.offset=e,this.total=n,this.countTH=r}offsetted(e){return e+this.offset}unOffsetted(e){return e-this.offset}renderedToSource(e){return this.offsetted(e)}sourceToRendered(e){return this.unOffsetted(e)}offsettedTH(e){return e-this.countTH}unOffsettedTH(e){return e+this.countTH}visibleColHeadedRowToSourceRow(e){return this.renderedToSource(this.offsettedTH(e))}sourceRowToVisibleColHeadedRow(e){return this.unOffsettedTH(this.sourceToRendered(e))}}function Yd(t,e,n){return(e=vG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function vG(t){var e=CG(t,"string");return typeof e=="symbol"?e:e+""}function CG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class yG{constructor(){Yd(this,"currentSize",0),Yd(this,"nextSize",0),Yd(this,"currentOffset",0),Yd(this,"nextOffset",0)}setSize(e){this.currentSize=this.nextSize,this.nextSize=e}setOffset(e){this.currentOffset=this.nextOffset,this.nextOffset=e}}const bG=0,fO=1,iS=2;function $C(t,e,n){return(e=SG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function SG(t){var e=RG(t,"string");return typeof e=="symbol"?e:e+""}function RG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class EG{constructor(){$C(this,"size",new yG),$C(this,"workingSpace",bG),$C(this,"sharedSize",null)}setSize(e){this.size.setSize(e)}setOffset(e){this.size.setOffset(e)}getViewSize(){return this.size}isShared(){return this.sharedSize!==null}isPlaceOn(e){return this.workingSpace===e}append(e){this.workingSpace=fO,e.workingSpace=iS,this.sharedSize=e.getViewSize()}prepend(e){this.workingSpace=iS,e.workingSpace=fO,this.sharedSize=e.getViewSize()}}var gO={},FC,mO;function TG(){if(mO)return FC;mO=1;var t=Bm(),e=TypeError;return FC=function(n,r){if(!delete n[r])throw new e("Cannot delete property "+t(r)+" of "+t(n))},FC}var pO;function _G(){if(pO)return gO;pO=1;var t=dt(),e=Wu(),n=ju(),r=a1(),i=TG(),o=l1(),s=[].unshift(0)!==1,a=function(){try{Object.defineProperty([],"length",{writable:!1}).unshift()}catch(u){return u instanceof TypeError}},l=s||!a();return t({target:"Array",proto:!0,arity:1,forced:l},{unshift:function(c){var h=e(this),d=n(h),f=arguments.length;if(f){o(d+f);for(var g=d;g--;){var C=g+f;g in h?h[C]=h[g]:i(h,C)}for(var y=0;y<f;y++)h[y]=arguments[y]}return r(h,d+f)}}),gO}_G();function MG(t,e,n){return(e=IG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function IG(t){var e=PG(t,"string");return typeof e=="symbol"?e:e+""}function PG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class wO{constructor(e,n){MG(this,"order",[]),this.order=[...Array(n).keys()].map(r=>e+r)}get length(){return this.order.length}has(e){return this.order.indexOf(e)>-1}get(e){return e<this.order.length?this.order[e]:-1}remove(e){this.order.splice(this.order.indexOf(e),1)}prepend(e){return this.order.unshift(e),this.order.pop()}}function OG(t,e,n){return(e=xG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function xG(t){var e=AG(t,"string");return typeof e=="symbol"?e:e+""}function AG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class HG{constructor(e){OG(this,"sizeSet",void 0),this.sizeSet=e}diff(){const{sizeSet:e}=this,{currentSize:n,nextSize:r}=e.getViewSize();let i=Math.max(r,n);if(i===0)return[];const{currentOffset:o,nextOffset:s}=e.getViewSize(),a=new wO(o,n),l=new wO(s,r),u=[];for(let c=0;c<i;c++){const h=a.get(c),d=l.get(c);if(d===-1)u.push(["remove",h]);else if(h===-1)!e.isShared()||e.isShared()&&e.isPlaceOn(iS)?u.push(["append",d]):u.push(["prepend",d]);else if(d>h)a.has(d)&&(a.remove(d),r<=a.length&&(i-=1)),u.push(["replace",d,h]);else if(d<h){const f=a.prepend(d);u.push(["insert_before",d,h,f])}else u.push(["none",d])}return u}}function Il(t,e,n){return(e=NG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function NG(t){var e=DG(t,"string");return typeof e=="symbol"?e:e+""}function DG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class lD{constructor(e,n){Il(this,"rootNode",void 0),Il(this,"nodesPool",void 0),Il(this,"sizeSet",new EG),Il(this,"collectedNodes",[]),Il(this,"viewDiffer",new HG(this.sizeSet)),Il(this,"leads",[]),this.rootNode=e,this.nodesPool=n}setSize(e){return this.sizeSet.setSize(e),this}setOffset(e){return this.sizeSet.setOffset(e),this}isSharedViewSet(){return this.sizeSet.isShared()}getNode(e){return e<this.collectedNodes.length?this.collectedNodes[e]:null}getCurrentNode(){const e=this.collectedNodes.length;return e>0?this.collectedNodes[e-1]:null}applyCommand(e){const{rootNode:n}=this,[r,i,o,s]=e,a=this.nodesPool(i);switch(this.collectedNodes.push(a),r){case"prepend":n.insertBefore(a,n.firstChild);break;case"append":n.appendChild(a);break;case"insert_before":n.insertBefore(a,this.nodesPool(o)),n.removeChild(this.nodesPool(s));break;case"replace":n.replaceChild(a,this.nodesPool(o));break;case"remove":n.removeChild(a);break}}start(){this.collectedNodes.length=0,this.leads=this.viewDiffer.diff()}render(){this.leads.length>0&&this.applyCommand(this.leads.shift())}end(){for(;this.leads.length>0;)this.applyCommand(this.leads.shift())}}class uD extends lD{prependView(e){return this.sizeSet.prepend(e.sizeSet),e.sizeSet.append(this.sizeSet),this}appendView(e){return this.sizeSet.append(e.sizeSet),e.sizeSet.prepend(this.sizeSet),this}}function vO(t,e,n){return(e=kG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function kG(t){var e=LG(t,"string");return typeof e=="symbol"?e:e+""}function LG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class $G{constructor(e){vO(this,"nodeType",void 0),vO(this,"pool",new Map),this.nodeType=e.toUpperCase()}setRootDocument(e){this.rootDocument=e}obtain(e,n){const i=typeof n=="number"?`${e}x${n}`:e.toString();if(this.pool.has(i))return this.pool.get(i);const o=this.rootDocument.createElement(this.nodeType);return this.pool.set(i,o),o}}function bc(t,e,n){return(e=FG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function FG(t){var e=VG(t,"string");return typeof e=="symbol"?e:e+""}function VG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class bd{constructor(e,n){bc(this,"nodesPool",null),bc(this,"nodeType",void 0),bc(this,"rootNode",void 0),bc(this,"table",null),bc(this,"renderedNodes",0),this.nodesPool=typeof e=="string"?new $G(e):null,this.nodeType=e,this.rootNode=n}setTable(e){this.nodesPool&&this.nodesPool.setRootDocument(e.rootDocument),this.table=e}adjust(){}render(){}}function CO(t,e,n){return(e=WG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function WG(t){var e=BG(t,"string");return typeof e=="symbol"?e:e+""}function BG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class jG extends bd{constructor(){super("TH"),CO(this,"orderViews",new WeakMap),CO(this,"sourceRowIndex",0)}obtainOrderView(e){let n;return this.orderViews.has(e)?n=this.orderViews.get(e):(n=new uD(e,r=>this.nodesPool.obtain(this.sourceRowIndex,r)),this.orderViews.set(e,n)),n}render(){const{rowsToRender:e,rowHeaderFunctions:n,rowHeadersCount:r,rows:i,cells:o}=this.table;for(let s=0;s<e;s++){const a=this.table.renderedRowToSource(s),l=i.getRenderedNode(s);this.sourceRowIndex=a;const u=this.obtainOrderView(l),c=o.obtainOrderView(l);u.appendView(c).setSize(r).setOffset(0).start();for(let h=r-1;h>=0;h--){u.render();const d=u.getCurrentNode();d.className="",d.removeAttribute("style"),qu(d,[new RegExp("aria-(.*)"),new RegExp("role")]),this.table.isAriaEnabled()&&ye(d,[_U(),DU(),_R(h+1),Cl(-1)]),n[h](a,d,h)}u.end()}}}class UG extends bd{constructor(e){super(null,e)}adjust(){const{columnHeadersCount:e,rowHeadersCount:n}=this.table;let r=this.rootNode.firstChild;if(e){const{columnsToRender:i}=this.table,o=i+n;for(let a=0,l=e;a<l;a++){for(r=this.rootNode.childNodes[a],r||(r=this.table.rootDocument.createElement("tr"),this.rootNode.appendChild(r)),this.renderedNodes=r.childNodes.length;this.renderedNodes<o;)r.appendChild(this.table.rootDocument.createElement("th")),this.renderedNodes+=1;for(;this.renderedNodes>o;)r.removeChild(r.lastChild),this.renderedNodes-=1}const s=this.rootNode.childNodes.length;if(s>e)for(let a=e;a<s;a++)this.rootNode.removeChild(this.rootNode.lastChild)}else r&&es(r)}render(){const{columnHeadersCount:e}=this.table;this.table.isAriaEnabled()&&ye(this.rootNode,[vN()]);for(let n=0;n<e;n+=1){const{columnHeaderFunctions:r,columnsToRender:i,rowHeadersCount:o}=this.table,s=this.rootNode.childNodes[n];this.table.isAriaEnabled()&&ye(s,[Xb(),SN(n+1)]);for(let a=-1*o;a<i;a+=1){const l=this.table.renderedColumnToSource(a),u=s.childNodes[a+o];u.className="",u.removeAttribute("style"),qu(u,[new RegExp("aria-(.*)"),new RegExp("role")]),this.table.isAriaEnabled()&&ye(u,[_R(a+1+this.table.rowHeadersCount),Cl(-1),MU(),...a>=0?[NU()]:[Xb()]]),r[n](l,u,n)}}}}let yO=!1;class zG extends bd{constructor(e){super(null,e)}adjust(){const{columnsToRender:e,rowHeadersCount:n}=this.table,r=e+n;for(;this.renderedNodes<r;)this.rootNode.appendChild(this.table.rootDocument.createElement("col")),this.renderedNodes+=1;for(;this.renderedNodes>r;)this.rootNode.removeChild(this.rootNode.lastChild),this.renderedNodes-=1}render(){this.adjust();const{columnsToRender:e,rowHeadersCount:n}=this.table;!yO&&e>1e3&&(yO=!0,Ze(nt`Performance tip: Handsontable rendered more than 1000 visible columns.\x20
|
|
41
|
+
Consider limiting the number of rendered columns by specifying the table width and/or\x20
|
|
42
|
+
turning off the "renderAllColumns" option.`));for(let i=0;i<n;i++){const o=this.table.renderedColumnToSource(i),s=this.table.columnUtils.getHeaderWidth(o);this.rootNode.childNodes[i].style.width=`${s}px`}for(let i=0;i<e;i++){const o=this.table.renderedColumnToSource(i),s=this.table.columnUtils.getWidth(o);this.rootNode.childNodes[i+n].style.width=`${s}px`}const r=this.rootNode.firstChild;r&&G(r,"rowHeader")}}function YG(t,e,n){return(e=GG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function GG(t){var e=qG(t,"string");return typeof e=="symbol"?e:e+""}function qG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const Pl={rowEven:"ht__row_even",rowOdd:"ht__row_odd"};let bO=!1;class KG extends bd{constructor(e){super("TR",e),YG(this,"orderView",void 0),this.orderView=new lD(e,n=>this.nodesPool.obtain(n))}getRenderedNode(e){return this.orderView.getNode(e)}hasStaleContent(e){return this.orderView.hasStaleContent(e)}render(){const{rowsToRender:e}=this.table;!bO&&e>1e3&&(bO=!0,Ze(nt`Performance tip: Handsontable rendered more than 1000 visible rows.\x20
|
|
43
|
+
Consider limiting the number of rendered rows by specifying the table height and/or\x20
|
|
44
|
+
turning off the "renderAllRows" option.`)),this.table.isAriaEnabled()&&ye(this.rootNode,[vN()]),this.orderView.setSize(e).setOffset(this.table.renderedRowToSource(0)).start();for(let i=0;i<e;i++){this.orderView.render();const o=this.orderView.getCurrentNode(),s=this.table.renderedRowToSource(i);if(this.table.isAriaEnabled()){var n,r;ye(o,[Xb(),SN(s+((n=(r=this.table.rowUtils)===null||r===void 0||(r=r.dataAccessObject)===null||r===void 0?void 0:r.columnHeaders.length)!==null&&n!==void 0?n:0)+1)])}(s+1)%2===0?ve(o,Pl.rowEven)||(pe(o,Pl.rowOdd),G(o,Pl.rowEven)):ve(o,Pl.rowOdd)||(pe(o,Pl.rowEven),G(o,Pl.rowOdd))}this.orderView.end()}}function SO(t,e,n){return(e=XG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function XG(t){var e=ZG(t,"string");return typeof e=="symbol"?e:e+""}function ZG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class QG extends bd{constructor(){super("TD"),SO(this,"orderViews",new WeakMap),SO(this,"sourceRowIndex",0)}obtainOrderView(e){let n;return this.orderViews.has(e)?n=this.orderViews.get(e):(n=new uD(e,r=>this.nodesPool.obtain(this.sourceRowIndex,r),this.nodeType),this.orderViews.set(e,n)),n}render(){const{rowsToRender:e,columnsToRender:n,rows:r,rowHeaders:i}=this.table;for(let a=0;a<e;a++){const l=this.table.renderedRowToSource(a),u=r.getRenderedNode(a);this.sourceRowIndex=l;const c=this.obtainOrderView(u),h=i.obtainOrderView(u);c.prependView(h).setSize(n).setOffset(0).start();for(let d=0;d<n;d++){c.render();const f=this.table.renderedColumnToSource(d),g=c.getCurrentNode();if(ve(g,"hide")||(g.className=""),g.removeAttribute("style"),g.removeAttribute("dir"),qu(g,[new RegExp("aria-(.*)"),new RegExp("role")]),this.table.cellRenderer(l,f,g),this.table.isAriaEnabled()){var o,s;ye(g,[...g.hasAttribute("role")?[]:[TU()],Cl(-1),_R(f+((o=(s=this.table.rowUtils)===null||s===void 0||(s=s.dataAccessObject)===null||s===void 0?void 0:s.rowHeaders.length)!==null&&o!==void 0?o:0)+1)])}}c.end()}}}function Qt(t,e,n){return(e=JG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function JG(t){var e=e2(t,"string");return typeof e=="symbol"?e:e+""}function e2(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class t2{constructor(e){let{cellRenderer:n,stylesHandler:r}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Qt(this,"rootNode",void 0),Qt(this,"rootDocument",void 0),Qt(this,"rowHeaders",null),Qt(this,"columnHeaders",null),Qt(this,"colGroup",null),Qt(this,"rows",null),Qt(this,"cells",null),Qt(this,"rowFilter",null),Qt(this,"columnFilter",null),Qt(this,"rowUtils",null),Qt(this,"columnUtils",null),Qt(this,"rowsToRender",0),Qt(this,"columnsToRender",0),Qt(this,"rowHeaderFunctions",[]),Qt(this,"rowHeadersCount",0),Qt(this,"columnHeaderFunctions",[]),Qt(this,"columnHeadersCount",0),Qt(this,"cellRenderer",void 0),Qt(this,"activeOverlayName",void 0),Qt(this,"stylesHandler",void 0),this.rootNode=e,this.rootDocument=this.rootNode.ownerDocument,this.cellRenderer=n,this.stylesHandler=r}setActiveOverlayName(e){this.activeOverlayName=e}setAxisUtils(e,n){this.rowUtils=e,this.columnUtils=n}setViewportSize(e,n){this.rowsToRender=e,this.columnsToRender=n}setFilters(e,n){this.rowFilter=e,this.columnFilter=n}setHeaderContentRenderers(e,n){this.rowHeaderFunctions=e,this.rowHeadersCount=e.length,this.columnHeaderFunctions=n,this.columnHeadersCount=n.length}setRenderers(){let{rowHeaders:e,columnHeaders:n,colGroup:r,rows:i,cells:o}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e.setTable(this),n.setTable(this),r.setTable(this),i.setTable(this),o.setTable(this),this.rowHeaders=e,this.columnHeaders=n,this.colGroup=r,this.rows=i,this.cells=o}renderedRowToSource(e){return this.rowFilter.renderedToSource(e)}renderedColumnToSource(e){return this.columnFilter.renderedToSource(e)}isAriaEnabled(){return this.rowUtils.wtSettings.getSetting("ariaTags")}render(){this.colGroup.adjust(),this.columnHeaders.adjust(),this.rows.adjust(),this.rowHeaders.adjust(),this.columnHeaders.render(),this.rows.render(),this.rowHeaders.render(),this.cells.render(),this.columnUtils.calculateWidths(),this.colGroup.render();const{rowsToRender:e,rows:n}=this;for(let r=0;r<e;r++){const i=n.getRenderedNode(r),o=this.rowUtils;if(i.firstChild){const s=this.renderedRowToSource(r),a=o.getHeightByOverlayName(s,this.activeOverlayName),u=this.stylesHandler.areCellsBorderBox()?0:1;a?i.firstChild.style.height=`${a-u}px`:i.firstChild.style.height=""}}}}class n2{constructor(){let{TABLE:e,THEAD:n,COLGROUP:r,TBODY:i,rowUtils:o,columnUtils:s,cellRenderer:a,stylesHandler:l}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.renderer=new t2(e,{cellRenderer:a,stylesHandler:l}),this.renderer.setRenderers({rowHeaders:new jG,columnHeaders:new UG(n),colGroup:new zG(r),rows:new KG(i),cells:new QG}),this.renderer.setAxisUtils(o,s)}setActiveOverlayName(e){return this.renderer.setActiveOverlayName(e),this}setFilters(e,n){return this.renderer.setFilters(e,n),this}setViewportSize(e,n){return this.renderer.setViewportSize(e,n),this}setHeaderContentRenderers(e,n){return this.renderer.setHeaderContentRenderers(e,n),this}adjust(){this.renderer.adjust()}render(){this.renderer.render()}}function VC(t,e,n){return(e=r2(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function r2(t){var e=i2(t,"string");return typeof e=="symbol"?e:e+""}function i2(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class o2{constructor(e,n){VC(this,"dataAccessObject",void 0),VC(this,"wtSettings",void 0),VC(this,"headerWidths",new Map),this.dataAccessObject=e,this.wtSettings=n}getWidth(e){return this.wtSettings.getSetting("columnWidth",e)||this.wtSettings.getSetting("defaultColumnWidth")}getHeaderHeight(e){let n=this.dataAccessObject.stylesHandler.getDefaultRowHeight();const r=this.dataAccessObject.wtViewport.oversizedColumnHeaders[e];return r!==void 0&&(n=n?Math.max(n,r):r),n}getHeaderWidth(e){return this.headerWidths.get(this.dataAccessObject.wtTable.columnFilter.sourceToRendered(e))}calculateWidths(){const{wtSettings:e}=this;let n=e.getSetting("rowHeaderWidth");if(n=e.getSetting("onModifyRowHeaderWidth",n),n!=null){const r=e.getSetting("rowHeaders").length,i=e.getSetting("defaultColumnWidth");for(let o=0;o<r;o++){let s=Array.isArray(n)?n[o]:n;s=s??i,this.headerWidths.set(o,s)}}}}function RO(t,e,n){return(e=s2(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function s2(t){var e=a2(t,"string");return typeof e=="symbol"?e:e+""}function a2(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class l2{constructor(e,n){RO(this,"dataAccessObject",void 0),RO(this,"wtSettings",void 0),this.dataAccessObject=e,this.wtSettings=n}getHeight(e){let n=this.wtSettings.getSetting("rowHeight",e);const r=this.dataAccessObject.wtViewport.oversizedRows[e];return r!==void 0&&(n=n===void 0?r:Math.max(n,r)),n}getHeightByOverlayName(e,n){let r=this.wtSettings.getSetting("rowHeightByOverlayName",e,n);const i=this.dataAccessObject.wtViewport.oversizedRows[e];return i!==void 0&&(r=r===void 0?i:Math.max(r,i)),r}}function Di(t,e,n){return(e=u2(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function u2(t){var e=c2(t,"string");return typeof e=="symbol"?e:e+""}function c2(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Xu{constructor(e,n,r,i,o){Di(this,"wtSettings",null),Di(this,"domBindings",void 0),Di(this,"TBODY",null),Di(this,"THEAD",null),Di(this,"COLGROUP",null),Di(this,"hasTableHeight",!0),Di(this,"hasTableWidth",!0),Di(this,"isTableVisible",!1),Di(this,"tableOffset",0),Di(this,"holderOffset",0),this.domBindings=r,this.isMaster=o==="master",this.name=o,this.dataAccessObject=e,this.facadeGetter=n,this.wtSettings=i,this.instance=this.dataAccessObject.wot,this.wot=this.dataAccessObject.wot,this.TABLE=r.rootTable,_N(this.TABLE),this.spreader=this.createSpreader(this.TABLE),this.hider=this.createHider(this.spreader),this.holder=this.createHolder(this.hider),this.wtRootElement=this.holder.parentNode,this.isMaster&&this.alignOverlaysWithTrimmingContainer(),this.fixTableDomTree(),this.rowFilter=null,this.columnFilter=null,this.correctHeaderWidth=!1;const s=this.wtSettings.getSettingPure("rowHeaderWidth");this.wtSettings.update("rowHeaderWidth",()=>this._modifyRowHeaderWidth(s)),this.rowUtils=new l2(this.dataAccessObject,this.wtSettings),this.columnUtils=new o2(this.dataAccessObject,this.wtSettings),this.tableRenderer=new n2({TABLE:this.TABLE,THEAD:this.THEAD,COLGROUP:this.COLGROUP,TBODY:this.TBODY,rowUtils:this.rowUtils,columnUtils:this.columnUtils,cellRenderer:this.wtSettings.getSettingPure("cellRenderer"),stylesHandler:this.dataAccessObject.stylesHandler})}is(e){return this.name===e}fixTableDomTree(){const e=this.domBindings.rootDocument;this.TBODY=this.TABLE.querySelector("tbody"),this.TBODY||(this.TBODY=e.createElement("tbody"),this.TABLE.appendChild(this.TBODY)),this.THEAD=this.TABLE.querySelector("thead"),this.THEAD||(this.THEAD=e.createElement("thead"),this.TABLE.insertBefore(this.THEAD,this.TBODY)),this.COLGROUP=this.TABLE.querySelector("colgroup"),this.COLGROUP||(this.COLGROUP=e.createElement("colgroup"),this.TABLE.insertBefore(this.COLGROUP,this.THEAD))}createSpreader(e){const n=e.parentNode;let r;return(!n||n.nodeType!==Node.ELEMENT_NODE||!ve(n,"wtHolder"))&&(r=this.domBindings.rootDocument.createElement("div"),r.className="wtSpreader",n&&n.insertBefore(r,e),r.appendChild(e)),r.style.position="relative",this.wtSettings.getSetting("ariaTags")&&ye(r,[Uo()]),r}createHider(e){const n=e.parentNode;let r;return(!n||n.nodeType!==Node.ELEMENT_NODE||!ve(n,"wtHolder"))&&(r=this.domBindings.rootDocument.createElement("div"),r.className="wtHider",n&&n.insertBefore(r,e),r.appendChild(e)),this.wtSettings.getSetting("ariaTags")&&ye(r,[Uo()]),r}createHolder(e){const n=e.parentNode;let r;return(!n||n.nodeType!==Node.ELEMENT_NODE||!ve(n,"wtHolder"))&&(r=this.domBindings.rootDocument.createElement("div"),r.style.position="relative",r.className="wtHolder",ye(r,[Cl(-1)]),n&&n.insertBefore(r,e),this.isMaster&&(r.parentNode.className+="ht_master handsontable",r.parentNode.setAttribute("dir",this.wtSettings.getSettingPure("rtlMode")?"rtl":"ltr"),this.wtSettings.getSetting("ariaTags")&&ye(r.parentNode,[Uo()])),r.appendChild(e)),this.wtSettings.getSetting("ariaTags")&&ye(r,[Uo()]),r}draw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const{wtSettings:n}=this,{wtOverlays:r,wtViewport:i}=this.dataAccessObject,o=n.getSetting("totalRows"),s=n.getSetting("totalColumns"),a=n.getSetting("rowHeaders"),l=a.length,u=n.getSetting("columnHeaders"),c=u.length;let h=e;if(this.isMaster&&(r.beforeDraw(),this.holderOffset=An(this.holder),h=i.createCalculators(h),l&&!n.getSetting("fixedColumnsStart"))){const f=r.inlineStartOverlay.getScrollPosition(),g=this.correctHeaderWidth;this.correctHeaderWidth=f!==0,g!==this.correctHeaderWidth&&(h=!1)}if(h)this.isMaster&&r.refresh(!0);else{this.isMaster?this.tableOffset=An(this.TABLE):this.tableOffset=this.dataAccessObject.parentTableOffset;const f=Math.max(this.getFirstRenderedRow(),0),g=Math.max(this.getFirstRenderedColumn(),0);this.rowFilter=new wG(f,o,c),this.columnFilter=new gG(g,s,l);let C=!0;if(this.isMaster){this.alignOverlaysWithTrimmingContainer();const y={};this.wtSettings.getSetting("beforeDraw",!0,y),C=y.skipRender!==!0}C&&(this.tableRenderer.setHeaderContentRenderers(a,u),(this.is(io)||this.is(Bs))&&this.tableRenderer.setHeaderContentRenderers(a,[]),this.resetOversizedRows(),this.tableRenderer.setActiveOverlayName(this.name).setViewportSize(this.getRenderedRowsCount(),this.getRenderedColumnsCount()).setFilters(this.rowFilter,this.columnFilter).render(),this.isMaster&&this.markOversizedColumnHeaders(),this.adjustColumnHeaderHeights(),(this.isMaster||this.is(io))&&this.markOversizedRows(),this.isMaster?(this.wtSettings.getSetting("externalRowCalculator")||i.createVisibleCalculators(),r.refresh(!1),r.applyToDOM(),this.wtSettings.getSetting("onDraw",!0)):this.is(io)&&this.dataAccessObject.cloneSource.wtOverlays.adjustElementsSize())}let d=!1;return this.isMaster&&(d=r.topOverlay.resetFixedPosition(),r.bottomOverlay.clone&&(d=r.bottomOverlay.resetFixedPosition()||d),d=r.inlineStartOverlay.resetFixedPosition()||d,r.topInlineStartCornerOverlay&&r.topInlineStartCornerOverlay.resetFixedPosition(),r.bottomInlineStartCornerOverlay&&r.bottomInlineStartCornerOverlay.clone&&r.bottomInlineStartCornerOverlay.resetFixedPosition()),d?(r.refreshAll(),r.adjustElementsSize()):this.dataAccessObject.selectionManager.setActiveOverlay(this.facadeGetter()).render(h),this.isMaster&&r.afterDraw(),this.dataAccessObject.drawn=!0,this}markIfOversizedColumnHeader(e){const n=this.columnFilter.renderedToSource(e);let r=this.wtSettings.getSetting("columnHeaders").length;const i=this.dataAccessObject.stylesHandler.getDefaultRowHeight();let o,s,a;const l=this.wtSettings.getSetting("columnHeaderHeight")||[];for(;r;)r-=1,o=this.getColumnHeaderHeight(r),s=this.getColumnHeader(n,r),s&&(a=vh(s),(!o&&i<a||o<a)&&(this.dataAccessObject.wtViewport.oversizedColumnHeaders[r]=a),Array.isArray(l)?l[r]!==null&&l[r]!==void 0&&(this.dataAccessObject.wtViewport.oversizedColumnHeaders[r]=l[r]):isNaN(l)||(this.dataAccessObject.wtViewport.oversizedColumnHeaders[r]=l),this.dataAccessObject.wtViewport.oversizedColumnHeaders[r]<(l[r]||l)&&(this.dataAccessObject.wtViewport.oversizedColumnHeaders[r]=l[r]||l))}adjustColumnHeaderHeights(){const{wtSettings:e}=this,n=this.THEAD.childNodes,r=this.dataAccessObject.wtViewport.oversizedColumnHeaders,i=e.getSetting("columnHeaders");for(let o=0,s=i.length;o<s;o++)if(r[o]){if(!n[o]||n[o].childNodes.length===0)return;n[o].childNodes[0].style.height=`${r[o]}px`}}resetOversizedRows(){const{wtSettings:e}=this,{wtViewport:n}=this.dataAccessObject;if(!(!this.isMaster&&!this.is(io))&&!e.getSetting("externalRowCalculator")){const r=this.getRenderedRowsCount();for(let i=0;i<r;i++){const o=this.rowFilter.renderedToSource(i);n.oversizedRows&&n.oversizedRows[o]&&(n.oversizedRows[o]=void 0)}}}getCell(e){let n=e.row,r=e.col;const i=this.wtSettings.getSetting("onModifyGetCellCoords",n,r,!this.isMaster,"render");if(i&&Array.isArray(i)&&([n,r]=i),this.isRowBeforeRenderedRows(n))return-1;if(this.isRowAfterRenderedRows(n))return-2;if(this.isColumnBeforeRenderedColumns(r))return-3;if(this.isColumnAfterRenderedColumns(r))return-4;const o=this.getRow(n);if(!o&&n>=0)throw new Error("TR was expected to be rendered but is not");const s=o.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(r)];if(!s&&r>=0)throw new Error("TD or TH was expected to be rendered but is not");return s}getRow(e){let n=null,r=null;if(e<0){var i;n=(i=this.rowFilter)===null||i===void 0?void 0:i.sourceRowToVisibleColHeadedRow(e),r=this.THEAD}else{var o;n=(o=this.rowFilter)===null||o===void 0?void 0:o.sourceToRendered(e),r=this.TBODY}return n!==void 0&&r!==void 0?r.childNodes.length<n+1?!1:r.childNodes[n]:!1}getColumnHeader(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const r=this.THEAD.childNodes[n];return r==null?void 0:r.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(e)]}getColumnHeaders(e){const n=[],r=this.columnFilter.sourceColumnToVisibleRowHeadedColumn(e);return this.THEAD.childNodes.forEach(i=>{const o=i.childNodes[r];o&&n.push(o)}),n}getRowHeader(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const r=this.wtSettings.getSetting("rowHeaders").length;if(n>=r)return;const i=this.rowFilter.sourceToRendered(e),o=i<0?this.rowFilter.sourceRowToVisibleColHeadedRow(e):i,a=(i<0?this.THEAD:this.TBODY).childNodes[o];return a==null?void 0:a.childNodes[n]}getRowHeaders(e){const n=[],r=this.wtSettings.getSetting("rowHeaders").length;for(let i=0;i<r;i++){const o=this.TBODY.childNodes[this.rowFilter.sourceToRendered(e)],s=o==null?void 0:o.childNodes[i];s&&n.push(s)}return n}getCoords(e){let n=e;if(n.nodeName!=="TD"&&n.nodeName!=="TH"&&(n=il(n,["TD","TH"])),n===null)return null;const r=n.parentNode;if(!r)return null;const i=r.parentNode;let o=XU(r),s=n.cellIndex;na(cl,n,this.wtRootElement)||na(ll,n,this.wtRootElement)?i.nodeName==="THEAD"&&(o-=i.childNodes.length):na(Bs,n,this.wtRootElement)||na(io,n,this.wtRootElement)?o=this.wtSettings.getSetting("totalRows")-i.childNodes.length+o:i===this.THEAD?o=this.rowFilter.visibleColHeadedRowToSourceRow(o):this.rowFilter&&(o=this.rowFilter.renderedToSource(o)),na(cl,n,this.wtRootElement)||na(ul,n,this.wtRootElement)||na(Bs,n,this.wtRootElement)?s=this.columnFilter.offsettedTH(s):this.columnFilter&&(s=this.columnFilter.visibleRowHeadedColumnToSourceColumn(s));const a=this.wtSettings.getSetting("onModifyGetCoordsElement",o,s);return a&&Array.isArray(a)&&([o,s]=a),this.wot.createCellCoords(o,s)}markOversizedRows(){if(this.wtSettings.getSetting("externalRowCalculator"))return;let e=this.TBODY.childNodes.length;const n=e*this.dataAccessObject.stylesHandler.getDefaultRowHeight(),r=vh(this.TBODY)-1,i=this.wot.stylesHandler.areCellsBorderBox(),o=i?nn:vh,s=i?0:1,a=i?1:0;let l,u,c,h,d;if(!(n===r&&!this.wtSettings.getSetting("fixedRowsBottom")))for(;e;){e-=1,c=this.rowFilter.renderedToSource(e),l=this.getRowHeight(c),h=this.getTrForRow(c),d=h.querySelector("th");const f=c===0?a:0;d?u=o(d):u=o(h)-s,(!l&&this.dataAccessObject.stylesHandler.getDefaultRowHeight()<u-f||l<u)&&(i||(u+=1),this.dataAccessObject.wtViewport.oversizedRows[c]=u)}}getTrForRow(e){return this.TBODY.childNodes[this.rowFilter.sourceToRendered(e)]}isColumnHeaderRendered(e){if(e>=0)return!1;const r=this.wtSettings.getSetting("rowHeaders").length;return Math.abs(e)<=r}isRowHeaderRendered(e){if(e>=0)return!1;const r=this.wtSettings.getSetting("columnHeaders").length;return Math.abs(e)<=r}isRowBeforeRenderedRows(e){const n=this.getFirstRenderedRow();return e<0&&n<=0?!this.isRowHeaderRendered(e):e<n}isRowAfterRenderedRows(e){return e>this.getLastRenderedRow()}isColumnBeforeRenderedColumns(e){const n=this.getFirstRenderedColumn();return e<0&&n<=0?!this.isColumnHeaderRendered(e):e<n}isColumnAfterRenderedColumns(e){return this.columnFilter&&e>this.getLastRenderedColumn()}isColumnAfterViewport(e){return this.columnFilter&&e>this.getLastVisibleColumn()}isRowAfterViewport(e){return this.rowFilter&&e>this.getLastVisibleRow()}isColumnBeforeViewport(e){return this.columnFilter&&this.columnFilter.sourceToRendered(e)<0&&e>=0}isLastRowFullyVisible(){return this.getLastVisibleRow()===this.getLastRenderedRow()}isLastColumnFullyVisible(){return this.getLastVisibleColumn()===this.getLastRenderedColumn()}allRowsInViewport(){return this.wtSettings.getSetting("totalRows")===this.getVisibleRowsCount()}allColumnsInViewport(){return this.wtSettings.getSetting("totalColumns")===this.getVisibleColumnsCount()}getRowHeight(e){return this.rowUtils.getHeight(e)}getColumnHeaderHeight(e){return this.columnUtils.getHeaderHeight(e)}getColumnWidth(e){return this.columnUtils.getWidth(e)}hasDefinedSize(){return this.hasTableHeight&&this.hasTableWidth}getWidth(){return qt(this.TABLE)}getHeight(){return nn(this.TABLE)}getTotalWidth(){const e=qt(this.hider);return e!==0?e:this.getWidth()}getTotalHeight(){const e=nn(this.hider);return e!==0?e:this.getHeight()}isVisible(){return Au(this.TABLE)}_modifyRowHeaderWidth(e){let n=ot(e)?e():null;return Array.isArray(n)?(n=[...n],n[n.length-1]=this._correctRowHeaderWidth(n[n.length-1])):n=this._correctRowHeaderWidth(n),n}_correctRowHeaderWidth(e){let n=e;return typeof e!="number"&&(n=this.wtSettings.getSetting("defaultColumnWidth")),this.correctHeaderWidth&&(n+=1),n}}const h2="stickyRowsBottom",$R={getFirstRenderedRow(){const t=this.getRenderedRowsCount();return t===0?-1:this.wtSettings.getSetting("totalRows")-t},getFirstVisibleRow(){return this.getFirstRenderedRow()},getFirstPartiallyVisibleRow(){return this.getFirstRenderedRow()},getLastRenderedRow(){return this.getRenderedRowsCount()===0?-1:this.wtSettings.getSetting("totalRows")-1},getLastVisibleRow(){return this.getLastRenderedRow()},getLastPartiallyVisibleRow(){return this.getLastRenderedRow()},getRenderedRowsCount(){return Math.min(this.wtSettings.getSetting("totalRows"),this.wtSettings.getSetting("fixedRowsBottom"))},getVisibleRowsCount(){return this.getRenderedRowsCount()},getColumnHeadersCount(){return 0}};ss($R,"MIXIN_NAME",h2,{writable:!1,enumerable:!1});const d2="stickyColumnsStart",lp={getFirstRenderedColumn(){return this.getRenderedColumnsCount()===0?-1:0},getFirstVisibleColumn(){return this.getFirstRenderedColumn()},getFirstPartiallyVisibleColumn(){return this.getFirstRenderedColumn()},getLastRenderedColumn(){return this.getRenderedColumnsCount()-1},getLastVisibleColumn(){return this.getLastRenderedColumn()},getLastPartiallyVisibleColumn(){return this.getLastRenderedColumn()},getRenderedColumnsCount(){return Math.min(this.wtSettings.getSetting("totalColumns"),this.wtSettings.getSetting("fixedColumnsStart"))},getVisibleColumnsCount(){return this.getRenderedColumnsCount()},getRowHeadersCount(){return this.dataAccessObject.rowHeaders.length}};ss(lp,"MIXIN_NAME",d2,{writable:!1,enumerable:!1});class FR extends Xu{constructor(e,n,r,i){super(e,n,r,i,Bs)}}ut(FR,$R);ut(FR,lp);const ll="top",io="bottom",ul="inline_start",cl="top_inline_start_corner",Bs="bottom_inline_start_corner",cD=[ll,io,ul,cl,Bs],f2=new Map([[ll,`ht_clone_${ll}`],[io,`ht_clone_${io}`],[ul,`ht_clone_${ul} ht_clone_left`],[cl,`ht_clone_${cl} ht_clone_top_left_corner`],[Bs,`ht_clone_${Bs} ht_clone_bottom_left_corner`]]);function g2(t,e){m2(t,e),e.add(t)}function m2(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function p2(t,e,n){return(e=w2(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function w2(t){var e=v2(t,"string");return typeof e=="symbol"?e:e+""}function v2(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Gd(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Sc=new WeakSet;class C2{constructor(e){g2(this,Sc),p2(this,"dataAccessObject",void 0),this.dataAccessObject=e}scrollViewport(e,n,r){if(e.col<0||e.row<0)return!1;const i=this.scrollViewportHorizontally(e.col,n),o=this.scrollViewportVertically(e.row,r);return i||o}scrollViewportHorizontally(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"auto";const{drawn:r,totalColumns:i}=this.dataAccessObject;if(!r)return!1;const o=Mr(n);if(e=this.dataAccessObject.wtSettings.getSetting("onBeforeViewportScrollHorizontally",e,o),!Number.isInteger(e)||e<0||e>i)return!1;n=o.value;const{fixedColumnsStart:s,inlineStartOverlay:a}=this.dataAccessObject,l=n==="auto";if(l&&e<s)return!1;const u=this.getFirstVisibleColumn(),c=this.getLastVisibleColumn();let h=!1;return(l&&(e<u||e>c)||!l)&&(h=a.scrollTo(e,l?e>=this.getLastPartiallyVisibleColumn():n==="end")),h}scrollViewportVertically(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"auto";const{drawn:r,totalRows:i}=this.dataAccessObject;if(!r)return!1;const o=Mr(n);if(e=this.dataAccessObject.wtSettings.getSetting("onBeforeViewportScrollVertically",e,o),!Number.isInteger(e)||e<0||e>i)return!1;n=o.value;const{fixedRowsBottom:s,fixedRowsTop:a,topOverlay:l}=this.dataAccessObject,u=n==="auto";if(u&&(e<a||e>i-s-1))return!1;const c=this.getFirstVisibleRow(),h=this.getLastVisibleRow();let d=!1;return(u&&(e<c||e>h)||!u)&&(d=l.scrollTo(e,u?e>=this.getLastPartiallyVisibleRow():n==="bottom")),d}getFirstVisibleRow(){return this.dataAccessObject.wtTable.getFirstVisibleRow()}getLastVisibleRow(){return Gd(Sc,this,TO).call(this,this.dataAccessObject.wtTable.getLastVisibleRow())}getFirstPartiallyVisibleRow(){return this.dataAccessObject.wtTable.getFirstPartiallyVisibleRow()}getLastPartiallyVisibleRow(){return Gd(Sc,this,TO).call(this,this.dataAccessObject.wtTable.getLastPartiallyVisibleRow())}getFirstVisibleColumn(){return this.dataAccessObject.wtTable.getFirstVisibleColumn()}getLastVisibleColumn(){return Gd(Sc,this,EO).call(this,this.dataAccessObject.wtTable.getLastVisibleColumn())}getFirstPartiallyVisibleColumn(){return this.dataAccessObject.wtTable.getFirstPartiallyVisibleColumn()}getLastPartiallyVisibleColumn(){return Gd(Sc,this,EO).call(this,this.dataAccessObject.wtTable.getLastPartiallyVisibleColumn())}}function EO(t){const{wtSettings:e,inlineStartOverlay:n,wtTable:r,wtViewport:i,totalColumns:o,rootWindow:s}=this.dataAccessObject;if(n.mainTableScrollableElement===s){const a=e.getSetting("rtlMode");let l=null;if(a){const c=r.TABLE.getBoundingClientRect(),d=this.dataAccessObject.rootWindow.document.documentElement.offsetWidth;l=Math.abs(c.right-d)}else l=An(r.wtRootElement).left;const u=Math.abs(IN(s,s));if(l>u){const c=PN(s);let h=i.getRowHeaderWidth();for(let d=1;d<=o;d++)if(h+=n.sumCellSizes(d-1,d),l+h-u>=c){t=d-2;break}}}return t}function TO(t){const{topOverlay:e,wtTable:n,wtViewport:r,totalRows:i,rootWindow:o}=this.dataAccessObject;if(e.mainTableScrollableElement===o){const s=An(n.wtRootElement),a=PR(o,o);if(s.top>a){const l=vh(o);let u=r.getColumnHeaderHeight();for(let c=1;c<=i;c++)if(u+=e.sumCellSizes(c-1,c),s.top+u-a>=l){t=c-2;break}}}return t}function Dr(t,e,n){return(e=y2(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function y2(t){var e=b2(t,"string");return typeof e=="symbol"?e:e+""}function b2(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class VR{get eventManager(){return new _i(this)}constructor(e,n){Dr(this,"wtTable",void 0),Dr(this,"wtScroll",void 0),Dr(this,"wtViewport",void 0),Dr(this,"wtOverlays",void 0),Dr(this,"selectionManager",void 0),Dr(this,"wtEvent",void 0),Dr(this,"guid",`wt_${mN()}`),Dr(this,"drawInterrupted",!1),Dr(this,"drawn",!1),Dr(this,"activeOverlayName","master"),Dr(this,"domBindings",void 0),Dr(this,"wtSettings",void 0),this.domBindings={rootTable:e,rootDocument:e.ownerDocument,rootWindow:e.ownerDocument.defaultView},this.wtSettings=n,this.wtScroll=new C2(this.createScrollDao())}findOriginalHeaders(){const e=[];if(this.wtTable.THEAD.childNodes.length&&this.wtTable.THEAD.childNodes[0].childNodes.length){for(let n=0,r=this.wtTable.THEAD.childNodes[0].childNodes.length;n<r;n++)e.push(this.wtTable.THEAD.childNodes[0].childNodes[n].innerHTML);this.wtSettings.getSetting("columnHeaders").length||this.wtSettings.update("columnHeaders",[function(n,r){ol(r,e[n])}])}}createCellCoords(e,n){return new al(e,n,this.wtSettings.getSetting("rtlMode"))}createCellRange(e,n,r){return new yd(e,n,r,this.wtSettings.getSetting("rtlMode"))}draw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return this.drawInterrupted=!1,!this.wtTable.isVisible()||QU(this.wtTable.wtRootElement.parentNode)?this.drawInterrupted=!0:this.wtTable.draw(e),this}getCell(e){if(!(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1))return this.wtTable.getCell(e);const r=this.wtSettings.getSetting("totalRows"),i=this.wtSettings.getSetting("fixedRowsTop"),o=this.wtSettings.getSetting("fixedRowsBottom"),s=this.wtSettings.getSetting("fixedColumnsStart");if(e.row<i&&e.col<s)return this.wtOverlays.topInlineStartCornerOverlay.clone.wtTable.getCell(e);if(e.row<i)return this.wtOverlays.topOverlay.clone.wtTable.getCell(e);if(e.col<s&&e.row>=r-o){if(this.wtOverlays.bottomInlineStartCornerOverlay&&this.wtOverlays.bottomInlineStartCornerOverlay.clone)return this.wtOverlays.bottomInlineStartCornerOverlay.clone.wtTable.getCell(e)}else{if(e.col<s)return this.wtOverlays.inlineStartOverlay.clone.wtTable.getCell(e);if(e.row<r&&e.row>=r-o&&this.wtOverlays.bottomOverlay&&this.wtOverlays.bottomOverlay.clone)return this.wtOverlays.bottomOverlay.clone.wtTable.getCell(e)}return this.wtTable.getCell(e)}scrollViewport(e,n,r){return this.wtScroll.scrollViewport(e,n,r)}scrollViewportHorizontally(e,n){return this.wtScroll.scrollViewportHorizontally(e,n)}scrollViewportVertically(e,n){return this.wtScroll.scrollViewportVertically(e,n)}getViewport(){return[this.wtTable.getFirstVisibleRow(),this.wtTable.getFirstVisibleColumn(),this.wtTable.getLastVisibleRow(),this.wtTable.getLastVisibleColumn()]}destroy(){this.wtOverlays.destroy(),this.wtEvent.destroy()}createScrollDao(){const e=this;return{get drawn(){return e.drawn},get topOverlay(){return e.wtOverlays.topOverlay},get inlineStartOverlay(){return e.wtOverlays.inlineStartOverlay},get wtTable(){return e.wtTable},get wtViewport(){return e.wtViewport},get wtSettings(){return e.wtSettings},get rootWindow(){return e.domBindings.rootWindow},get totalRows(){return e.wtSettings.getSetting("totalRows")},get totalColumns(){return e.wtSettings.getSetting("totalColumns")},get fixedRowsTop(){return e.wtSettings.getSetting("fixedRowsTop")},get fixedRowsBottom(){return e.wtSettings.getSetting("fixedRowsBottom")},get fixedColumnsStart(){return e.wtSettings.getSetting("fixedColumnsStart")}}}getTableDao(){const e=this;return{get wot(){return e},get parentTableOffset(){return e.cloneSource.wtTable.tableOffset},get cloneSource(){return e.cloneSource},get workspaceWidth(){return e.wtViewport.getWorkspaceWidth()},get wtViewport(){return e.wtViewport},get wtOverlays(){return e.wtOverlays},get selectionManager(){return e.selectionManager},get stylesHandler(){return e.stylesHandler},get drawn(){return e.drawn},set drawn(n){e.drawn=n},get wtTable(){return e.wtTable},get startColumnRendered(){return e.wtViewport.columnsRenderCalculator.startColumn},get startColumnVisible(){return e.wtViewport.columnsVisibleCalculator.startColumn},get startColumnPartiallyVisible(){return e.wtViewport.columnsPartiallyVisibleCalculator.startColumn},get endColumnRendered(){return e.wtViewport.columnsRenderCalculator.endColumn},get endColumnVisible(){return e.wtViewport.columnsVisibleCalculator.endColumn},get endColumnPartiallyVisible(){return e.wtViewport.columnsPartiallyVisibleCalculator.endColumn},get countColumnsRendered(){return e.wtViewport.columnsRenderCalculator.count},get countColumnsVisible(){return e.wtViewport.columnsVisibleCalculator.count},get startRowRendered(){return e.wtViewport.rowsRenderCalculator.startRow},get startRowVisible(){return e.wtViewport.rowsVisibleCalculator.startRow},get startRowPartiallyVisible(){return e.wtViewport.rowsPartiallyVisibleCalculator.startRow},get endRowRendered(){return e.wtViewport.rowsRenderCalculator.endRow},get endRowVisible(){return e.wtViewport.rowsVisibleCalculator.endRow},get endRowPartiallyVisible(){return e.wtViewport.rowsPartiallyVisibleCalculator.endRow},get countRowsRendered(){return e.wtViewport.rowsRenderCalculator.count},get countRowsVisible(){return e.wtViewport.rowsVisibleCalculator.count},get columnHeaders(){return e.wtSettings.getSetting("columnHeaders")},get rowHeaders(){return e.wtSettings.getSetting("rowHeaders")}}}}function _O(t,e,n){return(e=S2(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function S2(t){var e=R2(t,"string");return typeof e=="symbol"?e:e+""}function R2(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class E2 extends VR{constructor(e,n,r){super(e,n),_O(this,"cloneSource",void 0),_O(this,"cloneOverlay",void 0);const i=this.wtSettings.getSetting("facade",this);this.cloneSource=r.source,this.cloneOverlay=r.overlay,this.stylesHandler=r.stylesHandler,this.wtTable=this.cloneOverlay.createTable(this.getTableDao(),i,this.domBindings,this.wtSettings),this.wtViewport=r.viewport,this.selectionManager=r.selectionManager,this.wtEvent=new aD(i,this.domBindings,this.wtSettings,this.eventManager,this.wtTable,this.selectionManager,r.event),this.findOriginalHeaders()}}function T2(t,e,n){return(e=_2(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _2(t){var e=M2(t,"string");return typeof e=="symbol"?e:e+""}function M2(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Sd{constructor(e,n,r,i,o){T2(this,"wtSettings",null),ss(this,"wot",e,{writable:!1}),this.domBindings=o,this.facadeGetter=n,this.wtSettings=i;const{TABLE:s,hider:a,spreader:l,holder:u,wtRootElement:c}=this.wot.wtTable;this.instance=this.wot,this.type=r,this.mainTableScrollableElement=null,this.TABLE=s,this.hider=a,this.spreader=l,this.holder=u,this.wtRootElement=c,this.trimmingContainer=jh(this.hider.parentNode.parentNode),this.needFullRender=this.shouldBeRendered(),this.clone=this.makeClone()}hasRenderingStateChanged(){return this.needFullRender!==this.shouldBeRendered()}updateStateOfRendering(e){e==="before"&&this.shouldBeRendered()?this.needFullRender=!0:e==="after"&&!this.shouldBeRendered()&&(this.needFullRender=!1)}shouldBeRendered(){return!0}updateTrimmingContainer(){this.trimmingContainer=jh(this.hider.parentNode.parentNode)}updateMainScrollableElement(){const{wtTable:e}=this.wot,{rootWindow:n}=this.domBindings;n.getComputedStyle(e.wtRootElement.parentNode).getPropertyValue("overflow")==="hidden"?this.mainTableScrollableElement=this.wot.wtTable.holder:this.mainTableScrollableElement=qg(e.TABLE)}getRelativeCellPosition(e,n,r){if(this.clone.wtTable.holder.contains(e)===!1){Ze(`The provided element is not a child of the ${this.type} overlay`);return}const i=this.mainTableScrollableElement===this.domBindings.rootWindow,o=r<this.wtSettings.getSetting("fixedColumnsStart"),s=n<this.wtSettings.getSetting("fixedRowsTop"),a=n>=this.wtSettings.getSetting("totalRows")-this.wtSettings.getSetting("fixedRowsBottom"),l=this.clone.wtTable.spreader,u={start:this.getRelativeStartPosition(l),top:l.offsetTop},c={start:this.getRelativeStartPosition(e),top:e.offsetTop};let h=null;return i?h=this.getRelativeCellPositionWithinWindow(s,o,c,u):h=this.getRelativeCellPositionWithinHolder(s,a,o,c,u),h}getRelativeStartPosition(e){return this.isRtl()?e.offsetParent.offsetWidth-e.offsetLeft-e.offsetWidth:e.offsetLeft}getRelativeCellPositionWithinWindow(e,n,r,i){const o=this.wot.wtTable.wtRootElement.getBoundingClientRect();let s=0,a=0;if(!n)s=i.start;else{let l=o.left;this.isRtl()&&(l=this.domBindings.rootWindow.innerWidth-(o.left+o.width+vn())),s=l<=0?-1*l:0}return e?a=this.clone.wtTable.TABLE.getBoundingClientRect().top-o.top:a=i.top,{start:r.start+s,top:r.top+a}}getRelativeCellPositionWithinHolder(e,n,r,i,o){const s={horizontal:this.wot.wtOverlays.inlineStartOverlay.getScrollPosition(),vertical:this.wot.wtOverlays.topOverlay.getScrollPosition()};let a=0,l=0;if(r||(a=s.horizontal-o.start),n){const u=this.wot.wtTable.wtRootElement.getBoundingClientRect();l=this.clone.wtTable.TABLE.getBoundingClientRect().top*-1+u.top}else e||(l=s.vertical-o.top);return{start:i.start-a,top:i.top-l}}makeClone(){if(cD.indexOf(this.type)===-1)throw new Error(`Clone type "${this.type}" is not supported.`);const{wtTable:e,wtSettings:n}=this.wot,{rootDocument:r,rootWindow:i}=this.domBindings,o=r.createElement("div"),s=r.createElement("table"),a=e.wtRootElement.parentNode;o.className=`${f2.get(this.type)} handsontable`,o.setAttribute("dir",this.isRtl()?"rtl":"ltr"),o.style.position="absolute",o.style.top=0,o.style.overflow="visible",this.isRtl()?o.style.right=0:o.style.left=0,n.getSetting("ariaTags")&&ye(o,[Uo()]),s.className=e.TABLE.className,e.TABLE.getAttribute("role")&&s.setAttribute("role",e.TABLE.getAttribute("role")),o.appendChild(s),a.appendChild(o);const u=this.wtSettings.getSetting("preventOverflow");return u===!0||u==="horizontal"&&this.type===ll||u==="vertical"&&this.type===ul?this.mainTableScrollableElement=i:i.getComputedStyle(a).getPropertyValue("overflow")==="hidden"?this.mainTableScrollableElement=e.holder:this.mainTableScrollableElement=qg(e.TABLE),new E2(s,this.wtSettings,{source:this.wot,overlay:this,viewport:this.wot.wtViewport,event:this.wot.wtEvent,selectionManager:this.wot.selectionManager,stylesHandler:this.wot.stylesHandler})}refresh(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(this.needFullRender){const n=this.clone.cloneSource;n.activeOverlayName=this.clone.wtTable.name,this.clone.draw(e),n.activeOverlayName="master"}}reset(){const e=this.clone.wtTable.holder,n=this.clone.wtTable.hider,r=e.style,i=n.style,o=e.parentNode.style;[r,i,o].forEach(s=>{s.width="",s.height=""})}isRtl(){return this.wtSettings.getSetting("rtlMode")}destroy(){this.clone.eventManager.destroy()}}class I2 extends Sd{constructor(e,n,r,i,o,s){super(e,n,Bs,r,i),this.bottomOverlay=o,this.inlineStartOverlay=s}createTable(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return new FR(...n)}shouldBeRendered(){return this.wtSettings.getSetting("shouldRenderBottomOverlay")&&this.wtSettings.getSetting("shouldRenderInlineStartOverlay")}resetFixedPosition(){const{wot:e}=this;if(this.updateTrimmingContainer(),!e.wtTable.holder.parentNode)return!1;const n=this.clone.wtTable.holder.parentNode;if(n.style.top="",this.trimmingContainer===this.domBindings.rootWindow){const o=this.inlineStartOverlay.getOverlayOffset(),s=this.bottomOverlay.getOverlayOffset();n.style[this.isRtl()?"right":"left"]=`${o}px`,n.style.bottom=`${s}px`}else rp(n),this.repositionOverlay();let r=nn(this.clone.wtTable.TABLE);const i=qt(this.clone.wtTable.TABLE);return this.wot.wtTable.hasDefinedSize()||(r=0),n.style.height=`${r}px`,n.style.width=`${i}px`,!1}repositionOverlay(){const{wtTable:e,wtViewport:n}=this.wot,{rootDocument:r}=this.domBindings,i=this.clone.wtTable.holder.parentNode;let o=0;n.hasVerticalScroll()||(o+=n.getWorkspaceHeight()-e.getTotalHeight()),n.hasVerticalScroll()&&n.hasHorizontalScroll()&&(o+=vn(r)),i.style.bottom=`${o}px`}}const P2="calculatedColumns",up={getFirstRenderedColumn(){const t=this.dataAccessObject.startColumnRendered;return t===null?-1:t},getFirstVisibleColumn(){const t=this.dataAccessObject.startColumnVisible;return t===null?-1:t},getFirstPartiallyVisibleColumn(){const t=this.dataAccessObject.startColumnPartiallyVisible;return t===null?-1:t},getLastRenderedColumn(){const t=this.dataAccessObject.endColumnRendered;return t===null?-1:t},getLastVisibleColumn(){const t=this.dataAccessObject.endColumnVisible;return t===null?-1:t},getLastPartiallyVisibleColumn(){const t=this.dataAccessObject.endColumnPartiallyVisible;return t===null?-1:t},getRenderedColumnsCount(){return this.dataAccessObject.countColumnsRendered},getVisibleColumnsCount(){return this.dataAccessObject.countColumnsVisible},getRowHeadersCount(){return this.dataAccessObject.rowHeaders.length}};ss(up,"MIXIN_NAME",P2,{writable:!1,enumerable:!1});class WR extends Xu{constructor(e,n,r,i){super(e,n,r,i,io)}}ut(WR,$R);ut(WR,up);function O2(t,e,n){return(e=x2(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function x2(t){var e=A2(t,"string");return typeof e=="symbol"?e:e+""}function A2(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class H2 extends Sd{constructor(e,n,r,i){super(e,n,io,r,i),O2(this,"cachedFixedRowsBottom",-1),this.cachedFixedRowsBottom=this.wtSettings.getSetting("fixedRowsBottom")}createTable(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return new WR(...n)}shouldBeRendered(){return this.wtSettings.getSetting("shouldRenderBottomOverlay")}resetFixedPosition(){if(!this.needFullRender||!this.shouldBeRendered()||!this.wot.wtTable.holder.parentNode)return!1;const{rootWindow:e}=this.domBindings,n=this.clone.wtTable.holder.parentNode;n.style.top="";let r=0;const i=this.wtSettings.getSetting("preventOverflow");this.trimmingContainer===e&&(!i||i!=="vertical")?(r=this.getOverlayOffset(),n.style.bottom=`${r}px`):(r=this.getScrollPosition(),this.repositionOverlay());const o=this.adjustHeaderBordersPosition(r);return this.adjustElementsSize(),o}repositionOverlay(){const{wtTable:e,wtViewport:n}=this.wot,{rootDocument:r}=this.domBindings,i=this.clone.wtTable.holder.parentNode;let o=0;n.hasVerticalScroll()||(o+=n.getWorkspaceHeight()-e.getTotalHeight()),n.hasVerticalScroll()&&n.hasHorizontalScroll()&&(o+=vn(r)),i.style.bottom=`${o}px`}setScrollPosition(e){const{rootWindow:n}=this.domBindings,r=this.mainTableScrollableElement;let i=!1;if(r===n&&e!==n.scrollY){const o=n.scrollY;n.scrollTo(IR(n),top),i=o!==n.scrollY}else if(e!==r.scrollTop){const o=r.scrollTop;r.scrollTop=e,i=o!==r.scrollTop}return i}onScroll(){this.wtSettings.getSetting("onScrollHorizontally")}sumCellSizes(e,n){const{wtTable:r,stylesHandler:i}=this.wot,o=i.getDefaultRowHeight();let s=e,a=0;for(;s<n;){const l=r.getRowHeight(s);a+=l===void 0?o:l,s+=1}return a}adjustElementsSize(){this.updateTrimmingContainer(),this.needFullRender&&(this.adjustRootElementSize(),this.adjustRootChildrenSize())}adjustRootElementSize(){const{wtTable:e,wtViewport:n}=this.wot,{rootDocument:r,rootWindow:i}=this.domBindings,s=this.clone.wtTable.holder.parentNode.style,a=this.wtSettings.getSetting("preventOverflow");if(this.trimmingContainer!==i||a==="horizontal"){let u=n.getWorkspaceWidth();n.hasVerticalScroll()&&(u-=vn(r)),u=Math.min(u,e.wtRootElement.scrollWidth),s.width=`${u}px`}else s.width="";this.clone.wtTable.holder.style.width=s.width;let l=nn(this.clone.wtTable.TABLE);e.hasDefinedSize()||(l=0),s.height=`${l}px`}adjustRootChildrenSize(){const{holder:e}=this.clone.wtTable;this.clone.wtTable.hider.style.width=this.hider.style.width,e.style.width=e.parentNode.style.width,e.style.height=e.parentNode.style.height}applyToDOM(){const e=this.wtSettings.getSetting("totalRows");if(typeof this.wot.wtViewport.rowsRenderCalculator.startPosition=="number")this.spreader.style.top=`${this.wot.wtViewport.rowsRenderCalculator.startPosition}px`;else if(e===0)this.spreader.style.top="0";else throw new Error("Incorrect value of the rowsRenderCalculator");this.spreader.style.bottom="",this.needFullRender&&this.syncOverlayOffset()}syncOverlayOffset(){const e=this.isRtl()?"right":"left",{spreader:n}=this.clone.wtTable;typeof this.wot.wtViewport.columnsRenderCalculator.startPosition=="number"?n.style[e]=`${this.wot.wtViewport.columnsRenderCalculator.startPosition}px`:n.style[e]=""}scrollTo(e,n){let r=this.getTableParentOffset();const o=(this.wot.cloneSource?this.wot.cloneSource:this.wot).wtTable.holder;let s=0;n&&o.offsetHeight!==o.clientHeight&&(s=vn(this.domBindings.rootDocument)),n?(r+=this.sumCellSizes(0,e+1),r-=this.wot.wtViewport.getViewportHeight(),r+=1):r+=this.sumCellSizes(this.wtSettings.getSetting("fixedRowsBottom"),e),r+=s,this.setScrollPosition(r)}getTableParentOffset(){return this.mainTableScrollableElement===this.domBindings.rootWindow?this.wot.wtTable.holderOffset.top:0}getScrollPosition(){return PR(this.mainTableScrollableElement,this.domBindings.rootWindow)}getOverlayOffset(){const{rootWindow:e}=this.domBindings,n=this.wtSettings.getSetting("preventOverflow");let r=0;if(this.trimmingContainer===e&&(!n||n!=="vertical")){const i=this.wot.wtTable.getTotalHeight(),o=this.clone.wtTable.getTotalHeight(),s=i-o,a=this.domBindings.rootDocument.documentElement.clientHeight;r=Math.max(this.getTableParentOffset()-this.getScrollPosition()-a+i,0),r>s&&(r=0)}return r}adjustHeaderBordersPosition(e){const n=this.wtSettings.getSetting("fixedRowsBottom"),r=this.cachedFixedRowsBottom!==n,i=this.wtSettings.getSetting("columnHeaders");let o=!1;if((r||n===0)&&i.length>0){const s=this.wot.wtTable.holder.parentNode,a=ve(s,"innerBorderBottom");this.cachedFixedRowsBottom=this.wtSettings.getSetting("fixedRowsBottom"),e||this.wtSettings.getSetting("totalRows")===0?(G(s,"innerBorderBottom"),o=!a):(pe(s,"innerBorderBottom"),o=a)}return o}}const N2="calculatedRows",BR={getFirstRenderedRow(){const t=this.dataAccessObject.startRowRendered;return t===null?-1:t},getFirstVisibleRow(){const t=this.dataAccessObject.startRowVisible;return t===null?-1:t},getFirstPartiallyVisibleRow(){const t=this.dataAccessObject.startRowPartiallyVisible;return t===null?-1:t},getLastRenderedRow(){const t=this.dataAccessObject.endRowRendered;return t===null?-1:t},getLastVisibleRow(){const t=this.dataAccessObject.endRowVisible;return t===null?-1:t},getLastPartiallyVisibleRow(){const t=this.dataAccessObject.endRowPartiallyVisible;return t===null?-1:t},getRenderedRowsCount(){return this.dataAccessObject.countRowsRendered},getVisibleRowsCount(){return this.dataAccessObject.countRowsVisible},getColumnHeadersCount(){return this.dataAccessObject.columnHeaders.length}};ss(BR,"MIXIN_NAME",N2,{writable:!1,enumerable:!1});class jR extends Xu{constructor(e,n,r,i){super(e,n,r,i,ul)}}ut(jR,BR);ut(jR,lp);const D2="localHooks",Rn={_localHooks:Object.create(null),addLocalHook(t,e){return this._localHooks[t]||(this._localHooks[t]=[]),this._localHooks[t].push(e),this},runLocalHooks(t,e,n,r,i,o,s){if(this._localHooks[t]){const a=this._localHooks[t].length;for(let l=0;l<a;l++)Zb(this._localHooks[t][l],this,e,n,r,i,o,s)}},clearLocalHooks(){return this._localHooks={},this}};ss(Rn,"MIXIN_NAME",D2,{writable:!1,enumerable:!1});let hD=class{constructor(e,n){this.settings=e,this.cellRange=n||null}isEmpty(){return this.cellRange===null}add(e){return this.isEmpty()?this.cellRange=this.settings.createCellRange(e):this.cellRange.expand(e),this}replace(e,n){if(!this.isEmpty()){if(this.cellRange.from.isEqual(e))return this.cellRange.from=n,!0;if(this.cellRange.to.isEqual(e))return this.cellRange.to=n,!0}return!1}clear(){return this.cellRange=null,this}getCorners(){const e=this.cellRange.getOuterTopStartCorner(),n=this.cellRange.getOuterBottomEndCorner();return[e.row,e.col,n.row,n.col]}destroy(){this.runLocalHooks("destroy")}};ut(hD,Rn);const dD="active-header",UR="header",zR="area",Ch="focus",k2="fill",L2="row",$2="column",F2="custom-selection",YR=t=>{const e=t.stylesHandler;if(e.isClassicTheme())return Object.freeze({width:6,height:6,borderWidth:1,borderStyle:"solid",borderColor:"#FFF"});const n=e.getCSSVariableValue("cell-autofill-size"),r=e.getCSSVariableValue("cell-autofill-border-width"),i=e.getCSSVariableValue("cell-autofill-border-color");return Object.freeze({width:n,height:n,borderWidth:r,borderStyle:"solid",borderColor:i})};var MO={},IO;function V2(){if(IO)return MO;IO=1;var t=sp();return t("flat"),MO}V2();function W2(t,e){fD(t,e),e.add(t)}function PO(t,e,n){fD(t,e),e.set(t,n)}function fD(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ht(t,e){return t.get(yh(t,e))}function OO(t,e,n){return t.set(yh(t,e),n),n}function yh(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var ui=new WeakMap,In=new WeakMap,qd=new WeakSet;class B2{constructor(){W2(this,qd),PO(this,ui,void 0),PO(this,In,void 0)}setActiveOverlay(e){return OO(In,this,e),this}setActiveSelection(e){return OO(ui,this,e),this}scan(){const e=Ht(ui,this).settings.selectionType,n=new Set;return e==="active-header"?(this.scanColumnsInHeadersRange(r=>n.add(r)),this.scanRowsInHeadersRange(r=>n.add(r))):e==="area"?this.scanCellsRange(r=>n.add(r)):e==="focus"?(this.scanColumnsInHeadersRange(r=>n.add(r)),this.scanRowsInHeadersRange(r=>n.add(r)),this.scanCellsRange(r=>n.add(r))):e==="fill"?this.scanCellsRange(r=>n.add(r)):e==="header"?(this.scanColumnsInHeadersRange(r=>n.add(r)),this.scanRowsInHeadersRange(r=>n.add(r))):e==="row"?(this.scanRowsInHeadersRange(r=>n.add(r)),this.scanRowsInCellsRange(r=>n.add(r))):e==="column"&&(this.scanColumnsInHeadersRange(r=>n.add(r)),this.scanColumnsInCellsRange(r=>n.add(r))),n}scanColumnsInHeadersRange(e){const[n,r,i,o]=Ht(ui,this).getCorners(),{wtTable:s}=Ht(In,this),a=s.getRenderedColumnsCount(),l=s.getColumnHeadersCount();let u=0;for(let c=-s.getRowHeadersCount();c<a;c++){const h=s.columnFilter.renderedToSource(c);if(!(h<r||h>o)){for(let d=-l;d<0;d++){if(d<n||d>i)continue;const f=d+l;let g=s.getColumnHeader(h,f);const C=Ht(In,this).getSetting("onBeforeHighlightingColumnHeader",h,f,{selectionType:Ht(ui,this).settings.selectionType,columnCursor:u,selectionWidth:o-r+1});C!==null&&(C!==h&&(g=s.getColumnHeader(C,f)),e(g))}u+=1}}}scanRowsInHeadersRange(e){const[n,r,i,o]=Ht(ui,this).getCorners(),{wtTable:s}=Ht(In,this),a=s.getRenderedRowsCount(),l=s.getRowHeadersCount();let u=0;for(let c=-s.getColumnHeadersCount();c<a;c++){const h=s.rowFilter.renderedToSource(c);if(!(h<n||h>i)){for(let d=-l;d<0;d++){if(d<r||d>o)continue;const f=d+l;let g=s.getRowHeader(h,f);const C=Ht(In,this).getSetting("onBeforeHighlightingRowHeader",h,f,{selectionType:Ht(ui,this).settings.selectionType,rowCursor:u,selectionHeight:i-n+1});C!==null&&(C!==h&&(g=s.getRowHeader(C,f)),e(g))}u+=1}}}scanCellsRange(e){const{wtTable:n}=Ht(In,this);yh(qd,this,j2).call(this,(r,i)=>{const o=n.getCell(Ht(In,this).createCellCoords(r,i)),s=Ht(In,this).getSetting("onAfterDrawSelection",r,i,Ht(ui,this).settings.layerLevel);typeof s=="string"&&G(o,s),e(o)})}scanRowsInCellsRange(e){const[n,,r]=Ht(ui,this).getCorners(),{wtTable:i}=Ht(In,this);yh(qd,this,xO).call(this,(o,s)=>{if(o>=n&&o<=r){const a=i.getCell(Ht(In,this).createCellCoords(o,s));e(a)}})}scanColumnsInCellsRange(e){const[,n,,r]=Ht(ui,this).getCorners(),{wtTable:i}=Ht(In,this);yh(qd,this,xO).call(this,(o,s)=>{if(s>=n&&s<=r){const a=i.getCell(Ht(In,this).createCellCoords(o,s));e(a)}})}}function j2(t){let[e,n,r,i]=Ht(ui,this).getCorners();if(e<0&&r<0||n<0&&i<0)return;const{wtTable:o}=Ht(In,this),s=e!==r||n!==i;if(n=Math.max(n,0),i=Math.max(i,0),e=Math.max(e,0),r=Math.max(r,0),s){if(n=Math.max(n,o.getFirstRenderedColumn()),i=Math.min(i,o.getLastRenderedColumn()),e=Math.max(e,o.getFirstRenderedRow()),r=Math.min(r,o.getLastRenderedRow()),i<n||r<e)return}else{const a=o.getCell(Ht(In,this).createCellCoords(e,n));if(!Qo(a))return}for(let a=e;a<=r;a+=1)for(let l=n;l<=i;l+=1)t(a,l)}function xO(t){const{wtTable:e}=Ht(In,this),n=e.getRenderedRowsCount(),r=e.getRenderedColumnsCount();for(let i=0;i<n;i+=1){const o=e.rowFilter.renderedToSource(i);for(let s=0;s<r;s+=1)t(o,e.columnFilter.renderedToSource(s))}}class AO{constructor(e,n){n&&(this.eventManager=e.eventManager,this.instance=e,this.wot=e,this.settings=n,this.mouseDown=!1,this.main=null,this.top=null,this.bottom=null,this.start=null,this.end=null,this.topStyle=null,this.bottomStyle=null,this.startStyle=null,this.endStyle=null,this.cornerDefaultStyle=YR(this.instance),this.cornerCenterPointOffset=-Math.ceil(parseInt(this.cornerDefaultStyle.width,10)/2),this.corner=null,this.cornerStyle=null,this.createBorders(n),this.registerListeners())}registerListeners(){const e=this.wot.rootDocument.body;this.eventManager.addEventListener(e,"mousedown",()=>this.onMouseDown()),this.eventManager.addEventListener(e,"mouseup",()=>this.onMouseUp());for(let n=0,r=this.main.childNodes.length;n<r;n++){const i=this.main.childNodes[n];this.eventManager.addEventListener(i,"mouseenter",o=>this.onMouseEnter(o,this.main.childNodes[n]))}}onMouseDown(){this.mouseDown=!0}onMouseUp(){this.mouseDown=!1}onMouseEnter(e,n){if(!this.mouseDown||!this.wot.getSetting("hideBorderOnMouseDownOver"))return;e.preventDefault(),Pi(e);const r=this,i=this.wot.rootDocument.body,o=n.getBoundingClientRect();n.style.display="none";function s(l){if(l.clientY<Math.floor(o.top)||l.clientY>Math.ceil(o.top+o.height)||l.clientX<Math.floor(o.left)||l.clientX>Math.ceil(o.left+o.width))return!0}function a(l){s(l)&&(r.eventManager.removeEventListener(i,"mousemove",a),n.style.display="block")}this.eventManager.addEventListener(i,"mousemove",a)}createBorders(e){const{rootDocument:n}=this.wot;this.main=n.createElement("div");const r=["top","start","bottom","end","corner"];let i=this.main.style;i.position="absolute",i.top=0,i.left=0;for(let a=0;a<5;a++){const l=r[a],u=n.createElement("div");u.className=`wtBorder ${this.settings.className||""}`,this.settings[l]&&this.settings[l].hide&&(u.className+=" hidden"),i=u.style,i.backgroundColor=this.settings[l]&&this.settings[l].color?this.settings[l].color:e.border.color,i.height=this.settings[l]&&this.settings[l].width?`${this.settings[l].width}px`:`${e.border.width}px`,i.width=this.settings[l]&&this.settings[l].width?`${this.settings[l].width}px`:`${e.border.width}px`,this.main.appendChild(u)}this.top=this.main.childNodes[0],this.start=this.main.childNodes[1],this.bottom=this.main.childNodes[2],this.end=this.main.childNodes[3],this.topStyle=this.top.style,this.startStyle=this.start.style,this.bottomStyle=this.bottom.style,this.endStyle=this.end.style,this.corner=this.main.childNodes[4],this.corner.className+=" corner",this.cornerStyle=this.corner.style,this.cornerStyle.width=`${this.cornerDefaultStyle.width}px`,this.cornerStyle.height=`${this.cornerDefaultStyle.height}px`,this.cornerStyle.border=[`${this.cornerDefaultStyle.borderWidth}px`,this.cornerDefaultStyle.borderStyle,this.cornerDefaultStyle.borderColor].join(" "),zo()&&this.instance.getSetting("isDataViewInstance")&&this.createMultipleSelectorHandles(),this.disappear();const{wtTable:o}=this.wot;let s=o.bordersHolder;s||(s=n.createElement("div"),s.className="htBorders",o.bordersHolder=s,o.spreader.appendChild(s)),s.appendChild(this.main)}createMultipleSelectorHandles(){const{rootDocument:e,stylesHandler:n}=this.wot,r=n.getCSSVariableValue("cell-mobile-handle-size"),i=n.getCSSVariableValue("cell-mobile-handle-border-radius"),o=n.getCSSVariableValue("cell-mobile-handle-background-color"),s=n.getCSSVariableValue("cell-mobile-handle-border-width"),a=n.getCSSVariableValue("cell-mobile-handle-border-color");this.selectionHandles={top:e.createElement("DIV"),topHitArea:e.createElement("DIV"),bottom:e.createElement("DIV"),bottomHitArea:e.createElement("DIV")};const l=10,u=40;this.selectionHandles.top.className="topSelectionHandle topLeftSelectionHandle",this.selectionHandles.topHitArea.className="topSelectionHandle-HitArea topLeftSelectionHandle-HitArea",this.selectionHandles.bottom.className="bottomSelectionHandle bottomRightSelectionHandle",this.selectionHandles.bottomHitArea.className="bottomSelectionHandle-HitArea bottomRightSelectionHandle-HitArea",this.selectionHandles.styles={top:this.selectionHandles.top.style,topHitArea:this.selectionHandles.topHitArea.style,bottom:this.selectionHandles.bottom.style,bottomHitArea:this.selectionHandles.bottomHitArea.style};const c={position:"absolute",height:`${u}px`,width:`${u}px`,"border-radius":`${parseInt(u/1.5,10)}px`};He(c,(d,f)=>{this.selectionHandles.styles.bottomHitArea[f]=d,this.selectionHandles.styles.topHitArea[f]=d});const h=n.isClassicTheme()?{position:"absolute",height:`${l}px`,width:`${l}px`,"border-radius":`${parseInt(l/1.5,10)}px`,background:"#F5F5FF",border:"1px solid #4285c8"}:{position:"absolute",height:`${r}px`,width:`${r}px`,"border-radius":`${i}px`,background:`${o}`,border:`${s}px solid ${a}`};He(h,(d,f)=>{this.selectionHandles.styles.bottom[f]=d,this.selectionHandles.styles.top[f]=d}),this.main.appendChild(this.selectionHandles.top),this.main.appendChild(this.selectionHandles.bottom),this.main.appendChild(this.selectionHandles.topHitArea),this.main.appendChild(this.selectionHandles.bottomHitArea)}isPartRange(e,n){const r=this.wot.selectionManager.getAreaSelection();return!!(r.cellRange&&(e!==r.cellRange.to.row||n!==r.cellRange.to.col))}updateMultipleSelectionHandlesPosition(e,n,r,i,o,s){const l=this.wot.wtSettings.getSetting("rtlMode")?"right":"left",{top:u,topHitArea:c,bottom:h,bottomHitArea:d}=this.selectionHandles.styles,f=parseInt(u.borderWidth,10),g=parseInt(u.width,10),C=parseInt(c.width,10),y=this.wot.wtTable.getWidth(),E=this.wot.wtTable.getHeight();u.top=`${parseInt(r-g-1,10)}px`,u[l]=`${parseInt(i-g-1,10)}px`,c.top=`${parseInt(r-C/4*3,10)}px`,c[l]=`${parseInt(i-C/4*3,10)}px`;const v=Math.min(parseInt(i+o,10),y-g-f*2),P=Math.min(parseInt(i+o-C/4,10),y-C-f*2);h[l]=`${v}px`,d[l]=`${P}px`;const O=Math.min(parseInt(r+s,10),E-g-f*2),L=Math.min(parseInt(r+s-C/4,10),E-C-f*2);h.top=`${O}px`,d.top=`${L}px`,this.settings.border.cornerVisible&&this.settings.border.cornerVisible()?(u.display="block",c.display="block",this.isPartRange(e,n)?(h.display="none",d.display="none"):(h.display="block",d.display="block")):(u.display="none",h.display="none",c.display="none",d.display="none"),e===this.wot.wtSettings.getSetting("fixedRowsTop")||n===this.wot.wtSettings.getSetting("fixedColumnsStart")?(u.zIndex="9999",c.zIndex="9999"):(u.zIndex="",c.zIndex="")}appear(e){if(this.disabled)return;let[n,r,i,o]=e;if(n<0&&i<0||r<0&&o<0){this.disappear();return}const{wtTable:s,rootDocument:a,rootWindow:l}=this.wot,u=n!==i||r!==o,c=s.getFirstRenderedRow(),h=s.getLastRenderedRow(),d=s.getFirstRenderedColumn(),f=s.getLastRenderedColumn();if(d<0&&f<0||c<0&&h<0){this.disappear();return}let g;if(u){if(r=Math.max(r,d),o=Math.min(o,f),n=Math.max(n,c),i=Math.min(i,h),o<r||i<n){this.disappear();return}g=s.getCell(this.wot.createCellCoords(n,r))}else if(g=s.getCell(this.wot.createCellCoords(n,r)),!Qo(g)){this.disappear();return}const C=u?s.getCell(this.wot.createCellCoords(i,o)):g,y=An(g),E=u?An(C):y,v=An(s.TABLE),P=y.top,O=y.left,L=this.wot.wtSettings.getSetting("rtlMode");let T=0,A=0;if(L){const be=qt(s.TABLE),ke=qt(g),wt=l.innerWidth-v.left-be;A=O+ke-E.left,T=l.innerWidth-O-ke-wt-1}else A=E.left+qt(C)-O,T=O-v.left-1;if(this.isEntireColumnSelected(n,i)){const be=n,ke=this.getDimensionsFromHeader("columns",r,o,be,v);let wt=null;ke&&([wt,T,A]=ke),wt&&(g=wt)}let q=P-v.top-1,U=E.top+nn(C)-P;if(this.isEntireRowSelected(r,o)){const be=r,ke=this.getDimensionsFromHeader("rows",n,i,be,v);let wt=null;ke&&([wt,q,U]=ke),wt&&(g=wt)}const j=l.getComputedStyle(g);parseInt(j.borderTopWidth,10)>0&&(q+=1,U=U>0?U-1:0),parseInt(j[L?"borderRightWidth":"borderLeftWidth"],10)>0&&(T+=1,A=A>0?A-1:0);const Z=L?"right":"left";this.topStyle.top=`${q}px`,this.topStyle[Z]=`${T}px`,this.topStyle.width=`${A}px`,this.topStyle.display="block",this.startStyle.top=`${q}px`,this.startStyle[Z]=`${T}px`,this.startStyle.height=`${U}px`,this.startStyle.display="block";const J=Math.floor(this.settings.border.width/2);this.bottomStyle.top=`${q+U-J}px`,this.bottomStyle[Z]=`${T}px`,this.bottomStyle.width=`${A}px`,this.bottomStyle.display="block",this.endStyle.top=`${q}px`,this.endStyle[Z]=`${T+A-J}px`,this.endStyle.height=`${U+1}px`,this.endStyle.display="block";let se=this.settings.border.cornerVisible;se=typeof se=="function"?se(this.settings.layerLevel):se;const te=this.wot.getSetting("onModifyGetCellCoords",i,o,!1,"render");let[ue,pt]=[i,o];if(te&&Array.isArray(te)&&([,,ue,pt]=te),zo()||!se||this.isPartRange(ue,pt))this.cornerStyle.display="none";else{this.cornerStyle.top=`${q+U+this.cornerCenterPointOffset-this.cornerDefaultStyle.borderWidth}px`,this.cornerStyle[Z]=`${T+A+this.cornerCenterPointOffset-this.cornerDefaultStyle.borderWidth}px`,this.cornerStyle.borderRightWidth=`${this.cornerDefaultStyle.borderWidth}px`,this.cornerStyle.borderLeftWidth=`${this.cornerDefaultStyle.borderWidth}px`,this.cornerStyle.borderBottomWidth=`${this.cornerDefaultStyle.borderWidth}px`,this.cornerStyle.width=this.cornerDefaultStyle.width,this.cornerStyle.display="none";let be=jh(s.TABLE);const ke=be===l;ke&&(be=a.documentElement);const wt=parseInt(this.cornerDefaultStyle.borderWidth,10)-1,fn=Math.ceil(parseInt(this.cornerDefaultStyle.width,10)/2),et=Math.ceil(parseInt(this.cornerDefaultStyle.height,10)/2);if(o===this.wot.getSetting("totalColumns")-1){const m=ke?C.getBoundingClientRect().left:C.offsetLeft;let w=!1,p=0;L?(p=m-parseInt(this.cornerDefaultStyle.width,10)/2,w=p<0):(p=m+qt(C)+parseInt(this.cornerDefaultStyle.width,10)/2,w=p>=PN(be)),w&&(this.cornerStyle[Z]=`${Math.floor(T+A+this.cornerCenterPointOffset-fn-wt)}px`,this.cornerStyle[L?"borderLeftWidth":"borderRightWidth"]=0)}if(i===this.wot.getSetting("totalRows")-1){const p=(ke?C.getBoundingClientRect().top:C.offsetTop)+nn(C)+parseInt(this.cornerDefaultStyle.height,10)/2>=vh(be),I=this.wot.stylesHandler.isClassicTheme();if(p){const $=Math.floor(q+U+this.cornerCenterPointOffset-et-wt);I?(this.cornerStyle.top=`${$}px`,this.cornerStyle.borderBottomWidth=0):this.cornerStyle.top=`${$-1}px`}}this.cornerStyle.display="block"}zo()&&this.instance.getSetting("isDataViewInstance")&&this.updateMultipleSelectionHandlesPosition(i,o,q,T,A,U)}isEntireColumnSelected(e,n){return e===this.wot.wtTable.getFirstRenderedRow()&&n===this.wot.wtTable.getLastRenderedRow()}isEntireRowSelected(e,n){return e===this.wot.wtTable.getFirstRenderedColumn()&&n===this.wot.wtTable.getLastRenderedColumn()}getDimensionsFromHeader(e,n,r,i,o){const{wtTable:s}=this.wot,a=s.wtRootElement.parentNode;let l=null,u=null,c=null,h=null,d=null,f=null,g=null,C=null;switch(e){case"rows":l=function(){return s.getRowHeader(...arguments)},u=function(){return nn(...arguments)},c="ht__selection--rows",f="top";break;case"columns":l=function(){return s.getColumnHeader(...arguments)},u=function(){return qt(...arguments)},c="ht__selection--columns",f="left";break}if(a.classList.contains(c)){const y=this.wot.getSetting("columnHeaders").length;if(g=l(n,y-i),C=l(r,y-i),!g||!C)return!1;const E=An(g),v=An(C);return g&&C&&(h=E[f]-o[f]-1,d=v[f]+u(C)-E[f]),[g,h,d]}return!1}changeBorderStyle(e,n){const r=this[e].style,i=n[e];!i||i.hide?G(this[e],"hidden"):(ve(this[e],"hidden")&&pe(this[e],"hidden"),r.backgroundColor=i.color,(e==="top"||e==="bottom")&&(r.height=`${i.width}px`),(e==="start"||e==="end")&&(r.width=`${i.width}px`))}changeBorderToDefaultStyle(e){const n={width:1,color:"#000"},r=this[e].style;r.backgroundColor=n.color,r.width=`${n.width}px`,r.height=`${n.width}px`}toggleHiddenClass(e,n){this.changeBorderToDefaultStyle(e),n?G(this[e],"hidden"):pe(this[e],"hidden")}disappear(){this.topStyle.display="none",this.bottomStyle.display="none",this.startStyle.display="none",this.endStyle.display="none",this.cornerStyle.display="none",zo()&&this.instance.getSetting("isDataViewInstance")&&(this.selectionHandles.styles.top.display="none",this.selectionHandles.styles.topHitArea.display="none",this.selectionHandles.styles.bottom.display="none",this.selectionHandles.styles.bottomHitArea.display="none")}destroy(){this.eventManager.destroyWithOwnEventsOnly(),this.main.parentNode.removeChild(this.main)}}function U2(t,e){gD(t,e),e.add(t)}function Ol(t,e,n){gD(t,e),e.set(t,n)}function gD(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Oe(t,e){return t.get(GR(t,e))}function HO(t,e,n){return t.set(GR(t,e),n),n}function GR(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Pn=new WeakMap,sr=new WeakMap,WC=new WeakMap,uh=new WeakMap,BC=new WeakMap,oa=new WeakMap,NO=new WeakSet;class z2{constructor(e){U2(this,NO),Ol(this,Pn,void 0),Ol(this,sr,void 0),Ol(this,WC,new B2),Ol(this,uh,new WeakMap),Ol(this,BC,new WeakSet),Ol(this,oa,new Map),HO(sr,this,e)}setActiveOverlay(e){return HO(Pn,this,e),Oe(WC,this).setActiveOverlay(Oe(Pn,this)),Oe(uh,this).has(Oe(Pn,this))||Oe(uh,this).set(Oe(Pn,this),new Set),this}getFocusSelection(){return Oe(sr,this)!==null?Oe(sr,this).getFocus():null}getAreaSelection(){return Oe(sr,this)!==null?Oe(sr,this).createLayeredArea():null}getBorderInstance(e){if(!e.settings.border)return null;if(Oe(oa,this).has(e)){const r=Oe(oa,this).get(e);if(r.has(Oe(Pn,this)))return r.get(Oe(Pn,this));const i=new AO(Oe(Pn,this),e.settings);return r.set(Oe(Pn,this),i),i}const n=new AO(Oe(Pn,this),e.settings);return Oe(oa,this).set(e,new Map([[Oe(Pn,this),n]])),n}getBorderInstances(e){var n,r;return Array.from((n=(r=Oe(oa,this).get(e))===null||r===void 0?void 0:r.values())!==null&&n!==void 0?n:[])}destroyBorders(e){Oe(oa,this).get(e).forEach(n=>n.destroy()),Oe(oa,this).delete(e)}render(e){if(Oe(sr,this)===null)return;e&&GR(NO,this,Y2).call(this);const n=Array.from(Oe(sr,this)),r=new Map,i=new Map;for(let o=0;o<n.length;o++){const s=n[o],{className:a,headerAttributes:l,createLayers:u,selectionType:c}=s.settings;Oe(BC,this).has(s)||(Oe(BC,this).add(s),s.addLocalHook("destroy",()=>this.destroyBorders(s)));const h=this.getBorderInstance(s);if(s.isEmpty()){h==null||h.disappear();continue}a&&Oe(WC,this).setActiveSelection(s).scan().forEach(g=>{if(r.has(g)){const C=r.get(g);C.has(a)&&u===!0?C.set(a,C.get(a)+1):C.set(a,1)}else r.set(g,new Map([[a,1]]));l&&(i.has(g)||i.set(g,[]),g.nodeName==="TH"&&i.get(g).push(...l))});const d=s.getCorners();Oe(Pn,this).getSetting("onBeforeDrawBorders",d,c),h==null||h.appear(d)}r.forEach((o,s)=>{var a;const l=Array.from(o).map(u=>{let[c,h]=u;return h===1?c:[c,...Array.from({length:h-1},(d,f)=>`${c}-${f+1}`)]}).flat();l.forEach(u=>Oe(uh,this).get(Oe(Pn,this)).add(u)),G(s,l),s.nodeName==="TD"&&Array.isArray((a=Oe(sr,this).options)===null||a===void 0?void 0:a.cellAttributes)&&ye(s,Oe(sr,this).options.cellAttributes)}),Array.from(i.keys()).forEach(o=>{ye(o,[...i.get(o)])})}}function Y2(){const t=Oe(uh,this).get(Oe(Pn,this)),e=Oe(Pn,this).wtSettings.getSetting("onBeforeRemoveCellClassNames");if(Array.isArray(e))for(let n=0;n<e.length;n++)t.add(e[n]);t.forEach(n=>{var r,i;const o=Oe(Pn,this).wtTable.TABLE.querySelectorAll(`.${n}`);let s=[];Array.isArray((r=Oe(sr,this).options)===null||r===void 0?void 0:r.cellAttributes)&&(s=Oe(sr,this).options.cellAttributes.map(a=>a[0])),Array.isArray((i=Oe(sr,this).options)===null||i===void 0?void 0:i.headerAttributes)&&(s=[...s,...Oe(sr,this).options.headerAttributes.map(a=>a[0])]);for(let a=0,l=o.length;a<l;a++)pe(o[a],n),qu(o[a],s)}),t.clear()}class G2 extends Sd{constructor(e,n,r,i){super(e,n,ul,r,i)}createTable(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return new jR(...n)}shouldBeRendered(){return this.wtSettings.getSetting("shouldRenderInlineStartOverlay")}resetFixedPosition(){const{wtTable:e}=this.wot;if(!this.needFullRender||!this.shouldBeRendered()||!e.holder.parentNode)return!1;const{rootWindow:n}=this.domBindings,r=this.clone.wtTable.holder.parentNode,i=this.wtSettings.getSetting("preventOverflow");let o=0;this.trimmingContainer===n&&(!i||i!=="horizontal")?(o=this.getOverlayOffset()*(this.isRtl()?-1:1),OR(r,`${o}px`,"0px")):(o=this.getScrollPosition(),rp(r));const s=this.adjustHeaderBordersPosition(o);return this.adjustElementsSize(),s}setScrollPosition(e){const{rootWindow:n}=this.domBindings;let r=!1;this.isRtl()&&(e=-e);const i=this.mainTableScrollableElement;if(i===n&&e!==n.scrollX){const o=n.scrollX;n.scrollTo(e,MN(n)),r=o!==n.scrollX}else if(e!==i.scrollLeft){const o=i.scrollLeft;i.scrollLeft=e,r=o!==i.scrollLeft}return r}onScroll(){this.wtSettings.getSetting("onScrollVertically")}sumCellSizes(e,n){const r=this.wtSettings.getSetting("defaultColumnWidth");let i=e,o=0;for(;i<n;)o+=this.wot.wtTable.getColumnWidth(i)||r,i+=1;return o}adjustElementsSize(){this.updateTrimmingContainer(),this.needFullRender&&(this.adjustRootElementSize(),this.adjustRootChildrenSize())}adjustRootElementSize(){const{wtTable:e,wtViewport:n}=this.wot,{rootDocument:r,rootWindow:i}=this.domBindings,s=this.clone.wtTable.holder.parentNode.style,a=this.wtSettings.getSetting("preventOverflow");if(this.trimmingContainer!==i||a==="vertical"){let u=n.getWorkspaceHeight();n.hasHorizontalScroll()&&(u-=vn(r)),u=Math.min(u,e.wtRootElement.scrollHeight),s.height=`${u}px`}else s.height="";this.clone.wtTable.holder.style.height=s.height;const l=qt(this.clone.wtTable.TABLE);s.width=`${l}px`}adjustRootChildrenSize(){const{holder:e}=this.clone.wtTable,n=YR(this.wot),r=this.wot.selectionManager.getFocusSelection()?parseInt(n.width,10)/2:0;this.clone.wtTable.hider.style.height=this.hider.style.height,e.style.height=e.parentNode.style.height,e.style.width=`${parseInt(e.parentNode.style.width,10)+r}px`}applyToDOM(){const e=this.wtSettings.getSetting("totalColumns"),n=this.isRtl()?"right":"left";if(typeof this.wot.wtViewport.columnsRenderCalculator.startPosition=="number")this.spreader.style[n]=`${this.wot.wtViewport.columnsRenderCalculator.startPosition}px`;else if(e===0)this.spreader.style[n]="0";else throw new Error("Incorrect value of the columnsRenderCalculator");this.isRtl()?this.spreader.style.left="":this.spreader.style.right="",this.needFullRender&&this.syncOverlayOffset()}syncOverlayOffset(){typeof this.wot.wtViewport.rowsRenderCalculator.startPosition=="number"?this.clone.wtTable.spreader.style.top=`${this.wot.wtViewport.rowsRenderCalculator.startPosition}px`:this.clone.wtTable.spreader.style.top=""}scrollTo(e,n){const{wtSettings:r}=this,i=r.getSetting("rowHeaders"),o=r.getSetting("fixedColumnsStart"),a=(this.wot.cloneSource?this.wot.cloneSource:this.wot).wtTable.holder,l=o===0&&i.length>0&&!ve(a.parentNode,"innerBorderInlineStart")?1:0;let u=this.getTableParentOffset(),c=0;if(n){const h=this.wot.wtTable.getColumnWidth(e),d=this.wot.wtViewport.getViewportWidth();h>d&&(n=!1)}return n&&a.offsetWidth!==a.clientWidth&&(c=vn(this.domBindings.rootDocument)),n?(u+=this.sumCellSizes(0,e+1),u-=this.wot.wtViewport.getViewportWidth(),u+=l):u+=this.sumCellSizes(this.wtSettings.getSetting("fixedColumnsStart"),e),u+=c,ez(this.mainTableScrollableElement)===u-l&&l>0&&this.wot.wtOverlays.expandHiderHorizontallyBy(l),this.setScrollPosition(u)}getTableParentOffset(){const e=this.wtSettings.getSetting("preventOverflow");let n=0;return!e&&this.trimmingContainer===this.domBindings.rootWindow&&(n=this.wot.wtTable.holderOffset.left),n}getScrollPosition(){return Math.abs(IN(this.mainTableScrollableElement,this.domBindings.rootWindow))}getOverlayOffset(){const{rootWindow:e}=this.domBindings,n=this.wtSettings.getSetting("preventOverflow");let r=0;if(this.trimmingContainer===e&&(!n||n!=="horizontal")){this.isRtl()?r=Math.abs(Math.min(this.getTableParentOffset()-this.getScrollPosition(),0)):r=Math.max(this.getScrollPosition()-this.getTableParentOffset(),0);const i=this.wot.wtTable.getTotalWidth(),o=this.clone.wtTable.getTotalWidth(),s=i-o;r>s&&(r=0)}return r}adjustHeaderBordersPosition(e){const{wtSettings:n}=this,r=this.wot.wtTable.holder.parentNode,i=n.getSetting("rowHeaders"),o=n.getSetting("fixedColumnsStart"),s=n.getSetting("totalRows"),a=n.getSetting("preventOverflow")==="vertical";s?pe(r,"emptyRows"):G(r,"emptyRows");let l=!1;if(!a){if(o&&!i.length)G(r,"innerBorderLeft innerBorderInlineStart");else if(!o&&i.length){const u=ve(r,"innerBorderInlineStart");e?(G(r,"innerBorderLeft innerBorderInlineStart"),l=!u):(pe(r,"innerBorderLeft innerBorderInlineStart"),l=u)}}return l}}const q2="stickyRowsTop",qR={getFirstRenderedRow(){return this.getRenderedRowsCount()===0?-1:0},getFirstVisibleRow(){return this.getFirstRenderedRow()},getFirstPartiallyVisibleRow(){return this.getFirstRenderedRow()},getLastRenderedRow(){return this.getRenderedRowsCount()-1},getLastVisibleRow(){return this.getLastRenderedRow()},getLastPartiallyVisibleRow(){return this.getLastRenderedRow()},getRenderedRowsCount(){return Math.min(this.wtSettings.getSetting("totalRows"),this.wtSettings.getSetting("fixedRowsTop"))},getVisibleRowsCount(){return this.getRenderedRowsCount()},getColumnHeadersCount(){return this.dataAccessObject.columnHeaders.length}};ss(qR,"MIXIN_NAME",q2,{writable:!1,enumerable:!1});class KR extends Xu{constructor(e,n,r,i){super(e,n,r,i,cl)}}ut(KR,qR);ut(KR,lp);function DO(t,e,n){return(e=K2(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function K2(t){var e=X2(t,"string");return typeof e=="symbol"?e:e+""}function X2(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Z2 extends Sd{constructor(e,n,r,i,o,s){super(e,n,cl,r,i),DO(this,"topOverlay",void 0),DO(this,"inlineStartOverlay",void 0),this.topOverlay=o,this.inlineStartOverlay=s}createTable(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return new KR(...n)}shouldBeRendered(){return this.wtSettings.getSetting("shouldRenderTopOverlay")&&this.wtSettings.getSetting("shouldRenderInlineStartOverlay")}resetFixedPosition(){if(this.updateTrimmingContainer(),!this.wot.wtTable.holder.parentNode)return!1;const e=this.clone.wtTable.holder.parentNode;if(this.trimmingContainer===this.domBindings.rootWindow){const i=this.inlineStartOverlay.getOverlayOffset()*(this.isRtl()?-1:1),o=this.topOverlay.getOverlayOffset();OR(e,`${i}px`,`${o}px`)}else rp(e);let n=nn(this.clone.wtTable.TABLE);const r=qt(this.clone.wtTable.TABLE);return this.wot.wtTable.hasDefinedSize()||(n=0),e.style.height=`${n}px`,e.style.width=`${r}px`,!1}}class XR extends Xu{constructor(e,n,r,i){super(e,n,r,i,ll)}}ut(XR,qR);ut(XR,up);function Q2(t,e,n){return(e=J2(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function J2(t){var e=eq(t,"string");return typeof e=="symbol"?e:e+""}function eq(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class tq extends Sd{constructor(e,n,r,i){super(e,n,ll,r,i),Q2(this,"cachedFixedRowsTop",-1),this.cachedFixedRowsTop=this.wtSettings.getSetting("fixedRowsTop")}createTable(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return new XR(...n)}shouldBeRendered(){return this.wtSettings.getSetting("shouldRenderTopOverlay")}resetFixedPosition(){if(!this.needFullRender||!this.shouldBeRendered()||!this.wot.wtTable.holder.parentNode)return!1;const e=this.clone.wtTable.holder.parentNode,{rootWindow:n}=this.domBindings,r=this.wtSettings.getSetting("preventOverflow");let i=0,o=!1;if(this.trimmingContainer===n&&(!r||r!=="vertical")){const{wtTable:a}=this.wot,l=a.hider.getBoundingClientRect(),u=Math.ceil(l.bottom),c=e.offsetHeight;o=u===c,i=this.getOverlayOffset(),OR(e,"0px",`${i}px`)}else i=this.getScrollPosition(),rp(e);const s=this.adjustHeaderBordersPosition(i,o);return this.adjustElementsSize(),s}setScrollPosition(e){const{rootWindow:n}=this.domBindings,r=this.mainTableScrollableElement;let i=!1;if(r===n&&e!==n.scrollY){const o=n.scrollY;n.scrollTo(IR(n),e),i=o!==n.scrollY}else if(e!==r.scrollTop){const o=r.scrollTop;r.scrollTop=e,i=o!==r.scrollTop}return i}onScroll(){this.wtSettings.getSetting("onScrollHorizontally")}sumCellSizes(e,n){const r=this.wot.stylesHandler.getDefaultRowHeight();let i=e,o=0;for(;i<n;){const s=this.wot.wtTable.getRowHeight(i);o+=s===void 0?r:s,i+=1}return o}adjustElementsSize(){this.updateTrimmingContainer(),this.needFullRender&&(this.adjustRootElementSize(),this.adjustRootChildrenSize())}adjustRootElementSize(){const{wtTable:e,wtViewport:n}=this.wot,{rootDocument:r,rootWindow:i}=this.domBindings,s=this.clone.wtTable.holder.parentNode.style,a=this.wtSettings.getSetting("preventOverflow");if(this.trimmingContainer!==i||a==="horizontal"){let u=n.getWorkspaceWidth();n.hasVerticalScroll()&&(u-=vn(r)),u=Math.min(u,e.wtRootElement.scrollWidth),s.width=`${u}px`}else s.width="";this.clone.wtTable.holder.style.width=s.width;let l=nn(this.clone.wtTable.TABLE);e.hasDefinedSize()||(l=0),s.height=`${l}px`}adjustRootChildrenSize(){const{holder:e}=this.clone.wtTable,n=YR(this.wot),r=this.wot.selectionManager.getFocusSelection()?parseInt(n.height,10)/2:0;this.clone.wtTable.hider.style.width=this.hider.style.width,e.style.width=e.parentNode.style.width,e.style.height=`${parseInt(e.parentNode.style.height,10)+r}px`}applyToDOM(){const e=this.wtSettings.getSetting("totalRows");if(typeof this.wot.wtViewport.rowsRenderCalculator.startPosition=="number")this.spreader.style.top=`${this.wot.wtViewport.rowsRenderCalculator.startPosition}px`;else if(e===0)this.spreader.style.top="0";else throw new Error("Incorrect value of the rowsRenderCalculator");this.spreader.style.bottom="",this.needFullRender&&this.syncOverlayOffset()}syncOverlayOffset(){const e=this.isRtl()?"right":"left",{spreader:n}=this.clone.wtTable;typeof this.wot.wtViewport.columnsRenderCalculator.startPosition=="number"?n.style[e]=`${this.wot.wtViewport.columnsRenderCalculator.startPosition}px`:n.style[e]=""}scrollTo(e,n){const{wot:r,wtSettings:i}=this,s=(r.cloneSource?r.cloneSource:r).wtTable.holder,a=i.getSetting("columnHeaders"),u=i.getSetting("fixedRowsTop")===0&&a.length>0&&!ve(s.parentNode,"innerBorderTop")?1:0;let c=this.getTableParentOffset(),h=0;if(n){const d=this.wot.wtTable.getRowHeight(e),f=this.wot.wtViewport.getViewportHeight();d>f&&(n=!1)}if(n&&s.offsetHeight!==s.clientHeight&&(h=vn(this.domBindings.rootDocument)),n){const d=i.getSetting("fixedRowsBottom"),f=i.getSetting("totalRows");c+=this.sumCellSizes(0,e+1),c-=r.wtViewport.getViewportHeight()-this.sumCellSizes(f-d,f),c+=1,c+=u}else c+=this.sumCellSizes(i.getSetting("fixedRowsTop"),e);return c+=h,JU(this.mainTableScrollableElement)===c-u&&u>0&&this.wot.wtOverlays.expandHiderVerticallyBy(u),this.setScrollPosition(c)}getTableParentOffset(){return this.mainTableScrollableElement===this.domBindings.rootWindow?this.wot.wtTable.holderOffset.top:0}getScrollPosition(){return PR(this.mainTableScrollableElement,this.domBindings.rootWindow)}getOverlayOffset(){const{rootWindow:e}=this.domBindings,n=this.wtSettings.getSetting("preventOverflow");let r=0;if(this.trimmingContainer===e&&(!n||n!=="vertical")){const i=this.wot.wtTable.getTotalHeight(),o=this.clone.wtTable.getTotalHeight(),s=i-o;r=Math.max(this.getScrollPosition()-this.getTableParentOffset(),0),r>s&&(r=0)}return r}adjustHeaderBordersPosition(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const{wtSettings:r}=this,i=this.wot.wtTable.holder.parentNode,o=r.getSetting("totalColumns"),s=r.getSetting("preventOverflow")==="horizontal";o?pe(i,"emptyColumns"):G(i,"emptyColumns");let a=!1;if(!n&&!s){const l=r.getSetting("fixedRowsTop"),u=this.cachedFixedRowsTop!==l,c=r.getSetting("columnHeaders");if((u||l===0)&&c.length>0){const h=ve(i,"innerBorderTop");this.cachedFixedRowsTop=r.getSetting("fixedRowsTop"),e||r.getSetting("totalRows")===0?(G(i,"innerBorderTop"),a=!h):(pe(i,"innerBorderTop"),a=h)}}return a}}function Kd(t,e,n){nq(t,e),e.set(t,n)}function nq(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function yo(t,e,n){return(e=rq(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function rq(t){var e=iq(t,"string");return typeof e=="symbol"?e:e+""}function iq(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function sa(t,e,n){return t.set(mD(t,e),n),n}function bo(t,e){return t.get(mD(t,e))}function mD(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var xl=new WeakMap,Xd=new WeakMap,Al=new WeakMap,Zd=new WeakMap;class oq{constructor(e,n,r,i,o,s){yo(this,"wot",null),Kd(this,xl,[]),yo(this,"topOverlay",null),yo(this,"bottomOverlay",null),yo(this,"inlineStartOverlay",null),yo(this,"topInlineStartCornerOverlay",null),yo(this,"bottomInlineStartCornerOverlay",null),yo(this,"browserLineHeight",void 0),yo(this,"wtSettings",null),Kd(this,Xd,!1),Kd(this,Al,0),Kd(this,Zd,null),yo(this,"resizeObserver",new ResizeObserver(c=>{Xg(()=>{!Array.isArray(c)||!c.length||(sa(Al,this,bo(Al,this)+1),bo(Al,this)===100&&(Ze("The ResizeObserver callback was fired too many times in direct succession.\nThis may be due to an infinite loop caused by setting a dynamic height/width (for example, with the `dvh` units) to a Handsontable container's parent. \nThe observer will be disconnected."),this.resizeObserver.disconnect()),bo(Zd,this)!==null&&clearTimeout(bo(Zd,this)),sa(Zd,this,setTimeout(()=>{sa(Al,this,0)},100)),this.wtSettings.getSetting("onContainerElementResize"))})})),this.wot=e,this.wtSettings=i,this.domBindings=r,this.facadeGetter=n,this.wtTable=s;const{rootDocument:a,rootWindow:l}=this.domBindings;this.instance=this.wot,this.eventManager=o,this.scrollbarSize=vn(a);const u=l.getComputedStyle(s.wtRootElement.parentNode).getPropertyValue("overflow")==="hidden";this.scrollableElement=u?s.holder:qg(s.TABLE),this.initOverlays(),this.destroyed=!1,this.keyPressed=!1,this.spreaderLastSize={width:null,height:null},this.verticalScrolling=!1,this.horizontalScrolling=!1,this.initBrowserLineHeight(),this.registerListeners(),this.lastScrollX=l.scrollX,this.lastScrollY=l.scrollY}getOverlays(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const n=[...bo(xl,this)];return e&&n.push(this.wtTable),n}initBrowserLineHeight(){const{rootWindow:e,rootDocument:n}=this.domBindings,r=e.getComputedStyle(n.body),i=parseInt(r.lineHeight,10),o=parseInt(r.fontSize,10)*1.2;this.browserLineHeight=i||o}initOverlays(){const e=[this.wot,this.facadeGetter,this.wtSettings,this.domBindings];this.topOverlay=new tq(...e),this.bottomOverlay=new H2(...e),this.inlineStartOverlay=new G2(...e),this.topInlineStartCornerOverlay=new Z2(...e,this.topOverlay,this.inlineStartOverlay),this.bottomInlineStartCornerOverlay=new I2(...e,this.bottomOverlay,this.inlineStartOverlay),sa(xl,this,[this.topOverlay,this.bottomOverlay,this.inlineStartOverlay,this.topInlineStartCornerOverlay,this.bottomInlineStartCornerOverlay])}beforeDraw(){sa(Xd,this,bo(xl,this).reduce((e,n)=>n.hasRenderingStateChanged()||e,!1)),bo(xl,this).forEach(e=>e.updateStateOfRendering("before"))}afterDraw(){this.syncScrollWithMaster(),bo(xl,this).forEach(e=>{const n=e.hasRenderingStateChanged();e.updateStateOfRendering("after"),n&&!e.needFullRender&&e.reset()})}refreshAll(){if(this.wot.drawn){if(!this.wtTable.holder.parentNode){this.destroy();return}this.wot.draw(!0),this.verticalScrolling&&this.inlineStartOverlay.onScroll(),this.horizontalScrolling&&this.topOverlay.onScroll(),this.verticalScrolling=!1,this.horizontalScrolling=!1}}registerListeners(){const{rootDocument:e,rootWindow:n}=this.domBindings,{mainTableScrollableElement:r}=this.topOverlay,{mainTableScrollableElement:i}=this.inlineStartOverlay;this.eventManager.addEventListener(e.documentElement,"keydown",h=>this.onKeyDown(h)),this.eventManager.addEventListener(e.documentElement,"keyup",()=>this.onKeyUp()),this.eventManager.addEventListener(e,"visibilitychange",()=>this.onKeyUp()),this.eventManager.addEventListener(r,"scroll",h=>this.onTableScroll(h),{passive:!0}),r!==i&&this.eventManager.addEventListener(i,"scroll",h=>this.onTableScroll(h),{passive:!0});const o=n.devicePixelRatio&&n.devicePixelRatio>1,s=this.scrollableElement===n,a=this.wtSettings.getSetting("preventWheel"),l={passive:s};(a||o||!FN())&&this.eventManager.addEventListener(this.wtTable.wtRootElement,"wheel",h=>this.onCloneWheel(h,a),l),[this.topOverlay,this.bottomOverlay,this.inlineStartOverlay,this.topInlineStartCornerOverlay,this.bottomInlineStartCornerOverlay].forEach(h=>{this.eventManager.addEventListener(h.clone.wtTable.holder,"wheel",d=>this.onCloneWheel(d,a),l)});let c;this.eventManager.addEventListener(n,"resize",()=>{Xg(()=>{clearTimeout(c),this.wtSettings.getSetting("onWindowResize"),c=setTimeout(()=>{sa(Al,this,0)},200)})}),s||this.resizeObserver.observe(this.wtTable.wtRootElement.parentElement)}onTableScroll(e){const n=this.domBindings.rootWindow,r=this.inlineStartOverlay.mainTableScrollableElement,i=this.topOverlay.mainTableScrollableElement,o=e.target;this.keyPressed&&(i!==n&&o!==n&&!e.target.contains(i)||r!==n&&o!==n&&!e.target.contains(r))||this.syncScrollPositions(e)}onCloneWheel(e,n){const{rootWindow:r}=this.domBindings,i=this.inlineStartOverlay.mainTableScrollableElement,o=this.topOverlay.mainTableScrollableElement,s=e.target,a=o!==r&&s!==r&&!s.contains(o),l=i!==r&&s!==r&&!s.contains(i);if(this.keyPressed&&(a||l)||this.scrollableElement===r)return;const u=this.translateMouseWheelToScroll(e);(n||this.scrollableElement!==r&&u)&&e.preventDefault()}onKeyDown(e){this.keyPressed=Cd(e.keyCode,"ARROW_UP|ARROW_RIGHT|ARROW_DOWN|ARROW_LEFT")}onKeyUp(){this.keyPressed=!1}translateMouseWheelToScroll(e){let n=isNaN(e.deltaY)?-1*e.wheelDeltaY:e.deltaY,r=isNaN(e.deltaX)?-1*e.wheelDeltaX:e.deltaX;e.deltaMode===1&&(r+=r*this.browserLineHeight,n+=n*this.browserLineHeight);const i=this.scrollVertically(n),o=this.scrollHorizontally(r);return i||o}scrollVertically(e){const n=this.scrollableElement.scrollTop;return this.scrollableElement.scrollTop+=e,n!==this.scrollableElement.scrollTop}scrollHorizontally(e){const n=this.scrollableElement.scrollLeft;return this.scrollableElement.scrollLeft+=e,n!==this.scrollableElement.scrollLeft}syncScrollPositions(){if(this.destroyed)return;const e=this.topOverlay.clone.wtTable.holder,n=this.inlineStartOverlay.clone.wtTable.holder;let r=this.scrollableElement.scrollLeft,i=this.scrollableElement.scrollTop;if(this.wot.wtViewport.isHorizontallyScrollableByWindow()&&(r=this.scrollableElement.scrollX),this.wot.wtViewport.isVerticallyScrollableByWindow()&&(i=this.scrollableElement.scrollY),this.horizontalScrolling=this.lastScrollX!==r,this.verticalScrolling=this.lastScrollY!==i,this.lastScrollX=r,this.lastScrollY=i,this.horizontalScrolling){e.scrollLeft=r;const o=this.bottomOverlay.needFullRender?this.bottomOverlay.clone.wtTable.holder:null;o&&(o.scrollLeft=r)}this.verticalScrolling&&(n.scrollTop=i),this.refreshAll()}syncScrollWithMaster(){if(!bo(Xd,this))return;const e=this.topOverlay.mainTableScrollableElement,{scrollLeft:n,scrollTop:r}=e;this.topOverlay.needFullRender&&(this.topOverlay.clone.wtTable.holder.scrollLeft=n),this.bottomOverlay.needFullRender&&(this.bottomOverlay.clone.wtTable.holder.scrollLeft=n),this.inlineStartOverlay.needFullRender&&(this.inlineStartOverlay.clone.wtTable.holder.scrollTop=r),sa(Xd,this,!1)}updateMainScrollableElements(){this.eventManager.clearEvents(!0),this.inlineStartOverlay.updateMainScrollableElement(),this.topOverlay.updateMainScrollableElement(),this.bottomOverlay.needFullRender&&this.bottomOverlay.updateMainScrollableElement();const{wtTable:e}=this,{rootWindow:n}=this.domBindings;n.getComputedStyle(e.wtRootElement.parentNode).getPropertyValue("overflow")==="hidden"?this.scrollableElement=e.holder:this.scrollableElement=qg(e.TABLE),this.registerListeners()}destroy(){this.resizeObserver.disconnect(),this.eventManager.destroy(),this.topOverlay.destroy(),this.bottomOverlay.clone&&this.bottomOverlay.destroy(),this.inlineStartOverlay.destroy(),this.topInlineStartCornerOverlay&&this.topInlineStartCornerOverlay.destroy(),this.bottomInlineStartCornerOverlay&&this.bottomInlineStartCornerOverlay.clone&&this.bottomInlineStartCornerOverlay.destroy(),this.destroyed=!0}refresh(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this.updateLastSpreaderSize()&&this.adjustElementsSize(),this.bottomOverlay.clone&&this.bottomOverlay.refresh(e),this.inlineStartOverlay.refresh(e),this.topOverlay.refresh(e),this.topInlineStartCornerOverlay&&this.topInlineStartCornerOverlay.refresh(e),this.bottomInlineStartCornerOverlay&&this.bottomInlineStartCornerOverlay.clone&&this.bottomInlineStartCornerOverlay.refresh(e)}updateLastSpreaderSize(){const e=this.wtTable.spreader,n=e.clientWidth,r=e.clientHeight,i=n!==this.spreaderLastSize.width||r!==this.spreaderLastSize.height;return i&&(this.spreaderLastSize.width=n,this.spreaderLastSize.height=r),i}adjustElementsSize(){const{wtViewport:e}=this.wot,{wtTable:n}=this,{rootWindow:r}=this.domBindings,i=this.scrollableElement===r,o=this.wtSettings.getSetting("totalColumns"),s=this.wtSettings.getSetting("totalRows"),a=e.getRowHeaderWidth(),u=e.getColumnHeaderHeight()+this.topOverlay.sumCellSizes(0,s)+1,c=a+this.inlineStartOverlay.sumCellSizes(0,o),d=n.hider.style,f=()=>i?!1:this.scrollableElement.scrollTop>Math.max(0,u-n.holder.clientHeight),g=()=>i?!1:this.scrollableElement.scrollLeft>Math.max(0,c-n.holder.clientWidth),C=f()?1:0,y=g()?1:0;d.width=`${c+y}px`,d.height=`${u+C}px`,this.topOverlay.adjustElementsSize(),this.inlineStartOverlay.adjustElementsSize(),this.bottomOverlay.adjustElementsSize()}expandHiderVerticallyBy(e){const{wtTable:n}=this;n.hider.style.height=`${parseInt(n.hider.style.height,10)+e}px`}expandHiderHorizontallyBy(e){const{wtTable:n}=this;n.hider.style.width=`${parseInt(n.hider.style.width,10)+e}px`}applyToDOM(){this.wtTable.isVisible()&&(this.topOverlay.applyToDOM(),this.bottomOverlay.clone&&this.bottomOverlay.applyToDOM(),this.inlineStartOverlay.applyToDOM())}getParentOverlay(e){if(!e)return null;const n=[this.topOverlay,this.inlineStartOverlay,this.bottomOverlay,this.topInlineStartCornerOverlay,this.bottomInlineStartCornerOverlay];let r=null;return M(n,i=>{i&&i.clone&&i.clone.wtTable.TABLE.contains(e)&&(r=i.clone)}),r}syncOverlayTableClassNames(){const e=this.wtTable.TABLE,n=[this.topOverlay,this.inlineStartOverlay,this.bottomOverlay,this.topInlineStartCornerOverlay,this.bottomInlineStartCornerOverlay];M(n,r=>{r&&(r.clone.wtTable.TABLE.className=e.className)})}}function kO(t,e,n){return(e=sq(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function sq(t){var e=aq(t,"string");return typeof e=="symbol"?e:e+""}function aq(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class lq{constructor(e){kO(this,"settings",{}),kO(this,"defaults",Object.freeze(this.getDefaults())),He(this.defaults,(n,r)=>{if(e[r]!==void 0)this.settings[r]=e[r];else{if(n===void 0)throw new Error(`A required setting "${r}" was not provided`);this.settings[r]=n}})}getDefaults(){return{facade:void 0,table:void 0,isDataViewInstance:!0,externalRowCalculator:!1,currentRowClassName:null,currentColumnClassName:null,preventOverflow(){return!1},preventWheel:!1,data:void 0,fixedColumnsStart:0,fixedRowsTop:0,fixedRowsBottom:0,shouldRenderInlineStartOverlay:()=>this.getSetting("fixedColumnsStart")>0||this.getSetting("rowHeaders").length>0,shouldRenderTopOverlay:()=>this.getSetting("fixedRowsTop")>0||this.getSetting("columnHeaders").length>0,shouldRenderBottomOverlay:()=>this.getSetting("fixedRowsBottom")>0,minSpareRows:0,rowHeaders(){return[]},columnHeaders(){return[]},totalRows:void 0,totalColumns:void 0,cellRenderer:(e,n,r)=>{const i=this.getSetting("data",e,n);ol(r,i??"")},columnWidth(){},rowHeight(){},rowHeightByOverlayName(){},defaultColumnWidth:50,selections:null,hideBorderOnMouseDownOver:!1,viewportRowCalculatorOverride:null,viewportColumnCalculatorOverride:null,viewportRowRenderingThreshold:null,viewportColumnRenderingThreshold:null,onCellMouseDown:null,onCellContextMenu:null,onCellMouseOver:null,onCellMouseOut:null,onCellMouseUp:null,onCellDblClick:null,onCellCornerMouseDown:null,onCellCornerDblClick:null,beforeDraw:null,onDraw:null,onBeforeRemoveCellClassNames:null,onAfterDrawSelection:null,onBeforeDrawBorders:null,onBeforeViewportScrollHorizontally:e=>e,onBeforeViewportScrollVertically:e=>e,onScrollHorizontally:null,onScrollVertically:null,onBeforeTouchScroll:null,onAfterMomentumScroll:null,onModifyRowHeaderWidth:null,onModifyGetCellCoords:null,onModifyGetCoordsElement:null,onModifyGetCoords:null,onBeforeHighlightingRowHeader:e=>e,onBeforeHighlightingColumnHeader:e=>e,onWindowResize:null,onContainerElementResize:null,renderAllColumns:!1,renderAllRows:!1,groups:!1,rowHeaderWidth:null,columnHeaderHeight:null,headerClassName:null,rtlMode:!1,ariaTags:!0}}update(e,n){return n===void 0?He(e,(r,i)=>{this.settings[i]=r}):this.settings[e]=n,this}getSetting(e,n,r,i,o){return typeof this.settings[e]=="function"?this.settings[e](n,r,i,o):n!==void 0&&Array.isArray(this.settings[e])?this.settings[e][n]:this.settings[e]}getSettingPure(e){return this.settings[e]}has(e){return!!this.settings[e]}}class ZR extends Xu{constructor(e,n,r,i){super(e,n,r,i,"master")}alignOverlaysWithTrimmingContainer(){const e=jh(this.wtRootElement),{rootWindow:n}=this.domBindings;if(e===n)this.wtSettings.getSetting("preventOverflow")||(this.holder.style.overflow="visible",this.wtRootElement.style.overflow="visible");else{const r=e.parentElement,i=Kg(e,"height",n),o=Kg(e,"overflow",n),s=this.holder.style,{scrollWidth:a,scrollHeight:l}=e;let u=e.offsetWidth,c=e.offsetHeight;if(r&&["auto","hidden","scroll"].includes(o)){const d=e.cloneNode(!1);d.style.overflow="auto",d.style.position="absolute",e.nextElementSibling?r.insertBefore(d,e.nextElementSibling):r.appendChild(d);const f=parseInt(n.getComputedStyle(d).height,10);r.removeChild(d),f===0&&(c=0)}c=Math.min(c,l),s.height=i==="auto"?"auto":`${c}px`,u=Math.min(u,a),s.width=`${u}px`,s.overflow="",this.hasTableHeight=s.height==="auto"?!0:c>0,this.hasTableWidth=u>0}this.isTableVisible=Au(this.TABLE)}markOversizedColumnHeaders(){const{wtSettings:e}=this,{wtViewport:n}=this.dataAccessObject,r="master",o=e.getSetting("columnHeaders").length;if(o&&!n.hasOversizedColumnHeadersMarked[r]){const a=e.getSetting("rowHeaders").length,l=this.getRenderedColumnsCount();for(let u=0;u<o;u++)for(let c=-1*a;c<l;c++)this.markIfOversizedColumnHeader(c);n.hasOversizedColumnHeadersMarked[r]=!0}}}ut(ZR,BR);ut(ZR,up);class uq{constructor(e,n,r,i,o){this.dataAccessObject=e,this.wot=e.wot,this.instance=this.wot,this.domBindings=n,this.wtSettings=r,this.wtTable=o,this.oversizedRows=[],this.oversizedColumnHeaders=[],this.hasOversizedColumnHeadersMarked={},this.clientHeight=0,this.rowHeaderWidth=NaN,this.rowsVisibleCalculator=null,this.columnsVisibleCalculator=null,this.rowsCalculatorTypes=new Map([["rendered",()=>this.wtSettings.getSetting("renderAllRows")?new WY:new GY],["fullyVisible",()=>new xY],["partiallyVisible",()=>new nD]]),this.columnsCalculatorTypes=new Map([["rendered",()=>this.wtSettings.getSetting("renderAllColumns")?new $Y:new UY],["fullyVisible",()=>new IY],["partiallyVisible",()=>new tD]]),this.eventManager=i,this.eventManager.addEventListener(this.domBindings.rootWindow,"resize",()=>{this.clientHeight=this.getWorkspaceHeight()})}getWorkspaceHeight(){const e=this.domBindings.rootDocument,n=this.dataAccessObject.topOverlayTrimmingContainer;let r=0;return n===this.domBindings.rootWindow?r=e.documentElement.clientHeight:r=nn(n)>0&&n.clientHeight>0?n.clientHeight:1/0,r}getViewportHeight(){let e=this.getWorkspaceHeight();if(e===1/0)return e;const n=this.getColumnHeaderHeight();return n>0&&(e-=n),e}getWorkspaceWidth(){const{rootDocument:e,rootWindow:n}=this.domBindings,r=this.dataAccessObject.inlineStartOverlayTrimmingContainer;let i;if(r===n){const o=this.wtSettings.getSetting("totalColumns");i=this.wtTable.holder.offsetWidth,this.getRowHeaderWidth()+this.sumColumnWidths(0,o)>i&&(i=e.documentElement.clientWidth)}else i=r.clientWidth;return i}getViewportWidth(){const e=this.getWorkspaceWidth();if(e===1/0)return e;const n=this.getRowHeaderWidth();return n>0?e-n:e}hasVerticalScroll(){if(this.isVerticallyScrollableByWindow()){const o=this.domBindings.rootDocument.documentElement;return o.scrollHeight>o.clientHeight}const{holder:e,hider:n}=this.wtTable,r=e.clientHeight,i=n.offsetHeight;return r<i?!0:i>this.getWorkspaceHeight()}hasHorizontalScroll(){if(this.isVerticallyScrollableByWindow()){const o=this.domBindings.rootDocument.documentElement;return o.scrollWidth>o.clientWidth}const{holder:e,hider:n}=this.wtTable,r=e.clientWidth,i=n.offsetWidth;return r<i?!0:i>this.getWorkspaceWidth()}isVerticallyScrollableByWindow(){return this.dataAccessObject.topOverlayTrimmingContainer===this.domBindings.rootWindow}isHorizontallyScrollableByWindow(){return this.dataAccessObject.inlineStartOverlayTrimmingContainer===this.domBindings.rootWindow}sumColumnWidths(e,n){let r=0,i=e;for(;i<n;)r+=this.wtTable.getColumnWidth(i),i+=1;return r}getWorkspaceOffset(){return An(this.wtTable.holder)}getColumnHeaderHeight(){return this.wtSettings.getSetting("columnHeaders").length?isNaN(this.columnHeaderHeight)&&(this.columnHeaderHeight=nn(this.wtTable.THEAD)):this.columnHeaderHeight=0,this.columnHeaderHeight}getRowHeaderWidth(){const e=this.wtSettings.getSetting("rowHeaderWidth"),n=this.wtSettings.getSetting("rowHeaders");if(e){this.rowHeaderWidth=0;for(let r=0,i=n.length;r<i;r++)this.rowHeaderWidth+=e[r]||e}if(isNaN(this.rowHeaderWidth))if(n.length){let r=this.wtTable.TABLE.querySelector("TH");this.rowHeaderWidth=0;for(let i=0,o=n.length;i<o;i++)r?(this.rowHeaderWidth+=qt(r),r=r.nextSibling):this.rowHeaderWidth+=50}else this.rowHeaderWidth=0;return this.rowHeaderWidth=this.wtSettings.getSetting("onModifyRowHeaderWidth",this.rowHeaderWidth)||this.rowHeaderWidth,this.rowHeaderWidth}createRowsCalculator(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["rendered","fullyVisible","partiallyVisible"];const{wtSettings:n,wtTable:r}=this;let i=this.getViewportHeight(),o,s;this.rowHeaderWidth=NaN;let a=this.dataAccessObject.topScrollPosition-this.dataAccessObject.topParentOffset;const l=n.getSetting("fixedRowsTop"),u=n.getSetting("fixedRowsBottom"),c=n.getSetting("totalRows");return l&&a>=0&&(s=this.dataAccessObject.topOverlay.sumCellSizes(0,l),a+=s,i-=s),u&&this.dataAccessObject.bottomOverlay.clone&&(s=this.dataAccessObject.bottomOverlay.sumCellSizes(c-u,c),i-=s),r.holder.clientHeight===r.holder.offsetHeight?o=0:o=vn(this.domBindings.rootDocument),new tG({calculationTypes:e.map(h=>[h,this.rowsCalculatorTypes.get(h)()]),viewportHeight:i,scrollOffset:a,totalRows:n.getSetting("totalRows"),defaultRowHeight:this.instance.stylesHandler.getDefaultRowHeight(),rowHeightFn:h=>r.getRowHeight(h),overrideFn:n.getSettingPure("viewportRowCalculatorOverride"),horizontalScrollbarHeight:o})}createColumnsCalculator(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["rendered","fullyVisible","partiallyVisible"];const{wtSettings:n,wtTable:r}=this;let i=this.getViewportWidth(),o=Math.abs(this.dataAccessObject.inlineStartScrollPosition)-this.dataAccessObject.inlineStartParentOffset;this.columnHeaderHeight=NaN;const s=n.getSetting("fixedColumnsStart");if(s&&o>=0){const a=this.dataAccessObject.inlineStartOverlay.sumCellSizes(0,s);o+=a,i-=a}return r.holder.clientWidth!==r.holder.offsetWidth&&(i-=vn(this.domBindings.rootDocument)),new QY({calculationTypes:e.map(a=>[a,this.columnsCalculatorTypes.get(a)()]),viewportWidth:i,scrollOffset:o,totalColumns:n.getSetting("totalColumns"),columnWidthFn:a=>r.getColumnWidth(a),overrideFn:n.getSettingPure("viewportColumnCalculatorOverride"),inlineStartOffset:this.dataAccessObject.inlineStartParentOffset})}createCalculators(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const{wtSettings:n}=this,r=this.createRowsCalculator(),i=this.createColumnsCalculator();if(e&&!n.getSetting("renderAllRows")){const o=r.getResultsFor("fullyVisible");e=this.areAllProposedVisibleRowsAlreadyRendered(o)}if(e&&!n.getSetting("renderAllColumns")){const o=i.getResultsFor("fullyVisible");e=this.areAllProposedVisibleColumnsAlreadyRendered(o)}return e||(this.rowsRenderCalculator=r.getResultsFor("rendered"),this.columnsRenderCalculator=i.getResultsFor("rendered")),this.rowsVisibleCalculator=r.getResultsFor("fullyVisible"),this.columnsVisibleCalculator=i.getResultsFor("fullyVisible"),this.rowsPartiallyVisibleCalculator=r.getResultsFor("partiallyVisible"),this.columnsPartiallyVisibleCalculator=i.getResultsFor("partiallyVisible"),e}createVisibleCalculators(){const e=this.createRowsCalculator(["fullyVisible","partiallyVisible"]),n=this.createColumnsCalculator(["fullyVisible","partiallyVisible"]);this.rowsVisibleCalculator=e.getResultsFor("fullyVisible"),this.columnsVisibleCalculator=n.getResultsFor("fullyVisible"),this.rowsPartiallyVisibleCalculator=e.getResultsFor("partiallyVisible"),this.columnsPartiallyVisibleCalculator=n.getResultsFor("partiallyVisible")}areAllProposedVisibleRowsAlreadyRendered(e){if(!this.rowsVisibleCalculator)return!1;let{startRow:n,endRow:r}=e;if(n===null&&r===null){if(!e.isVisibleInTrimmingContainer)return!0;n=this.rowsPartiallyVisibleCalculator.startRow,r=this.rowsPartiallyVisibleCalculator.endRow}const{startRow:i,endRow:o,rowStartOffset:s,rowEndOffset:a}=this.rowsRenderCalculator,l=this.wtSettings.getSetting("totalRows")-1,u=this.wtSettings.getSetting("viewportRowRenderingThreshold");return Number.isInteger(u)&&u>0?(n=Math.max(0,n-Math.min(s,u)),r=Math.min(l,r+Math.min(a,u))):u==="auto"&&(n=Math.max(0,n-Math.ceil(s/2)),r=Math.min(l,r+Math.ceil(a/2))),n<i||n===i&&n>0?!1:!(r>o||r===o&&r<l)}areAllProposedVisibleColumnsAlreadyRendered(e){if(!this.columnsVisibleCalculator)return!1;let{startColumn:n,endColumn:r}=e;if(n===null&&r===null){if(!e.isVisibleInTrimmingContainer)return!0;n=this.columnsPartiallyVisibleCalculator.startColumn,r=this.columnsPartiallyVisibleCalculator.endColumn}const{startColumn:i,endColumn:o,columnStartOffset:s,columnEndOffset:a}=this.columnsRenderCalculator,l=this.wtSettings.getSetting("totalColumns")-1,u=this.wtSettings.getSetting("viewportColumnRenderingThreshold");return Number.isInteger(u)&&u>0?(n=Math.max(0,n-Math.min(s,u)),r=Math.min(l,r+Math.min(a,u))):u==="auto"&&(n=Math.max(0,n-Math.ceil(s/2)),r=Math.min(l,r+Math.ceil(a/2))),n<i||n===i&&n>0?!1:!(r>o||r===o&&r<l)}resetHasOversizedColumnHeadersMarked(){He(this.hasOversizedColumnHeadersMarked,(e,n,r)=>{r[n]=void 0})}}function cq(t,e){pD(t,e),e.add(t)}function aa(t,e,n){pD(t,e),e.set(t,n)}function pD(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Rt(t,e){return t.get(vi(t,e))}function wi(t,e,n){return t.set(vi(t,e),n),n}function vi(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const LO=23;var qi=new WeakMap,Wo=new WeakMap,QR=new WeakMap,oS=new WeakMap,Es=new WeakMap,ch=new WeakMap,zh=new WeakMap,Zi=new WeakSet;class hq{constructor(e){cq(this,Zi),aa(this,qi,void 0),aa(this,Wo,void 0),aa(this,QR,void 0),aa(this,oS,void 0),aa(this,Es,!0),aa(this,ch,{}),aa(this,zh,{}),wi(Wo,this,e.rootTable.parentElement.parentElement),wi(oS,this,e.rootDocument)}isClassicTheme(){return Rt(Es,this)}getCSSVariableValue(e){var n;if(Rt(Es,this))return null;if(Rt(ch,this)[`--ht-${e}`])return Rt(ch,this)[`--ht-${e}`];const r=(n=vi(Zi,this,mq).call(this,`--ht-${e}`))!==null&&n!==void 0?n:vi(Zi,this,wD).call(this,`--ht-${e}`);if(r!==null)return Rt(ch,this)[`--ht-${e}`]=r,r}getStyleForTD(e){var n;return(n=Rt(zh,this))===null||n===void 0?void 0:n.td[e]}getDefaultRowHeight(){if(Rt(Es,this))return LO;const e=vi(Zi,this,dq).call(this);return!e&&ve(Rt(Wo,this),"ht-wrapper")?(Ze(`The "${Rt(qi,this)}" theme is enabled, but its stylesheets are missing or not imported correctly. Import the correct CSS files in order to use that theme.`),wi(Es,this,!0),this.useTheme(),LO):e}areCellsBorderBox(){return this.getStyleForTD("box-sizing")==="border-box"}useTheme(e){if(!e){vi(Zi,this,$O).call(this),wi(Es,this,!0),wi(qi,this,e||void 0);return}e&&e!==Rt(qi,this)&&(Rt(qi,this)&&vi(Zi,this,pq).call(this),wi(qi,this,e),wi(Es,this,!1),vi(Zi,this,fq).call(this),vi(Zi,this,$O).call(this))}getThemeName(){return Rt(qi,this)}removeClassNames(){ve(Rt(Wo,this),Rt(qi,this))&&pe(Rt(Wo,this),Rt(qi,this))}}function dq(){const t=this.getCSSVariableValue("line-height"),e=this.getCSSVariableValue("cell-vertical-padding"),n=Math.ceil(parseFloat(this.getStyleForTD("border-bottom-width")));return t===null||e===null||isNaN(n)?null:t+2*e+n}function fq(){pe(Rt(Wo,this),/ht-theme-.*/g),G(Rt(Wo,this),Rt(qi,this))}function $O(){this.isClassicTheme()||wi(QR,this,getComputedStyle(Rt(Wo,this)));const t=vi(Zi,this,gq).call(this,["box-sizing","border-bottom-width"]);Rt(zh,this).td={...Rt(zh,this).td,"box-sizing":t["box-sizing"],"border-bottom-width":t["border-bottom-width"]}}function gq(t){const e=Rt(oS,this),n=Rt(Wo,this),r=e.createElement("table"),i=e.createElement("tbody"),o=e.createElement("tr"),s=e.createElement("tr"),a=e.createElement("td");s.appendChild(a),i.appendChild(o),i.appendChild(s),r.appendChild(i),n.appendChild(r);const l=getComputedStyle(a),u={};return t.forEach(c=>{u[c]=l.getPropertyValue(c)}),n.removeChild(r),u}function mq(t){const e=Math.ceil(parseFloat(vi(Zi,this,wD).call(this,t)));return Number.isNaN(e)?null:e}function wD(t){const e=Rt(QR,this).getPropertyValue(t);return e===""?null:e}function pq(){wi(zh,this,{}),wi(ch,this,{}),wi(Es,this,!0)}class wq extends VR{constructor(e,n){super(e,new lq(n)),this.stylesHandler=new hq(this.domBindings);const r=this.wtSettings.getSetting("facade",this);this.wtTable=new ZR(this.getTableDao(),r,this.domBindings,this.wtSettings),this.wtViewport=new uq(this.getViewportDao(),this.domBindings,this.wtSettings,this.eventManager,this.wtTable),this.selectionManager=new z2(this.wtSettings.getSetting("selections")),this.wtEvent=new aD(r,this.domBindings,this.wtSettings,this.eventManager,this.wtTable,this.selectionManager),this.wtOverlays=new oq(this,r,this.domBindings,this.wtSettings,this.eventManager,this.wtTable),this.exportSettingsAsClassNames(),this.findOriginalHeaders()}exportSettingsAsClassNames(){const e={rowHeaders:"htRowHeaders",columnHeaders:"htColumnHeaders"},n=[],r=[];He(e,(i,o)=>{this.wtSettings.getSetting(o).length&&r.push(i),n.push(i)}),pe(this.wtTable.wtRootElement.parentNode,n),G(this.wtTable.wtRootElement.parentNode,r)}getOverlayByName(e){var n;if(!cD.includes(e))return null;const r=e.replace(/_([a-z])/g,i=>i[1].toUpperCase());return(n=this.wtOverlays[`${r}Overlay`])!==null&&n!==void 0?n:null}getViewportDao(){const e=this;return{get wot(){return e},get topOverlayTrimmingContainer(){return e.wtOverlays.topOverlay.trimmingContainer},get inlineStartOverlayTrimmingContainer(){return e.wtOverlays.inlineStartOverlay.trimmingContainer},get topScrollPosition(){return e.wtOverlays.topOverlay.getScrollPosition()},get topParentOffset(){return e.wtOverlays.topOverlay.getTableParentOffset()},get inlineStartScrollPosition(){return e.wtOverlays.inlineStartOverlay.getScrollPosition()},get inlineStartParentOffset(){return e.wtOverlays.inlineStartOverlay.getTableParentOffset()},get topOverlay(){return e.wtOverlays.topOverlay},get inlineStartOverlay(){return e.wtOverlays.inlineStartOverlay},get bottomOverlay(){return e.wtOverlays.bottomOverlay}}}}class JR{constructor(e){e instanceof VR?this._wot=e:this._initFromSettings(e)}_initFromSettings(e){e.facade=n=>{const r=new JR(n);return()=>r},this._wot=new wq(e.table,e)}get guid(){return this._wot.guid}get rootDocument(){return this._wot.domBindings.rootDocument}get rootWindow(){return this._wot.domBindings.rootWindow}get wtSettings(){return this._wot.wtSettings}get cloneSource(){return this._wot.cloneSource}get cloneOverlay(){return this._wot.cloneOverlay}get selectionManager(){return this._wot.selectionManager}get wtViewport(){return this._wot.wtViewport}get wtOverlays(){return this._wot.wtOverlays}get wtTable(){return this._wot.wtTable}get wtEvent(){return this._wot.wtEvent}get wtScroll(){return this._wot.wtScroll}get drawn(){return this._wot.drawn}set drawn(e){this._wot.drawn=e}get activeOverlayName(){return this._wot.activeOverlayName}get drawInterrupted(){return this._wot.drawInterrupted}set drawInterrupted(e){this._wot.drawInterrupted=e}get lastMouseOver(){return this._wot.lastMouseOver}set lastMouseOver(e){this._wot.lastMouseOver=e}get momentumScrolling(){return this._wot.momentumScrolling}set momentumScrolling(e){this._wot.momentumScrolling=e}get touchApplied(){return this._wot.touchApplied}set touchApplied(e){this._wot.touchApplied=e}get domBindings(){return this._wot.domBindings}get eventListeners(){return this._wot.eventListeners}set eventListeners(e){this._wot.eventListeners=e}get eventManager(){return this._wot.eventManager}get stylesHandler(){return this._wot.stylesHandler}createCellCoords(e,n){return this._wot.createCellCoords(e,n)}createCellRange(e,n,r){return this._wot.createCellRange(e,n,r)}draw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return this._wot.draw(e),this}getCell(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return this._wot.getCell(e,n)}scrollViewport(e,n,r){return this._wot.scrollViewport(e,n,r)}scrollViewportHorizontally(e,n){return this._wot.scrollViewportHorizontally(e,n)}scrollViewportVertically(e,n){return this._wot.scrollViewportVertically(e,n)}getViewport(){return this._wot.getViewport()}getOverlayName(){return this._wot.cloneOverlay?this._wot.cloneOverlay.type:"master"}getOverlayByName(e){return this._wot.getOverlayByName(e)}exportSettingsAsClassNames(){return this._wot.exportSettingsAsClassNames()}update(e,n){return this._wot.wtSettings.update(e,n),this}getSetting(e,n,r,i,o){return this._wot.wtSettings.getSetting(e,n,r,i,o)}hasSetting(e){return this._wot.wtSettings.hasSetting(e)}destroy(){this._wot.destroy()}}function FO(t){let{isShiftKey:e,isLeftClick:n,isRightClick:r,coords:i,selection:o,controller:s,cellCoordsFactory:a}=t;const l=o.isSelected()?o.getSelectedRange().current():null,u=o.isSelectedByCorner(),c=o.isSelectedByRowHeader();if(o.markSource("mouse"),e&&l)i.row>=0&&i.col>=0&&!s.cell?o.setRangeEnd(i):(u||c)&&i.row>=0&&i.col>=0&&!s.cell?o.setRangeEnd(a(i.row,i.col)):u&&i.row<0&&!s.column?o.setRangeEnd(a(l.to.row,i.col)):c&&i.col<0&&!s.row?o.setRangeEnd(a(i.row,l.to.col)):(!u&&!c&&i.col<0||u&&i.col<0)&&!s.row?o.selectRows(Math.max(l.from.row,0),i.row,i.col):(!u&&!c&&i.row<0||c&&i.row<0)&&!s.column&&o.selectColumns(Math.max(l.from.col,0),i.col,i.row);else{const h=!o.inInSelection(i),d=n||r&&h;i.row<0&&i.col>=0&&!s.column?d&&o.selectColumns(i.col,i.col,i.row):i.col<0&&i.row>=0&&!s.row?d&&o.selectRows(i.row,i.row,i.col):i.col>=0&&i.row>=0&&!s.cell?d&&o.setRangeStart(i):i.col<0&&i.row<0&&o.selectAll(!0,!0,{disableHeadersHighlight:!0,focusPosition:{row:0,col:0}})}o.markEndSource()}function vq(t){let{isLeftClick:e,coords:n,selection:r,controller:i,cellCoordsFactory:o}=t;if(!e)return;const s=r.isSelectedByRowHeader(),a=r.isSelectedByColumnHeader(),l=r.tableProps.countCols(),u=r.tableProps.countRows();r.markSource("mouse"),a&&!i.column?r.setRangeEnd(o(u-1,n.col)):s&&!i.row?r.setRangeEnd(o(n.row,l-1)):i.cell||r.setRangeEnd(n),r.markEndSource()}const Cq=new Map([["mousedown",FO],["mouseover",vq],["touchstart",FO]]);function VO(t,e){let{coords:n,selection:r,controller:i,cellCoordsFactory:o}=e;Cq.get(t.type)({coords:n,selection:r,controller:i,cellCoordsFactory:o,isShiftKey:t.shiftKey,isLeftClick:HR(t)||t.type==="touchstart",isRightClick:sl(t)})}const vD=new WeakMap,eE=Symbol("rootInstance");function yq(t){vD.set(t,!0)}function bq(t){return t===eE}function _g(t){return vD.has(t)}function Sq(t,e){CD(t,e),e.add(t)}function cs(t,e,n){CD(t,e),e.set(t,n)}function CD(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function hs(t,e,n){return(e=Rq(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Rq(t){var e=Eq(t,"string");return typeof e=="symbol"?e:e+""}function Eq(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Yt(t,e){return t.get(Mu(t,e))}function Zn(t,e,n){return t.set(Mu(t,e),n),n}function Mu(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var jC=new WeakMap,Qd=new WeakMap,Jd=new WeakMap,So=new WeakMap,ii=new WeakMap,UC=new WeakMap,zC=new WeakMap,Hl=new WeakMap,hh=new WeakSet;class Tq{constructor(e){Sq(this,hh),hs(this,"hot",void 0),hs(this,"eventManager",void 0),hs(this,"settings",void 0),hs(this,"THEAD",void 0),hs(this,"TBODY",void 0),hs(this,"_wt",void 0),hs(this,"activeWt",void 0),cs(this,jC,0),cs(this,Qd,0),hs(this,"postponedAdjustElementsSize",!1),cs(this,Jd,!1),cs(this,So,void 0),cs(this,ii,void 0),cs(this,UC,0),cs(this,zC,0),cs(this,Hl,null),this.hot=e,this.eventManager=new _i(this.hot),this.settings=this.hot.getSettings(),this.createElements(),this.registerEvents(),this.initializeWalkontable()}render(){if(!this.hot.isRenderSuspended()){const e=this.hot.forceFullRender;this.hot.runHooks("beforeRender",e),this.postponedAdjustElementsSize&&(this.postponedAdjustElementsSize=!1,this.adjustElementsSize()),this._wt.draw(!e),Mu(hh,this,Mq).call(this),this.hot.runHooks("afterRender",e),this.hot.forceFullRender=!1}}adjustElementsSize(){this.hot.isRenderSuspended()?this.postponedAdjustElementsSize=!0:this._wt.wtOverlays.adjustElementsSize()}getCellAtCoords(e,n){const r=this._wt.getCell(e,n);return r<0?null:r}scrollViewport(e,n,r){return this._wt.scrollViewport(e,n,r)}scrollViewportHorizontally(e,n){return this._wt.scrollViewportHorizontally(e,n)}scrollViewportVertically(e,n){return this._wt.scrollViewportVertically(e,n)}createElements(){const{rootElement:e,rootDocument:n}=this.hot,r=e.getAttribute("style");r&&e.setAttribute("data-originalstyle",r),G(e,"handsontable"),Zn(ii,this,n.createElement("TABLE")),G(Yt(ii,this),"htCore"),this.hot.getSettings().tableClassName&&G(Yt(ii,this),this.hot.getSettings().tableClassName),this.settings.ariaTags&&(ye(Yt(ii,this),[Uo()]),ye(e,[EU(),bN(-1),tp(this.hot.countCols()),$U()])),this.THEAD=n.createElement("THEAD"),Yt(ii,this).appendChild(this.THEAD),this.TBODY=n.createElement("TBODY"),Yt(ii,this).appendChild(this.TBODY),this.hot.table=Yt(ii,this),this.hot.container.insertBefore(Yt(ii,this),this.hot.container.firstChild)}registerEvents(){const{rootElement:e,rootDocument:n,selection:r,rootWindow:i}=this.hot,o=n.documentElement;this.eventManager.addEventListener(e,"mousedown",a=>{Zn(Jd,this,!0),this.isTextSelectionAllowed(a.target)||(RP(i),a.preventDefault(),i.focus())}),this.eventManager.addEventListener(e,"mouseup",()=>{Zn(Jd,this,!1)}),this.eventManager.addEventListener(e,"mousemove",a=>{Yt(Jd,this)&&!this.isTextSelectionAllowed(a.target)&&(this.settings.fragmentSelection&&RP(i),a.preventDefault())}),this.eventManager.addEventListener(o,"keyup",a=>{r.isInProgress()&&!a.shiftKey&&r.finish()}),this.eventManager.addEventListener(o,"mouseup",a=>{r.isInProgress()&&HR(a)&&r.finish(),Zn(So,this,!1);const l=HN(n.activeElement);Tg(n.activeElement)&&!l||(l||!r.isSelected()&&!r.isSelectedByAnyHeader()&&!e.contains(a.target)&&!sl(a))&&this.hot.unlisten()}),this.eventManager.addEventListener(o,"contextmenu",a=>{r.isInProgress()&&sl(a)&&(r.finish(),Zn(So,this,!1))}),this.eventManager.addEventListener(o,"touchend",()=>{r.isInProgress()&&r.finish(),Zn(So,this,!1)}),this.eventManager.addEventListener(o,"mousedown",a=>{const l=a.target,u=a.x||a.clientX,c=a.y||a.clientY;let h=a.target;if(Yt(So,this)||!e||!this.hot.view)return;const{holder:d}=this._wt.wtTable;if(h===d){const g=vn(n);if(n.elementFromPoint(u+g,c)!==d||n.elementFromPoint(u,c+g)!==d)return}else for(;h!==o;){if(h===null){if(a.isTargetWebComponent)break;return}if(h===e)return;h=h.parentNode}(typeof this.settings.outsideClickDeselects=="function"?this.settings.outsideClickDeselects(l):this.settings.outsideClickDeselects)?this.hot.deselectCell():this.hot.destroyEditor(!1,!1)});let s=xu(i);for(;s!==null;)this.eventManager.addEventListener(s.document.documentElement,"click",()=>{this.hot.unlisten()}),s=xu(s);this.eventManager.addEventListener(Yt(ii,this),"selectstart",a=>{this.settings.fragmentSelection||Tg(a.target)||a.preventDefault()})}translateFromRenderableToVisualCoords(e){let{row:n,col:r}=e;return this.hot._createCellCoords(...this.translateFromRenderableToVisualIndex(n,r))}translateFromRenderableToVisualIndex(e,n){let r=e>=0?this.hot.rowIndexMapper.getVisualFromRenderableIndex(e):e,i=n>=0?this.hot.columnIndexMapper.getVisualFromRenderableIndex(n):n;return r===null&&(r=e),i===null&&(i=n),[r,i]}countRenderableIndexes(e,n){const r=Math.min(e.getNotTrimmedIndexesLength(),n),i=e.getNearestNotHiddenIndex(r-1,-1);return i===null?0:e.getRenderableFromVisualIndex(i)+1}countRenderableColumns(){return this.countRenderableIndexes(this.hot.columnIndexMapper,this.settings.maxCols)}countRenderableRows(){return this.countRenderableIndexes(this.hot.rowIndexMapper,this.settings.maxRows)}countNotHiddenRowIndexes(e,n){return this.countNotHiddenIndexes(e,n,this.hot.rowIndexMapper,this.countRenderableRows())}countNotHiddenColumnIndexes(e,n){return this.countNotHiddenIndexes(e,n,this.hot.columnIndexMapper,this.countRenderableColumns())}countNotHiddenIndexes(e,n,r,i){if(isNaN(e)||e<0)return 0;const o=r.getNearestNotHiddenIndex(e,n),s=r.getRenderableFromVisualIndex(o);if(!Number.isInteger(s))return 0;let a=0;return n<0?a=s+1:n>0&&(a=i-s),a}countNotHiddenFixedColumnsStart(){const e=this.hot.countCols(),n=Math.min(parseInt(this.settings.fixedColumnsStart,10),e)-1;return this.countNotHiddenColumnIndexes(n,-1)}countNotHiddenFixedRowsTop(){const e=this.hot.countRows(),n=Math.min(parseInt(this.settings.fixedRowsTop,10),e)-1;return this.countNotHiddenRowIndexes(n,-1)}countNotHiddenFixedRowsBottom(){const e=this.hot.countRows(),n=Math.max(e-parseInt(this.settings.fixedRowsBottom,10),0);return this.countNotHiddenRowIndexes(n,1)}countRenderableColumnsInRange(e,n){let r=0;for(let i=e;i<=n;i++)this.hot.columnIndexMapper.getRenderableFromVisualIndex(i)!==null&&(r+=1);return r}countRenderableRowsInRange(e,n){let r=0;for(let i=e;i<=n;i++)this.hot.rowIndexMapper.getRenderableFromVisualIndex(i)!==null&&(r+=1);return r}getStylesHandler(){return this._wt.stylesHandler}getDefaultRowHeight(){return this._wt.stylesHandler.getDefaultRowHeight()}addClassNameToLicenseElement(e){var n;const r=(n=this.hot.rootElement.parentNode)===null||n===void 0?void 0:n.querySelector(".hot-display-license-info");r&&G(r,e)}removeClassNameFromLicenseElement(e){var n;const r=(n=this.hot.rootElement.parentNode)===null||n===void 0?void 0:n.querySelector(".hot-display-license-info");r&&pe(r,e)}isMainTableNotFullyCoveredByOverlays(){const e=this.countNotHiddenFixedRowsTop()+this.countNotHiddenFixedRowsBottom(),n=this.countNotHiddenFixedColumnsStart();return this.hot.countRenderedRows()>e&&this.hot.countRenderedCols()>n}initializeWalkontable(){const e={ariaTags:this.settings.ariaTags,rtlMode:this.hot.isRtl(),externalRowCalculator:this.hot.getPlugin("autoRowSize")&&this.hot.getPlugin("autoRowSize").isEnabled(),table:Yt(ii,this),isDataViewInstance:()=>_g(this.hot),preventOverflow:()=>this.settings.preventOverflow,preventWheel:()=>this.settings.preventWheel,viewportColumnRenderingThreshold:()=>this.settings.viewportColumnRenderingThreshold,viewportRowRenderingThreshold:()=>this.settings.viewportRowRenderingThreshold,data:(o,s)=>this.hot.getDataAtCell(...this.translateFromRenderableToVisualIndex(o,s)),totalRows:()=>this.countRenderableRows(),totalColumns:()=>this.countRenderableColumns(),fixedColumnsStart:()=>this.countNotHiddenFixedColumnsStart(),fixedRowsTop:()=>this.countNotHiddenFixedRowsTop(),fixedRowsBottom:()=>this.countNotHiddenFixedRowsBottom(),shouldRenderInlineStartOverlay:()=>this.settings.fixedColumnsStart>0||e.rowHeaders().length>0,shouldRenderTopOverlay:()=>this.settings.fixedRowsTop>0||e.columnHeaders().length>0,shouldRenderBottomOverlay:()=>this.settings.fixedRowsBottom>0,minSpareRows:()=>this.settings.minSpareRows,renderAllRows:this.settings.renderAllRows,renderAllColumns:this.settings.renderAllColumns,rowHeaders:()=>{const o=[];return this.hot.hasRowHeaders()&&o.push((s,a)=>{const l=s>=0?this.hot.rowIndexMapper.getVisualFromRenderableIndex(s):s;this.appendRowHeader(l,a)}),this.hot.runHooks("afterGetRowHeaderRenderers",o),Zn(Qd,this,o.length),this.hot.getSettings().ariaTags&&Mu(hh,this,yD).call(this)===this.hot.countCols()&&Mu(hh,this,_q).call(this,Yt(Qd,this)),o},columnHeaders:()=>{const o=[];return this.hot.hasColHeaders()&&o.push((s,a)=>{const l=s>=0?this.hot.columnIndexMapper.getVisualFromRenderableIndex(s):s;this.appendColHeader(l,a)}),this.hot.runHooks("afterGetColumnHeaderRenderers",o),Zn(jC,this,o.length),o},columnWidth:o=>{const s=this.hot.columnIndexMapper.getVisualFromRenderableIndex(o);return this.hot.getColWidth(s===null?o:s)},rowHeight:o=>{const s=this.hot.rowIndexMapper.getVisualFromRenderableIndex(o);return this.hot.getRowHeight(s===null?o:s)},rowHeightByOverlayName:(o,s)=>{const a=this.hot.rowIndexMapper.getVisualFromRenderableIndex(o),l=a===null?o:a;return this.hot.runHooks("modifyRowHeightByOverlayName",this.hot.getRowHeight(l),l,s)},cellRenderer:(o,s,a)=>{const[l,u]=this.translateFromRenderableToVisualIndex(o,s),c=this.hot.runHooks("modifyGetCellCoords",l,u,!1,"meta");let h=l,d=u;Array.isArray(c)&&([h,d]=c);const f=this.hot.getCellMeta(h,d),g=this.hot.colToProp(d);let C=this.hot.getDataAtRowProp(h,g);this.hot.hasHook("beforeValueRender")&&(C=this.hot.runHooks("beforeValueRender",C,f)),this.hot.runHooks("beforeRenderer",a,l,u,g,C,f),this.hot.getCellRenderer(f)(this.hot,a,l,u,g,C,f),this.hot.runHooks("afterRenderer",a,l,u,g,C,f)},selections:this.hot.selection.highlight,hideBorderOnMouseDownOver:()=>this.settings.fragmentSelection,onWindowResize:()=>{this.hot&&!this.hot.isDestroyed&&this.hot.refreshDimensions()},onContainerElementResize:()=>{this.hot&&!this.hot.isDestroyed&&Au(this.hot.rootElement)&&this.hot.refreshDimensions()},onCellMouseDown:(o,s,a,l)=>{const u=this.translateFromRenderableToVisualCoords(s),c={row:!1,column:!1,cell:!1};this.hot.listen(),this.activeWt=l,Zn(So,this,!0),Zn(Hl,this,{x:o.clientX,y:o.clientY}),this.hot.runHooks("beforeOnCellMouseDown",o,u,a,c),!za(o)&&(VO(o,{coords:u,selection:this.hot.selection,controller:c,cellCoordsFactory:(h,d)=>this.hot._createCellCoords(h,d)}),this.hot.runHooks("afterOnCellMouseDown",o,u,a),this.activeWt=this._wt)},onCellContextMenu:(o,s,a,l)=>{const u=this.translateFromRenderableToVisualCoords(s);this.activeWt=l,Zn(So,this,!1),this.hot.selection.isInProgress()&&this.hot.selection.finish(),this.hot.runHooks("beforeOnCellContextMenu",o,u,a),!za(o)&&(this.hot.runHooks("afterOnCellContextMenu",o,u,a),this.activeWt=this._wt)},onCellMouseOut:(o,s,a,l)=>{const u=this.translateFromRenderableToVisualCoords(s);this.activeWt=l,this.hot.runHooks("beforeOnCellMouseOut",o,u,a),!za(o)&&(this.hot.runHooks("afterOnCellMouseOut",o,u,a),this.activeWt=this._wt)},onCellMouseOver:(o,s,a,l)=>{const u=this.translateFromRenderableToVisualCoords(s),c={row:!1,column:!1,cell:!1};this.activeWt=l,this.hot.runHooks("beforeOnCellMouseOver",o,u,a,c),!za(o)&&(Yt(So,this)&&(!Yt(Hl,this)||Yt(Hl,this).x!==o.clientX||Yt(Hl,this).y!==o.clientY)&&VO(o,{coords:u,selection:this.hot.selection,controller:c,cellCoordsFactory:(h,d)=>this.hot._createCellCoords(h,d)}),this.hot.runHooks("afterOnCellMouseOver",o,u,a),this.activeWt=this._wt,Zn(Hl,this,null))},onCellMouseUp:(o,s,a,l)=>{const u=this.translateFromRenderableToVisualCoords(s);this.activeWt=l,this.hot.runHooks("beforeOnCellMouseUp",o,u,a),!(za(o)||this.hot.isDestroyed)&&(this.hot.runHooks("afterOnCellMouseUp",o,u,a),this.activeWt=this._wt)},onCellCornerMouseDown:o=>{o.preventDefault(),this.hot.runHooks("afterOnCellCornerMouseDown",o)},onCellCornerDblClick:o=>{o.preventDefault(),this.hot.runHooks("afterOnCellCornerDblClick",o)},beforeDraw:(o,s)=>this.beforeRender(o,s),onDraw:o=>this.afterRender(o),onBeforeViewportScrollVertically:(o,s)=>{const a=this.hot.rowIndexMapper,l=o<0;let u=o;return!l&&(u=a.getVisualFromRenderableIndex(o),u===null)?o:(u=this.hot.runHooks("beforeViewportScrollVertically",u,s),this.hot.runHooks("beforeViewportScroll"),l?u:a.getRenderableFromVisualIndex(u))},onBeforeViewportScrollHorizontally:(o,s)=>{const a=this.hot.columnIndexMapper,l=o<0;let u=o;return!l&&(u=a.getVisualFromRenderableIndex(o),u===null)?o:(u=this.hot.runHooks("beforeViewportScrollHorizontally",u,s),this.hot.runHooks("beforeViewportScroll"),l?u:a.getRenderableFromVisualIndex(u))},onScrollVertically:()=>{this.hot.runHooks("afterScrollVertically"),this.hot.runHooks("afterScroll")},onScrollHorizontally:()=>{this.hot.runHooks("afterScrollHorizontally"),this.hot.runHooks("afterScroll")},onBeforeRemoveCellClassNames:()=>this.hot.runHooks("beforeRemoveCellClassNames"),onBeforeHighlightingRowHeader:(o,s,a)=>{const l=this.hot.rowIndexMapper,u=o<0;let c=o;u||(c=l.getVisualFromRenderableIndex(o));const h=this.hot.runHooks("beforeHighlightingRowHeader",c,s,a);return u?h:l.getRenderableFromVisualIndex(l.getNearestNotHiddenIndex(h,1))},onBeforeHighlightingColumnHeader:(o,s,a)=>{const l=this.hot.columnIndexMapper,u=o<0;let c=o;u||(c=l.getVisualFromRenderableIndex(o));const h=this.hot.runHooks("beforeHighlightingColumnHeader",c,s,a);return u?h:l.getRenderableFromVisualIndex(l.getNearestNotHiddenIndex(h,1))},onAfterDrawSelection:(o,s,a)=>{let l;const[u,c]=this.translateFromRenderableToVisualIndex(o,s),h=this.hot.selection.getSelectedRange();if(h.size()>0){const f=h.peekByIndex(a??0);l=[f.from.row,f.from.col,f.to.row,f.to.col]}return this.hot.runHooks("afterDrawSelection",u,c,l,a)},onBeforeDrawBorders:(o,s)=>{const[a,l,u,c]=o,h=[this.hot.rowIndexMapper.getVisualFromRenderableIndex(a),this.hot.columnIndexMapper.getVisualFromRenderableIndex(l),this.hot.rowIndexMapper.getVisualFromRenderableIndex(u),this.hot.columnIndexMapper.getVisualFromRenderableIndex(c)];return this.hot.runHooks("beforeDrawBorders",h,s)},onBeforeTouchScroll:()=>this.hot.runHooks("beforeTouchScroll"),onAfterMomentumScroll:()=>this.hot.runHooks("afterMomentumScroll"),onModifyRowHeaderWidth:o=>this.hot.runHooks("modifyRowHeaderWidth",o),onModifyGetCellCoords:(o,s,a,l)=>{const u=this.hot.rowIndexMapper,c=this.hot.columnIndexMapper,h=s>=0?c.getVisualFromRenderableIndex(s):s,d=o>=0?u.getVisualFromRenderableIndex(o):o,f=this.hot.runHooks("modifyGetCellCoords",d,h,a,l);if(Array.isArray(f)){const[g,C,y,E]=f;return[g>=0?u.getRenderableFromVisualIndex(u.getNearestNotHiddenIndex(g,1)):g,C>=0?c.getRenderableFromVisualIndex(c.getNearestNotHiddenIndex(C,1)):C,y>=0?u.getRenderableFromVisualIndex(u.getNearestNotHiddenIndex(y,-1)):y,E>=0?c.getRenderableFromVisualIndex(c.getNearestNotHiddenIndex(E,-1)):E]}},onModifyGetCoordsElement:(o,s)=>{const a=this.hot.rowIndexMapper,l=this.hot.columnIndexMapper,u=s>=0?l.getVisualFromRenderableIndex(s):s,c=o>=0?a.getVisualFromRenderableIndex(o):o,h=this.hot.runHooks("modifyGetCoordsElement",c,u);if(Array.isArray(h)){const[d,f]=h;return[d>=0?a.getRenderableFromVisualIndex(a.getNearestNotHiddenIndex(d,1)):d,f>=0?l.getRenderableFromVisualIndex(l.getNearestNotHiddenIndex(f,1)):f]}},viewportRowCalculatorOverride:o=>{let s=this.settings.viewportRowRenderingOffset;if(s==="auto"&&this.settings.fixedRowsTop&&(s=10),s>0||s==="auto"){const a=this.countRenderableRows(),l=o.startRow,u=o.endRow;if(typeof s=="number")o.startRow=Math.max(l-s,0),o.endRow=Math.min(u+s,a-1);else if(s==="auto"){const c=Math.max(1,Math.ceil(u/a*12));o.startRow=Math.max(l-c,0),o.endRow=Math.min(u+c,a-1)}}this.hot.runHooks("afterViewportRowCalculatorOverride",o)},viewportColumnCalculatorOverride:o=>{let s=this.settings.viewportColumnRenderingOffset;if(s==="auto"&&this.settings.fixedColumnsStart&&(s=10),s>0||s==="auto"){const a=this.countRenderableColumns(),l=o.startColumn,u=o.endColumn;if(typeof s=="number"&&(o.startColumn=Math.max(l-s,0),o.endColumn=Math.min(u+s,a-1)),s==="auto"){const c=Math.max(1,Math.ceil(u/a*6));o.startColumn=Math.max(l-c,0),o.endColumn=Math.min(u+c,a-1)}}this.hot.runHooks("afterViewportColumnCalculatorOverride",o)},rowHeaderWidth:()=>this.settings.rowHeaderWidth,columnHeaderHeight:()=>{const o=this.hot.runHooks("modifyColumnHeaderHeight");return this.settings.columnHeaderHeight||o}};this.hot.runHooks("beforeInitWalkontable",e),this._wt=new JR(e),this.activeWt=this._wt;const n=this._wt.wtTable.spreader,{width:r,height:i}=this.hot.rootElement.getBoundingClientRect();this.setLastSize(r,i),this.eventManager.addEventListener(n,"mousedown",o=>{o.target===n&&o.which===3&&o.stopPropagation()}),this.eventManager.addEventListener(n,"contextmenu",o=>{o.target===n&&o.which===3&&o.stopPropagation()}),this.eventManager.addEventListener(this.hot.rootDocument.documentElement,"click",()=>{this.settings.observeDOMVisibility&&this._wt.drawInterrupted&&this.hot.render()})}isTextSelectionAllowed(e){if(Tg(e))return!0;const n=tl(e,this._wt.wtTable.spreader);return!!(this.settings.fragmentSelection===!0&&n||this.settings.fragmentSelection==="cell"&&this.isSelectedOnlyCell()&&n||!this.settings.fragmentSelection&&this.isCellEdited()&&this.isSelectedOnlyCell())}isMouseDown(){return Yt(So,this)}isSelectedOnlyCell(){var e,n;return(e=(n=this.hot.getSelectedRangeLast())===null||n===void 0?void 0:n.isSingleCell())!==null&&e!==void 0?e:!1}isCellEdited(){const e=this.hot.getActiveEditor();return e&&e.isOpened()}beforeRender(e,n){e&&this.hot.runHooks("beforeViewRender",this.hot.forceFullRender,n)}afterRender(e){e&&this.hot.runHooks("afterViewRender",this.hot.forceFullRender)}appendRowHeader(e,n){if(n.firstChild){const r=n.firstChild;if(!ve(r,"relative")){es(n),this.appendRowHeader(e,n);return}this.updateCellHeader(r.querySelector(".rowHeader"),e,this.hot.getRowHeader)}else{const{rootDocument:r,getRowHeader:i}=this.hot,o=r.createElement("div"),s=r.createElement("span");o.className="relative",s.className="rowHeader",this.updateCellHeader(s,e,i),o.appendChild(s),n.appendChild(o)}this.hot.runHooks("afterGetRowHeader",e,n)}appendColHeader(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hot.getColHeader,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;const o=()=>{const s=e>=0?this.hot.getColumnMeta(e).headerClassName:null;return s?s.split(" "):[]};if(n.firstChild){const s=n.firstChild;ve(s,"relative")?(this.updateCellHeader(s.querySelector(".colHeader"),e,r,i),s.className="",G(s,["relative",...o()])):(es(n),this.appendColHeader(e,n,r,i))}else{const{rootDocument:s}=this.hot,a=s.createElement("div"),l=s.createElement("span"),u=o();a.classList.add("relative",...u),l.className="colHeader",this.settings.ariaTags&&(ye(a,...Uo()),ye(l,...Uo())),this.updateCellHeader(l,e,r,i),a.appendChild(l),n.appendChild(a)}this.hot.runHooks("afterGetColHeader",e,n,i)}updateCellHeader(e,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,o=n;const s=this._wt.wtOverlays.getParentOverlay(e)||this._wt;e.parentNode&&(ve(e,"colHeader")?o=s.wtTable.columnFilter.sourceToRendered(n):ve(e,"rowHeader")&&(o=s.wtTable.rowFilter.sourceToRendered(n))),o>-1?Ku(e,r(n,i)):(ol(e," "),G(e,"cornerHeader"))}maximumVisibleElementWidth(e){const r=this._wt.wtViewport.getWorkspaceWidth()-e;return r>0?r:0}maximumVisibleElementHeight(e){const r=this._wt.wtViewport.getWorkspaceHeight()-e;return r>0?r:0}setLastSize(e,n){Zn(UC,this,e),Zn(zC,this,n)}getLastSize(){return{width:Yt(UC,this),height:Yt(zC,this)}}getFirstRenderedVisibleRow(){if(!this._wt.wtViewport.rowsRenderCalculator)return null;const e=this.hot.rowIndexMapper,n=e.getVisualFromRenderableIndex(this._wt.wtTable.getFirstRenderedRow());return e.getNearestNotHiddenIndex(n??0,1)}getLastRenderedVisibleRow(){if(!this._wt.wtViewport.rowsRenderCalculator)return null;const e=this.hot.rowIndexMapper,n=e.getVisualFromRenderableIndex(this._wt.wtTable.getLastRenderedRow());return e.getNearestNotHiddenIndex(n??this.hot.countRows()-1,-1)}getFirstRenderedVisibleColumn(){if(!this._wt.wtViewport.columnsRenderCalculator)return null;const e=this.hot.columnIndexMapper,n=e.getVisualFromRenderableIndex(this._wt.wtTable.getFirstRenderedColumn());return e.getNearestNotHiddenIndex(n??0,1)}getLastRenderedVisibleColumn(){if(!this._wt.wtViewport.columnsRenderCalculator)return null;const e=this.hot.columnIndexMapper,n=e.getVisualFromRenderableIndex(this._wt.wtTable.getLastRenderedColumn());return e.getNearestNotHiddenIndex(n??this.hot.countCols()-1,-1)}getFirstFullyVisibleRow(){return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getFirstVisibleRow())}getLastFullyVisibleRow(){return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getLastVisibleRow())}getFirstFullyVisibleColumn(){return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getFirstVisibleColumn())}getLastFullyVisibleColumn(){return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getLastVisibleColumn())}getFirstPartiallyVisibleRow(){return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getFirstPartiallyVisibleRow())}getLastPartiallyVisibleRow(){return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getLastPartiallyVisibleRow())}getFirstPartiallyVisibleColumn(){return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getFirstPartiallyVisibleColumn())}getLastPartiallyVisibleColumn(){return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getLastPartiallyVisibleColumn())}getColumnHeadersCount(){return Yt(jC,this)}getRowHeadersCount(){return Yt(Qd,this)}getViewportWidth(){return this._wt.wtViewport.getViewportWidth()}getWorkspaceWidth(){return this._wt.wtViewport.getWorkspaceWidth()}getViewportHeight(){return this._wt.wtViewport.getViewportHeight()}getWorkspaceHeight(){return this._wt.wtViewport.getWorkspaceHeight()}getElementOverlayName(e){var n;return((n=this._wt.wtOverlays.getParentOverlay(e))!==null&&n!==void 0?n:this._wt).wtTable.name}getOverlayByName(e){return this._wt.getOverlayByName(e)}getActiveOverlayName(){return this._wt.activeOverlayName}isVisible(){return this._wt.wtTable.isVisible()}hasVerticalScroll(){return this._wt.wtViewport.hasVerticalScroll()}hasHorizontalScroll(){return this._wt.wtViewport.hasHorizontalScroll()}getTableWidth(){return this._wt.wtTable.getWidth()}getTableHeight(){return this._wt.wtTable.getHeight()}getTableOffset(){return this._wt.wtViewport.getWorkspaceOffset()}getRowHeaderWidth(){return this._wt.wtViewport.getRowHeaderWidth()}getColumnHeaderHeight(){return this._wt.wtViewport.getColumnHeaderHeight()}isVerticallyScrollableByWindow(){return this._wt.wtViewport.isVerticallyScrollableByWindow()}isHorizontallyScrollableByWindow(){return this._wt.wtViewport.isHorizontallyScrollableByWindow()}destroy(){this._wt.destroy(),this.eventManager.destroy()}}function yD(){return parseInt(this.hot.rootElement.getAttribute(tp()[0]),10)}function _q(t){const e=Mu(hh,this,yD).call(this)+t;ye(this.hot.rootElement,...tp(e))}function Mq(){const t=this.hot.rootElement;this.hasVerticalScroll()?G(t,"htHasScrollY"):pe(t,"htHasScrollY"),this.hasHorizontalScroll()?G(t,"htHasScrollX"):pe(t,"htHasScrollX")}var WO={},BO={},jO;function Iq(){if(jO)return BO;jO=1;var t=dt(),e=sn(),n=Uu(),r=dr(),i=ln(),o=ho(),s=Ir(),a=Ks(),l=a("every",TypeError);return t({target:"Iterator",proto:!0,real:!0,forced:l},{every:function(c){i(this);try{r(c)}catch(f){s(this,"throw",f)}if(l)return e(l,this,c);var h=o(this),d=0;return!n(h,function(f,g){if(!c(f,d++))return g()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}}),BO}var UO;function Pq(){return UO||(UO=1,Iq()),WO}Pq();const Oq="ABCDEFGHIJKLMNOPQRSTUVWXYZ",zO=Oq.length;function xq(t){let e=t+1,n="",r;for(;e>0;)r=(e-1)%zO,n=String.fromCharCode(65+r)+n,e=parseInt((e-r)/zO,10);return n}function bD(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=t;const r=[];return(!Array.isArray(t)||!Array.isArray(t[0]))&&(n=[t]),n.forEach((i,o)=>{Array.isArray(i)?i.forEach((s,a)=>{r.push([o+e,a,s])}):Object.keys(i).forEach(s=>{r.push([o+e,s,i[s]])})}),r}function SD(t){let e=0;return Array.isArray(t)&&(t[0]&&Array.isArray(t[0])?e=t[0].length:t[0]&&Ae(t[0])&&(e=AR(t[0]))),e}function Aq(t){return!!(Array.isArray(t)&&t.length&&t.every(e=>Array.isArray(e)))}function Hq(t){return!!(Array.isArray(t)&&t.length&&t.every(e=>typeof e=="object"&&!Array.isArray(e)&&e!==null))}function Rc(t,e,n){return(e=Nq(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Nq(t){var e=Dq(t,"string");return typeof e=="symbol"?e:e+""}function Dq(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class kq{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];Rc(this,"hot",void 0),Rc(this,"data",void 0),Rc(this,"dataType","array"),Rc(this,"colToProp",()=>{}),Rc(this,"propToCol",()=>{}),this.hot=e,this.data=n}modifyRowData(e){let n;return this.hot.hasHook("modifyRowData")&&(n=this.hot.runHooks("modifyRowData",e)),n!==void 0&&!Number.isInteger(n)?n:this.data[e]}getData(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return!this.data||this.data.length===0?this.data:this.getByRange(null,null,e)}setData(e){this.data=e}getAtColumn(e){const n=[];return M(this.data,(r,i)=>{const o=this.getAtCell(i,e);n.push(o)}),n}getAtRow(e,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;const o=n===void 0&&r===void 0,{dataDotNotation:s}=this.hot.getSettings();let a=null,l=null;if(a=this.modifyRowData(e),Array.isArray(a))l=[],o?a.forEach((u,c)=>{l[c]=this.getAtPhysicalCell(e,c,a)}):de(n,r,u=>{l[u-n]=this.getAtPhysicalCell(e,u,a)});else if(Ae(a)||ot(a))if(i?l=[]:l={},!o||i){const c=this.countFirstRowKeys()-1;de(0,c,h=>{const d=this.colToProp(h);if(h>=(n||0)&&h<=(r||c)&&!Number.isInteger(d)){const f=this.getAtPhysicalCell(e,d,a);i?l.push(f):s?wC(l,d,f):l[d]=f}})}else He(a,(u,c)=>{const h=this.getAtPhysicalCell(e,c,a);s?wC(l,c,h):l[c]=h});return l}setAtCell(e,n,r){if(!(e>=this.countRows()||n>=this.countFirstRowKeys())){if(this.hot.hasHook("modifySourceData")){const i=Mr(r);this.hot.runHooks("modifySourceData",e,n,i,"set"),i.isTouched()&&(r=i.value)}["__proto__","constructor","prototype"].includes(e)||(Number.isInteger(n)?this.data[e][n]=r:wC(this.data[e],n,r))}}getAtPhysicalCell(e,n,r){let i=null;if(r)if(typeof n=="string"){const{dataDotNotation:o}=this.hot.getSettings();i=o?uz(r,n):r[n]}else typeof n=="function"?i=n(r):i=r[n];if(this.hot.hasHook("modifySourceData")){const o=Mr(i);this.hot.runHooks("modifySourceData",e,n,o,"get"),o.isTouched()&&(i=o.value)}return i}getAtCell(e,n){const r=this.modifyRowData(e);return this.getAtPhysicalCell(e,this.colToProp(n),r)}getByRange(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=!1,o=null,s=null,a=null,l=null;e===null||n===null?(i=!0,o=0,a=this.countRows()-1):(o=Math.min(e.row,n.row),s=Math.min(e.col,n.col),a=Math.max(e.row,n.row),l=Math.max(e.col,n.col));const u=[];return de(o,a,c=>{u.push(i?this.getAtRow(c,void 0,void 0,r):this.getAtRow(c,s,l,r))}),u}countRows(){if(this.hot.hasHook("modifySourceLength")){const e=this.hot.runHooks("modifySourceLength");if(Number.isInteger(e))return e}return this.data.length}countFirstRowKeys(){return SD(this.data)}destroy(){this.data=null,this.hot=null}}var YO={},GO={},qO;function Lq(){if(qO)return GO;qO=1;var t=dt(),e=sn(),n=Uu(),r=dr(),i=ln(),o=ho(),s=Ir(),a=Ks(),l=a("some",TypeError);return t({target:"Iterator",proto:!0,real:!0,forced:l},{some:function(c){i(this);try{r(c)}catch(f){s(this,"throw",f)}if(l)return e(l,this,c);var h=o(this),d=0;return n(h,function(f,g){if(c(f,d++))return g()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}}),GO}var KO;function $q(){return KO||(KO=1,Lq()),YO}$q();function XO(t,e,n){return(e=Fq(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Fq(t){var e=Vq(t,"string");return typeof e=="symbol"?e:e+""}function Vq(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class bl{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;XO(this,"indexedValues",[]),XO(this,"initValueOrFn",void 0),this.initValueOrFn=e}getValues(){return this.indexedValues}getValueAtIndex(e){const n=this.indexedValues;if(e<n.length)return n[e]}setValues(e){this.indexedValues=e.slice(),this.runLocalHooks("change")}setValueAtIndex(e,n){return e<this.indexedValues.length?(this.indexedValues[e]=n,this.runLocalHooks("change"),!0):!1}clear(){this.setDefaultValues()}getLength(){return this.getValues().length}setDefaultValues(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.indexedValues.length;this.indexedValues.length=0,ot(this.initValueOrFn)?de(e-1,n=>this.indexedValues.push(this.initValueOrFn(n))):de(e-1,()=>this.indexedValues.push(this.initValueOrFn)),this.runLocalHooks("change")}init(e){return this.setDefaultValues(e),this.runLocalHooks("init"),this}insert(){this.runLocalHooks("change")}remove(){this.runLocalHooks("change")}destroy(){this.clearLocalHooks(),this.indexedValues=null,this.initValueOrFn=null}}ut(bl,Rn);function tE(t,e,n,r){const i=n.length?n[0]:void 0;return[...t.slice(0,i),...n.map((o,s)=>ot(r)?r(o,s):r),...i===void 0?[]:t.slice(i)]}function nE(t,e){return rl(t,(n,r)=>e.includes(r)===!1)}class Zs extends bl{insert(e,n){this.indexedValues=tE(this.indexedValues,e,n,this.initValueOrFn),super.insert(e,n)}remove(e){this.indexedValues=nE(this.indexedValues,e),super.remove(e)}}class cp extends Zs{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;super(e)}getHiddenIndexes(){return fr(this.getValues(),(e,n,r)=>(n&&e.push(r),e),[])}}function rE(t,e,n){return[...t.slice(0,e),...n,...t.slice(e)]}function Yh(t,e){return rl(t,n=>e.includes(n)===!1)}function iE(t,e){return Be(t,n=>n-e.filter(r=>r<n).length)}function oE(t,e){const n=e[0],r=e.length;return Be(t,i=>i>=n?i+r:i)}function Wq(t,e,n){return(e=Bq(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Bq(t){var e=jq(t,"string");return typeof e=="symbol"?e:e+""}function jq(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class hp extends bl{constructor(){super(...arguments),Wq(this,"orderOfIndexes",[])}getValues(){return this.orderOfIndexes.map(e=>this.indexedValues[e])}setValues(e){this.orderOfIndexes=[...Array(e.length).keys()],super.setValues(e)}setValueAtIndex(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.orderOfIndexes.length;return e<this.indexedValues.length?(this.indexedValues[e]=n,this.orderOfIndexes.includes(e)===!1&&this.orderOfIndexes.splice(r,0,e),this.runLocalHooks("change"),!0):!1}clearValue(e){this.orderOfIndexes=Yh(this.orderOfIndexes,[e]),ot(this.initValueOrFn)?super.setValueAtIndex(e,this.initValueOrFn(e)):super.setValueAtIndex(e,this.initValueOrFn)}getLength(){return this.orderOfIndexes.length}setDefaultValues(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.indexedValues.length;this.orderOfIndexes.length=0,super.setDefaultValues(e)}insert(e,n){this.indexedValues=tE(this.indexedValues,e,n,this.initValueOrFn),this.orderOfIndexes=oE(this.orderOfIndexes,n),super.insert(e,n)}remove(e){this.indexedValues=nE(this.indexedValues,e),this.orderOfIndexes=Yh(this.orderOfIndexes,e),this.orderOfIndexes=iE(this.orderOfIndexes,e),super.remove(e)}getEntries(){return this.orderOfIndexes.map(e=>[e,this.getValueAtIndex(e)])}}class Rd extends Zs{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;super(e)}getTrimmedIndexes(){return fr(this.getValues(),(e,n,r)=>(n&&e.push(r),e),[])}}const ZO=new Map([["indexesSequence",{getListWithInsertedItems:rE,getListWithRemovedItems:Yh}],["physicallyIndexed",{getListWithInsertedItems:tE,getListWithRemovedItems:nE}]]),RD=t=>{if(ZO.has(t)===!1)throw new Error(`Alter strategy with ID '${t}' does not exist.`);return ZO.get(t)};class ED extends bl{constructor(){super(e=>e)}insert(e,n){const r=oE(this.indexedValues,n);this.indexedValues=rE(r,e,n),super.insert(e,n)}remove(e){const n=Yh(this.indexedValues,e);this.indexedValues=iE(n,e),super.remove(e)}}const QO=new Map([["hiding",cp],["index",bl],["linkedPhysicalIndexToValue",hp],["physicalIndexToValue",Zs],["trimming",Rd]]);function Uq(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!QO.has(t))throw new Error(`The provided map type ("${t}") does not exist.`);return new(QO.get(t))(e)}function zq(t,e,n){return(e=Yq(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Yq(t){var e=Gq(t,"string");return typeof e=="symbol"?e:e+""}function Gq(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class sE{constructor(){zq(this,"collection",new Map)}register(e,n){this.collection.has(e)===!1&&(this.collection.set(e,n),n.addLocalHook("change",()=>this.runLocalHooks("change",n)))}unregister(e){const n=this.collection.get(e);ae(n)&&(n.destroy(),this.collection.delete(e),this.runLocalHooks("change",n))}unregisterAll(){this.collection.forEach((e,n)=>this.unregister(n)),this.collection.clear()}get(e){return It(e)?Array.from(this.collection.values()):this.collection.get(e)}getLength(){return this.collection.size}removeFromEvery(e){this.collection.forEach(n=>{n.remove(e)})}insertToEvery(e,n){this.collection.forEach(r=>{r.insert(e,n)})}initEvery(e){this.collection.forEach(n=>{n.init(e)})}}ut(sE,Rn);function YC(t,e,n){return(e=qq(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function qq(t){var e=Kq(t,"string");return typeof e=="symbol"?e:e+""}function Kq(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class JO extends sE{constructor(e,n){super(),YC(this,"mergedValuesCache",[]),YC(this,"aggregationFunction",void 0),YC(this,"fallbackValue",void 0),this.aggregationFunction=e,this.fallbackValue=n}getMergedValues(){if((arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0)===!0)return this.mergedValuesCache;if(this.getLength()===0)return[];const n=Be(this.get(),o=>o.getValues()),r=[],i=ae(n[0])&&n[0].length||0;for(let o=0;o<i;o+=1){const s=[];for(let a=0;a<this.getLength();a+=1)s.push(n[a][o]);r.push(s)}return Be(r,this.aggregationFunction)}getMergedValueAtIndex(e,n){const r=this.getMergedValues(n)[e];return ae(r)?r:this.fallbackValue}updateCache(){this.mergedValuesCache=this.getMergedValues(!1)}}function Xq(t,e,n){Zq(t,e),e.set(t,n)}function Zq(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Qq(t,e,n){return t.set(TD(t,e),n),n}function Jq(t,e){return t.get(TD(t,e))}function TD(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var GC=new WeakMap;class _D{constructor(){Xq(this,GC,[])}subscribe(e){return this.addLocalHook("change",e),this._write(Jq(GC,this)),this}unsubscribe(){return this.runLocalHooks("unsubscribe"),this.clearLocalHooks(),this}_write(e){return e.length>0&&this.runLocalHooks("change",e),this}_writeInitialChanges(e){Qq(GC,this,e)}}ut(_D,Rn);function ex(t,e){const n=[];let r=0,i=0;for(;r<t.length&&i<e.length;r++,i++)t[r]!==e[i]&&n.push({op:"replace",index:i,oldValue:t[r],newValue:e[i]});for(;r<e.length;r++)n.push({op:"insert",index:r,oldValue:void 0,newValue:e[r]});for(;i<t.length;i++)n.push({op:"remove",index:i,oldValue:t[i],newValue:void 0});return n}function Ec(t,e,n){eK(t,e),e.set(t,n)}function eK(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function kr(t,e){return t.get(MD(t,e))}function ef(t,e,n){return t.set(MD(t,e),n),n}function MD(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var tf=new WeakMap,Tc=new WeakMap,nf=new WeakMap,rf=new WeakMap,of=new WeakMap;class tK{constructor(){let{initialIndexValue:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ec(this,tf,new Set),Ec(this,Tc,[]),Ec(this,nf,[]),Ec(this,rf,!1),Ec(this,of,!1),ef(of,this,e??!1)}createObserver(){const e=new _D;return kr(tf,this).add(e),e.addLocalHook("unsubscribe",()=>{kr(tf,this).delete(e)}),e._writeInitialChanges(ex(kr(Tc,this),kr(nf,this))),e}emit(e){let n=kr(nf,this);(!kr(rf,this)||kr(Tc,this).length!==e.length)&&(e.length===0?e=new Array(n.length).fill(kr(of,this)):ef(Tc,this,new Array(e.length).fill(kr(of,this))),kr(rf,this)||(ef(rf,this,!0),n=kr(Tc,this)));const r=ex(n,e);kr(tf,this).forEach(i=>i._write(r)),ef(nf,this,e)}}function kn(t,e,n){return(e=nK(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function nK(t){var e=rK(t,"string");return typeof e=="symbol"?e:e+""}function rK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class sS{constructor(){kn(this,"indexesSequence",new ED),kn(this,"trimmingMapsCollection",new JO(e=>e.some(n=>n===!0),!1)),kn(this,"hidingMapsCollection",new JO(e=>e.some(n=>n===!0),!1)),kn(this,"variousMapsCollection",new sE),kn(this,"hidingChangesObservable",new tK({initialIndexValue:!1})),kn(this,"notTrimmedIndexesCache",[]),kn(this,"notHiddenIndexesCache",[]),kn(this,"isBatched",!1),kn(this,"indexesSequenceChanged",!1),kn(this,"indexesChangeSource",void 0),kn(this,"trimmedIndexesChanged",!1),kn(this,"hiddenIndexesChanged",!1),kn(this,"renderablePhysicalIndexesCache",[]),kn(this,"fromPhysicalToVisualIndexesCache",new Map),kn(this,"fromVisualToRenderableIndexesCache",new Map),this.indexesSequence.addLocalHook("change",()=>{this.indexesSequenceChanged=!0,this.updateCache(),this.runLocalHooks("indexesSequenceChange",this.indexesChangeSource),this.runLocalHooks("change",this.indexesSequence,null)}),this.trimmingMapsCollection.addLocalHook("change",e=>{this.trimmedIndexesChanged=!0,this.updateCache(),this.runLocalHooks("change",e,this.trimmingMapsCollection)}),this.hidingMapsCollection.addLocalHook("change",e=>{this.hiddenIndexesChanged=!0,this.updateCache(),this.runLocalHooks("change",e,this.hidingMapsCollection)}),this.variousMapsCollection.addLocalHook("change",e=>{this.runLocalHooks("change",e,this.variousMapsCollection)})}suspendOperations(){this.isBatched=!0}resumeOperations(){this.isBatched=!1,this.updateCache()}createChangesObserver(e){if(e!=="hiding")throw new Error(`Unsupported index map type "${e}".`);return this.hidingChangesObservable.createObserver()}createAndRegisterIndexMap(e,n,r){return this.registerMap(e,Uq(n,r))}registerMap(e,n){if(this.trimmingMapsCollection.get(e)||this.hidingMapsCollection.get(e)||this.variousMapsCollection.get(e))throw Error(`Map with name "${e}" has been already registered.`);n instanceof Rd?this.trimmingMapsCollection.register(e,n):n instanceof cp?this.hidingMapsCollection.register(e,n):this.variousMapsCollection.register(e,n);const r=this.getNumberOfIndexes();return r>0&&n.init(r),n}unregisterMap(e){this.trimmingMapsCollection.unregister(e),this.hidingMapsCollection.unregister(e),this.variousMapsCollection.unregister(e)}unregisterAll(){this.trimmingMapsCollection.unregisterAll(),this.hidingMapsCollection.unregisterAll(),this.variousMapsCollection.unregisterAll()}getPhysicalFromVisualIndex(e){const n=this.notTrimmedIndexesCache[e];return ae(n)?n:null}getPhysicalFromRenderableIndex(e){const n=this.renderablePhysicalIndexesCache[e];return ae(n)?n:null}getVisualFromPhysicalIndex(e){const n=this.fromPhysicalToVisualIndexesCache.get(e);return ae(n)?n:null}getVisualFromRenderableIndex(e){return this.getVisualFromPhysicalIndex(this.getPhysicalFromRenderableIndex(e))}getRenderableFromVisualIndex(e){const n=this.fromVisualToRenderableIndexesCache.get(e);return ae(n)?n:null}getNearestNotHiddenIndex(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(this.getPhysicalFromVisualIndex(e)===null)return null;if(this.fromVisualToRenderableIndexesCache.has(e))return e;const o=Array.from(this.fromVisualToRenderableIndexesCache.keys());let s=-1;return n>0?s=o.findIndex(a=>a>e):s=o.reverse().findIndex(a=>a<e),s===-1?r?this.getNearestNotHiddenIndex(e,-n,!1):null:o[s]}initToLength(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getNumberOfIndexes();this.notTrimmedIndexesCache=[...new Array(e).keys()],this.notHiddenIndexesCache=[...new Array(e).keys()],this.suspendOperations(),this.indexesChangeSource="init",this.indexesSequence.init(e),this.indexesChangeSource=void 0,this.trimmingMapsCollection.initEvery(e),this.resumeOperations(),this.suspendOperations(),this.hidingMapsCollection.initEvery(e),this.variousMapsCollection.initEvery(e),this.resumeOperations(),this.runLocalHooks("init")}fitToLength(e){const n=this.getNumberOfIndexes();if(e<n){const r=[...Array(this.getNumberOfIndexes()-e).keys()].map(i=>i+e);this.removeIndexes(r)}else this.insertIndexes(n,e-n)}getIndexesSequence(){return this.indexesSequence.getValues()}setIndexesSequence(e){this.indexesChangeSource===void 0&&(this.indexesChangeSource="update"),this.indexesSequence.setValues(e),this.indexesChangeSource==="update"&&(this.indexesChangeSource=void 0)}getNotTrimmedIndexes(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0)===!0?this.notTrimmedIndexesCache:this.getIndexesSequence().filter(r=>this.isTrimmed(r)===!1)}getNotTrimmedIndexesLength(){return this.getNotTrimmedIndexes().length}getNotHiddenIndexes(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0)===!0?this.notHiddenIndexesCache:this.getIndexesSequence().filter(r=>this.isHidden(r)===!1)}getNotHiddenIndexesLength(){return this.getNotHiddenIndexes().length}getRenderableIndexes(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0)===!0?this.renderablePhysicalIndexesCache:this.getNotTrimmedIndexes().filter(r=>this.isHidden(r)===!1)}getRenderableIndexesLength(){return this.getRenderableIndexes().length}getNumberOfIndexes(){return this.getIndexesSequence().length}moveIndexes(e,n){typeof e=="number"&&(e=[e]);const r=Be(e,u=>this.getPhysicalFromVisualIndex(u)),i=this.getNotTrimmedIndexesLength(),o=e.length,s=Yh(this.getIndexesSequence(),r),a=s.filter(u=>this.isTrimmed(u)===!1);let l=s.indexOf(a[a.length-1])+1;if(n+o<i){const u=a[n];l=s.indexOf(u)}this.indexesChangeSource="move",this.setIndexesSequence(rE(s,l,r)),this.indexesChangeSource=void 0}isTrimmed(e){return this.trimmingMapsCollection.getMergedValueAtIndex(e)}isHidden(e){return this.hidingMapsCollection.getMergedValueAtIndex(e)}insertIndexes(e,n){const r=this.getNotTrimmedIndexes()[e],i=ae(r)?r:this.getNumberOfIndexes(),o=this.getIndexesSequence().includes(r)?this.getIndexesSequence().indexOf(r):this.getNumberOfIndexes(),s=Be(new Array(n).fill(i),(a,l)=>a+l);this.suspendOperations(),this.indexesChangeSource="insert",this.indexesSequence.insert(o,s),this.indexesChangeSource=void 0,this.trimmingMapsCollection.insertToEvery(o,s),this.hidingMapsCollection.insertToEvery(o,s),this.variousMapsCollection.insertToEvery(o,s),this.resumeOperations()}removeIndexes(e){this.suspendOperations(),this.indexesChangeSource="remove",this.indexesSequence.remove(e),this.indexesChangeSource=void 0,this.trimmingMapsCollection.removeFromEvery(e),this.hidingMapsCollection.removeFromEvery(e),this.variousMapsCollection.removeFromEvery(e),this.resumeOperations()}updateCache(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const n=this.indexesSequenceChanged||this.trimmedIndexesChanged||this.hiddenIndexesChanged;(e===!0||this.isBatched===!1&&n===!0)&&(this.trimmingMapsCollection.updateCache(),this.hidingMapsCollection.updateCache(),this.notTrimmedIndexesCache=this.getNotTrimmedIndexes(!1),this.notHiddenIndexesCache=this.getNotHiddenIndexes(!1),this.renderablePhysicalIndexesCache=this.getRenderableIndexes(!1),this.cacheFromPhysicalToVisualIndexes(),this.cacheFromVisualToRenderableIndexes(),this.hiddenIndexesChanged&&this.hidingChangesObservable.emit(this.hidingMapsCollection.getMergedValues()),this.runLocalHooks("cacheUpdated",{indexesSequenceChanged:this.indexesSequenceChanged,trimmedIndexesChanged:this.trimmedIndexesChanged,hiddenIndexesChanged:this.hiddenIndexesChanged}),this.indexesSequenceChanged=!1,this.trimmedIndexesChanged=!1,this.hiddenIndexesChanged=!1)}cacheFromPhysicalToVisualIndexes(){const e=this.getNotTrimmedIndexesLength();this.fromPhysicalToVisualIndexesCache.clear();for(let n=0;n<e;n+=1){const r=this.getPhysicalFromVisualIndex(n);this.fromPhysicalToVisualIndexesCache.set(r,n)}}cacheFromVisualToRenderableIndexes(){const e=this.getRenderableIndexesLength();this.fromVisualToRenderableIndexesCache.clear();for(let n=0;n<e;n+=1){const r=this.getPhysicalFromRenderableIndex(n),i=this.getVisualFromPhysicalIndex(r);this.fromVisualToRenderableIndexesCache.set(i,n)}}}ut(sS,Rn);function iK(t,e){return He(e,(n,r)=>{It(t[r])&&(t[r]=n)}),t}function ID(t){const n=/^([a-zA-Z]{2})-([a-zA-Z]{2})$/.exec(t);return n?`${n[1].toLowerCase()}-${n[2].toUpperCase()}`:t}function PD(t){ae(t)&&NR(nt`Language with code "${t}" was not found. You should register particular language\x20
|
|
45
|
+
before using it. Read more about this issue at: https://docs.handsontable.com/i18n/missing-language-code.`)}function oK(t,e){return Array.isArray(t)&&Number.isInteger(e)?t[e]:t}const{register:sK,getValues:aK}=Oi("phraseFormatters");function lK(t,e){sK(t,e)}function uK(){return aK()}lK("pluralize",oK);const OD="ContextMenu:items",_e=OD,aE=`${_e}.noItems`,lE=`${_e}.insertRowAbove`,uE=`${_e}.insertRowBelow`,cE=`${_e}.insertColumnOnTheLeft`,hE=`${_e}.insertColumnOnTheRight`,dE=`${_e}.removeRow`,fE=`${_e}.removeColumn`,gE=`${_e}.undo`,mE=`${_e}.redo`,em=`${_e}.readOnly`,pE=`${_e}.clearColumn`,wE=`${_e}.copy`,vE=`${_e}.copyWithHeaders`,CE=`${_e}.copyWithGroupHeaders`,yE=`${_e}.copyHeadersOnly`,bE=`${_e}.cut`,SE=`${_e}.freezeColumn`,RE=`${_e}.unfreezeColumn`,EE=`${_e}.mergeCells`,TE=`${_e}.unmergeCells`,_E=`${_e}.addComment`,ME=`${_e}.editComment`,IE=`${_e}.removeComment`,PE=`${_e}.readOnlyComment`,OE=`${_e}.align`,xE=`${_e}.align.left`,AE=`${_e}.align.center`,HE=`${_e}.align.right`,NE=`${_e}.align.justify`,DE=`${_e}.align.top`,kE=`${_e}.align.middle`,LE=`${_e}.align.bottom`,$E=`${_e}.borders`,FE=`${_e}.borders.top`,VE=`${_e}.borders.right`,WE=`${_e}.borders.bottom`,BE=`${_e}.borders.left`,jE=`${_e}.borders.remove`,UE=`${_e}.nestedHeaders.insertChildRow`,zE=`${_e}.nestedHeaders.detachFromParent`,YE=`${_e}.hideColumn`,GE=`${_e}.showColumn`,qE=`${_e}.hideRow`,KE=`${_e}.showRow`,qn="Filters:",$t=`${qn}conditions`,dp=`${$t}.none`,XE=`${$t}.isEmpty`,ZE=`${$t}.isNotEmpty`,QE=`${$t}.isEqualTo`,JE=`${$t}.isNotEqualTo`,e0=`${$t}.beginsWith`,t0=`${$t}.endsWith`,n0=`${$t}.contains`,r0=`${$t}.doesNotContain`,cK=`${$t}.byValue`,i0=`${$t}.greaterThan`,o0=`${$t}.greaterThanOrEqualTo`,s0=`${$t}.lessThan`,a0=`${$t}.lessThanOrEqualTo`,l0=`${$t}.isBetween`,u0=`${$t}.isNotBetween`,c0=`${$t}.after`,h0=`${$t}.before`,d0=`${$t}.today`,f0=`${$t}.tomorrow`,g0=`${$t}.yesterday`,m0=`${qn}labels.filterByCondition`,p0=`${qn}labels.filterByValue`,w0=`${qn}labels.conjunction`,fp=`${qn}labels.disjunction`,tm=`${qn}values.blankCells`,v0=`${qn}buttons.selectAll`,C0=`${qn}buttons.clear`,y0=`${qn}buttons.ok`,b0=`${qn}buttons.cancel`,S0=`${qn}buttons.placeholder.search`,R0=`${qn}buttons.placeholder.value`,E0=`${qn}buttons.placeholder.secondValue`,T0="CheckboxRenderer:",_0=`${T0}checked`,M0=`${T0}unchecked`,hK=Object.freeze(Object.defineProperty({__proto__:null,CHECKBOX_CHECKED:_0,CHECKBOX_RENDERER_NAMESPACE:T0,CHECKBOX_UNCHECKED:M0,CONTEXTMENU_ITEMS_ADD_COMMENT:_E,CONTEXTMENU_ITEMS_ALIGNMENT:OE,CONTEXTMENU_ITEMS_ALIGNMENT_BOTTOM:LE,CONTEXTMENU_ITEMS_ALIGNMENT_CENTER:AE,CONTEXTMENU_ITEMS_ALIGNMENT_JUSTIFY:NE,CONTEXTMENU_ITEMS_ALIGNMENT_LEFT:xE,CONTEXTMENU_ITEMS_ALIGNMENT_MIDDLE:kE,CONTEXTMENU_ITEMS_ALIGNMENT_RIGHT:HE,CONTEXTMENU_ITEMS_ALIGNMENT_TOP:DE,CONTEXTMENU_ITEMS_BORDERS:$E,CONTEXTMENU_ITEMS_BORDERS_BOTTOM:WE,CONTEXTMENU_ITEMS_BORDERS_LEFT:BE,CONTEXTMENU_ITEMS_BORDERS_RIGHT:VE,CONTEXTMENU_ITEMS_BORDERS_TOP:FE,CONTEXTMENU_ITEMS_CLEAR_COLUMN:pE,CONTEXTMENU_ITEMS_COPY:wE,CONTEXTMENU_ITEMS_COPY_COLUMN_HEADERS_ONLY:yE,CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_GROUP_HEADERS:CE,CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_HEADERS:vE,CONTEXTMENU_ITEMS_CUT:bE,CONTEXTMENU_ITEMS_EDIT_COMMENT:ME,CONTEXTMENU_ITEMS_FREEZE_COLUMN:SE,CONTEXTMENU_ITEMS_HIDE_COLUMN:YE,CONTEXTMENU_ITEMS_HIDE_ROW:qE,CONTEXTMENU_ITEMS_INSERT_LEFT:cE,CONTEXTMENU_ITEMS_INSERT_RIGHT:hE,CONTEXTMENU_ITEMS_MERGE_CELLS:EE,CONTEXTMENU_ITEMS_NESTED_ROWS_DETACH_CHILD:zE,CONTEXTMENU_ITEMS_NESTED_ROWS_INSERT_CHILD:UE,CONTEXTMENU_ITEMS_NO_ITEMS:aE,CONTEXTMENU_ITEMS_READ_ONLY:em,CONTEXTMENU_ITEMS_READ_ONLY_COMMENT:PE,CONTEXTMENU_ITEMS_REDO:mE,CONTEXTMENU_ITEMS_REMOVE_BORDERS:jE,CONTEXTMENU_ITEMS_REMOVE_COLUMN:fE,CONTEXTMENU_ITEMS_REMOVE_COMMENT:IE,CONTEXTMENU_ITEMS_REMOVE_ROW:dE,CONTEXTMENU_ITEMS_ROW_ABOVE:lE,CONTEXTMENU_ITEMS_ROW_BELOW:uE,CONTEXTMENU_ITEMS_SHOW_COLUMN:GE,CONTEXTMENU_ITEMS_SHOW_ROW:KE,CONTEXTMENU_ITEMS_UNDO:gE,CONTEXTMENU_ITEMS_UNFREEZE_COLUMN:RE,CONTEXTMENU_ITEMS_UNMERGE_CELLS:TE,CONTEXT_MENU_ITEMS_NAMESPACE:OD,FILTERS_BUTTONS_CANCEL:b0,FILTERS_BUTTONS_CLEAR:C0,FILTERS_BUTTONS_OK:y0,FILTERS_BUTTONS_PLACEHOLDER_SEARCH:S0,FILTERS_BUTTONS_PLACEHOLDER_SECOND_VALUE:E0,FILTERS_BUTTONS_PLACEHOLDER_VALUE:R0,FILTERS_BUTTONS_SELECT_ALL:v0,FILTERS_CONDITIONS_AFTER:c0,FILTERS_CONDITIONS_BEFORE:h0,FILTERS_CONDITIONS_BEGINS_WITH:e0,FILTERS_CONDITIONS_BETWEEN:l0,FILTERS_CONDITIONS_BY_VALUE:cK,FILTERS_CONDITIONS_CONTAINS:n0,FILTERS_CONDITIONS_EMPTY:XE,FILTERS_CONDITIONS_ENDS_WITH:t0,FILTERS_CONDITIONS_EQUAL:QE,FILTERS_CONDITIONS_GREATER_THAN:i0,FILTERS_CONDITIONS_GREATER_THAN_OR_EQUAL:o0,FILTERS_CONDITIONS_LESS_THAN:s0,FILTERS_CONDITIONS_LESS_THAN_OR_EQUAL:a0,FILTERS_CONDITIONS_NAMESPACE:$t,FILTERS_CONDITIONS_NONE:dp,FILTERS_CONDITIONS_NOT_BETWEEN:u0,FILTERS_CONDITIONS_NOT_CONTAIN:r0,FILTERS_CONDITIONS_NOT_EMPTY:ZE,FILTERS_CONDITIONS_NOT_EQUAL:JE,FILTERS_CONDITIONS_TODAY:d0,FILTERS_CONDITIONS_TOMORROW:f0,FILTERS_CONDITIONS_YESTERDAY:g0,FILTERS_DIVS_FILTER_BY_CONDITION:m0,FILTERS_DIVS_FILTER_BY_VALUE:p0,FILTERS_LABELS_CONJUNCTION:w0,FILTERS_LABELS_DISJUNCTION:fp,FILTERS_NAMESPACE:qn,FILTERS_VALUES_BLANK_CELLS:tm},Symbol.toStringTag,{value:"Module"}));/**
|
|
46
|
+
* @preserve
|
|
47
|
+
* Authors: Handsoncode
|
|
48
|
+
* Last updated: Nov 15, 2017
|
|
49
|
+
*
|
|
50
|
+
* Description: Definition file for English - United States language-country.
|
|
51
|
+
*/const xD={languageCode:"en-US",[aE]:"No available options",[lE]:"Insert row above",[uE]:"Insert row below",[cE]:"Insert column left",[hE]:"Insert column right",[dE]:["Remove row","Remove rows"],[fE]:["Remove column","Remove columns"],[gE]:"Undo",[mE]:"Redo",[em]:"Read only",[pE]:"Clear column",[OE]:"Alignment",[xE]:"Left",[AE]:"Center",[HE]:"Right",[NE]:"Justify",[DE]:"Top",[kE]:"Middle",[LE]:"Bottom",[SE]:"Freeze column",[RE]:"Unfreeze column",[$E]:"Borders",[FE]:"Top",[VE]:"Right",[WE]:"Bottom",[BE]:"Left",[jE]:"Remove border(s)",[_E]:"Add comment",[ME]:"Edit comment",[IE]:"Delete comment",[PE]:"Read-only comment",[EE]:"Merge cells",[TE]:"Unmerge cells",[wE]:"Copy",[vE]:["Copy with header","Copy with headers"],[CE]:["Copy with group header","Copy with group headers"],[yE]:["Copy header only","Copy headers only"],[bE]:"Cut",[UE]:"Insert child row",[zE]:"Detach from parent",[YE]:["Hide column","Hide columns"],[GE]:["Show column","Show columns"],[qE]:["Hide row","Hide rows"],[KE]:["Show row","Show rows"],[dp]:"None",[XE]:"Is empty",[ZE]:"Is not empty",[QE]:"Is equal to",[JE]:"Is not equal to",[e0]:"Begins with",[t0]:"Ends with",[n0]:"Contains",[r0]:"Does not contain",[i0]:"Greater than",[o0]:"Greater than or equal to",[s0]:"Less than",[a0]:"Less than or equal to",[l0]:"Is between",[u0]:"Is not between",[c0]:"After",[h0]:"Before",[d0]:"Today",[f0]:"Tomorrow",[g0]:"Yesterday",[tm]:"Blank cells",[m0]:"Filter by condition",[p0]:"Filter by value",[w0]:"And",[fp]:"Or",[v0]:"Select all",[C0]:"Clear",[y0]:"OK",[b0]:"Cancel",[S0]:"Search",[R0]:"Value",[E0]:"Second value",[_0]:"Checked",[M0]:"Unchecked"},dK=hK,aS=xD.languageCode,{register:fK,getItem:AD,hasItem:gK,getValues:mK}=Oi("languagesDictionaries");HD(xD);function HD(t,e){let n=t,r=e;return Ae(t)&&(r=t,n=r.languageCode),pK(n,r),fK(n,Gn(r)),Gn(r)}function pK(t,e){t!==aS&&iK(e,AD(aS))}function ND(t){return I0(t)?Gn(AD(t)):null}function I0(t){return gK(t)}function wK(){return mK()}function DD(t,e,n){const r=ND(t);if(r===null)return null;const i=r[e];if(It(i))return null;const o=vK(i,n);return Array.isArray(o)?o[0]:o}function vK(t,e){let n=t;return M(uK(),r=>{n=r(t,e)}),n}function CK(t){let e=ID(t);return I0(e)||(e=aS,PD(t)),e}function yK(t,e,n){return(e=bK(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function bK(t){var e=SK(t,"string");return typeof e=="symbol"?e:e+""}function SK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class as extends hD{constructor(e,n){super(e,null),yK(this,"visualCellRange",null),this.visualCellRange=n||null,this.commit()}add(e){return this.visualCellRange===null?this.visualCellRange=this.settings.createCellRange(e):this.visualCellRange.expand(e),this}clear(){return this.visualCellRange=null,super.clear()}trimToVisibleCellsRangeOnly(e){let{from:n,to:r}=e,i=this.getNearestNotHiddenCoords(n,1),o=this.getNearestNotHiddenCoords(r,-1);return i===null||o===null?null:((i.row>o.row||i.col>o.col)&&(i=n,o=r),this.settings.createCellRange(i,i,o))}getNearestNotHiddenCoords(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:n;const i=this.getNearestNotHiddenIndex(this.settings.rowIndexMapper,e.row,n);if(i===null)return null;const o=this.getNearestNotHiddenIndex(this.settings.columnIndexMapper,e.col,r);return o===null?null:this.settings.createCellCoords(i,o)}getNearestNotHiddenIndex(e,n,r){return n<0?n:e.getNearestNotHiddenIndex(n,r)}commit(){if(this.visualCellRange===null)return this;const e=this.trimToVisibleCellsRangeOnly(this.visualCellRange);return e===null?this.cellRange=null:this.cellRange=this.createRenderableCellRange(e.from,e.to),this}syncWith(e){const n=e.from.clone().normalize(),r=e.getVerticalDirection()==="N-S"?1:-1,i=e.getHorizontalDirection()==="W-E"?1:-1,o=this.settings.visualToRenderableCoords(this.visualCellRange.highlight);let s=null;if((o===null||o.col===null||o.row===null)&&(s=this.getNearestNotHiddenCoords(n,r,i)),s!==null&&e.overlaps(s)){const a=e.highlight.clone();if(a.row>=0&&(a.row=s.row),a.col>=0&&(a.col=s.col),this.cellRange===null){const l=this.settings.visualToRenderableCoords(a);this.cellRange=this.settings.createCellRange(l)}e.setHighlight(a)}return this.settings.selectionType==="focus"&&o!==null&&s===null&&e.setHighlight(this.visualCellRange.highlight),this}getCorners(){const{from:e,to:n}=this.cellRange;return[Math.min(e.row,n.row),Math.min(e.col,n.col),Math.max(e.row,n.row),Math.max(e.col,n.col)]}getVisualCorners(){const e=this.settings.renderableToVisualCoords(this.cellRange.getTopStartCorner()),n=this.settings.renderableToVisualCoords(this.cellRange.getBottomEndCorner());return[e.row,e.col,n.row,n.col]}createRenderableCellRange(e,n){const r=this.settings.visualToRenderableCoords(e),i=this.settings.visualToRenderableCoords(n);return r.row===null||r.col===null||i.row===null||i.col===null?null:this.settings.createCellRange(r,r,i)}}function qC(t){let{activeHeaderClassName:e,...n}=t;return new as({className:e,...n,selectionType:dD})}function RK(t){let{areaCornerVisible:e,...n}=t;return new as({className:"area",createLayers:!0,border:{width:1,color:"#4b89ff",cornerVisible:e},...n,selectionType:zR})}function EK(t){let{...e}=t;return new as({className:"highlight",...e,selectionType:zR})}function TK(t){let{columnClassName:e,...n}=t;return new as({className:e,...n,selectionType:$2})}function _K(t){let{cellCornerVisible:e,...n}=t;return new as({className:"current",headerAttributes:[MR()],border:{width:2,color:"#4b89ff",cornerVisible:e},...n,selectionType:Ch})}function MK(t){let{border:e,visualCellRange:n,...r}=t;return new as({...e,...r,selectionType:F2},n)}function IK(t){let{...e}=t;return new as({className:"fill",border:{width:1,color:"#ff0000"},...e,selectionType:k2})}function tx(t){let{headerClassName:e,...n}=t;return new as({className:e,...n,selectionType:UR})}function PK(t){let{rowClassName:e,...n}=t;return new as({className:e,...n,selectionType:L2})}function OK(t,e){xK(t,e),e.add(t)}function xK(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Qn(t,e,n){return(e=AK(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function AK(t){var e=HK(t,"string");return typeof e=="symbol"?e:e+""}function HK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ro(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var ki=new WeakSet;class NK{constructor(e){OK(this,ki),Qn(this,"options",void 0),Qn(this,"layerLevel",0),Qn(this,"focus",void 0),Qn(this,"fill",void 0),Qn(this,"layeredAreas",new Map),Qn(this,"areas",new Map),Qn(this,"rowHeaders",new Map),Qn(this,"columnHeaders",new Map),Qn(this,"activeRowHeaders",new Map),Qn(this,"activeColumnHeaders",new Map),Qn(this,"activeCornerHeaders",new Map),Qn(this,"rowHighlights",new Map),Qn(this,"columnHighlights",new Map),Qn(this,"customSelections",[]),this.options=e,this.focus=_K(e),this.fill=IK(e)}isEnabledFor(e,n){let r=e;e===Ch&&(r="current");let i=this.options.disabledCellSelection(n.row,n.col);return typeof i=="string"&&(i=[i]),i===!1||Array.isArray(i)&&!i.includes(r)}useLayerLevel(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return this.layerLevel=e,this}getFocus(){return this.focus}getFill(){return this.fill}createLayeredArea(){return Ro(ki,this,Eo).call(this,this.layeredAreas,RK)}getLayeredAreas(){return[...this.layeredAreas.values()]}createArea(){return Ro(ki,this,Eo).call(this,this.areas,EK)}getAreas(){return[...this.areas.values()]}createRowHeader(){return Ro(ki,this,Eo).call(this,this.rowHeaders,tx)}getRowHeaders(){return[...this.rowHeaders.values()]}createColumnHeader(){return Ro(ki,this,Eo).call(this,this.columnHeaders,tx)}getColumnHeaders(){return[...this.columnHeaders.values()]}createActiveRowHeader(){return Ro(ki,this,Eo).call(this,this.activeRowHeaders,qC)}getActiveRowHeaders(){return[...this.activeRowHeaders.values()]}createActiveColumnHeader(){return Ro(ki,this,Eo).call(this,this.activeColumnHeaders,qC)}getActiveColumnHeaders(){return[...this.activeColumnHeaders.values()]}createActiveCornerHeader(){return Ro(ki,this,Eo).call(this,this.activeCornerHeaders,qC)}getActiveCornerHeaders(){return[...this.activeCornerHeaders.values()]}createRowHighlight(){return Ro(ki,this,Eo).call(this,this.rowHighlights,PK)}getRowHighlights(){return[...this.rowHighlights.values()]}createColumnHighlight(){return Ro(ki,this,Eo).call(this,this.columnHighlights,TK)}getColumnHighlights(){return[...this.columnHighlights.values()]}getCustomSelections(){return[...this.customSelections.values()]}addCustomSelection(e){this.customSelections.push(MK({...this.options,...e}))}clear(){this.focus.clear(),this.fill.clear(),M(this.areas.values(),e=>void e.clear()),M(this.layeredAreas.values(),e=>void e.clear()),M(this.rowHeaders.values(),e=>void e.clear()),M(this.columnHeaders.values(),e=>void e.clear()),M(this.activeRowHeaders.values(),e=>void e.clear()),M(this.activeColumnHeaders.values(),e=>void e.clear()),M(this.activeCornerHeaders.values(),e=>void e.clear()),M(this.rowHighlights.values(),e=>void e.clear()),M(this.columnHighlights.values(),e=>void e.clear())}[Symbol.iterator](){return[this.focus,this.fill,...this.areas.values(),...this.layeredAreas.values(),...this.rowHeaders.values(),...this.columnHeaders.values(),...this.activeRowHeaders.values(),...this.activeColumnHeaders.values(),...this.activeCornerHeaders.values(),...this.rowHighlights.values(),...this.columnHighlights.values(),...this.customSelections][Symbol.iterator]()}}function Eo(t,e){const n=this.layerLevel;if(t.has(n))return t.get(n);const r=e({layerLevel:n,...this.options});return t.set(n,r),r}function nx(t,e,n){return(e=DK(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function DK(t){var e=kK(t,"string");return typeof e=="symbol"?e:e+""}function kK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class LK{constructor(e){nx(this,"ranges",[]),nx(this,"createCellRange",void 0),this.createCellRange=e}isEmpty(){return this.size()===0}set(e){return this.clear(),this.ranges.push(this.createCellRange(e)),this}add(e){return this.ranges.push(this.createCellRange(e)),this}pop(){return this.ranges.pop(),this}current(){return this.peekByIndex(this.size()-1)}previous(){return this.peekByIndex(this.size()-2)}includes(e){return this.ranges.some(n=>n.includes(e))}clear(){return this.ranges.length=0,this}size(){return this.ranges.length}peekByIndex(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,n;return e>=0&&e<this.size()&&(n=this.ranges[e]),n}[Symbol.iterator](){return this.ranges[Symbol.iterator]()}}function $K(t,e){kD(t,e),e.add(t)}function KC(t,e,n){kD(t,e),e.set(t,n)}function kD(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ge(t,e){return t.get(Jt(t,e))}function sf(t,e,n){return t.set(Jt(t,e),n),n}function Jt(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var af=new WeakMap,mt=new WeakMap,bi=new WeakMap,cn=new WeakSet;class lS{constructor(e,n){$K(this,cn),KC(this,af,void 0),KC(this,mt,void 0),KC(this,bi,{x:0,y:0}),sf(af,this,e),sf(mt,this,n)}transformStart(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=Ge(mt,this).createCellCoords(e,n);let o=Ge(af,this).current().highlight;const s=Ge(mt,this).visualToRenderableCoords(o);let a=0,l=0;if(this.runLocalHooks("beforeTransformStart",i),s.row!==null&&s.col!==null){const{width:u,height:c}=Jt(cn,this,LD).call(this),{row:h,col:d}=Jt(cn,this,ix).call(this,o),f=Ge(mt,this).fixedRowsBottom(),g=Ge(mt,this).minSpareRows(),C=Ge(mt,this).minSpareCols(),y=Ge(mt,this).autoWrapRow(),E=Ge(mt,this).autoWrapCol(),v=Ge(mt,this).createCellCoords(h+i.row,d+i.col);if(v.row>=c){const L=Mr(r&&g>0&&f===0),T=v.col+1,A=Ge(mt,this).createCellCoords(v.row-c,T>=u?T-u:T);this.runLocalHooks("beforeColumnWrap",L,Jt(cn,this,Nl).call(this,A),T>=u),L.value?this.runLocalHooks("insertRowRequire",Ge(mt,this).countRenderableRows()):E&&v.assign(A)}else if(v.row<0){const L=Mr(E),T=v.col-1,A=Ge(mt,this).createCellCoords(c+v.row,T<0?u+T:T);this.runLocalHooks("beforeColumnWrap",L,Jt(cn,this,Nl).call(this,A),T<0),E&&v.assign(A)}if(v.col>=u){const L=Mr(r&&C>0),T=v.row+1,A=Ge(mt,this).createCellCoords(T>=c?T-c:T,v.col-u);this.runLocalHooks("beforeRowWrap",L,Jt(cn,this,Nl).call(this,A),T>=c),L.value?this.runLocalHooks("insertColRequire",Ge(mt,this).countRenderableColumns()):y&&v.assign(A)}else if(v.col<0){const L=Mr(y),T=v.row-1,A=Ge(mt,this).createCellCoords(T<0?c+T:T,u+v.col);this.runLocalHooks("beforeRowWrap",L,Jt(cn,this,Nl).call(this,A),T<0),y&&v.assign(A)}const{rowDir:P,colDir:O}=Jt(cn,this,rx).call(this,v);a=P,l=O,o=Jt(cn,this,Nl).call(this,v)}return this.runLocalHooks("afterTransformStart",o,a,l),o}transformEnd(e,n){const r=Ge(mt,this).createCellCoords(e,n),i=Ge(af,this).current(),o=Ge(mt,this).visualToRenderableCoords(i.highlight),s=Jt(cn,this,XC).call(this,i.to.row,i.from.row),a=Jt(cn,this,ZC).call(this,i.to.col,i.from.col),l=i.to.clone();let u=0,c=0;if(this.runLocalHooks("beforeTransformEnd",r),o.row!==null&&o.col!==null&&s!==null&&a!==null){const{row:h,col:d}=Jt(cn,this,ix).call(this,i.highlight),f=Ge(mt,this).createCellCoords(s+r.row,a+r.col),g=i.getTopStartCorner(),C=i.getTopEndCorner(),y=i.getBottomEndCorner();if(r.col<0&&a>=d&&f.col<d){const O=f.col-d;f.col=Jt(cn,this,ZC).call(this,g.col,C.col)+O}else if(r.col>0&&a<=d&&f.col>d){const O=Jt(cn,this,ZC).call(this,C.col,g.col),L=Math.max(f.col-O,1);f.col=O+L}if(r.row<0&&s>=h&&f.row<h){const O=f.row-h;f.row=Jt(cn,this,XC).call(this,g.row,y.row)+O}else if(r.row>0&&s<=h&&f.row>h){const O=Jt(cn,this,XC).call(this,y.row,g.row),L=Math.max(f.row-O,1);f.row=O+L}const{rowDir:E,colDir:v}=Jt(cn,this,rx).call(this,f);u=E,c=v;const P=Jt(cn,this,Nl).call(this,f);r.row===0&&r.col!==0?l.col=P.col:r.row!==0&&r.col===0?l.row=P.row:(l.row=P.row,l.col=P.col)}return this.runLocalHooks("afterTransformEnd",l,u,c),l}setOffsetSize(e){let{x:n,y:r}=e;sf(bi,this,{x:n,y:r})}resetOffsetSize(){sf(bi,this,{x:0,y:0})}}function rx(t){const{width:e,height:n}=Jt(cn,this,LD).call(this);let r=0,i=0;return t.row<0?(r=-1,t.row=0):t.row>0&&t.row>=n&&(r=1,t.row=n-1),t.col<0?(i=-1,t.col=0):t.col>0&&t.col>=e&&(i=1,t.col=e-1),{rowDir:r,colDir:i}}function LD(){return{width:Ge(bi,this).x+Ge(mt,this).countRenderableColumns(),height:Ge(bi,this).y+Ge(mt,this).countRenderableRows()}}function XC(t,e){const n=Ge(mt,this).findFirstNonHiddenRenderableRow(t,e);return n===null?null:Ge(bi,this).y+n}function ZC(t,e){const n=Ge(mt,this).findFirstNonHiddenRenderableColumn(t,e);return n===null?null:Ge(bi,this).x+n}function ix(t){const{row:e,col:n}=Ge(mt,this).visualToRenderableCoords(t);if(e===null||n===null)throw new Error("Renderable coords are not visible.");return Ge(mt,this).createCellCoords(Ge(bi,this).y+e,Ge(bi,this).x+n)}function Nl(t){const e=t.clone();return e.col=t.col-Ge(bi,this).x,e.row=t.row-Ge(bi,this).y,Ge(mt,this).renderableToVisualCoords(e)}ut(lS,Rn);const gp=0,mp=1,$D=2,P0=3,FK=[P0,$D],VK=[["number"],["number","string"],["number","undefined"],["number","string","undefined"]],QC=Symbol("root"),ox=Symbol("child");function Nu(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:QC;if(e!==QC&&e!==ox)throw new Error("The second argument is used internally only and cannot be overwritten.");const n=Array.isArray(t),r=e===QC;let i=gp;if(n){const o=t[0];t.length===0?i=mp:r&&o instanceof yd?i=P0:r&&Array.isArray(o)?i=Nu(o,ox):t.length>=2&&t.length<=4&&!t.some((a,l)=>!VK[l].includes(typeof a))&&(i=$D)}return i}function Gh(t){let{createCellCoords:e,createCellRange:n,keepDirection:r=!1,propToCol:i}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!FK.includes(t))throw new Error("Unsupported selection ranges schema type was provided.");return function(o){const s=t===P0;let a=s?o.from.row:o[0],l=s?o.from.col:o[1],u=s?o.to.row:o[2],c=s?o.to.col:o[3];if(typeof i=="function"&&(typeof l=="string"&&(l=i(l)),typeof c=="string"&&(c=i(c))),It(u)&&(u=a),It(c)&&(c=l),!r){const f=a,g=l,C=u,y=c;a=Math.min(f,C),l=Math.min(g,y),u=Math.max(f,C),c=Math.max(g,y)}const h=e(a,l),d=e(u,c);return n(h,h,d)}}function WK(t){const e=Nu(t.getSelected());if(e===gp||e===mp)return[];const n=Gh(e,{createCellCoords:t._createCellCoords.bind(t),createCellRange:t._createCellRange.bind(t)}),r=new Set;M(t.getSelected(),s=>{const{from:a,to:l}=n(s),u=Math.max(a.col,0),c=l.col-u+1;M(Array.from(new Array(c),(h,d)=>u+d),h=>{r.has(h)||r.add(h)})});const i=Array.from(r).sort((s,a)=>s-a);return fr(i,(s,a,l,u)=>(l!==0&&a===u[l-1]+1?s[s.length-1][1]+=1:s.push([a,1]),s),[])}function BK(t){const e=Nu(t.getSelected());if(e===gp||e===mp)return[];const n=Gh(e,{createCellCoords:t._createCellCoords.bind(t),createCellRange:t._createCellRange.bind(t)}),r=new Set;M(t.getSelected(),s=>{const{from:a,to:l}=n(s),u=Math.max(a.row,0),c=l.row-u+1;M(Array.from(new Array(c),(h,d)=>u+d),h=>{r.has(h)||r.add(h)})});const i=Array.from(r).sort((s,a)=>s-a);return fr(i,(s,a,l,u)=>(l!==0&&a===u[l-1]+1?s[s.length-1][1]+=1:s.push([a,1]),s),[])}function Dl(t,e,n){jK(t,e),e.set(t,n)}function jK(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function la(t,e,n){return(e=UK(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function UK(t){var e=zK(t,"string");return typeof e=="symbol"?e:e+""}function zK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function bt(t,e){return t.get(FD(t,e))}function Li(t,e,n){return t.set(FD(t,e),n),n}function FD(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Tn=new WeakMap,ua=new WeakMap,lf=new WeakMap,_c=new WeakMap,uf=new WeakMap,Mc=new WeakMap;class VD{constructor(e,n){var r=this;la(this,"settings",void 0),la(this,"tableProps",void 0),la(this,"inProgress",!1),la(this,"selectedRange",new LK((i,o,s)=>this.tableProps.createCellRange(i,o,s))),la(this,"highlight",void 0),Dl(this,Tn,void 0),Dl(this,ua,void 0),la(this,"selectedByRowHeader",new Set),la(this,"selectedByColumnHeader",new Set),Dl(this,lf,!1),Dl(this,_c,!1),Dl(this,uf,"unknown"),Dl(this,Mc,-1),this.settings=e,this.tableProps=n,this.highlight=new NK({headerClassName:e.currentHeaderClassName,activeHeaderClassName:e.activeHeaderClassName,rowClassName:e.currentRowClassName,columnClassName:e.currentColClassName,cellAttributes:[MR()],rowIndexMapper:this.tableProps.rowIndexMapper,columnIndexMapper:this.tableProps.columnIndexMapper,disabledCellSelection:(i,o)=>this.tableProps.isDisabledCellSelection(i,o),cellCornerVisible:function(){return r.isCellCornerVisible(...arguments)},areaCornerVisible:function(){return r.isAreaCornerVisible(...arguments)},visualToRenderableCoords:i=>this.tableProps.visualToRenderableCoords(i),renderableToVisualCoords:i=>this.tableProps.renderableToVisualCoords(i),createCellCoords:(i,o)=>this.tableProps.createCellCoords(i,o),createCellRange:(i,o,s)=>this.tableProps.createCellRange(i,o,s)}),Li(Tn,this,new lS(this.selectedRange,{rowIndexMapper:this.tableProps.rowIndexMapper,columnIndexMapper:this.tableProps.columnIndexMapper,countRenderableRows:()=>this.tableProps.countRenderableRows(),countRenderableColumns:()=>this.tableProps.countRenderableColumns(),visualToRenderableCoords:i=>this.tableProps.visualToRenderableCoords(i),renderableToVisualCoords:i=>this.tableProps.renderableToVisualCoords(i),findFirstNonHiddenRenderableRow:function(){return r.tableProps.findFirstNonHiddenRenderableRow(...arguments)},findFirstNonHiddenRenderableColumn:function(){return r.tableProps.findFirstNonHiddenRenderableColumn(...arguments)},createCellCoords:(i,o)=>this.tableProps.createCellCoords(i,o),fixedRowsBottom:()=>e.fixedRowsBottom,minSpareRows:()=>e.minSpareRows,minSpareCols:()=>e.minSpareCols,autoWrapRow:()=>e.autoWrapRow,autoWrapCol:()=>e.autoWrapCol})),Li(ua,this,new lS(this.selectedRange,{rowIndexMapper:this.tableProps.rowIndexMapper,columnIndexMapper:this.tableProps.columnIndexMapper,countRenderableRows:()=>{const i=this.selectedRange.current();return this.tableProps.countRenderableRowsInRange(0,i.getOuterBottomEndCorner().row)},countRenderableColumns:()=>{const i=this.selectedRange.current();return this.tableProps.countRenderableColumnsInRange(0,i.getOuterBottomEndCorner().col)},visualToRenderableCoords:i=>this.tableProps.visualToRenderableCoords(i),renderableToVisualCoords:i=>this.tableProps.renderableToVisualCoords(i),findFirstNonHiddenRenderableRow:function(){return r.tableProps.findFirstNonHiddenRenderableRow(...arguments)},findFirstNonHiddenRenderableColumn:function(){return r.tableProps.findFirstNonHiddenRenderableColumn(...arguments)},createCellCoords:(i,o)=>this.tableProps.createCellCoords(i,o),fixedRowsBottom:()=>0,minSpareRows:()=>0,minSpareCols:()=>0,autoWrapRow:()=>!0,autoWrapCol:()=>!0})),bt(Tn,this).addLocalHook("beforeTransformStart",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r.runLocalHooks("beforeModifyTransformStart",...o)}),bt(Tn,this).addLocalHook("afterTransformStart",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r.runLocalHooks("afterModifyTransformStart",...o)}),bt(Tn,this).addLocalHook("beforeTransformEnd",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r.runLocalHooks("beforeModifyTransformEnd",...o)}),bt(Tn,this).addLocalHook("afterTransformEnd",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r.runLocalHooks("afterModifyTransformEnd",...o)}),bt(Tn,this).addLocalHook("insertRowRequire",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r.runLocalHooks("insertRowRequire",...o)}),bt(Tn,this).addLocalHook("insertColRequire",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r.runLocalHooks("insertColRequire",...o)}),bt(Tn,this).addLocalHook("beforeRowWrap",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r.runLocalHooks("beforeRowWrap",...o)}),bt(Tn,this).addLocalHook("beforeColumnWrap",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r.runLocalHooks("beforeColumnWrap",...o)}),bt(ua,this).addLocalHook("beforeTransformStart",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r.runLocalHooks("beforeModifyTransformFocus",...o)}),bt(ua,this).addLocalHook("afterTransformStart",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r.runLocalHooks("afterModifyTransformFocus",...o)})}getSelectedRange(){return this.selectedRange}markSource(e){Li(uf,this,e)}markEndSource(){Li(uf,this,"unknown")}getSelectionSource(){return bt(uf,this)}setExpectedLayers(e){Li(Mc,this,e)}begin(){this.inProgress=!0}finish(){this.runLocalHooks("afterSelectionFinished",Array.from(this.selectedRange)),this.inProgress=!1,Li(Mc,this,-1)}isInProgress(){return this.inProgress}setRangeStart(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:e;const o=this.settings.selectionMode==="multiple",s=It(n)?this.tableProps.getShortcutManager().isCtrlPressed():n,a=e.clone();Li(lf,this,!1),this.runLocalHooks(`beforeSetRangeStart${r?"Only":""}`,a),(!o||o&&!s&&It(n))&&this.selectedRange.clear(),this.selectedRange.add(a).current().setHighlight(i.clone()),this.getLayerLevel()===0&&(this.selectedByRowHeader.clear(),this.selectedByColumnHeader.clear()),r||this.setRangeEnd(e)}setRangeStartOnly(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e;this.setRangeStart(e,n,!0,r)}setRangeEnd(e){if(this.selectedRange.isEmpty())return;const n=e.clone(),r=this.tableProps.countRows(),i=this.tableProps.countCols(),o=this.selectedRange.current().clone().setTo(e).isSingleHeader();if((r>0||i>0)&&(r===0&&n.col<0&&!o||i===0&&n.row<0&&!o))return;this.runLocalHooks("beforeSetRangeEnd",n),this.begin();const s=this.selectedRange.current();if(this.settings.navigableHeaders||s.highlight.normalize(),this.settings.selectionMode==="single")s.setFrom(s.highlight),s.setTo(s.highlight);else{const l=s.getHorizontalDirection(),u=s.getVerticalDirection(),c=this.isMultiple();s.setTo(n),c&&(l!==s.getHorizontalDirection()||s.getWidth()===1&&!s.includes(s.highlight))&&s.from.assign({col:s.highlight.col}),c&&(u!==s.getVerticalDirection()||s.getHeight()===1&&!s.includes(s.highlight))&&s.from.assign({row:s.highlight.row})}r>0&&i>0&&(!this.settings.navigableHeaders||this.settings.navigableHeaders&&!s.isSingleHeader())&&s.to.normalize(),this.runLocalHooks("beforeHighlightSet"),this.setRangeFocus(this.selectedRange.current().highlight),this.applyAndCommit();const a=bt(Mc,this)===-1||this.selectedRange.size()===bt(Mc,this);this.runLocalHooks("afterSetRangeEnd",e,a)}applyAndCommit(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.selectedRange.current(),n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLayerLevel();const r=this.tableProps.countRows(),i=this.tableProps.countCols();n<this.highlight.layerLevel&&(M(this.highlight.getAreas(),g=>void g.clear()),M(this.highlight.getLayeredAreas(),g=>void g.clear()),M(this.highlight.getRowHeaders(),g=>void g.clear()),M(this.highlight.getColumnHeaders(),g=>void g.clear()),M(this.highlight.getActiveRowHeaders(),g=>void g.clear()),M(this.highlight.getActiveColumnHeaders(),g=>void g.clear()),M(this.highlight.getActiveCornerHeaders(),g=>void g.clear()),M(this.highlight.getRowHighlights(),g=>void g.clear()),M(this.highlight.getColumnHighlights(),g=>void g.clear())),this.highlight.useLayerLevel(n);const o=this.highlight.createArea(),s=this.highlight.createLayeredArea(),a=this.highlight.createRowHeader(),l=this.highlight.createColumnHeader(),u=this.highlight.createActiveRowHeader(),c=this.highlight.createActiveColumnHeader(),h=this.highlight.createActiveCornerHeader(),d=this.highlight.createRowHighlight(),f=this.highlight.createColumnHighlight();if(o.clear(),s.clear(),a.clear(),l.clear(),u.clear(),c.clear(),h.clear(),d.clear(),f.clear(),this.highlight.isEnabledFor(zR,e.highlight)&&(this.isMultiple()||n>=1)&&(o.add(e.from).add(e.to).commit(),s.add(e.from).add(e.to).commit(),n===1)){const g=this.selectedRange.previous();this.highlight.useLayerLevel(n-1),this.highlight.createArea().add(g.from).commit().syncWith(g),this.highlight.createLayeredArea().add(g.from).commit().syncWith(g),this.highlight.useLayerLevel(n)}if(this.highlight.isEnabledFor(UR,e.highlight)){if(!e.isSingleHeader()){const y=this.tableProps.createCellCoords(Math.max(e.from.row,0),-1),E=this.tableProps.createCellCoords(e.to.row,-1),v=this.tableProps.createCellCoords(-1,Math.max(e.from.col,0)),P=this.tableProps.createCellCoords(-1,e.to.col);this.settings.selectionMode==="single"?(a.add(y).commit(),l.add(v).commit(),d.add(y).commit(),f.add(v).commit()):(a.add(y).add(E).commit(),l.add(v).add(P).commit(),d.add(y).add(E).commit(),f.add(v).add(P).commit())}const g=!bt(_c,this)&&this.isEntireRowSelected()&&(i>0&&i===e.getWidth()||i===0&&this.isSelectedByRowHeader()),C=!bt(_c,this)&&this.isEntireColumnSelected()&&(r>0&&r===e.getHeight()||r===0&&this.isSelectedByColumnHeader());g&&u.add(this.tableProps.createCellCoords(Math.max(e.from.row,0),Math.min(-this.tableProps.countRowHeaders(),-1))).add(this.tableProps.createCellCoords(Math.max(e.to.row,0),-1)).commit(),C&&c.add(this.tableProps.createCellCoords(Math.min(-this.tableProps.countColHeaders(),-1),Math.max(e.from.col,0))).add(this.tableProps.createCellCoords(-1,Math.max(e.to.col,0))).commit(),g&&C&&h.add(this.tableProps.createCellCoords(-this.tableProps.countColHeaders(),-this.tableProps.countRowHeaders())).add(this.tableProps.createCellCoords(-1,-1)).commit()}}setRangeFocus(e){if(this.selectedRange.isEmpty())return;const n=this.selectedRange.current();this.inProgress||this.runLocalHooks("beforeSetFocus",e);const r=this.highlight.getFocus();r.clear(),n.setHighlight(e),this.inProgress||this.runLocalHooks("beforeHighlightSet"),this.highlight.isEnabledFor(Ch,n.highlight)&&r.add(n.highlight).commit().syncWith(n),this.inProgress||(Li(lf,this,!0),this.runLocalHooks("afterSetFocus",n.highlight))}transformStart(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.settings.navigableHeaders?bt(Tn,this).setOffsetSize({x:this.tableProps.countRowHeaders(),y:this.tableProps.countColHeaders()}):bt(Tn,this).resetOffsetSize(),this.setRangeStart(bt(Tn,this).transformStart(e,n,r))}transformEnd(e,n){this.settings.navigableHeaders?bt(Tn,this).setOffsetSize({x:this.tableProps.countRowHeaders(),y:this.tableProps.countColHeaders()}):bt(Tn,this).resetOffsetSize(),this.setRangeEnd(bt(Tn,this).transformEnd(e,n))}transformFocus(e,n){const r=this.selectedRange.current(),{row:i,col:o}=r.getOuterTopStartCorner(),s=this.tableProps.countRenderableColumnsInRange(0,o-1),a=this.tableProps.countRenderableRowsInRange(0,i-1);r.highlight.isHeader()?bt(ua,this).setOffsetSize({x:o<0?Math.abs(o):-s,y:i<0?Math.abs(i):-a}):bt(ua,this).setOffsetSize({x:o<0?0:-s,y:i<0?0:-a});const l=bt(ua,this).transformStart(e,n);this.setRangeFocus(l.normalize())}shiftRows(e,n){if(!this.isSelected())return;const r=this.selectedRange.current();if(this.isSelectedByCorner())this.selectAll(!0,!0,{disableHeadersHighlight:!0});else if(this.isSelectedByColumnHeader()||r.getOuterTopStartCorner().row>=e){const{from:i,to:o,highlight:s}=r,a=this.tableProps.countRows(),l=this.isSelectedByRowHeader(),u=this.isSelectedByColumnHeader(),c=u?-1:0,h=u?0:n;this.getSelectedRange().pop();const d=this.tableProps.createCellCoords(Ue(i.row+h,c,a-1),i.col),f=this.tableProps.createCellCoords(Ue(o.row+n,c,a-1),o.col);this.markSource("shift"),s.row>=e?this.setRangeStartOnly(d,!0,this.tableProps.createCellCoords(Ue(s.row+n,0,a-1),s.col)):this.setRangeStartOnly(d,!0),l&&this.selectedByRowHeader.add(this.getLayerLevel()),u&&this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(f),this.markEndSource()}}shiftColumns(e,n){if(!this.isSelected())return;const r=this.selectedRange.current();if(this.isSelectedByCorner())this.selectAll(!0,!0,{disableHeadersHighlight:!0});else if(this.isSelectedByRowHeader()||r.getOuterTopStartCorner().col>=e){const{from:i,to:o,highlight:s}=r,a=this.tableProps.countCols(),l=this.isSelectedByRowHeader(),u=this.isSelectedByColumnHeader(),c=l?-1:0,h=l?0:n;this.getSelectedRange().pop();const d=this.tableProps.createCellCoords(i.row,Ue(i.col+h,c,a-1)),f=this.tableProps.createCellCoords(o.row,Ue(o.col+n,c,a-1));this.markSource("shift"),s.col>=e?this.setRangeStartOnly(d,!0,this.tableProps.createCellCoords(s.row,Ue(s.col+n,0,a-1))):this.setRangeStartOnly(d,!0),l&&this.selectedByRowHeader.add(this.getLayerLevel()),u&&this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(f),this.markEndSource()}}getLayerLevel(){return this.selectedRange.size()-1}isSelected(){return!this.selectedRange.isEmpty()}isMultiple(){if(!this.isSelected())return!1;const e=Mr(!this.selectedRange.current().isSingle());return this.runLocalHooks("afterIsMultipleSelection",e),e.value}isFocusSelectionChanged(){return this.isSelected()&&bt(lf,this)}isSelectedByRowHeader(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getLayerLevel();return!this.isSelectedByCorner(e)&&(e===-1?this.selectedByRowHeader.size>0:this.selectedByRowHeader.has(e))}isEntireRowSelected(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getLayerLevel();const n=i=>{const{col:o}=i.getOuterTopStartCorner(),s=this.tableProps.countRowHeaders(),a=this.tableProps.countCols();return(s>0&&o<0||s===0)&&i.getWidth()===a};if(e===-1)return Array.from(this.selectedRange).some(i=>n(i));const r=this.selectedRange.peekByIndex(e);return r?n(r):!1}isSelectedByColumnHeader(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getLayerLevel();return!this.isSelectedByCorner()&&(e===-1?this.selectedByColumnHeader.size>0:this.selectedByColumnHeader.has(e))}isEntireColumnSelected(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getLayerLevel();const n=i=>{const{row:o}=i.getOuterTopStartCorner(),s=this.tableProps.countColHeaders(),a=this.tableProps.countRows();return(s>0&&o<0||s===0)&&i.getHeight()===a};if(e===-1)return Array.from(this.selectedRange).some(i=>n(i));const r=this.selectedRange.peekByIndex(e);return r?n(r):!1}isSelectedByAnyHeader(){return this.isSelectedByRowHeader(-1)||this.isSelectedByColumnHeader(-1)||this.isSelectedByCorner()}isSelectedByCorner(){return this.selectedByColumnHeader.has(this.getLayerLevel())&&this.selectedByRowHeader.has(this.getLayerLevel())}inInSelection(e){return this.selectedRange.includes(e)}isCellCornerVisible(){return this.settings.fillHandle&&!this.tableProps.isEditorOpened()&&!this.isMultiple()}isCellVisible(e){const n=this.tableProps.visualToRenderableCoords(e);return n.row!==null&&n.col!==null}isAreaCornerVisible(e){return Number.isInteger(e)&&e!==this.getLayerLevel()?!1:this.settings.fillHandle&&!this.tableProps.isEditorOpened()&&this.isMultiple()}clear(){this.selectedRange.clear(),this.highlight.clear()}deselect(){this.isSelected()&&(this.inProgress=!1,this.clear(),this.runLocalHooks("afterDeselect"))}selectAll(){var e;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{focusPosition:!1,disableHeadersHighlight:!1};const o=this.tableProps.countRows(),s=this.tableProps.countCols(),a=this.tableProps.countRowHeaders(),l=this.tableProps.countColHeaders(),u=r?-l:0,c=n?-a:0;if(u===0&&c===0&&(o===0||s===0))return;let h=(e=this.getSelectedRange().current())===null||e===void 0?void 0:e.highlight;const{focusPosition:d,disableHeadersHighlight:f}=i;Li(_c,this,f),d&&Number.isInteger(d==null?void 0:d.row)&&Number.isInteger(d==null?void 0:d.col)&&(h=this.tableProps.createCellCoords(Ue(d.row,u,o-1),Ue(d.col,c,s-1)));const g=this.tableProps.createCellCoords(u,c),C=this.tableProps.createCellCoords(o-1,s-1);this.clear(),this.setRangeStartOnly(g,void 0,h),c<0&&this.selectedByRowHeader.add(this.getLayerLevel()),u<0&&this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(C),this.finish(),Li(_c,this,!1)}selectCells(e){var n=this;const r=Nu(e);if(r===mp)return!1;if(r===gp)throw new Error(nt`Unsupported format of the selection ranges was passed. To select cells pass\x20
|
|
52
|
+
the coordinates as an array of arrays ([[rowStart, columnStart/columnPropStart, rowEnd,\x20
|
|
53
|
+
columnEnd/columnPropEnd]]) or as an array of CellRange objects.`);const i=Gh(r,{createCellCoords:function(){return n.tableProps.createCellCoords(...arguments)},createCellRange:function(){return n.tableProps.createCellRange(...arguments)},propToCol:l=>this.tableProps.propToCol(l),keepDirection:!0}),o=this.settings.navigableHeaders,s={countRows:this.tableProps.countRows(),countCols:this.tableProps.countCols(),countRowHeaders:o?this.tableProps.countRowHeaders():0,countColHeaders:o?this.tableProps.countColHeaders():0},a=!e.some(l=>{const u=i(l),c=u.isValid(s);return!(c&&!u.containsHeaders()||c&&u.containsHeaders()&&u.isSingleHeader())});return a&&(this.clear(),this.setExpectedLayers(e.length),M(e,l=>{const{from:u,to:c}=i(l);this.setRangeStartOnly(u.clone(),!1),this.setRangeEnd(c.clone())}),this.finish()),a}selectColumns(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;const i=typeof e=="string"?this.tableProps.propToCol(e):e,o=typeof n=="string"?this.tableProps.propToCol(n):n,s=this.tableProps.countRows(),a=this.tableProps.countCols(),l=this.tableProps.countColHeaders(),u=l===0?0:-l,c=this.tableProps.createCellCoords(u,i),h=this.tableProps.createCellCoords(s-1,o),d=this.tableProps.createCellRange(c,c,h).isValid({countRows:s,countCols:a,countRowHeaders:0,countColHeaders:l});if(d){let f=0,g=0;Number.isInteger(r==null?void 0:r.row)&&Number.isInteger(r==null?void 0:r.col)?(f=Ue(r.row,u,s-1),g=Ue(r.col,Math.min(i,o),Math.max(i,o))):(f=Ue(r,u,s-1),g=i);const C=this.tableProps.createCellCoords(f,g),y=l===0?0:Ue(C.row,u,-1),E=s-1,v=this.tableProps.createCellCoords(y,i),P=this.tableProps.createCellCoords(E,o);this.runLocalHooks("beforeSelectColumns",v,P,C),v.row=y,P.row=E,this.setRangeStartOnly(v,void 0,C),this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(P),this.runLocalHooks("afterSelectColumns",v,P,C),this.finish()}return d}selectRows(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;const i=this.tableProps.countRows(),o=this.tableProps.countCols(),s=this.tableProps.countRowHeaders(),a=s===0?0:-s,l=this.tableProps.createCellCoords(e,a),u=this.tableProps.createCellCoords(n,o-1),c=this.tableProps.createCellRange(l,l,u).isValid({countRows:i,countCols:o,countRowHeaders:s,countColHeaders:0});if(c){let h=0,d=0;Number.isInteger(r==null?void 0:r.row)&&Number.isInteger(r==null?void 0:r.col)?(h=Ue(r.row,Math.min(e,n),Math.max(e,n)),d=Ue(r.col,a,o-1)):(h=e,d=Ue(r,a,o-1));const f=this.tableProps.createCellCoords(h,d),g=s===0?0:Ue(f.col,a,-1),C=o-1,y=this.tableProps.createCellCoords(e,g),E=this.tableProps.createCellCoords(n,C);this.runLocalHooks("beforeSelectRows",y,E,f),y.col=g,E.col=C,this.setRangeStartOnly(y,void 0,f),this.selectedByRowHeader.add(this.getLayerLevel()),this.setRangeEnd(E),this.runLocalHooks("afterSelectRows",y,E,f),this.finish()}return c}refresh(){if(!this.isSelected())return;const e=this.tableProps.countRows(),n=this.tableProps.countCols();if(e===0||n===0){this.deselect();return}const r=this.selectedRange.peekByIndex(this.selectedRange.size()-1),{from:i,to:o,highlight:s}=r;this.clear(),s.assign({row:Ue(s.row,-1/0,e-1),col:Ue(s.col,-1/0,n-1)}),i.assign({row:Ue(i.row,-1/0,e-1),col:Ue(i.col,-1/0,n-1)}),o.assign({row:Ue(o.row,0,e-1),col:Ue(o.col,0,n-1)}),this.selectedRange.ranges.push(r),this.highlight.isEnabledFor(Ch,this.selectedRange.current().highlight)&&this.highlight.getFocus().add(s).commit().syncWith(r),this.applyAndCommit(r)}commit(){if(this.highlight.getCustomSelections().forEach(i=>{i.commit()}),!this.isSelected())return;const n=this.getLayerLevel(),r=this.selectedRange.current();this.highlight.isEnabledFor(Ch,r.highlight)&&this.highlight.getFocus().commit().syncWith(r);for(let i=0;i<this.selectedRange.size();i+=1){this.highlight.useLayerLevel(i);const o=this.highlight.createArea(),s=this.highlight.createLayeredArea(),a=this.highlight.createRowHeader(),l=this.highlight.createColumnHeader(),u=this.highlight.createActiveRowHeader(),c=this.highlight.createActiveColumnHeader(),h=this.highlight.createActiveCornerHeader(),d=this.highlight.createRowHighlight(),f=this.highlight.createColumnHighlight();o.commit(),s.commit(),a.commit(),l.commit(),u.commit(),c.commit(),h.commit(),d.commit(),f.commit()}this.highlight.useLayerLevel(n)}}ut(VD,Rn);const sx=/^(\r\n|\n\r|\r|\n)/,YK=/^[^\t\r\n]+/,ax=/^\t/;function GK(t){const e=[[""]];if(t.length===0)return e;let n=0,r=0,i;for(;t.length>0&&i!==t.length;)if(i=t.length,t.match(ax))t=t.replace(ax,""),n+=1,e[r][n]="";else if(t.match(sx))t=t.replace(sx,""),n=0,r+=1,e[r]=[""];else{let o="";if(t.startsWith('"')){let s=0,a=!0;for(;a;){const l=t.slice(0,1);l==='"'&&(s+=1),o+=l,t=t.slice(1),(t.length===0||t.match(/^[\t\r\n]/)&&s%2===0)&&(a=!1)}o=o.replace(/^"/,"").replace(/"$/,"").replace(/["]*/g,l=>new Array(Math.floor(l.length/2)).fill('"').join(""))}else{const s=t.match(YK);o=s?s[0]:"",t=t.slice(o.length)}e[r][n]=o}return e}function bh(t){let e,n,r,i,o="",s;for(e=0,n=t.length;e<n;e+=1){for(i=t[e].length,r=0;r<i;r+=1)r>0&&(o+=" "),s=t[e][r],typeof s=="string"?s.indexOf(`
|
|
54
|
+
`)>-1?o+=`"${s.replace(/"/g,'""')}"`:o+=s:s==null?o+="":o+=s;e!==n-1&&(o+=`
|
|
55
|
+
`)}return o}function ca(t,e,n){return(e=qK(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function qK(t){var e=KK(t,"string");return typeof e=="symbol"?e:e+""}function KK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class vu{static get DESTINATION_RENDERER(){return 1}static get DESTINATION_CLIPBOARD_GENERATOR(){return 2}constructor(e,n,r){ca(this,"hot",void 0),ca(this,"metaManager",void 0),ca(this,"tableMeta",void 0),ca(this,"dataSource",void 0),ca(this,"duckSchema",void 0),ca(this,"colToPropCache",void 0),ca(this,"propToColCache",void 0),this.hot=e,this.metaManager=r,this.tableMeta=r.getTableMeta(),this.dataSource=n,this.refreshDuckSchema(),this.createMap()}createMap(){const e=this.getSchema();if(typeof e>"u")throw new Error("trying to create `columns` definition but you didn't provide `schema` nor `data`");const n=this.tableMeta.columns;let r;if(this.colToPropCache=[],this.propToColCache=new Map,n){let i=0,o=0,s=!1;if(typeof n=="function"){const a=AR(e);i=a>0?a:this.countFirstRowKeys(),s=!0}else{const a=this.tableMeta.maxCols;i=Math.min(a,n.length)}for(r=0;r<i;r++){const a=s?n(r):n[r];if(Ae(a)){if(typeof a.data<"u"){const l=s?o:r;this.colToPropCache[l]=a.data,this.propToColCache.set(a.data,l)}o+=1}}}else this.recursiveDuckColumns(e)}countFirstRowKeys(){return SD(this.dataSource)}recursiveDuckColumns(e,n,r){let i=n,o=r,s;return typeof i>"u"&&(i=0,o=""),typeof e=="object"&&!Array.isArray(e)&&He(e,(a,l)=>{a===null?(s=o+l,this.colToPropCache.push(s),this.propToColCache.set(s,i),i+=1):i=this.recursiveDuckColumns(a,i,`${l}.`)}),i}colToProp(e){if(Number.isInteger(e)===!1)return e;const n=this.hot.toPhysicalColumn(e);return n===null?e:this.colToPropCache&&ae(this.colToPropCache[n])?this.colToPropCache[n]:n}propToCol(e){const n=this.propToColCache.get(e);if(ae(n))return this.hot.toVisualColumn(n);const r=this.hot.toVisualColumn(e);return r===null?e:r}getSchema(){const e=this.tableMeta.dataSchema;return e?typeof e=="function"?e():e:this.duckSchema}createDuckSchema(){return this.dataSource&&this.dataSource[0]?Uh(this.dataSource[0]):{}}refreshDuckSchema(){this.duckSchema=this.createDuckSchema()}createRow(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,{source:r,mode:i="above"}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const o=this.hot.countSourceRows();let s=o,a=0,l=e;if((typeof l!="number"||l>=o)&&(l=o),l<this.hot.countRows()&&(s=this.hot.toPhysicalRow(l)),this.hot.runHooks("beforeCreateRow",l,n,r)===!1||s===null)return{delta:0};const c=this.tableMeta.maxRows,h=this.getSchema().length,d=[];for(;a<n&&o+a<c;){let g=null;this.hot.dataType==="array"?this.tableMeta.dataSchema?g=Gn(this.getSchema()):(g=[],de(h-1,()=>g.push(null))):this.hot.dataType==="function"?g=this.tableMeta.dataSchema(l+a):(g={},op(g,this.getSchema())),d.push(g),a+=1}this.hot.rowIndexMapper.insertIndexes(l,a),i==="below"&&(s=Math.min(s+1,o)),this.spliceData(s,0,d);const f=this.hot.toVisualRow(s);return this.hot.countSourceRows()===d.length&&this.hot.columnIndexMapper.initToLength(this.hot.getInitialColumnCount()),a>0&&(e==null?this.metaManager.createRow(null,a):r!=="auto"&&this.metaManager.createRow(s,n)),this.hot.runHooks("afterCreateRow",f,a,r),{delta:a,startPhysicalIndex:s}}createCol(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,{source:r,mode:i="start"}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!this.hot.isColumnModificationAllowed())throw new Error("Cannot create new column. When data source in an object, you can only have as much columns as defined in first data row, data schema or in the 'columns' setting.If you want to be able to add new columns, you have to use array datasource.");const o=this.dataSource,s=this.tableMeta.maxCols,a=this.hot.countSourceCols();let l=e;if((typeof l!="number"||l>=a)&&(l=a),this.hot.runHooks("beforeCreateCol",l,n,r)===!1)return{delta:0};let c=a;l<this.hot.countCols()&&(c=this.hot.toPhysicalColumn(l));const h=this.hot.countSourceRows();let d=this.hot.countCols(),f=0,g=c;i==="end"&&(g=Math.min(g+1,a));const C=g;for(;f<n&&d<s;){if(typeof l!="number"||l>=d)if(h>0)for(let E=0;E<h;E+=1)typeof o[E]>"u"&&(o[E]=[]),o[E].push(null);else o.push([null]);else for(let E=0;E<h;E++)o[E].splice(g,0,null);f+=1,g+=1,d+=1}this.hot.columnIndexMapper.insertIndexes(l,f),f>0&&(e==null?this.metaManager.createColumn(null,f):r!=="auto"&&this.metaManager.createColumn(C,n));const y=this.hot.toVisualColumn(C);return this.hot.runHooks("afterCreateCol",y,f,r),this.refreshDuckSchema(),{delta:f,startPhysicalIndex:C}}removeRow(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,r=arguments.length>2?arguments[2]:void 0,i=Number.isInteger(e)?e:-n;const o=this.visualRowsToPhysical(i,n),s=this.hot.countSourceRows();if(i=(s+i)%s,this.hot.runHooks("beforeRemoveRow",i,o.length,o,r)===!1)return!1;const l=o.length;if(this.filterData(i,l,o),i<this.hot.countRows()){this.hot.rowIndexMapper.removeIndexes(o);const c=ae(this.tableMeta.columns)||ae(this.tableMeta.dataSchema)||this.tableMeta.colHeaders;this.hot.rowIndexMapper.getNotTrimmedIndexesLength()===0&&!c&&this.hot.columnIndexMapper.setIndexesSequence([])}return o.slice(0).sort((c,h)=>h-c).forEach(c=>{this.metaManager.removeRow(c,1)}),this.hot.runHooks("afterRemoveRow",i,l,o,r),!0}removeCol(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,r=arguments.length>2?arguments[2]:void 0;if(this.hot.dataType==="object"||this.tableMeta.columns)throw new Error("cannot remove column with object data source or columns option specified");let i=typeof e!="number"?-n:e;i=(this.hot.countCols()+i)%this.hot.countCols();const o=this.visualColumnsToPhysical(i,n),s=o.slice(0).sort((h,d)=>d-h);if(this.hot.runHooks("beforeRemoveCol",i,n,o,r)===!1)return!1;let l=!0;const u=s.length,c=this.dataSource;for(let h=0;h<u;h++)l&&o[0]!==o[h]-h&&(l=!1);if(l)for(let h=0,d=this.hot.countSourceRows();h<d;h++)c[h].splice(o[0],n),h===0&&this.metaManager.removeColumn(o[0],n);else for(let h=0,d=this.hot.countSourceRows();h<d;h++)for(let f=0;f<u;f++)c[h].splice(s[f],1),h===0&&this.metaManager.removeColumn(s[f],1);return i<this.hot.countCols()&&(this.hot.columnIndexMapper.removeIndexes(o),!this.tableMeta.rowHeaders&&this.hot.columnIndexMapper.getNotTrimmedIndexesLength()===0&&this.hot.rowIndexMapper.setIndexesSequence([])),this.hot.runHooks("afterRemoveCol",i,n,o,r),this.refreshDuckSchema(),!0}spliceCol(e,n,r){const i=this.hot.getDataAtCol(e),o=i.slice(n,n+r),s=i.slice(n+r);for(var a=arguments.length,l=new Array(a>3?a-3:0),u=3;u<a;u++)l[u-3]=arguments[u];fP(l,s);let c=0;for(;c<r;)l.push(null),c+=1;return wU(l),this.hot.populateFromArray(n,e,l,null,null,"spliceCol"),o}spliceRow(e,n,r){const i=this.hot.getSourceDataAtRow(e),o=i.slice(n,n+r),s=i.slice(n+r);for(var a=arguments.length,l=new Array(a>3?a-3:0),u=3;u<a;u++)l[u-3]=arguments[u];fP(l,s);let c=0;for(;c<r;)l.push(null),c+=1;return this.hot.populateFromArray(e,n,[l],null,null,"spliceRow"),o}spliceData(e,n,r){if(this.hot.runHooks("beforeDataSplice",e,n,r)!==!1){const o=[...this.dataSource.slice(0,e),...r,...this.dataSource.slice(e)];this.dataSource.length=0,o.forEach(s=>this.dataSource.push(s))}}filterData(e,n,r){let i=this.hot.runHooks("filterData",e,n,r);Array.isArray(i)===!1&&(i=this.dataSource.filter((o,s)=>r.indexOf(s)===-1)),this.dataSource.length=0,Array.prototype.push.apply(this.dataSource,i)}get(e,n){const r=this.hot.toPhysicalRow(e);let i=this.dataSource[r];const o=this.hot.runHooks("modifyRowData",r);i=isNaN(o)?o:i;const{dataDotNotation:s}=this.hot.getSettings();let a=null;if(i&&i.hasOwnProperty&&tn(i,n))a=i[n];else if(s&&typeof n=="string"&&n.indexOf(".")>-1){let l=i;if(!l)return null;const u=n.split(".");for(let c=0,h=u.length;c<h;c++)if(l=l[u[c]],typeof l>"u")return null;a=l}else typeof n=="function"&&(a=n(this.dataSource.slice(r,r+1)[0]));if(this.hot.hasHook("modifyData")){const l=Mr(a);this.hot.runHooks("modifyData",r,this.propToCol(n),l,"get"),l.isTouched()&&(a=l.value)}return a}getCopyable(e,n){return this.hot.getCellMeta(e,this.propToCol(n)).copyable?this.get(e,n):""}set(e,n,r){const i=this.hot.toPhysicalRow(e);let o=r,s=this.dataSource[i];const a=this.hot.runHooks("modifyRowData",i);if(s=isNaN(a)?a:s,this.hot.hasHook("modifyData")){const u=Mr(o);this.hot.runHooks("modifyData",i,this.propToCol(n),u,"set"),u.isTouched()&&(o=u.value)}const{dataDotNotation:l}=this.hot.getSettings();if(s&&s.hasOwnProperty&&tn(s,n))s[n]=o;else if(l&&typeof n=="string"&&n.indexOf(".")>-1){let u=s,c=0,h;const d=n.split(".");for(c=0,h=d.length-1;c<h;c++){if(d[c]==="__proto__"||d[c]==="constructor"||d[c]==="prototype")return;typeof u[d[c]]>"u"&&(u[d[c]]={}),u=u[d[c]]}u[d[c]]=o}else if(typeof n=="function")n(this.dataSource.slice(i,i+1)[0],o);else{if(n==="__proto__"||n==="constructor"||n==="prototype")return;s[n]=o}}visualRowsToPhysical(e,n){const r=this.hot.countSourceRows(),i=[];let o=(r+e)%r,s=n,a;for(;o<r&&s;)a=this.hot.toPhysicalRow(o),i.push(a),s-=1,o+=1;return i}visualColumnsToPhysical(e,n){const r=this.hot.countCols(),i=[];let o=(r+e)%r,s=n;for(;o<r&&s;){const a=this.hot.toPhysicalColumn(o);i.push(a),s-=1,o+=1}return i}clear(){for(let e=0;e<this.hot.countSourceRows();e++)for(let n=0;n<this.hot.countCols();n++)this.set(e,this.colToProp(n),"")}getLength(){const e=this.tableMeta.maxRows;let n;e<0||e===0?n=0:n=e||1/0;const r=this.hot.rowIndexMapper.getNotTrimmedIndexesLength();return Math.min(r,n)}getAll(){const e={row:0,col:0},n={row:Math.max(this.hot.countRows()-1,0),col:Math.max(this.hot.countCols()-1,0)};return e.row-n.row===0&&!this.hot.countSourceRows()?[]:this.getRange(e,n,vu.DESTINATION_RENDERER)}countCachedColumns(){return this.colToPropCache.length}getRange(e,n,r){const i=[];let o,s,a;const l=this.tableMeta.maxRows,u=this.tableMeta.maxCols;if(l===0||u===0)return[];const c=r===vu.DESTINATION_CLIPBOARD_GENERATOR?this.getCopyable:this.get,h=Math.min(Math.max(l-1,0),Math.max(e.row,n.row)),d=Math.min(Math.max(u-1,0),Math.max(e.col,n.col));for(o=Math.min(e.row,n.row);o<=h;o++){a=[];const f=o>=0?this.hot.toPhysicalRow(o):o;for(s=Math.min(e.col,n.col);s<=d&&f!==null;s++)a.push(c.call(this,o,this.colToProp(s)));f!==null&&i.push(a)}return i}getText(e,n){return bh(this.getRange(e,n,vu.DESTINATION_RENDERER))}getCopyableText(e,n){return bh(this.getRange(e,n,vu.DESTINATION_CLIPBOARD_GENERATOR))}destroy(){this.hot=null,this.metaManager=null,this.dataSource=null,this.duckSchema=null,this.colToPropCache.length=0,this.propToColCache.clear(),this.propToColCache=void 0}}const{register:XK,getItem:ZK,hasItem:WD,getNames:_le,getValues:Mle}=Oi("cellTypes");function QK(t){if(!WD(t))throw Error(`You declared cell type "${t}" as a string that is not mapped to a known object.
|
|
56
|
+
Cell type must be an object or a string mapped to an object registered by
|
|
57
|
+
"Handsontable.cellTypes.registerCellType" method`);return ZK(t)}function ci(t,e){typeof t!="string"&&(e=t,t=e.CELL_TYPE);const{editor:n,renderer:r,validator:i}=e;n&&yr(t,n),r&&Lr(t,r),i&&cu(t,i),XK(t,e)}function JK(t,e){var n;return t==="CELL_TYPE"?!1:((n=e._automaticallyAssignedMetaProps)===null||n===void 0?void 0:n.has(t))||!tn(e,t)}function pp(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t;const r=typeof e.type=="string"?QK(e.type):e.type;if(t._automaticallyAssignedMetaProps&&He(e,(o,s)=>void t._automaticallyAssignedMetaProps.delete(s)),!Ae(r))return;n===t&&!t._automaticallyAssignedMetaProps&&(t._automaticallyAssignedMetaProps=new Set);const i={};He(r,(o,s)=>{if(JK(s,n)){var a;i[s]=o,(a=t._automaticallyAssignedMetaProps)===null||a===void 0||a.add(s)}}),rn(t,i)}function e3(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];function n(){}lz(n,t);for(let r=0;r<e.length;r++)n.prototype[e[r]]=void 0;return n}function Mg(t){return Number.isInteger(t)&&t>=0}function Ig(t,e){if(!t())throw new Error(`Assertion failed: ${e}`)}function cf(t){return t==null}const BD=()=>({_automaticallyAssignedMetaProps:void 0,activeHeaderClassName:"ht__active_highlight",allowEmpty:!0,allowHtml:!1,allowInsertColumn:!0,allowInsertRow:!0,allowInvalid:!0,allowRemoveColumn:!0,allowRemoveRow:!0,ariaTags:!0,autoColumnSize:void 0,autoRowSize:void 0,autoWrapCol:!1,autoWrapRow:!1,bindRowsWithHeaders:void 0,cell:[],cells:void 0,checkedTemplate:void 0,className:void 0,colHeaders:null,collapsibleColumns:void 0,columnHeaderHeight:void 0,columns:void 0,columnSorting:void 0,columnSummary:void 0,colWidths:void 0,commentedCellClassName:"htCommentCell",comments:!1,contextMenu:void 0,copyable:!0,copyPaste:!0,correctFormat:!1,currentColClassName:void 0,currentHeaderClassName:"ht__highlight",currentRowClassName:void 0,customBorders:!1,data:void 0,dataDotNotation:!0,dataSchema:void 0,dateFormat:"DD/MM/YYYY",timeFormat:"h:mm:ss a",datePickerConfig:void 0,defaultDate:void 0,disableVisualSelection:!1,dragToScroll:!0,dropdownMenu:void 0,editor:void 0,enterBeginsEditing:!0,enterMoves:{col:0,row:1},fillHandle:{autoInsertRow:!1},filter:!0,filteringCaseSensitive:!1,filters:void 0,fixedColumnsLeft:0,fixedColumnsStart:0,fixedRowsBottom:0,fixedRowsTop:0,formulas:void 0,fragmentSelection:!1,headerClassName:void 0,height:void 0,hiddenColumns:void 0,hiddenRows:void 0,invalidCellClassName:"htInvalid",imeFastEdit:!1,isEmptyCol(t){let e,n,r;for(e=0,n=this.countRows();e<n;e++)if(r=this.getDataAtCell(e,t),Ut(r)===!1)return!1;return!0},isEmptyRow(t){let e,n,r,i;for(e=0,n=this.countCols();e<n;e++)if(r=this.getDataAtCell(t,e),Ut(r)===!1)return typeof r=="object"?(i=this.getCellMeta(t,e),xR(this.getSchema()[i.prop],r)):!1;return!0},label:void 0,language:"en-US",layoutDirection:"inherit",licenseKey:void 0,locale:"en-US",manualColumnFreeze:void 0,manualColumnMove:void 0,manualColumnResize:void 0,manualRowMove:void 0,manualRowResize:void 0,maxCols:1/0,maxRows:1/0,mergeCells:!1,minCols:0,minRows:0,minSpareCols:0,minSpareRows:0,multiColumnSorting:void 0,navigableHeaders:!1,tabNavigation:!0,nestedHeaders:void 0,nestedRows:void 0,noWordWrapClassName:"htNoWrap",numericFormat:void 0,observeDOMVisibility:!0,outsideClickDeselects:!0,persistentState:void 0,placeholder:void 0,placeholderCellClassName:"htPlaceholder",preventOverflow:!1,preventWheel:!1,readOnly:!1,readOnlyCellClassName:"htDimmed",renderAllRows:!1,renderAllColumns:!1,renderer:void 0,rowHeaders:void 0,rowHeaderWidth:void 0,rowHeights:void 0,search:!1,selectionMode:"multiple",selectOptions:void 0,skipColumnOnPaste:!1,skipRowOnPaste:!1,sortByRelevance:!0,source:void 0,startCols:5,startRows:5,stretchH:"none",strict:void 0,tableClassName:void 0,themeName:void 0,tabMoves:{row:0,col:1},title:void 0,trimDropdown:!0,trimRows:void 0,trimWhitespace:!0,type:"text",uncheckedTemplate:void 0,undo:!0,validator:void 0,viewportColumnRenderingOffset:"auto",viewportRowRenderingOffset:"auto",viewportColumnRenderingThreshold:0,viewportRowRenderingThreshold:0,visibleRows:10,width:void 0,wordWrap:!0});function lx(t,e,n){return(e=t3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function t3(t){var e=n3(t,"string");return typeof e=="symbol"?e:e+""}function n3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function r3(){return class{}}class i3{constructor(e){lx(this,"metaCtor",r3()),lx(this,"meta",void 0),this.meta=this.metaCtor.prototype,rn(this.meta,BD()),this.meta.instance=e}getMetaConstructor(){return this.metaCtor}getMeta(){return this.meta}updateMeta(e){var n;rn(this.meta,e),pp(this.meta,{...e,type:(n=e.type)!==null&&n!==void 0?n:this.meta.type},e)}}function o3(t,e,n){return(e=s3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function s3(t){var e=a3(t,"string");return typeof e=="symbol"?e:e+""}function a3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class l3{constructor(e){o3(this,"meta",void 0);const n=e.getMetaConstructor();this.meta=new n}getMeta(){return this.meta}updateMeta(e){rn(this.meta,e),pp(this.meta,e,e)}}function hf(t,e,n){return(e=u3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function u3(t){var e=c3(t,"string");return typeof e=="symbol"?e:e+""}function c3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class nm{constructor(e){hf(this,"valueFactory",void 0),hf(this,"data",[]),hf(this,"index",[]),hf(this,"holes",new Set),this.valueFactory=e}obtain(e){Ig(()=>Mg(e),"Expecting an unsigned number.");const n=this._getStorageIndexByKey(e);let r;if(n>=0)r=this.data[n],r===void 0&&(r=this.valueFactory(e),this.data[n]=r);else if(r=this.valueFactory(e),this.holes.size>0){const i=this.holes.values().next().value;this.holes.delete(i),this.data[i]=r,this.index[e]=i}else this.data.push(r),this.index[e]=this.data.length-1;return r}insert(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;Ig(()=>Mg(e)||cf(e),"Expecting an unsigned number or null/undefined argument.");const r=[],i=this.data.length;for(let s=0;s<n;s++)r.push(i+s),this.data.push(void 0);const o=cf(e)?this.index.length:e;this.index=[...this.index.slice(0,o),...r,...this.index.slice(o)]}remove(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;Ig(()=>Mg(e)||cf(e),"Expecting an unsigned number or null/undefined argument.");const r=this.index.splice(cf(e)?this.index.length-n:e,n);for(let i=0;i<r.length;i++){const o=r[i];typeof o=="number"&&this.holes.add(o)}}size(){return this.data.length-this.holes.size}values(){return this.data.filter((e,n)=>e!==void 0&&!this.holes.has(n))[Symbol.iterator]()}entries(){const e=[];for(let r=0;r<this.data.length;r++){const i=this._getKeyByStorageIndex(r);i!==-1&&this.data[r]!==void 0&&e.push([i,this.data[r]])}let n=0;return{next:()=>{if(n<e.length){const r=e[n];return n+=1,{value:r,done:!1}}return{done:!0}}}}clear(){this.data=[],this.index=[],this.holes.clear()}_getStorageIndexByKey(e){return this.index.length>e?this.index[e]:-1}_getKeyByStorageIndex(e){return this.index.indexOf(e)}[Symbol.iterator](){return this.entries()}}function ux(t,e,n){return(e=h3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function h3(t){var e=d3(t,"string");return typeof e=="symbol"?e:e+""}function d3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const f3=["data","width"];class g3{constructor(e){ux(this,"globalMeta",void 0),ux(this,"metas",new nm(()=>this._createMeta())),this.globalMeta=e,this.metas=new nm(()=>this._createMeta())}updateMeta(e,n){const r=this.getMeta(e);rn(r,n),pp(r,n)}createColumn(e,n){this.metas.insert(e,n)}removeColumn(e,n){this.metas.remove(e,n)}getMeta(e){return this.metas.obtain(e)}getMetaConstructor(e){return this.metas.obtain(e).constructor}clearCache(){this.metas.clear()}_createMeta(){return e3(this.globalMeta.getMetaConstructor(),f3).prototype}}function cx(t,e,n){return(e=m3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function m3(t){var e=p3(t,"string");return typeof e=="symbol"?e:e+""}function p3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class w3{constructor(e){cx(this,"columnMeta",void 0),cx(this,"metas",new nm(()=>this._createRow())),this.columnMeta=e}updateMeta(e,n,r){const i=this.getMeta(e,n);rn(i,r),pp(i,r)}createRow(e,n){this.metas.insert(e,n)}createColumn(e,n){for(let r=0;r<this.metas.size();r++)this.metas.obtain(r).insert(e,n)}removeRow(e,n){this.metas.remove(e,n)}removeColumn(e,n){for(let r=0;r<this.metas.size();r++)this.metas.obtain(r).remove(e,n)}getMeta(e,n,r){const i=this.metas.obtain(e).obtain(n);return r===void 0?i:i[r]}setMeta(e,n,r,i){var o;const s=this.metas.obtain(e).obtain(n);(o=s._automaticallyAssignedMetaProps)===null||o===void 0||o.delete(r),s[r]=i}removeMeta(e,n,r){const i=this.metas.obtain(e).obtain(n);delete i[r]}getMetas(){const e=[],n=Array.from(this.metas.values());for(let r=0;r<n.length;r++)ae(n[r])&&e.push(...n[r].values());return e}getMetasAtRow(e){Ig(()=>Mg(e),"Expecting an unsigned number.");const n=new Map(this.metas);return n.has(e)?Array.from(n.get(e).values()):[]}clearCache(){this.metas.clear()}_createRow(){return new nm(e=>this._createMeta(e))}_createMeta(e){const n=this.columnMeta.getMetaConstructor(e);return new n}}class jD{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];this.hot=e,this.globalMeta=new i3(e),this.tableMeta=new l3(this.globalMeta),this.columnMeta=new g3(this.globalMeta),this.cellMeta=new w3(this.columnMeta),r.forEach(i=>new i(this)),this.globalMeta.updateMeta(n)}getGlobalMeta(){return this.globalMeta.getMeta()}updateGlobalMeta(e){this.globalMeta.updateMeta(e)}getTableMeta(){return this.tableMeta.getMeta()}updateTableMeta(e){this.tableMeta.updateMeta(e)}getColumnMeta(e){return this.columnMeta.getMeta(e)}updateColumnMeta(e,n){this.columnMeta.updateMeta(e,n)}getCellMeta(e,n,r){const i=this.cellMeta.getMeta(e,n);return i.visualRow=r.visualRow,i.visualCol=r.visualColumn,i.row=e,i.col=n,r.skipMetaExtension||this.runLocalHooks("afterGetCellMeta",i),i}getCellMetaKeyValue(e,n,r){if(typeof r!="string")throw new Error("The passed cell meta object key is not a string");return this.cellMeta.getMeta(e,n,r)}setCellMeta(e,n,r,i){this.cellMeta.setMeta(e,n,r,i)}updateCellMeta(e,n,r){this.cellMeta.updateMeta(e,n,r)}removeCellMeta(e,n,r){this.cellMeta.removeMeta(e,n,r)}getCellsMeta(){return this.cellMeta.getMetas()}getCellsMetaAtRow(e){return this.cellMeta.getMetasAtRow(e)}createRow(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cellMeta.createRow(e,n)}removeRow(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cellMeta.removeRow(e,n)}createColumn(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cellMeta.createColumn(e,n),this.columnMeta.createColumn(e,n)}removeColumn(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cellMeta.removeColumn(e,n),this.columnMeta.removeColumn(e,n)}clearCellsCache(){this.cellMeta.clearCache()}clearCache(){this.cellMeta.clearCache(),this.columnMeta.clearCache()}}ut(jD,Rn);function hx(t,e,n,r){const{hotInstance:i,dataMap:o,dataSource:s,internalSource:a,source:l,metaManager:u,firstRun:c}=r,h=Ti(a),d=i.getSettings();Array.isArray(d.dataSchema)?i.dataType="array":ot(d.dataSchema)?i.dataType="function":i.dataType="object",o&&o.destroy(),t=i.runHooks(`before${h}`,t,c,l);const f=new vu(i,t,u);if(e(f),typeof t=="object"&&t!==null)t.push&&t.splice||(t=[t]);else if(t===null){const g=f.getSchema();t=[];let C,y=0,E=0;for(y=0,E=d.startRows;y<E;y++)if((i.dataType==="object"||i.dataType==="function")&&d.dataSchema)C=Gn(g),t.push(C);else if(i.dataType==="array")C=Gn(g[0]),t.push(C);else{C=[];for(let v=0,P=d.startCols;v<P;v++)C.push(null);t.push(C)}}else throw new Error(`${a} only accepts array of objects or array of arrays (${typeof t} given)`);Array.isArray(t[0])&&(i.dataType="array"),d.data=t,f.dataSource=t,s.data=t,s.dataType=i.dataType,s.colToProp=f.colToProp.bind(f),s.propToCol=f.propToCol.bind(f),s.countCachedColumns=f.countCachedColumns.bind(f),n(f),i.runHooks(`after${h}`,t,c,l),c||(i.runHooks("afterChange",null,a),i.render()),i.getSettings().ariaTags&&ye(i.rootElement,[bN(-1),tp(i.countCols()+(i.view?i.countRowHeaders():0))])}function dx(t,e,n){return(e=v3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function v3(t){var e=C3(t,"string");return typeof e=="symbol"?e:e+""}function C3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class y3{constructor(e){var n=this;dx(this,"metaManager",void 0),dx(this,"metaSyncMemo",new Map),this.metaManager=e,e.addLocalHook("afterGetCellMeta",function(){return n.extendCellMeta(...arguments)}),re.getSingleton().add("beforeRender",r=>{r&&this.metaSyncMemo.clear()},this.metaManager.hot)}extendCellMeta(e){var n;const{row:r,col:i}=e;if((n=this.metaSyncMemo.get(r))!==null&&n!==void 0&&n.has(i))return;const{visualRow:o,visualCol:s}=e,a=this.metaManager.hot,l=a.colToProp(s);e.prop=l,a.runHooks("beforeGetCellMeta",o,s,e);const u=tn(e,"type")?e.type:null;let c=ot(e.cells)?e.cells(r,i,l):null;if(u)if(c){var h;c.type=(h=c.type)!==null&&h!==void 0?h:u}else c={type:u};c&&this.metaManager.updateCellMeta(r,i,c),a.runHooks("afterGetCellMeta",o,s,e),this.metaSyncMemo.has(r)||this.metaSyncMemo.set(r,new Set),this.metaSyncMemo.get(r).add(i)}}function b3(t,e,n){S3(t,e),e.set(t,n)}function S3(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function JC(t,e,n){return(e=R3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function R3(t){var e=E3(t,"string");return typeof e=="symbol"?e:e+""}function E3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function T3(t,e){return t.get(_3(t,e))}function _3(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var fx=new WeakMap;class M3{constructor(e){JC(this,"metaManager",void 0),JC(this,"usageTracker",new Set),JC(this,"propDescriptors",new Map([["ariaTags",{initOnly:!0}],["fixedColumnsLeft",{target:"fixedColumnsStart",onChange(n){if(this.metaManager.hot.isRtl()&&n==="fixedColumnsLeft")throw new Error("The `fixedColumnsLeft` is not supported for RTL. Please use option `fixedColumnsStart`.");if(this.usageTracker.has("fixedColumnsLeft")&&this.usageTracker.has("fixedColumnsStart"))throw new Error("The `fixedColumnsLeft` and `fixedColumnsStart` should not be used together. Please use only the option `fixedColumnsStart`.")}}],["layoutDirection",{initOnly:!0}],["renderAllColumns",{initOnly:!0}],["renderAllRows",{initOnly:!0}]])),b3(this,fx,(n,r,i)=>{if(!i)throw new Error(`The \`${n}\` option can not be updated after the Handsontable is initialized.`)}),this.metaManager=e,this.extendMetaProps()}extendMetaProps(){this.propDescriptors.forEach((e,n)=>{const{initOnly:r,target:i,onChange:o}=e,s=typeof i=="string",a=s?i:n,l=`_${a}`;this.metaManager.globalMeta.meta[l]=this.metaManager.globalMeta.meta[a],o?(this.installPropWatcher(n,l,o),s&&this.installPropWatcher(i,l,o)):r&&(this.installPropWatcher(n,l,T3(fx,this)),this.metaManager.globalMeta.meta._initOnlySettings||(this.metaManager.globalMeta.meta._initOnlySettings=[]),this.metaManager.globalMeta.meta._initOnlySettings.push(n))})}installPropWatcher(e,n,r){const i=this;Object.defineProperty(this.metaManager.globalMeta.meta,e,{get(){return this[n]},set(o){const s=!i.usageTracker.has(e);i.usageTracker.add(e),r.call(i,e,o,s),this[n]=o},enumerable:!0,configurable:!0})}}const UD="gridDefault",Qs="editorManager.handlingEditor",I3={name:"editorCloseAndSave",callback(t){t._getEditorManager().closeEditorAndSaveChanges()}},P3="hooksRefRegisterer",zD={_hooksStorage:Object.create(null),addHook(t,e){return this._hooksStorage[t]||(this._hooksStorage[t]=[]),this.hot.addHook(t,e),this._hooksStorage[t].push(e),this},removeHooksByKey(t){M(this._hooksStorage[t]||[],e=>{this.hot.removeHook(t,e)})},clearHooks(){He(this._hooksStorage,(t,e)=>this.removeHooksByKey(e)),this._hooksStorage={}}};ss(zD,"MIXIN_NAME",P3,{writable:!1,enumerable:!1});function oi(t,e,n){return(e=O3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function O3(t){var e=x3(t,"string");return typeof e=="symbol"?e:e+""}function x3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const A3="base",Bt=Object.freeze({VIRGIN:"STATE_VIRGIN",EDITING:"STATE_EDITING",WAITING:"STATE_WAITING",FINISHED:"STATE_FINISHED"});class Zu{static get EDITOR_TYPE(){return A3}constructor(e){oi(this,"hot",void 0),oi(this,"state",Bt.VIRGIN),oi(this,"_opened",!1),oi(this,"_fullEditMode",!1),oi(this,"_closeCallback",null),oi(this,"TD",null),oi(this,"row",null),oi(this,"col",null),oi(this,"prop",null),oi(this,"originalValue",null),oi(this,"cellProperties",null),this.hot=e,this.init()}_fireCallbacks(e){this._closeCallback&&(this._closeCallback(e),this._closeCallback=null)}init(){}getValue(){throw Error("Editor getValue() method unimplemented")}setValue(){throw Error("Editor setValue() method unimplemented")}open(){throw Error("Editor open() method unimplemented")}close(){throw Error("Editor close() method unimplemented")}prepare(e,n,r,i,o,s){this.TD=i,this.row=e,this.col=n,this.prop=r,this.originalValue=o,this.cellProperties=s,this.state=this.isOpened()?this.state:Bt.VIRGIN}extend(){return class extends this.constructor{}}saveValue(e,n){let r,i,o,s;if(n){const l=this.hot.getSelectedLast();r=Math.max(Math.min(l[0],l[2]),0),i=Math.max(Math.min(l[1],l[3]),0),o=Math.max(l[0],l[2]),s=Math.max(l[1],l[3])}else[r,i,o,s]=[this.row,this.col,null,null];const a=this.hot.runHooks("modifyGetCellCoords",r,i,!1,"meta");Array.isArray(a)&&([r,i]=a),this.hot.populateFromArray(r,i,e,o,s,"edit")}beginEditing(e,n){if(this.state!==Bt.VIRGIN)return;const r=this.hot,i=r.rowIndexMapper.getRenderableFromVisualIndex(this.row),o=r.columnIndexMapper.getRenderableFromVisualIndex(this.col),s=()=>{if(this.state=Bt.EDITING,this.isInFullEditMode()){const l=typeof e=="string"?e:Pt(this.originalValue);this.setValue(l)}this.open(n),this._opened=!0,this.focus(),r.view.render(),r.runHooks("afterBeginEditing",this.row,this.col)};this.hot.addHookOnce("afterScroll",s),r.view.scrollViewport(r._createCellCoords(i,o))||(this.hot.removeHook("afterScroll",s),s())}finishEditing(e,n,r){let i;if(r){const o=this._closeCallback;this._closeCallback=s=>{o&&o(s),r(s),this.hot.view.render()}}if(!this.isWaiting()){if(this.state===Bt.VIRGIN){this.hot._registerTimeout(()=>{this._fireCallbacks(!0)});return}if(this.state===Bt.EDITING){if(e){this.cancelChanges(),this.hot.view.render();return}const o=this.getValue();this.cellProperties.trimWhitespace?i=[[typeof o=="string"?String.prototype.trim.call(o||""):o]]:i=[[o]],this.state=Bt.WAITING,this.saveValue(i,n),this.hot.getCellValidator(this.cellProperties)?this.hot.addHookOnce("postAfterValidate",s=>{this.state=Bt.FINISHED,this.discardEditor(s)}):(this.state=Bt.FINISHED,this.discardEditor(!0))}}}cancelChanges(){this.state=Bt.FINISHED,this.discardEditor()}discardEditor(e){this.state===Bt.FINISHED&&(e===!1&&this.cellProperties.allowInvalid!==!0?(this.hot.selectCell(this.row,this.col),this.focus(),this.state=Bt.EDITING,this._fireCallbacks(!1)):(this.close(),this._opened=!1,this._fullEditMode=!1,this.state=Bt.VIRGIN,this._fireCallbacks(!0),this.hot.getShortcutManager().setActiveContextName("grid")))}enableFullEditMode(){this._fullEditMode=!0}isInFullEditMode(){return this._fullEditMode}isOpened(){return this._opened}isWaiting(){return this.state===Bt.WAITING}getEditedCellRect(){var e;const n=this.getEditedCell();if(!n)return;const{wtOverlays:r,wtViewport:i}=this.hot.view._wt,o=this.hot.rootWindow,s=An(n),a=qt(n),l=An(this.hot.rootElement),u=qt(this.hot.rootElement),c=r.topOverlay.holder,h=r.inlineStartOverlay.holder,d=c!==o?c.scrollTop:0,f=h!==o?h.scrollLeft:0,g=o.innerWidth-l.left-u,{wtTable:C}=(e=r.getParentOverlay(n))!==null&&e!==void 0?e:this.hot.view._wt,y=C.name,E=["master","inline_start"].includes(y)?d:0,v=["master","top","bottom"].includes(y)?f:0,P=s.top===l.top?0:1;let O=s.top-l.top-P-E,L=0;this.hot.isRtl()?L=o.innerWidth-s.left-a-g-1+v:L=s.left-l.left-1-v,["top","top_inline_start_corner"].includes(y)&&(O+=r.topOverlay.getOverlayOffset()),["inline_start","top_inline_start_corner"].includes(y)&&(L+=Math.abs(r.inlineStartOverlay.getOverlayOffset()));const T=this.hot.hasColHeaders(),A=this.hot.rowIndexMapper.getRenderableFromVisualIndex(this.row),q=this.hot.columnIndexMapper.getRenderableFromVisualIndex(this.col),j=this.hot.rowIndexMapper.getRenderableIndexesLength()-this.hot.view._wt.getSetting("fixedRowsBottom");(T&&A<=0||A===j)&&(O+=1),q<=0&&(L+=1);const Z=i.rowsRenderCalculator.startPosition,J=i.columnsRenderCalculator.startPosition,se=Math.abs(r.inlineStartOverlay.getScrollPosition()),te=r.topOverlay.getScrollPosition(),ue=vn(this.hot.rootDocument);let pt=n.offsetTop;if(["inline_start","master"].includes(y)&&(pt+=Z-te),["bottom","bottom_inline_start_corner"].includes(y)){const{wtViewport:Y,wtTable:K}=r.bottomOverlay.clone;pt+=Y.getWorkspaceHeight()-K.getHeight()-ue}let be=n.offsetLeft;this.hot.isRtl()?(be>=0?be=C.getWidth()-n.offsetLeft:be=Math.abs(be),be+=J-se-a):["top","master","bottom"].includes(y)&&(be+=J-se);const ke=o.getComputedStyle(this.TD),wt=this.hot.isRtl()?"borderRightWidth":"borderLeftWidth",fn=parseInt(ke[wt],10)>0?0:1,et=parseInt(ke.borderTopWidth,10)>0?0:1,m=qt(n)+fn,w=nn(n)+et,p=xN(c)?ue:0,I=AN(h)?ue:0,$=this.hot.view.maximumVisibleElementWidth(be)-p+fn,B=Math.max(this.hot.view.maximumVisibleElementHeight(pt)-I+et,this.hot.view.getDefaultRowHeight());return{top:O,start:L,height:w,maxHeight:B,width:m,maxWidth:$}}getEditedCellsLayerClass(){switch(this.checkEditorSection()){case"inline-start":return"ht_clone_left ht_clone_inline_start";case"bottom":return"ht_clone_bottom";case"bottom-inline-start-corner":return"ht_clone_bottom_left_corner ht_clone_bottom_inline_start_corner";case"top":return"ht_clone_top";case"top-inline-start-corner":return"ht_clone_top_left_corner ht_clone_top_inline_start_corner";default:return"ht_clone_master"}}getEditedCell(){return this.hot.getCell(this.row,this.col,!0)}checkEditorSection(){const e=this.hot.countRows();let n="";return this.row<this.hot.getSettings().fixedRowsTop?this.col<this.hot.getSettings().fixedColumnsStart?n="top-inline-start-corner":n="top":this.hot.getSettings().fixedRowsBottom&&this.row>=e-this.hot.getSettings().fixedRowsBottom?this.col<this.hot.getSettings().fixedColumnsStart?n="bottom-inline-start-corner":n="bottom":this.col<this.hot.getSettings().fixedColumnsStart&&(n="inline-start"),n}}ut(Zu,zD);const H3={name:"editorCloseAndSaveByArrowKeys",callback(t,e,n){const r=t._getEditorManager(),i=r.getActiveEditor();i.isInFullEditMode()&&i.state===Bt.EDITING||(r.closeEditorAndSaveChanges(),t.getSelected()&&(n.includes("arrowdown")?t.selection.transformStart(1,0):n.includes("arrowup")?t.selection.transformStart(-1,0):n.includes("arrowleft")?t.selection.transformStart(0,-1*t.getDirectionFactor()):n.includes("arrowright")&&t.selection.transformStart(0,t.getDirectionFactor())),e.preventDefault())}},N3={name:"editorCloseAndSaveByEnter",callback(t,e){const n=t._getEditorManager();n.closeEditorAndSaveChanges(e.ctrlKey||e.metaKey),n.moveSelectionAfterEnter(e)}},D3={name:"editorCloseWithoutSaving",callback(t){const e=t._getEditorManager();e.closeEditorAndRestoreOriginalValue(t.getShortcutManager().isCtrlPressed()),e.activeEditor.focus()}},k3={name:"editorFastOpen",callback(t,e){const{highlight:n}=t.getSelectedRangeLast();n.isHeader()||t._getEditorManager().openEditor(null,e,!0)}},L3={name:"editorOpen",callback(t,e,n){const r=t._getEditorManager(),i=t.getSelectedRangeLast(),{highlight:o}=i;if(t.selection.isMultiple()&&!i.isHeader()&&t.countRenderedCols()>0&&t.countRenderedRows()>0){const s=t.getSettings(),a=typeof s.enterMoves=="function"?s.enterMoves(e):s.enterMoves;n.includes("shift")?t.selection.transformFocus(-a.row,-a.col):t.selection.transformFocus(a.row,a.col);return}o.isHeader()||(t.getSettings().enterBeginsEditing?r.cellProperties.readOnly?r.moveSelectionAfterEnter(e):r.openEditor(null,e,!0):r.moveSelectionAfterEnter(e),Pi(e))}};function $3(){return[I3,H3,N3,D3,k3,L3]}const F3={name:"extendCellsSelectionDown",callback(t){const{selection:e}=t,{highlight:n}=t.getSelectedRangeLast();!e.isSelectedByColumnHeader()&&!e.isSelectedByCorner()&&(n.isCell()||n.isHeader()&&e.isSelectedByRowHeader())&&(e.markSource("keyboard"),e.transformEnd(1,0),e.markEndSource())}},V3={name:"extendCellsSelectionDownByViewportHeight",callback(t){const{selection:e,rowIndexMapper:n}=t,{to:r}=t.getSelectedRangeLast(),i=Math.min(r.row+t.countVisibleRows(),t.countRows()-1),o=n.getNearestNotHiddenIndex(i,-1);if(o!==null){const s=t._createCellCoords(o,r.col),a=r.row-t.getFirstFullyVisibleRow(),l=Math.min(s.row-a,t.countRows()-1);e.markSource("keyboard"),e.setRangeEnd(s),e.markEndSource(),t.scrollViewportTo({row:l,verticalSnap:"top",horizontalSnap:"start"})}}},W3={name:"extendCellsSelectionLeft",callback(t){const{selection:e}=t,{highlight:n}=t.getSelectedRangeLast();!e.isSelectedByRowHeader()&&!e.isSelectedByCorner()&&(n.isCell()||n.isHeader()&&e.isSelectedByColumnHeader())&&(e.markSource("keyboard"),e.transformEnd(0,-1*t.getDirectionFactor()),e.markEndSource())}},B3={name:"extendCellsSelectionRight",callback(t){const{selection:e}=t,{highlight:n}=t.getSelectedRangeLast();!e.isSelectedByRowHeader()&&!e.isSelectedByCorner()&&(n.isCell()||n.isHeader()&&e.isSelectedByColumnHeader())&&(e.markSource("keyboard"),e.transformEnd(0,t.getDirectionFactor()),e.markEndSource())}},j3={name:"extendCellsSelectionToColumns",callback(t){const{selection:e}=t,{highlight:n,from:r,to:i}=t.getSelectedRangeLast();e.markSource("keyboard"),e.isSelectedByRowHeader()?e.selectAll(!0,!0):t.selectColumns(r.col,i.col,n),e.markEndSource()}},U3={name:"extendCellsSelectionToMostBottom",callback(t){const{selection:e,rowIndexMapper:n}=t,{highlight:r,from:i,to:o}=t.getSelectedRangeLast(),s=r.isHeader()&&e.isSelectedByRowHeader();if(r.isCell()||s){const a=n.getNearestNotHiddenIndex(t.countRows()-1,-1),l=i.clone();l.row=r.row,e.markSource("keyboard"),e.setRangeStart(l,void 0,!1,r.clone()),s&&e.selectedByRowHeader.add(e.getLayerLevel()),e.setRangeEnd(t._createCellCoords(a,o.col)),e.markEndSource()}}},z3={name:"extendCellsSelectionToMostInlineEnd",callback(t){const{selection:e,columnIndexMapper:n}=t,{highlight:r,from:i,to:o}=t.getSelectedRangeLast();if(!e.isSelectedByRowHeader()&&!e.isSelectedByCorner()&&r.isCell()){const s=n.getNearestNotHiddenIndex(t.countCols()-1,-1),a=i.clone();a.col=r.col,e.markSource("keyboard"),e.setRangeStart(a,void 0,!1,r.clone()),e.setRangeEnd(t._createCellCoords(o.row,s)),e.markEndSource()}}},Y3={name:"extendCellsSelectionToMostInlineStart",callback(t){const{selection:e,columnIndexMapper:n}=t,{highlight:r,from:i,to:o}=t.getSelectedRangeLast();if(!e.isSelectedByRowHeader()&&!e.isSelectedByCorner()&&r.isCell()){const s=parseInt(t.getSettings().fixedColumnsStart,10),a=n.getNearestNotHiddenIndex(s,1),l=i.clone();l.col=r.col,e.markSource("keyboard"),e.setRangeStart(l,void 0,!1,r.clone()),e.setRangeEnd(t._createCellCoords(o.row,a)),e.markEndSource()}}},G3={name:"extendCellsSelectionToMostLeft",callback(t){const{selection:e,columnIndexMapper:n}=t,{highlight:r,from:i,to:o}=t.getSelectedRangeLast(),s=r.isHeader()&&e.isSelectedByColumnHeader();if(r.isCell()||s){const a=n.getNearestNotHiddenIndex(...t.isRtl()?[t.countCols()-1,-1]:[0,1]),l=i.clone();l.col=r.col,e.markSource("keyboard"),e.setRangeStart(l,void 0,!1,r.clone()),s&&e.selectedByColumnHeader.add(e.getLayerLevel()),e.setRangeEnd(t._createCellCoords(o.row,a)),e.markEndSource()}}},q3={name:"extendCellsSelectionToMostRight",callback(t){const{selection:e,columnIndexMapper:n}=t,{highlight:r,from:i,to:o}=t.getSelectedRangeLast(),s=r.isHeader()&&e.isSelectedByColumnHeader();if(r.isCell()||s){const a=n.getNearestNotHiddenIndex(...t.isRtl()?[0,1]:[t.countCols()-1,-1]),l=i.clone();l.col=r.col,e.markSource("keyboard"),e.setRangeStart(l,void 0,!1,r.clone()),s&&e.selectedByColumnHeader.add(e.getLayerLevel()),e.setRangeEnd(t._createCellCoords(o.row,a)),e.markEndSource()}}},K3={name:"extendCellsSelectionToMostTop",callback(t){const{selection:e,rowIndexMapper:n}=t,{highlight:r,from:i,to:o}=t.getSelectedRangeLast(),s=r.isHeader()&&e.isSelectedByRowHeader();if(r.isCell()||s){const a=n.getNearestNotHiddenIndex(0,1),l=i.clone();l.row=r.row,e.markSource("keyboard"),e.setRangeStart(l,void 0,!1,r.clone()),s&&e.selectedByRowHeader.add(e.getLayerLevel()),e.setRangeEnd(t._createCellCoords(a,o.col)),e.markEndSource()}}},X3={name:"extendCellsSelectionToRows",callback(t){const{selection:e}=t,{highlight:n,from:r,to:i}=t.getSelectedRangeLast();e.markSource("keyboard"),e.isSelectedByColumnHeader()?e.selectAll(!0,!0):t.selectRows(r.row,i.row,n),e.markEndSource()}},Z3={name:"extendCellsSelectionUp",callback(t){const{selection:e}=t,{highlight:n}=t.getSelectedRangeLast();!e.isSelectedByColumnHeader()&&!e.isSelectedByCorner()&&(n.isCell()||n.isHeader()&&e.isSelectedByRowHeader())&&(e.markSource("keyboard"),e.transformEnd(-1,0),e.markEndSource())}},Q3={name:"extendCellsSelectionUpByViewportHeight",callback(t){const{selection:e,rowIndexMapper:n}=t,{to:r}=t.getSelectedRangeLast(),i=Math.max(r.row-t.countVisibleRows(),0),o=n.getNearestNotHiddenIndex(i,1);if(o!==null){const s=t._createCellCoords(o,r.col),a=r.row-t.getFirstFullyVisibleRow(),l=Math.max(s.row-a,0);e.markSource("keyboard"),e.setRangeEnd(s),e.markEndSource(),t.scrollViewportTo({row:l,verticalSnap:"top",horizontalSnap:"start"})}}};function J3(){return[F3,V3,W3,B3,j3,U3,z3,Y3,G3,q3,K3,X3,Z3,Q3]}const eX={name:"moveCellSelectionDown",callback(t){let{selection:e}=t;e.markSource("keyboard"),e.transformStart(1,0),e.markEndSource()}},tX={name:"moveCellSelectionDownByViewportHeight",callback(t){const{selection:e}=t,{navigableHeaders:n}=t.getSettings(),r=n?t.countColHeaders():0,{row:i}=t.getSelectedRangeLast().highlight;let o=t.countVisibleRows()+r;o=o===0?1:o,i===t.countRows()-1?o=1:i+o>t.countRows()&&(o=t.countRows()-i-1),e.markSource("keyboard"),e.transformStart(o,0),e.markEndSource(),t.getSelectedRangeLast().highlight.row<0&&t.scrollViewportTo({row:0})}},nX={name:"moveCellSelectionInlineEnd",callback(t,e){const{selection:n}=t,r=t.getSettings(),i=t.getSelectedRangeLast(),o=typeof r.tabMoves=="function"?r.tabMoves(e):r.tabMoves;n.markSource("keyboard"),n.isMultiple()&&!i.isHeader()&&t.countRenderedCols()>0&&t.countRenderedRows()>0?n.transformFocus(-o.row,-o.col):n.transformStart(-o.row,-o.col),n.markEndSource()}},rX={name:"moveCellSelectionInlineStart",callback(t,e){const{selection:n}=t,r=t.getSettings(),i=t.getSelectedRangeLast(),o=typeof r.tabMoves=="function"?r.tabMoves(e):r.tabMoves;n.markSource("keyboard"),n.isMultiple()&&!i.isHeader()&&t.countRenderedCols()>0&&t.countRenderedRows()>0?n.transformFocus(o.row,o.col):n.transformStart(o.row,o.col),n.markEndSource()}},iX={name:"moveCellSelectionLeft",callback(t){const{selection:e}=t;e.markSource("keyboard"),e.transformStart(0,-1*t.getDirectionFactor()),e.markEndSource()}},oX={name:"moveCellSelectionRight",callback(t){const{selection:e}=t;e.markSource("keyboard"),e.transformStart(0,t.getDirectionFactor()),e.markEndSource()}},sX={name:"moveCellSelectionToMostBottom",callback(t){const{selection:e}=t,{col:n}=t.getSelectedRangeLast().highlight;let r=t.rowIndexMapper.getNearestNotHiddenIndex(t.countRows()-1,-1);r===null&&(r=-1),e.setRangeStart(t._createCellCoords(r,n))}},aX={name:"moveCellSelectionToMostBottomInlineEnd",callback(t){const{selection:e,rowIndexMapper:n,columnIndexMapper:r}=t,i=parseInt(t.getSettings().fixedRowsBottom,10),o=n.getNearestNotHiddenIndex(t.countRows()-i-1,-1),s=r.getNearestNotHiddenIndex(t.countCols()-1,-1);e.markSource("keyboard"),e.setRangeStart(t._createCellCoords(o,s)),e.markEndSource()}},lX={name:"moveCellSelectionToMostInlineEnd",callback(t){const{selection:e,columnIndexMapper:n}=t;e.markSource("keyboard"),e.setRangeStart(t._createCellCoords(t.getSelectedRangeLast().highlight.row,n.getNearestNotHiddenIndex(t.countCols()-1,-1))),e.markEndSource()}},uX={name:"moveCellSelectionToMostInlineStart",callback(t){const{selection:e,columnIndexMapper:n}=t,r=parseInt(t.getSettings().fixedColumnsStart,10),i=t.getSelectedRangeLast().highlight.row,o=n.getNearestNotHiddenIndex(r,1);e.markSource("keyboard"),e.setRangeStart(t._createCellCoords(i,o)),e.markEndSource()}},cX={name:"moveCellSelectionToMostLeft",callback(t){const{selection:e,columnIndexMapper:n}=t,r=t.getSelectedRangeLast().highlight.row;let i=n.getNearestNotHiddenIndex(...t.isRtl()?[t.countCols()-1,-1]:[0,1]);i===null&&(i=t.isRtl()?-1:-t.countRowHeaders()),e.markSource("keyboard"),e.setRangeStart(t._createCellCoords(r,i)),e.markEndSource()}},hX={name:"moveCellSelectionToMostRight",callback(t){const{selection:e,columnIndexMapper:n}=t,{row:r}=t.getSelectedRangeLast().highlight;let i=n.getNearestNotHiddenIndex(...t.isRtl()?[0,1]:[t.countCols()-1,-1]);i===null&&(i=t.isRtl()?-t.countRowHeaders():-1),e.markSource("keyboard"),e.setRangeStart(t._createCellCoords(r,i)),e.markEndSource()}},dX={name:"moveCellSelectionToMostTop",callback(t){const{selection:e}=t,{col:n}=t.getSelectedRangeLast().highlight;let r=t.rowIndexMapper.getNearestNotHiddenIndex(0,1);r===null&&(r=-t.countColHeaders()),e.markSource("keyboard"),e.setRangeStart(t._createCellCoords(r,n)),e.markEndSource()}},fX={name:"moveCellSelectionToMostTopInlineStart",callback(t){const{selection:e,rowIndexMapper:n,columnIndexMapper:r}=t,i=parseInt(t.getSettings().fixedRowsTop,10),o=parseInt(t.getSettings().fixedColumnsStart,10),s=n.getNearestNotHiddenIndex(i,1),a=r.getNearestNotHiddenIndex(o,1);e.markSource("keyboard"),e.setRangeStart(t._createCellCoords(s,a)),e.markEndSource()}},gX={name:"moveCellSelectionUp",callback(t){let{selection:e}=t;e.markSource("keyboard"),e.transformStart(-1,0),e.markEndSource()}},mX={name:"moveCellSelectionUpByViewportHight",callback(t){const{selection:e}=t,{navigableHeaders:n}=t.getSettings(),r=n?t.countColHeaders():0,{row:i}=t.getSelectedRangeLast().highlight;let o=t.countVisibleRows()+r;o=o===0?-1:-o,i===-r?o=-1:i+o<r&&(o=-(i+r)),e.markSource("keyboard"),e.transformStart(o,0),e.markEndSource(),t.getSelectedRangeLast().highlight.row<0&&t.scrollViewportTo({row:0})}};function pX(){return[eX,tX,nX,rX,iX,oX,sX,aX,lX,uX,cX,hX,dX,fX,gX,mX]}const wX={name:"emptySelectedCells",callback(t){t.emptySelectedCells(),t._getEditorManager().prepareEditor()}},vX={name:"scrollToFocusedCell",callback(t){const{highlight:e}=t.getSelectedRangeLast(),n=t.getFirstFullyVisibleRow()-1,r=t.getFirstFullyVisibleColumn()-1,i=t.getLastFullyVisibleRow()+1,o=t.getLastFullyVisibleColumn()+1,s=t._createCellCoords(n,r),a=t._createCellCoords(i,o);if(!t._createCellRange(s,s,a).includes(e)&&(e.row>=0||e.col>=0)){const u={};if(e.col>=0){const c=Math.floor(t.countVisibleCols()/2);u.col=Math.max(e.col-c,0)}if(e.row>=0){const c=Math.floor(t.countVisibleRows()/2);u.row=Math.max(e.row-c,0)}t.scrollViewportTo({...u,verticalSnap:"top",horizontalSnap:"start"})}}},CX={name:"selectAllCells",callback(t){let{selection:e}=t;e.markSource("keyboard"),e.selectAll(!0,!0,{disableHeadersHighlight:!0}),e.markEndSource()}},yX={name:"selectAllCellsAndHeaders",callback(t){let{selection:e}=t;e.markSource("keyboard"),e.selectAll(!0,!0,{disableHeadersHighlight:!1}),e.markEndSource()}},bX={name:"populateSelectedCellsData",callback(t){const e=t.getSelectedRange(),{row:n,col:r}=e[e.length-1].highlight.normalize(),i=t.getDataAtCell(n,r),o=new Map;for(let s=0;s<e.length;s++)e[s].forAll((a,l)=>{if(a>=0&&l>=0&&(a!==n||l!==r)){const{readOnly:u}=t.getCellMeta(a,l);u||o.set(`${a}x${l}`,[a,l,i])}});t.setDataAtCell(Array.from(o.values()))}},SX=[...$3(),...J3(),...pX(),wX,vX,CX,yX,bX];function YD(t){const e={};return SX.forEach(n=>{let{name:r,callback:i}=n;e[r]=function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return i(t,...s)}}),e}function RX(t){const e=t.getShortcutManager().addContext("editor"),n=YD(t),r={group:Qs};e.addShortcuts([{keys:[["Enter"],["Enter","Shift"]],callback:(i,o)=>n.editorCloseAndSaveByEnter(i,o)},{keys:[["Enter","Control/Meta"],["Enter","Control/Meta","Shift"]],captureCtrl:!0,callback:(i,o)=>n.editorCloseAndSaveByEnter(i,o)},{keys:[["Tab"],["Tab","Shift"],["PageDown"],["PageUp"]],forwardToContext:t.getShortcutManager().getContext("grid"),callback:(i,o)=>n.editorCloseAndSave(i,o)},{keys:[["ArrowDown"],["ArrowUp"],["ArrowLeft"],["ArrowRight"]],preventDefault:!1,callback:(i,o)=>n.editorCloseAndSaveByArrowKeys(i,o)},{keys:[["Escape"],["Escape","Control/Meta"]],callback:()=>n.editorCloseWithoutSaving()}],r)}function EX(t){const e=t.getShortcutManager().addContext("grid"),n=YD(t),r={runOnlyIf:()=>{const{navigableHeaders:i}=t.getSettings();return ae(t.getSelected())&&(i||!i&&t.countRenderedRows()>0&&t.countRenderedCols()>0)},group:UD};e.addShortcuts([{keys:[["F2"]],callback:i=>n.editorFastOpen(i)},{keys:[["Enter"],["Enter","Shift"]],callback:(i,o)=>n.editorOpen(i,o)},{keys:[["Backspace"],["Delete"]],callback:()=>n.emptySelectedCells()}],{group:Qs,runOnlyIf:()=>ae(t.getSelected())}),e.addShortcuts([{keys:[["Control/Meta","A"]],callback:()=>n.selectAllCells(),runOnlyIf:()=>{var i;return!((i=t.getSelectedRangeLast())!==null&&i!==void 0&&i.highlight.isHeader())}},{keys:[["Control/Meta","A"]],callback:()=>{},runOnlyIf:()=>{var i;return(i=t.getSelectedRangeLast())===null||i===void 0?void 0:i.highlight.isHeader()},preventDefault:!0},{keys:[["Control/Meta","Shift","Space"]],callback:()=>n.selectAllCellsAndHeaders()},{keys:[["Control/Meta","Enter"]],callback:()=>n.populateSelectedCellsData(),runOnlyIf:()=>{var i,o;return!((i=t.getSelectedRangeLast())!==null&&i!==void 0&&i.highlight.isHeader())&&((o=t.getSelectedRangeLast())===null||o===void 0?void 0:o.getCellsCount())>1}},{keys:[["Control","Space"]],captureCtrl:!0,callback:()=>n.extendCellsSelectionToColumns()},{keys:[["Shift","Space"]],stopPropagation:!0,callback:()=>n.extendCellsSelectionToRows()},{keys:[["ArrowUp"]],callback:()=>n.moveCellSelectionUp()},{keys:[["ArrowUp","Control/Meta"]],captureCtrl:!0,callback:()=>n.moveCellSelectionToMostTop()},{keys:[["ArrowUp","Shift"]],callback:()=>n.extendCellsSelectionUp()},{keys:[["ArrowUp","Shift","Control/Meta"]],captureCtrl:!0,callback:()=>n.extendCellsSelectionToMostTop(),runOnlyIf:()=>!(t.selection.isSelectedByCorner()||t.selection.isSelectedByColumnHeader())},{keys:[["ArrowDown"]],callback:()=>n.moveCellSelectionDown()},{keys:[["ArrowDown","Control/Meta"]],captureCtrl:!0,callback:()=>n.moveCellSelectionToMostBottom()},{keys:[["ArrowDown","Shift"]],callback:()=>n.extendCellsSelectionDown()},{keys:[["ArrowDown","Shift","Control/Meta"]],captureCtrl:!0,callback:()=>n.extendCellsSelectionToMostBottom(),runOnlyIf:()=>!(t.selection.isSelectedByCorner()||t.selection.isSelectedByColumnHeader())},{keys:[["ArrowLeft"]],callback:()=>n.moveCellSelectionLeft()},{keys:[["ArrowLeft","Control/Meta"]],captureCtrl:!0,callback:()=>n.moveCellSelectionToMostLeft()},{keys:[["ArrowLeft","Shift"]],callback:()=>n.extendCellsSelectionLeft()},{keys:[["ArrowLeft","Shift","Control/Meta"]],captureCtrl:!0,callback:()=>n.extendCellsSelectionToMostLeft(),runOnlyIf:()=>!(t.selection.isSelectedByCorner()||t.selection.isSelectedByRowHeader())},{keys:[["ArrowRight"]],callback:()=>n.moveCellSelectionRight()},{keys:[["ArrowRight","Control/Meta"]],captureCtrl:!0,callback:()=>n.moveCellSelectionToMostRight()},{keys:[["ArrowRight","Shift"]],callback:()=>n.extendCellsSelectionRight()},{keys:[["ArrowRight","Shift","Control/Meta"]],captureCtrl:!0,callback:()=>n.extendCellsSelectionToMostRight(),runOnlyIf:()=>!(t.selection.isSelectedByCorner()||t.selection.isSelectedByRowHeader())},{keys:[["Home"]],captureCtrl:!0,callback:()=>n.moveCellSelectionToMostInlineStart(),runOnlyIf:()=>t.view.isMainTableNotFullyCoveredByOverlays()},{keys:[["Home","Shift"]],callback:()=>n.extendCellsSelectionToMostInlineStart()},{keys:[["Home","Control/Meta"]],captureCtrl:!0,callback:()=>n.moveCellSelectionToMostTopInlineStart(),runOnlyIf:()=>t.view.isMainTableNotFullyCoveredByOverlays()},{keys:[["End"]],captureCtrl:!0,callback:()=>n.moveCellSelectionToMostInlineEnd(),runOnlyIf:()=>t.view.isMainTableNotFullyCoveredByOverlays()},{keys:[["End","Shift"]],callback:()=>n.extendCellsSelectionToMostInlineEnd()},{keys:[["End","Control/Meta"]],captureCtrl:!0,callback:()=>n.moveCellSelectionToMostBottomInlineEnd(),runOnlyIf:()=>t.view.isMainTableNotFullyCoveredByOverlays()},{keys:[["PageUp"]],callback:()=>n.moveCellSelectionUpByViewportHight()},{keys:[["PageUp","Shift"]],callback:()=>n.extendCellsSelectionUpByViewportHeight()},{keys:[["PageDown"]],callback:()=>n.moveCellSelectionDownByViewportHeight()},{keys:[["PageDown","Shift"]],callback:()=>n.extendCellsSelectionDownByViewportHeight()},{keys:[["Tab"]],preventDefault:!1,callback:i=>n.moveCellSelectionInlineStart(i)},{keys:[["Shift","Tab"]],preventDefault:!1,callback:i=>n.moveCellSelectionInlineEnd(i)},{keys:[["Control/Meta","Backspace"]],callback:()=>n.scrollToFocusedCell()}],r)}function TX(t){[EX,RX].forEach(e=>e(t))}function _X(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n=t.rootElement,r=gx(t),i=gx(t);return r.addEventListener("focus",()=>e==null?void 0:e.onFocusFromTop()),i.addEventListener("focus",()=>e==null?void 0:e.onFocusFromBottom()),n.firstChild.before(r),n.lastChild.after(i),{activate(){t._registerTimeout(()=>{r.tabIndex=0,i.tabIndex=0},10)},deactivate(){t._registerTimeout(()=>{r.tabIndex=-1,i.tabIndex=-1},10)}}}function gx(t){const n=t.rootDocument.createElement("input");return n.type="text",n.name="__htFocusCatcher",n.classList.add("htFocusCatcher"),t.getSettings().ariaTags&&ye(n,[Bh("Focus catcher")]),n}function MX(t){const e=IX(t);let n;const{activate:r,deactivate:i}=_X(t,{onFocusFromTop(){var h;const d=(h=e(n))!==null&&h!==void 0?h:uS(t);d&&(t.runHooks("modifyFocusOnTabNavigation","from_above",d),t.selectCell(d.row,d.col)),t.listen()},onFocusFromBottom(){var h;const d=(h=e(n))!==null&&h!==void 0?h:cS(t);d&&(t.runHooks("modifyFocusOnTabNavigation","from_below",d),t.selectCell(d.row,d.col)),t.listen()}}),o={wrapped:!1,flipped:!1};let s=!0,a=!1,l=!1;t.addHook("afterListen",()=>i()),t.addHook("afterUnlisten",()=>r()),t.addHook("afterSelection",(h,d,f,g,C)=>{if(a&&(o.wrapped&&o.flipped||l)&&(l=!1,C.value=!0),s){var y;n=(y=t.getSelectedRangeLast())===null||y===void 0?void 0:y.highlight}}),t.addHook("beforeRowWrap",(h,d,f)=>{o.wrapped=!0,o.flipped=f});function u(){o.wrapped=!1,o.flipped=!1,t.deselectCell(),t.unlisten()}const c={keys:[["Tab"],["Shift","Tab"]],preventDefault:!1,stopPropagation:!1,relativeToGroup:UD,group:"focusCatcher"};t.getShortcutManager().getContext("grid").addShortcuts([{...c,callback:()=>{const{tabNavigation:h}=t.getSettings();a=!0,t.getSelectedRangeLast()&&!h&&(s=!1),h||(l=!0)},position:"before"},{...c,callback:h=>{const{tabNavigation:d,autoWrapRow:f}=t.getSettings();if(a=!1,s=!0,!d||!t.selection.isSelected()||f&&o.wrapped&&o.flipped||!f&&o.wrapped)return f&&o.wrapped&&o.flipped&&(n=h.shiftKey?uS(t):cS(t)),u(),!1;h.preventDefault()},position:"after"}])}function uS(t){const{rowIndexMapper:e,columnIndexMapper:n}=t,{navigableHeaders:r}=t.getSettings();let i=r&&t.countColHeaders()>0?-t.countColHeaders():0,o=r&&t.countRowHeaders()>0?-t.countRowHeaders():0;return i===0&&(i=e.getVisualFromRenderableIndex(i)),o===0&&(o=n.getVisualFromRenderableIndex(o)),i===null||o===null?null:t._createCellCoords(i,o)}function cS(t){var e,n;const{rowIndexMapper:r,columnIndexMapper:i}=t,{navigableHeaders:o}=t.getSettings();let s=r.getRenderableIndexesLength()-1,a=i.getRenderableIndexesLength()-1;if(s<0){if(!o||t.countColHeaders()===0)return null;s=-1}if(a<0){if(!o||t.countColHeaders()===0)return null;a=-1}return t._createCellCoords((e=r.getVisualFromRenderableIndex(s))!==null&&e!==void 0?e:s,(n=i.getVisualFromRenderableIndex(a))!==null&&n!==void 0?n:a)}function IX(t){return e=>{if(!e)return null;const n=uS(t),r=cS(t);return e.col<n.col&&(e.col=n.col),e.col>r.col&&(e.col=r.col),e.row<n.row&&(e.row=n.row),e.row>r.row&&(e.row=r.row),e}}function Qu(t){Qo(t)&&t.scrollIntoView({block:"nearest",inline:"nearest"})}function wp(t){const{selection:e,view:n}=t,r=t.getSelectedRangeLast(),i=e.getSelectionSource(),o=n.getFirstFullyVisibleColumn(),s=n.getLastFullyVisibleColumn(),a=r.getTopStartCorner().col,l=r.getBottomEndCorner().col,u=a<=o,c=l>=s,h=n.getFirstFullyVisibleRow(),d=n.getLastFullyVisibleRow(),f=r.getTopStartCorner().row,g=r.getBottomEndCorner().row,C=f<=h,y=g>=d;return{getComputedColumnTarget(E){return i==="mouse"||i==="keyboard"?E.col:u&&c?r.highlight.col:u?a:c?l:E.col},getComputedRowTarget(E){return i==="mouse"||i==="keyboard"?E.row:C&&y?r.highlight.row:C?f:y?g:E.row}}}function PX(t){return e=>{const n=wp(t).getComputedColumnTarget(e);t.scrollViewportTo({col:n},()=>{const r=!!t.getSettings().colHeaders;Qu(t.getCell(r?-1:0,n,!0))})}}function OX(){return()=>{}}function xX(t){return e=>{t.scrollViewportTo(e.toObject(),()=>{const{row:n,col:r}=t.getSelectedRangeLast().highlight;Qu(t.getCell(n,r,!0))})}}function AX(t){return e=>{const n=wp(t),r={row:n.getComputedRowTarget(e),col:n.getComputedColumnTarget(e)};t.scrollViewportTo(r,()=>{const{row:i,col:o}=r;Qu(t.getCell(i,o,!0))})}}function HX(t){return e=>{const n=wp(t),r={row:n.getComputedRowTarget(e),col:n.getComputedColumnTarget(e)};t.scrollViewportTo(r,()=>{const{row:i,col:o}=r;Qu(t.getCell(i,o,!0))})}}function NX(t){return e=>{const n=wp(t).getComputedRowTarget(e);t.scrollViewportTo({row:n},()=>{const r=!!t.getSettings().rowHeaders;Qu(t.getCell(n,r?-1:0,!0))})}}function DX(t){return e=>{const n=t.selection.getSelectionSource(),{row:r,col:i}=e,o=()=>{Qu(t.getCell(r,i,!0))};if(r<0&&i>=0)t.scrollViewportTo({col:i},o);else if(i<0&&r>=0)t.scrollViewportTo({row:r},o);else{if(n==="mouse"&&(i===t.view.getLastPartiallyVisibleColumn()||r===t.view.getLastPartiallyVisibleRow()))return;t.scrollViewportTo({row:r,col:i},o)}}}function kX(t){const{selection:e}=t;let n=!1,r=!1;return{resume(){r=!1},suspend(){r=!0},skipNextScrollCycle(){n=!0},scrollTo(i){var o;if(n||r){n=!1;return}let s;e.isFocusSelectionChanged()?s=xX(t):e.isSelectedByCorner()?s=OX():e.isSelectedByRowHeader()?s=NX(t):e.isSelectedByColumnHeader()?s=PX(t):e.getSelectedRange().size()===1&&e.isMultiple()?s=AX(t):e.getSelectedRange().size()===1&&!e.isMultiple()?s=DX(t):e.getSelectedRange().size()>1&&(s=HX(t)),(o=s)===null||o===void 0||o(i)}}}const mx=new Map([[" ","space"],["spacebar","space"],["scroll","scrolllock"],["del","delete"],["esc","escape"],["medianexttrack","mediatracknext"],["mediaprevioustrack","mediatrackprevious"],["volumeup","audiovolumeup"],["volumedown","audiovolumedown"],["volumemute","audiovolumemute"],["multiply","*"],["add","+"],["divide","/"],["subtract","-"],["left","arrowleft"],["right","arrowright"],["up","arrowup"],["down","arrowdown"]]),df=t=>t.map(e=>{const n=e.toLowerCase();return mx.has(n)?mx.get(n):n}).sort().join("+"),LX=t=>t.split("+"),px=new Map([[96,"numpad0"],[97,"numpad1"],[98,"numpad2"],[99,"numpad3"],[100,"numpad4"],[101,"numpad5"],[102,"numpad6"],[103,"numpad7"],[104,"numpad8"],[105,"numpad9"],[106,"multiply"],[107,"add"],[108,"decimal"],[109,"subtract"],[110,"decimal"],[111,"divide"],[112,"f1"],[113,"f2"],[114,"f3"],[115,"f4"],[116,"f5"],[117,"f6"],[118,"f7"],[119,"f8"],[120,"f9"],[121,"f10"],[122,"f11"],[123,"f12"],[186,"semicolon"],[187,"equal"],[188,"comma"],[189,"minus"],[190,"period"],[191,"slash"],[192,"backquote"],[219,"bracketleft"],[220,"backslash"],[221,"bracketright"],[222,"quote"]]),ey=t=>{let{which:e,key:n}=t;if(px.has(e))return px.get(e);const r=String.fromCharCode(e).toLowerCase();return/^[a-z0-9]$/.test(r)?r:n.toLowerCase()},GD=Symbol("shortcut-context");function qD(t){return Ae(t)&&t.__kindOf===GD}const $X=t=>{const e=ap({errorIdExists:l=>`The "${l}" shortcut is already registered in the "${t}" context.`}),n=function(){let{keys:l,callback:u,group:c,runOnlyIf:h=()=>!0,captureCtrl:d=!1,preventDefault:f=!0,stopPropagation:g=!1,relativeToGroup:C,position:y,forwardToContext:E}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(It(c))throw new Error("You need to define the shortcut's group.");if(ot(u)===!1)throw new Error("The shortcut's callback needs to be a function.");if(Array.isArray(l)===!1)throw new Error(nt`Pass the shortcut\'s keys as an array of arrays,\x20
|
|
58
|
+
using the KeyboardEvent.key properties:\x20
|
|
59
|
+
https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values.`);const v={callback:u,group:c,runOnlyIf:h,captureCtrl:d,preventDefault:f,stopPropagation:g};ae(C)&&(v.relativeToGroup=C,v.position=y),qD(E)&&(v.forwardToContext=E),l.forEach(P=>{const O=df(P);if(e.hasItem(O)){const T=e.getItem(O);let A=T.findIndex(q=>q.group===C);A!==-1?y==="before"?A-=1:A+=1:A=T.length,T.splice(A,0,v)}else e.addItem(O,[v])})},r=function(l){let u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};l.forEach(c=>{He(u,(h,d)=>{Object.prototype.hasOwnProperty.call(c,d)===!1&&(c[d]=u[d])}),n(c)})},i=l=>{const u=df(l);e.removeItem(u)};return{__kindOf:GD,addShortcut:n,addShortcuts:r,getShortcuts:l=>{const u=df(l),c=e.getItem(u);return ae(c)?c.slice():[]},hasShortcut:l=>{const u=df(l);return e.hasItem(u)},removeShortcutsByKeys:i,removeShortcutsByGroup:l=>{e.getItems().forEach(c=>{let[h,d]=c;const f=d.filter(g=>g.group!==l);f.length===0?i(LX(h)):(d.length=0,d.push(...f))})}}};function FX(){const t=new Set;return{press(e){t.add(e)},release(e){t.delete(e)},releaseAll(){t.clear()},isPressed(e){return t.has(e)}}}const VX=["meta","alt","shift","control"],Ic=FX(),Pc=[];let ff=0;function WX(t,e,n,r,i){const o=f=>VX.includes(f),s=function(f){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const C=[];return f.altKey&&C.push("alt"),g&&(f.ctrlKey||f.metaKey)?C.push("control/meta"):(f.ctrlKey&&C.push("control"),f.metaKey&&C.push("meta")),f.shiftKey&&C.push("shift"),C},a=f=>{if(e(f)===!1||n(f)===!1||f.keyCode===229||typeof f.key!="string"||za(f))return;const C=ey(f);let y=[];o(C)||(y=s(f));const E=[C].concat(y);!i(f,E)&&(IP()&&y.includes("meta")||!IP()&&y.includes("control"))&&i(f,[C].concat(s(f,!0))),r(f)},l=f=>{if(typeof f.key=="string"){const g=ey(f);o(g)&&Ic.press(g)}},u=f=>{if(typeof f.key=="string"){const g=ey(f);o(g)&&Ic.release(g)}},c=()=>{Ic.releaseAll()};return{mount:()=>{let f=t;for(ff+=1;f;)ff===1&&(f.document.documentElement.addEventListener("keydown",l),Pc.push({event:"keydown",listener:l}),f.document.documentElement.addEventListener("keyup",u),Pc.push({event:"keyup",listener:u})),f.document.documentElement.addEventListener("keydown",a),f.document.documentElement.addEventListener("blur",c),f=xu(f)},unmount:()=>{let f=t;for(ff-=1;f;){if(ff===0){for(let g=0;g<Pc.length;g++){const{event:C,listener:y}=Pc[g];f.document.documentElement.removeEventListener(C,y)}Pc.length=0}f.document.documentElement.removeEventListener("keydown",a),f.document.documentElement.removeEventListener("blur",c),f=xu(f)}},isPressed:f=>Ic.isPressed(f),releasePressedKeys:()=>Ic.releaseAll()}}const BX=t=>{let{ownerWindow:e,handleEvent:n,beforeKeyDown:r,afterKeyDown:i}=t;const o=ap({errorIdExists:g=>`The "${g}" context name is already registered.`});let s="grid";const a=g=>{const C=$X(g);return o.addItem(g,C),C},l=()=>s,u=g=>o.getItem(g),c=g=>{if(!o.hasItem(g))throw new Error(nt`You've tried to activate the "${g}" shortcut context\x20
|
|
60
|
+
that does not exist. Before activation, register the context using the "addContext" method.`);s=g};let h=!1;const d=function(g,C){let y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:l();const E=qD(y)?y:u(y);let v=!1;if(!E.hasShortcut(C))return v;const P=E.getShortcuts(C);for(let O=0;O<P.length;O++){const{callback:L,runOnlyIf:T,preventDefault:A,stopPropagation:q,captureCtrl:U,forwardToContext:j}=P[O];if(T(g)===!0){if(h=U,v=L(g,C)===!1,h=!1,A&&g.preventDefault(),q&&(Pi(g),g.stopPropagation()),v)break;j&&d(g,C,j)}}return v},f=WX(e,n,r,i,d);return f.mount(),{addContext:a,getActiveContextName:l,getContext:u,setActiveContextName:c,isCtrlPressed:()=>!h&&(f.isPressed("control")||f.isPressed("meta")),releasePressedKeys:()=>f.releasePressedKeys(),destroy:()=>f.unmount()}};function wx(t){const{classNames:e}=KU(t,/ht-theme-[a-zA-Z0-9_-]+/);return e.pop()}let ty=null;const ny=new Map;function KD(t,e){var n,r=this;let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,o=this;const s=new _i(o);let a,l,u,c,h,d,f=!0;bq(i)&&yq(this),this.rootElement=t,this.rootDocument=t.ownerDocument,this.rootWindow=this.rootDocument.defaultView,this.isDestroyed=!1,this.renderSuspendedCounter=0,this.executionSuspendedCounter=0;const g=(n=e==null?void 0:e.layoutDirection)!==null&&n!==void 0?n:"inherit",C=["rtl","ltr"].includes(g)?g:this.rootWindow.getComputedStyle(this.rootElement).direction;this.rootElement.setAttribute("dir",C),this.isRtl=function(){return C==="rtl"},this.isLtr=function(){return!o.isRtl()},this.getDirectionFactor=function(){return o.isLtr()?1:-1},e.language=CK(e.language);const y=Object.fromEntries(Object.entries(e).filter(m=>{let[w]=m;return!(re.getSingleton().isRegistered(w)||re.getSingleton().isDeprecated(w))})),E=new jD(o,y,[y3,M3]),v=E.getTableMeta(),P=E.getGlobalMeta(),O=ap();this.container=this.rootDocument.createElement("div"),t.insertBefore(this.container,t.firstChild),_g(this)&&(SU(e.licenseKey,t),G(t,"ht-wrapper")),this.guid=`ht_${mN()}`,ny.set(this.guid,this),this.columnIndexMapper=new sS,this.rowIndexMapper=new sS,this.columnIndexMapper.addLocalHook("indexesSequenceChange",m=>{o.runHooks("afterColumnSequenceChange",m)}),this.rowIndexMapper.addLocalHook("indexesSequenceChange",m=>{o.runHooks("afterRowSequenceChange",m)}),s.addEventListener(this.rootDocument.documentElement,"compositionstart",m=>{o.runHooks("beforeCompositionStart",m)}),l=new kq(o),(!this.rootElement.id||this.rootElement.id.substring(0,3)==="ht_")&&(this.rootElement.id=this.guid);const L=m=>{const{row:w,col:p}=m;return o._createCellCoords(w>=0?o.rowIndexMapper.getRenderableFromVisualIndex(w):w,p>=0?o.columnIndexMapper.getRenderableFromVisualIndex(p):p)},T=m=>{const{row:w,col:p}=m;return o._createCellCoords(w>=0?o.rowIndexMapper.getVisualFromRenderableIndex(w):w,p>=0?o.columnIndexMapper.getVisualFromRenderableIndex(p):p)},A=(m,w)=>{const p=w>m?1:-1,I=Math.min(m,w),$=Math.max(m,w),B=o.rowIndexMapper.getNearestNotHiddenIndex(m,p);return B===null||p===1&&B>$||p===-1&&B<I?null:B>=0?o.rowIndexMapper.getRenderableFromVisualIndex(B):B},q=(m,w)=>{const p=w>m?1:-1,I=Math.min(m,w),$=Math.max(m,w),B=o.columnIndexMapper.getNearestNotHiddenIndex(m,p);return B===null||p===1&&B>$||p===-1&&B<I?null:B>=0?o.columnIndexMapper.getRenderableFromVisualIndex(B):B};let U=new VD(v,{rowIndexMapper:o.rowIndexMapper,columnIndexMapper:o.columnIndexMapper,countCols:()=>o.countCols(),countRows:()=>o.countRows(),propToCol:m=>a.propToCol(m),isEditorOpened:()=>o.getActiveEditor()?o.getActiveEditor().isOpened():!1,countRenderableColumns:()=>this.view.countRenderableColumns(),countRenderableRows:()=>this.view.countRenderableRows(),countRowHeaders:()=>this.countRowHeaders(),countColHeaders:()=>this.countColHeaders(),countRenderableRowsInRange:function(){return r.view.countRenderableRowsInRange(...arguments)},countRenderableColumnsInRange:function(){return r.view.countRenderableColumnsInRange(...arguments)},getShortcutManager:()=>o.getShortcutManager(),createCellCoords:(m,w)=>o._createCellCoords(m,w),createCellRange:(m,w,p)=>o._createCellRange(m,w,p),visualToRenderableCoords:L,renderableToVisualCoords:T,findFirstNonHiddenRenderableRow:A,findFirstNonHiddenRenderableColumn:q,isDisabledCellSelection:(m,w)=>m<0||w<0?o.getSettings().disableVisualSelection:o.getCellMeta(m,w).disableVisualSelection});this.selection=U;const j=m=>{let{hiddenIndexesChanged:w}=m;this.forceFullRender=!0,w&&this.selection.commit()};this.columnIndexMapper.addLocalHook("cacheUpdated",j),this.rowIndexMapper.addLocalHook("cacheUpdated",j),this.selection.addLocalHook("afterSetRangeEnd",(m,w)=>{const p=Mr(!1),I=this.selection.getSelectedRange(),{from:$,to:B}=I.current(),Y=I.size()-1;this.runHooks("afterSelection",$.row,$.col,B.row,B.col,p,Y),this.runHooks("afterSelectionByProp",$.row,o.colToProp($.col),B.row,o.colToProp(B.col),p,Y),w&&(!p.isTouched()||p.isTouched()&&!p.value)&&d.scrollTo(m);const K=U.isSelectedByRowHeader(),b=U.isSelectedByColumnHeader();K&&b?G(this.rootElement,["ht__selection--rows","ht__selection--columns"]):K?(pe(this.rootElement,"ht__selection--columns"),G(this.rootElement,"ht__selection--rows")):b?(pe(this.rootElement,"ht__selection--rows"),G(this.rootElement,"ht__selection--columns")):pe(this.rootElement,["ht__selection--rows","ht__selection--columns"]),U.getSelectionSource()!=="shift"&&c.closeEditor(null),o.view.render(),c.prepareEditor()}),this.selection.addLocalHook("beforeSetFocus",m=>{this.runHooks("beforeSelectionFocusSet",m.row,m.col)}),this.selection.addLocalHook("afterSetFocus",m=>{const w=Mr(!1);this.runHooks("afterSelectionFocusSet",m.row,m.col,w),(!w.isTouched()||w.isTouched()&&!w.value)&&d.scrollTo(m),c.closeEditor(),o.view.render(),c.prepareEditor()}),this.selection.addLocalHook("afterSelectionFinished",m=>{const w=m.length-1,{from:p,to:I}=m[w];this.runHooks("afterSelectionEnd",p.row,p.col,I.row,I.col,w),this.runHooks("afterSelectionEndByProp",p.row,o.colToProp(p.col),I.row,o.colToProp(I.col),w)}),this.selection.addLocalHook("afterIsMultipleSelection",m=>{const w=this.runHooks("afterIsMultipleSelection",m.value);m.value&&(m.value=w)}),this.selection.addLocalHook("afterDeselect",()=>{c.closeEditor(),o.view.render(),pe(this.rootElement,["ht__selection--rows","ht__selection--columns"]),this.runHooks("afterDeselect")}),this.selection.addLocalHook("beforeHighlightSet",()=>this.runHooks("beforeSelectionHighlightSet")).addLocalHook("beforeSetRangeStart",function(){for(var m=arguments.length,w=new Array(m),p=0;p<m;p++)w[p]=arguments[p];return r.runHooks("beforeSetRangeStart",...w)}).addLocalHook("beforeSetRangeStartOnly",function(){for(var m=arguments.length,w=new Array(m),p=0;p<m;p++)w[p]=arguments[p];return r.runHooks("beforeSetRangeStartOnly",...w)}).addLocalHook("beforeSetRangeEnd",function(){for(var m=arguments.length,w=new Array(m),p=0;p<m;p++)w[p]=arguments[p];return r.runHooks("beforeSetRangeEnd",...w)}).addLocalHook("beforeSelectColumns",function(){for(var m=arguments.length,w=new Array(m),p=0;p<m;p++)w[p]=arguments[p];return r.runHooks("beforeSelectColumns",...w)}).addLocalHook("afterSelectColumns",function(){for(var m=arguments.length,w=new Array(m),p=0;p<m;p++)w[p]=arguments[p];return r.runHooks("afterSelectColumns",...w)}).addLocalHook("beforeSelectRows",function(){for(var m=arguments.length,w=new Array(m),p=0;p<m;p++)w[p]=arguments[p];return r.runHooks("beforeSelectRows",...w)}).addLocalHook("afterSelectRows",function(){for(var m=arguments.length,w=new Array(m),p=0;p<m;p++)w[p]=arguments[p];return r.runHooks("afterSelectRows",...w)}).addLocalHook("beforeModifyTransformStart",function(){for(var m=arguments.length,w=new Array(m),p=0;p<m;p++)w[p]=arguments[p];return r.runHooks("modifyTransformStart",...w)}).addLocalHook("afterModifyTransformStart",function(){for(var m=arguments.length,w=new Array(m),p=0;p<m;p++)w[p]=arguments[p];return r.runHooks("afterModifyTransformStart",...w)}).addLocalHook("beforeModifyTransformFocus",function(){for(var m=arguments.length,w=new Array(m),p=0;p<m;p++)w[p]=arguments[p];return r.runHooks("modifyTransformFocus",...w)}).addLocalHook("afterModifyTransformFocus",function(){for(var m=arguments.length,w=new Array(m),p=0;p<m;p++)w[p]=arguments[p];return r.runHooks("afterModifyTransformFocus",...w)}).addLocalHook("beforeModifyTransformEnd",function(){for(var m=arguments.length,w=new Array(m),p=0;p<m;p++)w[p]=arguments[p];return r.runHooks("modifyTransformEnd",...w)}).addLocalHook("afterModifyTransformEnd",function(){for(var m=arguments.length,w=new Array(m),p=0;p<m;p++)w[p]=arguments[p];return r.runHooks("afterModifyTransformEnd",...w)}).addLocalHook("beforeRowWrap",function(){for(var m=arguments.length,w=new Array(m),p=0;p<m;p++)w[p]=arguments[p];return r.runHooks("beforeRowWrap",...w)}).addLocalHook("beforeColumnWrap",function(){for(var m=arguments.length,w=new Array(m),p=0;p<m;p++)w[p]=arguments[p];return r.runHooks("beforeColumnWrap",...w)}).addLocalHook("insertRowRequire",m=>this.alter("insert_row_above",m,1,"auto")).addLocalHook("insertColRequire",m=>this.alter("insert_col_start",m,1,"auto")),u={alter(m,w){let p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,I=arguments.length>3?arguments[3]:void 0,$=arguments.length>4?arguments[4]:void 0;const B=Y=>{if(Y.length===0)return[];const K=[...Y];return K.sort((R,S)=>{let[k]=R,[_]=S;return k===_?0:k>_?1:-1}),fr(K,(R,S)=>{let[k,_]=S;const H=R[R.length-1],[W,x]=H,N=W+x;if(k<=N){const V=Math.max(_-(N-k),0);H[1]+=V}else R.push([k,_]);return R},[K[0]])};switch(m){case"insert_row_below":case"insert_row_above":const Y=o.countSourceRows();if(v.maxRows===Y)return;const K=m==="insert_row_below"?"below":"above";w=w??(K==="below"?Y:0);const{delta:b,startPhysicalIndex:R}=a.createRow(w,p,{source:I,mode:K});U.shiftRows(o.toVisualRow(R),b);break;case"insert_col_start":case"insert_col_end":const S=m==="insert_col_end"?"end":"start";w=w??(S==="end"?o.countSourceCols():0);const{delta:k,startPhysicalIndex:_}=a.createCol(w,p,{source:I,mode:S});if(k){if(Array.isArray(v.colHeaders)){const x=[o.toVisualColumn(_),0];x.length+=k,Array.prototype.splice.apply(v.colHeaders,x)}U.shiftColumns(o.toVisualColumn(_),k)}break;case"remove_row":const H=x=>{let N=0;M(x,V=>{let[F,z]=V;const oe=Ut(F)?o.countRows()-1:Math.max(F-N,0);if(Number.isInteger(F)&&(F=Math.max(F-N,0)),!a.removeRow(F,z,I))return;if(U.isSelected()){const{row:Se}=o.getSelectedRangeLast().highlight;Se>=F&&Se<=F+z-1&&c.closeEditor(!0)}const Re=o.countRows(),Ne=v.fixedRowsTop;Ne>=oe+1&&(v.fixedRowsTop-=Math.min(z,Ne-oe));const We=v.fixedRowsBottom;We&&oe>=Re-We&&(v.fixedRowsBottom-=Math.min(z,We)),Re===0?U.deselect():I==="ContextMenu.removeRow"?U.refresh():U.shiftRows(F,-z),N+=z})};Array.isArray(w)?H(B(w)):H([[w,p]]);break;case"remove_col":const W=x=>{let N=0;M(x,V=>{let[F,z]=V;const oe=Ut(F)?o.countCols()-1:Math.max(F-N,0);let ce=o.toPhysicalColumn(oe);if(Number.isInteger(F)&&(F=Math.max(F-N,0)),!a.removeCol(F,z,I))return;if(U.isSelected()){const{col:Se}=o.getSelectedRangeLast().highlight;Se>=F&&Se<=F+z-1&&c.closeEditor(!0)}o.countCols()===0?U.deselect():I==="ContextMenu.removeColumn"?U.refresh():U.shiftColumns(F,-z);const We=v.fixedColumnsStart;We>=oe+1&&(v.fixedColumnsStart-=Math.min(z,We-oe)),Array.isArray(v.colHeaders)&&(typeof ce>"u"&&(ce=-1),v.colHeaders.splice(ce,z)),N+=z})};Array.isArray(w)?W(B(w)):W([[w,p]]);break;default:throw new Error(`There is no such action "${m}"`)}$||u.adjustRowsAndCols(),o.view.render(),o.view.adjustElementsSize()},adjustRowsAndCols(){const m=v.minRows,w=v.minSpareRows,p=v.minCols,I=v.minSpareCols;if(m){const $=o.countRows();$<m&&a.createRow($,m-$,{source:"auto"})}if(w){const $=o.countEmptyRows(!0);if($<w){const B=w-$,Y=Math.min(B,v.maxRows-o.countSourceRows());a.createRow(o.countRows(),Y,{source:"auto"})}}{let $;(p||I)&&($=o.countEmptyCols(!0));let B=o.countCols();if(p&&!v.columns&&B<p){const Y=p-B;$+=Y,a.createCol(B,Y,{source:"auto"})}if(I&&!v.columns&&o.dataType==="array"&&$<I){B=o.countCols();const Y=I-$,K=Math.min(Y,v.maxCols-B);a.createCol(B,K,{source:"auto"})}}},populateFromArray(m,w,p,I,$){let B,Y,K,b;const R=[],S={},k=[],_=m.row,H=m.col;if(Y=w.length,Y===0)return!1;let W=0,x=0;switch(Ae(p)&&(W=p.col-H+1,x=p.row-_+1),$){case"shift_down":const N=Rg(w),V=N.length,F=Math.max(V,W),z=o.getData().slice(_),oe=Rg(z).slice(H,H+F);for(K=0;K<F;K+=1)if(K<V){for(B=0,Y=N[K].length;B<x-Y;B+=1)N[K].push(N[K][B%Y]);K<oe.length?k.push(N[K].concat(oe[K])):k.push(N[K].concat(new Array(z.length).fill(null)))}else k.push(N[K%V].concat(oe[K]));o.populateFromArray(_,H,Rg(k));break;case"shift_right":const ce=w.length,Re=Math.max(ce,x),Ne=o.getData().slice(_).map(Ct=>Ct.slice(H));for(B=0;B<Re;B+=1)if(B<ce){for(K=0,b=w[B].length;K<W-b;K+=1)w[B].push(w[B][K%b]);if(B<Ne.length)for(let Ct=0;Ct<Ne[B].length;Ct+=1)w[B].push(Ne[B][Ct]);else w[B].push(...new Array(Ne[0].length).fill(null))}else w.push(w[B%Y].slice(0,Re).concat(Ne[B]));o.populateFromArray(_,H,w);break;case"overwrite":default:S.row=m.row,S.col=m.col;let We=0,Se=0,Le=!0,vt;const ti=function(Zt){let ft=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const yt=w[Zt%w.length];return ft!==null?yt[ft%yt.length]:yt},po=w.length,Or=p?p.row-m.row+1:0;for(p?Y=Or:Y=Math.max(po,Or),B=0;B<Y&&!(p&&S.row>p.row&&Or>po||!v.allowInsertRow&&S.row>o.countRows()-1||S.row>=v.maxRows);B++){const Ct=B-We,Zt=ti(Ct).length,ft=p?p.col-m.col+1:0;if(p?b=ft:b=Math.max(Zt,ft),S.col=m.col,vt=o.getCellMeta(S.row,S.col),(I==="CopyPaste.paste"||I==="Autofill.fill")&&vt.skipRowOnPaste){We+=1,S.row+=1,Y+=1;continue}for(Se=0,K=0;K<b&&!(p&&S.col>p.col&&ft>Zt||!v.allowInsertColumn&&S.col>o.countCols()-1||S.col>=v.maxCols);K++){if(vt=o.getCellMeta(S.row,S.col),(I==="CopyPaste.paste"||I==="Autofill.fill")&&vt.skipColumnOnPaste){Se+=1,S.col+=1,b+=1;continue}if(vt.readOnly&&I!=="UndoRedo.undo"){S.col+=1;continue}const yt=K-Se;let $e=ti(Ct,yt),xr=o.getDataAtCell(S.row,S.col);if($e!==null&&typeof $e=="object")if(Array.isArray($e)&&xr===null&&(xr=[]),xr===null||typeof xr!="object")Le=!1;else{const Js=Uh(Array.isArray(xr)?xr:xr[0]||xr),ea=Uh(Array.isArray($e)?$e:$e[0]||$e);xR(Js,ea)||Array.isArray(Js)&&Array.isArray(ea)?$e=Gn($e):Le=!1}else xr!==null&&typeof xr=="object"&&(Le=!1);Le&&R.push([S.row,S.col,$e]),Le=!0,S.col+=1}S.row+=1}o.setDataAtCell(R,null,null,I||"populateFromArray");break}}};function Z(m){const w=ID(m);I0(w)?(o.runHooks("beforeLanguageChange",w),P.language=w,o.runHooks("afterLanguageChange",w)):PD(m)}function J(m,w){const p=m==="className"?o.rootElement:o.table;if(f)G(p,w);else{let I=[],$=[];P[m]&&(I=Array.isArray(P[m])?P[m]:mP(P[m])),w&&($=Array.isArray(w)?w:mP(w));const B=gP(I,$),Y=gP($,I);B.length&&pe(p,B),Y.length&&G(p,Y)}P[m]=w}this.init=function(){l.setData(v.data),o.runHooks("beforeInit"),(zo()||WN())&&G(o.rootElement,"mobile"),this.updateSettings(e,!0),this.view=new Tq(this);const m=v.themeName||wx(o.rootElement);o.useTheme(m),o.view.addClassNameToLicenseElement(o.getCurrentThemeName()),c=eS.getInstance(o,v,U),d=kX(o),h=new Gz(o),_g(this)&&MX(o),o.runHooks("init"),this.render(),f&&o.rootElement.offsetParent===null&&rz(o.rootElement,()=>{o.view._wt.wtOverlays.updateLastSpreaderSize(),o.render(),o.view.adjustElementsSize()}),typeof f=="object"&&(o.runHooks("afterChange",f[0],f[1]),f=!1),o.runHooks("afterInit")};function se(){let m=!1;return{validatorsInQueue:0,valid:!0,addValidatorToQueue(){this.validatorsInQueue+=1,m=!1},removeValidatorFormQueue(){this.validatorsInQueue=this.validatorsInQueue-1<0?0:this.validatorsInQueue-1,this.checkIfQueueIsEmpty()},onQueueEmpty(){},checkIfQueueIsEmpty(){this.validatorsInQueue===0&&m===!1&&(m=!0,this.onQueueEmpty(this.valid))}}}function te(m){const w=m.replace(",",".");return isNaN(parseFloat(w))===!1?parseFloat(w):m}function ue(m,w,p){if(!m.length){p();return}const I=o.getActiveEditor(),$=new se;let B=!0;$.onQueueEmpty=()=>{I&&B&&I.cancelChanges(),p()};for(let Y=m.length-1;Y>=0;Y--){const[K,b]=m[Y],R=a.propToCol(b);let S;Number.isInteger(R)?S=o.getCellMeta(K,R):S={...Object.getPrototypeOf(v),...v},o.getCellValidator(S)&&($.addValidatorToQueue(),o.validateCell(m[Y][3],S,function(k,_){return function(H){if(typeof H!="boolean")throw new Error("Validation error: result is not boolean");H===!1&&_.allowInvalid===!1&&(B=!1,m.splice(k,1),_.valid=!0),$.removeValidatorFormQueue()}}(Y,S),w))}$.checkIfQueueIsEmpty()}function pt(m,w){for(let I=m.length-1;I>=0;I--){let $=!1;if(m[I]===null){m.splice(I,1);continue}if(!((m[I][2]===null||m[I][2]===void 0)&&(m[I][3]===null||m[I][3]===void 0))){if(v.allowInsertRow)for(;m[I][0]>o.countRows()-1;){const{delta:B}=a.createRow(void 0,void 0,{source:"auto"});if(B===0){$=!0;break}}if(o.dataType==="array"&&(!v.columns||v.columns.length===0)&&v.allowInsertColumn)for(;a.propToCol(m[I][1])>o.countCols()-1;){const{delta:B}=a.createCol(void 0,void 0,{source:"auto"});if(B===0){$=!0;break}}$||a.set(m[I][0],m[I][1],m[I][3])}}if(m.length>0){u.adjustRowsAndCols(),o.runHooks("beforeChangeRender",m,w),c.closeEditor(),o.render(),c.prepareEditor(),o.view.adjustElementsSize(),o.runHooks("afterChange",m,w||"edit");const I=o.getActiveEditor();I&&ae(I.refreshValue)&&I.refreshValue()}else o.render()}this._createCellCoords=function(m,w){return o.view._wt.createCellCoords(m,w)},this._createCellRange=function(m,w,p){return o.view._wt.createCellRange(m,w,p)},this.validateCell=function(m,w,p,I){let $=o.getCellValidator(w);function B(Y){if(!(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0)||w.hidden===!0){p(Y);return}const b=w.visualCol,R=w.visualRow,S=o.getCell(R,b,!0);if(S&&S.nodeName!=="TH"){const k=o.rowIndexMapper.getRenderableFromVisualIndex(R),_=o.columnIndexMapper.getRenderableFromVisualIndex(b);o.view._wt.getSetting("cellRenderer",k,_,S)}p(Y)}CU($)&&($=function(Y){return function(K,b){b(Y.test(K))}}($)),ot($)?(m=o.runHooks("beforeValidate",m,w.visualRow,w.prop,I),o._registerImmediate(()=>{$.call(w,m,Y=>{o&&(Y=o.runHooks("afterValidate",Y,m,w.visualRow,w.prop,I),w.valid=Y,B(Y),o.runHooks("postAfterValidate",Y,m,w.visualRow,w.prop,I))})})):o._registerImmediate(()=>{w.valid=!0,B(w.valid,!1)})};function be(m,w,p){return Array.isArray(m)?m:[[m,w,p]]}function ke(m,w){const p=o.runHooks("beforeChange",m,w||"edit"),I=m.filter(B=>B!==null);if(p===!1||I.length===0){var $;return($=o.getActiveEditor())===null||$===void 0||$.cancelChanges(),[]}for(let B=I.length-1;B>=0;B--){const[Y,K,,b]=I[B],R=a.propToCol(K);let S;Number.isInteger(R)?S=o.getCellMeta(Y,R):S={...Object.getPrototypeOf(v),...v};const{type:k,checkedTemplate:_,uncheckedTemplate:H}=S;if(k==="numeric"&&typeof b=="string"&&sY(b)&&(I[B][3]=te(b)),k==="checkbox"){const W=Pt(b),x=W===Pt(_),N=W===Pt(H);(x||N)&&(I[B][3]=x?_:H)}}return I}this.setDataAtCell=function(m,w,p,I){const $=be(m,w,p),B=[];let Y=I,K,b,R;for(K=0,b=$.length;K<b;K++){if(typeof $[K]!="object")throw new Error("Method `setDataAtCell` accepts row number or changes array of arrays as its first parameter");if(typeof $[K][1]!="number")throw new Error("Method `setDataAtCell` accepts row and column number as its parameters. If you want to use object property name, use method `setDataAtRowProp`");$[K][1]>=this.countCols()?R=$[K][1]:R=a.colToProp($[K][1]),B.push([$[K][0],R,l.getAtCell(this.toPhysicalRow($[K][0]),$[K][1]),$[K][2]])}!Y&&typeof m=="object"&&(Y=w);const S=ke(B,Y);o.runHooks("afterSetDataAtCell",S,Y),ue(S,Y,()=>{pt(S,Y)})},this.setDataAtRowProp=function(m,w,p,I){const $=be(m,w,p),B=[];let Y=I,K,b;for(K=0,b=$.length;K<b;K++)B.push([$[K][0],$[K][1],l.getAtCell(this.toPhysicalRow($[K][0]),$[K][1]),$[K][2]]);!Y&&typeof m=="object"&&(Y=w);const R=ke(B,I);o.runHooks("afterSetDataAtRowProp",R,Y),ue(R,Y,()=>{pt(R,Y)})},this.listen=function(){o&&!o.isListening()&&(ny.forEach(m=>{o!==m&&m.unlisten()}),ty=o.guid,o.runHooks("afterListen"))},this.unlisten=function(){this.isListening()&&(ty=null,o.runHooks("afterUnlisten"))},this.isListening=function(){return ty===o.guid},this.destroyEditor=function(){let m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;c.closeEditor(m),o.view.render(),w&&U.isSelected()&&c.prepareEditor()},this.populateFromArray=function(m,w,p,I,$,B,Y){if(!(typeof p=="object"&&typeof p[0]=="object"))throw new Error("populateFromArray parameter `input` must be an array of arrays");const K=typeof I=="number"?o._createCellCoords(I,$):null;return u.populateFromArray(o._createCellCoords(m,w),p,K,B,Y)},this.spliceCol=function(m,w,p){for(var I=arguments.length,$=new Array(I>3?I-3:0),B=3;B<I;B++)$[B-3]=arguments[B];return a.spliceCol(m,w,p,...$)},this.spliceRow=function(m,w,p){for(var I=arguments.length,$=new Array(I>3?I-3:0),B=3;B<I;B++)$[B-3]=arguments[B];return a.spliceRow(m,w,p,...$)},this.getSelected=function(){if(U.isSelected())return Be(U.getSelectedRange(),m=>{let{from:w,to:p}=m;return[w.row,w.col,p.row,p.col]})},this.getSelectedLast=function(){const m=this.getSelected();let w;return m&&m.length>0&&(w=m[m.length-1]),w},this.getSelectedRange=function(){if(U.isSelected())return Array.from(U.getSelectedRange())},this.getSelectedRangeLast=function(){const m=this.getSelectedRange();let w;return m&&m.length>0&&(w=m[m.length-1]),w},this.emptySelectedCells=function(m){if(!U.isSelected()||this.countRows()===0||this.countCols()===0)return;const w=[];M(U.getSelectedRange(),p=>{if(p.isSingleHeader())return;const I=p.getTopStartCorner(),$=p.getBottomEndCorner();de(I.row,$.row,B=>{de(I.col,$.col,Y=>{this.getCellMeta(B,Y).readOnly||w.push([B,Y,null])})})}),w.length>0&&this.setDataAtCell(w,m)},this.isRenderSuspended=function(){return this.renderSuspendedCounter>0},this.suspendRender=function(){this.renderSuspendedCounter+=1},this.resumeRender=function(){const m=this.renderSuspendedCounter-1;this.renderSuspendedCounter=Math.max(m,0),!this.isRenderSuspended()&&m===this.renderSuspendedCounter&&o.view.render()},this.render=function(){this.view&&(this.forceFullRender=!0,this.isRenderSuspended()||o.view.render())},this.batchRender=function(m){this.suspendRender();const w=m();return this.resumeRender(),w},this.isExecutionSuspended=function(){return this.executionSuspendedCounter>0},this.suspendExecution=function(){this.executionSuspendedCounter+=1,this.columnIndexMapper.suspendOperations(),this.rowIndexMapper.suspendOperations()},this.resumeExecution=function(){let m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const w=this.executionSuspendedCounter-1;this.executionSuspendedCounter=Math.max(w,0),(!this.isExecutionSuspended()&&w===this.executionSuspendedCounter||m)&&(this.columnIndexMapper.resumeOperations(),this.rowIndexMapper.resumeOperations())},this.batchExecution=function(m){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;this.suspendExecution();const p=m();return this.resumeExecution(w),p},this.batch=function(m){this.suspendRender(),this.suspendExecution();const w=m();return this.resumeExecution(),this.resumeRender(),w},this.refreshDimensions=function(){if(!o.view)return;const m=o.view,{width:w,height:p}=m.getLastSize(),{width:I,height:$}=o.rootElement.getBoundingClientRect(),B=I!==w||$!==p;o.runHooks("beforeRefreshDimensions",{width:w,height:p},{width:I,height:$},B)!==!1&&((B||m._wt.wtOverlays.scrollableElement===o.rootWindow)&&(m.setLastSize(I,$),o.render(),m.adjustElementsSize()),o.runHooks("afterRefreshDimensions",{width:w,height:p},{width:I,height:$},B))},this.updateData=function(m,w){hx(m,p=>{a=p},p=>{a=p,o.columnIndexMapper.fitToLength(this.getInitialColumnCount()),o.rowIndexMapper.fitToLength(this.countSourceRows()),u.adjustRowsAndCols(),U.refresh()},{hotInstance:o,dataMap:a,dataSource:l,internalSource:"updateData",source:w,metaManager:E,firstRun:f})},this.loadData=function(m,w){hx(m,p=>{a=p},()=>{E.clearCellsCache(),o.initIndexMappers(),u.adjustRowsAndCols(),U.refresh(),f&&(f=[null,"loadData"])},{hotInstance:o,dataMap:a,dataSource:l,internalSource:"loadData",source:w,metaManager:E,firstRun:f})},this.getInitialColumnCount=function(){const m=v.columns;let w=0;if(Array.isArray(m))w=m.length;else if(ot(m))if(o.dataType==="array"){const p=this.countSourceCols();for(let I=0;I<p;I+=1)m(I)&&(w+=1)}else(o.dataType==="object"||o.dataType==="function")&&(w=a.colToPropCache.length);else if(ae(v.dataSchema)){const p=a.getSchema();w=Array.isArray(p)?p.length:AR(p)}else w=this.countSourceCols();return w},this.initIndexMappers=function(){this.columnIndexMapper.initToLength(this.getInitialColumnCount()),this.rowIndexMapper.initToLength(this.countSourceRows())},this.getData=function(m,w,p,I){return It(m)?a.getAll():a.getRange(o._createCellCoords(m,w),o._createCellCoords(p,I),a.DESTINATION_RENDERER)},this.getCopyableText=function(m,w,p,I){return a.getCopyableText(o._createCellCoords(m,w),o._createCellCoords(p,I))},this.getCopyableData=function(m,w){return a.getCopyable(m,a.colToProp(w))},this.getSchema=function(){return a.getSchema()},this.updateSettings=function(m){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const p=(f?o.loadData:o.updateData).bind(this);let I=!1,$,B;if(ae(m.rows))throw new Error('The "rows" setting is no longer supported. Do you mean startRows, minRows or maxRows?');if(ae(m.cols))throw new Error('The "cols" setting is no longer supported. Do you mean startCols, minCols or maxCols?');if(ae(m.ganttChart))throw new Error('Since 8.0.0 the "ganttChart" setting is no longer supported.');m.language&&Z(m.language);for($ in m)if(!($==="data"||$==="language"))if($==="className")J("className",m.className);else if($==="tableClassName"&&o.table)J("tableClassName",m.tableClassName),o.view._wt.wtOverlays.syncOverlayTableClassNames();else if(re.getSingleton().isRegistered($)||re.getSingleton().isDeprecated($)){const S=m[$];ot(S)?(re.getSingleton().addAsFixed($,S,o),v[$]=S):Array.isArray(S)&&(re.getSingleton().add($,S,o),v[$]=S)}else!w&&tn(m,$)&&(P[$]=m[$]);m.data===void 0&&v.data===void 0?p(null,"updateSettings"):m.data!==void 0?p(m.data,"updateSettings"):m.columns!==void 0&&(a.createMap(),o.initIndexMappers());const Y=o.countCols(),K=v.columns;if(K&&ot(K)&&(I=!0),(m.cell!==void 0||m.cells!==void 0||m.columns!==void 0)&&E.clearCache(),Y>0)for($=0,B=0;$<Y;$++){if(K){const S=I?K($):K[B];S&&E.updateColumnMeta(B,S)}B+=1}ae(m.cell)&&He(m.cell,S=>{o.setCellMetaObject(S.row,S.col,S)}),o.runHooks("afterCellMetaReset");let b=o.rootElement.style.height;b!==""&&(b=parseInt(o.rootElement.style.height,10));let R=m.height;if(ot(R)&&(R=R()),w&&o.rootElement.getAttribute("style")&&o.rootElement.setAttribute("data-initialstyle",o.rootElement.getAttribute("style")),R===null){const S=o.rootElement.getAttribute("data-initialstyle");S&&(S.indexOf("height")>-1||S.indexOf("overflow")>-1)?o.rootElement.setAttribute("style",S):(o.rootElement.style.height="",o.rootElement.style.overflow="")}else R!==void 0&&(o.rootElement.style.height=isNaN(R)?`${R}`:`${R}px`,o.rootElement.style.overflow="hidden");if(typeof m.width<"u"){let S=m.width;ot(S)&&(S=S()),o.rootElement.style.width=isNaN(S)?`${S}`:`${S}px`}if(!w){if(o.view){o.view._wt.wtViewport.resetHasOversizedColumnHeadersMarked(),o.view._wt.exportSettingsAsClassNames();const S=o.getCurrentThemeName(),k=tn(m,"themeName");S&&k&&S!==m.themeName&&(o.view.getStylesHandler().removeClassNames(),o.view.removeClassNameFromLicenseElement(S));const _=k&&m.themeName||wx(o.rootElement);o.useTheme(_),o.view.addClassNameToLicenseElement(o.getCurrentThemeName())}o.runHooks("afterUpdateSettings",m)}u.adjustRowsAndCols(),o.view&&!f&&(o.render(),o.view._wt.wtOverlays.adjustElementsSize()),!w&&o.view&&(b===""||R===""||R===void 0)&&b!==R&&o.view._wt.wtOverlays.updateMainScrollableElements()},this.getValue=function(){const m=o.getSelectedLast();if(v.getValue){if(ot(v.getValue))return v.getValue.call(o);if(m)return o.getData()[m[0][0]][v.getValue]}else if(m)return o.getDataAtCell(m[0],m[1])},this.getSettings=function(){return v},this.clear=function(){this.selectAll(),this.emptySelectedCells()},this.alter=function(m,w,p,I,$){u.alter(m,w,p,I,$)},this.getCell=function(m,w){let p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,I=w,$=m;if(w>=0){if(this.columnIndexMapper.isHidden(this.toPhysicalColumn(w)))return null;I=this.columnIndexMapper.getRenderableFromVisualIndex(w)}if(m>=0){if(this.rowIndexMapper.isHidden(this.toPhysicalRow(m)))return null;$=this.rowIndexMapper.getRenderableFromVisualIndex(m)}return $===null||I===null||$===void 0||I===void 0?null:o.view.getCellAtCoords(o._createCellCoords($,I),p)},this.getCoords=function(m){const w=this.view._wt.wtTable.getCoords(m);if(w===null)return null;const{row:p,col:I}=w;let $=p,B=I;return p>=0&&($=this.rowIndexMapper.getVisualFromRenderableIndex(p)),I>=0&&(B=this.columnIndexMapper.getVisualFromRenderableIndex(I)),o._createCellCoords($,B)},this.colToProp=function(m){return a.colToProp(m)},this.propToCol=function(m){return a.propToCol(m)},this.toVisualRow=m=>this.rowIndexMapper.getVisualFromPhysicalIndex(m),this.toVisualColumn=m=>this.columnIndexMapper.getVisualFromPhysicalIndex(m),this.toPhysicalRow=m=>this.rowIndexMapper.getPhysicalFromVisualIndex(m),this.toPhysicalColumn=m=>this.columnIndexMapper.getPhysicalFromVisualIndex(m),this.getDataAtCell=function(m,w){return a.get(m,a.colToProp(w))},this.getDataAtRowProp=function(m,w){return a.get(m,w)},this.getDataAtCol=function(m){const w=[],p=a.getRange(o._createCellCoords(0,m),o._createCellCoords(v.data.length-1,m),a.DESTINATION_RENDERER);for(let I=0;I<p.length;I+=1)for(let $=0;$<p[I].length;$+=1)w.push(p[I][$]);return w},this.getDataAtProp=function(m){const w=[],p=a.getRange(o._createCellCoords(0,a.propToCol(m)),o._createCellCoords(v.data.length-1,a.propToCol(m)),a.DESTINATION_RENDERER);for(let I=0;I<p.length;I+=1)for(let $=0;$<p[I].length;$+=1)w.push(p[I][$]);return w},this.getSourceData=function(m,w,p,I){let $;return m===void 0?$=l.getData():$=l.getByRange(o._createCellCoords(m,w),o._createCellCoords(p,I)),$},this.getSourceDataArray=function(m,w,p,I){let $;return m===void 0?$=l.getData(!0):$=l.getByRange(o._createCellCoords(m,w),o._createCellCoords(p,I),!0),$},this.getSourceDataAtCol=function(m){return l.getAtColumn(m)},this.setSourceDataAtCell=function(m,w,p,I){const $=be(m,w,p),B=this.hasHook("afterSetSourceDataAtCell"),Y=[];B&&M($,b=>{let[R,S,k]=b;Y.push([R,S,l.getAtCell(R,S),k])}),M($,b=>{let[R,S,k]=b;l.setAtCell(R,S,k)}),B&&this.runHooks("afterSetSourceDataAtCell",Y,I),this.render();const K=o.getActiveEditor();K&&ae(K.refreshValue)&&K.refreshValue()},this.getSourceDataAtRow=function(m){return l.getAtRow(m)},this.getSourceDataAtCell=function(m,w){return l.getAtCell(m,w)},this.getDataAtRow=function(m){return a.getRange(o._createCellCoords(m,0),o._createCellCoords(m,this.countCols()-1),a.DESTINATION_RENDERER)[0]||[]},this.getDataType=function(m,w,p,I){const $=m===void 0?[0,0,this.countRows(),this.countCols()]:[m,w,p,I],[B,Y]=$;let[,,K,b]=$,R=null,S=null;K===void 0&&(K=B),b===void 0&&(b=Y);let k="mixed";return de(Math.max(Math.min(B,K),0),Math.max(B,K),_=>{let H=!0;return de(Math.max(Math.min(Y,b),0),Math.max(Y,b),W=>(S=this.getCellMeta(_,W).type,R?H=R===S:R=S,H)),k=H?S:"mixed",H}),k},this.removeCellMeta=function(m,w,p){const[I,$]=[this.toPhysicalRow(m),this.toPhysicalColumn(w)];let B=E.getCellMetaKeyValue(I,$,p);o.runHooks("beforeRemoveCellMeta",m,w,p,B)!==!1&&(E.removeCellMeta(I,$,p),o.runHooks("afterRemoveCellMeta",m,w,p,B)),B=null},this.spliceCellsMeta=function(m){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;for(var p=arguments.length,I=new Array(p>2?p-2:0),$=2;$<p;$++)I[$-2]=arguments[$];if(I.length>0&&!Array.isArray(I[0]))throw new Error("The 3rd argument (cellMetaRows) has to be passed as an array of cell meta objects array.");w>0&&E.removeRow(this.toPhysicalRow(m),w),I.length>0&&M(I.reverse(),B=>{E.createRow(this.toPhysicalRow(m)),M(B,(Y,K)=>this.setCellMetaObject(m,K,Y))}),o.render()},this.setCellMetaObject=function(m,w,p){typeof p=="object"&&He(p,(I,$)=>{this.setCellMeta(m,w,$,I)})},this.setCellMeta=function(m,w,p,I){if(o.runHooks("beforeSetCellMeta",m,w,p,I)===!1)return;let B=m,Y=w;m<this.countRows()&&(B=this.toPhysicalRow(m)),w<this.countCols()&&(Y=this.toPhysicalColumn(w)),E.setCellMeta(B,Y,p,I),o.runHooks("afterSetCellMeta",m,w,p,I)},this.getCellsMeta=function(){return E.getCellsMeta()},this.getCellMeta=function(m,w){let p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{skipMetaExtension:!1},I=this.toPhysicalRow(m),$=this.toPhysicalColumn(w);return I===null&&(I=m),$===null&&($=w),E.getCellMeta(I,$,{visualRow:m,visualColumn:w,...p})},this.getColumnMeta=function(m){return E.getColumnMeta(this.toPhysicalColumn(m))},this.getCellMetaAtRow=function(m){return E.getCellsMetaAtRow(m)},this.isColumnModificationAllowed=function(){return!(o.dataType==="object"||v.columns)},this.getCellRenderer=function(m,w){const p=typeof m=="number"?o.getCellMeta(m,w).renderer:m.renderer;return typeof p=="string"?rS(p):It(p)?rS("text"):p},this.getCellEditor=function(m,w){const p=typeof m=="number"?o.getCellMeta(m,w).editor:m.editor;return typeof p=="string"?Jb(p):It(p)?Jb("text"):p},this.getCellValidator=function(m,w){const p=typeof m=="number"?o.getCellMeta(m,w).validator:m.validator;return typeof p=="string"?RY(p):p},this.validateCells=function(m){this._validateCells(m)},this.validateRows=function(m,w){if(!Array.isArray(m))throw new Error("validateRows parameter `rows` must be an array");this._validateCells(w,m)},this.validateColumns=function(m,w){if(!Array.isArray(m))throw new Error("validateColumns parameter `columns` must be an array");this._validateCells(w,void 0,m)},this._validateCells=function(m,w,p){const I=new se;m&&(I.onQueueEmpty=m);let $=o.countRows()-1;for(;$>=0;){if(w!==void 0&&w.indexOf($)===-1){$-=1;continue}let B=o.countCols()-1;for(;B>=0;){if(p!==void 0&&p.indexOf(B)===-1){B-=1;continue}I.addValidatorToQueue(),o.validateCell(o.getDataAtCell($,B),o.getCellMeta($,B),Y=>{if(typeof Y!="boolean")throw new Error("Validation error: result is not boolean");Y===!1&&(I.valid=!1),I.removeValidatorFormQueue()},"validateCells"),B-=1}$-=1}I.checkIfQueueIsEmpty()},this.getRowHeader=function(m){let w=v.rowHeaders,p=m;return p!==void 0&&(p=o.runHooks("modifyRowHeader",p)),p===void 0?(w=[],de(o.countRows()-1,I=>{w.push(o.getRowHeader(I))})):Array.isArray(w)&&w[p]!==void 0?w=w[p]:ot(w)?w=w(p):w&&typeof w!="string"&&typeof w!="number"&&(w=p+1),w},this.hasRowHeaders=function(){return!!v.rowHeaders},this.hasColHeaders=function(){if(v.colHeaders!==void 0&&v.colHeaders!==null)return!!v.colHeaders;for(let m=0,w=o.countCols();m<w;m++)if(o.getColHeader(m))return!0;return!1},this.getColHeader=function(m){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1;const p=o.runHooks("modifyColHeader",m);if(p===void 0){const K=[],b=o.countCols();for(let R=0;R<b;R++)K.push(o.getColHeader(R));return K}let I=v.colHeaders;const $=function(K){const b=[],R=o.countCols();let S=0;for(;S<R;S++)ot(v.columns)&&v.columns(S)&&b.push(S);return b[K]},B=o.toPhysicalColumn(p),Y=$(B);return v.colHeaders===!1?I=null:v.columns&&ot(v.columns)&&v.columns(Y)&&v.columns(Y).title?I=v.columns(Y).title:v.columns&&v.columns[B]&&v.columns[B].title?I=v.columns[B].title:Array.isArray(v.colHeaders)&&v.colHeaders[B]!==void 0?I=v.colHeaders[B]:ot(v.colHeaders)?I=v.colHeaders(B):v.colHeaders&&typeof v.colHeaders!="string"&&typeof v.colHeaders!="number"&&(I=xq(p)),I=o.runHooks("modifyColumnHeaderValue",I,m,w),I},this._getColWidthFromSettings=function(m){let w;if(m>=0&&(w=o.getCellMeta(0,m).width),(w===void 0||w===v.width)&&(w=v.colWidths),w!=null){switch(typeof w){case"object":w=w[m];break;case"function":w=w(m);break}typeof w=="string"&&(w=parseInt(w,10))}return w},this.getColWidth=function(m,w){let p=o._getColWidthFromSettings(m);return p=o.runHooks("modifyColWidth",p,m,w),p===void 0&&(p=Hu),p},this._getRowHeightFromSettings=function(m){const w=this.view.getDefaultRowHeight();let p=v.rowHeights;if(p!=null){switch(typeof p){case"object":p=p[m];break;case"function":p=p(m);break}typeof p=="string"&&(p=parseInt(p,10))}return p!=null&&p<w?w:p},this.getRowHeight=function(m,w){let p=o._getRowHeightFromSettings(m);return p=o.runHooks("modifyRowHeight",p,m,w),p},this.countSourceRows=function(){return l.countRows()},this.countSourceCols=function(){return l.countFirstRowKeys()},this.countRows=function(){return a.getLength()},this.countCols=function(){const m=v.maxCols,w=this.columnIndexMapper.getNotTrimmedIndexesLength();return Math.min(m,w)},this.countRenderedRows=function(){return o.view._wt.drawn?o.view._wt.wtTable.getRenderedRowsCount():-1},this.countVisibleRows=function(){return o.view._wt.drawn?o.view._wt.wtTable.getVisibleRowsCount():-1},this.countRenderedCols=function(){return o.view._wt.drawn?o.view._wt.wtTable.getRenderedColumnsCount():-1},this.countVisibleCols=function(){return o.view._wt.drawn?o.view._wt.wtTable.getVisibleColumnsCount():-1},this.countRowHeaders=function(){return this.view.getRowHeadersCount()},this.countColHeaders=function(){return this.view.getColumnHeadersCount()},this.countEmptyRows=function(){let m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,w=0;return nO(o.countRows()-1,p=>{if(o.isEmptyRow(p))w+=1;else if(m===!0)return!1}),w},this.countEmptyCols=function(){let m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,w=0;return nO(o.countCols()-1,p=>{if(o.isEmptyCol(p))w+=1;else if(m===!0)return!1}),w},this.isEmptyRow=function(m){return v.isEmptyRow.call(o,m)},this.isEmptyCol=function(m){return v.isEmptyCol.call(o,m)},this.selectCell=function(m,w,p,I){let $=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,B=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;return It(m)||It(w)?!1:this.selectCells([[m,w,p,I]],$,B)},this.selectCells=function(){let m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[[]],w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;w===!1&&d.suspend();const I=U.selectCells(m);return I&&p&&o.listen(),d.resume(),I},this.selectColumns=function(m){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:m,p=arguments.length>2?arguments[2]:void 0;return U.selectColumns(m,w,p)},this.selectRows=function(m){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:m,p=arguments.length>2?arguments[2]:void 0;return U.selectRows(m,w,p)},this.deselectCell=function(){U.deselect()},this.selectAll=function(){let m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:m,p=arguments.length>2?arguments[2]:void 0;d.skipNextScrollCycle(),U.selectAll(m,w,p)};const wt=(m,w)=>m.getNearestNotHiddenIndex(w,1,!0);this.scrollViewportTo=function(m,w){if(typeof m=="number"){var p;m={row:arguments[0],col:arguments[1],verticalSnap:arguments[2]?"bottom":"top",horizontalSnap:arguments[3]?"end":"start",considerHiddenIndexes:(p=arguments[4])!==null&&p!==void 0?p:!0}}const{row:I,col:$,considerHiddenIndexes:B}=m??{};let Y=I,K=$;if(ot(w)&&this.addHookOnce("afterScroll",w),B===void 0||B){const k=Number.isInteger(I)&&I>=0,_=Number.isInteger($)&&$>=0,H=k?wt(this.rowIndexMapper,I):void 0,W=_?wt(this.columnIndexMapper,$):void 0;if(H===null||W===null)return!1;Y=k?o.rowIndexMapper.getRenderableFromVisualIndex(H):I,K=_?o.columnIndexMapper.getRenderableFromVisualIndex(W):$}const b=Number.isInteger(Y),R=Number.isInteger(K);let S=!1;return b&&Y>=0&&R&&K>=0?S=o.view.scrollViewport(o._createCellCoords(Y,K),m.horizontalSnap,m.verticalSnap):b&&Y>=0&&(R&&K<0||!R)?S=o.view.scrollViewportVertically(Y,m.verticalSnap):R&&K>=0&&(b&&Y<0||!b)&&(S=o.view.scrollViewportHorizontally(K,m.horizontalSnap)),ot(w)&&(S?this.view.render():(this.removeHook("afterScroll",w),this._registerMicrotask(()=>w()))),S},this.scrollToFocusedCell=function(m){if(!this.selection.isSelected())return!1;ot(m)&&this.addHookOnce("afterScroll",m);const{highlight:w}=this.getSelectedRangeLast(),p=this.scrollViewportTo(w.toObject());return p?this.view.render():ot(m)&&(this.removeHook("afterScroll",m),this._registerMicrotask(()=>m())),p},this.destroy=function(){if(o._clearTimeouts(),o._clearImmediates(),o.view&&o.view.destroy(),l&&l.destroy(),l=null,this.getShortcutManager().destroy(),E.clearCache(),ny.delete(this.guid),_g(o)){const m=this.rootDocument.querySelector(".hot-display-license-info");m&&m.parentNode.removeChild(m)}es(o.rootElement),s.destroy(),c&&c.destroy(),o.batchExecution(()=>{o.rowIndexMapper.unregisterAll(),o.columnIndexMapper.unregisterAll(),O.getItems().forEach(m=>{let[,w]=m;w.destroy()}),O.clear(),o.runHooks("afterDestroy")},!0),re.getSingleton().destroy(o),He(o,(m,w,p)=>{ot(m)?p[w]=fn(w):w!=="guid"&&(p[w]=null)}),o.isDestroyed=!0,a&&a.destroy(),a=null,u=null,U=null,c=null,o=null};function fn(m){return()=>{throw new Error(`The "${m}" method cannot be called because this Handsontable instance has been destroyed`)}}this.getActiveEditor=function(){return c.getActiveEditor()},this.getFirstRenderedVisibleRow=function(){return o.view.getFirstRenderedVisibleRow()},this.getLastRenderedVisibleRow=function(){return o.view.getLastRenderedVisibleRow()},this.getFirstRenderedVisibleColumn=function(){return o.view.getFirstRenderedVisibleColumn()},this.getLastRenderedVisibleColumn=function(){return o.view.getLastRenderedVisibleColumn()},this.getFirstFullyVisibleRow=function(){return o.view.getFirstFullyVisibleRow()},this.getLastFullyVisibleRow=function(){return o.view.getLastFullyVisibleRow()},this.getFirstFullyVisibleColumn=function(){return o.view.getFirstFullyVisibleColumn()},this.getLastFullyVisibleColumn=function(){return o.view.getLastFullyVisibleColumn()},this.getFirstPartiallyVisibleRow=function(){return o.view.getFirstPartiallyVisibleRow()},this.getLastPartiallyVisibleRow=function(){return o.view.getLastPartiallyVisibleRow()},this.getFirstPartiallyVisibleColumn=function(){return o.view.getFirstPartiallyVisibleColumn()},this.getLastPartiallyVisibleColumn=function(){return o.view.getLastPartiallyVisibleColumn()},this.getPlugin=function(m){return O.getItem(Ti(m))},this.getPluginName=function(m){return m===this.undoRedo?this.undoRedo.constructor.PLUGIN_KEY:O.getId(m)},this.getInstance=function(){return o},this.addHook=function(m,w,p){re.getSingleton().add(m,w,o,p)},this.hasHook=function(m){return re.getSingleton().has(m,o)||re.getSingleton().has(m)},this.addHookOnce=function(m,w,p){re.getSingleton().once(m,w,o,p)},this.removeHook=function(m,w){re.getSingleton().remove(m,w,o)},this.runHooks=function(m,w,p,I,$,B,Y){return re.getSingleton().run(o,m,w,p,I,$,B,Y)},this.getTranslatedPhrase=function(m,w){return DD(v.language,m,w)},this.toHTML=()=>eO(this),this.toTableElement=()=>{const m=this.rootDocument.createElement("div");return m.insertAdjacentHTML("afterbegin",eO(this)),m.firstElementChild},this.timeouts=[],this.useTheme=m=>{this.view.getStylesHandler().useTheme(m),this.runHooks("afterSetTheme",m,!!f)},this.getCurrentThemeName=()=>this.view.getStylesHandler().getThemeName(),this._registerTimeout=function(m){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,p=m;typeof p=="function"&&(p=setTimeout(p,w)),this.timeouts.push(p)},this._clearTimeouts=function(){M(this.timeouts,m=>{clearTimeout(m)})},this.immediates=[],this._registerImmediate=function(m){this.immediates.push(setImmediate(m))},this._clearImmediates=function(){M(this.immediates,m=>{clearImmediate(m)})},this._registerMicrotask=function(m){this.rootWindow.queueMicrotask(()=>{this.isDestroyed||m()})},this._getEditorManager=function(){return c};const et=BX({handleEvent(){return o.isListening()},beforeKeyDown:m=>this.runHooks("beforeKeyDown",m),afterKeyDown:m=>{this.isDestroyed||o.runHooks("afterDocumentKeyDown",m)},ownerWindow:this.rootWindow});this.addHook("beforeOnCellMouseDown",m=>{m.ctrlKey===!1&&m.metaKey===!1&&et.releasePressedKeys()}),this.getShortcutManager=function(){return et},this.getFocusManager=function(){return h},QN().forEach(m=>{const w=LR(m);O.addItem(m,new w(this))}),TX(o),et.setActiveContextName("grid"),re.getSingleton().run(o,"construct")}function vx(t,e,n){t.addEventListener(e,n,!1)}function Cx(t,e,n){t.removeEventListener(e,n,!1)}function gf(t){return t.ownerDocument.defaultView.getComputedStyle(t)}function XD(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n={minHeight:200,maxHeight:300,minWidth:100,maxWidth:300,textContent:h=>h.value,...e},r=t.body,i=t.createTextNode(""),o=t.createElement("span");let s;function a(){var h,d;i.textContent=n.textContent(s),o.style.position="absolute",o.style.fontSize=gf(s).fontSize,o.style.fontFamily=gf(s).fontFamily,o.style.whiteSpace="pre",r.appendChild(o);const f=parseInt(((h=gf(s))===null||h===void 0?void 0:h.paddingInlineStart)||0,10),g=parseInt(((d=gf(s))===null||d===void 0?void 0:d.paddingInlineEnd)||0,10),C=o.clientWidth+f+g+1;r.removeChild(o);const y=s.style;y.height=`${n.minHeight}px`,n.minWidth>C?y.width=`${n.minWidth}px`:C>n.maxWidth?y.width=`${n.maxWidth}px`:y.width=`${C}px`;const E=s.scrollHeight?s.scrollHeight-1:0;n.minHeight>E?y.height=`${n.minHeight}px`:n.maxHeight<E?(y.height=`${n.maxHeight}px`,y.overflowY="visible"):y.height=`${E}px`}function l(){t.defaultView.setTimeout(a,0)}function u(h){if(h&&h.minHeight)if(h.minHeight==="inherit")n.minHeight=s.clientHeight;else{const d=parseInt(h.minHeight,10);isNaN(d)||(n.minHeight=d)}if(h&&h.maxHeight)if(h.maxHeight==="inherit")n.maxHeight=s.clientHeight;else{const d=parseInt(h.maxHeight,10);isNaN(d)||(n.maxHeight=d)}if(h&&h.minWidth)if(h.minWidth==="inherit")n.minWidth=s.clientWidth;else{const d=parseInt(h.minWidth,10);isNaN(d)||(n.minWidth=d)}if(h&&h.maxWidth)if(h.maxWidth==="inherit")n.maxWidth=s.clientWidth;else{const d=parseInt(h.maxWidth,10);isNaN(d)||(n.maxWidth=d)}o.firstChild||(o.className="autoResize",o.style.display="inline-block",o.appendChild(i))}function c(h,d){let f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;s=h,u(d),s.nodeName==="TEXTAREA"&&(s.style.resize="none",s.style.height=`${n.minHeight}px`,s.style.minWidth=`${n.minWidth}px`,s.style.maxWidth=`${n.maxWidth}px`,s.style.overflowY="hidden"),f&&(vx(s,"input",a),vx(s,"keydown",l)),a()}return{init:c,resize:a,unObserve(){Cx(s,"input",a),Cx(s,"keydown",l)}}}function yx(t,e){const n=ON(e),r=e.value.split(`
|
|
61
|
+
`);let i=n,o=0;for(let s=0;s<r.length;s++){const a=r[s];s!==0&&(o+=r[s-1].length+1);const l=o+a.length;if(t==="home"?i=o:t==="end"&&(i=l),n<=l)break}np(e,i)}function ha(t,e,n){return(e=jX(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function jX(t){var e=UX(t,"string");return typeof e=="symbol"?e:e+""}function UX(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const zX="ht_editor_visible",mf="ht_editor_hidden",bx="textEditor",YX="text";class Sl extends Zu{static get EDITOR_TYPE(){return YX}constructor(e){super(e),ha(this,"eventManager",new _i(this)),ha(this,"autoResize",XD(this.hot.rootDocument)),ha(this,"TEXTAREA",void 0),ha(this,"textareaStyle",void 0),ha(this,"TEXTAREA_PARENT",void 0),ha(this,"textareaParentStyle",void 0),ha(this,"layerClass",void 0),this.eventManager=new _i(this),this.createElements(),this.bindEvents(),this.hot.addHookOnce("afterDestroy",()=>this.destroy())}getValue(){return this.TEXTAREA.value}setValue(e){this.TEXTAREA.value=e}open(){this.refreshDimensions(),this.showEditableElement(),this.hot.getShortcutManager().setActiveContextName("editor"),this.registerShortcuts()}close(){this.autoResize.unObserve(),Eg(this.hot.rootDocument.activeElement,this.hot.rootElement)&&this.hot.listen(),this.hideEditableElement(),this.unregisterShortcuts()}prepare(e,n,r,i,o,s){const a=this.state;if(super.prepare(e,n,r,i,o,s),!s.readOnly){this.refreshDimensions(!0);const{allowInvalid:l}=s;l&&!this.isOpened()&&(this.TEXTAREA.value=""),a!==Bt.FINISHED&&!this.isOpened()&&this.hideEditableElement()}}beginEditing(e,n){this.state===Bt.VIRGIN&&(this.TEXTAREA.value="",super.beginEditing(e,n))}focus(){this.TEXTAREA.select(),np(this.TEXTAREA,this.TEXTAREA.value.length)}createElements(){const{rootDocument:e}=this.hot;this.TEXTAREA=e.createElement("TEXTAREA"),ye(this.TEXTAREA,[["data-hot-input",""],Cl(-1)]),G(this.TEXTAREA,"handsontableInput"),this.textareaStyle=this.TEXTAREA.style,this.textareaStyle.width=0,this.textareaStyle.height=0,this.textareaStyle.overflowY="visible",this.TEXTAREA_PARENT=e.createElement("DIV"),G(this.TEXTAREA_PARENT,"handsontableInputHolder"),ve(this.TEXTAREA_PARENT,this.layerClass)&&pe(this.TEXTAREA_PARENT,this.layerClass),G(this.TEXTAREA_PARENT,mf),this.textareaParentStyle=this.TEXTAREA_PARENT.style,this.TEXTAREA_PARENT.appendChild(this.TEXTAREA),this.hot.rootElement.appendChild(this.TEXTAREA_PARENT)}hideEditableElement(){pz()&&(this.textareaStyle.textIndent="-99999px"),this.textareaStyle.overflowY="visible",this.textareaParentStyle.opacity="0",this.textareaParentStyle.height="1px",pe(this.TEXTAREA_PARENT,this.layerClass),G(this.TEXTAREA_PARENT,mf)}showEditableElement(){this.textareaParentStyle.height="",this.textareaParentStyle.overflow="",this.textareaParentStyle.position="",this.textareaParentStyle[this.hot.isRtl()?"left":"right"]="auto",this.textareaParentStyle.opacity="1",this.textareaStyle.textIndent="";const e=this.TEXTAREA_PARENT.childNodes;let n=!1;de(e.length-1,r=>{const i=e[r];if(ve(i,"handsontableEditor"))return n=!0,!1}),ve(this.TEXTAREA_PARENT,mf)&&pe(this.TEXTAREA_PARENT,mf),n?(this.layerClass=zX,G(this.TEXTAREA_PARENT,this.layerClass)):(this.layerClass=this.getEditedCellsLayerClass(),G(this.TEXTAREA_PARENT,this.layerClass))}refreshValue(){const e=this.hot.toPhysicalRow(this.row),n=this.hot.getSourceDataAtCell(e,this.col);this.originalValue=n,this.setValue(n),this.refreshDimensions()}refreshDimensions(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(this.state!==Bt.EDITING&&!e)return;if(this.TD=this.getEditedCell(),!this.TD){e||this.close();return}const{top:n,start:r,width:i,maxWidth:o,height:s,maxHeight:a}=this.getEditedCellRect();this.textareaParentStyle.top=`${n}px`,this.textareaParentStyle[this.hot.isRtl()?"right":"left"]=`${r}px`,this.showEditableElement();const l=this.hot.rootWindow.getComputedStyle(this.TD);this.TEXTAREA.style.fontSize=l.fontSize,this.TEXTAREA.style.fontFamily=l.fontFamily,this.TEXTAREA.style.backgroundColor=this.TD.style.backgroundColor,this.autoResize.init(this.TEXTAREA,{minWidth:Math.min(i,o),minHeight:Math.min(s,a),maxWidth:o,maxHeight:a},!0)}bindEvents(){VN()&&this.eventManager.addEventListener(this.TEXTAREA,"focusout",()=>this.finishEditing(!1)),this.addHook("afterScrollHorizontally",()=>this.refreshDimensions()),this.addHook("afterScrollVertically",()=>this.refreshDimensions()),this.addHook("afterColumnResize",()=>{this.refreshDimensions(),this.state===Bt.EDITING&&this.focus()}),this.addHook("afterRowResize",()=>{this.refreshDimensions(),this.state===Bt.EDITING&&this.focus()})}allowKeyEventPropagation(){}destroy(){this.eventManager.destroy(),this.clearHooks()}registerShortcuts(){const n=this.hot.getShortcutManager().getContext("editor"),r={runOnlyIf:()=>ae(this.hot.getSelected()),group:bx},i=()=>{this.hot.rootDocument.execCommand("insertText",!1,`
|
|
62
|
+
`)};n.addShortcuts([{keys:[["Control","Enter"]],callback:()=>(i(),!1),runOnlyIf:o=>!this.hot.selection.isMultiple()&&!o.altKey},{keys:[["Meta","Enter"]],callback:()=>(i(),!1),runOnlyIf:()=>!this.hot.selection.isMultiple()},{keys:[["Alt","Enter"]],callback:()=>(i(),!1)},{keys:[["Home"]],callback:(o,s)=>{let[a]=s;yx(a,this.TEXTAREA)}},{keys:[["End"]],callback:(o,s)=>{let[a]=s;yx(a,this.TEXTAREA)}}],r)}unregisterShortcuts(){this.hot.getShortcutManager().getContext("editor").removeShortcutsByGroup(bx)}}const GX="base";function Ed(t,e,n,r,i,o,s){const a=s.ariaTags,l=[],u=[],c=[],h=[];s.className&&G(e,s.className),s.readOnly?(l.push(s.readOnlyCellClassName),a&&h.push(bP())):a&&c.push(bP()[0]),s.valid===!1&&s.invalidCellClassName?(l.push(s.invalidCellClassName),a&&h.push(SP())):(u.push(s.invalidCellClassName),a&&c.push(SP()[0])),s.wordWrap===!1&&s.noWordWrapClassName&&l.push(s.noWordWrapClassName),!o&&s.placeholder&&l.push(s.placeholderCellClassName),pe(e,u),G(e,l),qu(e,c),ye(e,h)}Ed.RENDERER_TYPE=GX;const qX="text";function ls(t,e,n,r,i,o,s){Ed.apply(this,[t,e,n,r,i,o,s]);let a=o;!a&&s.placeholder&&(a=s.placeholder),a=Pt(a),s.trimWhitespace&&(a=a.trim()),ol(e,a)}ls.RENDERER_TYPE=qX;const KX="text",ZD={CELL_TYPE:KX,editor:Sl,renderer:ls};ci(ZD);De.editors={BaseEditor:Zu};function De(t,e){const n=new KD(t,e||{},eE);return n.init(),n}De.Core=function(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return new KD(t,e,eE)};De.DefaultSettings=BD();De.hooks=re.getSingleton();De.CellCoords=al;De.CellRange=yd;De.packageName="handsontable";De.buildDate="24/04/2025 10:59:00";De.version="15.3.0";De.languages={dictionaryKeys:dK,getLanguageDictionary:ND,getLanguagesDictionaries:wK,registerLanguageDictionary:HD,getTranslatedPhrase:DD};function hS(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function XX(t){if(Array.isArray(t))return hS(t)}function ZX(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function qh(t,e,n){return e=rm(e),i4(t,QD()?Reflect.construct(e,n||[],rm(t).constructor):e.apply(t,n))}function Du(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Sx(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,JD(r.key),r)}}function ku(t,e,n){return e&&Sx(t.prototype,e),n&&Sx(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function QX(t,e,n){return(e=JD(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function rm(t){return rm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},rm(t)}function Kh(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&dS(t,e)}function QD(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(QD=function(){return!!t})()}function JX(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function e4(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
63
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Rx(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function t4(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Rx(Object(n),!0).forEach(function(r){QX(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Rx(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function n4(t,e){if(t==null)return{};var n,r,i=r4(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)===-1&&{}.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function r4(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}function i4(t,e){if(e&&(typeof e=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ZX(t)}function dS(t,e){return dS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},dS(t,e)}function o4(t){return XX(t)||JX(t)||a4(t)||e4()}function s4(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function JD(t){var e=s4(t,"string");return typeof e=="symbol"?e:e+""}function a4(t,e){if(t){if(typeof t=="string")return hS(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?hS(t,e):void 0}}var ry=null,l4="Your `HotTable` configuration includes `autoRowSize`/`autoColumnSize` options, which are not compatible with the component-based renderers`. Disable `autoRowSize` and `autoColumnSize` to prevent row and column misalignment.",u4="The Handsontable instance bound to this component was destroyed and cannot be used properly.",im="global",c4="hot-wrapper-editor-container";function h4(){if(typeof console<"u"){var t;(t=console).warn.apply(t,arguments)}}function fS(t,e){var n=Dt.Children.toArray(t),r=Dt.Children.count(t),i=null;return r!==0&&(r===1&&n[0].props[e]?i=n[0]:i=n.find(function(o){return o.props[e]!==void 0})),i||null}function ek(t){return t?t.type.WrappedComponent?t.type.WrappedComponent:t.type:null}function tk(t,e){if(typeof t>"u"||e===null)return null;var n=rk(e.props,!1);return n.className="".concat(c4," ").concat(n.className),zH.createPortal(Dt.createElement("div",Object.assign({},n),e),t.body)}function nk(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:im,r=fS(t,"hot-editor"),i=ek(r);return r?Dt.cloneElement(r,{emitEditorInstance:function(s,a){e.get(i)||e.set(i,new Map);var l=e.get(i);l.set(a??im,s)},editorColumnScope:n,isEditor:!0}):null}function d4(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:document,r=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0;n||(n=document),ry||(ry=n.createDocumentFragment());var o=i??n.createElement("DIV");ry.appendChild(o);var s=Dt.cloneElement(t,t4({key:"".concat(e.row,"-").concat(e.col)},e));return{portal:zH.createPortal(s,o,r),portalContainer:o}}function rk(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return{id:t.id||(e?"hot-"+Math.random().toString(36).substring(5):void 0),className:t.className||"",style:t.style||{}}}function f4(){return typeof window<"u"}var ik=function(){function t(){Du(this,t)}return ku(t,null,[{key:"getSettings",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.prevProps,o=i===void 0?{}:i,s=r.isInit,a=s===void 0?!1:s,l=r.initOnlySettingKeys,u=l===void 0?[]:l,c=function(y){return!a&&u.includes(y)?o[y]===n[y]:!1},h={};if(n.settings){var d=n.settings;for(var f in d)d.hasOwnProperty(f)&&!c(f)&&(h[f]=d[f])}for(var g in n)g!=="settings"&&g!=="children"&&!c(g)&&n.hasOwnProperty(g)&&(h[g]=n[g]);return h}}])}(),g4=function(t){function e(){return Du(this,e),qh(this,e,arguments)}return Kh(e,t),ku(e,[{key:"getSettingsProps",value:function(){var r=this;return this.internalProps=["_componentRendererColumns","_emitColumnSettings","_columnIndex","_getChildElementByType","_getRendererWrapper","_getEditorClass","_getEditorCache","_getOwnerDocument","hot-renderer","hot-editor","children"],Object.keys(this.props).filter(function(i){return!r.internalProps.includes(i)}).reduce(function(i,o){return i[o]=r.props[o],i},{})}},{key:"getLocalEditorElement",value:function(){return nk(this.props.children,this.props._getEditorCache(),this.props._columnIndex)}},{key:"createColumnSettings",value:function(){var r=this.props._getChildElementByType(this.props.children,"hot-renderer"),i=this.getLocalEditorElement();this.columnSettings=ik.getSettings(this.getSettingsProps()),r!==null&&(this.columnSettings.renderer=this.props._getRendererWrapper(r),this.props._componentRendererColumns.set(this.props._columnIndex,!0)),i!==null&&(this.columnSettings.editor=this.props._getEditorClass(i,this.props._columnIndex))}},{key:"emitColumnSettings",value:function(){this.props._emitColumnSettings(this.columnSettings,this.props._columnIndex)}},{key:"componentDidMount",value:function(){this.createColumnSettings(),this.emitColumnSettings()}},{key:"componentDidUpdate",value:function(){this.createColumnSettings(),this.emitColumnSettings()}},{key:"render",value:function(){var r=this.props._getOwnerDocument(),i=tk(r,this.getLocalEditorElement());return Dt.createElement(Dt.Fragment,null,i)}}])}(Dt.Component),m4=function(t){function e(){var n;return Du(this,e),n=qh(this,e,arguments),n.state={portals:[]},n}return Kh(e,t),ku(e,[{key:"render",value:function(){return Dt.createElement(Dt.Fragment,null,this.state.portals)}}])}(Dt.Component),p4="15.3.0";function w4(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ok={exports:{}},iy,Ex;function v4(){if(Ex)return iy;Ex=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return iy=t,iy}var oy,Tx;function C4(){if(Tx)return oy;Tx=1;var t=v4();function e(){}function n(){}return n.resetWarningCache=e,oy=function(){function i(a,l,u,c,h,d){if(d!==t){var f=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw f.name="Invariant Violation",f}}i.isRequired=i;function o(){return i}var s={array:i,bigint:i,bool:i,func:i,number:i,object:i,string:i,symbol:i,any:i,arrayOf:o,element:i,elementType:i,instanceOf:o,node:i,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:e};return s.PropTypes=s,s},oy}ok.exports=C4()();var y4=ok.exports,sy=w4(y4),O0=function(t){function e(){var n;return Du(this,e),n=qh(this,e,arguments),n.id=null,n.__hotInstance=null,n.hotElementRef=null,n.columnSettings=[],n.renderersPortalManager=null,n.portalCache=new Map,n.portalContainerCache=new Map,n.renderedCellCache=new Map,n.editorCache=new Map,n.componentRendererColumns=new Map,n}return Kh(e,t),ku(e,[{key:"hotInstance",get:function(){return!this.__hotInstance||this.__hotInstance&&!this.__hotInstance.isDestroyed?this.__hotInstance:(console.warn(u4),null)},set:function(r){this.__hotInstance=r}},{key:"_isHotInstanceDestroyed",value:function(){return this.__hotInstance&&this.__hotInstance.isDestroyed}},{key:"getPortalContainerCache",value:function(){return this.portalContainerCache}},{key:"getRenderedCellCache",value:function(){return this.renderedCellCache}},{key:"getEditorCache",value:function(){return this.editorCache}},{key:"clearCache",value:function(){this.getRenderedCellCache().clear(),this.componentRendererColumns.clear()}},{key:"getOwnerDocument",value:function(){return f4()?this.hotElementRef?this.hotElementRef.ownerDocument:document:null}},{key:"setHotElementRef",value:function(r){this.hotElementRef=r}},{key:"getRendererWrapper",value:function(r){var i=this;return function(s,a,l,u,c,h,d){var f=i.getRenderedCellCache(),g=i.getPortalContainerCache(),C="".concat(l,"-").concat(u),y=s.guid,E="".concat(y,"-").concat(C),v="".concat(C,"-").concat(y);if(f.has(C)&&(a.innerHTML=f.get(C).innerHTML),a&&!a.getAttribute("ghost-table")){for(var P=i.portalCache.get(v),O=g.get(E);a.firstChild;)a.removeChild(a.firstChild);if(P&&O)a.appendChild(O);else{var L=d4(r,{TD:a,row:l,col:u,prop:c,value:h,cellProperties:d,isRenderer:!0},a.ownerDocument,v,O),T=L.portal,A=L.portalContainer;g.set(E,A),a.appendChild(A),i.portalCache.set(v,T)}}return f.set(C,a),a}}},{key:"getEditorClass",value:function(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:im,s=ek(r),a=(i=this.getEditorCache().get(s))===null||i===void 0?void 0:i.get(o);return this.makeEditorClass(a)}},{key:"makeEditorClass",value:function(r){var i=function(o){function s(a){var l;return Du(this,s),l=qh(this,s,[a]),r.hotCustomEditorInstance=l,l.editorComponent=r,l}return Kh(s,o),ku(s,[{key:"focus",value:function(){}},{key:"getValue",value:function(){}},{key:"setValue",value:function(){}},{key:"open",value:function(){}},{key:"close",value:function(){}}])}(De.editors.BaseEditor);return Object.getOwnPropertyNames(De.editors.BaseEditor.prototype).forEach(function(o){o!=="constructor"&&(i.prototype[o]=function(){for(var s,a=arguments.length,l=new Array(a),u=0;u<a;u++)l[u]=arguments[u];return(s=r[o]).call.apply(s,[r].concat(l))})}),i}},{key:"getGlobalRendererElement",value:function(){return fS(this.props.children,"hot-renderer")}},{key:"getGlobalEditorElement",value:function(){return nk(this.props.children,this.getEditorCache())}},{key:"createNewGlobalSettings",value:function(){var r,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=this._isHotInstanceDestroyed()?[]:((r=this.hotInstance)===null||r===void 0||(r=r.getSettings())===null||r===void 0?void 0:r._initOnlySettings)||[],a=ik.getSettings(this.props,{prevProps:o,isInit:i,initOnlySettingKeys:s}),l=this.getGlobalRendererElement(),u=this.getGlobalEditorElement();if(a.columns=this.columnSettings.length?this.columnSettings:a.columns,u)a.editor=this.getEditorClass(u,im);else{var c;this.props.editor||(c=this.props.settings)!==null&&c!==void 0&&c.editor?a.editor=this.props.editor||this.props.settings.editor:a.editor=Jb("text")}if(l)a.renderer=this.getRendererWrapper(l),this.componentRendererColumns.set("global",!0);else{var h;this.props.renderer||(h=this.props.settings)!==null&&h!==void 0&&h.renderer?a.renderer=this.props.renderer||this.props.settings.renderer:a.renderer=rS("text")}return a}},{key:"displayAutoSizeWarning",value:function(r){var i,o;this.hotInstance&&((i=this.hotInstance.getPlugin("autoRowSize"))!==null&&i!==void 0&&i.enabled||(o=this.hotInstance.getPlugin("autoColumnSize"))!==null&&o!==void 0&&o.enabled)&&this.componentRendererColumns.size>0&&h4(l4)}},{key:"setHotColumnSettings",value:function(r,i){this.columnSettings[i]=r}},{key:"handsontableBeforeViewRender",value:function(){this.portalCache.clear(),this.getRenderedCellCache().clear()}},{key:"handsontableAfterViewRender",value:function(){this.renderersPortalManager.setState({portals:o4(this.portalCache.values())})}},{key:"updateHot",value:function(r){this.hotInstance&&this.hotInstance.updateSettings(r,!1)}},{key:"setRenderersPortalManagerRef",value:function(r){this.renderersPortalManager=r}},{key:"componentDidMount",value:function(){var r=this,i=this.createNewGlobalSettings(!0);this.hotInstance=new De.Core(this.hotElementRef,i),this.hotInstance.addHook("beforeViewRender",function(){return r.handsontableBeforeViewRender()}),this.hotInstance.addHook("afterViewRender",function(){return r.handsontableAfterViewRender()}),this.hotInstance.init(),this.displayAutoSizeWarning(i)}},{key:"componentDidUpdate",value:function(r){this.clearCache();var i=this.createNewGlobalSettings(!1,r);this.updateHot(i),this.displayAutoSizeWarning(i)}},{key:"componentWillUnmount",value:function(){this.clearCache(),this.hotInstance&&this.hotInstance.destroy()}},{key:"render",value:function(){var r=this,i=function(c){return c.type===g4},o=Dt.Children.toArray(this.props.children),s=o.filter(function(u){return i(u)}).map(function(u,c){return Dt.cloneElement(u,{_componentRendererColumns:r.componentRendererColumns,_emitColumnSettings:r.setHotColumnSettings.bind(r),_columnIndex:c,_getChildElementByType:fS.bind(r),_getRendererWrapper:r.getRendererWrapper.bind(r),_getEditorClass:r.getEditorClass.bind(r),_getOwnerDocument:r.getOwnerDocument.bind(r),_getEditorCache:r.getEditorCache.bind(r),children:u.props.children})}),a=rk(this.props),l=tk(this.getOwnerDocument(),this.getGlobalEditorElement());return Dt.createElement(Dt.Fragment,null,Dt.createElement("div",Object.assign({ref:this.setHotElementRef.bind(this)},a),s),Dt.createElement(m4,{ref:this.setRenderersPortalManagerRef.bind(this)}),l)}}],[{key:"version",get:function(){return p4}}])}(Dt.Component);O0.propTypes={style:sy.object,id:sy.string,className:sy.string};var b4=["children"],S4=Dt.forwardRef(function(t,e){var n,r=t.children,i=n4(t,b4),o=typeof Dt.useId=="function"?Dt.useId():void 0,s=(n=i.id)!==null&&n!==void 0?n:o;return Dt.createElement(O0,Object.assign({id:s},i,{ref:e}),r)});S4.version=O0.version;Dt.Component;const _x="handsontableEditor",R4="handsontable";class x0 extends Sl{static get EDITOR_TYPE(){return R4}open(){super.open();const e=this.htContainer.style;this.htEditor&&(this.htEditor.destroy(),e.width="",e.height="",e.overflow=""),e.display==="none"&&(e.display=""),this.htEditor=new this.hot.constructor(this.htContainer,this.htOptions),this.htEditor.init(),this.htEditor.rootElement.style.display="",this.cellProperties.strict?this.htEditor.selectCell(0,0):this.htEditor.deselectCell(),np(this.TEXTAREA,0,this.TEXTAREA.value.length),this.htEditor.updateSettings({width:this.getWidth(),height:this.getHeight()}),this.refreshDimensions()}close(){this.htEditor&&(this.htEditor.rootElement.style.display="none"),this.removeHooksByKey("beforeKeyDown"),super.close()}prepare(e,n,r,i,o,s){super.prepare(e,n,r,i,o,s);const a=this,l={startRows:0,startCols:0,minRows:0,minCols:0,className:"listbox",copyPaste:!1,autoColumnSize:!1,autoRowSize:!1,readOnly:!0,fillHandle:!1,autoWrapCol:!1,autoWrapRow:!1,ariaTags:!1,themeName:this.hot.getCurrentThemeName(),afterOnCellMouseDown(u,c){const h=this.getSourceData(c.row,c.col);h!==void 0&&a.setValue(h),a.hot.destroyEditor()},preventWheel:!0,layoutDirection:this.hot.isRtl()?"rtl":"ltr"};this.cellProperties.handsontable&&rn(l,s.handsontable),this.htOptions=l}beginEditing(e,n){const r=this.hot.getSettings().onBeginEditing;r&&r()===!1||super.beginEditing(e,n)}createElements(){super.createElements();const e=this.hot.rootDocument.createElement("DIV");e.className="handsontableEditor",this.TEXTAREA_PARENT.appendChild(e),this.htContainer=e,this.assignHooks()}finishEditing(e,n,r){if(this.htEditor&&this.htEditor.isListening()&&this.hot.listen(),this.htEditor&&this.htEditor.getSelectedLast()){const i=this.htEditor.getValue();i!==void 0&&this.setValue(i)}super.finishEditing(e,n,r)}getHeight(){return this.htEditor.view.getTableHeight()+1}getWidth(){return this.htEditor.view.getTableWidth()}assignHooks(){this.hot.addHook("afterDestroy",()=>{var e;(e=this.htEditor)===null||e===void 0||e.destroy()}),this.hot.addHook("afterSetTheme",(e,n)=>{if(!n){var r;(r=this.htEditor)===null||r===void 0||r.useTheme(e)}})}registerShortcuts(){const n=this.hot.getShortcutManager().getContext("editor");super.registerShortcuts();const r={group:_x,relativeToGroup:Qs,position:"before"},i=(o,s)=>{const a=this.htEditor;if(o!==void 0&&(o<0||a.flipped&&o>a.countRows()-1?a.deselectCell():a.selectCell(o,0),a.getData().length))return s.preventDefault(),Pi(s),this.hot.listen(),this.TEXTAREA.focus(),!1};n.addShortcuts([{keys:[["ArrowUp"]],callback:o=>{const s=this.htEditor;let a,l;return!s.getSelectedLast()&&s.flipped?a=s.countRows()-1:s.getSelectedLast()&&(s.flipped?(l=s.getSelectedLast()[0],a=Math.max(0,l-1)):(l=s.getSelectedLast()[0],a=l-1)),i(a,o)},preventDefault:!1},{keys:[["ArrowDown"]],callback:o=>{const s=this.htEditor;let a,l;if(!s.getSelectedLast()&&!s.flipped)a=0;else if(s.getSelectedLast()){if(s.flipped)a=s.getSelectedLast()[0]+1;else if(!s.flipped){const u=s.countRows()-1;l=s.getSelectedLast()[0],a=Math.min(u,l+1)}}return i(a,o)},preventDefault:!1}],r)}unregisterShortcuts(){super.unregisterShortcuts(),this.hot.getShortcutManager().getContext("editor").removeShortcutsByGroup(_x)}}function E4(t,e){sk(t,e),e.add(t)}function Mx(t,e,n){sk(t,e),e.set(t,n)}function sk(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function pf(t,e,n){return(e=T4(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function T4(t){var e=_4(t,"string");return typeof e=="symbol"?e:e+""}function _4(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ay(t,e){return t.get(gS(t,e))}function gS(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const M4="autocomplete";var ly=new WeakMap,Ix=new WeakMap,uy=new WeakSet;class A0 extends x0{constructor(){super(...arguments),E4(this,uy),pf(this,"query",null),pf(this,"strippedChoices",[]),pf(this,"rawChoices",[]),Mx(this,ly,this.hot.guid.slice(0,9)),Mx(this,Ix,ip(()=>{this.focus()},100)),pf(this,"sortByRelevance",function(e,n,r){const i=[],o=[],s=e.length;let a=n.length,l,u,c,h;if(s===0){for(c=0;c<a;c++)o.push(c);return o}for(c=0;c<a;c++){if(u=yP(Pt(n[c])),r)h=u.indexOf(e);else{const d=this.cellProperties.locale;h=u.toLocaleLowerCase(d).indexOf(e.toLocaleLowerCase(d))}h!==-1&&(l=u.length-h-s,i.push({baseIndex:c,index:h,charsLeft:l,value:u}))}for(i.sort((d,f)=>{if(f.index===-1)return-1;if(d.index===-1)return 1;if(d.index<f.index)return-1;if(f.index<d.index)return 1;if(d.index===f.index){if(d.charsLeft<f.charsLeft)return-1;if(d.charsLeft>f.charsLeft)return 1}return 0}),c=0,a=i.length;c<a;c++)o.push(i[c].baseIndex);return o})}static get EDITOR_TYPE(){return M4}getValue(){const e=this.rawChoices.find(n=>this.stripValueIfNeeded(n)===this.TEXTAREA.value);return ae(e)?e:this.TEXTAREA.value}createElements(){super.createElements(),G(this.htContainer,"autocompleteEditor"),G(this.htContainer,this.hot.rootWindow.navigator.platform.indexOf("Mac")===-1?"":"htMacScroll"),this.hot.getSettings().ariaTags&&ye(this.TEXTAREA,[kU(),xU(),yN("listbox"),VU()])}prepare(e,n,r,i,o,s){super.prepare(e,n,r,i,o,s),this.hot.getSettings().ariaTags&&ye(this.TEXTAREA,[Gr("false"),WU(`${ay(ly,this)}-listbox-${e}-${n}`)])}open(){super.open();const e=this.cellProperties.trimDropdown===void 0?!0:this.cellProperties.trimDropdown,n=this.hot.getSettings().ariaTags,r=Array.isArray(this.cellProperties.source)?this.cellProperties.source:null,i=r==null?void 0:r.length,{row:o,col:s}=this;this.showEditableElement(),this.focus(),this.addHook("beforeKeyDown",a=>this.onBeforeKeyDown(a)),this.htEditor.addHook("afterScroll",ay(Ix,this)),this.htEditor.updateSettings({colWidths:e?[qt(this.TEXTAREA)-2]:void 0,autoColumnSize:!0,renderer:(a,l,u,c,h,d,f)=>{ls(a,l,u,c,h,d,f);const{filteringCaseSensitive:g,allowHtml:C,locale:y}=this.cellProperties,E=this.query;let v=Pt(d),P,O;v&&!C&&(P=g===!0?v.indexOf(E):v.toLocaleLowerCase(y).indexOf(E.toLocaleLowerCase(y)),P!==-1&&(O=v.substr(P,E.length),v=v.replace(O,`<strong>${O}</strong>`))),n&&ye(l,[AU(),...r?[zU(i)]:[],...r?[YU(r.indexOf(d)+1)]:[],["id",`${this.htEditor.rootElement.id}_${u}-${c}`]]),l.innerHTML=v},afterSelectionEnd:(a,l)=>{if(n){const u=h=>{ye(h,[MR()]),ye(this.TEXTAREA,...BU(h.id))},c=this.htEditor.getCell(a,l,!0);c!==null?u(c):this.htEditor.addHookOnce("afterScrollVertically",()=>{const h=this.htEditor.getCell(a,l,!0);u(h)})}}}),n&&(ye(this.htEditor.view._wt.wtOverlays.wtTable.TABLE,...Uo()),ye(this.htEditor.rootElement,[CN(),jU("polite"),UU("text"),["id",`${ay(ly,this)}-listbox-${o}-${s}`]]),ye(this.TEXTAREA,...Gr("true"))),this.hot._registerTimeout(()=>{this.queryChoices(this.TEXTAREA.value)})}close(){this.removeHooksByKey("beforeKeyDown"),super.close(),this.hot.getSettings().ariaTags&&ye(this.TEXTAREA,[Gr("false")])}discardEditor(e){super.discardEditor(e),this.hot.view.render()}queryChoices(e){const n=this.cellProperties.source;this.query=e,typeof n=="function"?n.call(this.cellProperties,e,r=>{this.rawChoices=r,this.updateChoicesList(this.stripValuesIfNeeded(r))}):Array.isArray(n)?(this.rawChoices=n,this.updateChoicesList(this.stripValuesIfNeeded(n))):this.updateChoicesList([])}updateChoicesList(e){const n=ON(this.TEXTAREA),r=tz(this.TEXTAREA),i=this.cellProperties.sortByRelevance,o=this.cellProperties.filter;let s=null,a=null,l=e;i&&(s=this.sortByRelevance(this.stripValueIfNeeded(this.getValue()),l,this.cellProperties.filteringCaseSensitive));const u=Array.isArray(s)?s.length:0;if(o===!1)u&&(a=s[0]);else{const c=[];for(let h=0,d=l.length;h<d&&!(i&&u<=h);h++)u?c.push(l[s[h]]):c.push(l[h]);a=0,l=c}this.strippedChoices=l,l.length===0?this.htEditor.rootElement.style.display="none":this.htEditor.rootElement.style.display="",this.htEditor.loadData(Rg([l])),l.length>0&&(this.updateDropdownDimensions(),this.flipDropdownIfNeeded(),this.cellProperties.strict===!0&&this.highlightBestMatchingChoice(a)),this.hot.listen(),np(this.TEXTAREA,n,n===r?void 0:r)}flipDropdownIfNeeded(){const e=this.getEditedCellRect(),n=e.height;let r=e.top;if(this.hot.view.isVerticallyScrollableByWindow()){const a=this.hot.view.getTableOffset().top-this.hot.rootWindow.scrollY;r=Math.max(r+a,0)}const i=this.getHeight(),o=this.hot.view.getWorkspaceHeight()-r-n,s=i>o&&r>o+n;return s?this.flipDropdown(i):this.unflipDropdown(),this.limitDropdownIfNeeded(s?r:o,i),s}limitDropdownIfNeeded(e,n){if(n>e){let r=0,i=0,o=0,s=null;do o=this.htEditor.getRowHeight(i)||this.htEditor.view.getDefaultRowHeight(),r+=o,i+=1;while(r<e);s=r-o,this.htEditor.flipped&&(this.htEditor.rootElement.style.top=`${parseInt(this.htEditor.rootElement.style.top,10)+n-s}px`),this.setDropdownHeight(r-o)}}flipDropdown(e){const n=this.htEditor.rootElement.style;n.position="absolute",n.top=`${-e}px`,this.htEditor.flipped=!0}unflipDropdown(){const e=this.htEditor.rootElement.style;e.position="absolute",e.top="",this.htEditor.flipped=void 0}updateDropdownDimensions(){this.htEditor.updateSettings({width:this.getWidth(),height:this.getHeight()}),gS(uy,this,Px).call(this),this.htEditor.view._wt.wtTable.alignOverlaysWithTrimmingContainer()}setDropdownHeight(e){this.htEditor.updateSettings({height:e}),gS(uy,this,Px).call(this),this.htEditor.view._wt.wtTable.alignOverlaysWithTrimmingContainer()}highlightBestMatchingChoice(e){typeof e=="number"?this.htEditor.selectCell(e,0,void 0,void 0,void 0,!1):this.htEditor.deselectCell()}getHeight(){const e=this.hot.rootWindow.getComputedStyle(this.htContainer.querySelector(".htCore")),n=parseInt(e.borderTopWidth,10)+parseInt(e.borderBottomWidth,10),r=Math.min(this.cellProperties.visibleRows,this.strippedChoices.length);return Array.from({length:r},(o,s)=>s).reduce((o,s)=>{const a=this.htEditor.getRowHeight(s)||this.htEditor.view.getDefaultRowHeight();return o+a},0)+n+1}getWidth(){const e=this.hot.rootWindow.getComputedStyle(this.htContainer.querySelector(".htCore")),n=parseInt(e.borderInlineStartWidth,10)+parseInt(e.borderInlineEndWidth,10);return this.htEditor.getColWidth(0)+n}stripValueIfNeeded(e){return this.stripValuesIfNeeded([e])[0]}stripValuesIfNeeded(e){const{allowHtml:n}=this.cellProperties,r=Be(e,o=>Pt(o));return Be(r,o=>n?o:yP(o))}allowKeyEventPropagation(e){const n=this.htEditor.getSelectedRangeLast(),r={row:n?n.from.row:-1};let i=!1;return e===me.ARROW_DOWN&&r.row>0&&r.row<this.htEditor.countRows()-1&&(i=!0),e===me.ARROW_UP&&r.row>-1&&(i=!0),i}onBeforeKeyDown(e){if(vz(e.keyCode)||e.keyCode===me.BACKSPACE||e.keyCode===me.DELETE||e.keyCode===me.INSERT){let n=10;if(e.keyCode===me.C&&(e.ctrlKey||e.metaKey))return;this.isOpened()||(n+=10),this.htEditor&&this.hot._registerTimeout(()=>{this.queryChoices(this.TEXTAREA.value)},n)}}}function Px(){this.htEditor.view.hasVerticalScroll()&&this.htEditor.updateSettings({width:this.getWidth()+vn(this.hot.rootDocument)})}const I4="checkbox";class ak extends Zu{static get EDITOR_TYPE(){return I4}beginEditing(e,n){if(n&&n.type==="mouseup"&&n.target.nodeName==="TD"){const r=this.TD.querySelector('input[type="checkbox"]');ve(r,"htBadValue")||r.click()}}finishEditing(){}init(){}open(){}close(){}getValue(){}setValue(){}focus(){}}/*!
|
|
64
|
+
* Pikaday
|
|
65
|
+
*
|
|
66
|
+
* Copyright © 2014 David Bushell | BSD & MIT license | https://github.com/Pikaday/Pikaday
|
|
67
|
+
*/const ks=()=>window,jr=()=>window.document,mS=(t,e)=>window.setTimeout(t,e),Ki=function(t,e,n,r){t.addEventListener(e,n,!!r)},To=function(t,e,n,r){t.removeEventListener(e,n,!!r)},P4=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},Cr=function(t,e){return(" "+t.className+" ").indexOf(" "+e+" ")!==-1},cy=function(t,e){Cr(t,e)||(t.className=t.className===""?e:t.className+" "+e)},hy=function(t,e){t.className=P4((" "+t.className+" ").replace(" "+e+" "," "))},H0=function(t){return/Array/.test(Object.prototype.toString.call(t))},Rr=function(t){return/Date/.test(Object.prototype.toString.call(t))&&!isNaN(t.getTime())},O4=function(t){let e=t.getDay();return e===0||e===6},x4=function(t){return t%4===0&&t%100!==0||t%400===0},Ox=function(t,e){return[31,x4(t)?29:28,31,30,31,30,31,31,30,31,30,31][e]},wf=function(t){Rr(t)&&t.setHours(0,0,0,0)},vf=function(t,e){return t.getTime()===e.getTime()},om=function(t,e,n){let r,i;for(r in e)i=t[r]!==void 0,i&&typeof e[r]=="object"&&e[r]!==null&&e[r].nodeName===void 0?Rr(e[r])?n&&(t[r]=new Date(e[r].getTime())):H0(e[r])?n&&(t[r]=e[r].slice(0)):t[r]=om({},e[r],n):(n||!i)&&(t[r]=e[r]);return t},xx=function(t,e,n){let r=jr().createEvent("HTMLEvents");r.initEvent(e,!0,!1),r=om(r,n),t.dispatchEvent(r)},Ax=function(t){return t.month<0&&(t.year-=Math.ceil(Math.abs(t.month)/12),t.month+=12),t.month>11&&(t.year+=Math.floor(Math.abs(t.month)/12),t.month-=12),t},$i={field:null,bound:void 0,ariaLabel:"Use the arrow keys to pick a date",position:"bottom left",reposition:!0,format:"YYYY-MM-DD",toString:null,parse:null,defaultDate:null,setDefaultDate:!1,firstDay:0,firstWeekOfYearMinDays:4,formatStrict:!1,minDate:null,maxDate:null,yearRange:10,showWeekNumber:!1,pickWholeWeek:!1,minYear:0,maxYear:9999,minMonth:void 0,maxMonth:void 0,startRange:null,endRange:null,isRTL:!1,yearSuffix:"",showMonthAfterYear:!1,showDaysInNextAndPreviousMonths:!1,enableSelectionDaysInNextAndPreviousMonths:!1,numberOfMonths:1,mainCalendar:"left",container:void 0,blurFieldOnSelect:!0,i18n:{previousMonth:"Previous Month",nextMonth:"Next Month",months:["January","February","March","April","May","June","July","August","September","October","November","December"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},theme:null,events:[],onSelect:null,onOpen:null,onClose:null,onDraw:null,keyboardInput:!0},Hx=function(t,e,n){for(e+=t.firstDay;e>=7;)e-=7;return n?t.i18n.weekdaysShort[e]:t.i18n.weekdays[e]},A4=function(t){let e=[],n="false";if(t.isEmpty)if(t.showDaysInNextAndPreviousMonths)e.push("is-outside-current-month"),t.enableSelectionDaysInNextAndPreviousMonths||e.push("is-selection-disabled");else return'<td class="is-empty"></td>';return t.isDisabled&&e.push("is-disabled"),t.isToday&&e.push("is-today"),t.isSelected&&(e.push("is-selected"),n="true"),t.hasEvent&&e.push("has-event"),t.isInRange&&e.push("is-inrange"),t.isStartRange&&e.push("is-startrange"),t.isEndRange&&e.push("is-endrange"),'<td data-day="'+t.day+'" class="'+e.join(" ")+'" aria-selected="'+n+'"><button class="pika-button pika-day" type="button" data-pika-year="'+t.year+'" data-pika-month="'+t.month+'" data-pika-day="'+t.day+'">'+t.day+"</button></td>"},H4=function(t,e){t.setHours(0,0,0,0);let n=t.getDate(),r=t.getDay(),i=e,o=i-1,s=7,a=function(d){return(d+s-1)%s};t.setDate(n+o-a(r));let l=new Date(t.getFullYear(),0,i),u=24*60*60*1e3,c=(t.getTime()-l.getTime())/u;return 1+Math.round((c-o+a(l.getDay()))/s)},N4=function(t,e,n,r,i){let o=new Date(r,n,e);return'<td class="pika-week">'+(t.hasMoment?t.moment(o).isoWeek():H4(o,i))+"</td>"},D4=function(t,e,n,r){return'<tr class="pika-row'+(n?" pick-whole-week":"")+(r?" is-selected":"")+'">'+(e?t.reverse():t).join("")+"</tr>"},k4=function(t){return"<tbody>"+t.join("")+"</tbody>"},L4=function(t){let e,n=[];for(t.showWeekNumber&&n.push("<th></th>"),e=0;e<7;e++)n.push('<th scope="col"><abbr title="'+Hx(t,e)+'">'+Hx(t,e,!0)+"</abbr></th>");return"<thead><tr>"+(t.isRTL?n.reverse():n).join("")+"</tr></thead>"},$4=function(t,e,n,r,i,o){let s,a,l,u=t._o,c=n===u.minYear,h=n===u.maxYear,d='<div id="'+o+'" class="pika-title" role="heading" aria-live="polite">',f,g,C=!0,y=!0;for(l=[],s=0;s<12;s++)l.push('<option value="'+(n===i?s-e:12+s-e)+'"'+(s===r?' selected="selected"':"")+(c&&s<u.minMonth||h&&s>u.maxMonth?' disabled="disabled"':"")+">"+u.i18n.months[s]+"</option>");for(f='<div class="pika-label">'+u.i18n.months[r]+'<select class="pika-select pika-select-month" tabindex="-1">'+l.join("")+"</select></div>",H0(u.yearRange)?(s=u.yearRange[0],a=u.yearRange[1]+1):(s=n-u.yearRange,a=1+n+u.yearRange),l=[];s<a&&s<=u.maxYear;s++)s>=u.minYear&&l.push('<option value="'+s+'"'+(s===n?' selected="selected"':"")+">"+s+"</option>");return g='<div class="pika-label">'+n+u.yearSuffix+'<select class="pika-select pika-select-year" tabindex="-1">'+l.join("")+"</select></div>",u.showMonthAfterYear?d+=g+f:d+=f+g,c&&(r===0||u.minMonth>=r)&&(C=!1),h&&(r===11||u.maxMonth<=r)&&(y=!1),e===0&&(d+='<button class="pika-prev'+(C?"":" is-disabled")+'" type="button">'+u.i18n.previousMonth+"</button>"),e===t._o.numberOfMonths-1&&(d+='<button class="pika-next'+(y?"":" is-disabled")+'" type="button">'+u.i18n.nextMonth+"</button>"),d+="</div>"},F4=function(t,e,n){return'<table cellpadding="0" cellspacing="0" class="pika-table" role="grid" aria-labelledby="'+n+'">'+L4(t)+k4(e)+"</table>"};function pS(t){let e=this,n=e.config(t);e._onMouseDown=function(i){if(!e._v)return;i=i||ks().event;let o=i.target||i.srcElement;if(o)if(Cr(o,"is-disabled")||(Cr(o,"pika-button")&&!Cr(o,"is-empty")&&!Cr(o.parentNode,"is-disabled")?(e.setDate(new Date(o.getAttribute("data-pika-year"),o.getAttribute("data-pika-month"),o.getAttribute("data-pika-day"))),n.bound&&mS(function(){e.hide(),n.blurFieldOnSelect&&n.field&&n.field.blur()},100)):Cr(o,"pika-prev")?e.prevMonth():Cr(o,"pika-next")&&e.nextMonth()),Cr(o,"pika-select"))e._c=!0;else if(i.preventDefault)i.preventDefault();else return i.returnValue=!1,!1},e._onChange=function(i){i=i||ks().event;let o=i.target||i.srcElement;o&&(Cr(o,"pika-select-month")?e.gotoMonth(o.value):Cr(o,"pika-select-year")&&e.gotoYear(o.value))},e._onKeyChange=function(i){if(i=i||ks().event,e.isVisible())switch(i.keyCode){case 13:case 27:n.field&&n.field.blur();break;case 37:e.adjustDate("subtract",1);break;case 38:e.adjustDate("subtract",7);break;case 39:e.adjustDate("add",1);break;case 40:e.adjustDate("add",7);break;case 8:case 46:e.setDate(null);break}},e._parseFieldValue=function(){if(n.parse)return n.parse(n.field.value,n.format);if(this.hasMoment){let i=this.moment(n.field.value,n.format,n.formatStrict);return i&&i.isValid()?i.toDate():null}else return new Date(Date.parse(n.field.value))},e._onInputChange=function(i){let o;i.firedBy!==e&&(o=e._parseFieldValue(),Rr(o)&&e.setDate(o),e._v||e.show())},e._onInputFocus=function(){e.show()},e._onInputClick=function(){e.show()},e._onInputBlur=function(){let i=jr().activeElement;do if(Cr(i,"pika-single"))return;while(i=i.parentNode);e._c||(e._b=mS(function(){e.hide()},50)),e._c=!1},e._onClick=function(i){i=i||ks().event;let o=i.target||i.srcElement,s=o;if(o){!hasEventListeners&&Cr(o,"pika-select")&&(o.onchange||(o.setAttribute("onchange","return;"),Ki(o,"change",e._onChange)));do if(Cr(s,"pika-single")||s===n.trigger)return;while(s=s.parentNode);e._v&&o!==n.trigger&&s!==n.trigger&&e.hide()}},e.el=jr().createElement("div"),e.el.className="pika-single"+(n.isRTL?" is-rtl":"")+(n.theme?" "+n.theme:""),Ki(e.el,"mousedown",e._onMouseDown,!0),Ki(e.el,"touchend",e._onMouseDown,!0),Ki(e.el,"change",e._onChange),n.keyboardInput&&Ki(jr(),"keydown",e._onKeyChange),n.field&&(n.container?n.container.appendChild(e.el):n.bound?jr().body.appendChild(e.el):n.field.parentNode.insertBefore(e.el,n.field.nextSibling),Ki(n.field,"change",e._onInputChange),n.defaultDate||(n.defaultDate=e._parseFieldValue(),n.setDefaultDate=!0));let r=n.defaultDate;Rr(r)?n.setDefaultDate?e.setDate(r,!0):e.gotoDate(r):e.gotoDate(new Date),n.bound?(this.hide(),e.el.className+=" is-bound",Ki(n.trigger,"click",e._onInputClick),Ki(n.trigger,"focus",e._onInputFocus),Ki(n.trigger,"blur",e._onInputBlur)):this.show()}pS.prototype={config:function(t){this._o||(this._o=om({},$i,!0));let e=om(this._o,t,!0);e.isRTL=!!e.isRTL,e.field=e.field&&e.field.nodeName?e.field:null,e.theme=typeof e.theme=="string"&&e.theme?e.theme:null,e.bound=!!(e.bound!==void 0?e.field&&e.bound:e.field),e.trigger=e.trigger&&e.trigger.nodeName?e.trigger:e.field,e.disableWeekends=!!e.disableWeekends,e.disableDayFn=typeof e.disableDayFn=="function"?e.disableDayFn:null;let n=parseInt(e.numberOfMonths,10)||1;if(e.numberOfMonths=n>4?4:n,Rr(e.minDate)||(e.minDate=!1),Rr(e.maxDate)||(e.maxDate=!1),e.minDate&&e.maxDate&&e.maxDate<e.minDate&&(e.maxDate=e.minDate=!1),e.minDate&&this.setMinDate(e.minDate),e.maxDate&&this.setMaxDate(e.maxDate),H0(e.yearRange)){let r=new Date().getFullYear()-10;e.yearRange[0]=parseInt(e.yearRange[0],10)||r,e.yearRange[1]=parseInt(e.yearRange[1],10)||r}else e.yearRange=Math.abs(parseInt(e.yearRange,10))||$i.yearRange,e.yearRange>100&&(e.yearRange=100);return e},toString:function(t){return t=t||this._o.format,Rr(this._d)?this._o.toString?this._o.toString(this._d,t):this.hasMoment?this.moment(this._d).format(t):this._d.toDateString():""},getMoment:function(){return this.hasMoment?this.moment(this._d):null},setMoment:function(t,e){this.hasMoment&&this.moment.isMoment(t)&&this.setDate(t.toDate(),e)},useMoment:function(t){this.hasMoment=!0,this.moment=t},getDate:function(){return Rr(this._d)?new Date(this._d.getTime()):null},setDate:function(t,e){if(!t)return this._d=null,this._o.field&&(this._o.field.value="",xx(this._o.field,"change",{firedBy:this})),this.draw();if(typeof t=="string"&&(t=new Date(Date.parse(t))),!Rr(t))return;let n=this._o.minDate,r=this._o.maxDate;Rr(n)&&t<n?t=n:Rr(r)&&t>r&&(t=r),this._d=new Date(t.getTime()),wf(this._d),this.gotoDate(this._d),this._o.field&&(this._o.field.value=this.toString(),xx(this._o.field,"change",{firedBy:this})),!e&&typeof this._o.onSelect=="function"&&this._o.onSelect.call(this,this.getDate())},clear:function(){this.setDate(null)},gotoDate:function(t){let e=!0;if(Rr(t)){if(this.calendars){let n=new Date(this.calendars[0].year,this.calendars[0].month,1),r=new Date(this.calendars[this.calendars.length-1].year,this.calendars[this.calendars.length-1].month,1),i=t.getTime();r.setMonth(r.getMonth()+1),r.setDate(r.getDate()-1),e=i<n.getTime()||r.getTime()<i}e&&(this.calendars=[{month:t.getMonth(),year:t.getFullYear()}],this._o.mainCalendar==="right"&&(this.calendars[0].month+=1-this._o.numberOfMonths)),this.adjustCalendars()}},adjustDate:function(t,e){let n=this.getDate()||new Date,r=parseInt(e)*24*60*60*1e3,i;t==="add"?i=new Date(n.valueOf()+r):t==="subtract"&&(i=new Date(n.valueOf()-r)),this.setDate(i)},adjustCalendars:function(){this.calendars[0]=Ax(this.calendars[0]);for(let t=1;t<this._o.numberOfMonths;t++)this.calendars[t]=Ax({month:this.calendars[0].month+t,year:this.calendars[0].year});this.draw()},gotoToday:function(){this.gotoDate(new Date)},gotoMonth:function(t){isNaN(t)||(this.calendars[0].month=parseInt(t,10),this.adjustCalendars())},nextMonth:function(){this.calendars[0].month++,this.adjustCalendars()},prevMonth:function(){this.calendars[0].month--,this.adjustCalendars()},gotoYear:function(t){isNaN(t)||(this.calendars[0].year=parseInt(t,10),this.adjustCalendars())},setMinDate:function(t){t instanceof Date?(wf(t),this._o.minDate=t,this._o.minYear=t.getFullYear(),this._o.minMonth=t.getMonth()):(this._o.minDate=$i.minDate,this._o.minYear=$i.minYear,this._o.minMonth=$i.minMonth,this._o.startRange=$i.startRange),this.draw()},setMaxDate:function(t){t instanceof Date?(wf(t),this._o.maxDate=t,this._o.maxYear=t.getFullYear(),this._o.maxMonth=t.getMonth()):(this._o.maxDate=$i.maxDate,this._o.maxYear=$i.maxYear,this._o.maxMonth=$i.maxMonth,this._o.endRange=$i.endRange),this.draw()},setStartRange:function(t){this._o.startRange=t},setEndRange:function(t){this._o.endRange=t},draw:function(t){if(!this._v&&!t)return;let e=this._o,n=e.minYear,r=e.maxYear,i=e.minMonth,o=e.maxMonth,s="",a;this._y<=n&&(this._y=n,!isNaN(i)&&this._m<i&&(this._m=i)),this._y>=r&&(this._y=r,!isNaN(o)&&this._m>o&&(this._m=o));for(let l=0;l<e.numberOfMonths;l++)a="pika-title-"+Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,2),s+='<div class="pika-lendar">'+$4(this,l,this.calendars[l].year,this.calendars[l].month,this.calendars[0].year,a)+this.render(this.calendars[l].year,this.calendars[l].month,a)+"</div>";this.el.innerHTML=s,e.bound&&e.field.type!=="hidden"&&mS(function(){e.trigger.focus()},1),typeof this._o.onDraw=="function"&&this._o.onDraw(this),e.bound&&e.field.setAttribute("aria-label",e.ariaLabel)},adjustPosition:function(){let t,e,n,r,i,o,s,a,l,u,c;this._o.container||(this.el.style.position="absolute",t=this._o.trigger,e=this.el.offsetWidth,n=this.el.offsetHeight,r=ks().innerWidth||jr().documentElement.clientWidth,i=ks().innerHeight||jr().documentElement.clientHeight,o=jr().body.scrollTop||jr().documentElement.scrollTop,u=!0,c=!0,l=t.getBoundingClientRect(),s=l.left+ks().pageXOffset,a=l.bottom+ks().pageYOffset,(this._o.reposition&&s+e>r||this._o.position.indexOf("right")>-1&&s-e+t.offsetWidth>0)&&(s=s-e+t.offsetWidth,u=!1),(this._o.reposition&&a+n>i+o||this._o.position.indexOf("top")>-1&&a-n-t.offsetHeight>0)&&(a=a-n-t.offsetHeight,c=!1),s<0&&(s=0),a<0&&(a=0),this.el.style.left=s+"px",this.el.style.top=a+"px",cy(this.el,u?"left-aligned":"right-aligned"),cy(this.el,c?"bottom-aligned":"top-aligned"),hy(this.el,u?"right-aligned":"left-aligned"),hy(this.el,c?"top-aligned":"bottom-aligned"))},render:function(t,e,n){let r=this._o,i=new Date,o=Ox(t,e),s=new Date(t,e,1).getDay(),a=[],l=[];wf(i),r.firstDay>0&&(s-=r.firstDay,s<0&&(s+=7));let u=e===0?11:e-1,c=e===11?0:e+1,h=e===0?t-1:t,d=e===11?t+1:t,f=Ox(h,u),g=o+s,C=g;for(;C>7;)C-=7;g+=7-C;let y=!1;for(let E=0,v=0;E<g;E++){let P=new Date(t,e,1+(E-s)),O=Rr(this._d)?vf(P,this._d):!1,L=vf(P,i),T=r.events.indexOf(P.toDateString())!==-1,A=E<s||E>=o+s,q=1+(E-s),U=e,j=t,Z=r.startRange&&vf(r.startRange,P),J=r.endRange&&vf(r.endRange,P),se=r.startRange&&r.endRange&&r.startRange<P&&P<r.endRange,te=r.minDate&&P<r.minDate||r.maxDate&&P>r.maxDate||r.disableWeekends&&O4(P)||r.disableDayFn&&r.disableDayFn(P);A&&(E<s?(q=f+q,U=u,j=h):(q=q-o,U=c,j=d));let ue={day:q,month:U,year:j,hasEvent:T,isSelected:O,isToday:L,isDisabled:te,isEmpty:A,isStartRange:Z,isEndRange:J,isInRange:se,showDaysInNextAndPreviousMonths:r.showDaysInNextAndPreviousMonths,enableSelectionDaysInNextAndPreviousMonths:r.enableSelectionDaysInNextAndPreviousMonths};r.pickWholeWeek&&O&&(y=!0),l.push(A4(ue)),++v===7&&(r.showWeekNumber&&l.unshift(N4(this,E-s,e,t,r.firstWeekOfYearMinDays)),a.push(D4(l,r.isRTL,r.pickWholeWeek,y)),l=[],v=0,y=!1)}return F4(r,a,n)},isVisible:function(){return this._v},show:function(){this.isVisible()||(this._v=!0,this.draw(),hy(this.el,"is-hidden"),this._o.bound&&(Ki(jr(),"click",this._onClick),this.adjustPosition()),typeof this._o.onOpen=="function"&&this._o.onOpen.call(this))},hide:function(){let t=this._v;t!==!1&&(this._o.bound&&To(jr(),"click",this._onClick),this._o.container||(this.el.style.position="static",this.el.style.left="auto",this.el.style.top="auto"),cy(this.el,"is-hidden"),this._v=!1,t!==void 0&&typeof this._o.onClose=="function"&&this._o.onClose.call(this))},destroy:function(){let t=this._o;this.hide(),To(this.el,"mousedown",this._onMouseDown,!0),To(this.el,"touchend",this._onMouseDown,!0),To(this.el,"change",this._onChange),t.keyboardInput&&To(jr(),"keydown",this._onKeyChange),t.field&&(To(t.field,"change",this._onInputChange),t.bound&&(To(t.trigger,"click",this._onInputClick),To(t.trigger,"focus",this._onInputFocus),To(t.trigger,"blur",this._onInputBlur))),this.el.parentNode&&this.el.parentNode.removeChild(this.el)}};function V4(t,e){W4(t,e),e.add(t)}function W4(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Nx(t,e,n){return(e=B4(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function B4(t){var e=j4(t,"string");return typeof e=="symbol"?e:e+""}function j4(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function dy(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const lk="date",Dx="dateEditor",U4="DD/MM/YYYY";var Cf=new WeakSet;class uk extends Sl{constructor(){super(...arguments),V4(this,Cf),Nx(this,"parentDestroyed",!1),Nx(this,"$datePicker",null)}static get EDITOR_TYPE(){return lk}init(){if(typeof X!="function")throw new Error("You need to include moment.js to your project.");if(typeof pS!="function")throw new Error("You need to include Pikaday to your project.");super.init(),this.hot.addHook("afterDestroy",()=>{this.parentDestroyed=!0,this.destroyElements()}),this.hot.addHook("afterSetTheme",(e,n)=>{n||(pe(this.datePicker,/ht-theme-.*/g),G(this.datePicker,e))})}createElements(){super.createElements(),this.datePicker=this.hot.rootDocument.createElement("DIV"),this.datePickerStyle=this.datePicker.style,this.datePickerStyle.position="absolute",this.datePickerStyle.top=0,this.datePickerStyle.left=0,this.datePickerStyle.zIndex=9999,this.datePicker.setAttribute("dir",this.hot.isRtl()?"rtl":"ltr"),G(this.datePicker,"htDatepickerHolder");const e=this.hot.getCurrentThemeName();pe(this.datePicker,/ht-theme-.*/g),G(this.datePicker,e),this.hot.rootDocument.body.appendChild(this.datePicker),this.eventManager.addEventListener(this.datePicker,"mousedown",n=>{ve(n.target,"pika-day")&&this.hideDatepicker(),n.stopPropagation()})}destroyElements(){const e=this.datePicker.parentNode;this.$datePicker&&this.$datePicker.destroy(),e&&e.removeChild(this.datePicker)}prepare(e,n,r,i,o,s){super.prepare(e,n,r,i,o,s)}open(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;const r=this.hot.getShortcutManager().getContext("editor");this.showDatepicker(e),super.open(),r.addShortcuts([{keys:[["ArrowLeft"]],callback:()=>{this.$datePicker.adjustDate("subtract",1)}},{keys:[["ArrowRight"]],callback:()=>{this.$datePicker.adjustDate("add",1)}},{keys:[["ArrowUp"]],callback:()=>{this.$datePicker.adjustDate("subtract",7)}},{keys:[["ArrowDown"]],callback:()=>{this.$datePicker.adjustDate("add",7)}}],{group:Dx})}close(){var e;this._opened=!1,(e=this.$datePicker)!==null&&e!==void 0&&e.destroy&&this.$datePicker.destroy(),this.hot._registerTimeout(()=>{const i=this.hot._getEditorManager();i.closeEditor(),this.hot.view.render(),i.prepareEditor()}),this.hot.getShortcutManager().getContext("editor").removeShortcutsByGroup(Dx),super.close()}finishEditing(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;super.finishEditing(e,n)}showDatepicker(e){const n=dy(Cf,this,fy).call(this),r=this.hot.view.isMouseDown(),i=e?BN(e.keyCode):!1;let o;this.datePicker.style.display="block",this.$datePicker=new pS(this.getDatePickerConfig()),typeof this.$datePicker.useMoment=="function"&&this.$datePicker.useMoment(X),this.$datePicker._onInputFocus=function(){},this.originalValue?(o=this.originalValue,X(o,n,!0).isValid()&&this.$datePicker.setMoment(X(o,n),!0),this.getValue()!==this.originalValue&&this.setValue(this.originalValue),!i&&!r&&this.setValue("")):this.cellProperties.defaultDate?(o=this.cellProperties.defaultDate,X(o,n,!0).isValid()&&this.$datePicker.setMoment(X(o,n),!0),!i&&!r&&this.setValue("")):this.$datePicker.gotoToday()}hideDatepicker(){this.datePickerStyle.display="none",this.$datePicker.hide()}getDatePickerConfig(){var e;const n=this.TEXTAREA,r={};this.cellProperties&&this.cellProperties.datePickerConfig&&op(r,this.cellProperties.datePickerConfig);const i=r.onSelect,o=r.onClose;return r.field=n,r.trigger=n,r.container=this.datePicker,r.bound=!1,r.keyboardInput=!1,r.format=(e=r.format)!==null&&e!==void 0?e:dy(Cf,this,fy).call(this),r.reposition=r.reposition||!1,r.isRTL=!1,r.onSelect=s=>{let a=s;isNaN(a.getTime())||(a=X(a).format(dy(Cf,this,fy).call(this))),this.setValue(a),i&&i(),zo()&&this.hideDatepicker()},r.onClose=()=>{this.parentDestroyed||this.finishEditing(!1),o&&o()},r}refreshDimensions(e){var n;if(super.refreshDimensions(e),this.state!==Bt.EDITING)return;if(this.TD=this.getEditedCell(),!this.TD){this.hideDatepicker();return}const{rowIndexMapper:r,columnIndexMapper:i}=this.hot,{wtOverlays:o}=this.hot.view._wt,{wtTable:s}=(n=o.getParentOverlay(this.TD))!==null&&n!==void 0?n:this.hot.view._wt,a=r.getVisualFromRenderableIndex(s.getFirstPartiallyVisibleRow()),l=r.getVisualFromRenderableIndex(s.getLastPartiallyVisibleRow()),u=i.getVisualFromRenderableIndex(s.getFirstPartiallyVisibleColumn()),c=i.getVisualFromRenderableIndex(s.getLastPartiallyVisibleColumn());if(this.row>=a&&this.row<=l&&this.col>=u&&this.col<=c){const h=this.TD.getBoundingClientRect();this.datePickerStyle.top=`${this.hot.rootWindow.pageYOffset+h.top+nn(this.TD)}px`;let d=this.hot.rootWindow.pageXOffset;this.hot.isRtl()?d+=h.right-qt(this.datePicker):d+=h.left,this.datePickerStyle.left=`${d}px`}else this.hideDatepicker()}}function fy(){var t;return(t=this.cellProperties.dateFormat)!==null&&t!==void 0?t:U4}const z4="dropdown";class ck extends A0{static get EDITOR_TYPE(){return z4}prepare(e,n,r,i,o,s){s.filter=!1,s.strict=!0,super.prepare(e,n,r,i,o,s)}}const Y4="numeric";class hk extends Sl{static get EDITOR_TYPE(){return Y4}}function G4(t,e,n){return(e=q4(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function q4(t){var e=K4(t,"string");return typeof e=="symbol"?e:e+""}function K4(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const X4="password";class dk extends Sl{constructor(){super(...arguments),G4(this,"autoResize",XD(this.hot.rootDocument,{textContent:e=>"•".repeat(e.value.length)}))}static get EDITOR_TYPE(){return X4}createElements(){super.createElements(),this.TEXTAREA=this.hot.rootDocument.createElement("input"),this.TEXTAREA.setAttribute("type","password"),this.TEXTAREA.setAttribute("data-hot-input",""),this.TEXTAREA.className="handsontableInput",this.textareaStyle=this.TEXTAREA.style,this.textareaStyle.width=0,this.textareaStyle.height=0,es(this.TEXTAREA_PARENT),this.TEXTAREA_PARENT.appendChild(this.TEXTAREA)}}const gy="ht_editor_visible",kx="selectEditor",Z4="select";class fk extends Zu{static get EDITOR_TYPE(){return Z4}init(){this.selectWrapper=this.hot.rootDocument.createElement("div"),this.select=this.hot.rootDocument.createElement("select"),this.select.setAttribute("data-hot-input","true"),this.selectWrapper.style.display="none";const e=this.hot.rootDocument.createElement("DIV"),n=this.hot.getSettings().ariaTags;e.className="htAutocompleteArrow",n&&e.setAttribute(...yl()),e.appendChild(this.hot.rootDocument.createTextNode("▼")),G(this.selectWrapper,"htSelectEditor"),this.selectWrapper.appendChild(this.select),this.selectWrapper.insertBefore(e,this.selectWrapper.firstChild),this.hot.rootElement.appendChild(this.selectWrapper),this.registerHooks()}getValue(){return this.select.value}setValue(e){this.select.value=e}open(){this._opened=!0,this.refreshDimensions(),this.selectWrapper.style.display="",this.hot.getShortcutManager().setActiveContextName("editor"),this.registerShortcuts()}close(){this._opened=!1,this.selectWrapper.style.display="none",ve(this.selectWrapper,gy)&&pe(this.selectWrapper,gy),this.unregisterShortcuts(),this.clearHooks()}focus(){this.select.focus()}registerHooks(){this.addHook("afterScrollHorizontally",()=>this.refreshDimensions()),this.addHook("afterScrollVertically",()=>this.refreshDimensions()),this.addHook("afterColumnResize",()=>this.refreshDimensions()),this.addHook("afterRowResize",()=>this.refreshDimensions())}prepare(e,n,r,i,o,s){super.prepare(e,n,r,i,o,s);const a=this.cellProperties.selectOptions;let l;typeof a=="function"?l=this.prepareOptions(a(this.row,this.col,this.prop)):l=this.prepareOptions(a),es(this.select),He(l,(u,c)=>{const h=this.hot.rootDocument.createElement("OPTION");h.value=c,Ku(h,u),this.select.appendChild(h)})}prepareOptions(e){let n={};if(Array.isArray(e))for(let r=0,i=e.length;r<i;r++)n[e[r]]=e[r];else typeof e=="object"&&(n=e);return n}refreshValue(){const e=this.hot.getSourceDataAtCell(this.row,this.prop);this.originalValue=e,this.setValue(e),this.refreshDimensions()}refreshDimensions(){if(this.state!==Bt.EDITING)return;if(this.TD=this.getEditedCell(),!this.TD){this.close();return}const{top:e,start:n,width:r,height:i}=this.getEditedCellRect(),o=this.selectWrapper.style;o.height=`${i}px`,o.width=`${r}px`,o.top=`${e}px`,o[this.hot.isRtl()?"right":"left"]=`${n}px`,o.margin="0px",G(this.selectWrapper,gy)}registerShortcuts(){const n=this.hot.getShortcutManager().getContext("editor"),r={group:kx};this.isInFullEditMode()&&n.addShortcuts([{keys:[["ArrowUp"]],callback:()=>{const i=this.select.selectedIndex-1;i>=0&&(this.select[i].selected=!0)}},{keys:[["ArrowDown"]],callback:()=>{const i=this.select.selectedIndex+1;i<=this.select.length-1&&(this.select[i].selected=!0)}}],r)}unregisterShortcuts(){this.hot.getShortcutManager().getContext("editor").removeShortcutsByGroup(kx)}}const Q4="time";class gk extends Sl{static get EDITOR_TYPE(){return Q4}prepare(e,n,r,i,o,s){super.prepare(e,n,r,i,o,s),this.TEXTAREA.dir="ltr"}}function J4(){yr(Zu),yr(A0),yr(ak),yr(uk),yr(ck),yr(x0),yr(hk),yr(dk),yr(fk),yr(Sl),yr(gk)}const e9="html";function N0(t,e,n,r,i,o,s){Ed.apply(this,[t,e,n,r,i,o,s]),Ku(e,o??"",!1)}N0.RENDERER_TYPE=e9;const t9="autocomplete";function Ju(t,e,n,r,i,o,s){const{rootDocument:a}=t,l=s.allowHtml?N0:ls,u=a.createElement("DIV"),c=t.getSettings().ariaTags;if(u.className="htAutocompleteArrow",c&&u.setAttribute(...yl()),u.appendChild(a.createTextNode("▼")),l.apply(this,[t,e,n,r,i,o,s]),e.firstChild||e.appendChild(a.createTextNode(" ")),e.insertBefore(u,e.firstChild),G(e,"htAutocomplete"),!t.acArrowListener){const h=new _i(t);t.acArrowListener=function(d){ve(d.target,"htAutocompleteArrow")&&t.view._wt.getSetting("onCellDblClick",null,t._createCellCoords(n,r),e)},h.addEventListener(t.rootElement,"mousedown",t.acArrowListener),t.addHookOnce("afterDestroy",()=>{h.destroy()})}}Ju.RENDERER_TYPE=t9;const n9="dropdown";function D0(t,e,n,r,i,o,s){Ju.apply(this,[t,e,n,r,i,o,s])}D0.RENDERER_TYPE=n9;const Lx=new WeakMap,$x=new WeakMap,r9="htBadValue",Lu="data-row",$u="data-col",i9="checkboxRenderer",mk="checkbox";re.getSingleton().add("modifyAutoColumnSizeSeed",function(t,e,n){const{label:r,type:i,row:o,column:s,prop:a}=e;if(i===mk){if(r){const{value:l,property:u}=r;let c=n;if(l)c=typeof l=="function"?l(o,s,a,n):l;else if(u){const h=this.getDataAtRowProp(o,u);c=h!==null?h:n}t=c}return t}});function k0(t,e,n,r,i,o,s){const{rootDocument:a}=t,l=t.getSettings().ariaTags;Ed.apply(this,[t,e,n,r,i,o,s]),o9(t);let u=s9(a);const c=s.label;let h=!1;if(typeof s.checkedTemplate>"u"&&(s.checkedTemplate=!0),typeof s.uncheckedTemplate>"u"&&(s.uncheckedTemplate=!1),es(e),o===s.checkedTemplate||Pt(o).toLocaleLowerCase(s.locale)===Pt(s.checkedTemplate).toLocaleLowerCase(s.locale)?u.checked=!0:o===s.uncheckedTemplate||Pt(o).toLocaleLowerCase(s.locale)===Pt(s.uncheckedTemplate).toLocaleLowerCase(s.locale)?u.checked=!1:Ut(o)?G(u,"noValue"):(u.style.display="none",G(u,r9),h=!0),ye(u,[[Lu,n],[$u,r]]),l&&ye(u,[Bh(u.checked?t.getTranslatedPhrase(_0):t.getTranslatedPhrase(M0)),RN(u.checked),HU()]),!h&&c){let C="";if(c.value)C=typeof c.value=="function"?c.value.call(this,n,r,i,o):c.value;else if(c.property){const E=t.getDataAtRowProp(n,c.property);C=E!==null?E:""}const y=a9(a,C,c.separated!==!0);c.position==="before"?c.separated?(e.appendChild(y),e.appendChild(u)):(y.appendChild(u),u=y):(!c.position||c.position==="after")&&(c.separated?(e.appendChild(u),e.appendChild(y)):(y.insertBefore(u,y.firstChild),u=y))}(!c||c&&!c.separated)&&e.appendChild(u),h&&e.appendChild(a.createTextNode("#bad-value#")),Lx.has(t)||(Lx.set(t,!0),d());function d(){const y=t.getShortcutManager().getContext("grid"),E={group:i9,relativeToGroup:Qs,position:"before"};y.addShortcuts([{keys:[["space"]],callback:()=>(f(),!g()),runOnlyIf:()=>{var v;return(v=t.getSelectedRangeLast())===null||v===void 0?void 0:v.highlight.isCell()}},{keys:[["enter"]],callback:()=>(f(),!g()),runOnlyIf:()=>{const v=t.getSelectedRangeLast();return t.getSettings().enterBeginsEditing&&(v==null?void 0:v.highlight.isCell())&&!t.selection.isMultiple()}},{keys:[["delete"],["backspace"]],callback:()=>(f(!0),!g()),runOnlyIf:()=>{var v;return(v=t.getSelectedRangeLast())===null||v===void 0?void 0:v.highlight.isCell()}}],E)}function f(){let C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const y=t.getSelectedRange(),E=[],v=new Map;let P=[],O=0;if(y){for(let L=0;L<y.length;L++){const{row:T,col:A}=y[L].getTopStartCorner(),{row:q,col:U}=y[L].getBottomEndCorner();for(let j=T;j<=q;j+=1)for(let Z=A;Z<=U;Z+=1){const J=t.getCellMeta(j,Z);if(J.hidden)continue;const se={checkedTemplate:J.checkedTemplate,uncheckedTemplate:J.uncheckedTemplate};if(J.type!=="checkbox"){C===!0&&!J.readOnly&&(v.has(E.length)?v.set(E.length,[...v.get(E.length),[j,Z,null]]):v.set(E.length,[[j,Z,null]]));continue}if(J.readOnly===!0)continue;typeof J.checkedTemplate>"u"&&(J.checkedTemplate=!0),typeof J.uncheckedTemplate>"u"&&(J.uncheckedTemplate=!1);const te=t.getDataAtCell(j,Z);C===!1?[J.checkedTemplate,J.checkedTemplate.toString()].includes(te)?P.push([j,Z,J.uncheckedTemplate,se]):[J.uncheckedTemplate,J.uncheckedTemplate.toString(),null,void 0].includes(te)&&P.push([j,Z,J.checkedTemplate,se]):P.push([j,Z,J.uncheckedTemplate,se]),O+=1}E.push(O),O=0}P.every(L=>{let[,,T]=L;return T===P[0][2]})?P=P.map(L=>{let[T,A,q]=L;return[T,A,q]}):P=P.map(L=>{let[T,A,,q]=L;return[T,A,q.checkedTemplate]}),P.length>0&&E.forEach((L,T)=>{let A=P.splice(0,L);v.size&&v.has(T)&&(A=[...A,...v.get(T)]),t.setDataAtCell(A)})}}function g(){const C=t.getSelectedRange();if(C){for(let y=0;y<C.length;y++){const E=C[y].getTopStartCorner(),v=C[y].getBottomEndCorner();for(let P=E.row;P<=v.row;P++)for(let O=E.col;O<=v.col;O++){if(t.getCellMeta(P,O).readOnly)continue;const T=t.getCell(P,O);if(Qo(T)&&T.querySelectorAll("input[type=checkbox]").length>0)return!0}}return!1}}}k0.RENDERER_TYPE=mk;function o9(t){let e=$x.get(t);if(!e){const{rootElement:n}=t;e=new _i(t),e.addEventListener(n,"click",r=>u9(r,t)),e.addEventListener(n,"mouseup",r=>l9(r,t)),e.addEventListener(n,"change",r=>c9(r,t)),$x.set(t,e)}return e}function s9(t){const e=t.createElement("input");return e.className="htCheckboxRendererInput",e.type="checkbox",e.setAttribute("tabindex","-1"),e.cloneNode(!1)}function a9(t,e,n){const r=t.createElement("label");r.className=`htCheckboxRendererLabel ${n?"fullWidth":""}`;const i=t.createTextNode(e);if(n){const o=t.createElement("span");o.appendChild(i),r.appendChild(o)}else r.appendChild(i);return r.cloneNode(!0)}function l9(t,e){const{target:n}=t;L0(n)&&(!n.hasAttribute(Lu)||!n.hasAttribute($u)||setTimeout(e.listen,10))}function u9(t,e){const{target:n}=t;if(!L0(n)||!n.hasAttribute(Lu)||!n.hasAttribute($u))return;const r=parseInt(n.getAttribute(Lu),10),i=parseInt(n.getAttribute($u),10);e.getCellMeta(r,i).readOnly&&t.preventDefault()}function c9(t,e){const{target:n}=t;if(!L0(n)||!n.hasAttribute(Lu)||!n.hasAttribute($u))return;const r=parseInt(n.getAttribute(Lu),10),i=parseInt(n.getAttribute($u),10),o=e.getCellMeta(r,i);if(!o.readOnly){let s=null;t.target.checked?s=o.uncheckedTemplate===void 0?!0:o.checkedTemplate:s=o.uncheckedTemplate===void 0?!1:o.uncheckedTemplate,e.setDataAtCell(r,i,s)}}function L0(t){return t.tagName==="INPUT"&&t.getAttribute("type")==="checkbox"}const h9="handsontable";function $0(t,e,n,r,i,o,s){Ju.apply(this,[t,e,n,r,i,o,s])}$0.RENDERER_TYPE=h9;var d9=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function f9(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}/*!
|
|
68
|
+
* Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
|
|
69
|
+
*
|
|
70
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
71
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
72
|
+
* in the Software without restriction, including without limitation the rights
|
|
73
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
74
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
75
|
+
* furnished to do so, subject to the following conditions:
|
|
76
|
+
*
|
|
77
|
+
* The above copyright notice and this permission notice shall be included in
|
|
78
|
+
* all copies or substantial portions of the Software.
|
|
79
|
+
*
|
|
80
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
81
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
82
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
83
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
84
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
85
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
86
|
+
* SOFTWARE.
|
|
87
|
+
*/var my,Fx;function g9(){return Fx||(Fx=1,my={languageTag:"en-US",delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},spaceSeparated:!1,ordinal:function(t){let e=t%10;return~~(t%100/10)===1?"th":e===1?"st":e===2?"nd":e===3?"rd":"th"},bytes:{binarySuffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],decimalSuffixes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]},currency:{symbol:"$",position:"prefix",code:"USD"},currencyFormat:{thousandSeparated:!0,totalLength:4,spaceSeparated:!0,spaceSeparatedCurrency:!0},formats:{fourDigits:{totalLength:4,spaceSeparated:!0},fullWithTwoDecimals:{output:"currency",thousandSeparated:!0,mantissa:2},fullWithTwoDecimalsNoCurrency:{thousandSeparated:!0,mantissa:2},fullWithNoDecimals:{output:"currency",thousandSeparated:!0,mantissa:0}}}),my}/*!
|
|
88
|
+
* Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
|
|
89
|
+
*
|
|
90
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
91
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
92
|
+
* in the Software without restriction, including without limitation the rights
|
|
93
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
94
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
95
|
+
* furnished to do so, subject to the following conditions:
|
|
96
|
+
*
|
|
97
|
+
* The above copyright notice and this permission notice shall be included in
|
|
98
|
+
* all copies or substantial portions of the Software.
|
|
99
|
+
*
|
|
100
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
101
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
102
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
103
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
104
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
105
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
106
|
+
* SOFTWARE.
|
|
107
|
+
*/var py,Vx;function pk(){if(Vx)return py;Vx=1;const t=[{key:"ZiB",factor:Math.pow(1024,7)},{key:"ZB",factor:Math.pow(1e3,7)},{key:"YiB",factor:Math.pow(1024,8)},{key:"YB",factor:Math.pow(1e3,8)},{key:"TiB",factor:Math.pow(1024,4)},{key:"TB",factor:Math.pow(1e3,4)},{key:"PiB",factor:Math.pow(1024,5)},{key:"PB",factor:Math.pow(1e3,5)},{key:"MiB",factor:Math.pow(1024,2)},{key:"MB",factor:Math.pow(1e3,2)},{key:"KiB",factor:Math.pow(1024,1)},{key:"KB",factor:Math.pow(1e3,1)},{key:"GiB",factor:Math.pow(1024,3)},{key:"GB",factor:Math.pow(1e3,3)},{key:"EiB",factor:Math.pow(1024,6)},{key:"EB",factor:Math.pow(1e3,6)},{key:"B",factor:1}];function e(l){return l.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function n(l,u,c,h,d,f,g){if(!isNaN(+l))return+l;let C="",y=l.replace(/(^[^(]*)\((.*)\)([^)]*$)/,"$1$2$3");if(y!==l)return-1*n(y,u,c,h,d,f);for(let T=0;T<t.length;T++){let A=t[T];if(C=l.replace(RegExp(`([0-9 ])(${A.key})$`),"$1"),C!==l)return n(C,u,c,h,d,f)*A.factor}if(C=l.replace("%",""),C!==l)return n(C,u,c,h,d,f)/100;let E=parseFloat(l);if(isNaN(E))return;let v=h(E);if(v&&v!=="."&&(C=l.replace(new RegExp(`${e(v)}$`),""),C!==l))return n(C,u,c,h,d,f);let P={};Object.keys(f).forEach(T=>{P[f[T]]=T});let O=Object.keys(P).sort().reverse(),L=O.length;for(let T=0;T<L;T++){let A=O[T],q=P[A];if(C=l.replace(A,""),C!==l){let U;switch(q){case"thousand":U=Math.pow(10,3);break;case"million":U=Math.pow(10,6);break;case"billion":U=Math.pow(10,9);break;case"trillion":U=Math.pow(10,12);break}return n(C,u,c,h,d,f)*U}}}function r(l,u,c){let h=l.replace(c,"");return h=h.replace(new RegExp(`([0-9])${e(u.thousands)}([0-9])`,"g"),"$1$2"),h=h.replace(u.decimal,"."),h}function i(l,u,c="",h,d,f,g){if(l==="")return;if(l===d)return 0;let C=r(l,u,c);return n(C,u,c,h,d,f)}function o(l,u){if(!(l.indexOf(":")&&u.thousands!==":"))return!1;let h=l.split(":");if(h.length!==3)return!1;let d=+h[0],f=+h[1],g=+h[2];return!isNaN(d)&&!isNaN(f)&&!isNaN(g)}function s(l){let u=l.split(":"),c=+u[0],h=+u[1];return+u[2]+60*h+3600*c}function a(l,u){const c=W0();let h=c.currentDelimiters(),d=c.currentCurrency().symbol,f=c.currentOrdinal(),g=c.getZeroFormat(),C=c.currentAbbreviations(),y;if(typeof l=="string")o(l,h)?y=s(l):y=i(l,h,d,f,g,C);else if(typeof l=="number")y=l;else return;if(y!==void 0)return y}return py={unformat:a},py}/*!
|
|
108
|
+
* Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
|
|
109
|
+
*
|
|
110
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
111
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
112
|
+
* in the Software without restriction, including without limitation the rights
|
|
113
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
114
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
115
|
+
* furnished to do so, subject to the following conditions:
|
|
116
|
+
*
|
|
117
|
+
* The above copyright notice and this permission notice shall be included in
|
|
118
|
+
* all copies or substantial portions of the Software.
|
|
119
|
+
*
|
|
120
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
121
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
122
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
123
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
124
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
125
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
126
|
+
* SOFTWARE.
|
|
127
|
+
*/var wy,Wx;function F0(){if(Wx)return wy;Wx=1;let t=pk();const e=/^[a-z]{2,3}(-[a-zA-Z]{4})?(-([A-Z]{2}|[0-9]{3}))?$/,n=["currency","percent","byte","time","ordinal","number"],r=["trillion","billion","million","thousand"],i=["prefix","infix","postfix"],o=["sign","parenthesis"],s={type:"object",children:{thousand:{type:"string",mandatory:!0},million:{type:"string",mandatory:!0},billion:{type:"string",mandatory:!0},trillion:{type:"string",mandatory:!0}},mandatory:!0},u={output:{type:"string",validValues:n},base:{type:"string",validValues:["decimal","binary","general"],restriction:(y,E)=>E.output==="byte",message:"`base` must be provided only when the output is `byte`",mandatory:y=>y.output==="byte"},characteristic:{type:"number",restriction:y=>y>=0,message:"value must be positive"},prefix:"string",postfix:"string",forceAverage:{type:"string",validValues:r},average:"boolean",lowPrecision:{type:"boolean",restriction:(y,E)=>E.average===!0,message:"`lowPrecision` must be provided only when the option `average` is set"},currencyPosition:{type:"string",validValues:i},currencySymbol:"string",totalLength:{type:"number",restrictions:[{restriction:y=>y>=0,message:"value must be positive"},{restriction:(y,E)=>!E.exponential,message:"`totalLength` is incompatible with `exponential`"}]},mantissa:{type:"number",restriction:y=>y>=0,message:"value must be positive"},optionalMantissa:"boolean",trimMantissa:"boolean",roundingFunction:"function",optionalCharacteristic:"boolean",thousandSeparated:"boolean",spaceSeparated:"boolean",spaceSeparatedCurrency:"boolean",spaceSeparatedAbbreviation:"boolean",abbreviations:{type:"object",children:{thousand:"string",million:"string",billion:"string",trillion:"string"}},negative:{type:"string",validValues:o},forceSign:"boolean",exponential:{type:"boolean"},prefixSymbol:{type:"boolean",restriction:(y,E)=>E.output==="percent",message:"`prefixSymbol` can be provided only when the output is `percent`"}},c={languageTag:{type:"string",mandatory:!0,restriction:y=>y.match(e),message:"the language tag must follow the BCP 47 specification (see https://tools.ieft.org/html/bcp47)"},delimiters:{type:"object",children:{thousands:"string",decimal:"string",thousandsSize:"number"},mandatory:!0},abbreviations:s,spaceSeparated:"boolean",spaceSeparatedCurrency:"boolean",ordinal:{type:"function",mandatory:!0},bytes:{type:"object",children:{binarySuffixes:"object",decimalSuffixes:"object"}},currency:{type:"object",children:{symbol:"string",position:"string",code:"string"},mandatory:!0},defaults:"format",ordinalFormat:"format",byteFormat:"format",percentageFormat:"format",currencyFormat:"format",timeDefaults:"format",formats:{type:"object",children:{fourDigits:{type:"format",mandatory:!0},fullWithTwoDecimals:{type:"format",mandatory:!0},fullWithTwoDecimalsNoCurrency:{type:"format",mandatory:!0},fullWithNoDecimals:{type:"format",mandatory:!0}}}};function h(y,E){let v=d(y),P=g(E);return v&&P}function d(y){return t.unformat(y)!==void 0}function f(y,E,v,P=!1){let O=Object.keys(y).map(L=>{if(!E[L])return console.error(`${v} Invalid key: ${L}`),!1;let T=y[L],A=E[L];if(typeof A=="string"&&(A={type:A}),A.type==="format"){if(!f(T,u,`[Validate ${L}]`,!0))return!1}else if(typeof T!==A.type)return console.error(`${v} ${L} type mismatched: "${A.type}" expected, "${typeof T}" provided`),!1;if(A.restrictions&&A.restrictions.length){let q=A.restrictions.length;for(let U=0;U<q;U++){let{restriction:j,message:Z}=A.restrictions[U];if(!j(T,y))return console.error(`${v} ${L} invalid value: ${Z}`),!1}}return A.restriction&&!A.restriction(T,y)?(console.error(`${v} ${L} invalid value: ${A.message}`),!1):A.validValues&&A.validValues.indexOf(T)===-1?(console.error(`${v} ${L} invalid value: must be among ${JSON.stringify(A.validValues)}, "${T}" provided`),!1):!(A.children&&!f(T,A.children,`[Validate ${L}]`))});return P||O.push(...Object.keys(E).map(L=>{let T=E[L];if(typeof T=="string"&&(T={type:T}),T.mandatory){let A=T.mandatory;if(typeof A=="function"&&(A=A(y)),A&&y[L]===void 0)return console.error(`${v} Missing mandatory key "${L}"`),!1}return!0})),O.reduce((L,T)=>L&&T,!0)}function g(y){return f(y,u,"[Validate format]")}function C(y){return f(y,c,"[Validate language]")}return wy={validate:h,validateFormat:g,validateInput:d,validateLanguage:C},wy}/*!
|
|
128
|
+
* Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
|
|
129
|
+
*
|
|
130
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
131
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
132
|
+
* in the Software without restriction, including without limitation the rights
|
|
133
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
134
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
135
|
+
* furnished to do so, subject to the following conditions:
|
|
136
|
+
*
|
|
137
|
+
* The above copyright notice and this permission notice shall be included in
|
|
138
|
+
* all copies or substantial portions of the Software.
|
|
139
|
+
*
|
|
140
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
141
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
142
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
143
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
144
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
145
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
146
|
+
* SOFTWARE.
|
|
147
|
+
*/function m9(t,e){let n=t.match(/^{([^}]*)}/);return n?(e.prefix=n[1],t.slice(n[0].length)):t}function p9(t,e){let n=t.match(/{([^}]*)}$/);return n?(e.postfix=n[1],t.slice(0,-n[0].length)):t}function w9(t,e){if(t.indexOf("$")!==-1){e.output="currency";return}if(t.indexOf("%")!==-1){e.output="percent";return}if(t.indexOf("bd")!==-1){e.output="byte",e.base="general";return}if(t.indexOf("b")!==-1){e.output="byte",e.base="binary";return}if(t.indexOf("d")!==-1){e.output="byte",e.base="decimal";return}if(t.indexOf(":")!==-1){e.output="time";return}t.indexOf("o")!==-1&&(e.output="ordinal")}function v9(t,e){t.indexOf(",")!==-1&&(e.thousandSeparated=!0)}function C9(t,e){t.indexOf(" ")!==-1&&(e.spaceSeparated=!0,e.spaceSeparatedCurrency=!0,(e.average||e.forceAverage)&&(e.spaceSeparatedAbbreviation=!0))}function y9(t,e){let n=t.match(/[1-9]+[0-9]*/);n&&(e.totalLength=+n[0])}function b9(t,e){let r=t.split(".")[0].match(/0+/);r&&(e.characteristic=r[0].length)}function S9(t,e){let n=t.split(".")[1];if(n){let r=n.match(/0+/);r&&(e.mantissa=r[0].length)}}function R9(t,e){const n=t.split(".")[1];n&&(e.trimMantissa=n.indexOf("[")!==-1)}function E9(t,e){t.indexOf("a")!==-1&&(e.average=!0)}function T9(t,e){t.indexOf("K")!==-1?e.forceAverage="thousand":t.indexOf("M")!==-1?e.forceAverage="million":t.indexOf("B")!==-1?e.forceAverage="billion":t.indexOf("T")!==-1&&(e.forceAverage="trillion")}function _9(t,e){t.match(/\[\.]/)?e.optionalMantissa=!0:t.match(/\./)&&(e.optionalMantissa=!1)}function M9(t,e){if(t.indexOf(".")!==-1){let n=t.split(".")[0];e.optionalCharacteristic=n.indexOf("0")===-1}}function I9(t,e){t.match(/^\+?\([^)]*\)$/)&&(e.negative="parenthesis"),t.match(/^\+?-/)&&(e.negative="sign")}function P9(t,e){t.match(/^\+/)&&(e.forceSign=!0)}function O9(t,e={}){return typeof t!="string"?t:(t=m9(t,e),t=p9(t,e),w9(t,e),y9(t,e),b9(t,e),M9(t,e),E9(t,e),T9(t,e),S9(t,e),_9(t,e),R9(t,e),v9(t,e),C9(t,e),I9(t,e),P9(t,e),e)}var V0={parseFormat:O9};/*!
|
|
148
|
+
* Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
|
|
149
|
+
*
|
|
150
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
151
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
152
|
+
* in the Software without restriction, including without limitation the rights
|
|
153
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
154
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
155
|
+
* furnished to do so, subject to the following conditions:
|
|
156
|
+
*
|
|
157
|
+
* The above copyright notice and this permission notice shall be included in
|
|
158
|
+
* all copies or substantial portions of the Software.
|
|
159
|
+
*
|
|
160
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
161
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
162
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
163
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
164
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
165
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
166
|
+
* SOFTWARE.
|
|
167
|
+
*/var vy,Bx;function W0(){if(Bx)return vy;Bx=1;const t=g9(),e=F0(),n=V0;let r={},i,o={},s=null,a={};function l(c){i=c}function u(){return o[i]}return r.languages=()=>Object.assign({},o),r.currentLanguage=()=>i,r.currentBytes=()=>u().bytes||{},r.currentCurrency=()=>u().currency,r.currentAbbreviations=()=>u().abbreviations,r.currentDelimiters=()=>u().delimiters,r.currentOrdinal=()=>u().ordinal,r.currentDefaults=()=>Object.assign({},u().defaults,a),r.currentOrdinalDefaultFormat=()=>Object.assign({},r.currentDefaults(),u().ordinalFormat),r.currentByteDefaultFormat=()=>Object.assign({},r.currentDefaults(),u().byteFormat),r.currentPercentageDefaultFormat=()=>Object.assign({},r.currentDefaults(),u().percentageFormat),r.currentCurrencyDefaultFormat=()=>Object.assign({},r.currentDefaults(),u().currencyFormat),r.currentTimeDefaultFormat=()=>Object.assign({},r.currentDefaults(),u().timeFormat),r.setDefaults=c=>{c=n.parseFormat(c),e.validateFormat(c)&&(a=c)},r.getZeroFormat=()=>s,r.setZeroFormat=c=>s=typeof c=="string"?c:null,r.hasZeroFormat=()=>s!==null,r.languageData=c=>{if(c){if(o[c])return o[c];throw new Error(`Unknown tag "${c}"`)}return u()},r.registerLanguage=(c,h=!1)=>{if(!e.validateLanguage(c))throw new Error("Invalid language data");o[c.languageTag]=c,h&&l(c.languageTag)},r.setLanguage=(c,h=t.languageTag)=>{if(!o[c]){let d=c.split("-")[0],f=Object.keys(o).find(g=>g.split("-")[0]===d);if(!o[f]){l(h);return}l(f);return}l(c)},r.registerLanguage(t),i=t.languageTag,vy=r,vy}function x9(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}/*!
|
|
168
|
+
* Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
|
|
169
|
+
*
|
|
170
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
171
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
172
|
+
* in the Software without restriction, including without limitation the rights
|
|
173
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
174
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
175
|
+
* furnished to do so, subject to the following conditions:
|
|
176
|
+
*
|
|
177
|
+
* The above copyright notice and this permission notice shall be included in
|
|
178
|
+
* all copies or substantial portions of the Software.
|
|
179
|
+
*
|
|
180
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
181
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
182
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
183
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
184
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
185
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
186
|
+
* SOFTWARE.
|
|
187
|
+
*/function A9(t,e){t.forEach(n=>{let r;try{r=x9(`../languages/${n}`)}catch{console.error(`Unable to load "${n}". No matching language file found.`)}r&&e.registerLanguage(r)})}var H9=t=>({loadLanguagesInNode:e=>A9(e,t)}),wk={exports:{}};(function(t){(function(e){var n,r=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,i=Math.ceil,o=Math.floor,s="[BigNumber Error] ",a=s+"Number primitive has more than 15 significant digits: ",l=1e14,u=14,c=9007199254740991,h=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],d=1e7,f=1e9;function g(T){var A,q,U,j=p.prototype={constructor:p,toString:null,valueOf:null},Z=new p(1),J=20,se=4,te=-7,ue=21,pt=-1e7,be=1e7,ke=!1,wt=1,fn=0,et={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},m="0123456789abcdefghijklmnopqrstuvwxyz",w=!0;function p(b,R){var S,k,_,H,W,x,N,V,F=this;if(!(F instanceof p))return new p(b,R);if(R==null){if(b&&b._isBigNumber===!0){F.s=b.s,!b.c||b.e>be?F.c=F.e=null:b.e<pt?F.c=[F.e=0]:(F.e=b.e,F.c=b.c.slice());return}if((x=typeof b=="number")&&b*0==0){if(F.s=1/b<0?(b=-b,-1):1,b===~~b){for(H=0,W=b;W>=10;W/=10,H++);H>be?F.c=F.e=null:(F.e=H,F.c=[b]);return}V=String(b)}else{if(!r.test(V=String(b)))return U(F,V,x);F.s=V.charCodeAt(0)==45?(V=V.slice(1),-1):1}(H=V.indexOf("."))>-1&&(V=V.replace(".","")),(W=V.search(/e/i))>0?(H<0&&(H=W),H+=+V.slice(W+1),V=V.substring(0,W)):H<0&&(H=V.length)}else{if(v(R,2,m.length,"Base"),R==10&&w)return F=new p(b),Y(F,J+F.e+1,se);if(V=String(b),x=typeof b=="number"){if(b*0!=0)return U(F,V,x,R);if(F.s=1/b<0?(V=V.slice(1),-1):1,p.DEBUG&&V.replace(/^0\.0*|\./,"").length>15)throw Error(a+b)}else F.s=V.charCodeAt(0)===45?(V=V.slice(1),-1):1;for(S=m.slice(0,R),H=W=0,N=V.length;W<N;W++)if(S.indexOf(k=V.charAt(W))<0){if(k=="."){if(W>H){H=N;continue}}else if(!_&&(V==V.toUpperCase()&&(V=V.toLowerCase())||V==V.toLowerCase()&&(V=V.toUpperCase()))){_=!0,W=-1,H=0;continue}return U(F,String(b),x,R)}x=!1,V=q(V,R,10,F.s),(H=V.indexOf("."))>-1?V=V.replace(".",""):H=V.length}for(W=0;V.charCodeAt(W)===48;W++);for(N=V.length;V.charCodeAt(--N)===48;);if(V=V.slice(W,++N)){if(N-=W,x&&p.DEBUG&&N>15&&(b>c||b!==o(b)))throw Error(a+F.s*b);if((H=H-W-1)>be)F.c=F.e=null;else if(H<pt)F.c=[F.e=0];else{if(F.e=H,F.c=[],W=(H+1)%u,H<0&&(W+=u),W<N){for(W&&F.c.push(+V.slice(0,W)),N-=u;W<N;)F.c.push(+V.slice(W,W+=u));W=u-(V=V.slice(W)).length}else W-=N;for(;W--;V+="0");F.c.push(+V)}}else F.c=[F.e=0]}p.clone=g,p.ROUND_UP=0,p.ROUND_DOWN=1,p.ROUND_CEIL=2,p.ROUND_FLOOR=3,p.ROUND_HALF_UP=4,p.ROUND_HALF_DOWN=5,p.ROUND_HALF_EVEN=6,p.ROUND_HALF_CEIL=7,p.ROUND_HALF_FLOOR=8,p.EUCLID=9,p.config=p.set=function(b){var R,S;if(b!=null)if(typeof b=="object"){if(b.hasOwnProperty(R="DECIMAL_PLACES")&&(S=b[R],v(S,0,f,R),J=S),b.hasOwnProperty(R="ROUNDING_MODE")&&(S=b[R],v(S,0,8,R),se=S),b.hasOwnProperty(R="EXPONENTIAL_AT")&&(S=b[R],S&&S.pop?(v(S[0],-1e9,0,R),v(S[1],0,f,R),te=S[0],ue=S[1]):(v(S,-1e9,f,R),te=-(ue=S<0?-S:S))),b.hasOwnProperty(R="RANGE"))if(S=b[R],S&&S.pop)v(S[0],-1e9,-1,R),v(S[1],1,f,R),pt=S[0],be=S[1];else if(v(S,-1e9,f,R),S)pt=-(be=S<0?-S:S);else throw Error(s+R+" cannot be zero: "+S);if(b.hasOwnProperty(R="CRYPTO"))if(S=b[R],S===!!S)if(S)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))ke=S;else throw ke=!S,Error(s+"crypto unavailable");else ke=S;else throw Error(s+R+" not true or false: "+S);if(b.hasOwnProperty(R="MODULO_MODE")&&(S=b[R],v(S,0,9,R),wt=S),b.hasOwnProperty(R="POW_PRECISION")&&(S=b[R],v(S,0,f,R),fn=S),b.hasOwnProperty(R="FORMAT"))if(S=b[R],typeof S=="object")et=S;else throw Error(s+R+" not an object: "+S);if(b.hasOwnProperty(R="ALPHABET"))if(S=b[R],typeof S=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(S))w=S.slice(0,10)=="0123456789",m=S;else throw Error(s+R+" invalid: "+S)}else throw Error(s+"Object expected: "+b);return{DECIMAL_PLACES:J,ROUNDING_MODE:se,EXPONENTIAL_AT:[te,ue],RANGE:[pt,be],CRYPTO:ke,MODULO_MODE:wt,POW_PRECISION:fn,FORMAT:et,ALPHABET:m}},p.isBigNumber=function(b){if(!b||b._isBigNumber!==!0)return!1;if(!p.DEBUG)return!0;var R,S,k=b.c,_=b.e,H=b.s;e:if({}.toString.call(k)=="[object Array]"){if((H===1||H===-1)&&_>=-1e9&&_<=f&&_===o(_)){if(k[0]===0){if(_===0&&k.length===1)return!0;break e}if(R=(_+1)%u,R<1&&(R+=u),String(k[0]).length==R){for(R=0;R<k.length;R++)if(S=k[R],S<0||S>=l||S!==o(S))break e;if(S!==0)return!0}}}else if(k===null&&_===null&&(H===null||H===1||H===-1))return!0;throw Error(s+"Invalid BigNumber: "+b)},p.maximum=p.max=function(){return $(arguments,-1)},p.minimum=p.min=function(){return $(arguments,1)},p.random=function(){var b=9007199254740992,R=Math.random()*b&2097151?function(){return o(Math.random()*b)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(S){var k,_,H,W,x,N=0,V=[],F=new p(Z);if(S==null?S=J:v(S,0,f),W=i(S/u),ke)if(crypto.getRandomValues){for(k=crypto.getRandomValues(new Uint32Array(W*=2));N<W;)x=k[N]*131072+(k[N+1]>>>11),x>=9e15?(_=crypto.getRandomValues(new Uint32Array(2)),k[N]=_[0],k[N+1]=_[1]):(V.push(x%1e14),N+=2);N=W/2}else if(crypto.randomBytes){for(k=crypto.randomBytes(W*=7);N<W;)x=(k[N]&31)*281474976710656+k[N+1]*1099511627776+k[N+2]*4294967296+k[N+3]*16777216+(k[N+4]<<16)+(k[N+5]<<8)+k[N+6],x>=9e15?crypto.randomBytes(7).copy(k,N):(V.push(x%1e14),N+=7);N=W/7}else throw ke=!1,Error(s+"crypto unavailable");if(!ke)for(;N<W;)x=R(),x<9e15&&(V[N++]=x%1e14);for(W=V[--N],S%=u,W&&S&&(x=h[u-S],V[N]=o(W/x)*x);V[N]===0;V.pop(),N--);if(N<0)V=[H=0];else{for(H=-1;V[0]===0;V.splice(0,1),H-=u);for(N=1,x=V[0];x>=10;x/=10,N++);N<u&&(H-=u-N)}return F.e=H,F.c=V,F}}(),p.sum=function(){for(var b=1,R=arguments,S=new p(R[0]);b<R.length;)S=S.plus(R[b++]);return S},q=function(){var b="0123456789";function R(S,k,_,H){for(var W,x=[0],N,V=0,F=S.length;V<F;){for(N=x.length;N--;x[N]*=k);for(x[0]+=H.indexOf(S.charAt(V++)),W=0;W<x.length;W++)x[W]>_-1&&(x[W+1]==null&&(x[W+1]=0),x[W+1]+=x[W]/_|0,x[W]%=_)}return x.reverse()}return function(S,k,_,H,W){var x,N,V,F,z,oe,ce,Re,Ne=S.indexOf("."),We=J,Se=se;for(Ne>=0&&(F=fn,fn=0,S=S.replace(".",""),Re=new p(k),oe=Re.pow(S.length-Ne),fn=F,Re.c=R(L(y(oe.c),oe.e,"0"),10,_,b),Re.e=Re.c.length),ce=R(S,k,_,W?(x=m,b):(x=b,m)),V=F=ce.length;ce[--F]==0;ce.pop());if(!ce[0])return x.charAt(0);if(Ne<0?--V:(oe.c=ce,oe.e=V,oe.s=H,oe=A(oe,Re,We,Se,_),ce=oe.c,z=oe.r,V=oe.e),N=V+We+1,Ne=ce[N],F=_/2,z=z||N<0||ce[N+1]!=null,z=Se<4?(Ne!=null||z)&&(Se==0||Se==(oe.s<0?3:2)):Ne>F||Ne==F&&(Se==4||z||Se==6&&ce[N-1]&1||Se==(oe.s<0?8:7)),N<1||!ce[0])S=z?L(x.charAt(1),-We,x.charAt(0)):x.charAt(0);else{if(ce.length=N,z)for(--_;++ce[--N]>_;)ce[N]=0,N||(++V,ce=[1].concat(ce));for(F=ce.length;!ce[--F];);for(Ne=0,S="";Ne<=F;S+=x.charAt(ce[Ne++]));S=L(S,V,x.charAt(0))}return S}}(),A=function(){function b(k,_,H){var W,x,N,V,F=0,z=k.length,oe=_%d,ce=_/d|0;for(k=k.slice();z--;)N=k[z]%d,V=k[z]/d|0,W=ce*N+V*oe,x=oe*N+W%d*d+F,F=(x/H|0)+(W/d|0)+ce*V,k[z]=x%H;return F&&(k=[F].concat(k)),k}function R(k,_,H,W){var x,N;if(H!=W)N=H>W?1:-1;else for(x=N=0;x<H;x++)if(k[x]!=_[x]){N=k[x]>_[x]?1:-1;break}return N}function S(k,_,H,W){for(var x=0;H--;)k[H]-=x,x=k[H]<_[H]?1:0,k[H]=x*W+k[H]-_[H];for(;!k[0]&&k.length>1;k.splice(0,1));}return function(k,_,H,W,x){var N,V,F,z,oe,ce,Re,Ne,We,Se,Le,vt,ti,po,Or,Ct,Zt,ft=k.s==_.s?1:-1,yt=k.c,$e=_.c;if(!yt||!yt[0]||!$e||!$e[0])return new p(!k.s||!_.s||(yt?$e&&yt[0]==$e[0]:!$e)?NaN:yt&&yt[0]==0||!$e?ft*0:ft/0);for(Ne=new p(ft),We=Ne.c=[],V=k.e-_.e,ft=H+V+1,x||(x=l,V=C(k.e/u)-C(_.e/u),ft=ft/u|0),F=0;$e[F]==(yt[F]||0);F++);if($e[F]>(yt[F]||0)&&V--,ft<0)We.push(1),z=!0;else{for(po=yt.length,Ct=$e.length,F=0,ft+=2,oe=o(x/($e[0]+1)),oe>1&&($e=b($e,oe,x),yt=b(yt,oe,x),Ct=$e.length,po=yt.length),ti=Ct,Se=yt.slice(0,Ct),Le=Se.length;Le<Ct;Se[Le++]=0);Zt=$e.slice(),Zt=[0].concat(Zt),Or=$e[0],$e[1]>=x/2&&Or++;do{if(oe=0,N=R($e,Se,Ct,Le),N<0){if(vt=Se[0],Ct!=Le&&(vt=vt*x+(Se[1]||0)),oe=o(vt/Or),oe>1)for(oe>=x&&(oe=x-1),ce=b($e,oe,x),Re=ce.length,Le=Se.length;R(ce,Se,Re,Le)==1;)oe--,S(ce,Ct<Re?Zt:$e,Re,x),Re=ce.length,N=1;else oe==0&&(N=oe=1),ce=$e.slice(),Re=ce.length;if(Re<Le&&(ce=[0].concat(ce)),S(Se,ce,Le,x),Le=Se.length,N==-1)for(;R($e,Se,Ct,Le)<1;)oe++,S(Se,Ct<Le?Zt:$e,Le,x),Le=Se.length}else N===0&&(oe++,Se=[0]);We[F++]=oe,Se[0]?Se[Le++]=yt[ti]||0:(Se=[yt[ti]],Le=1)}while((ti++<po||Se[0]!=null)&&ft--);z=Se[0]!=null,We[0]||We.splice(0,1)}if(x==l){for(F=1,ft=We[0];ft>=10;ft/=10,F++);Y(Ne,H+(Ne.e=F+V*u-1)+1,W,z)}else Ne.e=V,Ne.r=+z;return Ne}}();function I(b,R,S,k){var _,H,W,x,N;if(S==null?S=se:v(S,0,8),!b.c)return b.toString();if(_=b.c[0],W=b.e,R==null)N=y(b.c),N=k==1||k==2&&(W<=te||W>=ue)?O(N,W):L(N,W,"0");else if(b=Y(new p(b),R,S),H=b.e,N=y(b.c),x=N.length,k==1||k==2&&(R<=H||H<=te)){for(;x<R;N+="0",x++);N=O(N,H)}else if(R-=W,N=L(N,H,"0"),H+1>x){if(--R>0)for(N+=".";R--;N+="0");}else if(R+=H-x,R>0)for(H+1==x&&(N+=".");R--;N+="0");return b.s<0&&_?"-"+N:N}function $(b,R){for(var S,k,_=1,H=new p(b[0]);_<b.length;_++)k=new p(b[_]),(!k.s||(S=E(H,k))===R||S===0&&H.s===R)&&(H=k);return H}function B(b,R,S){for(var k=1,_=R.length;!R[--_];R.pop());for(_=R[0];_>=10;_/=10,k++);return(S=k+S*u-1)>be?b.c=b.e=null:S<pt?b.c=[b.e=0]:(b.e=S,b.c=R),b}U=function(){var b=/^(-?)0([xbo])(?=\w[\w.]*$)/i,R=/^([^.]+)\.$/,S=/^\.([^.]+)$/,k=/^-?(Infinity|NaN)$/,_=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(H,W,x,N){var V,F=x?W:W.replace(_,"");if(k.test(F))H.s=isNaN(F)?null:F<0?-1:1;else{if(!x&&(F=F.replace(b,function(z,oe,ce){return V=(ce=ce.toLowerCase())=="x"?16:ce=="b"?2:8,!N||N==V?oe:z}),N&&(V=N,F=F.replace(R,"$1").replace(S,"0.$1")),W!=F))return new p(F,V);if(p.DEBUG)throw Error(s+"Not a"+(N?" base "+N:"")+" number: "+W);H.s=null}H.c=H.e=null}}();function Y(b,R,S,k){var _,H,W,x,N,V,F,z=b.c,oe=h;if(z){e:{for(_=1,x=z[0];x>=10;x/=10,_++);if(H=R-_,H<0)H+=u,W=R,N=z[V=0],F=o(N/oe[_-W-1]%10);else if(V=i((H+1)/u),V>=z.length)if(k){for(;z.length<=V;z.push(0));N=F=0,_=1,H%=u,W=H-u+1}else break e;else{for(N=x=z[V],_=1;x>=10;x/=10,_++);H%=u,W=H-u+_,F=W<0?0:o(N/oe[_-W-1]%10)}if(k=k||R<0||z[V+1]!=null||(W<0?N:N%oe[_-W-1]),k=S<4?(F||k)&&(S==0||S==(b.s<0?3:2)):F>5||F==5&&(S==4||k||S==6&&(H>0?W>0?N/oe[_-W]:0:z[V-1])%10&1||S==(b.s<0?8:7)),R<1||!z[0])return z.length=0,k?(R-=b.e+1,z[0]=oe[(u-R%u)%u],b.e=-R||0):z[0]=b.e=0,b;if(H==0?(z.length=V,x=1,V--):(z.length=V+1,x=oe[u-H],z[V]=W>0?o(N/oe[_-W]%oe[W])*x:0),k)for(;;)if(V==0){for(H=1,W=z[0];W>=10;W/=10,H++);for(W=z[0]+=x,x=1;W>=10;W/=10,x++);H!=x&&(b.e++,z[0]==l&&(z[0]=1));break}else{if(z[V]+=x,z[V]!=l)break;z[V--]=0,x=1}for(H=z.length;z[--H]===0;z.pop());}b.e>be?b.c=b.e=null:b.e<pt&&(b.c=[b.e=0])}return b}function K(b){var R,S=b.e;return S===null?b.toString():(R=y(b.c),R=S<=te||S>=ue?O(R,S):L(R,S,"0"),b.s<0?"-"+R:R)}return j.absoluteValue=j.abs=function(){var b=new p(this);return b.s<0&&(b.s=1),b},j.comparedTo=function(b,R){return E(this,new p(b,R))},j.decimalPlaces=j.dp=function(b,R){var S,k,_,H=this;if(b!=null)return v(b,0,f),R==null?R=se:v(R,0,8),Y(new p(H),b+H.e+1,R);if(!(S=H.c))return null;if(k=((_=S.length-1)-C(this.e/u))*u,_=S[_])for(;_%10==0;_/=10,k--);return k<0&&(k=0),k},j.dividedBy=j.div=function(b,R){return A(this,new p(b,R),J,se)},j.dividedToIntegerBy=j.idiv=function(b,R){return A(this,new p(b,R),0,1)},j.exponentiatedBy=j.pow=function(b,R){var S,k,_,H,W,x,N,V,F,z=this;if(b=new p(b),b.c&&!b.isInteger())throw Error(s+"Exponent not an integer: "+K(b));if(R!=null&&(R=new p(R)),x=b.e>14,!z.c||!z.c[0]||z.c[0]==1&&!z.e&&z.c.length==1||!b.c||!b.c[0])return F=new p(Math.pow(+K(z),x?b.s*(2-P(b)):+K(b))),R?F.mod(R):F;if(N=b.s<0,R){if(R.c?!R.c[0]:!R.s)return new p(NaN);k=!N&&z.isInteger()&&R.isInteger(),k&&(z=z.mod(R))}else{if(b.e>9&&(z.e>0||z.e<-1||(z.e==0?z.c[0]>1||x&&z.c[1]>=24e7:z.c[0]<8e13||x&&z.c[0]<=9999975e7)))return H=z.s<0&&P(b)?-0:0,z.e>-1&&(H=1/H),new p(N?1/H:H);fn&&(H=i(fn/u+2))}for(x?(S=new p(.5),N&&(b.s=1),V=P(b)):(_=Math.abs(+K(b)),V=_%2),F=new p(Z);;){if(V){if(F=F.times(z),!F.c)break;H?F.c.length>H&&(F.c.length=H):k&&(F=F.mod(R))}if(_){if(_=o(_/2),_===0)break;V=_%2}else if(b=b.times(S),Y(b,b.e+1,1),b.e>14)V=P(b);else{if(_=+K(b),_===0)break;V=_%2}z=z.times(z),H?z.c&&z.c.length>H&&(z.c.length=H):k&&(z=z.mod(R))}return k?F:(N&&(F=Z.div(F)),R?F.mod(R):H?Y(F,fn,se,W):F)},j.integerValue=function(b){var R=new p(this);return b==null?b=se:v(b,0,8),Y(R,R.e+1,b)},j.isEqualTo=j.eq=function(b,R){return E(this,new p(b,R))===0},j.isFinite=function(){return!!this.c},j.isGreaterThan=j.gt=function(b,R){return E(this,new p(b,R))>0},j.isGreaterThanOrEqualTo=j.gte=function(b,R){return(R=E(this,new p(b,R)))===1||R===0},j.isInteger=function(){return!!this.c&&C(this.e/u)>this.c.length-2},j.isLessThan=j.lt=function(b,R){return E(this,new p(b,R))<0},j.isLessThanOrEqualTo=j.lte=function(b,R){return(R=E(this,new p(b,R)))===-1||R===0},j.isNaN=function(){return!this.s},j.isNegative=function(){return this.s<0},j.isPositive=function(){return this.s>0},j.isZero=function(){return!!this.c&&this.c[0]==0},j.minus=function(b,R){var S,k,_,H,W=this,x=W.s;if(b=new p(b,R),R=b.s,!x||!R)return new p(NaN);if(x!=R)return b.s=-R,W.plus(b);var N=W.e/u,V=b.e/u,F=W.c,z=b.c;if(!N||!V){if(!F||!z)return F?(b.s=-R,b):new p(z?W:NaN);if(!F[0]||!z[0])return z[0]?(b.s=-R,b):new p(F[0]?W:se==3?-0:0)}if(N=C(N),V=C(V),F=F.slice(),x=N-V){for((H=x<0)?(x=-x,_=F):(V=N,_=z),_.reverse(),R=x;R--;_.push(0));_.reverse()}else for(k=(H=(x=F.length)<(R=z.length))?x:R,x=R=0;R<k;R++)if(F[R]!=z[R]){H=F[R]<z[R];break}if(H&&(_=F,F=z,z=_,b.s=-b.s),R=(k=z.length)-(S=F.length),R>0)for(;R--;F[S++]=0);for(R=l-1;k>x;){if(F[--k]<z[k]){for(S=k;S&&!F[--S];F[S]=R);--F[S],F[k]+=l}F[k]-=z[k]}for(;F[0]==0;F.splice(0,1),--V);return F[0]?B(b,F,V):(b.s=se==3?-1:1,b.c=[b.e=0],b)},j.modulo=j.mod=function(b,R){var S,k,_=this;return b=new p(b,R),!_.c||!b.s||b.c&&!b.c[0]?new p(NaN):!b.c||_.c&&!_.c[0]?new p(_):(wt==9?(k=b.s,b.s=1,S=A(_,b,0,3),b.s=k,S.s*=k):S=A(_,b,0,wt),b=_.minus(S.times(b)),!b.c[0]&&wt==1&&(b.s=_.s),b)},j.multipliedBy=j.times=function(b,R){var S,k,_,H,W,x,N,V,F,z,oe,ce,Re,Ne,We,Se=this,Le=Se.c,vt=(b=new p(b,R)).c;if(!Le||!vt||!Le[0]||!vt[0])return!Se.s||!b.s||Le&&!Le[0]&&!vt||vt&&!vt[0]&&!Le?b.c=b.e=b.s=null:(b.s*=Se.s,!Le||!vt?b.c=b.e=null:(b.c=[0],b.e=0)),b;for(k=C(Se.e/u)+C(b.e/u),b.s*=Se.s,N=Le.length,z=vt.length,N<z&&(Re=Le,Le=vt,vt=Re,_=N,N=z,z=_),_=N+z,Re=[];_--;Re.push(0));for(Ne=l,We=d,_=z;--_>=0;){for(S=0,oe=vt[_]%We,ce=vt[_]/We|0,W=N,H=_+W;H>_;)V=Le[--W]%We,F=Le[W]/We|0,x=ce*V+F*oe,V=oe*V+x%We*We+Re[H]+S,S=(V/Ne|0)+(x/We|0)+ce*F,Re[H--]=V%Ne;Re[H]=S}return S?++k:Re.splice(0,1),B(b,Re,k)},j.negated=function(){var b=new p(this);return b.s=-b.s||null,b},j.plus=function(b,R){var S,k=this,_=k.s;if(b=new p(b,R),R=b.s,!_||!R)return new p(NaN);if(_!=R)return b.s=-R,k.minus(b);var H=k.e/u,W=b.e/u,x=k.c,N=b.c;if(!H||!W){if(!x||!N)return new p(_/0);if(!x[0]||!N[0])return N[0]?b:new p(x[0]?k:_*0)}if(H=C(H),W=C(W),x=x.slice(),_=H-W){for(_>0?(W=H,S=N):(_=-_,S=x),S.reverse();_--;S.push(0));S.reverse()}for(_=x.length,R=N.length,_-R<0&&(S=N,N=x,x=S,R=_),_=0;R;)_=(x[--R]=x[R]+N[R]+_)/l|0,x[R]=l===x[R]?0:x[R]%l;return _&&(x=[_].concat(x),++W),B(b,x,W)},j.precision=j.sd=function(b,R){var S,k,_,H=this;if(b!=null&&b!==!!b)return v(b,1,f),R==null?R=se:v(R,0,8),Y(new p(H),b,R);if(!(S=H.c))return null;if(_=S.length-1,k=_*u+1,_=S[_]){for(;_%10==0;_/=10,k--);for(_=S[0];_>=10;_/=10,k++);}return b&&H.e+1>k&&(k=H.e+1),k},j.shiftedBy=function(b){return v(b,-9007199254740991,c),this.times("1e"+b)},j.squareRoot=j.sqrt=function(){var b,R,S,k,_,H=this,W=H.c,x=H.s,N=H.e,V=J+4,F=new p("0.5");if(x!==1||!W||!W[0])return new p(!x||x<0&&(!W||W[0])?NaN:W?H:1/0);if(x=Math.sqrt(+K(H)),x==0||x==1/0?(R=y(W),(R.length+N)%2==0&&(R+="0"),x=Math.sqrt(+R),N=C((N+1)/2)-(N<0||N%2),x==1/0?R="5e"+N:(R=x.toExponential(),R=R.slice(0,R.indexOf("e")+1)+N),S=new p(R)):S=new p(x+""),S.c[0]){for(N=S.e,x=N+V,x<3&&(x=0);;)if(_=S,S=F.times(_.plus(A(H,_,V,1))),y(_.c).slice(0,x)===(R=y(S.c)).slice(0,x))if(S.e<N&&--x,R=R.slice(x-3,x+1),R=="9999"||!k&&R=="4999"){if(!k&&(Y(_,_.e+J+2,0),_.times(_).eq(H))){S=_;break}V+=4,x+=4,k=1}else{(!+R||!+R.slice(1)&&R.charAt(0)=="5")&&(Y(S,S.e+J+2,1),b=!S.times(S).eq(H));break}}return Y(S,S.e+J+1,se,b)},j.toExponential=function(b,R){return b!=null&&(v(b,0,f),b++),I(this,b,R,1)},j.toFixed=function(b,R){return b!=null&&(v(b,0,f),b=b+this.e+1),I(this,b,R)},j.toFormat=function(b,R,S){var k,_=this;if(S==null)b!=null&&R&&typeof R=="object"?(S=R,R=null):b&&typeof b=="object"?(S=b,b=R=null):S=et;else if(typeof S!="object")throw Error(s+"Argument not an object: "+S);if(k=_.toFixed(b,R),_.c){var H,W=k.split("."),x=+S.groupSize,N=+S.secondaryGroupSize,V=S.groupSeparator||"",F=W[0],z=W[1],oe=_.s<0,ce=oe?F.slice(1):F,Re=ce.length;if(N&&(H=x,x=N,N=H,Re-=H),x>0&&Re>0){for(H=Re%x||x,F=ce.substr(0,H);H<Re;H+=x)F+=V+ce.substr(H,x);N>0&&(F+=V+ce.slice(H)),oe&&(F="-"+F)}k=z?F+(S.decimalSeparator||"")+((N=+S.fractionGroupSize)?z.replace(new RegExp("\\d{"+N+"}\\B","g"),"$&"+(S.fractionGroupSeparator||"")):z):F}return(S.prefix||"")+k+(S.suffix||"")},j.toFraction=function(b){var R,S,k,_,H,W,x,N,V,F,z,oe,ce=this,Re=ce.c;if(b!=null&&(x=new p(b),!x.isInteger()&&(x.c||x.s!==1)||x.lt(Z)))throw Error(s+"Argument "+(x.isInteger()?"out of range: ":"not an integer: ")+K(x));if(!Re)return new p(ce);for(R=new p(Z),V=S=new p(Z),k=N=new p(Z),oe=y(Re),H=R.e=oe.length-ce.e-1,R.c[0]=h[(W=H%u)<0?u+W:W],b=!b||x.comparedTo(R)>0?H>0?R:V:x,W=be,be=1/0,x=new p(oe),N.c[0]=0;F=A(x,R,0,1),_=S.plus(F.times(k)),_.comparedTo(b)!=1;)S=k,k=_,V=N.plus(F.times(_=V)),N=_,R=x.minus(F.times(_=R)),x=_;return _=A(b.minus(S),k,0,1),N=N.plus(_.times(V)),S=S.plus(_.times(k)),N.s=V.s=ce.s,H=H*2,z=A(V,k,H,se).minus(ce).abs().comparedTo(A(N,S,H,se).minus(ce).abs())<1?[V,k]:[N,S],be=W,z},j.toNumber=function(){return+K(this)},j.toPrecision=function(b,R){return b!=null&&v(b,1,f),I(this,b,R,2)},j.toString=function(b){var R,S=this,k=S.s,_=S.e;return _===null?k?(R="Infinity",k<0&&(R="-"+R)):R="NaN":(b==null?R=_<=te||_>=ue?O(y(S.c),_):L(y(S.c),_,"0"):b===10&&w?(S=Y(new p(S),J+_+1,se),R=L(y(S.c),S.e,"0")):(v(b,2,m.length,"Base"),R=q(L(y(S.c),_,"0"),10,b,k,!0)),k<0&&S.c[0]&&(R="-"+R)),R},j.valueOf=j.toJSON=function(){return K(this)},j._isBigNumber=!0,T!=null&&p.set(T),p}function C(T){var A=T|0;return T>0||T===A?A:A-1}function y(T){for(var A,q,U=1,j=T.length,Z=T[0]+"";U<j;){for(A=T[U++]+"",q=u-A.length;q--;A="0"+A);Z+=A}for(j=Z.length;Z.charCodeAt(--j)===48;);return Z.slice(0,j+1||1)}function E(T,A){var q,U,j=T.c,Z=A.c,J=T.s,se=A.s,te=T.e,ue=A.e;if(!J||!se)return null;if(q=j&&!j[0],U=Z&&!Z[0],q||U)return q?U?0:-se:J;if(J!=se)return J;if(q=J<0,U=te==ue,!j||!Z)return U?0:!j^q?1:-1;if(!U)return te>ue^q?1:-1;for(se=(te=j.length)<(ue=Z.length)?te:ue,J=0;J<se;J++)if(j[J]!=Z[J])return j[J]>Z[J]^q?1:-1;return te==ue?0:te>ue^q?1:-1}function v(T,A,q,U){if(T<A||T>q||T!==o(T))throw Error(s+(U||"Argument")+(typeof T=="number"?T<A||T>q?" out of range: ":" not an integer: ":" not a primitive number: ")+String(T))}function P(T){var A=T.c.length-1;return C(T.e/u)==A&&T.c[A]%2!=0}function O(T,A){return(T.length>1?T.charAt(0)+"."+T.slice(1):T)+(A<0?"e":"e+")+A}function L(T,A,q){var U,j;if(A<0){for(j=q+".";++A;j+=q);T=j+T}else if(U=T.length,++A>U){for(j=q,A-=U;--A;j+=q);T+=j}else A<U&&(T=T.slice(0,A)+"."+T.slice(A));return T}n=g(),n.default=n.BigNumber=n,t.exports?t.exports=n:(e||(e=typeof self<"u"&&self?self:window),e.BigNumber=n)})(d9)})(wk);var vk=wk.exports;/*!
|
|
188
|
+
* Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
|
|
189
|
+
*
|
|
190
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
191
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
192
|
+
* in the Software without restriction, including without limitation the rights
|
|
193
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
194
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
195
|
+
* furnished to do so, subject to the following conditions:
|
|
196
|
+
*
|
|
197
|
+
* The above copyright notice and this permission notice shall be included in
|
|
198
|
+
* all copies or substantial portions of the Software.
|
|
199
|
+
*
|
|
200
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
201
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
202
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
203
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
204
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
205
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
206
|
+
* SOFTWARE.
|
|
207
|
+
*/const fi=W0(),N9=F0(),D9=V0,k9=vk,bn={trillion:Math.pow(10,12),billion:Math.pow(10,9),million:Math.pow(10,6),thousand:Math.pow(10,3)},Td={totalLength:0,characteristic:0,forceAverage:!1,average:!1,mantissa:-1,optionalMantissa:!0,thousandSeparated:!1,spaceSeparated:!1,negative:"sign",forceSign:!1,roundingFunction:Math.round,spaceSeparatedAbbreviation:!1},{binarySuffixes:Ck,decimalSuffixes:sm}=fi.currentBytes(),B0={general:{scale:1024,suffixes:sm},binary:{scale:1024,suffixes:Ck},decimal:{scale:1e3,suffixes:sm}};function L9(t,e={},n){if(typeof e=="string"&&(e=D9.parseFormat(e)),!N9.validateFormat(e))return"ERROR: invalid format";let i=e.prefix||"",o=e.postfix||"",s=$9(t,e,n);return s=r6(s,i),s=i6(s,o),s}function $9(t,e,n){switch(e.output){case"currency":return e=hu(e,fi.currentCurrencyDefaultFormat()),Y9(t,e,fi);case"percent":return e=hu(e,fi.currentPercentageDefaultFormat()),z9(t,e,fi,n);case"byte":return e=hu(e,fi.currentByteDefaultFormat()),B9(t,e,fi,n);case"time":return e=hu(e,fi.currentTimeDefaultFormat()),U9(t);case"ordinal":return e=hu(e,fi.currentOrdinalDefaultFormat()),j9(t,e,fi);case"number":default:return _d({instance:t,providedFormat:e})}}function F9(t){let e=B0.decimal;return vp(t._value,e.suffixes,e.scale).suffix}function V9(t){let e=B0.binary;return vp(t._value,e.suffixes,e.scale).suffix}function W9(t){let e=B0.general;return vp(t._value,e.suffixes,e.scale).suffix}function vp(t,e,n){let r=e[0],i=Math.abs(t);if(i>=n){for(let o=1;o<e.length;++o){let s=Math.pow(n,o),a=Math.pow(n,o+1);if(i>=s&&i<a){r=e[o],t=t/s;break}}r===e[0]&&(t=t/Math.pow(n,e.length-1),r=e[e.length-1])}return{value:t,suffix:r}}function B9(t,e,n,r){let i=e.base||"binary",o=Object.assign({},Td,e);const{binarySuffixes:s,decimalSuffixes:a}=n.currentBytes();let u={general:{scale:1024,suffixes:a||sm,marker:"bd"},binary:{scale:1024,suffixes:s||Ck,marker:"b"},decimal:{scale:1e3,suffixes:a||sm,marker:"d"}}[i],{value:c,suffix:h}=vp(t._value,u.suffixes,u.scale);return`${_d({instance:r(c),providedFormat:e,state:n,defaults:n.currentByteDefaultFormat()})}${o.spaceSeparated?" ":""}${h}`}function j9(t,e,n){let r=n.currentOrdinal(),i=Object.assign({},Td,e),o=_d({instance:t,providedFormat:e,state:n}),s=r(t._value);return`${o}${i.spaceSeparated?" ":""}${s}`}function U9(t){let e=Math.floor(t._value/60/60),n=Math.floor((t._value-e*60*60)/60),r=Math.round(t._value-e*60*60-n*60);return`${e}:${n<10?"0":""}${n}:${r<10?"0":""}${r}`}function z9(t,e,n,r){let i=e.prefixSymbol,o=_d({instance:r(t._value*100),providedFormat:e,state:n}),s=Object.assign({},Td,e);return i?`%${s.spaceSeparated?" ":""}${o}`:`${o}${s.spaceSeparated?" ":""}%`}function Y9(t,e,n){const r=n.currentCurrency();let i=Object.assign({},e),o=Object.assign({},Td,i),s,a="",l=!!o.totalLength||!!o.forceAverage||o.average,u=i.currencyPosition||r.position,c=i.currencySymbol||r.symbol;const h=o.spaceSeparatedCurrency!==void 0?o.spaceSeparatedCurrency:o.spaceSeparated;i.lowPrecision===void 0&&(i.lowPrecision=!1),h&&(a=" "),u==="infix"&&(s=a+c+a);let d=_d({instance:t,providedFormat:i,state:n,decimalSeparator:s});return u==="prefix"&&(t._value<0&&o.negative==="sign"?d=`-${a}${c}${d.slice(1)}`:t._value>0&&o.forceSign?d=`+${a}${c}${d.slice(1)}`:d=c+a+d),(!u||u==="postfix")&&(a=!o.spaceSeparatedAbbreviation&&l?"":a,d=d+a+c),d}function G9({value:t,forceAverage:e,lowPrecision:n=!0,abbreviations:r,spaceSeparated:i=!1,totalLength:o=0,roundingFunction:s=Math.round}){let a="",l=Math.abs(t),u=-1;if(e&&r[e]&&bn[e]?(a=r[e],t=t/bn[e]):l>=bn.trillion||n&&s(l/bn.trillion)===1?(a=r.trillion,t=t/bn.trillion):l<bn.trillion&&l>=bn.billion||n&&s(l/bn.billion)===1?(a=r.billion,t=t/bn.billion):l<bn.billion&&l>=bn.million||n&&s(l/bn.million)===1?(a=r.million,t=t/bn.million):(l<bn.million&&l>=bn.thousand||n&&s(l/bn.thousand)===1)&&(a=r.thousand,t=t/bn.thousand),a&&(a=(i?" ":"")+a),o){let h=t<0,d=t.toString().split(".")[0],f=h?d.length-1:d.length;u=Math.max(o-f,0)}return{value:t,abbreviation:a,mantissaPrecision:u}}function q9({value:t,characteristicPrecision:e}){let[n,r]=t.toExponential().split("e"),i=+n;if(!e)return{value:i,abbreviation:`e${r}`};let o=1;return o<e&&(i=i*Math.pow(10,e-o),r=+r-(e-o),r=r>=0?`+${r}`:r),{value:i,abbreviation:`e${r}`}}function yf(t){let e="";for(let n=0;n<t;n++)e+="0";return e}function K9(t,e){let n=t.toString(),[r,i]=n.split("e"),[o,s=""]=r.split(".");if(+i>0)n=o+s+yf(i-s.length);else{let a=".";+o<0?a=`-0${a}`:a=`0${a}`;let l=(yf(-i-1)+Math.abs(o)+s).substr(0,e);l.length<e&&(l+=yf(e-l.length)),n=a+l}return+i>0&&e>0&&(n+=`.${yf(e)}`),n}function X9(t,e,n=Math.round){return t.toString().indexOf("e")!==-1?K9(t,e):new k9(n(+`${t}e+${e}`)/Math.pow(10,e)).toFixed(e)}function Z9(t,e,n,r,i,o){if(r===-1)return t;let s=X9(e,r,o),[a,l=""]=s.toString().split(".");if(l.match(/^0+$/)&&(n||i))return a;let u=l.match(/0+$/);return i&&u?`${a}.${l.toString().slice(0,u.index)}`:s.toString()}function Q9(t,e,n,r){let i=t,[o,s]=i.toString().split(".");if(o.match(/^-?0$/)&&n)return s?`${o.replace("0","")}.${s}`:o.replace("0","");const a=e<0&&o.indexOf("-")===0;if(a&&(o=o.slice(1),i=i.slice(1)),o.length<r){let l=r-o.length;for(let u=0;u<l;u++)i=`0${i}`}return a&&(i=`-${i}`),i.toString()}function J9(t,e){let n=[],r=0;for(let i=t;i>0;i--)r===e&&(n.unshift(i),r=0),r++;return n}function e6(t,e,n,r,i){let o=r.currentDelimiters(),s=o.thousands;i=i||o.decimal;let a=o.thousandsSize||3,l=t.toString(),u=l.split(".")[0],c=l.split(".")[1];const h=e<0&&u.indexOf("-")===0;return n&&(h&&(u=u.slice(1)),J9(u.length,a).forEach((f,g)=>{u=u.slice(0,f+g)+s+u.slice(f+g)}),h&&(u=`-${u}`)),c?l=u+i+c:l=u,l}function t6(t,e){return t+e}function n6(t,e,n){return e===0?t:+t==0?t.replace("-",""):e>0?`+${t}`:n==="sign"?t:`(${t.replace("-","")})`}function r6(t,e){return e+t}function i6(t,e){return t+e}function _d({instance:t,providedFormat:e,state:n=fi,decimalSeparator:r,defaults:i=n.currentDefaults()}){let o=t._value;if(o===0&&n.hasZeroFormat())return n.getZeroFormat();if(!isFinite(o))return o.toString();let s=Object.assign({},Td,i,e),a=s.totalLength,l=a?0:s.characteristic,u=s.optionalCharacteristic,c=s.forceAverage,h=s.lowPrecision,d=!!a||!!c||s.average,f=a?-1:d&&e.mantissa===void 0?0:s.mantissa,g=a?!1:e.optionalMantissa===void 0?f===-1:s.optionalMantissa,C=s.trimMantissa,y=s.thousandSeparated,E=s.spaceSeparated,v=s.negative,P=s.forceSign,O=s.exponential,L=s.roundingFunction,T="";if(d){let q=G9({value:o,forceAverage:c,lowPrecision:h,abbreviations:n.currentAbbreviations(),spaceSeparated:E,roundingFunction:L,totalLength:a});o=q.value,T+=q.abbreviation,a&&(f=q.mantissaPrecision)}if(O){let q=q9({value:o,characteristicPrecision:l});o=q.value,T=q.abbreviation+T}let A=Z9(o.toString(),o,g,f,C,L);return A=Q9(A,o,u,l),A=e6(A,o,y,n,r),(d||O)&&(A=t6(A,T)),(P||o<0)&&(A=n6(A,o,v)),A}function hu(t,e){if(!t)return e;let n=Object.keys(t);return n.length===1&&n[0]==="output"?e:t}var o6=t=>({format:(...e)=>L9(...e,t),getByteUnit:(...e)=>W9(...e,t),getBinaryByteUnit:(...e)=>V9(...e,t),getDecimalByteUnit:(...e)=>F9(...e,t),formatOrDefault:hu});/*!
|
|
208
|
+
* Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
|
|
209
|
+
*
|
|
210
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
211
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
212
|
+
* in the Software without restriction, including without limitation the rights
|
|
213
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
214
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
215
|
+
* furnished to do so, subject to the following conditions:
|
|
216
|
+
*
|
|
217
|
+
* The above copyright notice and this permission notice shall be included in
|
|
218
|
+
* all copies or substantial portions of the Software.
|
|
219
|
+
*
|
|
220
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
221
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
222
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
223
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
224
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
225
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
226
|
+
* SOFTWARE.
|
|
227
|
+
*/const ts=vk;function s6(t,e,n){let r=new ts(t._value),i=e;return n.isNumbro(e)&&(i=e._value),i=new ts(i),t._value=r.plus(i).toNumber(),t}function yk(t,e,n){let r=new ts(t._value),i=e;return n.isNumbro(e)&&(i=e._value),i=new ts(i),t._value=r.minus(i).toNumber(),t}function a6(t,e,n){let r=new ts(t._value),i=e;return n.isNumbro(e)&&(i=e._value),i=new ts(i),t._value=r.times(i).toNumber(),t}function l6(t,e,n){let r=new ts(t._value),i=e;return n.isNumbro(e)&&(i=e._value),i=new ts(i),t._value=r.dividedBy(i).toNumber(),t}function u6(t,e,n){let r=e;return n.isNumbro(e)&&(r=e._value),t._value=r,t}function c6(t,e,n){let r=n(t._value);return yk(r,e,n),Math.abs(r._value)}var h6=t=>({add:(e,n)=>s6(e,n,t),subtract:(e,n)=>yk(e,n,t),multiply:(e,n)=>a6(e,n,t),divide:(e,n)=>l6(e,n,t),set:(e,n)=>u6(e,n,t),difference:(e,n)=>c6(e,n,t),BigNumber:ts});/*!
|
|
228
|
+
* Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
|
|
229
|
+
*
|
|
230
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
231
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
232
|
+
* in the Software without restriction, including without limitation the rights
|
|
233
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
234
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
235
|
+
* furnished to do so, subject to the following conditions:
|
|
236
|
+
*
|
|
237
|
+
* The above copyright notice and this permission notice shall be included in
|
|
238
|
+
* all copies or substantial portions of the Software.
|
|
239
|
+
*
|
|
240
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
241
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
242
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
243
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
244
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
245
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
246
|
+
* SOFTWARE.
|
|
247
|
+
*/const d6="2.5.0",mo=W0(),f6=F0(),g6=H9(zt),m6=pk();let da=o6(zt),Ba=h6(zt);const p6=V0;class bk{constructor(e){this._value=e}clone(){return zt(this._value)}format(e={}){return da.format(this,e)}formatCurrency(e){return typeof e=="string"&&(e=p6.parseFormat(e)),e=da.formatOrDefault(e,mo.currentCurrencyDefaultFormat()),e.output="currency",da.format(this,e)}formatTime(e={}){return e.output="time",da.format(this,e)}binaryByteUnits(){return da.getBinaryByteUnit(this)}decimalByteUnits(){return da.getDecimalByteUnit(this)}byteUnits(){return da.getByteUnit(this)}difference(e){return Ba.difference(this,e)}add(e){return Ba.add(this,e)}subtract(e){return Ba.subtract(this,e)}multiply(e){return Ba.multiply(this,e)}divide(e){return Ba.divide(this,e)}set(e){return Ba.set(this,Sk(e))}value(){return this._value}valueOf(){return this._value}}function Sk(t){let e=t;return zt.isNumbro(t)?e=t._value:typeof t=="string"?e=zt.unformat(t):isNaN(t)&&(e=NaN),e}function zt(t){return new bk(Sk(t))}zt.version=d6;zt.isNumbro=function(t){return t instanceof bk};zt.language=mo.currentLanguage;zt.registerLanguage=mo.registerLanguage;zt.setLanguage=mo.setLanguage;zt.languages=mo.languages;zt.languageData=mo.languageData;zt.zeroFormat=mo.setZeroFormat;zt.defaultFormat=mo.currentDefaults;zt.setDefaults=mo.setDefaults;zt.defaultCurrencyFormat=mo.currentCurrencyDefaultFormat;zt.validate=f6.validate;zt.loadLanguagesInNode=g6.loadLanguagesInNode;zt.unformat=m6.unformat;zt.BigNumber=Ba.BigNumber;var w6=zt,fa=f9(w6);const v6="numeric";function Rk(t,e){if(Un(t)){const n=e.numericFormat,r=n&&n.culture||"-",i=n&&n.pattern;if(typeof r<"u"&&!fa.languages()[r]){const o=r.replace("-",""),s=fa.allLanguages?fa.allLanguages[r]:fa[o];s&&fa.registerLanguage(s)}fa.setLanguage(r),t=fa(t).format(i||"0")}return t}function j0(t,e,n,r,i,o,s){let a=o;if(Un(a)){let u=[];if(Array.isArray(s.className))u=s.className;else{var l;const c=(l=s.className)!==null&&l!==void 0?l:"";c.length&&(u=c.split(" "))}a=Rk(a,s),u.indexOf("htLeft")<0&&u.indexOf("htCenter")<0&&u.indexOf("htRight")<0&&u.indexOf("htJustify")<0&&u.push("htRight"),u.indexOf("htNumeric")<0&&u.push("htNumeric"),s.className=u.join(" "),e.dir="ltr"}ls(t,e,n,r,i,a,s)}j0.RENDERER_TYPE=v6;const C6="password";function U0(t,e,n,r,i,o,s){ls.apply(this,[t,e,n,r,i,o,s]);const a=s.hashLength||e.innerHTML.length,l=s.hashSymbol||"*";let u="";de(a-1,()=>{u+=l}),Ku(e,u)}U0.RENDERER_TYPE=C6;const y6="select";function z0(t,e,n,r,i,o,s){ls.apply(this,[t,e,n,r,i,o,s])}z0.RENDERER_TYPE=y6;const b6="time";function Y0(t,e,n,r,i,o,s){ls.apply(this,[t,e,n,r,i,o,s]),e.dir="ltr"}Y0.RENDERER_TYPE=b6;function S6(){Lr(Ju),Lr(Ed),Lr(k0),Lr(D0),Lr($0),Lr(N0),Lr(j0),Lr(U0),Lr(z0),Lr(ls),Lr(Y0)}const R6="autocomplete";function Cp(t,e){let n=t;if(n==null&&(n=""),this.allowEmpty&&n===""){e(!0);return}this.strict&&this.source?typeof this.source=="function"?this.source(n,jx(n,e)):jx(n,e)(this.source):e(!0)}Cp.VALIDATOR_TYPE=R6;function jx(t,e){const n=t;return function(r){let i=!1;for(let o=0,s=r.length;o<s;o++)if(n===r[o]){i=!0;break}e(i)}}function E6(t){const e=new Date(t);return isNaN(new Date(`${t}T00:00`).getDate())?e:new Date(e.getTime()+e.getTimezoneOffset()*6e4)}const T6="date";function G0(t,e){const n=YN(lk,this.instance);let r=t,i=!0;r==null&&(r="");let o=X(r,this.dateFormat||n.defaultDateFormat,!0).isValid(),s=X(new Date(r)).isValid()||o;if(this.allowEmpty&&r===""&&(s=!0,o=!0),s||(i=!1),!s&&o&&(i=!0),s&&!o)if(this.correctFormat===!0){const a=_6(r,this.dateFormat);this.instance.setDataAtCell(this.visualRow,this.visualCol,a,"dateValidator"),i=!0}else i=!1;e(i)}G0.VALIDATOR_TYPE=T6;function _6(t,e){const n=X(E6(t)),r=X(t,e),i=t.search(/[A-Za-z]/g)>-1;let o;return n.isValid()&&n.format("x")===r.format("x")||!r.isValid()||i?o=n:o=r,o.format(e)}const M6="dropdown";function q0(t,e){Cp.apply(this,[t,e])}q0.VALIDATOR_TYPE=M6;const I6="numeric";function K0(t,e){let n=t;n==null&&(n=""),this.allowEmpty&&n===""?e(!0):e(n===""?!1:Un(t))}K0.VALIDATOR_TYPE=I6;const P6=["YYYY-MM-DDTHH:mm:ss.SSSZ","X","x"],O6="time";function X0(t,e){const n=this.timeFormat||"h:mm:ss a";let r=!0,i=t;i===null&&(i=""),i=/^\d{3,}$/.test(i)?parseInt(i,10):i;const o=/^\d{1,2}$/.test(i);o&&(i+=":00");const s=X(i,P6,!0).isValid()?X(i):X(i,n);let a=s.isValid(),l=X(i,n,!0).isValid()&&!o;if(this.allowEmpty&&i===""&&(a=!0,l=!0),a||(r=!1),!a&&l&&(r=!0),a&&!l)if(this.correctFormat===!0){const u=s.format(n);this.instance.setDataAtCell(this.visualRow,this.visualCol,u,"timeValidator"),r=!0}else r=!1;e(r)}X0.VALIDATOR_TYPE=O6;function x6(){cu(Cp),cu(q0),cu(G0),cu(K0),cu(X0)}const A6="autocomplete",H6={CELL_TYPE:A6,editor:A0,renderer:Ju,validator:Cp},N6="checkbox",D6={CELL_TYPE:N6,editor:ak,renderer:k0},k6="date";function Ek(t,e,n,r,i,o,s){Ju.apply(this,[t,e,n,r,i,o,s])}Ek.RENDERER_TYPE=k6;const L6="date",$6={CELL_TYPE:L6,editor:uk,renderer:Ek,validator:G0},F6="dropdown",V6={CELL_TYPE:F6,editor:ck,renderer:D0,validator:q0,filter:!1,strict:!0},W6="handsontable",B6={CELL_TYPE:W6,editor:x0,renderer:$0},j6="numeric",U6={CELL_TYPE:j6,editor:hk,renderer:j0,validator:K0,dataType:"number"},z6="password",Y6={CELL_TYPE:z6,editor:dk,renderer:U0,copyable:!1},G6="select",q6={CELL_TYPE:G6,editor:fk,renderer:z0},K6="time",X6={CELL_TYPE:K6,editor:gk,renderer:Y0,validator:X0};function Z6(){ci(H6),ci(D6),ci($6),ci(V6),ci(B6),ci(U6),ci(Y6),ci(q6),ci(ZD),ci(X6)}function Q6(t,e){Tk(t,e),e.add(t)}function J6(t,e,n){Tk(t,e),e.set(t,n)}function Tk(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function kl(t,e,n){return(e=e8(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function e8(t){var e=t8(t,"string");return typeof e=="symbol"?e:e+""}function t8(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ll(t,e){return t.get(_k(t,e))}function _k(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const Ux=new Map([["plugin",pY],["cell-type",WD],["editor",zN],["renderer",JN],["validator",eD]]),Mk=Symbol("mainSetting"),n8="base",bf=[];let ga=null;var ma=new WeakMap,zx=new WeakSet;class Xe{static get PLUGIN_KEY(){return n8}static get SETTING_KEYS(){return[this.PLUGIN_KEY]}static get DEFAULT_SETTINGS(){return{}}constructor(e){Q6(this,zx),kl(this,"eventManager",new _i(this)),kl(this,"pluginName",null),kl(this,"pluginsInitializedCallbacks",[]),kl(this,"isPluginsReady",!1),kl(this,"enabled",!1),kl(this,"initialized",!1),J6(this,ma,{}),ss(this,"hot",e,{writable:!1}),ga=null,this.hot.addHook("afterPluginsInitialized",()=>this.onAfterPluginsInitialized()),this.hot.addHook("afterUpdateSettings",n=>this.onUpdateSettings(n)),this.hot.addHook("beforeInit",()=>this.init())}init(){this.pluginName=this.hot.getPluginName(this);const e=this.constructor.PLUGIN_DEPS,n=Array.isArray(e)?e:[];if(n.length>0){const i=[];if(n.forEach(o=>{const[s,a]=o.split(":");if(!Ux.has(s))throw new Error(`Unknown plugin dependency type "${s}" was found.`);Ux.get(s)(a)||i.push(` - ${a} (${s})`)}),i.length>0){const o=[`The ${this.pluginName} plugin requires the following modules:
|
|
248
|
+
`,`${i.join(`
|
|
249
|
+
`)}
|
|
250
|
+
`].join("");bf.push(o)}}if(ga||(ga=QN()),ga.indexOf(this.pluginName)>=0&&ga.splice(ga.indexOf(this.pluginName),1),this.hot.addHookOnce("afterPluginsInitialized",()=>{this.isEnabled&&this.isEnabled()&&this.enablePlugin()}),ga.length===0){if(bf.length>0){const i=[`${bf.join(`
|
|
251
|
+
`)}
|
|
252
|
+
`,"You have to import and register them manually."].join("");throw bf.length=0,new Error(i)}this.hot.runHooks("afterPluginsInitialized")}this.initialized=!0}enablePlugin(){this.enabled=!0}disablePlugin(){var e;(e=this.eventManager)===null||e===void 0||e.clear(),this.clearHooks(),this.enabled=!1}getSetting(e){const n=this.hot.getSettings()[this.constructor.PLUGIN_KEY];if(e===void 0)return n;const r=this.constructor.DEFAULT_SETTINGS;if((Array.isArray(n)||Ae(n))&&r[Mk]===e){var i;return Array.isArray(n)?n:(i=n[e])!==null&&i!==void 0?i:r[e]}if(Ae(n)){var o;return(o=n[e])!==null&&o!==void 0?o:r[e]}return r[e]}addHook(e,n,r){Ll(ma,this)[e]=Ll(ma,this)[e]||[];const i=Ll(ma,this)[e];this.hot.addHook(e,n,r),i.push(n),Ll(ma,this)[e]=i}removeHooks(e){M(Ll(ma,this)[e]||[],n=>{this.hot.removeHook(e,n)})}clearHooks(){const e=Ll(ma,this);He(e,(n,r)=>this.removeHooks(r)),e.length=0}callOnPluginsReady(e){this.isPluginsReady?e():this.pluginsInitializedCallbacks.push(e)}onAfterPluginsInitialized(){M(this.pluginsInitializedCallbacks,e=>e()),this.pluginsInitializedCallbacks.length=0,this.isPluginsReady=!0}onUpdateSettings(e){const n=_k(zx,this,r8).call(this,e);this.isEnabled&&(this.enabled&&!this.isEnabled()&&this.disablePlugin(),!this.enabled&&this.isEnabled()&&this.enablePlugin(),this.enabled&&this.isEnabled()&&n&&this.updatePlugin(e))}updatePlugin(){}destroy(){var e;(e=this.eventManager)===null||e===void 0||e.destroy(),this.clearHooks(),He(this,(n,r)=>{r!=="hot"&&(this[r]=null)}),delete this.t,delete this.hot}}function r8(t){if(!t)return!1;const e=this.constructor.SETTING_KEYS;if(typeof e=="boolean")return e;for(let n=0;n<e.length;n++)if(t[e[n]]!==void 0)return!0;return!1}function pa(t,e,n){return(e=i8(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i8(t){var e=o8(t,"string");return typeof e=="symbol"?e:e+""}function o8(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}let Ik=class{constructor(e){pa(this,"hot",null),pa(this,"container",null),pa(this,"injected",!1),pa(this,"rows",[]),pa(this,"columns",[]),pa(this,"samples",null),pa(this,"settings",{useHeaders:!0}),this.hot=e}addRow(e,n){if(this.columns.length)throw new Error("Doesn't support multi-dimensional table");this.rows.length||(this.container=this.createContainer(this.hot.rootElement.className));const r={row:e};this.rows.push(r),this.samples=n,this.table=this.createTable(this.hot.table.className),this.table.colGroup.appendChild(this.createColGroupsCol(e)),this.table.tr.appendChild(this.createRow(e)),e===0&&G(this.table.table,"htGhostTableFirstRow"),this.container.container.appendChild(this.table.fragment),r.table=this.table.table}addColumnHeadersRow(e){const n=this.hot.getColHeader(0);if(n!=null){const r={row:-1};this.rows.push(r),this.container=this.createContainer(this.hot.rootElement.className),this.samples=e,this.table=this.createTable(this.hot.table.className),this.table.colGroup.appendChild(this.createColGroupsCol()),this.appendColumnHeadersRow(),this.container.container.appendChild(this.table.fragment),r.table=this.table.table}}addColumn(e,n){if(this.rows.length)throw new Error("Doesn't support multi-dimensional table");this.columns.length||(this.container=this.createContainer(this.hot.rootElement.className));const r={col:e};this.columns.push(r),this.samples=n,this.table=this.createTable(this.hot.table.className),this.getSetting("useHeaders")&&this.hot.getColHeader(e)!==null&&this.hot.view.appendColHeader(e,this.table.th,void 0,-1),this.table.tBody.appendChild(this.createCol(e)),this.container.container.appendChild(this.table.fragment),r.table=this.table.table}getHeights(e){this.injected||this.injectTable(),M(this.rows,n=>{const{height:r}=n.table.getBoundingClientRect();e(n.row,Math.ceil(r))})}getWidths(e){this.injected||this.injectTable(),M(this.columns,n=>{const{width:r}=n.table.getBoundingClientRect();e(n.col,Math.ceil(r))})}setSettings(e){this.settings=e}setSetting(e,n){this.settings||(this.settings={}),this.settings[e]=n}getSettings(){return this.settings}getSetting(e){return this.settings?this.settings[e]:null}createColGroupsCol(e){const n=this.hot.rootDocument.createDocumentFragment();return this.hot.hasRowHeaders()&&n.appendChild(this.createColElement(-1,-1)),this.samples.forEach(r=>{M(r.strings,i=>{n.appendChild(this.createColElement(i.col,e))})}),n}createRow(e){const{rootDocument:n}=this.hot,r=n.createDocumentFragment(),i=n.createElement("th");return this.hot.hasRowHeaders()&&(this.hot.view.appendRowHeader(e,i),r.appendChild(i)),this.samples.forEach(o=>{M(o.strings,s=>{const a=s.col,l=this.hot.getCellMeta(e,a),u=this.hot.getCellRenderer(l),c=n.createElement("td");c.setAttribute("ghost-table",1),u(this.hot,c,e,a,this.hot.colToProp(a),s.value,l),r.appendChild(c)})}),r}appendColumnHeadersRow(){const{rootDocument:e}=this.hot,n=e.createDocumentFragment(),r=[];if(this.hot.hasRowHeaders()){const i=e.createElement("th");r.push([-1,i]),n.appendChild(i)}this.samples.forEach(i=>{M(i.strings,o=>{const s=o.col,a=e.createElement("th");r.push([s,a]),n.appendChild(a)})}),this.table.tHead.appendChild(n),M(r,i=>{const[o,s]=i;this.hot.view.appendColHeader(o,s)})}createCol(e){const{rootDocument:n}=this.hot,r=n.createDocumentFragment();return this.samples.forEach(i=>{M(i.strings,o=>{const s=o.row,a=this.hot.getCellMeta(s,e),l=this.hot.getCellRenderer(a),u=n.createElement("td"),c=n.createElement("tr");u.setAttribute("ghost-table",1),l(this.hot,u,s,e,this.hot.colToProp(e),o.value,a),c.appendChild(u),r.appendChild(c)})}),r}clean(){this.rows.length=0,this.rows[-1]=void 0,this.columns.length=0,this.samples&&this.samples.clear(),this.samples=null,this.removeTable()}injectTable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;this.injected||((e||this.hot.rootElement).appendChild(this.container.fragment),this.injected=!0)}removeTable(){this.injected&&this.container.container.parentNode&&(this.container.container.parentNode.removeChild(this.container.container),this.container=null,this.injected=!1)}createColElement(e,n){const r=this.hot.rootDocument.createElement("col");let i=0;n>=0&&e>=0&&(i=this.hot.getCellMeta(n,e).colspan);let o=this.hot.getColWidth(e);if(i>1)for(let s=e+1;s<e+i;s++)o+=this.hot.getColWidth(s);return r.style.width=`${o}px`,r}createTable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";const{rootDocument:n}=this.hot,r=n.createDocumentFragment(),i=n.createElement("table"),o=n.createElement("thead"),s=n.createElement("tbody"),a=n.createElement("colgroup"),l=n.createElement("tr"),u=n.createElement("th");return this.isVertical()&&i.appendChild(a),this.isHorizontal()&&(l.appendChild(u),o.appendChild(l),i.style.tableLayout="auto",i.style.width="auto"),i.appendChild(o),this.isVertical()&&s.appendChild(l),i.appendChild(s),G(i,e),r.appendChild(i),{fragment:r,table:i,tHead:o,tBody:s,colGroup:a,tr:l,th:u}}createContainer(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";const{rootDocument:n}=this.hot,r=n.createDocumentFragment(),i=n.createElement("div"),o=`htGhostTable htAutoSize ${e.trim()}`;return G(i,o),r.appendChild(i),{fragment:r,container:i}}isVertical(){return!!(this.rows.length&&!this.columns.length)}isHorizontal(){return!!(this.columns.length&&!this.rows.length)}};function Sf(t,e,n){return(e=s8(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function s8(t){var e=a8(t,"string");return typeof e=="symbol"?e:e+""}function a8(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class yp{static get SAMPLE_COUNT(){return 3}constructor(e){Sf(this,"samples",null),Sf(this,"dataFactory",null),Sf(this,"customSampleCount",null),Sf(this,"allowDuplicates",!1),this.dataFactory=e}getSampleCount(){return this.customSampleCount?this.customSampleCount:yp.SAMPLE_COUNT}setSampleCount(e){this.customSampleCount=e}setAllowDuplicates(e){this.allowDuplicates=e}generateRowSamples(e,n){return this.generateSamples("row",n,e)}generateColumnSamples(e,n){return this.generateSamples("col",n,e)}generateSamples(e,n,r){const i=new Map,{from:o,to:s}=typeof r=="number"?{from:r,to:r}:r;return de(o,s,a=>{const l=this.generateSample(e,n,a);i.set(a,l)}),i}generateSample(e,n,r){if(e!=="row"&&e!=="col")throw new Error("Unsupported sample type");const i=new Map,o=e==="row"?"col":"row",s=[];return de(n.from,n.to,a=>{const l=e==="row"?this.dataFactory(r,a):this.dataFactory(a,r);if(l===!1)return;const{value:u,bundleSeed:c}=l,h=typeof c=="string"&&c.length>0;let d;h?d=c:Ae(u)?d=`${Object.keys(u).length}`:Array.isArray(u)?d=`${u.length}`:d=`${Pt(u).length}`,i.has(d)||i.set(d,{needed:this.getSampleCount(),strings:[]});const f=i.get(d);f.needed&&(!(s.indexOf(u)>-1)||this.allowDuplicates||h)&&(f.strings.push({value:u,[o]:a}),s.push(u),f.needed-=1)}),i}}function l8(t,e){Pk(t,e),e.add(t)}function Cy(t,e,n){Pk(t,e),e.set(t,n)}function Pk(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Oc(t,e,n){return(e=u8(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function u8(t){var e=c8(t,"string");return typeof e=="symbol"?e:e+""}function c8(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ls(t,e){return t.get(lr(t,e))}function am(t,e,n){return t.set(lr(t,e),n),n}function lr(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}re.getSingleton().register("modifyAutoColumnSizeSeed");const yy="autoColumnSize",h8=10,d8="autoColumnSize";var Z0=new WeakMap,du=new WeakMap,Fu=new WeakMap,br=new WeakSet;class Sh extends Xe{static get PLUGIN_KEY(){return yy}static get PLUGIN_PRIORITY(){return h8}static get SETTING_KEYS(){return!0}static get DEFAULT_SETTINGS(){return{useHeaders:!0,samplingRatio:null,allowSampleDuplicates:!1}}static get CALCULATION_STEP(){return 50}static get SYNC_CALCULATION_LIMIT(){return 50}constructor(e){super(e),l8(this,br),Oc(this,"ghostTable",new Ik(this.hot)),Oc(this,"samplesGenerator",new yp((n,r)=>{const i=this.hot.toPhysicalRow(n),o=this.hot.toPhysicalColumn(r);if(this.hot.rowIndexMapper.isHidden(i)||this.hot.columnIndexMapper.isHidden(o))return!1;const s=this.hot.getCellMeta(n,r);let a="";s.spanned||(a=this.hot.getDataAtCell(n,r));let l="";return this.hot.hasHook("modifyAutoColumnSizeSeed")&&(l=this.hot.runHooks("modifyAutoColumnSizeSeed",l,s,a)),{value:a,bundleSeed:l}})),Oc(this,"inProgress",!1),Oc(this,"measuredColumns",0),Oc(this,"columnWidthsMap",new Zs),Cy(this,Z0,!1),Cy(this,du,[]),Cy(this,Fu,[]),this.hot.columnIndexMapper.registerMap(d8,this.columnWidthsMap),this.addHook("beforeColumnResize",(n,r,i)=>lr(br,this,Yx).call(this,n,r,i))}isEnabled(){return this.hot.getSettings()[yy]!==!1&&!this.hot.getSettings().colWidths}enablePlugin(){var e=this;if(this.enabled)return;this.ghostTable.setSetting("useHeaders",this.getSetting("useHeaders")),this.samplesGenerator.setAllowDuplicates(this.getSetting("allowSampleDuplicates"));const n=this.getSetting("samplingRatio");n&&!isNaN(n)&&this.samplesGenerator.setSampleCount(parseInt(n,10)),this.addHook("afterLoadData",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return lr(br,e,m8).call(e,...i)}),this.addHook("beforeChangeRender",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return lr(br,e,p8).call(e,...i)}),this.addHook("afterFormulasValuesUpdate",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return lr(br,e,v8).call(e,...i)}),this.addHook("beforeRender",()=>lr(br,this,g8).call(this)),this.addHook("modifyColWidth",(r,i)=>this.getColumnWidth(i,r)),this.addHook("init",()=>lr(br,this,w8).call(this)),super.enablePlugin()}updatePlugin(){am(Fu,this,this.findColumnsWhereHeaderWasChanged()),super.updatePlugin()}disablePlugin(){super.disablePlugin(),this.addHook("beforeColumnResize",(e,n,r)=>lr(br,this,Yx).call(this,e,n,r))}calculateVisibleColumnsWidth(){if(!this.hot.countRows())return;const e=this.getFirstVisibleColumn(),n=this.getLastVisibleColumn();if(e===-1||n===-1)return;const r=this.hot.forceFullRender;this.calculateColumnsWidth({from:e,to:n},void 0,r)}calculateColumnsWidth(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{from:0,to:this.hot.countCols()-1},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{from:0,to:this.hot.countRows()-1},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=typeof e=="number"?{from:e,to:e}:e,o=typeof n=="number"?{from:n,to:n}:n;de(i.from,i.to,s=>{let a=this.hot.toPhysicalColumn(s);a===null&&(a=s),(r||this.columnWidthsMap.getValueAtIndex(a)===null&&!this.hot._getColWidthFromSettings(a))&&lr(br,this,Ok).call(this,s,o)}),this.ghostTable.columns.length&&(lr(br,this,xk).call(this),this.measuredColumns=i.to+1,this.ghostTable.clean())}calculateAllColumnsWidth(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{from:0,to:this.hot.countRows()-1},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=0;const i=this.hot.countCols()-1;let o=null;this.inProgress=!0;const s=()=>{if(!this.hot){Zg(o),this.inProgress=!1;return}this.calculateColumnsWidth({from:r,to:Math.min(r+Sh.CALCULATION_STEP,i)},e,n),r=r+Sh.CALCULATION_STEP+1,r<i?o=Xg(s):(Zg(o),this.inProgress=!1,this.hot.view.adjustElementsSize())},a=this.getSyncCalculationLimit();a>=0&&(this.calculateColumnsWidth({from:0,to:a},e,n),r=a+1),r<i?s():this.inProgress=!1}recalculateAllColumnsWidth(){this.hot.view.isVisible()&&this.calculateAllColumnsWidth({from:0,to:this.hot.countRows()-1},!0)}getSyncCalculationLimit(){const e=this.hot.getSettings()[yy];let n=Sh.SYNC_CALCULATION_LIMIT;const r=this.hot.countCols()-1;return Ae(e)&&(n=e.syncLimit,pN(n)?n=KN(r,n):n>>=0),Math.min(n,r)}getColumnWidth(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=n;return i===void 0&&(i=this.columnWidthsMap.getValueAtIndex(this.hot.toPhysicalColumn(e)),r&&typeof i=="number"&&(i=Math.max(i,Hu))),i}getFirstVisibleColumn(){var e;return(e=this.hot.getFirstRenderedVisibleColumn())!==null&&e!==void 0?e:-1}getLastVisibleColumn(){var e;return(e=this.hot.getLastRenderedVisibleColumn())!==null&&e!==void 0?e:-1}findColumnsWhereHeaderWasChanged(){return this.hot.getColHeader().reduce((r,i,o)=>{const s=Ls(du,this).length;return(s-1<o||Ls(du,this)[o]!==i)&&r.push(this.hot.toVisualColumn(o)),s-1<o?Ls(du,this).push(i):Ls(du,this)[o]=i,r},[])}clearCache(e){Array.isArray(e)?this.hot.batchExecution(()=>{e.forEach(n=>{this.columnWidthsMap.setValueAtIndex(n,null)})},!0):this.columnWidthsMap.clear()}isNeedRecalculate(){return!!this.columnWidthsMap.getValues().slice(0,this.measuredColumns).filter(e=>e===null).length}destroy(){this.ghostTable.clean(),super.destroy()}}function f8(t){const e={from:0,to:this.hot.countRows()-1};t.forEach(n=>{const r=this.hot.toPhysicalColumn(n);r!==null&&(this.hot._getColWidthFromSettings(r)||lr(br,this,Ok).call(this,n,e))}),this.ghostTable.columns.length&&(lr(br,this,xk).call(this),this.ghostTable.clean())}function Ok(t,e){this.samplesGenerator.generateColumnSamples(t,e).forEach((r,i)=>this.ghostTable.addColumn(i,r))}function xk(){this.hot.batchExecution(()=>{this.ghostTable.getWidths((t,e)=>{const n=this.hot.toPhysicalColumn(t);this.columnWidthsMap.setValueAtIndex(n,e)})},!0)}function g8(){this.calculateVisibleColumnsWidth(),this.inProgress||(lr(br,this,f8).call(this,Ls(Fu,this)),am(Fu,this,[]))}function m8(t,e){e||this.recalculateAllColumnsWidth()}function p8(t){const e=t.reduce((n,r)=>{let[,i]=r;const o=this.hot.propToCol(i);return Number.isInteger(o)&&n.indexOf(o)===-1&&n.push(o),n},[]);Ls(Fu,this).push(...e)}function Yx(t,e,n){let r=t;return n&&(this.calculateColumnsWidth(e,void 0,!0),r=this.getColumnWidth(e,void 0,!1)),r}function w8(){am(du,this,this.hot.getColHeader()),this.recalculateAllColumnsWidth(),am(Z0,this,!0)}function v8(t){if(!Ls(Z0,this))return;const e=t.reduce((n,r)=>{var i;const o=(i=r.address)===null||i===void 0?void 0:i.col;if(Number.isInteger(o)){const s=this.hot.toVisualColumn(o);n.indexOf(s)===-1&&n.push(s)}return n},[]);Ls(Fu,this).push(...e)}const Ka={horizontal:"horizontal",vertical:"vertical"};function C8(t,e,n){let r,i,o;return e[0]===t[0]&&e[1]<t[1]?(o="left",r=n(e[0],e[1]),i=n(e[2],t[1]-1)):e[2]===t[2]&&e[0]===t[0]&&e[3]>t[3]?(o="right",r=n(e[0],t[3]+1),i=n(e[2],e[3])):e[0]<t[0]&&e[1]===t[1]?(o="up",r=n(e[0],e[1]),i=n(t[0]-1,e[3])):e[2]>t[2]&&e[1]===t[1]&&(o="down",r=n(t[2]+1,e[1]),i=n(e[2],e[3])),r&&r.normalize(),i&&i.normalize(),{directionOfDrag:o,startOfDragCoords:r,endOfDragCoords:i}}function y8(t){const e={};return t===!0?(e.directions=Object.keys(Ka),e.autoInsertRow=!0):Ae(t)?(ae(t.autoInsertRow)?t.direction===Ka.horizontal?e.autoInsertRow=!1:e.autoInsertRow=t.autoInsertRow:e.autoInsertRow=!1,ae(t.direction)?e.directions=[t.direction]:e.directions=Object.keys(Ka)):typeof t=="string"?(e.directions=[t],e.autoInsertRow=!0):(e.directions=[],e.autoInsertRow=!1),e}function b8(t,e){S8(t,e),e.add(t)}function S8(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function $l(t,e,n){return(e=R8(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function R8(t){var e=E8(t,"string");return typeof e=="symbol"?e:e+""}function E8(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function xc(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}re.getSingleton().register("modifyAutofillRange");re.getSingleton().register("beforeAutofill");re.getSingleton().register("afterAutofill");const Gx="autofill",T8=20,_8=["fillHandle"],M8="insert_row_below",I8=200;var Fl=new WeakSet;class P8 extends Xe{constructor(){super(...arguments),b8(this,Fl),$l(this,"addingStarted",!1),$l(this,"mouseDownOnCellCorner",!1),$l(this,"mouseDragOutside",!1),$l(this,"handleDraggedCells",0),$l(this,"directions",[]),$l(this,"autoInsertRow",!1)}static get PLUGIN_KEY(){return Gx}static get PLUGIN_PRIORITY(){return T8}static get SETTING_KEYS(){return[Gx,..._8]}isEnabled(){return this.hot.getSettings().fillHandle}enablePlugin(){this.enabled||(this.mapSettings(),this.registerEvents(),this.addHook("afterOnCellCornerMouseDown",e=>xc(Fl,this,x8).call(this,e)),this.addHook("afterOnCellCornerDblClick",e=>xc(Fl,this,O8).call(this,e)),this.addHook("beforeOnCellMouseOver",(e,n)=>xc(Fl,this,A8).call(this,n)),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.clearMappedSettings(),super.disablePlugin()}getSelectionData(){const e=this.hot.getSelectedRangeLast(),{row:n,col:r}=e.getTopStartCorner(),{row:i,col:o}=e.getBottomEndCorner(),s=this.hot.runHooks("modifyCopyableRange",[{startRow:n,startCol:r,endRow:i,endCol:o}]),a=[],l=[],u=[];return M(s,c=>{for(let h=c.startRow;h<=c.endRow;h+=1)a.indexOf(h)===-1&&a.push(h);for(let h=c.startCol;h<=c.endCol;h+=1)l.indexOf(h)===-1&&l.push(h)}),M(a,c=>{const h=[];M(l,d=>{h.push(this.hot.getCopyableData(c,d))}),u.push(h)}),u}fillIn(){if(this.hot.selection.highlight.getFill().isEmpty())return!1;const[e,n,r,i]=this.hot.selection.highlight.getFill().getVisualCorners(),o=this.hot.getSelectedRangeLast(),s=o.getTopStartCorner(),a=o.getBottomEndCorner();this.resetSelectionOfDraggedArea();const l=[s.row,s.col,a.row,a.col],u=this.hot.runHooks("modifyAutofillRange",[Math.min(s.row,e),Math.min(s.col,n),Math.max(a.row,r),Math.max(a.col,i)],l),{directionOfDrag:c,startOfDragCoords:h,endOfDragCoords:d}=C8(l,u,(f,g)=>this.hot._createCellCoords(f,g));if(h&&h.row>-1&&h.col>-1){const f=this.getSelectionData(),g=o.clone(),C=this.hot._createCellRange(h,h,d),y=this.hot.runHooks("beforeAutofill",f,g,C,c);if(y===!1)return this.hot.selection.highlight.getFill().clear(),this.hot.render(),!1;let E=y;const v=y;if(["up","left"].indexOf(c)>-1&&!(v.length===1&&v[0].length===0))if(E=[],c==="up"){const P=d.row-h.row+1,O=P%v.length;for(let L=0;L<P;L++)E.push(v[(L+(v.length-O))%v.length])}else{const P=d.col-h.col+1,O=P%v[0].length;for(let L=0;L<v.length;L++){E.push([]);for(let T=0;T<P;T++)E[L].push(v[L][(T+(v[L].length-O))%v[L].length])}}this.hot.populateFromArray(h.row,h.col,E,d.row,d.col,`${this.pluginName}.fill`,null),this.setSelection(u),this.hot.runHooks("afterAutofill",E,g,C,c),this.hot.render()}else this.hot.view.render();return!0}reduceSelectionAreaIfNeeded(e){return e.row<0&&(e.row=0),e.col<0&&(e.col=0),e}getCoordsOfDragAndDropBorders(e){const n=this.hot.getSelectedRangeLast(),r=n.getBottomEndCorner();let i=e;if(this.directions.includes(Ka.vertical)&&this.directions.includes(Ka.horizontal)){const o=n.getTopStartCorner();(r.col<=e.col||o.col>=e.col)&&(i=this.hot._createCellCoords(r.row,e.col)),(r.row<e.row||o.row>e.row)&&(i=this.hot._createCellCoords(e.row,r.col))}else if(this.directions.includes(Ka.vertical))i=this.hot._createCellCoords(e.row,r.col);else if(this.directions.includes(Ka.horizontal))i=this.hot._createCellCoords(r.row,e.col);else return;return this.reduceSelectionAreaIfNeeded(i)}showBorder(e){const n=this.getCoordsOfDragAndDropBorders(e);n&&this.redrawBorders(n)}addRow(){this.hot._registerTimeout(()=>{this.hot.alter(M8,void 0,1,`${this.pluginName}.fill`),this.addingStarted=!1},I8)}addNewRowIfNeeded(){if(!this.hot.selection.highlight.getFill().isEmpty()&&this.addingStarted===!1&&this.autoInsertRow){const e=this.hot.getSelectedLast(),n=this.hot.selection.highlight.getFill().getVisualCorners(),r=this.hot.countRows();e[2]<r-1&&n[2]===r-1&&(this.addingStarted=!0,this.addRow())}}getIndexOfLastAdjacentFilledInRow(e){const n=this.hot.getData(),r=this.hot.countRows();let i;for(let o=e[2]+1;o<r;o++){for(let l=e[1];l<=e[3];l++){const u=n[o][l];if(!Ut(u))return-1}const s=n[o][e[1]-1],a=n[o][e[3]+1];(!Ut(s)||!Ut(a))&&(i=o)}return i}addSelectionFromStartAreaToSpecificRowIndex(e,n){this.hot.selection.highlight.getFill().clear().add(this.hot._createCellCoords(e[0],e[1])).add(this.hot._createCellCoords(n,e[3])).commit()}setSelection(e){this.hot.selectCell(...Be(e,n=>Math.max(n,0)),!1,!1)}selectAdjacent(){const e=this.hot.getSelectedLast(),n=this.getIndexOfLastAdjacentFilledInRow(e);return n===-1||n===void 0?!1:(this.addSelectionFromStartAreaToSpecificRowIndex(e,n),!0)}resetSelectionOfDraggedArea(){this.handleDraggedCells=0,this.hot.selection.highlight.getFill().clear()}redrawBorders(e){this.hot.selection.highlight.getFill().clear().add(this.hot.getSelectedRangeLast().from).add(this.hot.getSelectedRangeLast().to).add(e).commit(),this.hot.view.render()}getIfMouseWasDraggedOutside(e){const{documentElement:n}=this.hot.rootDocument,r=An(this.hot.table).top-(this.hot.rootWindow.pageYOffset||n.scrollTop)+nn(this.hot.table),i=An(this.hot.table).left-(this.hot.rootWindow.pageXOffset||n.scrollLeft)+qt(this.hot.table);return e.clientY>r&&e.clientX<=i}registerEvents(){const{documentElement:e}=this.hot.rootDocument;this.eventManager.addEventListener(e,"mouseup",()=>xc(Fl,this,H8).call(this)),this.eventManager.addEventListener(e,"mousemove",n=>xc(Fl,this,N8).call(this,n))}clearMappedSettings(){this.directions.length=0,this.autoInsertRow=!1}mapSettings(){const e=y8(this.hot.getSettings().fillHandle);this.directions=e.directions,this.autoInsertRow=e.autoInsertRow}destroy(){super.destroy()}}function O8(){this.selectAdjacent()&&this.fillIn()}function x8(){this.handleDraggedCells=1,this.mouseDownOnCellCorner=!0}function A8(t){this.mouseDownOnCellCorner&&!this.hot.view.isMouseDown()&&this.handleDraggedCells&&(this.handleDraggedCells+=1,this.showBorder(t),this.addNewRowIfNeeded())}function H8(){this.handleDraggedCells&&(this.handleDraggedCells>1&&this.fillIn(),this.handleDraggedCells=0,this.mouseDownOnCellCorner=!1)}function N8(t){const e=this.getIfMouseWasDraggedOutside(t);this.addingStarted===!1&&this.handleDraggedCells>0&&e?(this.mouseDragOutside=!0,this.addingStarted=!0):this.mouseDragOutside=!1,this.mouseDragOutside&&this.autoInsertRow&&this.addRow()}function D8(t,e){Ak(t,e),e.add(t)}function qx(t,e,n){Ak(t,e),e.set(t,n)}function Ak(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Vl(t,e,n){return(e=k8(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function k8(t){var e=L8(t,"string");return typeof e=="symbol"?e:e+""}function L8(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Hk(t,e,n){return t.set(to(t,e),n),n}function lm(t,e){return t.get(to(t,e))}function to(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const by="autoRowSize",$8=40,F8="autoRowSize";var Xh=new WeakMap,Q0=new WeakMap,Ao=new WeakSet;class Rh extends Xe{static get PLUGIN_KEY(){return by}static get PLUGIN_PRIORITY(){return $8}static get SETTING_KEYS(){return!0}static get DEFAULT_SETTINGS(){return{useHeaders:!0,samplingRatio:null,allowSampleDuplicates:!1}}static get CALCULATION_STEP(){return 50}static get SYNC_CALCULATION_LIMIT(){return 500}constructor(e){super(e),D8(this,Ao),Vl(this,"headerHeight",null),Vl(this,"ghostTable",new Ik(this.hot)),Vl(this,"samplesGenerator",new yp((n,r)=>{const i=this.hot.toPhysicalRow(n),o=this.hot.toPhysicalColumn(r);if(this.hot.rowIndexMapper.isHidden(i)||this.hot.columnIndexMapper.isHidden(o)||n>=0&&r>=0&&this.hot.getCellMeta(n,r).hidden)return!1;let s;return n>=0?s=this.hot.getDataAtCell(n,r):n===-1&&(s=this.hot.getColHeader(r)),{value:s}})),Vl(this,"inProgress",!1),Vl(this,"measuredRows",0),Vl(this,"rowHeightsMap",new Zs),qx(this,Xh,[]),qx(this,Q0,!1),this.hot.rowIndexMapper.registerMap(F8,this.rowHeightsMap),this.addHook("beforeRowResize",(n,r,i)=>to(Ao,this,Kx).call(this,n,r,i))}isEnabled(){const e=this.hot.getSettings()[by];return e===!0||Ae(e)}enablePlugin(){var e=this;if(this.enabled)return;this.samplesGenerator.setAllowDuplicates(this.getSetting("allowSampleDuplicates"));const n=this.getSetting("samplingRatio");n&&!isNaN(n)&&this.samplesGenerator.setSampleCount(parseInt(n,10)),this.addHook("afterLoadData",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return to(Ao,e,B8).call(e,...i)}),this.addHook("beforeChangeRender",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return to(Ao,e,j8).call(e,...i)}),this.addHook("beforeColumnResize",()=>this.recalculateAllRowsHeight()),this.addHook("afterFormulasValuesUpdate",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return to(Ao,e,z8).call(e,...i)}),this.addHook("beforeRender",()=>to(Ao,this,W8).call(this)),this.addHook("modifyRowHeight",(r,i)=>this.getRowHeight(i,r)),this.addHook("init",()=>to(Ao,this,U8).call(this)),this.addHook("modifyColumnHeaderHeight",()=>this.getColumnHeaderHeight()),super.enablePlugin()}disablePlugin(){this.headerHeight=null,super.disablePlugin(),this.addHook("beforeRowResize",(e,n,r)=>to(Ao,this,Kx).call(this,e,n,r))}calculateVisibleRowsHeight(){if(!this.hot.countCols())return;const e=this.getFirstVisibleRow(),n=this.getLastVisibleRow();if(e===-1||n===-1)return;const r=this.hot.forceFullRender;this.calculateRowsHeight({from:e,to:n},void 0,r)}calculateRowsHeight(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{from:0,to:this.hot.countRows()-1},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{from:0,to:this.hot.countCols()-1},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=typeof e=="number"?{from:e,to:e}:e,o=typeof n=="number"?{from:n,to:n}:n;if(this.hot.getColHeader(0)!==null){const s=this.samplesGenerator.generateRowSamples(-1,o);this.ghostTable.addColumnHeadersRow(s.get(-1))}de(i.from,i.to,s=>{let a=this.hot.toPhysicalRow(s);a===null&&(a=s),(r||this.rowHeightsMap.getValueAtIndex(a)===null)&&this.samplesGenerator.generateRowSamples(s,o).forEach((u,c)=>this.ghostTable.addRow(c,u))}),this.ghostTable.rows.length&&(this.hot.batchExecution(()=>{this.ghostTable.getHeights((s,a)=>{s<0?this.headerHeight=a:this.rowHeightsMap.setValueAtIndex(this.hot.toPhysicalRow(s),a)})},!0),this.measuredRows=i.to+1,this.ghostTable.clean())}calculateAllRowsHeight(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{from:0,to:this.hot.countCols()-1},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=0;const i=this.hot.countRows()-1;let o=null;this.inProgress=!0;const s=()=>{if(!this.hot){Zg(o),this.inProgress=!1;return}this.calculateRowsHeight({from:r,to:Math.min(r+Rh.CALCULATION_STEP,i)},e,n),r=r+Rh.CALCULATION_STEP+1,r<i?o=Xg(s):(Zg(o),this.inProgress=!1,this.hot.view.adjustElementsSize())},a=this.getSyncCalculationLimit();a>=0&&(this.calculateRowsHeight({from:0,to:a},e,n),r=a+1),r<i?s():(this.inProgress=!1,this.hot.view.adjustElementsSize())}recalculateAllRowsHeight(){this.hot.view.isVisible()&&this.calculateAllRowsHeight({from:0,to:this.hot.countCols()-1},!0)}getSyncCalculationLimit(){const e=this.hot.getSettings()[by];let n=Rh.SYNC_CALCULATION_LIMIT;const r=this.hot.countRows()-1;return Ae(e)&&(n=e.syncLimit,pN(n)?n=KN(r,n):n>>=0),Math.min(n,r)}getRowHeight(e,n){const r=e<0?this.headerHeight:this.rowHeightsMap.getValueAtIndex(this.hot.toPhysicalRow(e));let i=n;return r!==null&&r>(n||0)&&(i=r),i}getColumnHeaderHeight(){return this.headerHeight}getFirstVisibleRow(){var e;return(e=this.hot.getFirstRenderedVisibleRow())!==null&&e!==void 0?e:-1}getLastVisibleRow(){var e;return(e=this.hot.getLastRenderedVisibleRow())!==null&&e!==void 0?e:-1}clearCache(e){this.headerHeight=null,Array.isArray(e)?this.hot.batchExecution(()=>{e.forEach(n=>{this.rowHeightsMap.setValueAtIndex(n,null)})},!0):this.rowHeightsMap.clear()}clearCacheByRange(e){const{from:n,to:r}=typeof e=="number"?{from:e,to:e}:e;this.hot.batchExecution(()=>{de(Math.min(n,r),Math.max(n,r),i=>{this.rowHeightsMap.setValueAtIndex(i,null)})},!0)}isNeedRecalculate(){return!!this.rowHeightsMap.getValues().slice(0,this.measuredRows).filter(e=>e===null).length}destroy(){this.ghostTable.clean(),super.destroy()}}function V8(t){const e={from:0,to:this.hot.countCols()-1};t.forEach(n=>{this.samplesGenerator.generateRowSamples(n,e).forEach((i,o)=>this.ghostTable.addRow(o,i))}),this.ghostTable.rows.length&&(this.hot.batchExecution(()=>{this.ghostTable.getHeights((n,r)=>{const i=this.hot.toPhysicalRow(n);this.rowHeightsMap.setValueAtIndex(i,r)})},!0),this.ghostTable.clean())}function W8(){this.calculateVisibleRowsHeight(),this.inProgress||(to(Ao,this,V8).call(this,lm(Xh,this)),Hk(Xh,this,[]))}function Kx(t,e,n){let r=t;return n&&(this.calculateRowsHeight(e,void 0,!0),r=this.getRowHeight(e)),r}function B8(t,e){e||this.recalculateAllRowsHeight()}function j8(t){const e=t.reduce((n,r)=>{let[i]=r;return n.indexOf(i)===-1&&n.push(i),n},[]);lm(Xh,this).push(...e)}function U8(){this.recalculateAllRowsHeight(),Hk(Q0,this,!0)}function z8(t){if(!lm(Q0,this))return;const e=t.reduce((n,r)=>{var i;const o=(i=r.address)===null||i===void 0?void 0:i.row;if(Number.isInteger(o)){const s=this.hot.toVisualRow(o);n.indexOf(s)===-1&&n.push(s)}return n},[]);lm(Xh,this).push(...e)}const{getListWithInsertedItems:Y8,getListWithRemovedItems:G8}=RD("physicallyIndexed");class q8 extends bl{constructor(){super(e=>e)}insert(e,n){const r=oE(this.indexedValues,n);this.indexedValues=Y8(r,e,n,this.initValueOrFn),super.insert(e,n)}remove(e){const n=G8(this.indexedValues,e);this.indexedValues=iE(n,e),super.remove(e)}}const{getListWithInsertedItems:K8,getListWithRemovedItems:X8}=RD("physicallyIndexed");class Z8 extends bl{constructor(){super(e=>e)}insert(e,n){this.indexedValues=K8(this.indexedValues,e,n,(r,i)=>this.getNextValue(i)),super.insert(e,n)}remove(e){this.indexedValues=X8(this.indexedValues,e),super.remove(e)}getNextValue(e){return Math.max(...this.getValues())+1+e}}function Q8(t,e){J8(t,e),e.add(t)}function J8(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function e7(t,e,n){return(e=t7(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function t7(t){var e=n7(t,"string");return typeof e=="symbol"?e:e+""}function n7(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function r7(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const Xx="bindRowsWithHeaders",i7=210,o7="loose",Zx=new Map([["loose",q8],["strict",Z8]]);var Qx=new WeakSet;class s7 extends Xe{constructor(){super(...arguments),Q8(this,Qx),e7(this,"headerIndexes",null)}static get PLUGIN_KEY(){return Xx}static get PLUGIN_PRIORITY(){return i7}isEnabled(){return!!this.hot.getSettings()[Xx]}enablePlugin(){var e;if(this.enabled)return;const n=(e=Zx.get(this.getSetting()))!==null&&e!==void 0?e:Zx.get(o7);this.headerIndexes=this.hot.rowIndexMapper.registerMap("bindRowsWithHeaders",new n),this.addHook("modifyRowHeader",r=>r7(Qx,this,a7).call(this,r)),super.enablePlugin()}disablePlugin(){this.hot.rowIndexMapper.unregisterMap("bindRowsWithHeaders"),super.disablePlugin()}destroy(){super.destroy()}}function a7(t){return this.headerIndexes.getValueAtIndex(this.hot.toPhysicalRow(t))}function l7(t,e){Nk(t,e),e.add(t)}function u7(t,e,n){Nk(t,e),e.set(t,n)}function Nk(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Jx(t,e,n){return(e=c7(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function c7(t){var e=h7(t,"string");return typeof e=="symbol"?e:e+""}function h7(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function eA(t,e){return t.get(Cu(t,e))}function Sy(t,e,n){return t.set(Cu(t,e),n),n}function Cu(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const Pg="collapsibleColumns",d7=290,f7=["nestedHeaders"],Iu="collapsibleIndicator",tA=Pg,nA=new Map([["collapse",{hideColumn:!0,beforeHook:"beforeColumnCollapse",afterHook:"afterColumnCollapse"}],["expand",{hideColumn:!1,beforeHook:"beforeColumnExpand",afterHook:"afterColumnExpand"}]]);var Wl=new WeakMap,Ac=new WeakSet;class g7 extends Xe{constructor(){super(...arguments),l7(this,Ac),Jx(this,"nestedHeadersPlugin",null),Jx(this,"headerStateManager",null),u7(this,Wl,null)}static get PLUGIN_KEY(){return Pg}static get PLUGIN_PRIORITY(){return d7}static get PLUGIN_DEPS(){return["plugin:NestedHeaders"]}static get SETTING_KEYS(){return[Pg,...f7]}isEnabled(){return!!this.hot.getSettings()[Pg]}enablePlugin(){var e=this;if(this.enabled)return;const{nestedHeaders:n}=this.hot.getSettings();n||Ze("You need to configure the Nested Headers plugin in order to use collapsible headers."),Sy(Wl,this,this.hot.columnIndexMapper.createAndRegisterIndexMap(this.pluginName,"hiding")),this.nestedHeadersPlugin=this.hot.getPlugin("nestedHeaders"),this.headerStateManager=this.nestedHeadersPlugin.getStateManager(),this.addHook("init",()=>Cu(Ac,this,w7).call(this)),this.addHook("afterLoadData",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Cu(Ac,e,v7).call(e,...i)}),this.addHook("afterGetColHeader",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Cu(Ac,e,m7).call(e,...i)}),this.addHook("beforeOnCellMouseDown",(r,i,o)=>Cu(Ac,this,p7).call(this,r,i,o)),this.registerShortcuts(),super.enablePlugin(),this.updatePlugin()}updatePlugin(){if(this.hot.view){if(!this.nestedHeadersPlugin.detectedOverlappedHeaders){const{collapsibleColumns:e}=this.hot.getSettings();typeof e=="boolean"?this.headerStateManager.mapState(n=>({collapsible:n.origColspan>1})):Array.isArray(e)&&(this.headerStateManager.mapState(()=>({collapsible:!1})),this.headerStateManager.mergeStateWith(e))}super.updatePlugin()}}disablePlugin(){this.hot.columnIndexMapper.unregisterMap(this.pluginName),Sy(Wl,this,null),this.nestedHeadersPlugin=null,this.unregisterShortcuts(),this.clearButtons(),super.disablePlugin()}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Enter"]],callback:()=>{var e;const{row:n,col:r}=this.hot.getSelectedRangeLast().highlight,{collapsible:i,isCollapsed:o,columnIndex:s}=(e=this.headerStateManager.getHeaderTreeNodeData(n,r))!==null&&e!==void 0?e:{};if(i)return o?this.expandSection({row:n,col:s}):this.collapseSection({row:n,col:s}),!1},runOnlyIf:()=>{var e,n;return((e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.isSingle())&&((n=this.hot.getSelectedRangeLast())===null||n===void 0?void 0:n.highlight.isHeader())},group:tA,relativeToGroup:Qs,position:"before"})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(tA)}clearButtons(){if(!this.hot.view)return;const e=this.hot.view._wt.getSetting("columnHeaders").length,n=this.hot.view._wt.wtTable.THEAD,r=this.hot.view._wt.wtOverlays.topOverlay.clone.wtTable.THEAD,i=this.hot.view._wt.wtOverlays.topInlineStartCornerOverlay?this.hot.view._wt.wtOverlays.topInlineStartCornerOverlay.clone.wtTable.THEAD:null,o=function(s){s&&s.parentNode.removeChild(s)};de(0,e-1,s=>{const a=n.childNodes[s],l=r.childNodes[s],u=i?i.childNodes[s]:null;de(0,a.childNodes.length-1,c=>{let h=a.childNodes[c].querySelector(`.${Iu}`);o(h),l&&l.childNodes[c]&&(h=l.childNodes[c].querySelector(`.${Iu}`),o(h)),i&&u&&u.childNodes[c]&&(h=u.childNodes[c].querySelector(`.${Iu}`),o(h))})})}expandSection(e){this.toggleCollapsibleSection([e],"expand")}collapseSection(e){this.toggleCollapsibleSection([e],"collapse")}toggleAllCollapsibleSections(e){const n=this.headerStateManager.mapNodes(r=>{const{collapsible:i,origColspan:o,headerLevel:s,columnIndex:a,isCollapsed:l}=r;if(i===!0&&o>1&&(l&&e==="expand"||!l&&e==="collapse"))return{row:this.headerStateManager.levelToRowCoords(s),col:a}});this.toggleCollapsibleSection(n,e)}collapseAll(){this.toggleAllCollapsibleSections("collapse")}expandAll(){this.toggleAllCollapsibleSections("expand")}toggleCollapsibleSection(e,n){if(!nA.has(n))throw new Error(`Unsupported action is passed (${n}).`);if(!Array.isArray(e))return;const r=rl(e,f=>{let{row:g}=f;return g<0});let i=r.length>0;M(r,f=>{var g;let{row:C,col:y}=f;const{collapsible:E,isCollapsed:v}=(g=this.headerStateManager.getHeaderSettings(C,y))!==null&&g!==void 0?g:{};if(!E||v&&n==="collapse"||!v&&n==="expand")return i=!1,!1});const o=[],s=[];i&&M(r,f=>{let{row:g,col:C}=f;const{colspanCompensation:y,affectedColumns:E,rollbackModification:v}=this.headerStateManager.triggerNodeModification(n,g,C);y>0&&(s.push(...E),o.push(v))});const a=this.getCollapsedColumns();let l=[];n==="collapse"?l=vU([...a,...s]):n==="expand"&&(l=rl(a,f=>!s.includes(f)));const u=nA.get(n);if(this.hot.runHooks(u.beforeHook,a,l,i)===!1){M(o,f=>{f()});return}this.hot.batchExecution(()=>{M(s,f=>{eA(Wl,this).setValueAtIndex(this.hot.toPhysicalColumn(f),u.hideColumn)})},!0);const h=this.getCollapsedColumns().length!==a.length,d=this.hot.getSelectedRangeLast();if(n==="collapse"&&h&&d){const{row:f,col:g}=d.highlight;if((this.hot.rowIndexMapper.isHidden(f)||this.hot.columnIndexMapper.isHidden(g))&&s.includes(g)){const y=f>=0?this.hot.rowIndexMapper.getNearestNotHiddenIndex(f,1,!0):f,E=g>=0?this.hot.columnIndexMapper.getNearestNotHiddenIndex(g,1,!0):g;y!==null&&E!==null&&this.hot.selectCell(y,E)}}this.hot.runHooks(u.afterHook,a,l,i,h),this.hot.render(),this.hot.view.adjustElementsSize()}getCollapsedColumns(){return eA(Wl,this).getHiddenIndexes()}destroy(){Sy(Wl,this,null),super.destroy()}}function m7(t,e,n){var r;const{collapsible:i,origColspan:o,isCollapsed:s}=(r=this.headerStateManager.getHeaderSettings(n,t))!==null&&r!==void 0?r:{},a=i&&o>1&&t>=this.hot.getSettings().fixedColumnsStart,l=this.hot.getSettings().ariaTags;let u=e.querySelector(`.${Iu}`);if(qu(e,[Gr("")[0]]),a)u||(u=this.hot.rootDocument.createElement("div"),G(u,Iu),e.querySelector("div:first-child").appendChild(u)),pe(u,["collapsed","expanded"]),s?(G(u,"collapsed"),ol(u,"+"),l&&ye(e,...Gr(!1))):(G(u,"expanded"),ol(u,"-"),l&&ye(e,...Gr(!0))),l&&ye(u,...yl());else{var c;(c=u)===null||c===void 0||c.remove()}}function p7(t,e){ve(t.target,Iu)&&(ve(t.target,"expanded")?(this.eventManager.fireEvent(t.target,"mouseup"),this.toggleCollapsibleSection([e],"collapse")):ve(t.target,"collapsed")&&(this.eventManager.fireEvent(t.target,"mouseup"),this.toggleCollapsibleSection([e],"expand")),Pi(t))}function w7(){this.updatePlugin()}function v7(t,e){e||this.updatePlugin()}function wa(t,e,n){return(e=C7(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function C7(t){var e=y7(t,"string");return typeof e=="symbol"?e:e+""}function y7(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const b7=["sortEmptyCells","indicator","headerAction","compareFunctionFactory"],S7=!1,R7=!0,E7=!0;class T7{constructor(e,n){wa(this,"hot",void 0),wa(this,"sortingStates",new hp),wa(this,"sortEmptyCells",S7),wa(this,"indicator",R7),wa(this,"headerAction",E7),wa(this,"compareFunctionFactory",void 0),wa(this,"mapName",void 0),this.hot=e,this.mapName=n,this.hot.columnIndexMapper.registerMap(n,this.sortingStates)}updateAllColumnsProperties(e){Ae(e)&&He(e,(n,r)=>{b7.includes(r)&&(this[r]=n)})}getAllColumnsProperties(){const e={sortEmptyCells:this.sortEmptyCells,indicator:this.indicator,headerAction:this.headerAction};return typeof this.compareFunctionFactory=="function"&&(e.compareFunctionFactory=this.compareFunctionFactory),e}getSortOrderOfColumn(e){var n;return(n=this.sortingStates.getValueAtIndex(this.hot.toPhysicalColumn(e)))===null||n===void 0?void 0:n.sortOrder}getIndexOfColumnInSortQueue(e){return e=this.hot.toPhysicalColumn(e),this.sortingStates.getEntries().findIndex(n=>{let[r]=n;return r===e})}getNumberOfSortedColumns(){return this.sortingStates.getLength()}isListOfSortedColumnsEmpty(){return this.getNumberOfSortedColumns()===0}isColumnSorted(e){return Ae(this.sortingStates.getValueAtIndex(this.hot.toPhysicalColumn(e)))}getSortStates(){return this.sortingStates===null?[]:this.sortingStates.getEntries().map(n=>{let[r,i]=n;return{column:this.hot.toVisualColumn(r),...i}})}getColumnSortState(e){const n=this.getSortOrderOfColumn(e);if(ae(n))return{column:e,sortOrder:n}}setSortStates(e){this.sortingStates.clear();for(let n=0;n<e.length;n+=1)this.sortingStates.setValueAtIndex(this.hot.toPhysicalColumn(e[n].column),{sortOrder:e[n].sortOrder})}destroy(){this.hot.columnIndexMapper.unregisterMap(this.mapName),this.sortingStates=null}}function Dk(t,e,n){const r=e.locale;return function(i,o){const{sortEmptyCells:s}=n;return typeof i=="string"&&(i=i.toLocaleLowerCase(r)),typeof o=="string"&&(o=o.toLocaleLowerCase(r)),i===o?ao:Ut(i)?Ut(o)?ao:s&&t==="asc"?kt:Lt:Ut(o)?s&&t==="asc"?Lt:kt:isNaN(i)&&!isNaN(o)?t==="asc"?Lt:kt:!isNaN(i)&&isNaN(o)||(isNaN(i)||isNaN(o)||(i=parseFloat(i),o=parseFloat(o)),i<o)?t==="asc"?kt:Lt:i>o?t==="asc"?Lt:kt:ao}}const kk="default";function _7(t,e,n){return function(r,i){const o=parseFloat(r),s=parseFloat(i),{sortEmptyCells:a}=n;if(o===s||isNaN(o)&&isNaN(s))return ao;if(a){if(Ut(r))return t==="asc"?kt:Lt;if(Ut(i))return t==="asc"?Lt:kt}return isNaN(o)?Lt:isNaN(s)?kt:o<s?t==="asc"?kt:Lt:o>s?t==="asc"?Lt:kt:ao}}const M7="numeric";function I7(t,e,n){const r=e.checkedTemplate,i=e.uncheckedTemplate,{sortEmptyCells:o}=n;return function(s,a){const l=Ut(s),u=Ut(a),c=l?i:s,h=u?i:a,d=c===i||c===r,f=h===i||h===r;if(o===!1){if(l&&u===!1)return Lt;if(l===!1&&u)return kt}return d===!1&&f?t==="asc"?kt:Lt:d&&f===!1?t==="asc"?Lt:kt:d===!1&&f===!1?Dk(t,e,n)(s,a):c===i&&h===r?t==="asc"?kt:Lt:c===r&&h===i?t==="asc"?Lt:kt:ao}}const P7="checkbox";function O7(t,e,n){return Bk(t,e.dateFormat,n)}const x7="date";function A7(t,e,n){return Bk(t,e.timeFormat,n)}const H7="time",{register:Md,getItem:rA,hasItem:N7}=Oi("sorting.compareFunctionFactory"),{register:Lk,getItem:D7}=Oi("sorting.mainSortComparator");function $k(t){return N7(t)?rA(t):rA(kk)}Md(P7,I7);Md(x7,O7);Md(kk,Dk);Md(M7,_7);Md(H7,A7);const ao=0,kt=-1,Lt=1;function k7(t,e){const n=D7(e);for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];t.sort(n(...i))}const um="asc",cm="desc",Fk="colHeader";function L7(t){if(Ae(t)===!1)return!1;const{column:e,sortOrder:n}=t;return Number.isInteger(e)&&[um,cm].includes(n)}function $7(t){if(t.some(n=>L7(n)===!1))return!1;const e=t.map(n=>{let{column:r}=n;return r});return new Set(e).size===e.length}function iA(t){if(t!==cm)return t===um?cm:um}function Vk(t){return t.querySelector(`.${Fk}`)}function Wk(t,e){if(t<0||!e.parentNode)return!1;const n=e.parentNode.parentNode.childNodes;return Array.from(n).indexOf(e.parentNode)-n.length===-1}function J0(t,e,n){return t===-1&&e>=0&&sl(n)===!1}function Bk(t,e,n){return function(r,i){const{sortEmptyCells:o}=n;if(r===i)return ao;if(Ut(r))return Ut(i)?ao:o&&t==="asc"?kt:Lt;if(Ut(i))return o&&t==="asc"?Lt:kt;const s=X(r,e),a=X(i,e);return s.isValid()?a.isValid()?a.isAfter(s)?t==="asc"?kt:Lt:a.isBefore(s)?t==="asc"?Lt:kt:ao:kt:Lt}}function F7(t,e){Ze(nt`Plugins \`columnSorting\` and \`multiColumnSorting\` should not be enabled simultaneously.\x20
|
|
253
|
+
Only \`${t}\` will work. The \`${e}\` plugin will remain disabled.`)}const V7="ascending",W7="descending",jk="indicatorDisabled",Uk="columnSorting",zk="sortAction",Yk=new Map([[um,V7],[cm,W7]]);function B7(t,e,n,r){const i=[Uk];if(r&&i.push(zk),n===!1)return i.push(jk),i;const o=t.getSortOrderOfColumn(e);return ae(o)&&i.push(Yk.get(o)),i}function j7(){return Array.from(Yk.values()).concat(zk,jk,Uk)}function U7(t,e){return function(n,r){const[,...i]=n,[,...o]=r;return function(a){const l=t[a],u=e[a],c=i[a],h=o[a],d=u.columnSorting;return(d.compareFunctionFactory?d.compareFunctionFactory:$k(u.type))(l,u,d)(c,h)}(0)}}function z7(t,e){Y7(t,e),e.add(t)}function Y7(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Rf(t,e,n){return(e=G7(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function G7(t){var e=q7(t,"string");return typeof e=="symbol"?e:e+""}function q7(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function fu(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const hm="columnSorting",K7=50,dm="append",X7="replace",oA=hm;Lk(hm,U7);re.getSingleton().register("beforeColumnSort");re.getSingleton().register("afterColumnSort");const Hc=new WeakMap;var ja=new WeakSet;class Gk extends Xe{constructor(){super(...arguments),z7(this,ja),Rf(this,"columnStatesManager",null),Rf(this,"columnMetaCache",null),Rf(this,"pluginKey",hm),Rf(this,"indexesSequenceCache",null)}static get PLUGIN_KEY(){return hm}static get PLUGIN_PRIORITY(){return K7}isEnabled(){return!!this.hot.getSettings()[this.pluginKey]}enablePlugin(){var e=this;if(Hc.has(this.hot)&&Hc.get(this.hot)!==this.pluginKey){this.hot.updateSettings({[this.pluginKey]:!1}),F7(Hc.get(this.hot),this.pluginKey);return}this.enabled||(Hc.set(this.hot,this.pluginKey),this.columnStatesManager=new T7(this.hot,`${this.pluginKey}.sortingStates`),this.columnMetaCache=new Zs(n=>{let r=this.hot.toVisualColumn(n);return r===null&&(r=n),this.getMergedPluginSettings(r)}),this.hot.columnIndexMapper.registerMap(`${this.pluginKey}.columnMeta`,this.columnMetaCache),this.addHook("afterGetColHeader",(n,r)=>fu(ja,this,Z7).call(this,n,r)),this.addHook("beforeOnCellMouseDown",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return fu(ja,e,J7).call(e,...r)}),this.addHook("afterOnCellMouseDown",(n,r)=>this.onAfterOnCellMouseDown(n,r)),this.addHook("afterInit",()=>fu(ja,this,wS).call(this)),this.addHook("afterLoadData",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return fu(ja,e,Q7).call(e,...r)}),this.hot.view&&fu(ja,this,wS).call(this),this.registerShortcuts(),super.enablePlugin())}disablePlugin(){const e=(n,r)=>{const i=Vk(r);Wk(n,r)===!1||i===null||this.updateHeaderClasses(i)};Hc.delete(this.hot),this.hot.addHook("afterGetColHeader",e),this.hot.addHookOnce("afterViewRender",()=>{this.hot.removeHook("afterGetColHeader",e)}),this.hot.batchExecution(()=>{this.indexesSequenceCache!==null&&(this.hot.rowIndexMapper.setIndexesSequence(this.indexesSequenceCache.getValues()),this.hot.rowIndexMapper.unregisterMap(this.pluginKey),this.indexesSequenceCache=null)},!0),this.hot.columnIndexMapper.unregisterMap(`${this.pluginKey}.columnMeta`),this.columnStatesManager.destroy(),this.columnMetaCache=null,this.columnStatesManager=null,this.unregisterShortcuts(),super.disablePlugin()}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Enter"]],callback:()=>{const{highlight:e}=this.hot.getSelectedRangeLast();return this.sort(this.getColumnNextConfig(e.col)),!1},runOnlyIf:()=>{var e,n;const r=(e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;return r&&((n=this.hot.getSelectedRangeLast())===null||n===void 0?void 0:n.isSingle())&&this.hot.selection.isCellVisible(r)&&r.row===-1&&r.col>=0},relativeToGroup:Qs,position:"before",group:oA})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(oA)}sort(e){const n=this.getSortConfig(),r=this.getNormalizedSortConfigs(e),i=this.areValidSortConfigs(r);this.hot.runHooks("beforeColumnSort",n,r,i)!==!1&&(n.length===0&&this.indexesSequenceCache===null&&(this.indexesSequenceCache=this.hot.rowIndexMapper.registerMap(this.pluginKey,new ED),this.indexesSequenceCache.setValues(this.hot.rowIndexMapper.getIndexesSequence())),i&&(this.columnStatesManager.setSortStates(r),this.sortByPresetSortStates(r),this.saveAllSortSettings(r)),this.hot.runHooks("afterColumnSort",n,i?r:n,i),i&&this.hot.render())}clearSort(){this.sort([])}isSorted(){return this.enabled&&!this.columnStatesManager.isListOfSortedColumnsEmpty()}getSortConfig(e){return ae(e)?this.columnStatesManager.getColumnSortState(e):this.columnStatesManager.getSortStates()}setSortConfig(e){const n=this.getNormalizedSortConfigs(e);this.areValidSortConfigs(n)&&this.columnStatesManager.setSortStates(n)}getNormalizedSortConfigs(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return Array.isArray(e)?e.slice(0,1):[e]}areValidSortConfigs(e){const n=this.hot.countCols();return $7(e)&&e.every(r=>{let{column:i}=r;return i<=n&&i>=0})}saveAllSortSettings(e){const n=this.columnStatesManager.getAllColumnsProperties(),r=i=>{let{column:o,...s}=i;return{column:this.hot.toPhysicalColumn(o),...s}};n.initialConfig=Be(e,r),this.hot.runHooks("persistentStateSave","columnSorting",n)}getAllSavedSortSettings(){const e={};this.hot.runHooks("persistentStateLoad","columnSorting",e);const n=e.value,r=i=>{let{column:o,...s}=i;return{column:this.hot.toVisualColumn(o),...s}};return ae(n)&&Array.isArray(n.initialConfig)&&(n.initialConfig=Be(n.initialConfig,r)),n}getColumnNextConfig(e){const n=this.columnStatesManager.getSortOrderOfColumn(e);if(ae(n)){const i=iA(n);return ae(i)?{column:e,sortOrder:i}:void 0}const r=this.hot.countCols();if(Number.isInteger(e)&&e>=0&&e<r)return{column:e,sortOrder:iA()}}getNextSortConfig(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:dm;const r=this.columnStatesManager.getIndexOfColumnInSortQueue(e),i=r!==-1,o=this.getSortConfig(),s=this.getColumnNextConfig(e);if(i){if(It(s))return[...o.slice(0,r),...o.slice(r+1)];if(n===dm)return[...o.slice(0,r),...o.slice(r+1),s];if(n===X7)return[...o.slice(0,r),s,...o.slice(r+1)]}return ae(s)?o.concat(s):o}getPluginColumnConfig(e){if(Ae(e)){const n=e[this.pluginKey];if(Ae(n))return n}return{}}getMergedPluginSettings(e){const n=this.hot.getSettings()[this.pluginKey],r=this.columnStatesManager.getAllColumnsProperties(),i=this.hot.getCellMeta(0,e),o=Object.getPrototypeOf(i);return Array.isArray(o.columns)?Object.assign(r,n,this.getPluginColumnConfig(o.columns[e])):ot(o.columns)?Object.assign(r,n,this.getPluginColumnConfig(o.columns(e))):Object.assign(r,n)}getFirstCellSettings(e){const n=this.hot.getCellMeta(0,e),r=Object.create(n);return r[this.pluginKey]=this.columnMetaCache.getValueAtIndex(this.hot.toPhysicalColumn(e)),r}getNumberOfRowsToSort(e){const n=this.hot.getSettings();return n.maxRows<=e?n.maxRows:e-n.minSpareRows}sortByPresetSortStates(e){if(this.hot.rowIndexMapper.setIndexesSequence(this.indexesSequenceCache.getValues()),e.length===0)return;const n=[],r=this.hot.countRows(),i=u=>Be(e,c=>this.hot.getDataAtCell(u,c.column));for(let u=0;u<this.getNumberOfRowsToSort(r);u+=1)n.push([this.hot.toPhysicalRow(u)].concat(i(u)));const o=Be(n,u=>u[0]);k7(n,this.pluginKey,Be(e,u=>u.sortOrder),Be(e,u=>this.getFirstCellSettings(u.column)));for(let u=n.length;u<r;u+=1)n.push([u].concat(i(u)));const s=Be(n,u=>u[0]),a=new Map(Be(o,(u,c)=>[u,s[c]])),l=Be(this.hot.rowIndexMapper.getIndexesSequence(),u=>a.has(u)?a.get(u):u);this.hot.rowIndexMapper.setIndexesSequence(l)}sortBySettings(e){if(Ae(e)){this.columnStatesManager.updateAllColumnsProperties(e);const n=e.initialConfig;(Array.isArray(n)||Ae(n))&&this.sort(n)}else this.hot.render()}updateHeaderClasses(e){if(pe(e,j7()),this.enabled!==!1){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];G(e,B7(...r))}}onUpdateSettings(e){super.onUpdateSettings(e),this.columnMetaCache!==null&&this.columnMetaCache.init(this.hot.columnIndexMapper.getNumberOfIndexes()),ae(e[this.pluginKey])&&this.sortBySettings(e[this.pluginKey])}wasClickableHeaderClicked(e,n){return this.getFirstCellSettings(n)[this.pluginKey].headerAction&&ve(e.target,Fk)}onAfterOnCellMouseDown(e,n){if(J0(n.row,n.col,e)!==!1&&this.wasClickableHeaderClicked(e,n.col)){this.hot.getShortcutManager().isCtrlPressed()&&(this.hot.deselectCell(),this.hot.selectColumns(n.col));const r=this.hot.getActiveEditor(),i=this.getColumnNextConfig(n.col);r!=null&&r.isOpened()&&this.hot.getCellValidator(r.row,r.col)?this.hot.addHookOnce("postAfterValidate",()=>{this.sort(i)}):this.sort(i)}}destroy(){var e;(e=this.columnStatesManager)===null||e===void 0||e.destroy(),super.destroy()}}function wS(){const t=this.getAllSavedSortSettings();if(Ae(t))this.sortBySettings(t);else{const e=this.hot.getSettings()[this.pluginKey];this.sortBySettings(e)}}function Z7(t,e){const n=Vk(e);if(Wk(t,e)===!1||n===null)return;const r=this.getFirstCellSettings(t)[this.pluginKey],i=r.indicator,o=r.headerAction;if(this.updateHeaderClasses(n,this.columnStatesManager,t,i,o),this.hot.getSettings().ariaTags){const s=this.columnStatesManager.getSortOrderOfColumn(t);ye(e,...FU(s?`${s}ending`:"none"))}}function Q7(t){t===!0&&this.hot.view&&fu(ja,this,wS).call(this)}function J7(t,e,n,r){J0(e.row,e.col,t)!==!1&&this.wasClickableHeaderClicked(t,e.col)&&this.hot.getShortcutManager().isCtrlPressed()&&(r.column=!0)}function va(t,e,n){return(e=e5(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function e5(t){var e=t5(t,"string");return typeof e=="symbol"?e:e+""}function t5(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class n5{constructor(e,n){va(this,"plugin",void 0),va(this,"hot",void 0),va(this,"endpoints",[]),va(this,"settings",void 0),va(this,"settingsType","array"),va(this,"currentEndpoint",null),va(this,"cellsToSetCache",[]),this.plugin=e,this.hot=this.plugin.hot,this.settings=n}initEndpoints(){this.endpoints=this.parseSettings(),this.refreshAllEndpoints()}getEndpoint(e){return this.settingsType==="function"?this.fillMissingEndpointData(this.settings)[e]:this.endpoints[e]}getAllEndpoints(){return this.settingsType==="function"?this.fillMissingEndpointData(this.settings):this.endpoints}fillMissingEndpointData(e){return this.parseSettings(e.call(this))}parseSettings(e){const n=[];let r=e;if(!r&&typeof this.settings=="function"){this.settingsType="function";return}return r||(r=this.settings),M(r,i=>{const o={};this.assignSetting(i,o,"ranges",[[0,this.hot.countRows()-1]]),this.assignSetting(i,o,"reversedRowCoords",!1),this.assignSetting(i,o,"destinationRow",new Error(`
|
|
254
|
+
You must provide a destination row for the Column Summary plugin in order to work properly!
|
|
255
|
+
`)),this.assignSetting(i,o,"destinationColumn",new Error(`
|
|
256
|
+
You must provide a destination column for the Column Summary plugin in order to work properly!
|
|
257
|
+
`)),this.assignSetting(i,o,"sourceColumn",i.destinationColumn),this.assignSetting(i,o,"type","sum"),this.assignSetting(i,o,"forceNumeric",!1),this.assignSetting(i,o,"suppressDataTypeErrors",!0),this.assignSetting(i,o,"customFunction",null),this.assignSetting(i,o,"readOnly",!0),this.assignSetting(i,o,"roundFloat",!1),n.push(o)}),n}assignSetting(e,n,r,i){if(r==="ranges"&&e[r]===void 0){n[r]=i;return}else if(r==="ranges"&&e[r].length===0)return;if(e[r]===void 0){if(i instanceof Error)throw i;n[r]=i}else r==="destinationRow"&&n.reversedRowCoords?n[r]=this.hot.countRows()-e[r]-1:n[r]=e[r]}resetSetupBeforeStructureAlteration(e,n,r){if(this.settingsType!=="function")return;const i=e.indexOf("row")>-1?"row":"col",o=this.getAllEndpoints();M(o,s=>{i==="row"&&s.destinationRow>=n&&(e==="insert_row"?s.alterRowOffset=r:e==="remove_row"&&(s.alterRowOffset=-1*r)),i==="col"&&s.destinationColumn>=n&&(e==="insert_col"?s.alterColumnOffset=r:e==="remove_col"&&(s.alterColumnOffset=-1*r))}),this.resetAllEndpoints(o,!1)}resetSetupAfterStructureAlteration(e,n,r,i,o){let s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;if(this.settingsType==="function"){const d=()=>(this.hot.removeHook("beforeViewRender",d),this.refreshAllEndpoints());this.hot.addHookOnce("beforeViewRender",d);return}const a=e.indexOf("row")>-1?"row":"col",l=e.indexOf("remove")>-1?-1:1,u=this.getAllEndpoints(),c=e.indexOf("move_row")===0,h=n;M(u,d=>{a==="row"&&d.destinationRow>=h&&(d.alterRowOffset=l*r),a==="col"&&d.destinationColumn>=h&&(d.alterColumnOffset=l*r)}),this.resetAllEndpoints(u,!c),c?M(u,d=>{this.extendEndpointRanges(d,h,i[0],i.length),this.recreatePhysicalRanges(d),this.clearOffsetInformation(d)}):M(u,d=>{this.shiftEndpointCoordinates(d,h)}),s&&this.refreshAllEndpoints()}clearOffsetInformation(e){e.alterRowOffset=void 0,e.alterColumnOffset=void 0}extendEndpointRanges(e,n,r,i){M(e.ranges,o=>{o[1]&&(n>=o[0]&&n<=o[1]?r>o[1]?o[1]+=i:r<o[0]&&(o[0]-=i):r>=o[0]&&r<=o[1]&&(o[1]-=i,n<=o[0]&&(o[0]+=1,o[1]+=1)))})}recreatePhysicalRanges(e){const n=e.ranges,r=[],i=[];M(n,o=>{const s=[];if(o[1])for(let a=o[0];a<=o[1];a++)s.push(this.hot.toPhysicalRow(a));else s.push(this.hot.toPhysicalRow(o[0]));i.push(s)}),M(i,o=>{let s=[];M(o,(a,l)=>{l===0?s.push(a):o[l]!==o[l-1]+1&&(s.push(o[l-1]),r.push(s),s=[],s.push(a)),l===o.length-1&&(s.push(a),r.push(s))})}),e.ranges=r}shiftEndpointCoordinates(e,n){e.alterRowOffset&&e.alterRowOffset!==0?(e.destinationRow+=e.alterRowOffset||0,M(e.ranges,r=>{M(r,(i,o)=>{i>=n&&(r[o]+=e.alterRowOffset||0)})})):e.alterColumnOffset&&e.alterColumnOffset!==0&&(e.destinationColumn+=e.alterColumnOffset||0,e.sourceColumn+=e.alterColumnOffset||0)}resetAllEndpoints(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getAllEndpoints(),n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;e.some(i=>{const o=i.alterRowOffset||0,s=i.alterColumnOffset||0;return i.destinationRow+o>=this.hot.countRows()||i.destinationColumn+s>=this.hot.countCols()})||(this.cellsToSetCache=[],M(e,i=>{this.resetEndpointValue(i,n)}),this.hot.setDataAtCell(this.cellsToSetCache,"ColumnSummary.reset"),this.cellsToSetCache=[])}refreshAllEndpoints(){this.cellsToSetCache=[],M(this.getAllEndpoints(),e=>{this.currentEndpoint=e,this.plugin.calculate(e),this.setEndpointValue(e,"init")}),this.currentEndpoint=null,this.hot.setDataAtCell(this.cellsToSetCache,"ColumnSummary.reset"),this.cellsToSetCache=[]}refreshChangedEndpoints(e){const n=[];this.cellsToSetCache=[],M(e,(r,i,o)=>{`${r[2]||""}`!=`${r[3]}`&&M(this.getAllEndpoints(),(s,a)=>{this.hot.propToCol(o[i][1])===s.sourceColumn&&n.indexOf(a)===-1&&n.push(a)})}),M(n,r=>{this.refreshEndpoint(this.getEndpoint(r))}),this.hot.setDataAtCell(this.cellsToSetCache,"ColumnSummary.reset"),this.cellsToSetCache=[]}refreshCellMetas(){this.endpoints.forEach(e=>{const n=this.hot.toVisualRow(e.destinationRow);if(n!==null){const r=this.hot.getCellMeta(n,e.destinationColumn);r.readOnly=e.readOnly,r.className="columnSummaryResult"}})}refreshEndpoint(e){this.currentEndpoint=e,this.plugin.calculate(e),this.setEndpointValue(e),this.currentEndpoint=null}resetEndpointValue(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;const r=e.alterRowOffset||0,i=e.alterColumnOffset||0;this.cellsToSetCache.push([this.hot.toVisualRow(e.destinationRow+(n?r:0)),this.hot.toVisualColumn(e.destinationColumn+(n?i:0)),""])}setEndpointValue(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=this.hot.toVisualRow(e.destinationRow);if(e.destinationRow>=this.hot.countRows()||e.destinationColumn>=this.hot.countCols()){this.throwOutOfBoundsWarning();return}const o=this.hot.toVisualRow(e.destinationRow);if(o!==null){const s=this.hot.getCellMeta(o,e.destinationColumn);(n==="init"||s.readOnly!==e.readOnly)&&(s.readOnly=e.readOnly,s.className="columnSummaryResult")}if((e.roundFloat===!0||Number.isInteger(e.roundFloat))&&!isNaN(e.result)){const s=e.roundFloat;let a=0;Number.isInteger(s)&&(a=Math.min(Math.max(0,s),100)),e.result=e.result.toFixed(a)}r?this.hot.setDataAtCell(i,e.destinationColumn,e.result,"ColumnSummary.set"):this.cellsToSetCache.push([i,e.destinationColumn,e.result]),e.alterRowOffset=void 0,e.alterColumnOffset=void 0}throwOutOfBoundsWarning(){Ze("One of the Column Summary plugins' destination points you provided is beyond the table boundaries!")}}function Ry(t){return t==null||isNaN(t)}function r5(t,e){i5(t,e),e.add(t)}function i5(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function o5(t,e,n){return(e=s5(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function s5(t){var e=a5(t,"string");return typeof e=="symbol"?e:e+""}function a5(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ef(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const Ey="columnSummary",l5=220;var Nc=new WeakSet;class u5 extends Xe{constructor(){super(...arguments),r5(this,Nc),o5(this,"endpoints",null)}static get PLUGIN_KEY(){return Ey}static get PLUGIN_PRIORITY(){return l5}isEnabled(){return!!this.hot.getSettings()[Ey]}enablePlugin(){var e=this;this.enabled||(this.settings=this.hot.getSettings()[Ey],this.endpoints=new n5(this,this.settings),this.addHook("afterInit",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Ef(Nc,e,c5).call(e,...r)}),this.addHook("afterChange",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Ef(Nc,e,d5).call(e,...r)}),this.addHook("afterUpdateSettings",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Ef(Nc,e,h5).call(e,...r)}),this.addHook("beforeCreateRow",(n,r,i)=>this.endpoints.resetSetupBeforeStructureAlteration("insert_row",n,r,null,i)),this.addHook("beforeCreateCol",(n,r,i)=>this.endpoints.resetSetupBeforeStructureAlteration("insert_col",n,r,null,i)),this.addHook("beforeRemoveRow",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return e.endpoints.resetSetupBeforeStructureAlteration("remove_row",...r)}),this.addHook("beforeRemoveCol",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return e.endpoints.resetSetupBeforeStructureAlteration("remove_col",...r)}),this.addHook("afterCreateRow",(n,r,i)=>this.endpoints.resetSetupAfterStructureAlteration("insert_row",n,r,null,i)),this.addHook("afterCreateCol",(n,r,i)=>this.endpoints.resetSetupAfterStructureAlteration("insert_col",n,r,null,i)),this.addHook("afterRemoveRow",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return e.endpoints.resetSetupAfterStructureAlteration("remove_row",...r)}),this.addHook("afterRemoveCol",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return e.endpoints.resetSetupAfterStructureAlteration("remove_col",...r)}),this.addHook("afterRowMove",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Ef(Nc,e,f5).call(e,...r)}),super.enablePlugin())}disablePlugin(){this.endpoints=null,this.settings=null,this.currentEndpoint=null,super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.endpoints.initEndpoints(),super.updatePlugin()}calculate(e){switch(e.type.toLowerCase()){case"sum":e.result=this.calculateSum(e);break;case"min":e.result=this.calculateMinMax(e,e.type);break;case"max":e.result=this.calculateMinMax(e,e.type);break;case"count":e.result=this.countEntries(e);break;case"average":e.result=this.calculateAverage(e);break;case"custom":e.result=e.customFunction.call(this,e);break}}calculateSum(e){let n=0;return He(e.ranges,r=>{n+=this.getPartialSum(r,e.sourceColumn)}),n}getPartialSum(e,n){let r=0,i=e[1]||e[0],o=null,s=0;do{if(o=this.getCellValue(i,n),o=Ry(o)?null:o,o!==null){const a=(`${o}`.split(".")[1]||[]).length||1;a>s&&(s=a)}r+=o||0,i-=1}while(i>=e[0]);return Math.round(r*10**s)/10**s}calculateMinMax(e,n){let r=null;return He(e.ranges,i=>{const o=this.getPartialMinMax(i,e.sourceColumn,n);if(r===null&&o!==null&&(r=o),o!==null)switch(n){case"min":r=Math.min(r,o);break;case"max":r=Math.max(r,o);break}}),r===null?"Not enough data":r}getPartialMinMax(e,n,r){let i=null,o=e[1]||e[0],s;do{if(s=this.getCellValue(o,n),s=Ry(s)?null:s,i===null)i=s;else if(s!==null)switch(r){case"min":i=Math.min(i,s);break;case"max":i=Math.max(i,s);break}o-=1}while(o>=e[0]);return i}countEmpty(e,n){let r,i=0,o=e[1]||e[0];do r=this.getCellValue(o,n),r=Ry(r)?null:r,r===null&&(i+=1),o-=1;while(o>=e[0]);return i}countEntries(e){let n=0;const r=e.ranges;return He(r,i=>{const o=i[1]===void 0?1:i[1]-i[0]+1,s=this.countEmpty(i,e.sourceColumn);n+=o,n-=s}),n}calculateAverage(e){const n=this.calculateSum(e),r=this.countEntries(e);return n/r}getCellValue(e,n){const r=this.hot.toVisualRow(e),i=this.hot.toVisualColumn(n);let o=this.hot.getSourceDataAtCell(e,n),s="";if(r!==null&&i!==null&&(s=this.hot.getCellMeta(r,i).className||""),s.indexOf("columnSummaryResult")>-1)return null;if(this.endpoints.currentEndpoint.forceNumeric&&(typeof o=="string"&&(o=o.replace(/,/,".")),o=parseFloat(o)),isNaN(o)&&!this.endpoints.currentEndpoint.suppressDataTypeErrors)throw new Error(nt`ColumnSummary plugin: cell at (${e}, ${n}) is not in a\x20
|
|
258
|
+
numeric format. Cannot do the calculation.`);return o}}function c5(){this.endpoints.initEndpoints()}function h5(t){t.columns!==void 0&&this.endpoints.refreshCellMetas()}function d5(t,e){t&&e!=="ColumnSummary.reset"&&e!=="ColumnSummary.set"&&e!=="loadData"&&this.endpoints.refreshChangedEndpoints(t)}function f5(t,e){this.endpoints.resetSetupBeforeStructureAlteration("move_row",t[0],t.length,t,this.pluginName),this.endpoints.resetSetupAfterStructureAlteration("move_row",e,t.length,t,this.pluginName)}function g5(t,e){qk(t,e),e.add(t)}function Ty(t,e,n){qk(t,e),e.set(t,n)}function qk(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function gu(t,e){return t.get(eT(t,e))}function vS(t,e,n){return t.set(eT(t,e),n),n}function eT(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var fm=new WeakMap,Tf=new WeakMap,_f=new WeakMap,sA=new WeakSet;class Kk{constructor(){g5(this,sA),Ty(this,fm,!0),Ty(this,Tf,null),Ty(this,_f,new ResizeObserver(e=>eT(sA,this,m5).call(this,e)))}setObservedElement(e){vS(Tf,this,e)}unobserve(){gu(_f,this).unobserve(gu(Tf,this))}observe(){vS(fm,this,!0),gu(_f,this).observe(gu(Tf,this))}destroy(){gu(_f,this).disconnect()}}function m5(t){if(gu(fm,this)||!Array.isArray(t)||!t.length){vS(fm,this,!1);return}t.forEach(e=>{let{borderBoxSize:n}=e;const{inlineSize:r,blockSize:i}=n[0];this.runLocalHooks("resize",r,i)})}ut(Kk,Rn);function Ca(t,e,n){p5(t,e),e.set(t,n)}function p5(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function at(t,e){return t.get(Xk(t,e))}function _o(t,e,n){return t.set(Xk(t,e),n),n}function Xk(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var ya=new WeakMap,_y=new WeakMap,Mo=new WeakMap,ds=new WeakMap,fs=new WeakMap,Mf=new WeakMap,Bl=new WeakMap;class Xa{static get CLASS_EDITOR_CONTAINER(){return"htCommentsContainer"}static get CLASS_EDITOR(){return"htComments"}static get CLASS_INPUT(){return"htCommentTextArea"}static get CLASS_CELL(){return"htCommentCell"}constructor(e,n){var r=this;Ca(this,ya,void 0),Ca(this,_y,!1),Ca(this,Mo,null),Ca(this,ds,void 0),Ca(this,fs,void 0),Ca(this,Mf,!0),Ca(this,Bl,new Kk),_o(ya,this,e),_o(_y,this,n),_o(ds,this,this.createEditor()),_o(fs,this,at(ds,this).style),at(Bl,this).setObservedElement(this.getInputElement()),at(Bl,this).addLocalHook("resize",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r.runLocalHooks("resize",...o)}),this.hide()}setPosition(e,n){at(fs,this).left=`${e}px`,at(fs,this).top=`${n}px`}setSize(e,n){if(e&&n){const r=this.getInputElement();r.style.width=`${e}px`,r.style.height=`${n}px`}}getSize(){return{width:qt(this.getInputElement()),height:nn(this.getInputElement())}}observeSize(){at(Bl,this).observe()}resetSize(){const e=this.getInputElement();e.style.width="",e.style.height=""}setReadOnlyState(e){const n=this.getInputElement();n.readOnly=e}show(){at(fs,this).display="block",_o(Mf,this,!1)}hide(){at(Bl,this).unobserve(),at(Mf,this)||(at(fs,this).display="none"),_o(Mf,this,!0)}isVisible(){return at(fs,this).display==="block"}setValue(){const n=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:"")||"";this.getInputElement().value=n}getValue(){return this.getInputElement().value}isFocused(){return at(ya,this).activeElement===this.getInputElement()}focus(){this.getInputElement().focus()}createEditor(){const e=at(ya,this).createElement("div"),n=at(ya,this).createElement("textarea");return e.style.display="none",_o(Mo,this,at(ya,this).createElement("div")),at(Mo,this).setAttribute("dir",at(_y,this)?"rtl":"ltr"),G(at(Mo,this),Xa.CLASS_EDITOR_CONTAINER),at(ya,this).body.appendChild(at(Mo,this)),G(e,Xa.CLASS_EDITOR),G(n,Xa.CLASS_INPUT),n.setAttribute("data-hot-input",!0),e.appendChild(n),at(Mo,this).appendChild(e),e}getInputElement(){return at(ds,this).querySelector(`.${Xa.CLASS_INPUT}`)}getEditorElement(){return at(ds,this)}destroy(){const e=at(Mo,this)?at(Mo,this).parentNode:null;at(ds,this).parentNode.removeChild(at(ds,this)),_o(ds,this,null),_o(fs,this,null),at(Bl,this).destroy(),e&&e.removeChild(at(Mo,this))}}ut(Xa,Rn);function My(t,e,n){return(e=w5(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function w5(t){var e=v5(t,"string");return typeof e=="symbol"?e:e+""}function v5(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const C5=250,y5=250;class Zk{constructor(e){My(this,"wasLastActionShow",!0),My(this,"showDebounced",null),My(this,"hidingTimer",null),this.updateDelay(e)}hide(){this.wasLastActionShow=!1,this.hidingTimer=setTimeout(()=>{this.wasLastActionShow===!1&&this.runLocalHooks("hide")},y5)}show(e){this.wasLastActionShow=!0,this.showDebounced(e)}cancelHiding(){this.wasLastActionShow=!0,clearTimeout(this.hidingTimer),this.hidingTimer=null}updateDelay(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:C5;this.showDebounced=ip(n=>{this.wasLastActionShow&&this.runLocalHooks("show",n.from.row,n.from.col)},e)}destroy(){this.clearLocalHooks()}}ut(Zk,Rn);function b5(t,e){return t.indexOf(e)!==-1?t:`${t.replace("htTop","").replace("htMiddle","").replace("htBottom","").replace(" ","")} ${e}`}function S5(t,e){return t.indexOf(e)!==-1?t:`${t.replace("htLeft","").replace("htCenter","").replace("htRight","").replace("htJustify","").replace(" ","")} ${e}`}function ba(t,e){const n={};return M(t,r=>{r.forAll((i,o)=>{i>=0&&o>=0&&(n[i]||(n[i]=[]),n[i][o]=e(i,o))})}),n}function Ts(t,e,n,r,i){M(t,o=>{o.forAll((s,a)=>{s>=0&&a>=0&&R5(s,a,e,n,r,i)})})}function R5(t,e,n,r,i,o){const s=i(t,e);let a=r;s.className&&(n==="vertical"?a=b5(s.className,r):a=S5(s.className,r)),o(t,e,"className",a)}function Qk(t){return`<span class="selected">✓</span>${t}`}function Og(t,e){let n=!1;return Array.isArray(t)&&M(t,r=>(r.forAll((i,o)=>{if(i>=0&&o>=0&&e(i,o))return n=!0,!1}),n)),n}function bp(t,e){const n={top:0,left:0};if(e!==t.ownerDocument){const{frameElement:r}=e.defaultView,{top:i,left:o}=r.getBoundingClientRect();n.top=i,n.left=o}return n}const xe="---------";function E5(){return{name:xe}}const Vr="alignment";function T5(){return{key:Vr,name(){return this.getTranslatedPhrase(OE)},disabled(){if(this.countRows()===0||this.countCols()===0)return!0;const t=this.getSelectedRangeLast();return!t||t.isSingleHeader()?!0:!(this.getSelectedRange()&&!this.selection.isSelectedByCorner())},submenu:{items:[{key:`${Vr}:left`,name(){return this.getTranslatedPhrase(xE)},callback(){const t=this.getSelectedRange(),e=ba(t,(i,o)=>this.getCellMeta(i,o).className),n="horizontal",r="htLeft";this.runHooks("beforeCellAlignment",e,t,n,r),Ts(t,n,r,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1},{key:`${Vr}:center`,name(){return this.getTranslatedPhrase(AE)},callback(){const t=this.getSelectedRange(),e=ba(t,(i,o)=>this.getCellMeta(i,o).className),n="horizontal",r="htCenter";this.runHooks("beforeCellAlignment",e,t,n,r),Ts(t,n,r,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1},{key:`${Vr}:right`,name(){return this.getTranslatedPhrase(HE)},callback(){const t=this.getSelectedRange(),e=ba(t,(i,o)=>this.getCellMeta(i,o).className),n="horizontal",r="htRight";this.runHooks("beforeCellAlignment",e,t,n,r),Ts(t,n,r,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1},{key:`${Vr}:justify`,name(){return this.getTranslatedPhrase(NE)},callback(){const t=this.getSelectedRange(),e=ba(t,(i,o)=>this.getCellMeta(i,o).className),n="horizontal",r="htJustify";this.runHooks("beforeCellAlignment",e,t,n,r),Ts(t,n,r,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1},{name:xe},{key:`${Vr}:top`,name(){return this.getTranslatedPhrase(DE)},callback(){const t=this.getSelectedRange(),e=ba(t,(i,o)=>this.getCellMeta(i,o).className),n="vertical",r="htTop";this.runHooks("beforeCellAlignment",e,t,n,r),Ts(t,n,r,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1},{key:`${Vr}:middle`,name(){return this.getTranslatedPhrase(kE)},callback(){const t=this.getSelectedRange(),e=ba(t,(i,o)=>this.getCellMeta(i,o).className),n="vertical",r="htMiddle";this.runHooks("beforeCellAlignment",e,t,n,r),Ts(t,n,r,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1},{key:`${Vr}:bottom`,name(){return this.getTranslatedPhrase(LE)},callback(){const t=this.getSelectedRange(),e=ba(t,(i,o)=>this.getCellMeta(i,o).className),n="vertical",r="htBottom";this.runHooks("beforeCellAlignment",e,t,n,r),Ts(t,n,r,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1}]}}}const Sp="clear_column";function _5(){return{key:Sp,name(){return this.getTranslatedPhrase(pE)},callback(t,e){const n=e[0].start.col,r=e[0].end.col;this.countRows()&&this.populateFromArray(0,n,[[null]],Math.max(e[0].start.row,e[0].end.row),r,"ContextMenu.clearColumn")},disabled(){const t=this.getSelectedRangeLast();if(!t||t.isSingleHeader()&&t.highlight.col<0||!this.selection.isSelectedByColumnHeader())return!0;let e=!1;return t.forAll((n,r)=>{if(n<0||r<0)return!0;const{readOnly:i}=this.getCellMeta(n,r);return i?!0:(e=!0,!1)}),!e}}}const Id="col_left";function M5(){return{key:Id,name(){return this.getTranslatedPhrase(cE)},callback(){const t=this.getSelectedRangeLast().getTopLeftCorner(),e=this.isRtl()?"insert_col_end":"insert_col_start";this.alter(e,t.col,1,"ContextMenu.columnLeft")},disabled(){if(!this.isColumnModificationAllowed())return!0;const t=this.getSelectedRangeLast();return!t||this.selection.isSelectedByRowHeader()||t.isSingleHeader()&&t.highlight.col<0||this.countSourceCols()>=this.getSettings().maxCols?!0:this.selection.isSelectedByCorner()?this.countCols()===0:!1},hidden(){return!this.getSettings().allowInsertColumn}}}const Pd="col_right";function I5(){return{key:Pd,name(){return this.getTranslatedPhrase(hE)},callback(){const t=this.getSelectedRangeLast().getTopRightCorner(),e=this.isRtl()?"insert_col_start":"insert_col_end";this.alter(e,t.col,1,"ContextMenu.columnRight")},disabled(){if(!this.isColumnModificationAllowed())return!0;const t=this.getSelectedRangeLast();return!!(!t||this.selection.isSelectedByRowHeader()||t.isSingleHeader()&&t.highlight.col<0||this.countSourceCols()>=this.getSettings().maxCols)},hidden(){return!this.getSettings().allowInsertColumn}}}const Od="make_read_only";function P5(){return{key:Od,checkable:!0,ariaChecked(){return Og(this.getSelectedRange(),(e,n)=>this.getCellMeta(e,n).readOnly)},ariaLabel(){return this.getTranslatedPhrase(em)},name(){let t=this.getTranslatedPhrase(em);return Og(this.getSelectedRange(),(n,r)=>this.getCellMeta(n,r).readOnly)&&(t=Qk(t)),t},callback(){const t=this.getSelectedRange(),e=Og(t,(n,r)=>this.getCellMeta(n,r).readOnly);M(t,n=>{n.forAll((r,i)=>{r>=0&&i>=0&&this.setCellMeta(r,i,"readOnly",!e)})}),this.render()},disabled(){const t=this.getSelectedRangeLast();return!!(!t||t.isSingleHeader()||this.selection.isSelectedByCorner()||this.countRows()===0||this.countCols()===0||!this.getSelectedRange()||this.getSelectedRange().length===0)}}}const Rp="redo";function O5(){return{key:Rp,name(){return this.getTranslatedPhrase(mE)},callback(){this.getPlugin("undoRedo").redo()},hidden(){const t=this.getPlugin("undoRedo");return!t||!t.isEnabled()},disabled(){return!this.getPlugin("undoRedo").isRedoAvailable()}}}const xd="remove_col";function x5(){return{key:xd,name(){const t=this.getSelected();let e=0;if(t)if(t.length>1)e=1;else{const[,n,,r]=t[0];n-r!==0&&(e=1)}return this.getTranslatedPhrase(fE,e)},callback(){this.alter("remove_col",WK(this),null,"ContextMenu.removeColumn")},disabled(){if(!this.isColumnModificationAllowed())return!0;const t=this.getSelectedRangeLast();if(!t||t.isSingleHeader()&&t.highlight.col<0)return!0;const e=this.countCols();return this.selection.isSelectedByCorner()?e===0:this.selection.isSelectedByRowHeader()||e===0},hidden(){return!this.getSettings().allowRemoveColumn}}}const Ep="remove_row";function A5(){return{key:Ep,name(){const t=this.getSelected();let e=0;if(t)if(t.length>1)e=1;else{const[n,,r]=t[0];n-r!==0&&(e=1)}return this.getTranslatedPhrase(dE,e)},callback(){this.alter("remove_row",BK(this),1,"ContextMenu.removeRow")},disabled(){const t=this.getSelectedRangeLast();if(!t||t.isSingleHeader()&&t.highlight.row<0)return!0;const e=this.countRows();return this.selection.isSelectedByCorner()?e===0:this.selection.isSelectedByColumnHeader()||e===0},hidden(){return!this.getSettings().allowRemoveRow}}}const Tp="row_above";function H5(){return{key:Tp,name(){return this.getTranslatedPhrase(lE)},callback(){const t=this.getSelectedRangeLast().getTopLeftCorner();this.alter("insert_row_above",t.row,1,"ContextMenu.rowAbove")},disabled(){const t=this.getSelectedRangeLast();return!t||this.selection.isSelectedByColumnHeader()||t.isSingleHeader()&&t.highlight.row<0||this.countSourceRows()>=this.getSettings().maxRows?!0:this.selection.isSelectedByCorner()?this.countRows()===0:!1},hidden(){return!this.getSettings().allowInsertRow}}}const _p="row_below";function N5(){return{key:_p,name(){return this.getTranslatedPhrase(uE)},callback(){const t=this.getSelectedRangeLast().getBottomRightCorner();this.alter("insert_row_below",t.row,1,"ContextMenu.rowBelow")},disabled(){const t=this.getSelectedRangeLast();return!!(!t||this.selection.isSelectedByColumnHeader()||t.isSingleHeader()&&t.highlight.row<0||this.countSourceRows()>=this.getSettings().maxRows)},hidden(){return!this.getSettings().allowInsertRow}}}const Zh="no_items";function D5(){return{key:Zh,name(){return this.getTranslatedPhrase(aE)},disabled:!0,isCommand:!1}}const Mp="undo";function k5(){return{key:Mp,name(){return this.getTranslatedPhrase(gE)},callback(){this.getPlugin("undoRedo").undo()},hidden(){const t=this.getPlugin("undoRedo");return!t||!t.isEnabled()},disabled(){return!this.getPlugin("undoRedo").isUndoAvailable()}}}const L5=[Tp,_p,Id,Pd,Sp,Ep,xd,Mp,Rp,Od,Vr,xe,Zh],$5={[xe]:E5,[Zh]:D5,[Tp]:H5,[_p]:N5,[Id]:M5,[Pd]:I5,[Sp]:_5,[Ep]:A5,[xd]:x5,[Mp]:k5,[Rp]:O5,[Od]:P5,[Vr]:T5};function Jk(){const t={};return He($5,(e,n)=>{t[n]=e()}),t}function F5(t){return{key:"commentsAddEdit",name(){var e;const n=(e=this.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;return n!=null&&n.isCell()&&t.getCommentAtCell(n.row,n.col)?this.getTranslatedPhrase(ME):this.getTranslatedPhrase(_E)},callback(){const e=this.getSelectedRangeLast();t.setRange(e),t.show(),t.focusEditor()},disabled(){const e=this.getSelectedRangeLast();return!!(!e||e.highlight.isHeader()||this.selection.isEntireRowSelected()&&this.selection.isEntireColumnSelected()||this.countRenderedRows()===0||this.countRenderedCols()===0)}}}function V5(t){return{key:"commentsRemove",name(){return this.getTranslatedPhrase(IE)},callback(){this.getSelectedRangeLast().forAll((n,r)=>{n>=0&&r>=0&&t.removeCommentAtCell(n,r,!1)}),this.render()},disabled(){const e=this.getSelectedRangeLast();return!!(!e||e.highlight.isHeader()||this.selection.isEntireRowSelected()&&this.selection.isEntireColumnSelected()||this.countRenderedRows()===0||this.countRenderedCols()===0)}}}function W5(t){return{key:"commentsReadOnly",name(){const e=this.getTranslatedPhrase(PE);return Og(this.getSelectedRange(),(r,i)=>t.getCommentMeta(r,i,xg))?Qk(e):e},callback(){this.getSelectedRangeLast().forAll((n,r)=>{if(n>=0&&r>=0){const i=!!t.getCommentMeta(n,r,xg);t.updateCommentMeta(n,r,{[xg]:!i})}})},disabled(){const e=this.getSelectedRangeLast();return!!(!e||e.highlight.isHeader()||!t.getCommentAtCell(e.highlight.row,e.highlight.col)||this.selection.isEntireRowSelected()&&this.selection.isEntireColumnSelected()||this.countRenderedRows()===0||this.countRenderedCols()===0)}}}function B5(t,e){eL(t,e),e.add(t)}function jl(t,e,n){eL(t,e),e.set(t,n)}function eL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function j5(t,e,n){return(e=U5(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function U5(t){var e=z5(t,"string");return typeof e=="symbol"?e:e+""}function z5(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function $s(t,e,n){return t.set(rr(t,e),n),n}function Ie(t,e){return t.get(rr(t,e))}function rr(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const gm="comments",Y5=60,Lo="comment",dh="value",tL="style",xg="readOnly",Dc=gm,CS=`plugin:${gm}`;var it=new WeakMap,Qi=new WeakMap,Ip=new WeakMap,Ag=new WeakMap,yS=new WeakMap,mm=new WeakMap,gr=new WeakSet;class G5 extends Xe{constructor(){super(...arguments),B5(this,gr),j5(this,"range",{}),jl(this,it,null),jl(this,Qi,null),jl(this,Ip,!1),jl(this,Ag,!1),jl(this,yS,null),jl(this,mm,"")}static get PLUGIN_KEY(){return gm}static get PLUGIN_PRIORITY(){return Y5}static get DEFAULT_SETTINGS(){return{displayDelay:250}}isEnabled(){return!!this.hot.getSettings()[gm]}enablePlugin(){var e=this;this.enabled||(Ie(it,this)||($s(it,this,new Xa(this.hot.rootDocument,this.hot.isRtl())),Ie(it,this).addLocalHook("resize",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rr(gr,e,tZ).call(e,...r)})),Ie(Qi,this)||$s(Qi,this,new Zk(this.getSetting("displayDelay"))),this.addHook("afterContextMenuDefaultOptions",n=>this.addToContextMenu(n)),this.addHook("afterRenderer",(n,r,i,o,s,a)=>rr(gr,this,Q5).call(this,n,a)),this.addHook("afterScroll",()=>rr(gr,this,nZ).call(this)),this.addHook("afterBeginEditing",()=>this.hide()),this.addHook("afterDocumentKeyDown",n=>rr(gr,this,aA).call(this,n)),this.addHook("beforeCompositionStart",n=>rr(gr,this,aA).call(this,n)),this.addHook("afterSetTheme",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rr(gr,e,rZ).call(e,...r)}),Ie(Qi,this).addLocalHook("hide",()=>this.hide()),Ie(Qi,this).addLocalHook("show",(n,r)=>this.showAtCell(n,r)),this.registerShortcuts(),this.registerListeners(),super.enablePlugin())}updatePlugin(){Ie(Qi,this).updateDelay(this.getSetting("displayDelay")),super.updatePlugin()}disablePlugin(){this.unregisterShortcuts(),super.disablePlugin()}registerShortcuts(){const e=this.hot.getShortcutManager(),n=e.getContext("grid"),r=e.addContext(CS);n.addShortcut({keys:[["Control","Alt","M"]],callback:()=>{const i=this.hot.getSelectedRangeLast();$s(Ag,this,!0),this.hot.scrollToFocusedCell(()=>{this.setRange(i),this.show(),this.focusEditor(),e.setActiveContextName(CS),this.hot._registerTimeout(()=>{$s(Ag,this,!1)})})},stopPropagation:!0,runOnlyIf:()=>{var i;return(i=this.hot.getSelectedRangeLast())===null||i===void 0?void 0:i.highlight.isCell()},group:Dc}),r.addShortcut({keys:[["Escape"]],callback:()=>{Ie(it,this).setValue(Ie(mm,this)),this.hide(),e.setActiveContextName("grid")},runOnlyIf:()=>Ie(it,this).isVisible()&&Ie(it,this).isFocused(),group:Dc}),r.addShortcut({keys:[["Control/Meta","Enter"]],callback:()=>{this.hide(),e.setActiveContextName("grid")},runOnlyIf:()=>Ie(it,this).isVisible()&&Ie(it,this).isFocused(),group:Dc}),r.addShortcut({keys:[["Shift","Tab"],["Tab"]],forwardToContext:e.getContext("grid"),callback:()=>{Ie(it,this).setValue(Ie(it,this).getValue()),this.hide(),e.setActiveContextName("grid")},group:Dc})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(Dc)}registerListeners(){const{rootDocument:e}=this.hot,n=this.getEditorInputElement();this.eventManager.addEventListener(e,"mouseover",r=>rr(gr,this,X5).call(this,r)),this.eventManager.addEventListener(e,"mousedown",r=>rr(gr,this,q5).call(this,r)),this.eventManager.addEventListener(e,"mouseup",()=>rr(gr,this,Z5).call(this)),this.eventManager.addEventListener(n,"focus",()=>rr(gr,this,eZ).call(this)),this.eventManager.addEventListener(n,"blur",()=>rr(gr,this,J5).call(this)),this.eventManager.addEventListener(this.getEditorInputElement(),"mousedown",r=>rr(gr,this,K5).call(this,r))}setRange(e){this.range=e}clearRange(){this.range={}}targetIsCellWithComment(e){const n=il(e.target,"TD","TBODY");return!!(n&&ve(n,"htCommentCell")&&il(n,[this.hot.rootElement]))}targetIsCommentTextArea(e){return this.getEditorInputElement()===e.target}setComment(e){if(!this.range.from)throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');const n=Ie(it,this).getValue();let r="";e!=null?r=e:n!=null&&(r=n);const i=this.range.from.row,o=this.range.from.col;this.updateCommentMeta(i,o,{[dh]:r}),this.hot.render()}setCommentAtCell(e,n,r){this.setRange({from:this.hot._createCellCoords(e,n)}),this.setComment(r)}removeComment(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;if(!this.range.from)throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');this.hot.setCellMeta(this.range.from.row,this.range.from.col,Lo),e&&this.hot.render(),this.hide()}removeCommentAtCell(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;this.setRange({from:this.hot._createCellCoords(e,n)}),this.removeComment(r)}getComment(){const e=this.range.from.row,n=this.range.from.col;return this.getCommentMeta(e,n,dh)}getCommentAtCell(e,n){return this.getCommentMeta(e,n,dh)}show(){var e;if(!this.range.from)throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');const{from:{row:n,col:r}}=this.range;if(n<0||n>this.hot.countSourceRows()-1||r<0||r>this.hot.countSourceCols()-1)return!1;const i=this.hot.getCellMeta(this.range.from.row,this.range.from.col);return Ie(Qi,this).cancelHiding(),Ie(it,this).setValue((e=i[Lo]?i[Lo][dh]:null)!==null&&e!==void 0?e:""),Ie(it,this).show(),this.refreshEditor(!0),!0}showAtCell(e,n){return this.setRange({from:this.hot._createCellCoords(e,n)}),this.show()}hide(){Ie(it,this).hide()}refreshEditor(){if(!(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1)&&(!this.range.from||!Ie(it,this).isVisible()))return;const{rowIndexMapper:n,columnIndexMapper:r}=this.hot,{row:i,col:o}=this.range.from;let s=n.getRenderableFromVisualIndex(i),a=r.getRenderableFromVisualIndex(o);const l=s===null;Ie(it,this).setPosition(0,0),s===null&&(s=n.getRenderableFromVisualIndex(n.getNearestNotHiddenIndex(i,-1))),a===null&&(a=r.getRenderableFromVisualIndex(r.getNearestNotHiddenIndex(o,-1)));const u=s===null,c=a===null;s=s??0,a=a??0;const{rootWindow:h,view:{_wt:d}}=this.hot,{wtTable:f}=d,g=d.getCell({row:s,col:a},!0),C=this.getCommentMeta(i,o,tL);C?Ie(it,this).setSize(C.width,C.height):Ie(it,this).resetSize();const y=c?0:f.getColumnWidth(a),E=l&&!u?nn(g):0,{left:v,top:P,width:O,height:L}=g.getBoundingClientRect(),{width:T,height:A}=Ie(it,this).getSize(),{innerWidth:q,innerHeight:U}=this.hot.rootWindow,j=this.hot.rootDocument.documentElement,Z=vn(this.hot.rootDocument),J=xN(this.hot.rootWindow)?Z:0,se=AN(this.hot.rootWindow)?Z:0;let te=v+h.scrollX+y,ue=P+h.scrollY+E;this.hot.isRtl()&&(te-=T+y),this.hot.isLtr()&&v+O+T>q-J?te=v+h.scrollX-T-1:this.hot.isRtl()&&te<-(j.scrollWidth-j.clientWidth)&&(te=v+h.scrollX+y+1),P+A>U-se&&(ue-=A-L+1),Ie(it,this).setPosition(te,ue),Ie(it,this).setReadOnlyState(this.getCommentMeta(i,o,xg)),Ie(it,this).observeSize()}focusEditor(){Ie(it,this).focus()}updateCommentMeta(e,n,r){const i=this.hot.getCellMeta(e,n)[Lo];let o;i?(o=Gn(i),op(o,r)):o=r,this.hot.setCellMeta(e,n,Lo,o)}getCommentMeta(e,n,r){const i=this.hot.getCellMeta(e,n);if(i[Lo])return i[Lo][r]}addToContextMenu(e){e.items.push({name:xe},F5(this),V5(this),W5(this))}getEditorInputElement(){return Ie(it,this).getInputElement()}destroy(){var e,n;(e=Ie(it,this))===null||e===void 0||e.destroy(),(n=Ie(Qi,this))===null||n===void 0||n.destroy(),super.destroy()}}function q5(t){if(!(!this.hot.view||!this.hot.view._wt)&&!Ie(Ip,this)&&!this.targetIsCommentTextArea(t)){const e=il(t.target,"TD","TBODY");let n=null;e&&(n=this.hot.getCoords(e)),(!e||this.range.from&&n&&(this.range.from.row!==n.row||this.range.from.col!==n.col))&&this.hide()}}function K5(t){t.stopPropagation()}function X5(t){const{rootDocument:e}=this.hot;if(!(Ie(Ip,this)||Ie(it,this).isFocused()||ve(t.target,"wtBorder")||Ie(yS,this)===t.target||!Ie(it,this)))if($s(yS,this,e.elementFromPoint(t.clientX,t.clientY)),this.targetIsCellWithComment(t)){const n=this.hot._createCellRange(this.hot.getCoords(t.target));Ie(Qi,this).show(n)}else tl(t.target,e)&&!this.targetIsCommentTextArea(t)&&Ie(Qi,this).hide()}function Z5(){$s(Ip,this,!1)}function Q5(t,e){e[Lo]&&e[Lo][dh]&&G(t,e.commentedCellClassName)}function J5(){$s(mm,this,""),this.hot.getShortcutManager().setActiveContextName("grid"),this.setComment()}function eZ(){$s(mm,this,this.getComment()),this.hot.listen(),this.hot.getShortcutManager().setActiveContextName(CS)}function tZ(t,e){this.updateCommentMeta(this.range.from.row,this.range.from.col,{[tL]:{width:t,height:e}})}function aA(t){Ie(it,this).isFocused()&&Pi(t)}function nZ(){Ie(Ag,this)||this.hide()}function rZ(){const t=Ie(it,this).getEditorElement();pe(t,/ht-theme-.*/g),G(t,this.hot.getCurrentThemeName())}function Iy(t,e,n){return(e=iZ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function iZ(t){var e=oZ(t,"string");return typeof e=="symbol"?e:e+""}function oZ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class nL{constructor(e){Iy(this,"hot",void 0),Iy(this,"commands",{}),Iy(this,"commonCallback",null),this.hot=e}registerCommand(e,n){this.commands[e]=n}setCommonCallback(e){this.commonCallback=e}execute(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];const o=e.split(":"),s=o[0],a=o.length===2?o[1]:null;let l=this.commands[s];if(!l)throw new Error(`Menu command '${s}' not exists.`);if(a&&l.submenu&&(l=sZ(a,l.submenu.items)),l.disabled===!0||typeof l.disabled=="function"&&l.disabled.call(this.hot)===!0||tn(l,"submenu"))return;const u=[];typeof l.callback=="function"&&u.push(l.callback),typeof this.commonCallback=="function"&&u.push(this.commonCallback),r.unshift(o.join(":")),M(u,c=>c.apply(this.hot,r))}}function sZ(t,e){let n;return M(e,r=>{const i=r.key?r.key.split(":"):null;if(Array.isArray(i)&&i[1]===t)return n=r,!1}),n}function Py(t,e,n){return(e=aZ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function aZ(t){var e=lZ(t,"string");return typeof e=="symbol"?e:e+""}function lZ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class rL{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;Py(this,"hot",void 0),Py(this,"predefinedItems",Jk()),Py(this,"defaultOrderPattern",void 0),this.hot=e,this.defaultOrderPattern=n}setPredefinedItems(e){const n={};this.defaultOrderPattern.length=0,He(e,(r,i)=>{let o="";r.name===xe?(n[xe]=r,o=xe):isNaN(parseInt(i,10))?(r.key=r.key===void 0?i:r.key,n[i]=r,o=r.key):(n[r.key]=r,o=r.key),this.defaultOrderPattern.push(o)}),this.predefinedItems=n}getItems(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return uZ(e,this.defaultOrderPattern,this.predefinedItems)}}function uZ(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=[];let i=t;return i&&i.items?i=i.items:Array.isArray(i)||(i=e),Ae(i)?He(i,(o,s)=>{let a=n[typeof o=="string"?o:s];a||(a=o),Ae(o)?rn(a,o):typeof a=="string"&&(a={name:a}),a.key===void 0&&(a.key=s),r.push(a)}):M(i,(o,s)=>{let a=n[o];!a&&L5.indexOf(o)>=0||(a||(a={name:o,key:`${s}`}),Ae(o)&&rn(a,o),a.key===void 0&&(a.key=s),r.push(a))}),r}function gs(t,e,n){return(e=cZ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function cZ(t){var e=hZ(t,"string");return typeof e=="symbol"?e:e+""}function hZ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class dZ{constructor(e,n){gs(this,"top",void 0),gs(this,"topRelative",void 0),gs(this,"left",void 0),gs(this,"leftRelative",void 0),gs(this,"scrollTop",void 0),gs(this,"scrollLeft",void 0),gs(this,"cellHeight",void 0),gs(this,"cellWidth",void 0);const r=n.scrollY,i=n.scrollX;let o,s,a,l,u,c;this.rootWindow=n,this.type=this.getSourceType(e),this.type==="literal"?(o=parseInt(e.top,10),a=parseInt(e.left,10),u=e.height||0,c=e.width||0,s=o,l=a,o+=r,a+=i):this.type==="event"&&(o=parseInt(e.pageY,10),a=parseInt(e.pageX,10),u=e.target.clientHeight,c=e.target.clientWidth,s=o-r,l=a-i),this.top=o,this.topRelative=s,this.left=a,this.leftRelative=l,this.scrollTop=r,this.scrollLeft=i,this.cellHeight=u,this.cellWidth=c}getSourceType(e){let n="literal";return e instanceof Event&&(n="event"),n}fitsAbove(e){return this.topRelative>=e.offsetHeight}fitsBelow(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.rootWindow.innerHeight;return this.topRelative+e.offsetHeight<=n}fitsOnRight(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.rootWindow.innerWidth;return this.leftRelative+this.cellWidth+e.offsetWidth<=n}fitsOnLeft(e){return this.leftRelative>=e.offsetWidth}}function kc(t,e,n){fZ(t,e),e.set(t,n)}function fZ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Me(t,e){return t.get(iL(t,e))}function If(t,e,n){return t.set(iL(t,e),n),n}function iL(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Ln=new WeakMap,Jn=new WeakMap,er=new WeakMap,Oy=new WeakMap,Ul=new WeakMap;class gZ{constructor(e){kc(this,Ln,void 0),kc(this,Jn,void 0),kc(this,er,void 0),kc(this,Oy,!1),kc(this,Ul,{above:0,below:0,left:0,right:0}),If(Oy,this,e)}setOffset(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return Me(Ul,this)[e]=n,this}setElement(e){return If(Ln,this,e),this}setParentElement(e){return If(Jn,this,e),this}updatePosition(e){If(er,this,new dZ(e,Me(Ln,this).ownerDocument.defaultView)),Me(Oy,this)?(Me(er,this).fitsBelow(Me(Ln,this))?this.setPositionBelowCursor():Me(er,this).fitsAbove(Me(Ln,this))?this.setPositionAboveCursor():this.setPositionBelowCursor(),this.updateHorizontalPosition()):(this.setPositionBelowCursor(),this.setPositionOnRightOfCursor())}updateHorizontalPosition(){Me(Ln,this).dir==="rtl"?Me(er,this).fitsOnLeft(Me(Ln,this))?this.setPositionOnLeftOfCursor():this.setPositionOnRightOfCursor():Me(er,this).fitsOnRight(Me(Ln,this))?this.setPositionOnRightOfCursor():this.setPositionOnLeftOfCursor()}setPositionAboveCursor(){let e=Me(Ul,this).above+Me(er,this).top-Me(Ln,this).offsetHeight;if(Me(Jn,this)){const r=Me(Jn,this).ownerDocument.defaultView.getComputedStyle(Me(Jn,this).querySelector(".ht_master")),i=Number.parseInt(r.paddingTop,10),o=Number.parseInt(r.borderTop,10);e=Me(er,this).top+Me(er,this).cellHeight-Me(Ln,this).scrollHeight+i+o}Me(Ln,this).style.top=`${e}px`}setPositionBelowCursor(){let e=Me(Ul,this).below+Me(er,this).top+1;if(Me(Jn,this)){const r=Me(Jn,this).ownerDocument.defaultView.getComputedStyle(Me(Jn,this).querySelector(".ht_master")),i=Number.parseInt(r.paddingTop,10),o=Number.parseInt(r.borderTop,10);e=Me(er,this).top-i-o-1}Me(Ln,this).style.top=`${e}px`}setPositionOnRightOfCursor(){let e=Me(er,this).left;if(Me(Jn,this)){const n=Me(Jn,this).ownerDocument.defaultView,r=Number.parseInt(n.getComputedStyle(Me(Jn,this).querySelector(".htCore")).borderRightWidth,10);e+=Me(er,this).cellWidth+r}else e+=Me(Ul,this).right;Me(Ln,this).style.left=`${e}px`}setPositionOnLeftOfCursor(){let e=Me(Ul,this).left+Me(er,this).left-Me(Ln,this).offsetWidth;if(Me(Jn,this)){const n=Me(Jn,this).ownerDocument.defaultView,r=Number.parseInt(n.getComputedStyle(Me(Jn,this).querySelector(".htCore")).borderLeftWidth,10);e-=r}Me(Ln,this).style.left=`${e}px`}}function oL(t){let{initialPage:e=-1,size:n=()=>0,onItemSelect:r=()=>{},onClear:i=()=>{}}=t;const o=new Set;let s=Ue(e,-1,g()-1);function a(y,E){const v=g()-1;return y<0&&(y=v),y>v&&(y=0),o.has(y)?-1:(o.add(y),r(y,!1)===!1&&(y=a(E===1?++y:--y,E)),y)}function l(y){y>-1&&y<g()&&r(y,!0)!==!1&&(s=y)}function u(){return s}function c(){g()>0&&(o.clear(),s=a(0,1))}function h(){g()>0&&(o.clear(),s=a(g()-1,-1))}function d(){g()>0&&(o.clear(),s=a(++s,1))}function f(){g()>0&&(o.clear(),s=a(--s,-1))}function g(){return Math.max(n(),0)}function C(){o.clear(),s=e,i()}return{setCurrentPage:l,getCurrentPage:u,toFirstItem:c,toLastItem:h,toNextItem:d,toPreviousItem:f,getSize:g,clear:C}}function mZ(t){return Be(t,e=>({start:e.getTopStartCorner(),end:e.getBottomEndCorner()}))}function bS(t){return tn(t,"submenu")}function SS(t){return new RegExp(xe,"i").test(t.name)}function Hg(t,e){return t.disabled===!0||typeof t.disabled=="function"&&t.disabled.call(e)===!0}function lA(t){return tn(t,"disableSelection")}function pZ(t){return ve(t,"htSeparator")}function wZ(t){return ve(t,"htSubmenu")}function vZ(t){return ve(t,"htDisabled")}function CZ(t){return ve(t,"htSelectionDisabled")}function yZ(t,e){return!t.hidden||!(typeof t.hidden=="function"&&t.hidden.call(e))}function sL(t,e){const n=t.slice(0);for(let r=0;r<n.length&&n[r].name===e;)n.shift();return n}function bZ(t,e){let n=t.slice(0);return n.reverse(),n=sL(n,e),n.reverse(),n}function SZ(t){const e=[];return M(t,(n,r)=>{r>0?e[e.length-1].name!==n.name&&e.push(n):e.push(n)}),e}function RZ(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:xe,n=t.slice(0);return n=sL(n,e),n=bZ(n,e),n=SZ(n),n}function EZ(t){return t.checkable===!0}function TZ(t){return oL({size:()=>t.countRows(),onItemSelect(e,n){const r=t.getCell(e,0);if(!r||pZ(r)||vZ(r)||CZ(r))return!1;t.selectCell(e,0,...n?[e,0,!1,!1]:[])},onClear(){t.deselectCell()}})}function _Z(t){const{hot:e,hotMenu:n}=t;return[{keys:[["Control/Meta","A"]],forwardToContext:e.getShortcutManager().getContext("grid"),callback:()=>t.close(!0)},{keys:[["Tab"],["Shift","Tab"]],callback:(r,i)=>{const o=e.getSettings(),s=typeof o.tabMoves=="function"?o.tabMoves(r):o.tabMoves;i.includes("shift")?e.selection.transformStart(-s.row,-s.col):e.selection.transformStart(s.row,s.col),t.close(!0)}},{keys:[["Escape"]],callback:()=>t.close()},{keys:[["ArrowDown"]],callback:()=>t.getNavigator().toNextItem()},{keys:[["ArrowUp"]],callback:()=>t.getNavigator().toPreviousItem()},{keys:[[e.isRtl()?"ArrowLeft":"ArrowRight"]],callback:()=>{const r=n.getSelectedLast();if(r){const i=t.openSubMenu(r[0]);i&&i.getNavigator().toFirstItem()}}},{keys:[[e.isRtl()?"ArrowRight":"ArrowLeft"]],callback:()=>{n.getSelectedLast()&&t.isSubMenu()&&(t.close(),t.isSubMenu()&&t.parentMenu.hotMenu.listen())}},{keys:[["Control/Meta","ArrowUp"],["Home"]],callback:()=>t.getNavigator().toFirstItem()},{keys:[["Control/Meta","ArrowDown"],["End"]],callback:()=>t.getNavigator().toLastItem()},{keys:[["Enter"],["Space"]],callback:r=>{const i=n.getSelectedLast();i&&(n.getSourceDataAtRow(i[0]).submenu?t.openSubMenu(i[0]).getNavigator().toFirstItem():(t.executeCommand(r),t.close(!0)))}},{keys:[["PageUp"]],callback:()=>{n.getSelectedLast()?n.selection.transformStart(-n.countVisibleRows(),0):t.getNavigator().toFirstItem()}},{keys:[["PageDown"]],callback:()=>{n.getSelectedLast()?n.selection.transformStart(n.countVisibleRows(),0):t.getNavigator().toLastItem()}}]}const aL="menu",uA=aL;function MZ(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const n=[];r(_Z(t)),e.forEach(u=>{let{shortcuts:c,contextName:h}=u;i(c,h)});function r(u,c){a(c).addShortcuts(u,{group:aL})}function i(u,c){const h=a(c);u.forEach(d=>{let{keys:f}=d;f.forEach(g=>h.removeShortcutsByKeys(g))}),n.push({shortcuts:u,contextName:c}),r(u,c)}function o(){return[...n]}function s(u){return u?`${uA}:${u}`:uA}function a(u){var c;const h=t.hotMenu.getShortcutManager(),d=s(u);return(c=h.getContext(d))!==null&&c!==void 0?c:h.addContext(d)}function l(u){t.hotMenu.getShortcutManager().setActiveContextName(s(u))}return{addCustomShortcuts:i,getCustomShortcuts:o,getContext:a,listen:l}}function IZ(t){return(e,n,r,i,o,s)=>{const a=e.getSourceDataAtRow(r),l=t.rootDocument.createElement("div"),u=typeof s=="function"?s.call(t):s,c=typeof a.ariaLabel=="function"?a.ariaLabel.call(t):a.ariaLabel,h=typeof a.ariaChecked=="function"?a.ariaChecked.call(t):a.ariaChecked;if(es(n),G(l,"htItemWrapper"),t.getSettings().ariaTags){const d=!Hg(a,t)&&!lA(a)&&!SS(a);ye(n,[...EZ(a)?[OU(),Bh(c),RN(h)]:[PU(),Bh(u)],...d?[Cl(-1)]:[],...Hg(a,t)?[LU()]:[],...bS(a)?[Gr(!1)]:[]])}n.className="",n.appendChild(l),SS(a)?G(n,"htSeparator"):typeof a.renderer=="function"?(G(n,"htCustomMenuRenderer"),n.appendChild(a.renderer(e,l,r,i,o,u))):Ku(l,u),Hg(a,t)?G(n,"htDisabled"):lA(a)?G(n,"htSelectionDisabled"):bS(a)&&G(n,"htSubmenu")}}function xy(t,e,n){PZ(t,e),e.set(t,n)}function PZ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Fi(t,e,n){return(e=OZ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function OZ(t){var e=xZ(t,"string");return typeof e=="symbol"?e:e+""}function xZ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ay(t,e,n){return t.set(lL(t,e),n),n}function Sa(t,e){return t.get(lL(t,e))}function lL(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const cA=215;var Lc=new WeakMap,Pf=new WeakMap,Of=new WeakMap;class ec{get tableBorderWidth(){return Sa(Of,this)===void 0&&this.hotMenu&&Ay(Of,this,parseInt(this.hotMenu.rootWindow.getComputedStyle(this.hotMenu.view._wt.wtTable.TABLE).borderWidth,10)),Sa(Of,this)}constructor(e,n){var r=this;Fi(this,"hot",void 0),Fi(this,"options",void 0),Fi(this,"eventManager",new _i(this)),Fi(this,"container",void 0),Fi(this,"positioner",void 0),Fi(this,"hotMenu",null),Fi(this,"hotSubMenus",{}),Fi(this,"parentMenu",void 0),Fi(this,"menuItems",null),Fi(this,"origOutsideClickDeselects",null),xy(this,Lc,void 0),xy(this,Pf,void 0),xy(this,Of,void 0),this.hot=e,this.options=n||{parent:null,name:null,className:"",keepInViewport:!0,standalone:!1,minWidth:cA,container:this.hot.rootDocument.documentElement},this.container=this.createContainer(this.options.name),this.positioner=new gZ(this.options.keepInViewport),this.parentMenu=this.options.parent||null,this.registerEvents(),this.isSubMenu()&&this.addLocalHook("afterSelectionChange",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r.parentMenu.runLocalHooks("afterSelectionChange",...o)}),this.hot.addHook("afterSetTheme",(i,o)=>{if(!o){var s;(s=this.hotMenu)===null||s===void 0||s.useTheme(i)}})}registerEvents(){let e=this.hot.rootWindow;for(;e;)this.eventManager.addEventListener(e.document,"mousedown",n=>this.onDocumentMouseDown(n)),this.eventManager.addEventListener(e.document,"touchstart",n=>this.onDocumentMouseDown(n)),this.eventManager.addEventListener(e.document,"contextmenu",n=>this.onDocumentContextMenu(n)),e=xu(e)}setMenuItems(e){this.menuItems=e}getNavigator(){return Sa(Lc,this)}getKeyboardShortcutsCtrl(){return Sa(Pf,this)}getSelectedItem(){return this.hasSelectedItem()?this.hotMenu.getSourceDataAtRow(this.hotMenu.getSelectedLast()[0]):null}hasSelectedItem(){return Array.isArray(this.hotMenu.getSelectedLast())}isSubMenu(){return this.parentMenu!==null}open(){this.runLocalHooks("beforeOpen"),this.container.removeAttribute("style"),this.container.style.display="block";const e=ip(a=>this.openSubMenu(a),300),n=this.options.minWidth||cA;let r=!1,i=rl(this.menuItems,a=>(a.key===Zh&&(r=!0),yZ(a,this.hot)));if(i.length<1&&!r)i.push(Jk()[Zh]);else if(i.length===0)return;i=RZ(i,xe);let o=!1;const s={data:i,colHeaders:!1,autoColumnSize:!0,autoWrapRow:!1,modifyColWidth(a){return ae(a)&&a<n?n:a},autoRowSize:!1,readOnly:!0,editor:!1,copyPaste:!1,hiddenRows:!0,maxCols:1,columns:[{data:"name",renderer:IZ(this.hot)}],renderAllRows:!0,fragmentSelection:!1,outsideClickDeselects:!1,disableVisualSelection:"area",layoutDirection:this.hot.isRtl()?"rtl":"ltr",ariaTags:!1,themeName:this.hot.getCurrentThemeName(),beforeRefreshDimensions:()=>!1,beforeOnCellMouseOver:(a,l)=>{Sa(Lc,this).setCurrentPage(l.row)},afterOnCellMouseOver:(a,l)=>{this.isAllSubMenusClosed()?e(l.row):this.openSubMenu(l.row)},afterOnCellContextMenu:a=>{a.preventDefault(),MP()&&o&&this.hasSelectedItem()&&this.close(!0)},afterSelection:(a,l,u,c,h)=>{this.hotMenu.view.isMouseDown()&&(h.value=!0),this.runLocalHooks("afterSelectionChange",this.getSelectedItem())},beforeOnCellMouseUp:a=>{this.hasSelectedItem()&&(o=!this.isCommandPassive(this.getSelectedItem()),this.executeCommand(a))},afterOnCellMouseUp:a=>{(!MP()||!sl(a))&&o&&this.hasSelectedItem()&&(zo()||WN()?this.hot._registerTimeout(()=>this.close(!0),325):this.close(!0))},afterUnlisten:()=>{!this.hasSelectedItem()&&this.isOpened()&&this.hotMenu.listen()}};this.origOutsideClickDeselects=this.hot.getSettings().outsideClickDeselects,this.hot.getSettings().outsideClickDeselects=!1,this.hotMenu=new this.hot.constructor(this.container,s),this.hotMenu.addHook("afterInit",()=>this.onAfterInit()),this.hotMenu.init(),Ay(Lc,this,TZ(this.hotMenu)),Ay(Pf,this,MZ(this)),Sa(Pf,this).listen(),this.focus(),this.isSubMenu()&&this.addLocalHook("afterOpen",()=>this.parentMenu.runLocalHooks("afterSubmenuOpen",this)),this.runLocalHooks("afterOpen",this)}close(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(this.isOpened()){if(e&&this.isSubMenu())this.parentMenu.close();else if(Sa(Lc,this).clear(),this.closeAllSubMenus(),this.container.style.display="none",this.hotMenu.destroy(),this.hotMenu=null,this.hot.getSettings().outsideClickDeselects=this.origOutsideClickDeselects,this.runLocalHooks("afterClose"),this.isSubMenu()){if(this.hot.getSettings().ariaTags){const n=this.parentMenu.hotMenu.getSelectedLast();if(n){const r=this.parentMenu.hotMenu.getCell(n[0],0);ye(r,[Gr(!1)])}}this.parentMenu.hotMenu.listen()}}}openSubMenu(e){if(!this.hotMenu)return!1;const n=this.hotMenu.getCell(e,0);if(this.closeAllSubMenus(),!n||!wZ(n))return!1;const r=this.hotMenu.getSourceDataAtRow(e),i=new ec(this.hot,{parent:this,name:r.name,className:this.options.className,keepInViewport:!0,container:this.options.container});return i.setMenuItems(r.submenu.items),i.open(),i.setPosition(n.getBoundingClientRect()),this.hotSubMenus[r.key]=i,this.hot.getSettings().ariaTags&&ye(n,[Gr(!0)]),i}closeSubMenu(e){const n=this.hotMenu.getSourceDataAtRow(e),r=this.hotSubMenus[n.key];if(r){r.destroy(),delete this.hotSubMenus[n.key];const i=this.hotMenu.getCell(e,0);this.hot.getSettings().ariaTags&&ye(i,[Gr(!1)])}}closeAllSubMenus(){M(this.hotMenu.getData(),(e,n)=>this.closeSubMenu(n))}isAllSubMenusClosed(){return Object.keys(this.hotSubMenus).length===0}focus(){this.isOpened()&&(this.hotMenu.rootElement.focus({preventScroll:!0}),this.getKeyboardShortcutsCtrl().listen(),this.hotMenu.listen())}destroy(){const e=this.container.parentNode;this.clearLocalHooks(),this.close(),this.parentMenu=null,this.eventManager.destroy(),e&&e.removeChild(this.container)}isOpened(){return this.hotMenu!==null}executeCommand(e){if(!this.isOpened()||!this.hasSelectedItem())return;const n=this.getSelectedItem();if(this.runLocalHooks("select",n,e),this.isCommandPassive(n))return;const r=this.hot.getSelectedRange(),i=r?mZ(r):[];this.runLocalHooks("executeCommand",n.key,i,e),this.isSubMenu()&&this.parentMenu.runLocalHooks("executeCommand",n.key,i,e)}isCommandPassive(e){return e.isCommand===!1||SS(e)||Hg(e,this.hot)||bS(e)}setOffset(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.positioner.setOffset(e,n)}setPosition(e){this.isSubMenu()&&this.positioner.setParentElement(this.parentMenu.container),this.positioner.setElement(this.container).updatePosition(e)}updateMenuDimensions(){const e=this.hotMenu.view.getStylesHandler(),{wtTable:n}=this.hotMenu.view._wt,r=this.hotMenu.getSettings().data,i=n.hider.style,o=n.holder.style,s=parseInt(i.width,10),a=fr(r,(l,u,c)=>{const d=this.hotMenu.getCell(c,0)?nn(this.hotMenu.getCell(c,0)):0;return l+(u.name===xe?1:d)},0);e.isClassicTheme()?(o.width=`${s+3}px`,o.height=`${a+3}px`):(o.width=`${s}px`,o.height=`${a}px`),i.height=o.height}createContainer(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;const n=this.options.container.ownerDocument;let r=e,i;return r&&(ot(r)&&(r=r.call(this.hot),r===null||It(r)?r="":r=r.toString()),r=r.replace(/[^A-Za-z0-9]/g,"_"),r=`${this.options.className}Sub_${r}`,i=n.querySelector(`.${this.options.className}.${r}`)),i||(i=n.createElement("div"),G(i,`htMenu handsontable ${this.options.className}`),r&&G(i,r),this.options.container.appendChild(i)),i}onAfterInit(){this.updateMenuDimensions(),this.hot.getSettings().ariaTags&&ye(this.hotMenu.rootElement,[IU(),Cl(-1)])}onDocumentMouseDown(e){this.isOpened()&&(this.options.standalone&&this.hotMenu&&!tl(e.target,this.hotMenu.rootElement)?this.close(!0):(this.isAllSubMenusClosed()||this.isSubMenu())&&!tl(e.target,".htMenu")&&this.close(!0))}onDocumentContextMenu(e){this.isOpened()&&ve(e.target,"htCore")&&tl(e.target,this.hotMenu.rootElement)&&e.preventDefault()}}ut(ec,Rn);function AZ(t,e){HZ(t,e),e.add(t)}function HZ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Hy(t,e,n){return(e=NZ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function NZ(t){var e=DZ(t,"string");return typeof e=="symbol"?e:e+""}function DZ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function xf(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const fh="contextMenu",kZ=70,hA=fh;re.getSingleton().register("afterContextMenuDefaultOptions");re.getSingleton().register("beforeContextMenuShow");re.getSingleton().register("afterContextMenuShow");re.getSingleton().register("afterContextMenuHide");re.getSingleton().register("afterContextMenuExecute");var $c=new WeakSet;class Pp extends Xe{constructor(){super(...arguments),AZ(this,$c),Hy(this,"commandExecutor",new nL(this.hot)),Hy(this,"itemsFactory",null),Hy(this,"menu",null)}static get PLUGIN_KEY(){return fh}static get PLUGIN_PRIORITY(){return kZ}static get PLUGIN_DEPS(){return["plugin:AutoColumnSize"]}static get DEFAULT_ITEMS(){return[Tp,_p,xe,Id,Pd,xe,Ep,xd,xe,Mp,Rp,xe,Od,xe,Vr]}isEnabled(){return!!this.hot.getSettings()[fh]}enablePlugin(){var e=this;if(this.enabled)return;const n=this.hot.getSettings()[fh];typeof n.callback=="function"&&this.commandExecutor.setCommonCallback(n.callback),this.menu=new ec(this.hot,{className:"htContextMenu",keepInViewport:!0,container:n.uiContainer||this.hot.rootDocument.body}),this.menu.addLocalHook("beforeOpen",()=>xf($c,this,$Z).call(this)),this.menu.addLocalHook("afterOpen",()=>xf($c,this,FZ).call(this)),this.menu.addLocalHook("afterClose",()=>xf($c,this,VZ).call(this)),this.menu.addLocalHook("executeCommand",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return e.executeCommand.call(e,...i)}),this.addHook("afterOnCellContextMenu",r=>xf($c,this,LZ).call(this,r)),this.registerShortcuts(),super.enablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.close(),this.menu&&(this.menu.destroy(),this.menu=null),this.unregisterShortcuts(),super.disablePlugin()}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Control/Meta","Shift","Backslash"],["Shift","F10"]],callback:()=>{const{highlight:e}=this.hot.getSelectedRangeLast();this.hot.scrollToFocusedCell();const n=this.hot.getCell(e.row,e.col,!0).getBoundingClientRect(),r=bp(this.menu.container,this.hot.rootDocument);this.open({left:n.left+r.left,top:n.top+r.top-1+n.height},{left:n.width,above:-n.height}),this.menu.getNavigator().toFirstItem()},runOnlyIf:()=>{var e;const n=(e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;return n&&this.hot.selection.isCellVisible(n)&&!this.menu.isOpened()},group:hA})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(hA)}open(e){var n;let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{above:0,below:0,left:0,right:0};if((n=this.menu)!==null&&n!==void 0&&n.isOpened())return;this.prepareMenuItems(),this.menu.open();const i=this.menu.tableBorderWidth>0;He(r,(o,s)=>{const a=["below","right"].includes(s)?o+1:o-1;this.menu.setOffset(s,i?o:a)}),this.menu.setPosition(e)}close(){var e;(e=this.menu)===null||e===void 0||e.close(),this.itemsFactory=null}executeCommand(e){this.itemsFactory===null&&this.prepareMenuItems();for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];this.commandExecutor.execute(e,...r)}prepareMenuItems(){this.itemsFactory=new rL(this.hot,Pp.DEFAULT_ITEMS);const e=this.hot.getSettings()[fh],n={items:this.itemsFactory.getItems(e)};this.hot.runHooks("afterContextMenuDefaultOptions",n),this.itemsFactory.setPredefinedItems(n.items);const r=this.itemsFactory.getItems(e);this.hot.runHooks("beforeContextMenuSetItems",r),this.menu.setMenuItems(r),M(r,i=>this.commandExecutor.registerCommand(i.key,i))}destroy(){this.close(),this.menu&&this.menu.destroy(),super.destroy()}}function LZ(t){const e=this.hot.getSettings(),n=e.rowHeaders,r=e.colHeaders;function i(a){return a.nodeName==="TD"||a.parentNode.nodeName==="TD"}const o=t.target;if(this.close(),ve(o,"handsontableInput")||(t.preventDefault(),t.stopPropagation(),!(n||r)&&!i(o)&&!(ve(o,"current")&&ve(o,"wtBorder"))))return;const s=bp(this.menu.container,this.hot.rootDocument);this.open({top:t.clientY+s.top,left:t.clientX+s.left})}function $Z(){this.hot.runHooks("beforeContextMenuShow",this)}function FZ(){this.hot.runHooks("afterContextMenuShow",this)}function VZ(){this.hot.listen(),this.hot.runHooks("afterContextMenuHide",this)}Pp.SEPARATOR={name:xe};function WZ(t){return{key:"copy",name(){return this.getTranslatedPhrase(wE)},callback(){t.copyCellsOnly()},disabled(){if(this.countRows()===0||this.countCols()===0)return!0;const e=this.getSelectedRangeLast();if(!e||e.isSingleHeader())return!0;const n=this.getSelected();return!n||n.length>1},hidden:!1}}function BZ(t){return{key:"copy_column_headers_only",name(){const e=this.getSelectedRangeLast(),n=e?Ue(e.getWidth()-1,0,1):0;return this.getTranslatedPhrase(yE,n)},callback(){t.copyColumnHeadersOnly()},disabled(){if(!this.hasColHeaders())return!0;const e=this.getSelectedRangeLast();if(!e||e.isSingleHeader())return!0;const n=this.getSelected();return!n||n.length>1},hidden:!1}}function jZ(t){return{key:"copy_with_column_group_headers",name(){const e=this.getSelectedRangeLast(),n=e?Ue(e.getWidth()-1,0,1):0;return this.getTranslatedPhrase(CE,n)},callback(){t.copyWithAllColumnHeaders()},disabled(){if(!this.hasColHeaders()||!this.getSettings().nestedHeaders)return!0;const e=this.getSelectedRangeLast();if(!e||e.isSingleHeader())return!0;const n=this.getSelected();return!n||n.length>1},hidden:!1}}function UZ(t){return{key:"copy_with_column_headers",name(){const e=this.getSelectedRangeLast(),n=e?Ue(e.getWidth()-1,0,1):0;return this.getTranslatedPhrase(vE,n)},callback(){t.copyWithColumnHeaders()},disabled(){if(!this.hasColHeaders())return!0;const e=this.getSelectedRangeLast();if(!e||e.isSingleHeader())return!0;const n=this.getSelected();return!n||n.length>1},hidden:!1}}function zZ(t){return{key:"cut",name(){return this.getTranslatedPhrase(bE)},callback(){t.cut()},disabled(){if(this.countRows()===0||this.countCols()===0)return!0;const e=this.getSelectedRangeLast();if(!e||e.isSingleHeader())return!0;const n=this.getSelected();return!n||n.length>1},hidden:!1}}class YZ{constructor(){this.data={}}setData(e,n){this.data[e]=n}getData(e){return this.data[e]||void 0}}class GZ{constructor(){this.clipboardData=new YZ}preventDefault(){}composedPath(){return[]}}function qZ(t,e){uL(t,e),e.add(t)}function zl(t,e,n){uL(t,e),e.set(t,n)}function uL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Vn(t,e){return t.get(yu(t,e))}function Yl(t,e,n){return t.set(yu(t,e),n),n}function yu(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var ms=new WeakMap,Ny=new WeakMap,Fc=new WeakMap,RS=new WeakMap,ES=new WeakMap,Vc=new WeakMap,Wc=new WeakSet;class KZ{constructor(e){let{countRows:n,countColumns:r,rowsLimit:i,columnsLimit:o,countColumnHeaders:s}=e;qZ(this,Wc),zl(this,ms,void 0),zl(this,Ny,void 0),zl(this,Fc,void 0),zl(this,RS,void 0),zl(this,ES,void 0),zl(this,Vc,void 0),Yl(Ny,this,n),Yl(Fc,this,r),Yl(RS,this,i),Yl(ES,this,o),Yl(Vc,this,s)}setSelectedRange(e){Yl(ms,this,e)}getCellsRange(){if(Vn(Ny,this).call(this)===0||Vn(Fc,this).call(this)===0)return null;const{row:e,col:n}=Vn(ms,this).getTopStartCorner(),{row:r,col:i}=Vn(ms,this).getBottomEndCorner(),o=yu(Wc,this,XZ).call(this,e,r),s=yu(Wc,this,Dy).call(this,n,i);return{isRangeTrimmed:r!==o||i!==s,startRow:e,startCol:n,endRow:o,endCol:s}}getMostBottomColumnHeadersRange(){if(Vn(Fc,this).call(this)===0||Vn(Vc,this).call(this)===0)return null;const{col:e}=Vn(ms,this).getTopStartCorner(),{col:n}=Vn(ms,this).getBottomEndCorner(),r=yu(Wc,this,Dy).call(this,e,n);return{isRangeTrimmed:n!==r,startRow:-1,startCol:e,endRow:-1,endCol:r}}getAllColumnHeadersRange(){if(Vn(Fc,this).call(this)===0||Vn(Vc,this).call(this)===0)return null;const{col:e}=Vn(ms,this).getTopStartCorner(),{col:n}=Vn(ms,this).getBottomEndCorner(),r=yu(Wc,this,Dy).call(this,e,n);return{isRangeTrimmed:n!==r,startRow:-Vn(Vc,this).call(this),startCol:e,endRow:-1,endCol:r}}}function Dy(t,e){return Math.min(e,Math.max(t+Vn(ES,this).call(this)-1,t))}function XZ(t,e){return Math.min(e,Math.max(t+Vn(RS,this).call(this)-1,t))}function cL(t){const e=[],n=[];return M(t,r=>{const i=Math.min(r.startRow,r.endRow),o=Math.max(r.startRow,r.endRow);de(i,o,l=>{e.indexOf(l)===-1&&e.push(l)});const s=Math.min(r.startCol,r.endCol),a=Math.max(r.startCol,r.endCol);de(s,a,l=>{n.indexOf(l)===-1&&n.push(l)})}),{rows:e,columns:n}}function ZZ(t,e){hL(t,e),e.add(t)}function ps(t,e,n){hL(t,e),e.set(t,n)}function hL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Bc(t,e,n){return(e=QZ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function QZ(t){var e=JZ(t,"string");return typeof e=="symbol"?e:e+""}function JZ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ar(t,e){return t.get(ur(t,e))}function hi(t,e,n){return t.set(ur(t,e),n),n}function ur(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}re.getSingleton().register("afterCopyLimit");re.getSingleton().register("modifyCopyableRange");re.getSingleton().register("beforeCut");re.getSingleton().register("afterCut");re.getSingleton().register("beforePaste");re.getSingleton().register("afterPaste");re.getSingleton().register("beforeCopy");re.getSingleton().register("afterCopy");const ky="copyPaste",eQ=80,tQ=["fragmentSelection"],dA=['<meta name="generator" content="Handsontable"/>','<style type="text/css">td{white-space:normal}br{mso-data-placement:same-cell}</style>'].join("");var TS=new WeakMap,_S=new WeakMap,MS=new WeakMap,Gl=new WeakMap,Af=new WeakMap,Hf=new WeakMap,ql=new WeakMap,pm=new WeakMap,Sr=new WeakSet;class nQ extends Xe{constructor(){super(...arguments),ZZ(this,Sr),Bc(this,"columnsLimit",1/0),Bc(this,"rowsLimit",1/0),Bc(this,"pasteMode","overwrite"),Bc(this,"uiContainer",this.hot.rootDocument.body),ps(this,TS,!1),ps(this,_S,!1),ps(this,MS,!1),ps(this,Gl,"cells-only"),ps(this,Af,!1),ps(this,Hf,!1),ps(this,ql,new KZ({countRows:()=>this.hot.countRows(),countColumns:()=>this.hot.countCols(),rowsLimit:()=>this.rowsLimit,columnsLimit:()=>this.columnsLimit,countColumnHeaders:()=>this.hot.view.getColumnHeadersCount()})),ps(this,pm,!1),Bc(this,"copyableRanges",[])}static get PLUGIN_KEY(){return ky}static get SETTING_KEYS(){return[ky,...tQ]}static get PLUGIN_PRIORITY(){return eQ}static get DEFAULT_SETTINGS(){return{pasteMode:"overwrite",rowsLimit:1/0,columnsLimit:1/0,copyColumnHeaders:!1,copyColumnGroupHeaders:!1,copyColumnHeadersOnly:!1}}isEnabled(){return!!this.hot.getSettings()[ky]}enablePlugin(){var e,n,r=this;this.enabled||(this.pasteMode=(e=this.getSetting("pasteMode"))!==null&&e!==void 0?e:this.pasteMode,this.rowsLimit=isNaN(this.getSetting("rowsLimit"))?this.rowsLimit:this.getSetting("rowsLimit"),this.columnsLimit=isNaN(this.getSetting("columnsLimit"))?this.columnsLimit:this.getSetting("columnsLimit"),hi(TS,this,this.getSetting("copyColumnHeaders")),hi(_S,this,this.getSetting("copyColumnGroupHeaders")),hi(MS,this,this.getSetting("copyColumnHeadersOnly")),this.uiContainer=(n=this.getSetting("uiContainer"))!==null&&n!==void 0?n:this.uiContainer,this.addHook("afterContextMenuDefaultOptions",i=>ur(Sr,this,oQ).call(this,i)),this.addHook("afterSelection",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return ur(Sr,r,sQ).call(r,...o)}),this.addHook("afterSelectionEnd",()=>ur(Sr,this,aQ).call(this)),this.eventManager.addEventListener(this.hot.rootDocument,"copy",function(){return r.onCopy(...arguments)}),this.eventManager.addEventListener(this.hot.rootDocument,"cut",function(){return r.onCut(...arguments)}),this.eventManager.addEventListener(this.hot.rootDocument,"paste",function(){return r.onPaste(...arguments)}),Qg()&&(this.eventManager.addEventListener(this.hot.rootDocument.body,"mouseenter",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return ur(Sr,r,lQ).call(r,...o)}),this.eventManager.addEventListener(this.hot.rootDocument.body,"mouseleave",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return ur(Sr,r,uQ).call(r,...o)}),this.addHook("afterSelection",()=>ur(Sr,this,cQ).call(this))),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){super.disablePlugin()}copy(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"cells-only";hi(Gl,this,e),hi(Af,this,!0),ur(Sr,this,fA).call(this,"copy")}copyCellsOnly(){this.copy("cells-only")}copyColumnHeadersOnly(){this.copy("column-headers-only")}copyWithAllColumnHeaders(){this.copy("with-column-group-headers")}copyWithColumnHeaders(){this.copy("with-column-headers")}cut(){hi(Hf,this,!0),ur(Sr,this,fA).call(this,"cut")}getRangedCopyableData(e){return bh(this.getRangedData(e))}getRangedData(e){const n=[],{rows:r,columns:i}=cL(e);return M(r,o=>{const s=[];M(i,a=>{o<0?s.push(this.hot.getColHeader(a,o)):s.push(this.hot.getCopyableData(o,a))}),n.push(s)}),n}paste(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e;if(!e&&!n)return;const r=new GZ;e&&r.clipboardData.setData("text/plain",e),n&&r.clipboardData.setData("text/html",n),this.onPaste(r)}setCopyableText(){const e=this.hot.getSelectedRangeLast();if(!e)return;if(e.isSingleHeader()){this.copyableRanges=[];return}ar(ql,this).setSelectedRange(e);const n=new Map([["headers",null],["cells",null]]);ar(Gl,this)==="column-headers-only"?n.set("headers",ar(ql,this).getMostBottomColumnHeadersRange()):(ar(Gl,this)==="with-column-headers"?n.set("headers",ar(ql,this).getMostBottomColumnHeadersRange()):ar(Gl,this)==="with-column-group-headers"&&n.set("headers",ar(ql,this).getAllColumnHeadersRange()),n.set("cells",ar(ql,this).getCellsRange())),this.copyableRanges=Array.from(n.values()).filter(i=>i!==null).map(i=>{let{startRow:o,startCol:s,endRow:a,endCol:l}=i;return{startRow:o,startCol:s,endRow:a,endCol:l}}),this.copyableRanges=this.hot.runHooks("modifyCopyableRange",this.copyableRanges);const r=n.get("cells");if(r!==null&&r.isRangeTrimmed){const{startRow:i,startCol:o,endRow:s,endCol:a}=r;this.hot.runHooks("afterCopyLimit",s-i+1,a-o+1,this.rowsLimit,this.columnsLimit)}}isEditorOpened(){var e;return(e=this.hot.getActiveEditor())===null||e===void 0?void 0:e.isOpened()}populateValues(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.hot.getSelectedRangeLast();if(!e.length)return;const r=e.length,i=e[0].length,o=[],{row:s,col:a}=n.getTopStartCorner(),{row:l,col:u}=n.getBottomEndCorner();let c=s,h=a,d=s,f=a;for(;o.length<r||c<=l;){const{skipRowOnPaste:g,visualRow:C}=this.hot.getCellMeta(c,a);if(c=C+1,g===!0)continue;d=C,h=a;const y=[],E=o.length%r;for(;y.length<i||h<=u;){const{skipColumnOnPaste:v,visualCol:P}=this.hot.getCellMeta(s,h);if(h=P+1,v===!0)continue;f=P;const O=y.length%i;y.push(e[E][O])}o.push(y)}return hi(pm,this,!0),this.hot.populateFromArray(s,a,o,void 0,void 0,"CopyPaste.paste",this.pasteMode),[s,a,d,f]}onCopy(e){const n=e.composedPath()[0],r=this.hot.getFocusManager().getRefocusElement(),i=n==null?void 0:n.hasAttribute("data-hot-input");if(!this.hot.isListening()&&!ar(Af,this)||this.isEditorOpened()||Qo(n)&&(i&&n!==r||!i&&n!==this.hot.rootDocument.body&&!Eg(n,this.hot.rootElement)))return;e.preventDefault(),this.setCopyableText(),hi(Af,this,!1);const o=this.getRangedData(this.copyableRanges),s=ur(Sr,this,rQ).call(this,this.copyableRanges);if(!!this.hot.runHooks("beforeCopy",o,this.copyableRanges,s)){const l=bh(o);if(e&&e.clipboardData){const u=tO(o,this.hot.rootDocument);e.clipboardData.setData("text/plain",l),e.clipboardData.setData("text/html",[dA,u].join(""))}else typeof ClipboardEvent>"u"&&this.hot.rootWindow.clipboardData.setData("Text",l);this.hot.runHooks("afterCopy",o,this.copyableRanges,s)}hi(Gl,this,"cells-only")}onCut(e){const n=e.composedPath()[0],r=this.hot.getFocusManager().getRefocusElement(),i=n==null?void 0:n.hasAttribute("data-hot-input");if(!this.hot.isListening()&&!ar(Hf,this)||this.isEditorOpened()||Qo(n)&&(i&&n!==r||!i&&n!==this.hot.rootDocument.body&&!Eg(n,this.hot.rootElement)))return;e.preventDefault(),this.setCopyableText(),hi(Hf,this,!1);const o=this.getRangedData(this.copyableRanges);if(!!this.hot.runHooks("beforeCut",o,this.copyableRanges)){const a=bh(o);if(e&&e.clipboardData){const l=tO(o,this.hot.rootDocument);e.clipboardData.setData("text/plain",a),e.clipboardData.setData("text/html",[dA,l].join(""))}else typeof ClipboardEvent>"u"&&this.hot.rootWindow.clipboardData.setData("Text",a);this.hot.emptySelectedCells("CopyPaste.cut"),this.hot.runHooks("afterCut",o,this.copyableRanges)}}onPaste(e){const n=e.composedPath()[0],r=this.hot.getFocusManager().getRefocusElement(),i=n==null?void 0:n.hasAttribute("data-hot-input");if(!this.hot.isListening()||this.isEditorOpened()||!this.hot.getSelected()||Qo(n)&&(i&&n!==r||!i&&n!==this.hot.rootDocument.body&&!Eg(n,this.hot.rootElement)))return;e.preventDefault();let o;if(e&&typeof e.clipboardData<"u"){const c=TR(e.clipboardData.getData("text/html"),{ADD_TAGS:["meta"],ADD_ATTR:["content"],FORCE_BODY:!0});c&&/(<table)|(<TABLE)/g.test(c)?o=oY(c,this.hot.rootDocument).data:o=e.clipboardData.getData("text/plain")}else typeof ClipboardEvent>"u"&&typeof this.hot.rootWindow.clipboardData<"u"&&(o=this.hot.rootWindow.clipboardData.getData("Text"));if(typeof o=="string"&&(o=GK(o)),o===void 0||o&&o.length===0||this.hot.runHooks("beforePaste",o,this.copyableRanges)===!1)return;const[s,a,l,u]=this.populateValues(o);this.hot.selectCell(s,a,Math.min(this.hot.countRows()-1,l),Math.min(this.hot.countCols()-1,u)),this.hot.runHooks("afterPaste",o,this.copyableRanges)}destroy(){super.destroy()}}function fA(t){if(Qg()){const e=this.hot.getSelectedRangeLast();if(e){const{row:n,col:r}=e.highlight,i=this.hot.getCell(n,r,!0);i&&iz(i,()=>{this.hot.rootDocument.execCommand(t)})}}else this.hot.rootDocument.execCommand(t)}function rQ(t){const{rows:e}=cL(t);let n=0;for(let r=0;r<e.length&&!(e[r]>=0);r++)n+=1;return{columnHeadersCount:n}}function iQ(){if(this.hot.isListening()){const t=this.hot.getSelectedRangeLast();if(t){const{row:e,col:n}=t.highlight,r=this.hot.getCell(e,n,!0);r&&DN(r)}}}function dL(){if(this.hot.isListening()){const t=this.hot.getSelectedRangeLast();if(t){const{row:e,col:n}=t.highlight,r=this.hot.getCell(e,n,!0);r!=null&&r.hasAttribute("contenteditable")&&kN(r)}}}function oQ(t){t.items.push({name:"---------"},WZ(this)),ar(TS,this)&&t.items.push(UZ(this)),ar(_S,this)&&t.items.push(jZ(this)),ar(MS,this)&&t.items.push(BZ(this)),t.items.push(zZ(this))}function sQ(t,e,n,r,i){ar(pm,this)&&(i.value=!0),hi(pm,this,!1)}function aQ(){this.isEditorOpened()||this.hot.getSettings().fragmentSelection||this.setCopyableText()}function lQ(){ur(Sr,this,dL).call(this)}function uQ(){ur(Sr,this,iQ).call(this)}function cQ(){ur(Sr,this,dL).call(this)}function fL(t,e){return`border_row${t}col${e}`}function gh(){return{width:1,color:"#000"}}function Yo(){return{hide:!0}}function hQ(){return{width:1,color:"#000",cornerVisible:!1}}function Ly(t){if(ae(t.start)||ae(t.left)){var e;t.start=(e=t.start)!==null&&e!==void 0?e:t.left}if(ae(t.end)||ae(t.right)){var n;t.end=(n=t.end)!==null&&n!==void 0?n:t.right}return delete t.left,delete t.right,t}function jc(t){return ae(t.start)&&(t.left=t.start),ae(t.end)&&(t.right=t.end),t}function $y(t,e){return{id:fL(t,e),border:hQ(),row:t,col:e,top:Yo(),bottom:Yo(),start:Yo(),end:Yo()}}function dQ(t,e){return tn(e,"border")&&e.border&&(t.border=e.border),tn(e,"top")&&ae(e.top)&&(e.top?(Ae(e.top)||(e.top=gh()),t.top=e.top):(e.top=Yo(),t.top=e.top)),tn(e,"bottom")&&ae(e.bottom)&&(e.bottom?(Ae(e.bottom)||(e.bottom=gh()),t.bottom=e.bottom):(e.bottom=Yo(),t.bottom=e.bottom)),tn(e,"start")&&ae(e.start)&&(e.start?(Ae(e.start)||(e.start=gh()),t.start=e.start):(e.start=Yo(),t.start=e.start)),tn(e,"end")&&ae(e.end)&&(e.end?(Ae(e.end)||(e.end=gh()),t.end=e.end):(e.end=Yo(),t.end=e.end)),t}function ns(t,e){let n=!1;return M(t.getSelectedRange(),r=>{r.forAll((i,o)=>{if(i<0||o<0)return;const s=t.getCellMeta(i,o).borders;if(s)if(e){if(!tn(s[e],"hide")||s[e].hide===!1)return n=!0,!1}else return n=!0,!1})}),n}function Op(t){return`<span class="selected">✓</span>${t}`}function fQ(t){return t.some(e=>ae(e.left)||ae(e.right))}function gQ(t){return t.some(e=>ae(e.start)||ae(e.end))}const mQ=new Map([["left","start"],["right","end"]]);function pQ(t){var e;return(e=mQ.get(t))!==null&&e!==void 0?e:t}function wQ(t){return{key:"borders:bottom",name(){let e=this.getTranslatedPhrase(WE);return ns(this,"bottom")&&(e=Op(e)),e},callback(e,n){const r=ns(this,"bottom");t.prepareBorder(n,"bottom",r)}}}function vQ(t){const e=t.hot.isRtl()?"end":"start";return{key:"borders:left",name(){let n=this.getTranslatedPhrase(BE);return ns(this,e)&&(n=Op(n)),n},callback(n,r){const i=ns(this,e);t.prepareBorder(r,e,i)}}}function CQ(t){return{key:"borders:no_borders",name(){return this.getTranslatedPhrase(jE)},callback(e,n){t.prepareBorder(n,"noBorders")},disabled(){return!ns(this)}}}function yQ(t){const e=t.hot.isRtl()?"start":"end";return{key:"borders:right",name(){let n=this.getTranslatedPhrase(VE);return ns(this,e)&&(n=Op(n)),n},callback(n,r){const i=ns(this,e);t.prepareBorder(r,e,i)}}}function bQ(t){return{key:"borders:top",name(){let e=this.getTranslatedPhrase(FE);return ns(this,"top")&&(e=Op(e)),e},callback(e,n){const r=ns(this,"top");t.prepareBorder(n,"top",r)}}}function SQ(t,e){RQ(t,e),e.add(t)}function RQ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function EQ(t,e,n){return(e=TQ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function TQ(t){var e=_Q(t,"string");return typeof e=="symbol"?e:e+""}function _Q(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function gA(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const Ng="customBorders",MQ=90;var Fy=new WeakSet;class IQ extends Xe{constructor(){super(...arguments),SQ(this,Fy),EQ(this,"savedBorders",[])}static get PLUGIN_KEY(){return Ng}static get PLUGIN_PRIORITY(){return MQ}isEnabled(){return!!this.hot.getSettings()[Ng]}enablePlugin(){this.enabled||(this.addHook("afterContextMenuDefaultOptions",e=>gA(Fy,this,PQ).call(this,e)),this.addHook("init",()=>gA(Fy,this,OQ).call(this)),super.enablePlugin())}disablePlugin(){this.hideBorders(),super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.changeBorderSettings(),super.updatePlugin()}setBorders(e,n){let r=["top","bottom","start","end"],i=null;n&&(this.checkSettingsCohesion([n]),r=Object.keys(n),i=Ly(n));const o=Nu(e),s=Gh(o,{createCellCoords:this.hot._createCellCoords.bind(this.hot),createCellRange:this.hot._createCellRange.bind(this.hot)});M(e,a=>{s(a).forAll((l,u)=>{M(r,c=>{this.prepareBorderFromCustomAdded(l,u,i,pQ(c))})})}),this.hot.view.render()}getBorders(e){if(!Array.isArray(e))return this.savedBorders;const n=Nu(e),r=Gh(n,{createCellCoords:this.hot._createCellCoords.bind(this.hot),createCellRange:this.hot._createCellRange.bind(this.hot)}),i=[];return M(e,o=>{r(o).forAll((s,a)=>{M(this.savedBorders,l=>{l.row===s&&l.col===a&&i.push(jc(l))})})}),i}clearBorders(e){e?this.setBorders(e):(M(this.savedBorders,n=>{this.clearBordersFromSelectionSettings(n.id),this.clearNullCellRange(),this.hot.removeCellMeta(n.row,n.col,"borders")}),this.savedBorders.length=0)}insertBorderIntoSettings(e,n){this.checkSavedBorders(e)||this.savedBorders.push(e);const i=this.hot._createCellRange(this.hot._createCellCoords(e.row,e.col));this.checkCustomSelections(e,i,n)||this.hot.selection.highlight.addCustomSelection({border:e,visualCellRange:i})}prepareBorderFromCustomAdded(e,n,r,i){const o=this.hot.countRows(),s=this.hot.countCols();if(e>=o||n>=s)return;let a=$y(e,n);r&&(a=dQ(a,r),M(this.hot.selection.highlight.customSelections,l=>{if(a.id===l.settings.id)return Object.assign(l.settings,r),a.id=l.settings.id,a.top=l.settings.top,a.bottom=l.settings.bottom,a.start=l.settings.start,a.end=l.settings.end,!1})),this.hot.setCellMeta(e,n,"borders",jc(a)),this.insertBorderIntoSettings(a,i)}prepareBorderFromCustomAddedRange(e,n){const r=Math.min(e.to.row,this.hot.countRows()-1),i=Math.min(e.to.col,this.hot.countCols()-1);de(e.from.row,r,o=>{de(e.from.col,i,s=>{const a=$y(o,s);let l=0;o===e.from.row&&tn(n,"top")&&(l+=1,a.top=n.top),o===e.to.row&&tn(n,"bottom")&&(l+=1,a.bottom=n.bottom),s===e.from.col&&tn(n,"start")&&(l+=1,a.start=n.start),s===e.to.col&&tn(n,"end")&&(l+=1,a.end=n.end),l>0&&(this.hot.setCellMeta(o,s,"borders",jc(a)),this.insertBorderIntoSettings(a))})})}removeAllBorders(e,n){const r=fL(e,n);this.spliceBorder(r),this.clearBordersFromSelectionSettings(r),this.clearNullCellRange(),this.hot.removeCellMeta(e,n,"borders")}setBorder(e,n,r,i){let o=this.hot.getCellMeta(e,n).borders;!o||o.border===void 0?o=$y(e,n):o=Ly(o),i?(o[r]=Yo(),this.countHide(o)===4?this.removeAllBorders(e,n):(this.checkCustomSelectionsFromContextMenu(o,r,i)||this.insertBorderIntoSettings(o),this.hot.setCellMeta(e,n,"borders",jc(o)))):(o[r]=gh(),this.checkCustomSelectionsFromContextMenu(o,r,i)||this.insertBorderIntoSettings(o),this.hot.setCellMeta(e,n,"borders",jc(o)))}prepareBorder(e,n,r){M(e,i=>{let{start:o,end:s}=i;if(o.row===s.row&&o.col===s.col)n==="noBorders"?this.removeAllBorders(o.row,o.col):this.setBorder(o.row,o.col,n,r);else switch(n){case"noBorders":de(o.col,s.col,a=>{de(o.row,s.row,l=>{this.removeAllBorders(l,a)})});break;case"top":de(o.col,s.col,a=>{this.setBorder(o.row,a,n,r)});break;case"bottom":de(o.col,s.col,a=>{this.setBorder(s.row,a,n,r)});break;case"start":de(o.row,s.row,a=>{this.setBorder(a,o.col,n,r)});break;case"end":de(o.row,s.row,a=>{this.setBorder(a,s.col,n,r)});break}})}createCustomBorders(e){M(e,n=>{const r=Ly(n);n.range?this.prepareBorderFromCustomAddedRange(n.range,r):this.prepareBorderFromCustomAdded(n.row,n.col,r)})}countHide(e){const{top:n,bottom:r,start:i,end:o}=e;return fr([n,r,i,o],(a,l)=>{let u=a;return l&&l.hide&&(u+=1),u},0)}clearBordersFromSelectionSettings(e){const n=Be(this.hot.selection.highlight.customSelections,r=>r.settings.id).indexOf(e);n>-1&&this.hot.selection.highlight.customSelections[n].clear()}clearNullCellRange(){M(this.hot.selection.highlight.customSelections,(e,n)=>{if(e.cellRange===null)return this.hot.selection.highlight.customSelections[n].destroy(),this.hot.selection.highlight.customSelections.splice(n,1),!1})}hideBorders(){M(this.savedBorders,e=>{this.clearBordersFromSelectionSettings(e.id),this.clearNullCellRange()})}spliceBorder(e){const n=Be(this.savedBorders,r=>r.id).indexOf(e);n>-1&&this.savedBorders.splice(n,1)}checkSavedBorders(e){let n=!1;return this.countHide(e)===4?(this.spliceBorder(e.id),n=!0):M(this.savedBorders,(i,o)=>{if(e.id===i.id)return this.savedBorders[o]=e,n=!0,!1}),n}checkCustomSelectionsFromContextMenu(e,n,r){let i=!1;return M(this.hot.selection.highlight.customSelections,o=>{if(e.id===o.settings.id){const s=this.hot.view._wt.selectionManager.getBorderInstances(o);return M(s,a=>{a.toggleHiddenClass(n,r)}),i=!0,!1}}),i}checkCustomSelections(e,n,r){const i=this.countHide(e);let o=!1;return i===4?(this.removeAllBorders(e.row,e.col),o=!0):M(this.hot.selection.highlight.customSelections,s=>{if(e.id===s.settings.id){if(s.visualCellRange=n,s.commit(),r){const a=this.hot.view._wt.selectionManager.getBorderInstances(s);M(a,l=>{l.changeBorderStyle(r,e)})}return o=!0,!1}}),o}changeBorderSettings(){const e=this.hot.getSettings()[Ng];if(Array.isArray(e)){const n=Gn(e);this.checkSettingsCohesion(n),n.length||(this.savedBorders=n),this.createCustomBorders(n)}else e!==void 0&&this.createCustomBorders(this.savedBorders)}checkSettingsCohesion(e){const n=fQ(e),r=gQ(e);if(n&&r)throw new Error('The "left"/"right" and "start"/"end" options should not be used together. Please use only the option "start"/"end".');if(this.hot.isRtl()&&n)throw new Error('The "left"/"right" properties are not supported for RTL. Please use option "start"/"end".')}destroy(){super.destroy()}}function PQ(t){this.hot.getSettings()[Ng]&&t.items.push({name:"---------"},{key:"borders",name(){return this.getTranslatedPhrase($E)},disabled(){const e=this.getSelectedRangeLast();return!e||e.isSingleHeader()?!0:this.selection.isSelectedByCorner()},submenu:{items:[bQ(this),yQ(this),wQ(this),vQ(this),CQ(this)]}})}function OQ(){this.changeBorderSettings()}function xQ(t,e){AQ(t,e),e.add(t)}function AQ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Vy(t,e,n){return(e=HQ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function HQ(t){var e=NQ(t,"string");return typeof e=="symbol"?e:e+""}function NQ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function mA(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const pA="dragToScroll",DQ=100;var Wy=new WeakSet;class kQ extends Xe{constructor(){super(...arguments),xQ(this,Wy),Vy(this,"boundaries",null),Vy(this,"callback",null),Vy(this,"listening",!1)}static get PLUGIN_KEY(){return pA}static get PLUGIN_PRIORITY(){return DQ}isEnabled(){return!!this.hot.getSettings()[pA]}enablePlugin(){this.enabled||(this.addHook("afterOnCellMouseDown",e=>mA(Wy,this,wA).call(this,e)),this.addHook("afterOnCellCornerMouseDown",e=>mA(Wy,this,wA).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&&arguments[0]!==void 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,n){let r=0,i=0;n<this.boundaries.top?i=n-this.boundaries.top:n>this.boundaries.bottom&&(i=n-this.boundaries.bottom),e<this.boundaries.left?r=e-this.boundaries.left:e>this.boundaries.right&&(r=e-this.boundaries.right),this.callback(r,i)}listen(){this.listening=!0}unlisten(){this.listening=!1}isListening(){return this.listening}registerEvents(){const{rootWindow:e}=this.hot;let n=e;for(;n;)this.eventManager.addEventListener(n.document,"contextmenu",()=>this.unlisten()),this.eventManager.addEventListener(n.document,"mouseup",()=>this.unlisten()),this.eventManager.addEventListener(n.document,"mousemove",r=>this.onMouseMove(r)),n=xu(n)}unregisterEvents(){this.eventManager.clear()}onMouseMove(e){this.isListening()&&this.check(e.clientX,e.clientY)}destroy(){super.destroy()}}function wA(t){if(sl(t))return;const e=this.hot.view._wt.wtOverlays.topOverlay.mainTableScrollableElement;this.setBoundaries(e!==this.hot.rootWindow?e.getBoundingClientRect():void 0),this.setCallback((n,r)=>{var i,o;const s=(i=e.scrollLeft)!==null&&i!==void 0?i:e.scrollX,a=(o=e.scrollTop)!==null&&o!==void 0?o:e.scrollY;e.scroll(s+Math.sign(n)*50,a+Math.sign(r)*20)}),this.listen()}function LQ(t,e){gL(t,e),e.add(t)}function $Q(t,e,n){gL(t,e),e.set(t,n)}function gL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function By(t,e,n){return(e=FQ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function FQ(t){var e=VQ(t,"string");return typeof e=="symbol"?e:e+""}function VQ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function WQ(t,e){return t.get(Wr(t,e))}function mL(t,e,n){return t.set(Wr(t,e),n),n}function Wr(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}re.getSingleton().register("afterDropdownMenuDefaultOptions");re.getSingleton().register("beforeDropdownMenuShow");re.getSingleton().register("afterDropdownMenuShow");re.getSingleton().register("afterDropdownMenuHide");re.getSingleton().register("afterDropdownMenuExecute");const Dg="dropdownMenu",BQ=230,Qh="changeType",jy=Dg;var xp=new WeakMap,gi=new WeakSet;class Ap extends Xe{static get PLUGIN_KEY(){return Dg}static get PLUGIN_PRIORITY(){return BQ}static get PLUGIN_DEPS(){return["plugin:AutoColumnSize"]}static get DEFAULT_ITEMS(){return[Id,Pd,xe,xd,xe,Sp,xe,Od,xe,Vr]}constructor(e){super(e),LQ(this,gi),By(this,"commandExecutor",new nL(this.hot)),By(this,"itemsFactory",null),By(this,"menu",null),$Q(this,xp,!1),this.hot.addHook("afterGetColHeader",(n,r)=>Wr(gi,this,UQ).call(this,n,r))}isEnabled(){return this.hot.getSettings()[Dg]}enablePlugin(){var e=this;if(this.enabled)return;this.itemsFactory=new rL(this.hot,Ap.DEFAULT_ITEMS),this.addHook("beforeOnCellMouseDown",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return Wr(gi,e,XQ).call(e,...o)}),this.addHook("beforeViewportScrollHorizontally",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return Wr(gi,e,KQ).call(e,...o)});const n=this.hot.getSettings()[Dg],r={items:this.itemsFactory.getItems(n)};this.registerEvents(),typeof n.callback=="function"&&this.commandExecutor.setCommonCallback(n.callback),this.registerShortcuts(),super.enablePlugin(),this.callOnPluginsReady(()=>{this.hot.runHooks("afterDropdownMenuDefaultOptions",r),this.itemsFactory.setPredefinedItems(r.items);const i=this.itemsFactory.getItems(n);this.menu&&this.menu.destroy(),this.menu=new ec(this.hot,{className:"htDropdownMenu",keepInViewport:!0,container:n.uiContainer||this.hot.rootDocument.body}),this.hot.runHooks("beforeDropdownMenuSetItems",i),this.menu.setMenuItems(i),this.menu.addLocalHook("beforeOpen",()=>Wr(gi,this,zQ).call(this)),this.menu.addLocalHook("afterOpen",()=>Wr(gi,this,YQ).call(this)),this.menu.addLocalHook("afterSubmenuOpen",o=>Wr(gi,this,GQ).call(this,o)),this.menu.addLocalHook("afterClose",()=>Wr(gi,this,qQ).call(this)),this.menu.addLocalHook("executeCommand",function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return e.executeCommand.call(e,...s)}),M(i,o=>this.commandExecutor.registerCommand(o.key,o))})}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.close(),this.menu&&this.menu.destroy(),this.unregisterShortcuts(),super.disablePlugin()}registerShortcuts(){const e=this.hot.getShortcutManager().getContext("grid"),n=()=>{const{highlight:r}=this.hot.getSelectedRangeLast();if((r.isHeader()&&r.row===-1||r.isCell())&&r.col>=0){this.hot.selectColumns(r.col,r.col,-1);const{from:i}=this.hot.getSelectedRangeLast(),o=bp(this.menu.container,this.hot.rootDocument),s=this.hot.getCell(-1,i.col,!0).querySelector(`.${Qh}`),a=s.getBoundingClientRect();this.open({left:a.left+o.left,top:a.top+s.offsetHeight+o.top},{left:a.width,right:0,above:0,below:3}),this.menu.getNavigator().toFirstItem()}};e.addShortcuts([{keys:[["Shift","Alt","ArrowDown"],["Control/Meta","Enter"]],callback:n,runOnlyIf:()=>{var r;const i=(r=this.hot.getSelectedRangeLast())===null||r===void 0?void 0:r.highlight;return i&&this.hot.selection.isCellVisible(i)&&i.isHeader()&&!this.menu.isOpened()},captureCtrl:!0,group:jy},{keys:[["Shift","Alt","ArrowDown"]],callback:n,runOnlyIf:()=>{var r;const i=(r=this.hot.getSelectedRangeLast())===null||r===void 0?void 0:r.highlight;return i&&this.hot.selection.isCellVisible(i)&&i.isCell()&&!this.menu.isOpened()},group:jy}])}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(jy)}registerEvents(){this.eventManager.addEventListener(this.hot.rootElement,"click",e=>Wr(gi,this,jQ).call(this,e))}open(e){var n;let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{above:0,below:0,left:0,right:0};(n=this.menu)!==null&&n!==void 0&&n.isOpened()||(this.menu.open(),He(r,(i,o)=>{this.menu.setOffset(o,i)}),this.menu.setPosition(e))}close(){var e;(e=this.menu)===null||e===void 0||e.close()}executeCommand(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];this.commandExecutor.execute(e,...r)}setListening(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.menu.isOpened()&&(e?this.menu.hotMenu.listen():this.menu.hotMenu.unlisten())}destroy(){this.close(),this.menu&&this.menu.destroy(),super.destroy()}}function pL(t){t.getKeyboardShortcutsCtrl().addCustomShortcuts([{keys:[["Control/Meta","A"]],callback:()=>!1}])}function jQ(t){if(ve(t.target,Qh)){const e=bp(this.menu.container,this.hot.rootDocument),n=t.target.getBoundingClientRect();t.stopPropagation(),mL(xp,this,!1),this.open({left:n.left+e.left,top:n.top+t.target.offsetHeight+e.top},{left:n.width,right:0,above:0,below:3})}}function UQ(t,e){const n=e.parentNode;if(!n)return;const r=n.parentNode.childNodes,i=Array.prototype.indexOf.call(r,n);if(t<0||i!==r.length-1)return;const o=e.querySelector(`.${Qh}`);if(this.enabled&&o)return;if(!this.enabled){o&&o.parentNode.removeChild(o);return}const s=this.hot.rootDocument.createElement("button");s.className=Qh,s.type="button",s.tabIndex=-1,this.hot.getSettings().ariaTags&&(ye(s,[yl(),Bh(" ")]),ye(e,[yN("menu")])),s.onclick=function(){return!1},e.firstChild.insertBefore(s,e.firstChild.firstChild)}function zQ(){this.hot.runHooks("beforeDropdownMenuShow",this)}function YQ(){this.hot.runHooks("afterDropdownMenuShow",this),Wr(gi,this,pL).call(this,this.menu)}function GQ(t){Wr(gi,this,pL).call(this,t)}function qQ(){this.hot.listen(),this.hot.runHooks("afterDropdownMenuHide",this)}function KQ(t){return WQ(xp,this)?null:t}function XQ(t){ve(t.target,Qh)&&mL(xp,this,!0)}Ap.SEPARATOR={name:xe};function vA(t,e,n){return(e=ZQ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ZQ(t){var e=QQ(t,"string");return typeof e=="symbol"?e:e+""}function QQ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class JQ{constructor(e){vA(this,"hot",void 0),vA(this,"options",{}),this.hot=e}setOptions(e){this.options=e}getData(){const{startRow:e,startCol:n,endRow:r,endCol:i}=this._getDataRange(),o=this.options,s=[];return de(e,r,a=>{const l=[];!o.exportHiddenRows&&this._isHiddenRow(a)||(de(n,i,u=>{!o.exportHiddenColumns&&this._isHiddenColumn(u)||l.push(this.hot.getDataAtCell(a,u))}),s.push(l))}),s}getRowHeaders(){const e=[];if(this.options.rowHeaders){const{startRow:n,endRow:r}=this._getDataRange(),i=this.hot.getRowHeader();de(n,r,o=>{!this.options.exportHiddenRows&&this._isHiddenRow(o)||e.push(i[o])})}return e}getColumnHeaders(){const e=[];if(this.options.columnHeaders){const{startCol:n,endCol:r}=this._getDataRange(),i=this.hot.getColHeader();de(n,r,o=>{!this.options.exportHiddenColumns&&this._isHiddenColumn(o)||e.push(i[o])})}return e}_getDataRange(){const e=this.hot.countCols()-1,n=this.hot.countRows()-1;let[r=0,i=0,o=n,s=e]=this.options.range;return r=Math.max(r,0),i=Math.max(i,0),o=Math.min(o,n),s=Math.min(s,e),{startRow:r,startCol:i,endRow:o,endCol:s}}_isHiddenRow(e){return this.hot.rowIndexMapper.isHidden(this.hot.toPhysicalRow(e))}_isHiddenColumn(e){return this.hot.columnIndexMapper.isHidden(this.hot.toPhysicalColumn(e))}}function CA(t,e,n){return(e=eJ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function eJ(t){var e=tJ(t,"string");return typeof e=="symbol"?e:e+""}function tJ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class tT{static get DEFAULT_OPTIONS(){return{mimeType:"text/plain",fileExtension:"txt",filename:"Handsontable [YYYY]-[MM]-[DD]",encoding:"utf-8",bom:!1,columnHeaders:!1,rowHeaders:!1,exportHiddenColumns:!1,exportHiddenRows:!1,range:[]}}constructor(e,n){CA(this,"dataProvider",void 0),CA(this,"options",void 0),this.dataProvider=e,this.options=this._mergeOptions(n),this.dataProvider.setOptions(this.options)}_mergeOptions(e){let n=uo(this.constructor.DEFAULT_OPTIONS);const r=new Date;return n=rn(uo(tT.DEFAULT_OPTIONS),n),n=rn(n,e),n.filename=wN(n.filename,{YYYY:r.getFullYear(),MM:`${r.getMonth()+1}`.padStart(2,"0"),DD:`${r.getDate()}`.padStart(2,"0")}),n}}function nJ(t,e){rJ(t,e),e.add(t)}function rJ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function yA(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const wL="\r",iJ='"',oJ=`
|
|
259
|
+
`,sJ="=",aJ="+",lJ="-",uJ="@",cJ=" ";var Uy=new WeakSet;class hJ extends tT{constructor(){super(...arguments),nJ(this,Uy)}static get DEFAULT_OPTIONS(){return{mimeType:"text/csv",fileExtension:"csv",bom:!0,columnDelimiter:",",rowDelimiter:`\r
|
|
260
|
+
`,sanitizeValues:!1}}export(){const e=this.options,n=this.dataProvider.getData();let r=this.dataProvider.getColumnHeaders();const i=r.length>0,o=this.dataProvider.getRowHeaders(),s=o.length>0;let a=e.bom?"\uFEFF":"";return i&&(r=Be(r,l=>this._escapeCell(l,{force:!0,sanitizeValue:e.sanitizeValues})),s&&(a+=e.columnDelimiter),a+=r.join(e.columnDelimiter),a+=e.rowDelimiter),M(n,(l,u)=>{u>0&&(a+=e.rowDelimiter),s&&(a+=this._escapeCell(o[u],{sanitizeValue:e.sanitizeValues}),a+=e.columnDelimiter);const c=l.map(h=>this._escapeCell(h,{sanitizeValue:e.sanitizeValues})).join(e.columnDelimiter);a+=c}),a}_escapeCell(e){let{force:n=!1,sanitizeValue:r=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=Pt(e);return i===""||(r&&(n=!0),r instanceof RegExp?i=yA(Uy,this,fJ).call(this,i,r):typeof r=="function"?i=r(i):r&&(i=yA(Uy,this,dJ).call(this,i)),(n||i.indexOf(wL)>=0||i.indexOf(iJ)>=0||i.indexOf(oJ)>=0||i.indexOf(this.options.columnDelimiter)>=0)&&(i=i.replace(new RegExp('"',"g"),'""'),i=`"${i}"`)),i}}function dJ(t){return t.startsWith(sJ)||t.startsWith(aJ)||t.startsWith(lJ)||t.startsWith(uJ)||t.startsWith(cJ)||t.startsWith(wL)?`'${t}`:t}function fJ(t,e){return e.test(t)?`'${t}`:t}const gJ="csv",IS={[gJ]:hJ};function mJ(t,e,n){return typeof IS[t]=="function"?new IS[t](e,n):null}const pJ="exportFile",wJ=240;class vJ extends Xe{static get PLUGIN_KEY(){return pJ}static get PLUGIN_PRIORITY(){return wJ}isEnabled(){return!0}exportAsString(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this._createTypeFormatter(e,n).export()}exportAsBlob(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this._createBlob(this._createTypeFormatter(e,n))}downloadFile(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{rootDocument:r,rootWindow:i}=this.hot,o=this._createTypeFormatter(e,n),s=this._createBlob(o),a=i.URL||i.webkitURL,l=r.createElement("a"),u=`${o.options.filename}.${o.options.fileExtension}`;if(l.download!==void 0){const c=a.createObjectURL(s);l.style.display="none",l.setAttribute("href",c),l.setAttribute("download",u),r.body.appendChild(l),l.dispatchEvent(new MouseEvent("click")),r.body.removeChild(l),setTimeout(()=>{a.revokeObjectURL(c)},100)}else navigator.msSaveOrOpenBlob&&navigator.msSaveOrOpenBlob(s,u)}_createTypeFormatter(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!IS[e])throw new Error(`Export format type "${e}" is not supported.`);return mJ(e,new JQ(this.hot),n)}_createBlob(e){let n=null;return typeof Blob<"u"&&(n=new Blob([e.export()],{type:`${e.options.mimeType};charset=${e.options.encoding}`})),n}}function Kl(t,e,n){return(e=CJ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function CJ(t){var e=yJ(t,"string");return typeof e=="symbol"?e:e+""}function yJ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Ad{constructor(e,n){let{id:r,stateless:i=!0}=n;Kl(this,"hot",void 0),Kl(this,"id",void 0),Kl(this,"elements",[]),Kl(this,"hidden",!1),Kl(this,"stateId",""),Kl(this,"state",void 0),this.hot=e,this.id=r,this.stateId=`Filters.component.${this.id}`,this.state=i?null:this.hot.columnIndexMapper.registerMap(this.stateId,new hp)}getElements(){return this.elements}reset(){M(this.elements,e=>e.reset())}hide(){this.hidden=!0}show(){this.hidden=!1}isHidden(){return this.hot===null||this.hidden}restoreState(e){this.state&&this.setState(this.state.getValueAtIndex(e))}setState(){throw new Error("The state setting logic is not implemented")}saveState(e){this.state&&this.state.setValueAtIndex(e,this.getState())}getState(){throw new Error("The state gathering logic is not implemented")}destroy(){this.hot.columnIndexMapper.unregisterMap(this.stateId),this.clearLocalHooks(),M(this.elements,e=>e.destroy()),this.state=null,this.elements=null,this.hot=null}}ut(Ad,Rn);const Jh={};function zs(t,e){if(!Jh[t])throw Error(`Filter condition "${t}" does not exist.`);const{condition:n,descriptor:r}=Jh[t];let i=e;return r.inputValuesDecorator&&(i=r.inputValuesDecorator(i)),function(o){return n.apply(o.meta.instance,[].concat([o],[i]))}}function Za(t){if(!Jh[t])throw Error(`Filter condition "${t}" does not exist.`);return Jh[t].descriptor}function Xt(t,e,n){n.key=t,Jh[t]={condition:e,descriptor:n}}const wn="none";function bJ(){return!0}Xt(wn,bJ,{name:dp,inputsCount:0,showOperators:!1});const Eh="empty";function SJ(t){return Ut(t.value)}Xt(Eh,SJ,{name:XE,inputsCount:0,showOperators:!0});const kg="not_empty";function RJ(t,e){return!zs(Eh,e)(t)}Xt(kg,RJ,{name:ZE,inputsCount:0,showOperators:!0});const Th="eq";function EJ(t,e){let[n]=e;return Pt(t.value).toLocaleLowerCase(t.meta.locale)===Pt(n)}Xt(Th,EJ,{name:QE,inputsCount:1,showOperators:!0});const Lg="neq";function TJ(t,e){return!zs(Th,e)(t)}Xt(Lg,TJ,{name:JE,inputsCount:1,showOperators:!0});const vL="gt";function _J(t,e){let[n]=e,r=n;return t.meta.type==="numeric"&&(r=parseFloat(r,10)),t.value>r}Xt(vL,_J,{name:i0,inputsCount:1,showOperators:!0});const CL="gte";function MJ(t,e){let[n]=e,r=n;return t.meta.type==="numeric"&&(r=parseFloat(r,10)),t.value>=r}Xt(CL,MJ,{name:o0,inputsCount:1,showOperators:!0});const yL="lt";function IJ(t,e){let[n]=e,r=n;return t.meta.type==="numeric"&&(r=parseFloat(r,10)),t.value<r}Xt(yL,IJ,{name:s0,inputsCount:1,showOperators:!0});const bL="lte";function PJ(t,e){let[n]=e,r=n;return t.meta.type==="numeric"&&(r=parseFloat(r,10)),t.value<=r}Xt(bL,PJ,{name:a0,inputsCount:1,showOperators:!0});const nT="date_after";function OJ(t,e){let[n]=e;const r=X(t.value,t.meta.dateFormat),i=X(n,t.meta.dateFormat);return!r.isValid()||!i.isValid()?!1:r.diff(i)>=0}Xt(nT,OJ,{name:c0,inputsCount:1,showOperators:!0});const rT="date_before";function xJ(t,e){let[n]=e;const r=X(t.value,t.meta.dateFormat),i=X(n,t.meta.dateFormat);return!r.isValid()||!i.isValid()?!1:r.diff(i)<=0}Xt(rT,xJ,{name:h0,inputsCount:1,showOperators:!0});const wm="between";function AJ(t,e){let[n,r]=e,i=n,o=r;if(t.meta.type==="numeric"){const s=parseFloat(i,10),a=parseFloat(o,10);i=Math.min(s,a),o=Math.max(s,a)}else if(t.meta.type==="date"){const s=zs(rT,[o]),a=zs(nT,[i]);return s(t)&&a(t)}return t.value>=i&&t.value<=o}Xt(wm,AJ,{name:l0,inputsCount:2,showOperators:!0});const SL="not_between";function HJ(t,e){return!zs(wm,e)(t)}Xt(SL,HJ,{name:u0,inputsCount:2,showOperators:!0});const RL="begins_with";function NJ(t,e){let[n]=e;return Pt(t.value).toLocaleLowerCase(t.meta.locale).startsWith(Pt(n))}Xt(RL,NJ,{name:e0,inputsCount:1,showOperators:!0});const EL="ends_with";function DJ(t,e){let[n]=e;return Pt(t.value).toLocaleLowerCase(t.meta.locale).endsWith(Pt(n))}Xt(EL,DJ,{name:t0,inputsCount:1,showOperators:!0});const iT="contains";function kJ(t,e){let[n]=e;return Pt(t.value).toLocaleLowerCase(t.meta.locale).indexOf(Pt(n))>=0}Xt(iT,kJ,{name:n0,inputsCount:1,showOperators:!0});const TL="not_contains";function LJ(t,e){return!zs(iT,e)(t)}Xt(TL,LJ,{name:r0,inputsCount:1,showOperators:!0});const _L="date_tomorrow";function $J(t){const e=X(t.value,t.meta.dateFormat);return e.isValid()?e.isSame(X().subtract(-1,"days").startOf("day"),"d"):!1}Xt(_L,$J,{name:f0,inputsCount:0});const ML="date_today";function FJ(t){const e=X(t.value,t.meta.dateFormat);return e.isValid()?e.isSame(X().startOf("day"),"d"):!1}Xt(ML,FJ,{name:d0,inputsCount:0});const IL="date_yesterday";function VJ(t){const e=X(t.value,t.meta.dateFormat);return e.isValid()?e.isSame(X().subtract(1,"days").startOf("day"),"d"):!1}Xt(IL,VJ,{name:g0,inputsCount:0});hz();function WJ(t,e){let n=t;return n===""&&(n=`(${e})`),n}function Hd(t){const e=new Set(t);return function(n){return e.has(n)}}function oT(t){return t??""}function PS(t){return Array.from(new Set(t)).map(e=>oT(e)).sort((e,n)=>typeof e=="number"&&typeof n=="number"?e-n:e===n?0:e>n?1:-1)}function bA(t,e,n,r){const i=[],o=t===e;let s;return o||(s=Hd(e)),t.forEach(a=>{let l=!1;(o||s(a))&&(l=!0);const u={checked:l,value:a,visualValue:WJ(a,n)};r&&r(u),i.push(u)}),i}const Qa="by_value";function BJ(t,e){let[n]=e;return n(t.value)}Xt(Qa,BJ,{name:"By value",inputsCount:0,inputValuesDecorator(t){let[e]=t;return[Hd(e)]},showOperators:!1});const ed={};function jJ(t){if(!ed[t])throw Error(`Operation with id "${t}" does not exist.`);const e=ed[t].func;return function(n,r){return e(n,r)}}function UJ(t){return ed[t].name}function sT(t,e,n){ed[t]={name:e,func:n}}const js="conjunction",zJ=w0;function YJ(t,e){return t.every(n=>n.func(e))}sT(js,zJ,YJ);const vm="disjunction",GJ=fp;function qJ(t,e){return t.some(n=>n.func(e))}sT(vm,GJ,qJ);const aT="disjunctionWithExtraCondition",KJ=fp;function XJ(t,e){if(t.length<3)throw Error("Operation doesn't work on less then three conditions.");return t.slice(0,t.length-1).some(n=>n.func(e))&&t[t.length-1].func(e)}sT(aT,KJ,XJ);const ZJ="numeric",PL="text",QJ="date",SA={[ZJ]:[wn,xe,Eh,kg,xe,Th,Lg,xe,vL,CL,yL,bL,wm,SL],[PL]:[wn,xe,Eh,kg,xe,Th,Lg,xe,RL,EL,xe,iT,TL],[QJ]:[wn,xe,Eh,kg,xe,Th,Lg,xe,rT,nT,wm,xe,_L,ML,IL]};function JJ(t){const e=[];let n=t;return SA[n]||(n=PL),M(SA[n],r=>{let i;r===xe?i={name:xe}:i=uo(Za(r)),e.push(i)}),e}function Uc(t,e,n){return(e=eee(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function eee(t){var e=tee(t,"string");return typeof e=="symbol"?e:e+""}function tee(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const zy="built",Yy="building",RA=["click","input","keydown","keypress","keyup","focus","blur","change"];let Si=class OL{static get DEFAULTS(){return uo({className:"",value:"",tagName:"div",children:[],wrapIt:!0})}constructor(e,n){Uc(this,"hot",void 0),Uc(this,"eventManager",new _i(this)),Uc(this,"options",void 0),Uc(this,"_element",void 0),Uc(this,"buildState",void 0),this.hot=e,this.options=rn(OL.DEFAULTS,n),this._element=this.hot.rootDocument.createElement(this.options.wrapIt?"div":this.options.tagName)}setValue(e){this.options.value=e,this.update()}getValue(){return this.options.value}get element(){return this.buildState===Yy?this._element:this.buildState===zy?(this.update(),this._element):(this.buildState=Yy,this.build(),this.buildState=zy,this._element)}isBuilt(){return this.buildState===zy}translateIfPossible(e){return typeof e=="string"&&e.startsWith(qn)?this.hot.getTranslatedPhrase(e):e}build(){const e=(n,r)=>{this.eventManager.addEventListener(n,r,i=>this.runLocalHooks(r,i,this))};if(this.buildState||(this.buildState=Yy),this._element.setAttribute("data-hot-input",!0),this.options.tabIndex!==void 0&&this._element.setAttribute("tabindex",this.options.tabIndex),this.options.role!==void 0&&this._element.setAttribute("role",this.options.role),this.options.className&&G(this._element,this.options.className),this.options.children.length)M(this.options.children,n=>this._element.appendChild(n.element));else if(this.options.wrapIt){const n=this.hot.rootDocument.createElement(this.options.tagName);n.setAttribute("data-hot-input",!0),He(this.options,(r,i)=>{n[i]!==void 0&&i!=="className"&&i!=="tagName"&&i!=="children"&&(n[i]=this.translateIfPossible(r))}),this._element.appendChild(n),M(RA,r=>e(n,r))}else M(RA,n=>e(this._element,n))}update(){}reset(){this.options.value="",this.update()}show(){this.element.style.display=""}hide(){this.element.style.display="none"}focus(){}destroy(){this.eventManager.destroy(),this.eventManager=null,this.hot=null,this._element.parentNode&&this._element.parentNode.removeChild(this._element),this._element=null}};ut(Si,Rn);function nee(t,e){xL(t,e),e.add(t)}function ree(t,e,n){xL(t,e),e.set(t,n)}function xL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Nf(t,e){return t.get(lT(t,e))}function iee(t,e,n){return t.set(lT(t,e),n),n}function lT(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Xl=new WeakMap,EA=new WeakSet;class Us extends Si{static get DEFAULTS(){return uo({placeholder:"",type:"text",tagName:"input",tabIndex:-1})}constructor(e,n){super(e,rn(Us.DEFAULTS,n)),nee(this,EA),ree(this,Xl,void 0),this.registerHooks()}registerHooks(){this.addLocalHook("keyup",e=>lT(EA,this,oee).call(this,e))}build(){super.build();const e=this.hot.rootDocument.createElement("div");iee(Xl,this,this._element.firstChild),G(this._element,"htUIInput"),G(e,"htUIInputIcon"),this._element.appendChild(e),this.update()}update(){this.isBuilt()&&(Nf(Xl,this).type=this.options.type,Nf(Xl,this).placeholder=this.translateIfPossible(this.options.placeholder),Nf(Xl,this).value=this.translateIfPossible(this.options.value))}focus(){this.isBuilt()&&Nf(Xl,this).focus()}}function oee(t){this.options.value=t.target.value}function see(t,e){AL(t,e),e.add(t)}function zc(t,e,n){AL(t,e),e.set(t,n)}function AL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Zl(t,e,n){return t.set(_h(t,e),n),n}function Ot(t,e){return t.get(_h(t,e))}function _h(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var un=new WeakMap,Df=new WeakMap,kf=new WeakMap,Gy=new WeakMap,Lf=new WeakMap,$f=new WeakSet;class td extends Si{static get DEFAULTS(){return uo({className:"htUISelect",wrapIt:!1,tabIndex:-1})}constructor(e,n){super(e,rn(td.DEFAULTS,n)),see(this,$f),zc(this,un,null),zc(this,Df,[]),zc(this,kf,void 0),zc(this,Gy,void 0),zc(this,Lf,void 0),this.registerHooks()}getMenu(){return Ot(un,this)}registerHooks(){this.addLocalHook("click",()=>_h($f,this,uee).call(this))}setItems(e){Zl(Df,this,this.translateNames(e)),Ot(un,this)&&Ot(un,this).setMenuItems(Ot(Df,this))}translateNames(e){return M(e,n=>{n.name=this.translateIfPossible(n.name)}),e}build(){super.build(),Zl(un,this,new ec(this.hot,{className:"htSelectUI htFiltersConditionsMenu",keepInViewport:!1,standalone:!0,container:this.options.menuContainer})),Ot(un,this).setMenuItems(Ot(Df,this));const e=new Si(this.hot,{className:"htUISelectCaption"}),n=new Si(this.hot,{className:"htUISelectDropdown"});Zl(kf,this,e),Zl(Gy,this,e.element),Zl(Lf,this,n),this.hot.getSettings().ariaTags&&(ye(n.element,[yl()]),ye(this._element,[CN()])),M([e,n],r=>this._element.appendChild(r.element)),Ot(un,this).addLocalHook("select",r=>_h($f,this,aee).call(this,r)),Ot(un,this).addLocalHook("afterClose",()=>_h($f,this,lee).call(this)),this.update()}update(){if(!this.isBuilt())return;let e;this.options.value?e=this.options.value.name:e=Ot(un,this).hot.getTranslatedPhrase(dp),Ot(Gy,this).textContent=e,super.update()}openOptions(){const e=this.element.getBoundingClientRect();Ot(un,this)&&(Ot(un,this).open(),Ot(un,this).setPosition({left:this.hot.isLtr()?e.left-5:e.left-31,top:e.top-1,width:e.width,height:e.height}),Ot(un,this).getNavigator().toFirstItem(),Ot(un,this).getKeyboardShortcutsCtrl().addCustomShortcuts([{keys:[["Tab"],["Shift","Tab"]],callback:n=>{this.closeOptions(),this.runLocalHooks("tabKeydown",n)}},{keys:[["Control/Meta","A"]],callback:()=>!1}]))}closeOptions(){Ot(un,this)&&Ot(un,this).close()}focus(){this.isBuilt()&&this.element.focus()}destroy(){Ot(un,this)&&(Ot(un,this).destroy(),Zl(un,this,null)),Ot(kf,this)&&Ot(kf,this).destroy(),Ot(Lf,this)&&Ot(Lf,this).destroy(),super.destroy()}}function aee(t){t.name!==xe&&(this.options.value=t,this.update(),this.runLocalHooks("select",this.options.value))}function lee(){this.runLocalHooks("afterClose")}function uee(){this.openOptions()}function cee(t,e){hee(t,e),e.add(t)}function hee(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function TA(t,e,n){return(e=dee(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function dee(t){var e=fee(t,"string");return typeof e=="symbol"?e:e+""}function fee(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function _A(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var qy=new WeakSet;class OS extends Ad{constructor(e,n){super(e,{id:n.id,stateless:!1}),cee(this,qy),TA(this,"name",""),TA(this,"addSeparator",!1),this.name=n.name,this.addSeparator=n.addSeparator,this.elements.push(new td(this.hot,{menuContainer:n.menuContainer})),this.elements.push(new Us(this.hot,{placeholder:R0})),this.elements.push(new Us(this.hot,{placeholder:E0})),this.registerHooks()}registerHooks(){this.getSelectElement().addLocalHook("select",e=>_A(qy,this,gee).call(this,e)).addLocalHook("afterClose",()=>this.runLocalHooks("afterClose")).addLocalHook("tabKeydown",e=>this.runLocalHooks("selectTabKeydown",e)),M(this.getInputElements(),e=>{e.addLocalHook("keydown",n=>_A(qy,this,mee).call(this,n))})}setState(e){if(this.reset(),!e)return;const n=uo(e.command);n.name.startsWith($t)&&(n.name=this.hot.getTranslatedPhrase(n.name)),this.getSelectElement().setValue(n),M(e.args,(r,i)=>{if(i>n.inputsCount-1)return!1;const o=this.getInputElement(i);o.setValue(r),o[n.inputsCount>i?"show":"hide"](),i||this.hot._registerTimeout(()=>o.focus(),10)})}getState(){const e=this.getSelectElement().getValue()||Za(wn),n=[];return M(this.getInputElements(),(r,i)=>{e.inputsCount>i&&n.push(r.getValue())}),{command:e,args:n}}updateState(e,n){const r=Za(e?e.name:wn);this.state.setValueAtIndex(n,{command:r,args:e?e.args:[]}),e||M(this.getInputElements(),i=>i.setValue(null))}getSelectElement(){return this.elements.filter(e=>e instanceof td)[0]}getInputElement(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return this.getInputElements()[e]}getInputElements(){return this.elements.filter(e=>e instanceof Us)}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,n,r,i,o,s)=>{G(n.parentNode,"htFiltersMenuCondition"),this.addSeparator&&G(n.parentNode,"border");const a=this.hot.rootDocument.createElement("div");return G(a,"htFiltersMenuLabel"),a.textContent=s,n.appendChild(a),n.parentElement.hasAttribute("ghost-table")||M(this.elements,l=>n.appendChild(l.element)),n}}}reset(){const e=this.hot.getPlugin("filters").getSelectedColumn();let n=[Za(wn)];if(e!==null){const{visualIndex:r}=e;n=JJ(this.hot.getDataType(0,r,this.hot.countRows(),r))}M(this.getInputElements(),r=>r.hide()),this.getSelectElement().setItems(n),super.reset(),this.getSelectElement().setValue(n[0])}}function gee(t){M(this.getInputElements(),(e,n)=>{e[t.inputsCount>n?"show":"hide"](),n===0&&this.hot._registerTimeout(()=>e.focus(),10)}),this.runLocalHooks("change",t)}function mee(t){Cd(t.keyCode,"ESCAPE")&&(this.runLocalHooks("cancel"),Pi(t))}function MA(t,e,n){pee(t,e),e.set(t,n)}function pee(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Yc(t,e){return t.get(HL(t,e))}function IA(t,e,n){return t.set(HL(t,e),n),n}function HL(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Ql=new WeakMap,Ky=new WeakMap;class Cm extends Si{static get DEFAULTS(){return uo({type:"radio",tagName:"input",className:"htUIRadio",label:{}})}constructor(e,n){super(e,rn(Cm.DEFAULTS,n)),MA(this,Ql,void 0),MA(this,Ky,void 0)}build(){super.build();const e=this.hot.rootDocument.createElement("label");e.textContent=this.translateIfPossible(this.options.label.textContent),e.htmlFor=this.translateIfPossible(this.options.label.htmlFor),IA(Ky,this,e),IA(Ql,this,this._element.firstChild),Yc(Ql,this).checked=this.options.checked,this._element.appendChild(e),this.update()}update(){this.isBuilt()&&(Yc(Ky,this).textContent=this.translateIfPossible(this.options.label.textContent))}isChecked(){return this.isBuilt()?Yc(Ql,this).checked:!1}setChecked(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.isBuilt()&&(Yc(Ql,this).checked=e)}focus(){this.isBuilt()&&Yc(Ql,this).focus()}}function wee(t,e){vee(t,e),e.add(t)}function vee(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Cee(t,e,n){return(e=yee(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function yee(t){var e=bee(t,"string");return typeof e=="symbol"?e:e+""}function bee(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function See(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const PA=0;var OA=new WeakSet;class Ree extends Ad{constructor(e,n){super(e,{id:n.id,stateless:!1}),wee(this,OA),Cee(this,"name",""),this.name=n.name,this.buildOperatorsElement()}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,n)=>(G(n.parentNode,"htFiltersMenuOperators"),M(this.elements,r=>n.appendChild(r.element)),n)}}buildOperatorsElement(){const e=[js,vm];M(e,n=>{const r=new Cm(this.hot,{name:"operator",label:{htmlFor:n,textContent:UJ(n)},value:n,checked:n===e[PA],id:n});r.addLocalHook("change",i=>See(OA,this,Eee).call(this,i)),this.elements.push(r)})}setChecked(e){if(this.elements.length<e)throw Error(nt`Radio button with index ${e} doesn't exist.`);M(this.elements,(n,r)=>{n.setChecked(r===e)})}getActiveOperationId(){const e=this.elements.find(n=>n instanceof Cm&&n.isChecked());return e?e.getValue():js}getState(){return this.getActiveOperationId()}setState(e){this.reset(),e&&this.getActiveOperationId()!==e&&M(this.elements,n=>{n.setChecked(n.getValue()===e)})}updateState(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:js,n=arguments.length>1?arguments[1]:void 0,r=e;r===aT&&(r=vm),this.state.setValueAtIndex(n,r)}reset(){this.setChecked(PA)}}function Eee(t){this.setState(t.target.value)}function Tee(t,e,n){_ee(t,e),e.set(t,n)}function _ee(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Xy(t,e){return t.get(NL(t,e))}function Mee(t,e,n){return t.set(NL(t,e),n),n}function NL(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Gc=new WeakMap;class nd extends Si{static get DEFAULTS(){return uo({href:"#",tagName:"a",tabIndex:-1,role:"button"})}constructor(e,n){super(e,rn(nd.DEFAULTS,n)),Tee(this,Gc,void 0)}build(){super.build(),Mee(Gc,this,this._element.firstChild)}update(){this.isBuilt()&&(Xy(Gc,this).textContent=this.translateIfPossible(this.options.textContent))}focus(){this.isBuilt()&&Xy(Gc,this).focus()}activate(){Xy(Gc,this).click()}}function Iee(t,e){DL(t,e),e.add(t)}function Jl(t,e,n){DL(t,e),e.set(t,n)}function DL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Te(t,e){return t.get(bu(t,e))}function si(t,e,n){return t.set(bu(t,e),n),n}function bu(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const xA="multipleSelect.itemBox";var mi=new WeakMap,Wt=new WeakMap,Zy=new WeakMap,Io=new WeakMap,ws=new WeakMap,vs=new WeakMap,qc=new WeakSet;class rd extends Si{static get DEFAULTS(){return uo({className:"htUIMultipleSelect",value:[]})}constructor(e,n){super(e,rn(rd.DEFAULTS,n)),Iee(this,qc),Jl(this,mi,[]),Jl(this,Wt,void 0),Jl(this,Zy,void 0),Jl(this,Io,void 0),Jl(this,ws,void 0),Jl(this,vs,void 0),si(Io,this,new Us(this.hot,{placeholder:S0,className:"htUIMultipleSelectSearch"})),si(ws,this,new nd(this.hot,{textContent:v0,className:"htUISelectAll"})),si(vs,this,new nd(this.hot,{textContent:C0,className:"htUIClearAll"})),this.registerHooks()}getItemsBox(){return Te(Wt,this)}registerHooks(){Te(Io,this).addLocalHook("keydown",e=>bu(qc,this,Oee).call(this,e)),Te(Io,this).addLocalHook("input",e=>bu(qc,this,Pee).call(this,e)),Te(ws,this).addLocalHook("click",e=>bu(qc,this,xee).call(this,e)),Te(vs,this).addLocalHook("click",e=>bu(qc,this,Aee).call(this,e))}setItems(e){var n;si(mi,this,e),(n=Te(Wt,this))===null||n===void 0||n.loadData(Te(mi,this))}setLocale(e){si(Zy,this,e)}getLocale(){return Te(Zy,this)}getItems(){return[...Te(mi,this)]}getValue(){return Nee(Te(mi,this))}getSearchInputElement(){return Te(Io,this)}getSelectAllElement(){return Te(ws,this)}getClearAllElement(){return Te(vs,this)}isSelectedAllValues(){return Te(mi,this).length===this.getValue().length}build(){super.build();const{rootDocument:e}=this.hot,n=e.createElement("div"),r=new Si(this.hot,{className:"htUISelectionControls",children:[Te(ws,this),Te(vs,this)]});this._element.appendChild(Te(Io,this).element),this._element.appendChild(r.element),this._element.appendChild(n);const i=o=>{var s;if(!this._element)return;(s=Te(Wt,this))===null||s===void 0||s.destroy(),G(o,"htUIMultipleSelectHot"),si(Wt,this,new this.hot.constructor(o,{data:Te(mi,this),columns:[{data:"checked",type:"checkbox",label:{property:"visualValue",position:"after"}}],beforeRenderer:(u,c,h,d,f,g)=>{u.title=g.instance.getDataAtRowProp(c,g.label.property)},afterListen:()=>{this.runLocalHooks("focus",this)},beforeOnCellMouseUp:()=>{Te(Wt,this).listen()},modifyColWidth:u=>{const c=Te(Wt,this).container.scrollWidth-vn(e);return u!==void 0&&u<c?c:u},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"})),Te(Wt,this).init(),this.hot.addHook("afterSetTheme",(u,c)=>{c||Te(Wt,this).useTheme(u)});const l=Te(Wt,this).getShortcutManager().getContext("grid");l.removeShortcutsByKeys(["Tab"]),l.removeShortcutsByKeys(["Shift","Tab"]),l.addShortcut({keys:[["Escape"]],callback:u=>{this.runLocalHooks("keydown",u,this)},group:xA}),l.addShortcut({keys:[["Tab"],["Shift","Tab"]],callback:u=>{Te(Wt,this).deselectCell(),this.runLocalHooks("keydown",u,this),this.runLocalHooks("listTabKeydown",u,this)},group:xA})};i(n),this.hot._registerTimeout(()=>i(n),100)}focus(){this.isBuilt()&&Te(Wt,this).listen()}reset(){Te(Io,this).reset(),Te(ws,this).reset(),Te(vs,this).reset()}update(){this.isBuilt()&&(Te(Wt,this).loadData(Hee(Te(mi,this),this.options.value)),super.update())}destroy(){var e;(e=Te(Wt,this))===null||e===void 0||e.destroy(),Te(Io,this).destroy(),Te(vs,this).destroy(),Te(ws,this).destroy(),si(Io,this,null),si(vs,this,null),si(ws,this,null),si(Wt,this,null),si(mi,this,null),super.destroy()}}function Pee(t){const e=t.target.value.toLocaleLowerCase(this.getLocale());let n;e===""?n=[...Te(mi,this)]:n=Te(mi,this).filter(r=>`${r.value}`.toLocaleLowerCase(this.getLocale()).indexOf(e)>=0),Te(Wt,this).loadData(n)}function Oee(t){this.runLocalHooks("keydown",t,this),LN(Cd,t.keyCode)("ARROW_DOWN")&&(t.preventDefault(),Pi(t),Te(Wt,this).listen(),Te(Wt,this).selectCell(0,0))}function xee(t){const e=[];t.preventDefault(),Te(Wt,this).getSourceData().forEach((n,r)=>{n.checked=!0,e.push(bD(n,r)[0])}),Te(Wt,this).setSourceDataAtCell(e)}function Aee(t){const e=[];t.preventDefault(),Te(Wt,this).getSourceData().forEach((n,r)=>{n.checked=!1,e.push(bD(n,r)[0])}),Te(Wt,this).setSourceDataAtCell(e)}function Hee(t,e){const n=Hd(e);return t.map(r=>(r.checked=n(r.value),r))}function Nee(t){const e=[];return t.forEach(n=>{n.checked&&e.push(n.value)}),e}function Dee(t,e){kee(t,e),e.add(t)}function kee(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Lee(t,e,n){return(e=$ee(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function $ee(t){var e=Fee(t,"string");return typeof e=="symbol"?e:e+""}function Fee(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ff(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Kc=new WeakSet;class Vee extends Ad{constructor(e,n){super(e,{id:n.id,stateless:!1}),Dee(this,Kc),Lee(this,"name",""),this.name=n.name,this.elements.push(new rd(this.hot)),this.registerHooks()}registerHooks(){this.getMultipleSelectElement().addLocalHook("keydown",e=>Ff(Kc,this,Wee).call(this,e)).addLocalHook("listTabKeydown",e=>this.runLocalHooks("listTabKeydown",e)),this.hot.addHook("modifyFiltersMultiSelectValue",(e,n)=>Ff(Kc,this,Bee).call(this,e,n))}getElements(){const e=this.getMultipleSelectElement();return[e.getSearchInputElement(),e.getSelectAllElement(),e.getClearAllElement(),this.getMultipleSelectElement()]}setState(e){if(this.reset(),e&&e.command.key===Qa){const n=this.getMultipleSelectElement();n.setItems(e.itemsSnapshot),n.setValue(e.args[0]),n.setLocale(e.locale)}}getState(){const e=this.getMultipleSelectElement(),n=e.getItems();return{command:{key:e.isSelectedAllValues()||!n.length?wn:Qa},args:[e.getValue()],itemsSnapshot:n}}updateState(e){const n=(r,i,o,s,a)=>{const[l]=rl(i,h=>h.name===Qa),u={},c=this.hot.getTranslatedPhrase(tm);if(l){const h=s(r,a),d=Be(h,v=>v.value),f=new Map(h.map(v=>[v.value,this.hot.getCellMeta(v.meta.visualRow,v.meta.visualCol)])),g=PS(d);o&&(l.args[0]=o);const C=[],y=bA(g,l.args[0],c,v=>{v.checked&&C.push(v.value),Ff(Kc,this,AA).call(this,v,f)}),E=e.editedConditionStack.column;u.locale=this.hot.getCellMeta(0,E).locale,u.args=[C],u.command=Za(Qa),u.itemsSnapshot=y}else u.args=[],u.command=Za(wn);this.state.setValueAtIndex(r,u)};n(e.editedConditionStack.column,e.editedConditionStack.conditions,e.conditionArgsChange,e.filteredRowsFactory),e.dependentConditionStacks.length&&n(e.dependentConditionStacks[0].column,e.dependentConditionStacks[0].conditions,e.conditionArgsChange,e.filteredRowsFactory,e.editedConditionStack)}getMultipleSelectElement(){return this.elements.filter(e=>e instanceof rd)[0]}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,n,r,i,o,s)=>{G(n.parentNode,"htFiltersMenuValue");const a=this.hot.rootDocument.createElement("div");return G(a,"htFiltersMenuLabel"),a.textContent=s,n.appendChild(a),n.parentElement.hasAttribute("ghost-table")||M(this.elements,l=>n.appendChild(l.element)),n}}}reset(){const e=this.hot.getTranslatedPhrase(tm),n=this._getColumnVisibleValues(),r=n.map(l=>l.value),i=new Map(n.map(l=>[l.value,l.meta])),o=PS(r),s=bA(o,o,e,l=>{Ff(Kc,this,AA).call(this,l,i)});this.getMultipleSelectElement().setItems(s),super.reset(),this.getMultipleSelectElement().setValue(o);const a=this.hot.getPlugin("filters").getSelectedColumn();a!==null&&this.getMultipleSelectElement().setLocale(this.hot.getCellMeta(0,a.visualIndex).locale)}_getColumnVisibleValues(){const e=this.hot.getPlugin("filters").getSelectedColumn();return e===null?[]:Be(this.hot.getDataAtCol(e.visualIndex),(n,r)=>({value:oT(n),meta:this.hot.getCellMeta(r,e.visualIndex)}))}}function Wee(t){Cd(t.keyCode,"ESCAPE")&&(this.runLocalHooks("cancel"),Pi(t))}function AA(t,e){this.hot.hasHook("modifyFiltersMultiSelectValue")&&(t.visualValue=this.hot.runHooks("modifyFiltersMultiSelectValue",t.visualValue,e.get(t.value)))}function Bee(t,e){switch(e.type){case"numeric":return Rk(t,e);default:return t}}var kL;function jee(t,e){Uee(t,e),e.add(t)}function Uee(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function zee(t,e,n){return(e=Yee(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Yee(t){var e=Gee(t,"string");return typeof e=="symbol"?e:e+""}function Gee(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function qee(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var HA=new WeakSet;class id extends Ad{static get BUTTON_OK(){return"ok"}static get BUTTON_CANCEL(){return"cancel"}constructor(e,n){super(e,{id:n.id,stateless:!0}),jee(this,HA),zee(this,"name",""),this.name=n.name,this.elements.push(new Us(this.hot,{type:"button",value:y0,className:"htUIButton htUIButtonOK",identifier:id.BUTTON_OK})),this.elements.push(new Us(this.hot,{type:"button",value:b0,className:"htUIButton htUIButtonCancel",identifier:id.BUTTON_CANCEL})),this.registerHooks()}registerHooks(){M(this.elements,e=>{e.addLocalHook("click",(n,r)=>qee(HA,this,Kee).call(this,n,r))})}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,n)=>(G(n.parentNode,"htFiltersMenuActionBar"),M(this.elements,r=>n.appendChild(r.element)),n)}}accept(){this.runLocalHooks("accept")}cancel(){this.runLocalHooks("cancel")}}kL=id;function Kee(t,e){e.options.identifier===kL.BUTTON_OK?this.accept():this.cancel()}function Qy(t,e,n){return(e=Xee(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Xee(t){var e=Zee(t,"string");return typeof e=="symbol"?e:e+""}function Zee(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const NA="ConditionCollection.filteringStates";class uT{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;Qy(this,"hot",void 0),Qy(this,"isMapRegistrable",void 0),Qy(this,"filteringStates",new hp),this.hot=e,this.isMapRegistrable=n,this.isMapRegistrable===!0?this.hot.columnIndexMapper.registerMap(NA,this.filteringStates):this.filteringStates.init(this.hot.columnIndexMapper.getNumberOfIndexes())}isEmpty(){return this.getFilteredColumns().length===0}isMatch(e,n){var r;const i=this.filteringStates.getValueAtIndex(n),o=(r=i==null?void 0:i.conditions)!==null&&r!==void 0?r:[],s=i==null?void 0:i.operation;return this.isMatchInConditions(o,e,s)}isMatchInConditions(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:js;return e.length?jJ(r)(e,n):!0}addCondition(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:js,i=arguments.length>3?arguments[3]:void 0;const o=this.hot.getCellMeta(0,e).locale,s=n.args.map(c=>typeof c=="string"?c.toLocaleLowerCase(o):c),a=n.name||n.command.key;this.runLocalHooks("beforeAdd",e);const l=this.getOperation(e);if(l){if(l!==r)throw Error(nt`The column of index ${e} has been already applied with a \`${l}\`\x20
|
|
261
|
+
filter operation. Use \`removeConditions\` to clear the current conditions and then add new ones.\x20
|
|
262
|
+
Mind that you cannot mix different types of operations (for instance, if you use \`conjunction\`,\x20
|
|
263
|
+
use it consequently for a particular column).`)}else if(It(ed[r]))throw new Error(nt`Unexpected operation named \`${r}\`. Possible ones are\x20
|
|
264
|
+
\`disjunction\` and \`conjunction\`.`);const u=this.getConditions(e);u.length===0?this.filteringStates.setValueAtIndex(e,{operation:r,conditions:[{name:a,args:s,func:zs(a,s)}]},i):u.push({name:a,args:s,func:zs(a,s)}),this.runLocalHooks("afterAdd",e)}getConditions(e){var n,r;return(n=(r=this.filteringStates.getValueAtIndex(e))===null||r===void 0?void 0:r.conditions)!==null&&n!==void 0?n:[]}getOperation(e){var n;return(n=this.filteringStates.getValueAtIndex(e))===null||n===void 0?void 0:n.operation}getFilteredColumns(){return this.filteringStates.getEntries().map(e=>{let[n]=e;return n})}getColumnStackPosition(e){return this.getFilteredColumns().indexOf(e)}exportAllConditions(){return this.filteringStates.getEntries().reduce((e,n)=>{let[r,{operation:i,conditions:o}]=n;return e.push({column:r,operation:i,conditions:o.map(s=>{let{name:a,args:l}=s;return{name:a,args:[...l]}})}),e},[])}importAllConditions(e){this.clean(),e.forEach(n=>{n.conditions.forEach(r=>this.addCondition(n.column,r))})}removeConditions(e){this.runLocalHooks("beforeRemove",e),this.filteringStates.clearValue(e),this.runLocalHooks("afterRemove",e)}clean(){this.runLocalHooks("beforeClean"),this.filteringStates.clear(),this.runLocalHooks("afterClean")}hasConditions(e,n){const r=this.getConditions(e);return n?r.some(i=>i.name===n):r.length>0}destroy(){this.isMapRegistrable&&this.hot.columnIndexMapper.unregisterMap(NA),this.filteringStates=null,this.clearLocalHooks()}}ut(uT,Rn);function DA(t,e,n){return(e=Qee(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Qee(t){var e=Jee(t,"string");return typeof e=="symbol"?e:e+""}function Jee(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class LL{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:()=>[];DA(this,"conditionCollection",void 0),DA(this,"columnDataFactory",void 0),this.conditionCollection=e,this.columnDataFactory=n}filter(){let e=[];return M(this.conditionCollection.getFilteredColumns(),(n,r)=>{let i=this.columnDataFactory(n);r&&(i=this._getIntersectData(i,e)),e=this.filterByColumn(n,i)}),e}filterByColumn(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const r=[];return M(n,i=>{i!==void 0&&this.conditionCollection.isMatch(i,e)&&r.push(i)}),r}_getIntersectData(e,n){const r=[];return M(n,i=>{const o=i.meta.visualRow;e[o]!==void 0&&(r[o]=e[o])}),r}}function ete(t,e){tte(t,e),e.add(t)}function tte(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ra(t,e,n){return(e=nte(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function nte(t){var e=rte(t,"string");return typeof e=="symbol"?e:e+""}function rte(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Jy(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Vf=new WeakSet;class $L{constructor(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:()=>[];ete(this,Vf),Ra(this,"hot",void 0),Ra(this,"conditionCollection",void 0),Ra(this,"columnDataFactory",void 0),Ra(this,"changes",[]),Ra(this,"grouping",!1),Ra(this,"latestEditedColumnPosition",-1),Ra(this,"latestOrderStack",[]),this.hot=e,this.conditionCollection=n,this.columnDataFactory=r,this.conditionCollection.addLocalHook("beforeRemove",i=>Jy(Vf,this,ite).call(this,i)),this.conditionCollection.addLocalHook("afterRemove",i=>this.updateStatesAtColumn(i)),this.conditionCollection.addLocalHook("afterAdd",i=>this.updateStatesAtColumn(i)),this.conditionCollection.addLocalHook("beforeClean",()=>Jy(Vf,this,ote).call(this)),this.conditionCollection.addLocalHook("afterClean",()=>Jy(Vf,this,ste).call(this))}groupChanges(){this.grouping=!0}flush(){this.grouping=!1,M(this.changes,e=>{this.updateStatesAtColumn(e)}),this.changes.length=0}updateStatesAtColumn(e,n){var r=this;if(this.grouping){this.changes.indexOf(e)===-1&&this.changes.push(e);return}const i=this.conditionCollection.exportAllConditions();let o=this.conditionCollection.getColumnStackPosition(e);o===-1&&(o=this.latestEditedColumnPosition);const s=i.slice(0,o),a=i.slice(o);a.length&&a[0].column===e&&a.shift();const l=oz(function(c,h){let d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];const f=new uT(r.hot,!1),g=[].concat(c,d);f.importAllConditions(g);const C=r.columnDataFactory(h);let y;f.isEmpty()?y=C:y=new LL(f,v=>r.columnDataFactory(v)).filter(),y=Be(y,v=>v.meta.visualRow);const E=Hd(y);return f.destroy(),rl(C,v=>E(v.meta.visualRow))})(s),u=[].concat(this.conditionCollection.getConditions(e));this.runLocalHooks("update",{editedConditionStack:{column:e,conditions:u},dependentConditionStacks:a,filteredRowsFactory:l,conditionArgsChange:n})}destroy(){this.clearLocalHooks(),He(this,(e,n)=>{this[n]=null})}}function ite(t){this.latestEditedColumnPosition=this.conditionCollection.getColumnStackPosition(t)}function ote(){this.latestOrderStack=this.conditionCollection.getFilteredColumns()}function ste(){M(this.latestOrderStack,t=>{this.updateStatesAtColumn(t)})}ut($L,Rn);function ate(t){return oL({initialPage:0,size:()=>t.length,onItemSelect:(n,r)=>{const i=t[n];if(i instanceof rd)return r;if(i.element&&!Au(i.element))return!1;i.focus()}})}const Xc="filters";function lte(t,e){let n=-1,r;const i=ate(e),o=h=>()=>{r.isOpened()&&r.getKeyboardShortcutsCtrl().listen(Xc),i.setCurrentPage(e.indexOf(h))};e.forEach(h=>{h instanceof Si&&(h.addLocalHook("click",o(h)),h.addLocalHook("focus",o(h)),h.addLocalHook("afterClose",o(h)))}),l(t);function s(h){const d=r.getKeyboardShortcutsCtrl(),f=h.getKeyboardShortcutsCtrl();i.clear(),f.addCustomShortcuts([{keys:[["Tab"],["Shift","Tab"]],forwardToContext:d.getContext(Xc),callback:()=>{h.isSubMenu()&&h.close(),d.listen(Xc)}}]),!h.isSubMenu()&&d.addCustomShortcuts([{keys:[["Tab"],["Shift","Tab"]],callback:g=>{const C=r.getNavigator();C.getCurrentPage()>-1&&(n=C.getCurrentPage()),C.clear(),g.shiftKey?i.toPreviousItem():i.toNextItem()}},{keys:[["Escape"]],callback:()=>{r.close()}},{keys:[["Enter"],["Space"]],preventDefault:!1,callback:g=>{const C=e[i.getCurrentPage()];C instanceof td&&(C.openOptions(),g.preventDefault()),C instanceof nd&&(C.activate(),g.preventDefault()),C instanceof Si||g.preventDefault()}}],Xc)}function a(){r.focus(),r.getKeyboardShortcutsCtrl().listen(Xc)}function l(h){h.addLocalHook("afterSelectionChange",d=>{d.key.startsWith("filter_")||i.clear()}),h.addLocalHook("afterSubmenuOpen",s),h.addLocalHook("afterOpen",s),r=h}function u(){return r}function c(){return n}return{...i,listen:a,setMenu:l,getMenu:u,getLastMenuPage:c}}function ute(t,e){FL(t,e),e.add(t)}function eb(t,e,n){FL(t,e),e.set(t,n)}function FL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Zc(t,e,n){return(e=cte(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function cte(t){var e=hte(t,"string");return typeof e=="symbol"?e:e+""}function hte(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function $g(t,e,n){return t.set(ir(t,e),n),n}function Br(t,e){return t.get(ir(t,e))}function ir(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const xS="filters",dte=250,kA=xS;var Ho=new WeakMap,AS=new WeakMap,Ga=new WeakMap,mr=new WeakSet;class fte extends Xe{static get PLUGIN_KEY(){return xS}static get PLUGIN_PRIORITY(){return dte}static get PLUGIN_DEPS(){return["plugin:DropdownMenu","plugin:HiddenRows","cell-type:checkbox"]}constructor(e){var n;super(e),n=this,ute(this,mr),Zc(this,"dropdownMenuPlugin",null),Zc(this,"conditionCollection",null),Zc(this,"conditionUpdateObserver",null),Zc(this,"components",new Map([["filter_by_condition",null],["filter_operators",null],["filter_by_condition2",null],["filter_by_value",null],["filter_action_bar",null]])),Zc(this,"filtersRowsMap",null),eb(this,Ho,void 0),eb(this,AS,new WeakSet),eb(this,Ga,[]),this.hot.addHook("afterGetColHeader",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return ir(mr,n,yte).call(n,...i)})}isEnabled(){return!!this.hot.getSettings()[xS]}enablePlugin(){var e=this;if(this.enabled)return;this.filtersRowsMap=this.hot.rowIndexMapper.registerMap(this.pluginName,new Rd),this.dropdownMenuPlugin=this.hot.getPlugin("dropdownMenu");const n=this.hot.getSettings().dropdownMenu,r=n&&n.uiContainer||this.hot.rootDocument.body,i=a=>(a.addLocalHook("accept",()=>ir(mr,this,LA).call(this,"accept")),a.addLocalHook("cancel",()=>ir(mr,this,LA).call(this,"cancel")),a.addLocalHook("change",l=>ir(mr,this,Cte).call(this,a,l)),a),o=()=>`${this.hot.getTranslatedPhrase(m0)}:`,s=()=>`${this.hot.getTranslatedPhrase(p0)}:`;if(!this.components.get("filter_by_condition")){const a=new OS(this.hot,{id:"filter_by_condition",name:o,addSeparator:!1,menuContainer:r});a.addLocalHook("afterClose",()=>ir(mr,this,$A).call(this)),this.components.set("filter_by_condition",i(a))}if(this.components.get("filter_operators")||this.components.set("filter_operators",new Ree(this.hot,{id:"filter_operators",name:"Operators"})),!this.components.get("filter_by_condition2")){const a=new OS(this.hot,{id:"filter_by_condition2",name:"",addSeparator:!0,menuContainer:r});a.addLocalHook("afterClose",()=>ir(mr,this,$A).call(this)),this.components.set("filter_by_condition2",i(a))}if(this.components.get("filter_by_value")||this.components.set("filter_by_value",i(new Vee(this.hot,{id:"filter_by_value",name:s}))),this.components.get("filter_action_bar")||this.components.set("filter_action_bar",i(new id(this.hot,{id:"filter_action_bar",name:"Action bar"}))),this.conditionCollection||(this.conditionCollection=new uT(this.hot)),this.conditionUpdateObserver||(this.conditionUpdateObserver=new $L(this.hot,this.conditionCollection,a=>this.getDataMapAtColumn(a)),this.conditionUpdateObserver.addLocalHook("update",a=>ir(mr,this,bte).call(this,a))),this.components.forEach(a=>a.show()),this.addHook("afterDropdownMenuDefaultOptions",function(){for(var a=arguments.length,l=new Array(a),u=0;u<a;u++)l[u]=arguments[u];return ir(mr,e,vte).call(e,...l)}),this.addHook("beforeDropdownMenuShow",()=>ir(mr,this,wte).call(this)),this.addHook("afterDropdownMenuShow",()=>ir(mr,this,mte).call(this)),this.addHook("afterDropdownMenuHide",()=>ir(mr,this,pte).call(this)),this.addHook("afterChange",a=>ir(mr,this,gte).call(this,a)),this.hot.getSettings().dropdownMenu&&this.dropdownMenuPlugin&&(this.dropdownMenuPlugin.disablePlugin(),this.dropdownMenuPlugin.enablePlugin()),!Br(Ho,this)&&this.dropdownMenuPlugin.enabled){const a=[{focus:()=>{const u=Br(Ho,this).getMenu(),c=u.getNavigator(),h=Br(Ho,this).getLastMenuPage();u.focus(),h>0?c.setCurrentPage(h):c.toFirstItem()}},...Array.from(this.components).map(u=>{let[,c]=u;return c.getElements()}).flat()];$g(Ho,this,lte(this.dropdownMenuPlugin.menu,a));const l=u=>{Br(Ho,this).listen(),u.preventDefault(),Cd(u.keyCode,"TAB")&&(u.shiftKey?Br(Ho,this).toPreviousItem():Br(Ho,this).toNextItem())};this.components.get("filter_by_value").addLocalHook("listTabKeydown",l),this.components.get("filter_by_condition").addLocalHook("selectTabKeydown",l)}this.registerShortcuts(),super.enablePlugin()}disablePlugin(){if(this.enabled){var e;(e=this.dropdownMenuPlugin)!==null&&e!==void 0&&e.enabled&&this.dropdownMenuPlugin.menu.clearLocalHooks(),this.components.forEach((n,r)=>{n.destroy(),this.components.set(r,null)}),this.conditionCollection.destroy(),this.conditionCollection=null,this.hot.rowIndexMapper.unregisterMap(this.pluginName)}this.unregisterShortcuts(),super.disablePlugin()}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Alt","A"]],stopPropagation:!0,callback:()=>{const e=this.hot.getSelected();this.clearConditions(),this.filter(),e&&this.hot.selectCells(e)},group:kA})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(kA)}addCondition(e,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:js;const o=this.hot.toPhysicalColumn(e);this.conditionCollection.addCondition(o,{command:{key:n},args:r},i)}removeConditions(e){const n=this.hot.toPhysicalColumn(e);this.conditionCollection.removeConditions(n)}clearConditions(e){if(e===void 0)this.conditionCollection.clean();else{const n=this.hot.toPhysicalColumn(e);this.conditionCollection.removeConditions(n)}}importConditions(e){this.conditionCollection.importAllConditions(e)}exportConditions(){return this.conditionCollection.exportAllConditions()}filter(){const{navigableHeaders:e}=this.hot.getSettings(),n=this._createDataFilter(),r=!this.conditionCollection.isEmpty();let i=[];const o=this.exportConditions(),s=this.hot.runHooks("beforeFilter",o,Br(Ga,this));if(s!==!1&&r){const a=[];this.hot.batchExecution(()=>{this.filtersRowsMap.clear(),i=Be(n.filter(),u=>u.meta.visualRow);const l=Hd(i);de(this.hot.countSourceRows()-1,u=>{l(u)||a.push(u)}),M(a,u=>{this.filtersRowsMap.setValueAtIndex(u,!0)})},!0),!e&&!i.length&&this.hot.deselectCell(),$g(Ga,this,this.exportConditions())}else s!==!1&&!r?($g(Ga,this,this.exportConditions()),this.filtersRowsMap.clear()):this.importConditions(Br(Ga,this));this.hot.selection.isSelected()&&this.hot.selectCell(e?-1:0,this.hot.getSelectedRangeLast().highlight.col),s!==!1&&(this.hot.runHooks("afterFilter",o),this.hot.view.adjustElementsSize(),this.hot.render())}getSelectedColumn(){var e;const n=(e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;return n?{visualIndex:n.col,physicalIndex:this.hot.toPhysicalColumn(n.col)}:null}getDataMapAtColumn(e){const n=this.hot.toVisualColumn(e),r=[];return M(this.hot.getSourceDataAtCol(n),(i,o)=>{var s;const{row:a,col:l,visualCol:u,visualRow:c,type:h,instance:d,dateFormat:f,locale:g}=this.hot.getCellMeta(o,n),C=(s=this.hot.getDataAtCell(this.hot.toVisualRow(o),n))!==null&&s!==void 0?s:i;r.push({meta:{row:a,col:l,visualCol:u,visualRow:c,type:h,instance:d,dateFormat:f,locale:g},value:oT(C)})}),r}updateValueComponentCondition(e){const n=this.hot.getDataAtCol(e),r=PS(n);this.conditionUpdateObserver.updateStatesAtColumn(e,r)}restoreComponents(e){var n;const r=(n=this.getSelectedColumn())===null||n===void 0?void 0:n.physicalIndex;e.forEach(i=>{i.isHidden()||i.restoreState(r)}),this.updateDependentComponentsVisibility()}getOperationBasedOnArguments(e,n,r,i){let o=e;return o===vm&&n.command.key!==wn&&r.command.key!==wn&&i.command.key!==wn?o=aT:i.command.key!==wn&&(n.command.key===wn||r.command.key===wn)&&(o=js),o}setListeningDropdownMenu(){this.dropdownMenuPlugin&&this.dropdownMenuPlugin.setListening()}updateDependentComponentsVisibility(){const e=this.components.get("filter_by_condition"),{command:n}=e.getState(),r=[this.components.get("filter_by_condition2"),this.components.get("filter_operators")];n.showOperators?this.showComponents(...r):this.hideComponents(...r)}_createDataFilter(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.conditionCollection;return new LL(e,n=>this.getDataMapAtColumn(n))}getIndexesOfComponents(){const e=[];if(!this.dropdownMenuPlugin)return e;const n=this.dropdownMenuPlugin.menu;for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return M(i,s=>{M(n.menuItems,(a,l)=>{a.key===s.getMenuItemDescriptor().key&&e.push(l)})}),e}changeComponentsVisibility(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;if(!this.dropdownMenuPlugin)return;const r=this.dropdownMenuPlugin.menu.hotMenu,i=r.getPlugin("hiddenRows");for(var o=arguments.length,s=new Array(o>1?o-1:0),a=1;a<o;a++)s[a-1]=arguments[a];const l=this.getIndexesOfComponents(...s);e?i.showRows(l):i.hideRows(l),r.render()}hideComponents(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.changeComponentsVisibility(!1,...n)}showComponents(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.changeComponentsVisibility(!0,...n)}destroy(){this.enabled&&(this.components.forEach((e,n)=>{e!==null&&(e.destroy(),this.components.set(n,null))}),this.conditionCollection.destroy(),this.conditionUpdateObserver.destroy(),this.hot.rowIndexMapper.unregisterMap(this.pluginName)),super.destroy()}}function gte(t){t&&M(t,e=>{const[,n]=e,r=this.hot.propToCol(n);this.conditionCollection.hasConditions(r)&&this.updateValueComponentCondition(r)})}function mte(){const t=this.dropdownMenuPlugin.menu;this.restoreComponents(Array.from(this.components.values())),t.updateMenuDimensions()}function pte(){this.components.get("filter_by_condition").getSelectElement().closeOptions(),this.components.get("filter_by_condition2").getSelectElement().closeOptions()}function wte(){const t=this.dropdownMenuPlugin.menu;Br(AS,this).has(t)||Br(Ho,this).setMenu(t),Br(AS,this).add(t)}function vte(t){t.items.push({name:xe}),this.components.forEach(e=>{t.items.push(e.getMenuItemDescriptor())})}function LA(t){var e;if(t==="accept"){const r=this.getSelectedColumn();if(r===null){var n;(n=this.dropdownMenuPlugin)===null||n===void 0||n.close();return}const{physicalIndex:i}=r,o=this.components.get("filter_by_condition").getState(),s=this.components.get("filter_by_condition2").getState(),a=this.components.get("filter_by_value").getState(),l=this.getOperationBasedOnArguments(this.components.get("filter_operators").getActiveOperationId(),o,s,a);this.conditionUpdateObserver.groupChanges();let u=this.conditionCollection.getColumnStackPosition(i);u===-1&&(u=void 0),this.conditionCollection.removeConditions(i),o.command.key!==wn&&(this.conditionCollection.addCondition(i,o,l,u),s.command.key!==wn&&this.conditionCollection.addCondition(i,s,l,u)),a.command.key!==wn&&this.conditionCollection.addCondition(i,a,l,u),this.conditionUpdateObserver.flush(),this.components.forEach(c=>c.saveState(i)),this.filter()}(e=this.dropdownMenuPlugin)===null||e===void 0||e.close()}function Cte(t,e){const n=this.dropdownMenuPlugin.menu;this.updateDependentComponentsVisibility(),t.constructor===OS&&!e.inputsCount&&this.setListeningDropdownMenu(),n.updateMenuDimensions()}function $A(){this.setListeningDropdownMenu()}function yte(t,e,n){const r=this.hot.toPhysicalColumn(t);this.enabled&&this.conditionCollection.hasConditions(r)&&n===this.hot.view.getColumnHeadersCount()-1?G(e,"htFiltersActive"):pe(e,"htFiltersActive")}function bte(t){var e;if(!((e=this.dropdownMenuPlugin)!==null&&e!==void 0&&e.enabled))return;const{editedConditionStack:{conditions:n,column:r},conditionArgsChange:i}=t;Array.isArray(i)&&$g(Ga,this,Br(Ga,this).map(a=>(a.column===r&&n.length>0&&a.conditions.forEach(l=>{l.name==="by_value"&&(l.args=[[...i]])}),a)));const o=n.filter(a=>a.name===Qa),s=n.filter(a=>a.name!==Qa);if(o.length>=2||s.length>=3)Ze(nt`The filter conditions have been applied properly, but couldn’t be displayed visually.\x20
|
|
265
|
+
The overall amount of conditions exceed the capability of the dropdown menu.\x20
|
|
266
|
+
For more details see the documentation.`);else{const a=this.conditionCollection.getOperation(r);this.components.get("filter_by_condition").updateState(s[0],r),this.components.get("filter_by_condition2").updateState(s[1],r),this.components.get("filter_operators").updateState(a,r),this.components.get("filter_by_value").updateState(t)}}const VL="internal-use-in-handsontable",HS={licenseKey:VL,useArrayArithmetic:!0,useColumnIndex:!1,useStats:!1,evaluateNullToZero:!0,precisionEpsilon:1e-13,precisionRounding:14,smartRounding:!0,leapYear1900:!1,nullDate:{year:1899,month:12,day:30},nullYear:30,dateFormats:["DD/MM/YYYY","DD/MM/YY"],timeFormats:["hh:mm","hh:mm:ss.sss"],matchWholeCell:!0,useRegularExpressions:!1,useWildcards:!0,functionArgSeparator:",",thousandSeparator:"",decimalSeparator:".",language:"enGB"};function WL(t){var e;return{maxColumns:t.maxColumns,maxRows:t.maxRows,language:(e=t[xn])===null||e===void 0||(e=e.language)===null||e===void 0?void 0:e.langCode}}function BL(t){return Object.keys(t).reduce((e,n)=>(n!=="hyperformula"&&(e[n]=t[n]),e),{})}function Ste(t){var e;const n=t[xn],r=BL(n!=null&&(e=n.engine)!==null&&e!==void 0&&e.hyperformula?n.engine:{}),i=WL(t);return{...HS,...r,...i}}function Rte(t){var e;const n=t[xn],r=BL(n!=null&&(e=n.engine)!==null&&e!==void 0&&e.hyperformula?n.engine:{}),i=WL(t);return{...r,...i}}function Ete(t,e){return Object.keys(e).some(n=>e[n]!==void 0&&e[n]!==t[n])}function Hp(){const t="engine_relationship",e=Oi(xn);return e.hasItem(t)||e.register(t,new Map),e.getItem(t)}function cT(){const t="shared_engine_usage",e=Oi(xn);return e.hasItem(t)||e.register(t,new Map),e.getItem(t)}function Tte(t){const e=t.getSettings(),n=e[xn],r=n==null?void 0:n.engine;if(n===!0||It(r))return null;if(typeof r.hyperformula=="function"||typeof r=="function"){var i;return _te((i=r.hyperformula)!==null&&i!==void 0?i:r,e,t)}else if(typeof r=="object"&&It(r.hyperformula)){const o=Hp(),s=cT().get(r);return o.has(r)||o.set(r,[]),o.get(r).push(t),s&&s.push(t.guid),r.getConfig().licenseKey||r.updateConfig({licenseKey:VL}),(r.getConfig().leapYear1900!==HS.leapYear1900||xR(r.getConfig().nullDate,HS.nullDate)===!1)&&Ze(nt`If you use HyperFormula with Handsontable, keep the default \`leapYear1900\` and \`nullDate\`
|
|
267
|
+
settings. Otherwise, HyperFormula's dates may not sync correctly with Handsontable's dates.`),r}return null}function _te(t,e,n){const r=e[xn],i=Ste(e),o=Hp(),s=cT();Mte(t,r.functions),Ite(t,r.language);const a=t.buildEmpty(i);return o.set(a,[n]),s.set(a,[n.guid]),Pte(a,r.namedExpressions),a.on("sheetAdded",()=>{a.rebuildAndRecalculate()}),a.on("sheetRemoved",()=>{a.rebuildAndRecalculate()}),a}function FA(t){var e;const n=Hp(),r=n.size===0?[]:Array.from((e=n.get(t))!==null&&e!==void 0?e:[]);return new Map(r.map(i=>[i.getPlugin("formulas").sheetId,i]))}function VA(t,e){if(t){const n=Hp(),r=n.get(t),i=cT(),o=i.get(t);r&&r.includes(e)&&(r.splice(r.indexOf(e),1),r.length===0&&n.delete(t)),o&&o.includes(e.guid)&&(o.splice(o.indexOf(e.guid),1),o.length===0&&(i.delete(t),t.destroy()))}}function Mte(t,e){e&&e.forEach(n=>{const{name:r,plugin:i,translations:o}=n;try{t.registerFunction(r,i,o)}catch(s){Ze(s.message)}})}function Ite(t,e){if(e){const{langCode:n}=e;try{t.registerLanguage(n,e)}catch(r){Ze(r.message)}}}function Pte(t,e){e&&(t.suspendEvaluation(),e.forEach(n=>{const{name:r,expression:i,scope:o,options:s}=n;try{t.addNamedExpression(r,i,o,s)}catch(a){Ze(a.message)}}),t.resumeEvaluation())}function Ote(t,e){return(It(e)||!t.doesSheetExist(e))&&(e=t.addSheet(e)),e}const jL="DD/MM/YYYY";function xte(t){return typeof t=="string"&&t.charAt(0)==="'"&&t.charAt(1)==="="}function Ate(t){return xte(t)?t.substr(1):t}function Hte(t){return typeof t=="string"&&t.startsWith("=")}function hT(t,e){return typeof t=="string"&&e==="date"}function UL(t,e){return X(t,e,!0).isValid()}function zL(t,e){return X(t,e,!0).format(jL)}function Nte(t,e){return X(t,jL,!0).format(e)}function YL(t,e){const r=new Date(Date.UTC(0,0,t+-1));return X(r).format(e)}function Dte(t,e,n){const r=Array.from(Array(n).keys()).filter(o=>t.includes(o)===!1);if(e===0){var i;return(i=r[e])!==null&&i!==void 0?i:0}return r[e-1]+1}function kte(t,e){const n=[];return t.forEach(r=>{const i={from:r,to:e};n.forEach(o=>{const s=o.from>o.to,a=o.to<=i.from;o.from>i.from&&a&&s&&(i.from+=1)}),i.from>=e&&(e+=1),n.push(i)}),n}function Lte(t){return t.forEach((e,n)=>{t.slice(n+1).forEach(i=>{const o=i.from<i.to;i.from>e.from&&o&&(i.from-=1)})}),t}function dT(t,e,n){const r=kte(t,Dte(t,e,n));return Lte(r)}function Ea(t,e,n){$te(t,e),e.set(t,n)}function $te(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function St(t,e){return t.get(GL(t,e))}function Cs(t,e,n){return t.set(GL(t,e),n),n}function GL(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Qc=new WeakMap,ys=new WeakMap,pr=new WeakMap,Wf=new WeakMap,tb=new WeakMap,nb=new WeakMap,Bf=new WeakMap;class WA{constructor(e,n,r){Ea(this,Qc,void 0),Ea(this,ys,void 0),Ea(this,pr,void 0),Ea(this,Wf,[]),Ea(this,tb,[]),Ea(this,nb,void 0),Ea(this,Bf,[]),Cs(Qc,this,e),Cs(ys,this,n),Cs(pr,this,r)}setRemovedHfIndexes(e){return Cs(Bf,this,e.map(n=>{const r=St(ys,this).getVisualFromPhysicalIndex(n);return this.getHfIndexFromVisualIndex(r)})),St(Bf,this)}getRemovedHfIndexes(){return St(Bf,this)}getHfIndexFromVisualIndex(e){const n=St(ys,this).getIndexesSequence(),r=St(ys,this).getNotTrimmedIndexes();return n.indexOf(r[e],e)}syncMoves(e){const r=`move${Ti(St(Qc,this))}s`;St(pr,this).getEngine().batch(()=>{e.forEach(i=>{const o=i.from!==i.to,s=i.from+1!==i.to;o&&s&&St(pr,this).getEngine()[r](St(pr,this).getSheetId(),i.from,1,i.to)})})}storeMovesInformation(e,n,r){r!==!1&&(Cs(tb,this,e.map(i=>this.getHfIndexFromVisualIndex(i))),Cs(nb,this,this.getHfIndexFromVisualIndex(n)))}calculateAndSyncMoves(e,n){if(St(pr,this).isPerformingUndoRedo()||e===!1||n===!1)return;const r=dT(St(tb,this),St(nb,this),St(ys,this).getNumberOfIndexes());St(pr,this).getSheetId()===null?St(pr,this).getPostponeAction(()=>this.syncMoves(r)):this.syncMoves(r)}getIndexesChangeSyncMethod(){const e=`set${Ti(St(Qc,this))}Order`;return n=>{if(St(pr,this).isPerformingUndoRedo())return;const r=St(ys,this).getIndexesSequence();if(n==="update"&&r.length>0){const i=St(Wf,this).map(l=>r.indexOf(l)),o=St(pr,this).getEngine().getSheetDimensions(St(pr,this).getSheetId());let s;St(Qc,this)==="row"?s=o.height:s=o.width;const a=i.length;for(let l=a;l<s;l+=1)i.push(l);St(pr,this).getEngine()[e](St(pr,this).getSheetId(),i)}Cs(Wf,this,r)}}init(){Cs(Wf,this,St(ys,this).getIndexesSequence())}}function Ta(t,e,n){Fte(t,e),e.set(t,n)}function Fte(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Po(t,e){return t.get(qL(t,e))}function _a(t,e,n){return t.set(qL(t,e),n),n}function qL(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var jf=new WeakMap,Uf=new WeakMap,rb=new WeakMap,ib=new WeakMap,ob=new WeakMap,sb=new WeakMap,ab=new WeakMap;class Vte{constructor(e,n,r){Ta(this,jf,void 0),Ta(this,Uf,void 0),Ta(this,rb,void 0),Ta(this,ib,!1),Ta(this,ob,!1),Ta(this,sb,null),Ta(this,ab,null),_a(jf,this,new WA("row",e,this)),_a(Uf,this,new WA("column",n,this)),_a(rb,this,r)}getForAxis(e){return e==="row"?Po(jf,this):Po(Uf,this)}setPerformUndo(e){_a(ib,this,e)}setPerformRedo(e){_a(ob,this,e)}isPerformingUndoRedo(){return Po(ib,this)||Po(ob,this)}getSheetId(){return Po(ab,this)}getEngine(){return Po(sb,this)}getPostponeAction(){return Po(rb,this)}setupSyncEndpoint(e,n){_a(sb,this,e),_a(ab,this,n),Po(jf,this).init(),Po(Uf,this).init()}}function Wte(t,e){KL(t,e),e.add(t)}function Ma(t,e,n){return(e=Bte(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Bte(t){var e=jte(t,"string");return typeof e=="symbol"?e:e+""}function jte(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function lb(t,e,n){KL(t,e),e.set(t,n)}function KL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ys(t,e,n){return t.set(Ye(t,e),n),n}function nl(t,e){return t.get(Ye(t,e))}function Ye(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const xn="formulas",Ute=["maxRows","maxColumns","language"],zte=260;re.getSingleton().register("afterNamedExpressionAdded");re.getSingleton().register("afterNamedExpressionRemoved");re.getSingleton().register("afterSheetAdded");re.getSingleton().register("afterSheetRemoved");re.getSingleton().register("afterSheetRenamed");re.getSingleton().register("afterFormulasValuesUpdate");const tc=t=>t==="UndoRedo.undo"||t==="UndoRedo.redo"||t==="auto";var rs=new WeakMap,Np=new WeakMap,Jc=new WeakMap,Ke=new WeakSet;class Yte extends Xe{constructor(){var e;super(...arguments),e=this,Wte(this,Ke),lb(this,rs,!1),lb(this,Np,!1),lb(this,Jc,[["valuesUpdated",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Ye(Ke,e,lne).call(e,...r)}],["namedExpressionAdded",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Ye(Ke,e,une).call(e,...r)}],["namedExpressionRemoved",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Ye(Ke,e,cne).call(e,...r)}],["sheetAdded",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Ye(Ke,e,hne).call(e,...r)}],["sheetRenamed",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Ye(Ke,e,dne).call(e,...r)}],["sheetRemoved",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Ye(Ke,e,fne).call(e,...r)}]]),Ma(this,"staticRegister",Oi("formulas")),Ma(this,"engine",null),Ma(this,"sheetId",null),Ma(this,"sheetName",null),Ma(this,"indexSyncer",null),Ma(this,"rowAxisSyncer",null),Ma(this,"columnAxisSyncer",null)}static get PLUGIN_KEY(){return xn}static get PLUGIN_PRIORITY(){return zte}static get SETTING_KEYS(){return[xn,...Ute]}isEnabled(){return!!this.hot.getSettings()[xn]}enablePlugin(){var e,n=this;if(!this.enabled){if(this.engine=(e=Tte(this.hot))!==null&&e!==void 0?e:this.engine,!this.engine){Ze("Missing the required `engine` key in the Formulas settings. Please fill it with either an engine class or an engine instance.");return}if(this.sheetName!==null&&!this.engine.doesSheetExist(this.sheetName)){const r=this.addSheet(this.sheetName,this.hot.getSourceDataArray());r!==!1&&Ye(Ke,this,Mh).call(this,r)}this.addHook("beforeLoadData",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ye(Ke,n,BA).call(n,...i)}),this.addHook("afterLoadData",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ye(Ke,n,jA).call(n,...i)}),this.addHook("beforeUpdateData",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ye(Ke,n,BA).call(n,...i)}),this.addHook("afterUpdateData",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ye(Ke,n,jA).call(n,...i)}),this.addHook("modifyData",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ye(Ke,n,Xte).call(n,...i)}),this.addHook("modifySourceData",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ye(Ke,n,Zte).call(n,...i)}),this.addHook("beforeValidate",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ye(Ke,n,Gte).call(n,...i)}),this.addHook("afterSetSourceDataAtCell",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ye(Ke,n,Qte).call(n,...i)}),this.addHook("afterSetDataAtCell",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ye(Ke,n,UA).call(n,...i)}),this.addHook("afterSetDataAtRowProp",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ye(Ke,n,UA).call(n,...i)}),this.addHook("beforeCreateRow",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ye(Ke,n,Jte).call(n,...i)}),this.addHook("beforeCreateCol",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ye(Ke,n,ene).call(n,...i)}),this.addHook("afterCreateRow",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ye(Ke,n,rne).call(n,...i)}),this.addHook("afterCreateCol",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ye(Ke,n,ine).call(n,...i)}),this.addHook("beforeRemoveRow",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ye(Ke,n,tne).call(n,...i)}),this.addHook("beforeRemoveCol",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ye(Ke,n,nne).call(n,...i)}),this.addHook("afterRemoveRow",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ye(Ke,n,one).call(n,...i)}),this.addHook("afterRemoveCol",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ye(Ke,n,sne).call(n,...i)}),this.indexSyncer=new Vte(this.hot.rowIndexMapper,this.hot.columnIndexMapper,r=>{this.hot.addHookOnce("init",()=>{r()})}),this.rowAxisSyncer=this.indexSyncer.getForAxis("row"),this.columnAxisSyncer=this.indexSyncer.getForAxis("column"),this.hot.addHook("afterRowSequenceChange",this.rowAxisSyncer.getIndexesChangeSyncMethod()),this.hot.addHook("afterColumnSequenceChange",this.columnAxisSyncer.getIndexesChangeSyncMethod()),this.hot.addHook("beforeRowMove",(r,i,o,s)=>{this.rowAxisSyncer.storeMovesInformation(r,i,s)}),this.hot.addHook("beforeColumnMove",(r,i,o,s)=>{this.columnAxisSyncer.storeMovesInformation(r,i,s)}),this.hot.addHook("afterRowMove",(r,i,o,s,a)=>{this.rowAxisSyncer.calculateAndSyncMoves(s,a)}),this.hot.addHook("afterColumnMove",(r,i,o,s,a)=>{this.columnAxisSyncer.calculateAndSyncMoves(s,a)}),this.hot.addHook("beforeColumnFreeze",(r,i)=>{this.columnAxisSyncer.storeMovesInformation([r],this.hot.getSettings().fixedColumnsStart,i)}),this.hot.addHook("afterColumnFreeze",(r,i)=>{this.columnAxisSyncer.calculateAndSyncMoves(i,i)}),this.hot.addHook("beforeColumnUnfreeze",(r,i)=>{this.columnAxisSyncer.storeMovesInformation([r],this.hot.getSettings().fixedColumnsStart-1,i)}),this.hot.addHook("afterColumnUnfreeze",(r,i)=>{this.columnAxisSyncer.calculateAndSyncMoves(i,i)}),this.addHook("afterCellMetaReset",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ye(Ke,n,Kte).call(n,...i)}),this.addHook("beforeUndo",()=>{this.indexSyncer.setPerformUndo(!0),this.engine.undo()}),this.addHook("beforeRedo",()=>{this.indexSyncer.setPerformRedo(!0),this.engine.redo()}),this.addHook("afterUndo",()=>{this.indexSyncer.setPerformUndo(!1)}),this.addHook("afterUndo",()=>{this.indexSyncer.setPerformRedo(!1)}),this.addHook("afterDetachChild",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ye(Ke,n,ane).call(n,...i)}),this.addHook("beforeAutofill",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ye(Ke,n,qte).call(n,...i)}),nl(Jc,this).forEach(r=>{let[i,o]=r;return this.engine.on(i,o)}),super.enablePlugin()}}disablePlugin(){nl(Jc,this).forEach(e=>{let[n,r]=e;return this.engine.off(n,r)}),VA(this.engine,this.hot),this.engine=null,super.disablePlugin()}updatePlugin(e){const n=Rte(this.hot.getSettings());Ete(this.engine.getConfig(),n)&&this.engine.updateConfig(n);const r=this.hot.getSettings()[xn];if(ae(r)&&ae(r.sheetName)&&r.sheetName!==this.sheetName&&this.switchSheet(r.sheetName),!e.data&&this.sheetName===null){const i=this.hot.getSettings()[xn].sheetName;if(i&&this.engine.doesSheetExist(i))this.switchSheet(this.sheetName);else{const o=this.addSheet(i??void 0,this.hot.getSourceDataArray());Ye(Ke,this,Mh).call(this,o)}}super.updatePlugin(e)}destroy(){nl(Jc,this).forEach(e=>{var n;let[r,i]=e;return(n=this.engine)===null||n===void 0?void 0:n.off(r,i)}),Ys(Jc,this,null),VA(this.engine,this.hot),this.engine=null,super.destroy()}addSheet(e,n){if(ae(n)&&!Aq(n))return Ze("The provided data should be an array of arrays."),!1;if(e!=null&&this.engine.doesSheetExist(e))return Ze("Sheet with the provided name already exists."),!1;try{const r=this.engine.addSheet(e??void 0);return n&&this.engine.setSheetContent(this.engine.getSheetId(r),n),r}catch(r){return Ze(r.message),!1}}switchSheet(e){if(!this.engine.doesSheetExist(e)){NR(`The sheet named \`${e}\` does not exist, switch aborted.`);return}Ye(Ke,this,Mh).call(this,e);const n=this.engine.getSheetSerialized(this.sheetId);n.length>0&&this.hot.loadData(n,`${Ti(xn)}.switchSheet`)}getCellType(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.sheetId;const i=this.hot.toPhysicalRow(e),o=this.hot.toPhysicalColumn(n);return i!==null&&o!==null?this.engine.getCellType({sheet:r,row:this.rowAxisSyncer.getHfIndexFromVisualIndex(e),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(n)}):"EMPTY"}isFormulaCellType(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.sheetId;return this.engine.doesCellHaveFormula({sheet:r,row:this.rowAxisSyncer.getHfIndexFromVisualIndex(e),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(n)})}renderDependentSheets(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const r=new Set;e.forEach(i=>{var o;const s=i==null||(o=i.address)===null||o===void 0?void 0:o.sheet;s!==void 0&&(r.has(s)||r.add(s))}),FA(this.engine).forEach((i,o)=>{if((n||o!==this.sheetId)&&r.has(o)){var s;i.render(),(s=i.view)===null||s===void 0||s.adjustElementsSize()}})}validateDependentCells(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const r=o=>{var s;const{row:a,col:l,sheet:u}=(s=o==null?void 0:o.address)!==null&&s!==void 0?s:{};return ae(u)?`${u}:${a}x${l}`:""},i=new Set(n.map(o=>r(o)));e.forEach(o=>{var s,a;const{row:l,col:u}=(s=o.address)!==null&&s!==void 0?s:{};if(ae(l)===!1||ae(u)===!1||l>=this.hot.countRows()||u>=this.hot.countCols())return;const c=o==null||(a=o.address)===null||a===void 0?void 0:a.sheet,h=r(o);if(c!==void 0&&!i.has(h)){const d=FA(this.engine).get(c);if(!d)return;d.validateCell(d.getDataAtCell(l,u),d.getCellMeta(l,u),()=>{})}})}syncChangeWithEngine(e,n,r){const i={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(e),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(n),sheet:this.sheetId};if(!this.engine.isItPossibleToSetCellContents(i)){Ze(`Not possible to set cell data at ${JSON.stringify(i)}`);return}const o=this.hot.getCellMeta(e,n);return hT(r,o.type)&&(UL(r,o.dateFormat)?r=zL(r,o.dateFormat):Hte(r)===!1&&(r=`'${r}`)),this.engine.setCellContents(i,r)}}function Mh(t){this.sheetName=t,this.sheetId=this.engine.getSheetId(this.sheetName)}function Gte(t,e,n){const r=this.hot.propToCol(n);if(this.isFormulaCellType(e,r)){const i={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(e),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(r),sheet:this.sheetId},o=this.hot.getCellMeta(e,r);let s=this.engine.getCellValue(i);return o.type==="date"&&Un(s)&&(s=YL(s,o.dateFormat)),typeof s=="object"&&s!==null?s.value:s}return t}function qte(t,e,n){const{row:r,col:i}=e.getTopStartCorner(),{row:o,col:s}=e.getBottomEndCorner(),{row:a,col:l}=n.getTopStartCorner(),{row:u,col:c}=n.getBottomEndCorner(),h={start:{row:this.rowAxisSyncer.getHfIndexFromVisualIndex(r),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(i),sheet:this.sheetId},end:{row:this.rowAxisSyncer.getHfIndexFromVisualIndex(o),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(s),sheet:this.sheetId}},d={start:{row:this.rowAxisSyncer.getHfIndexFromVisualIndex(a),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(l),sheet:this.sheetId},end:{row:this.rowAxisSyncer.getHfIndexFromVisualIndex(u),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(c),sheet:this.sheetId}};if(this.engine.isItPossibleToSetCellContents(d)===!1)return!1;const f=this.engine.getFillRangeData(h,d),{row:g,col:C}=h.start,{row:y,col:E}=h.end,v=y-g+1,P=E-C+1;for(let O=0;O<f.length;O+=1)for(let L=0;L<f[O].length;L+=1){const T=f[O][L],A=g+O%v,q=C+L%P,U=this.hot.getCellMeta(A,q);hT(T,U.type)&&(T.startsWith("'")?f[O][L]=T.slice(1):this.isFormulaCellType(A,q,this.sheetId)===!1&&(f[O][L]=Nte(T,U.dateFormat)))}return f}function BA(t,e){(arguments.length>2&&arguments[2]!==void 0?arguments[2]:"").includes(Ti(xn))||Ys(Np,this,It(this.hot.getSettings().data))}function Kte(){if(nl(Np,this)){this.switchSheet(this.sheetName);return}const t=this.hot.getSourceDataArray();t.forEach((n,r)=>{n.forEach((i,o)=>{const s=this.hot.getCellMeta(r,o,{skipMetaExtension:!0}),a=s.dateFormat;hT(i,s.type)&&(UL(i,a)?t[r][o]=zL(i,a):i.startsWith("=")||(t[r][o]=`'${i}`))})}),Ys(rs,this,!0);const e=this.engine.setSheetContent(this.sheetId,t);this.indexSyncer.setupSyncEndpoint(this.engine,this.sheetId),this.renderDependentSheets(e),Ys(rs,this,!1)}function jA(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";if(n.includes(Ti(xn)))return;const r=Ote(this.engine,this.hot.getSettings()[xn].sheetName);if(Ye(Ke,this,Mh).call(this,r),n!=="updateSettings")if(nl(Np,this))this.switchSheet(this.sheetName);else{const i=this.hot.getSourceDataArray();if(this.engine.isItPossibleToReplaceSheetContent(this.sheetId,i)){Ys(rs,this,!0);const o=this.engine.setSheetContent(this.sheetId,i);this.indexSyncer.setupSyncEndpoint(this.engine,this.sheetId),this.renderDependentSheets(o),Ys(rs,this,!1)}}}function Xte(t,e,n,r){if(r!=="get"||nl(rs,this)||this.sheetName===null||!this.engine.doesSheetExist(this.sheetName))return;const i=this.hot.toVisualRow(t);if(i===null||e===null)return;const o=this.getCellType(i,e);if(o==="VALUE"||o==="EMPTY"){n.value=Ate(n.value);return}const s={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(i),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(e),sheet:this.sheetId};let a=this.engine.getCellValue(s);const l=this.hot.getCellMeta(i,e,{skipMetaExtension:!0});l.type==="date"&&Un(a)&&(a=YL(a,l.dateFormat)),n.value=typeof a=="object"&&a!==null?a.value:a}function Zte(t,e,n,r){if(r!=="get"||nl(rs,this)||this.sheetName===null||!this.engine.doesSheetExist(this.sheetName))return;const i=this.hot.toVisualRow(t),o=this.hot.propToCol(e);if(i===null||o===null)return;const s=this.getCellType(i,o);if(s==="VALUE"||s==="EMPTY")return;const a=this.engine.getSheetDimensions(this.engine.getSheetId(this.sheetName));if(a.width===0&&a.height===0)return;const l={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(i),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(o),sheet:this.sheetId};n.value=this.engine.getCellSerialized(l)}function UA(t,e){if(tc(e))return;const n=[],r=[],i=this.engine.batch(()=>{t.forEach(o=>{let[s,a,,l]=o;const u=this.hot.propToCol(a),c=this.hot.toPhysicalRow(s),h=this.hot.toPhysicalColumn(u),d={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(s),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(u),sheet:this.sheetId};c!==null&&h!==null?this.syncChangeWithEngine(s,u,l):n.push([s,u,l]),r.push({address:d})})});n.length&&this.hot.addHookOnce("afterChange",()=>{const o=this.engine.batch(()=>{n.forEach(s=>{let[a,l,u]=s;this.syncChangeWithEngine(a,l,u)})});this.renderDependentSheets(o,!0)}),this.renderDependentSheets(i),this.validateDependentCells(i,r)}function Qte(t,e){if(tc(e))return;const n=[],r=[];t.forEach(i=>{let[o,s,,a]=i;const l=this.hot.propToCol(s);if(!Un(l))return;const u={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(o),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(l),sheet:this.sheetId};if(!this.engine.isItPossibleToSetCellContents(u)){Ze(`Not possible to set source cell data at ${JSON.stringify(u)}`);return}r.push({address:u}),n.push(...this.engine.setCellContents(u,a))}),this.renderDependentSheets(n),this.validateDependentCells(n,r)}function Jte(t,e){let n=this.rowAxisSyncer.getHfIndexFromVisualIndex(t);if(t>=this.hot.countRows()&&(n=t),this.sheetId===null||!this.engine.doesSheetExist(this.sheetName)||!this.engine.isItPossibleToAddRows(this.sheetId,[n,e]))return!1}function ene(t,e){let n=this.columnAxisSyncer.getHfIndexFromVisualIndex(t);if(t>=this.hot.countCols()&&(n=t),this.sheetId===null||!this.engine.doesSheetExist(this.sheetName)||!this.engine.isItPossibleToAddColumns(this.sheetId,[n,e]))return!1}function tne(t,e,n){return this.rowAxisSyncer.setRemovedHfIndexes(n).every(o=>this.engine.isItPossibleToRemoveRows(this.sheetId,[o,1]))===!1?!1:void 0}function nne(t,e,n){return this.columnAxisSyncer.setRemovedHfIndexes(n).every(o=>this.engine.isItPossibleToRemoveColumns(this.sheetId,[o,1]))===!1?!1:void 0}function rne(t,e,n){if(tc(n))return;const r=this.engine.addRows(this.sheetId,[this.rowAxisSyncer.getHfIndexFromVisualIndex(t),e]);this.renderDependentSheets(r)}function ine(t,e,n){if(tc(n))return;const r=this.engine.addColumns(this.sheetId,[this.columnAxisSyncer.getHfIndexFromVisualIndex(t),e]);this.renderDependentSheets(r)}function one(t,e,n,r){if(tc(r))return;const i=this.rowAxisSyncer.getRemovedHfIndexes().sort((s,a)=>a-s),o=this.engine.batch(()=>{i.forEach(s=>{this.engine.removeRows(this.sheetId,[s,1])})});this.renderDependentSheets(o)}function sne(t,e,n,r){if(tc(r))return;const i=this.columnAxisSyncer.getRemovedHfIndexes().sort((s,a)=>a-s),o=this.engine.batch(()=>{i.forEach(s=>{this.engine.removeColumns(this.sheetId,[s,1])})});this.renderDependentSheets(o)}function ane(t,e,n){var r;Ys(rs,this,!0);const i=this.hot.getSourceDataArray(n,0,n+(((r=e.__children)===null||r===void 0?void 0:r.length)||0),this.hot.countSourceCols());Ys(rs,this,!1),i.forEach((o,s)=>{o.forEach((a,l)=>{this.engine.setCellContents({col:l,row:n+s,sheet:this.sheetId},[[a]])})})}function lne(t){this.hot.runHooks("afterFormulasValuesUpdate",t)}function une(t,e){this.hot.runHooks("afterNamedExpressionAdded",t,e)}function cne(t,e){this.hot.runHooks("afterNamedExpressionRemoved",t,e)}function hne(t){this.hot.runHooks("afterSheetAdded",t)}function dne(t,e){Ye(Ke,this,Mh).call(this,e),this.hot.runHooks("afterSheetRenamed",t,e)}function fne(t,e){this.hot.runHooks("afterSheetRemoved",t,e)}function gne(t){return{key:"hidden_columns_hide",name(){const e=this.getSelectedLast();let n=0;if(Array.isArray(e)){const[,r,,i]=e;r-i!==0&&(n=1)}return this.getTranslatedPhrase(YE,n)},callback(){const{from:e,to:n}=this.getSelectedRangeLast(),r=Math.max(Math.min(e.col,n.col),0),i=Math.max(e.col,n.col),o=[];for(let l=r;l<=i;l+=1)o.push(l);t.hideColumns(o);const s=o[o.length-1],a=this.columnIndexMapper.getNearestNotHiddenIndex(s,1,!0);Number.isInteger(a)&&a>=0?this.selectColumns(a):this.deselectCell(),this.render(),this.view.adjustElementsSize()},disabled:!1,hidden(){return!(this.selection.isSelectedByColumnHeader()||this.selection.isSelectedByCorner())}}}function mne(t){const e=[];return{key:"hidden_columns_show",name(){const n=e.length>1?1:0;return this.getTranslatedPhrase(GE,n)},callback(){var n,r;if(e.length===0)return;let i=e[0],o=e[e.length-1];i=(n=this.columnIndexMapper.getNearestNotHiddenIndex(i-1,-1))!==null&&n!==void 0?n:0,o=(r=this.columnIndexMapper.getNearestNotHiddenIndex(o+1,1))!==null&&r!==void 0?r:this.countCols()-1,t.showColumns(e),this.render(),this.view.adjustElementsSize(),o-i+1===this.countCols()||this.selectColumns(i,o)},disabled:!1,hidden(){const n=Be(t.getHiddenColumns(),h=>this.toPhysicalColumn(h));if(!(this.selection.isSelectedByColumnHeader()||this.selection.isSelectedByCorner())||n.length<1)return!0;e.length=0;const r=this.getSelectedRangeLast(),i=r.getTopStartCorner().col,o=r.getBottomEndCorner().col,s=this.columnIndexMapper,a=s.getRenderableFromVisualIndex(i),l=s.getRenderableFromVisualIndex(o),u=s.getNotTrimmedIndexes(),c=[];if(i!==o){const h=o-i+1,d=l-a+1;if(h>d){const f=u.slice(i,o+1);c.push(...f.filter(g=>n.includes(g)))}}else if(a===0&&a<i)c.push(...u.slice(0,i));else if(a===null)c.push(...u.slice(0,this.countCols()));else{const h=this.countCols()-1,d=s.getRenderableFromVisualIndex(s.getNearestNotHiddenIndex(h,-1));l===d&&h>o&&c.push(...u.slice(o+1))}return M(c,h=>{e.push(this.toVisualColumn(h))}),e.length===0}}}function pne(t,e){XL(t,e),e.add(t)}function wne(t,e,n){XL(t,e),e.set(t,n)}function XL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ia(t,e){return t.get(Ms(t,e))}function zA(t,e,n){return t.set(Ms(t,e),n),n}function Ms(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}re.getSingleton().register("beforeHideColumns");re.getSingleton().register("afterHideColumns");re.getSingleton().register("beforeUnhideColumns");re.getSingleton().register("afterUnhideColumns");const YA="hiddenColumns",vne=310;var Vi=new WeakMap,Pa=new WeakSet;class Cne extends Xe{constructor(){super(...arguments),pne(this,Pa),wne(this,Vi,null)}static get PLUGIN_KEY(){return YA}static get PLUGIN_PRIORITY(){return vne}static get DEFAULT_SETTINGS(){return{copyPasteEnabled:!0,indicators:!1,columns:[]}}isEnabled(){return!!this.hot.getSettings()[YA]}enablePlugin(){var e=this;this.enabled||(zA(Vi,this,new cp),Ia(Vi,this).addLocalHook("init",()=>Ms(Pa,this,Tne).call(this)),this.hot.columnIndexMapper.registerMap(this.pluginName,Ia(Vi,this)),this.addHook("afterContextMenuDefaultOptions",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Ms(Pa,e,Ene).call(e,...r)}),this.addHook("afterGetCellMeta",(n,r,i)=>Ms(Pa,this,bne).call(this,n,r,i)),this.addHook("modifyColWidth",(n,r)=>Ms(Pa,this,yne).call(this,n,r),2),this.addHook("afterGetColHeader",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Ms(Pa,e,Rne).call(e,...r)}),this.addHook("modifyCopyableRange",n=>Ms(Pa,this,Sne).call(this,n)),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){super.disablePlugin(),this.hot.columnIndexMapper.unregisterMap(this.pluginName),this.resetCellsMeta()}showColumns(e){const n=this.getHiddenColumns(),r=this.isValidConfig(e);let i=n;const o=Ia(Vi,this).getValues().slice(),s=e.length>0;if(r&&s){const l=e.map(u=>this.hot.toPhysicalColumn(u));M(l,u=>{o[u]=!1}),i=fr(o,(u,c,h)=>(c&&u.push(this.hot.toVisualColumn(h)),u),[])}this.hot.runHooks("beforeUnhideColumns",n,i,r&&s)!==!1&&(r&&s&&Ia(Vi,this).setValues(o),this.hot.view.adjustElementsSize(),this.hot.runHooks("afterUnhideColumns",n,i,r&&s,r&&i.length<n.length))}showColumn(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.showColumns(n)}hideColumns(e){const n=this.getHiddenColumns(),r=this.isValidConfig(e);let i=n;r&&(i=Array.from(new Set(n.concat(e)))),this.hot.runHooks("beforeHideColumns",n,i,r)!==!1&&(r&&this.hot.batchExecution(()=>{M(e,s=>{Ia(Vi,this).setValueAtIndex(this.hot.toPhysicalColumn(s),!0)})},!0),this.hot.runHooks("afterHideColumns",n,i,r,r&&i.length>n.length))}hideColumn(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.hideColumns(n)}getHiddenColumns(){return Be(Ia(Vi,this).getHiddenIndexes(),e=>this.hot.toVisualColumn(e))}isHidden(e){return Ia(Vi,this).getValueAtIndex(this.hot.toPhysicalColumn(e))||!1}isValidConfig(e){const n=this.hot.countCols();return Array.isArray(e)&&e.length>0?e.every(r=>Number.isInteger(r)&&r>=0&&r<n):!1}resetCellsMeta(){M(this.hot.getCellsMeta(),e=>{e.skipColumnOnPaste=!1})}destroy(){zA(Vi,this,null),super.destroy()}}function yne(t,e){if(this.isHidden(e))return 0;if(this.getSetting("indicators")&&(this.isHidden(e+1)||this.isHidden(e-1))&&typeof t=="number"&&this.hot.hasColHeaders())return t+15}function bne(t,e,n){if(this.getSetting("copyPasteEnabled")===!1&&this.isHidden(e)&&(n.skipColumnOnPaste=!0),this.isHidden(e-1))n.className=n.className||"",n.className.indexOf("afterHiddenColumn")===-1&&(n.className+=" afterHiddenColumn");else if(n.className){const r=n.className.split(" ");if(r.length>0){const i=r.indexOf("afterHiddenColumn");i>-1&&r.splice(i,1),n.className=r.join(" ")}}}function Sne(t){if(this.getSetting("copyPasteEnabled"))return t;const e=[],n=(r,i,o,s)=>{e.push({startRow:r,endRow:i,startCol:o,endCol:s})};return M(t,r=>{let i=!0,o=0;de(r.startCol,r.endCol,s=>{this.isHidden(s)?(i||n(r.startRow,r.endRow,o,s-1),i=!0):(i&&(o=s),s===r.endCol&&n(r.startRow,r.endRow,o,s),i=!1)})}),e}function Rne(t,e){if(!this.getSetting("indicators")||t<0)return;const n=[];t>=1&&this.isHidden(t-1)&&n.push("afterHiddenColumn"),t<this.hot.countCols()-1&&this.isHidden(t+1)&&n.push("beforeHiddenColumn"),G(e,n)}function Ene(t){t.items.push({name:xe},gne(this),mne(this))}function Tne(){const t=this.getSetting("columns");Array.isArray(t)&&this.hideColumns(t)}function _ne(t){return{key:"hidden_rows_hide",name(){const e=this.getSelectedLast();let n=0;if(Array.isArray(e)){const[r,,i]=e;r-i!==0&&(n=1)}return this.getTranslatedPhrase(qE,n)},callback(){const{from:e,to:n}=this.getSelectedRangeLast(),r=Math.max(Math.min(e.row,n.row),0),i=Math.max(e.row,n.row),o=[];for(let l=r;l<=i;l+=1)o.push(l);t.hideRows(o);const s=o[o.length-1],a=this.rowIndexMapper.getNearestNotHiddenIndex(s,1,!0);Number.isInteger(a)&&a>=0?this.selectRows(a):this.deselectCell(),this.render(),this.view.adjustElementsSize()},disabled:!1,hidden(){return!(this.selection.isSelectedByRowHeader()||this.selection.isSelectedByCorner())}}}function Mne(t){const e=[];return{key:"hidden_rows_show",name(){const n=e.length>1?1:0;return this.getTranslatedPhrase(KE,n)},callback(){var n,r;if(e.length===0)return;let i=e[0],o=e[e.length-1];i=(n=this.rowIndexMapper.getNearestNotHiddenIndex(i-1,-1))!==null&&n!==void 0?n:0,o=(r=this.rowIndexMapper.getNearestNotHiddenIndex(o+1,1))!==null&&r!==void 0?r:this.countRows()-1,t.showRows(e),this.render(),this.view.adjustElementsSize(),o-i+1===this.countRows()||this.selectRows(i,o)},disabled:!1,hidden(){const n=Be(t.getHiddenRows(),h=>this.toPhysicalRow(h));if(!(this.selection.isSelectedByRowHeader()||this.selection.isSelectedByCorner())||n.length<1)return!0;e.length=0;const r=this.getSelectedRangeLast(),i=r.getTopStartCorner().row,o=r.getBottomEndCorner().row,s=this.rowIndexMapper,a=s.getRenderableFromVisualIndex(i),l=s.getRenderableFromVisualIndex(o),u=s.getNotTrimmedIndexes(),c=[];if(i!==o){const h=o-i+1,d=l-a+1;if(h>d){const f=u.slice(i,o+1);c.push(...f.filter(g=>n.includes(g)))}}else if(a===0&&a<i)c.push(...u.slice(0,i));else if(a===null)c.push(...u.slice(0,this.countRows()));else{const h=this.countRows()-1,d=s.getRenderableFromVisualIndex(s.getNearestNotHiddenIndex(h,-1));l===d&&h>o&&c.push(...u.slice(o+1))}return M(c,h=>{e.push(this.toVisualRow(h))}),e.length===0}}}function Ine(t,e){ZL(t,e),e.add(t)}function Pne(t,e,n){ZL(t,e),e.set(t,n)}function ZL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Oa(t,e){return t.get(Is(t,e))}function GA(t,e,n){return t.set(Is(t,e),n),n}function Is(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}re.getSingleton().register("beforeHideRows");re.getSingleton().register("afterHideRows");re.getSingleton().register("beforeUnhideRows");re.getSingleton().register("afterUnhideRows");const qA="hiddenRows",One=320;var Wi=new WeakMap,xa=new WeakSet;class xne extends Xe{constructor(){super(...arguments),Ine(this,xa),Pne(this,Wi,null)}static get PLUGIN_KEY(){return qA}static get PLUGIN_PRIORITY(){return One}static get DEFAULT_SETTINGS(){return{copyPasteEnabled:!0,indicators:!1,rows:[]}}isEnabled(){return!!this.hot.getSettings()[qA]}enablePlugin(){var e=this;this.enabled||(GA(Wi,this,new cp),Oa(Wi,this).addLocalHook("init",()=>Is(xa,this,Lne).call(this)),this.hot.rowIndexMapper.registerMap(this.pluginName,Oa(Wi,this)),this.addHook("afterContextMenuDefaultOptions",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Is(xa,e,kne).call(e,...r)}),this.addHook("afterGetCellMeta",(n,r,i)=>Is(xa,this,Hne).call(this,n,r,i)),this.addHook("modifyRowHeight",(n,r)=>Is(xa,this,Ane).call(this,n,r)),this.addHook("afterGetRowHeader",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Is(xa,e,Dne).call(e,...r)}),this.addHook("modifyCopyableRange",n=>Is(xa,this,Nne).call(this,n)),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){super.disablePlugin(),this.hot.rowIndexMapper.unregisterMap(this.pluginName),this.resetCellsMeta()}showRows(e){const n=this.getHiddenRows(),r=this.isValidConfig(e);let i=n;const o=Oa(Wi,this).getValues().slice(),s=e.length>0;if(r&&s){const l=e.map(u=>this.hot.toPhysicalRow(u));M(l,u=>{o[u]=!1}),i=fr(o,(u,c,h)=>(c&&u.push(this.hot.toVisualRow(h)),u),[])}this.hot.runHooks("beforeUnhideRows",n,i,r&&s)!==!1&&(r&&s&&Oa(Wi,this).setValues(o),this.hot.runHooks("afterUnhideRows",n,i,r&&s,r&&i.length<n.length))}showRow(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.showRows(n)}hideRows(e){const n=this.getHiddenRows(),r=this.isValidConfig(e);let i=n;r&&(i=Array.from(new Set(n.concat(e)))),this.hot.runHooks("beforeHideRows",n,i,r)!==!1&&(r&&this.hot.batchExecution(()=>{M(e,s=>{Oa(Wi,this).setValueAtIndex(this.hot.toPhysicalRow(s),!0)})},!0),this.hot.runHooks("afterHideRows",n,i,r,r&&i.length>n.length))}hideRow(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.hideRows(n)}getHiddenRows(){return Be(Oa(Wi,this).getHiddenIndexes(),e=>this.hot.toVisualRow(e))}isHidden(e){return Oa(Wi,this).getValueAtIndex(this.hot.toPhysicalRow(e))||!1}isValidConfig(e){const n=this.hot.countRows();return Array.isArray(e)&&e.length>0?e.every(r=>Number.isInteger(r)&&r>=0&&r<n):!1}resetCellsMeta(){M(this.hot.getCellsMeta(),e=>{e.skipRowOnPaste=!1})}destroy(){GA(Wi,this,null),super.destroy()}}function Ane(t,e){return this.isHidden(e)?0:t}function Hne(t,e,n){if(this.getSetting("copyPasteEnabled")===!1&&this.isHidden(t)&&(n.skipRowOnPaste=!0),this.isHidden(t-1))n.className=n.className||"",n.className.indexOf("afterHiddenRow")===-1&&(n.className+=" afterHiddenRow");else if(n.className){const r=n.className.split(" ");if(r.length>0){const i=r.indexOf("afterHiddenRow");i>-1&&r.splice(i,1),n.className=r.join(" ")}}}function Nne(t){if(this.getSetting("copyPasteEnabled"))return t;const e=[],n=(r,i,o,s)=>{e.push({startRow:r,endRow:i,startCol:o,endCol:s})};return M(t,r=>{let i=!0,o=0;de(r.startRow,r.endRow,s=>{this.isHidden(s)?(i||n(o,s-1,r.startCol,r.endCol),i=!0):(i&&(o=s),s===r.endRow&&n(o,s,r.startCol,r.endCol),i=!1)})}),e}function Dne(t,e){if(!this.getSetting("indicators")||t<0)return;const n=[];t>=1&&this.isHidden(t-1)&&n.push("afterHiddenRow"),t<this.hot.countRows()-1&&this.isHidden(t+1)&&n.push("beforeHiddenRow"),G(e,n)}function kne(t){t.items.push({name:xe},_ne(this),Mne(this))}function Lne(){const t=this.getSetting("rows");Array.isArray(t)&&this.hideRows(t)}function $ne(t){return{key:"freeze_column",name(){return this.getTranslatedPhrase(SE)},callback(e,n){const[{start:{col:r}}]=n;t.freezeColumn(r),this.render(),this.view.adjustElementsSize()},hidden(){const e=this.getSelectedRange();let n=!1;return(e===void 0||e.length>1||e[0].from.col!==e[0].to.col||e[0].from.col<=this.getSettings().fixedColumnsStart-1)&&(n=!0),n}}}function Fne(t){return{key:"unfreeze_column",name(){return this.getTranslatedPhrase(RE)},callback(e,n){const[{start:{col:r}}]=n;t.unfreezeColumn(r),this.render(),this.view.adjustElementsSize()},hidden(){const e=this.getSelectedRange();let n=!1;return(e===void 0||e.length>1||e[0].from.col!==e[0].to.col||e[0].from.col>=this.getSettings().fixedColumnsStart)&&(n=!0),n}}}function Vne(t,e){QL(t,e),e.add(t)}function Wne(t,e,n){QL(t,e),e.set(t,n)}function QL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function NS(t,e){return t.get(ym(t,e))}function ub(t,e,n){return t.set(ym(t,e),n),n}function ym(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}re.getSingleton().register("beforeColumnFreeze");re.getSingleton().register("afterColumnFreeze");re.getSingleton().register("beforeColumnUnfreeze");re.getSingleton().register("afterColumnUnfreeze");const KA="manualColumnFreeze",Bne=110;var Ua=new WeakMap,cb=new WeakSet;class jne extends Xe{constructor(){super(...arguments),Vne(this,cb),Wne(this,Ua,!1)}static get PLUGIN_KEY(){return KA}static get PLUGIN_PRIORITY(){return Bne}isEnabled(){return!!this.hot.getSettings()[KA]}enablePlugin(){this.enabled||(this.addHook("afterContextMenuDefaultOptions",e=>ym(cb,this,Une).call(this,e)),this.addHook("beforeColumnMove",(e,n)=>ym(cb,this,zne).call(this,e,n)),super.enablePlugin())}disablePlugin(){ub(Ua,this,!1),super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}freezeColumn(e){const n=this.hot.getSettings(),r=n.fixedColumnsStart<this.hot.countCols()&&e>n.fixedColumnsStart-1;NS(Ua,this)||ub(Ua,this,!0),this.hot.runHooks("beforeColumnFreeze",e,r)!==!1&&(r&&(this.hot.columnIndexMapper.moveIndexes(e,n.fixedColumnsStart),n._fixedColumnsStart+=1),this.hot.runHooks("afterColumnFreeze",e,r))}unfreezeColumn(e){const n=this.hot.getSettings(),r=n.fixedColumnsStart>0&&e<=n.fixedColumnsStart-1;NS(Ua,this)||ub(Ua,this,!0),this.hot.runHooks("beforeColumnUnfreeze",e,r)!==!1&&(r&&(n._fixedColumnsStart-=1,this.hot.columnIndexMapper.moveIndexes(e,n.fixedColumnsStart)),this.hot.runHooks("afterColumnUnfreeze",e,r))}}function Une(t){t.items.push({name:"---------"},$ne(this),Fne(this))}function zne(t,e){if(NS(Ua,this)){const n=this.hot.getSettings().fixedColumnsStart;if(e<n||t.some(r=>r<n))return!1}}function zf(t,e,n){return(e=Yne(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Yne(t){var e=Gne(t,"string");return typeof e=="symbol"?e:e+""}function Gne(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const hb=0,XA=1,ZA=2,eu="px";let JL=class{constructor(e){zf(this,"hot",void 0),zf(this,"_element",null),zf(this,"state",hb),zf(this,"inlineProperty",void 0),this.hot=e,this.inlineProperty=e.isRtl()?"right":"left"}appendTo(e){e.appendChild(this._element),this.state=ZA}build(){this.state===hb&&(this._element=this.hot.rootDocument.createElement("div"),this.state=XA)}destroy(){this.isAppended()&&this._element.parentElement.removeChild(this._element),this._element=null,this.state=hb}isAppended(){return this.state===ZA}isBuilt(){return this.state>=XA}setPosition(e,n){Un(e)&&(this._element.style.top=e+eu),Un(n)&&(this._element.style[this.inlineProperty]=n+eu)}getPosition(){const e=this._element.style;return{top:e.top?parseInt(e.top,10):0,start:e[this.inlineProperty]?parseInt(e[this.inlineProperty],10):0}}setSize(e,n){Un(e)&&(this._element.style.width=e+eu),Un(n)&&(this._element.style.height=n+eu)}getSize(){return{width:this._element.style.width?parseInt(this._element.style.width,10):0,height:this._element.style.height?parseInt(this._element.style.height,10):0}}setOffset(e,n){Un(e)&&(this._element.style.marginTop=e+eu),Un(n)&&(this._element.style[`margin${Ti(this.inlineProperty)}`]=n+eu)}getOffset(){const e=this._element.style,n=`margin${Ti(this.inlineProperty)}`;return{top:e.marginTop?parseInt(e.marginTop,10):0,start:e[n]?parseInt(e[n],10):0}}};const qne="ht__manualColumnMove--backlight";let Kne=class extends JL{build(){super.build(),G(this._element,qne)}};const Xne="ht__manualColumnMove--guideline";let Zne=class extends JL{build(){super.build(),G(this._element,Xne)}};function Qne(t,e){e$(t,e),e.add(t)}function ai(t,e,n){e$(t,e),e.set(t,n)}function e$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function cr(t,e,n){return t.set(Ps(t,e),n),n}function he(t,e){return t.get(Ps(t,e))}function Ps(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}re.getSingleton().register("beforeColumnMove");re.getSingleton().register("afterColumnMove");const db="manualColumnMove",Jne=120,QA="ht__manualColumnMove",bm="show-ui",DS="on-moving--columns",kS="after-selection--columns";var Bn=new WeakMap,xs=new WeakMap,Go=new WeakMap,Fg=new WeakMap,Fs=new WeakMap,Wn=new WeakMap,Yf=new WeakMap,$r=new WeakMap,mu=new WeakMap,Sm=new WeakMap,Ih=new WeakMap,Aa=new WeakSet;class ere extends Xe{constructor(){super(...arguments),Qne(this,Aa),ai(this,Bn,new Kne(this.hot)),ai(this,xs,new Zne(this.hot)),ai(this,Go,[]),ai(this,Fg,0),ai(this,Fs,!1),ai(this,Wn,{}),ai(this,Yf,void 0),ai(this,$r,void 0),ai(this,mu,void 0),ai(this,Sm,void 0),ai(this,Ih,void 0)}static get PLUGIN_KEY(){return db}static get PLUGIN_PRIORITY(){return Jne}isEnabled(){return!!this.hot.getSettings()[db]}enablePlugin(){var e=this;this.enabled||(this.addHook("beforeOnCellMouseDown",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Ps(Aa,e,tre).call(e,...r)}),this.addHook("beforeOnCellMouseOver",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Ps(Aa,e,rre).call(e,...r)}),this.addHook("afterScrollVertically",()=>Ps(Aa,this,ore).call(this)),this.addHook("afterLoadData",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Ps(Aa,e,sre).call(e,...r)}),this.buildPluginUI(),this.registerEvents(),G(this.hot.rootElement,QA),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.moveBySettingsOrLoad(),super.updatePlugin()}disablePlugin(){pe(this.hot.rootElement,QA),this.unregisterEvents(),he(Bn,this).destroy(),he(xs,this).destroy(),super.disablePlugin()}moveColumn(e,n){return this.moveColumns([e],n)}moveColumns(e,n){const r=he(Yf,this),i=this.isMovePossible(e,n),o=this.hot.runHooks("beforeColumnMove",e,n,r,i);if(cr(Yf,this,void 0),o===!1)return;i&&this.hot.columnIndexMapper.moveIndexes(e,n);const s=i&&this.isColumnOrderChanged(e,n);return this.hot.runHooks("afterColumnMove",e,n,r,i,s),s}dragColumn(e,n){return this.dragColumns([e],n)}dragColumns(e,n){const r=this.countFinalIndex(e,n);return cr(Yf,this,n),this.moveColumns(e,r)}isMovePossible(e,n){const r=this.hot.columnIndexMapper.getNotTrimmedIndexesLength(),i=e.length+n>r,o=n<0,s=e.some(l=>l<0),a=e.some(l=>l>=r);return!(i||o||s||a)}isColumnOrderChanged(e,n){return e.some((r,i)=>r-i!==n)}countFinalIndex(e,n){const r=fr(e,(i,o)=>(o<n&&(i+=1),i),0);return n-r}getColumnsWidth(e,n){const r=this.hot.columnIndexMapper;let i=0;for(let o=e;o<=n;o+=1){const s=r.getRenderableFromVisualIndex(o);o<0?i+=this.hot.view._wt.wtViewport.getRowHeaderWidth()||0:s!==null&&(i+=this.hot.view._wt.wtTable.getColumnWidth(s)||0)}return i}moveBySettingsOrLoad(){const e=this.hot.getSettings()[db];if(Array.isArray(e))this.moveColumns(e,0);else if(e!==void 0){const n=this.persistentStateLoad();n.length&&this.moveColumns(n,0)}}isFixedColumnsStart(e){return e<this.hot.getSettings().fixedColumnsStart}persistentStateSave(){this.hot.runHooks("persistentStateSave","manualColumnMove",this.hot.columnIndexMapper.getIndexesSequence())}persistentStateLoad(){const e={};return this.hot.runHooks("persistentStateLoad","manualColumnMove",e),e.value?e.value:[]}prepareColumnsToMoving(e,n){const r=[];return de(e,n,i=>{r.push(i)}),r}refreshPositions(){const e=this.hot.view.getFirstFullyVisibleColumn();this.isFixedColumnsStart(he($r,this))&&e>0&&this.hot.scrollViewportTo({col:this.hot.columnIndexMapper.getNearestNotHiddenIndex(e-1,-1)});const n=this.hot.view._wt.wtTable,r=this.hot.view._wt.wtOverlays.scrollableElement,i=typeof r.scrollX=="number"?r.scrollX:r.scrollLeft;let o=this.hot.view.THEAD.offsetLeft+this.getColumnsWidth(0,he($r,this)-1);const s=n.hider.offsetWidth,a=n.TBODY.offsetLeft,l=he(Bn,this).getOffset().start,u=he(Bn,this).getSize().width;let c=0,h=0;if(this.hot.isRtl()){const g=this.hot.rootWindow,C=qt(this.hot.rootElement),y=g.innerWidth-he(mu,this)-C;h=g.innerWidth-he(Wn,this).eventPageX-y-(r.scrollX===void 0?i:0)}else h=he(Wn,this).eventPageX-(he(mu,this)-(r.scrollX===void 0?i:0));if(he(Sm,this)&&(c=this.hot.view._wt.wtOverlays.inlineStartOverlay.clone.wtTable.getColumnHeader(-1).offsetWidth),this.isFixedColumnsStart(he($r,this))&&(o+=i),o+=c,he($r,this)<0)he(Ih,this)>0?he(Wn,this).col=0:he(Wn,this).col=e>0?e-1:e;else if(he(Wn,this).TD.offsetWidth/2+o<=h){const g=he($r,this)>=he(Fg,this)?he(Fg,this)-1:he($r,this);he(Wn,this).col=g+1,o+=he(Wn,this).TD.offsetWidth}else he(Wn,this).col=he($r,this);let d=h,f=o;h+u+l>=s?d=s-u-l:h+l<a+c&&(d=a+c+Math.abs(l)),o>=s-1?f=s-1:f===0?f=1:r.scrollX!==void 0&&he($r,this)<he(Ih,this)&&(f-=he(mu,this)<=r.scrollX?he(mu,this):0),he(Bn,this).setPosition(null,d),he(xs,this).setPosition(null,f)}registerEvents(){const{documentElement:e}=this.hot.rootDocument;this.eventManager.addEventListener(e,"mousemove",n=>Ps(Aa,this,nre).call(this,n)),this.eventManager.addEventListener(e,"mouseup",()=>Ps(Aa,this,ire).call(this))}unregisterEvents(){this.eventManager.clear()}buildPluginUI(){he(Bn,this).build(),he(xs,this).build()}destroy(){he(Bn,this).destroy(),he(xs,this).destroy(),super.destroy()}}function tre(t,e,n,r){const i=this.hot.view._wt.wtTable,o=this.hot.selection.isSelectedByColumnHeader(),s=this.hot.getSelectedRangeLast(),a=ve(t.target,"sortAction");if(!s||!o||he(Fs,this)||t.button!==0||a){cr(Fs,this,!1),he(Go,this).length=0,pe(this.hot.rootElement,[DS,bm]);return}const l=he(xs,this).isBuilt()&&!he(xs,this).isAppended(),u=he(Bn,this).isBuilt()&&!he(Bn,this).isAppended();l&&u&&(he(xs,this).appendTo(i.hider),he(Bn,this).appendTo(i.hider));const{from:c,to:h}=s,d=Math.min(c.col,h.col),f=Math.max(c.col,h.col);if(e.row<0&&e.col>=d&&e.col<=f){r.column=!0,cr(Fs,this,!0);const g=n.firstChild?bz(t,n.firstChild).x:t.offsetX;he(Wn,this).eventPageX=t.pageX,cr($r,this,e.col),he(Wn,this).TD=n,he(Wn,this).col=e.col,cr(Go,this,this.prepareColumnsToMoving(d,f)),cr(Sm,this,!!this.hot.getSettings().rowHeaders),cr(Fg,this,this.hot.countCols()),cr(Ih,this,this.hot.getSettings().fixedColumnsStart),cr(mu,this,An(this.hot.rootElement).left);const C=he(Sm,this)?-1:0,y=i.holder.scrollTop+i.getColumnHeaderHeight(0)+1,E=e.col<he(Ih,this),v=this.hot.view._wt.wtOverlays.inlineStartOverlay.getOverlayOffset(),P=Math.abs(g-(this.hot.isRtl()?n.offsetWidth:0)),O=this.getColumnsWidth(d,e.col-1)+P,L=this.getColumnsWidth(C,d-1)+(E?v:0)+O;he(Bn,this).setPosition(y,L),he(Bn,this).setSize(this.getColumnsWidth(d,f),i.hider.offsetHeight-y),he(Bn,this).setOffset(null,-O),G(this.hot.rootElement,DS)}else pe(this.hot.rootElement,kS),cr(Fs,this,!1),he(Go,this).length=0}function nre(t){he(Fs,this)&&(he(Wn,this).eventPageX=t.pageX,this.refreshPositions())}function rre(t,e,n,r){!this.hot.getSelectedRangeLast()||!he(Fs,this)||(he(Go,this).indexOf(e.col)>-1?pe(this.hot.rootElement,bm):G(this.hot.rootElement,bm),r.row=!0,r.column=!0,r.cell=!0,cr($r,this,e.col),he(Wn,this).TD=n)}function ire(){const t=he(Wn,this).col,e=he(Go,this).length;if(cr($r,this,void 0),cr(Fs,this,!1),pe(this.hot.rootElement,[DS,bm,kS]),this.hot.selection.isSelectedByColumnHeader()&&G(this.hot.rootElement,kS),e<1||t===void 0)return;const n=he(Go,this)[0],r=this.hot.toPhysicalColumn(n),i=this.dragColumns(he(Go,this),t);if(he(Go,this).length=0,i===!0){this.persistentStateSave(),this.hot.render(),this.hot.view.adjustElementsSize();const o=this.hot.toVisualColumn(r),s=o+e-1;this.hot.selectColumns(o,s)}}function ore(){const t=this.hot.view._wt.wtTable,e=t.getColumnHeaderHeight(0)+1,n=t.holder.scrollTop,r=e+n;he(Bn,this).setPosition(r),he(Bn,this).setSize(null,t.hider.offsetHeight-r)}function sre(){this.moveBySettingsOrLoad()}function are(t,e){t$(t,e),e.add(t)}function _n(t,e,n){t$(t,e),e.set(t,n)}function t$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function jt(t,e,n){return t.set(pi(t,e),n),n}function ie(t,e){return t.get(pi(t,e))}function pi(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const Rm="manualColumnResize",lre=130,JA="manualColumnWidths";var $o=new WeakMap,Gf=new WeakMap,Er=new WeakMap,Em=new WeakMap,oo=new WeakMap,ure=new WeakMap,Pu=new WeakMap,qf=new WeakMap,nr=new WeakMap,No=new WeakMap,hl=new WeakMap,Tm=new WeakMap,Ph=new WeakMap,Oh=new WeakMap,_r=new WeakMap,xh=new WeakMap,Bi=new WeakSet;class cre extends Xe{static get PLUGIN_KEY(){return Rm}static get PLUGIN_PRIORITY(){return lre}constructor(e){super(e),are(this,Bi),_n(this,$o,null),_n(this,Gf,null),_n(this,Er,[]),_n(this,Em,null),_n(this,oo,null),_n(this,ure,null),_n(this,Pu,null),_n(this,qf,null),_n(this,nr,this.hot.rootDocument.createElement("DIV")),_n(this,No,this.hot.rootDocument.createElement("DIV")),_n(this,hl,null),_n(this,Tm,!1),_n(this,Ph,0),_n(this,Oh,null),_n(this,_r,void 0),_n(this,xh,void 0),G(ie(nr,this),"manualColumnResizer"),G(ie(No,this),"manualColumnResizerGuide")}get inlineDir(){return this.hot.isRtl()?"right":"left"}isEnabled(){return this.hot.getSettings()[Rm]}enablePlugin(){var e=this;this.enabled||(jt(_r,this,new Zs),ie(_r,this).addLocalHook("init",()=>pi(Bi,this,hre).call(this)),this.hot.columnIndexMapper.registerMap(this.pluginName,ie(_r,this)),this.addHook("modifyColWidth",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return pi(Bi,e,wre).call(e,...r)},1),this.addHook("beforeStretchingColumnWidth",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return pi(Bi,e,vre).call(e,...r)},1),this.addHook("beforeColumnResize",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return pi(Bi,e,Cre).call(e,...r)}),this.bindEvents(),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){jt(xh,this,ie(_r,this).getValues()),this.hot.columnIndexMapper.unregisterMap(this.pluginName),super.disablePlugin()}saveManualColumnWidths(){this.hot.runHooks("persistentStateSave",JA,ie(_r,this).getValues())}loadManualColumnWidths(){const e={};return this.hot.runHooks("persistentStateLoad",JA,e),e.value}setManualSize(e,n){const r=Math.max(n,20),i=this.hot.toPhysicalColumn(e);return ie(_r,this).setValueAtIndex(i,r),r}clearManualSize(e){const n=this.hot.toPhysicalColumn(e);ie(_r,this).setValueAtIndex(n,null)}setupHandlePosition(e){if(!e.parentNode)return;jt($o,this,e);const{_wt:n}=this.hot.view,r=n.wtTable.getCoords(ie($o,this)),i=r.col;if(i<0)return;const o=nn(ie($o,this)),s=ie($o,this).getBoundingClientRect(),a=i<n.getSetting("fixedColumnsStart");let l;a&&(l=n.wtOverlays.topInlineStartCornerOverlay.getRelativeCellPosition(ie($o,this),r.row,r.col)),l||(l=n.wtOverlays.topOverlay.getRelativeCellPosition(ie($o,this),r.row,r.col)),jt(Gf,this,this.hot.columnIndexMapper.getVisualFromRenderableIndex(i)),jt(Er,this,[]);const u=this.hot.selection.isSelectedByCorner()||this.hot.selection.isSelectedByColumnHeader();if(this.hot.selection.isSelected()&&u){const c=this.hot.getSelectedRange();M(c,h=>{const d=h.getTopStartCorner().col,f=h.getBottomEndCorner().col;de(d,f,g=>{ie(Er,this).includes(g)||ie(Er,this).push(g)})})}ie(Er,this).includes(ie(Gf,this))||jt(Er,this,[ie(Gf,this)]),jt(qf,this,l.start-6),jt(Pu,this,parseInt(s.width,10)),ie(nr,this).style.top=`${l.top}px`,ie(nr,this).style[this.inlineDir]=`${ie(qf,this)+ie(Pu,this)}px`,ie(nr,this).style.height=`${o}px`,this.hot.rootElement.appendChild(ie(nr,this))}refreshHandlePosition(){ie(nr,this).style[this.inlineDir]=`${ie(qf,this)+ie(Em,this)}px`}setupGuidePosition(){const e=parseInt(nn(ie(nr,this)),10),n=parseInt(ie(nr,this).style.top,10)+e,r=this.hot.view.getTableHeight();G(ie(nr,this),"active"),G(ie(No,this),"active"),ie(No,this).style.top=`${n}px`,this.refreshGuidePosition(),ie(No,this).style.height=`${r-e}px`,this.hot.rootElement.appendChild(ie(No,this))}refreshGuidePosition(){ie(No,this).style[this.inlineDir]=ie(nr,this).style[this.inlineDir]}hideHandleAndGuide(){pe(ie(nr,this),"active"),pe(ie(No,this),"active")}checkIfColumnHeader(e){const n=il(e,["THEAD"],this.hot.rootElement),{topOverlay:r,topInlineStartCornerOverlay:i}=this.hot.view._wt.wtOverlays;return[r.clone.wtTable.THEAD,i.clone.wtTable.THEAD].includes(n)}getClosestTHParent(e){return e.tagName!=="TABLE"?e.tagName==="TH"?e:this.getClosestTHParent(e.parentNode):null}afterMouseDownTimeout(){const e=()=>{this.hot.render(),this.hot.view.adjustElementsSize()},n=(r,i)=>{const o=this.hot.runHooks("beforeColumnResize",ie(oo,this),r,!0);o!==void 0&&jt(oo,this,o),this.setManualSize(r,ie(oo,this)),this.saveManualColumnWidths(),this.hot.runHooks("afterColumnResize",ie(oo,this),r,!0),i&&e()};ie(Ph,this)>=2&&(ie(Er,this).length>1?(M(ie(Er,this),i=>{n(i)}),e()):M(ie(Er,this),i=>{n(i,!0)})),jt(Ph,this,0),jt(Oh,this,null)}bindEvents(){const{rootWindow:e,rootElement:n}=this.hot;this.eventManager.addEventListener(n,"mouseover",r=>pi(Bi,this,dre).call(this,r)),this.eventManager.addEventListener(n,"mousedown",r=>pi(Bi,this,fre).call(this,r)),this.eventManager.addEventListener(e,"mousemove",r=>pi(Bi,this,gre).call(this,r)),this.eventManager.addEventListener(e,"mouseup",()=>pi(Bi,this,mre).call(this)),this.eventManager.addEventListener(ie(nr,this),"contextmenu",()=>pi(Bi,this,pre).call(this))}destroy(){super.destroy()}}function hre(){const t=this.hot.getSettings()[Rm],e=this.loadManualColumnWidths();typeof e<"u"?this.hot.batchExecution(()=>{e.forEach((n,r)=>{ie(_r,this).setValueAtIndex(r,n)})},!0):Array.isArray(t)?(this.hot.batchExecution(()=>{t.forEach((n,r)=>{ie(_r,this).setValueAtIndex(r,n)})},!0),jt(xh,this,t)):t===!0&&Array.isArray(ie(xh,this))&&this.hot.batchExecution(()=>{ie(xh,this).forEach((n,r)=>{ie(_r,this).setValueAtIndex(r,n)})},!0)}function dre(t){if(!NN(t.target)&&ie(Tm,this)!==!0&&this.checkIfColumnHeader(t.target)){const e=this.getClosestTHParent(t.target);if(!e)return;const n=e.getAttribute("colspan");e&&(n===null||n==="1")&&(ie(hl,this)||this.setupHandlePosition(e))}}function fre(t){t.target.parentNode===this.hot.rootElement&&ve(t.target,"manualColumnResizer")&&(this.setupHandlePosition(ie($o,this)),this.setupGuidePosition(),jt(hl,this,!0),ie(Oh,this)===null&&(jt(Oh,this,setTimeout(()=>this.afterMouseDownTimeout(),500)),this.hot._registerTimeout(ie(Oh,this))),jt(Ph,this,ie(Ph,this)+1),this.startX=t.pageX,jt(oo,this,ie(Pu,this)))}function gre(t){if(ie(hl,this)){const e=(t.pageX-this.startX)*this.hot.getDirectionFactor();jt(Em,this,ie(Pu,this)+e),M(ie(Er,this),n=>{jt(oo,this,this.setManualSize(n,ie(Em,this)))}),this.refreshHandlePosition(),this.refreshGuidePosition()}}function mre(){const t=()=>{this.hot.render(),this.hot.view.adjustElementsSize()},e=(n,r)=>{this.hot.runHooks("beforeColumnResize",ie(oo,this),n,!1),r&&t(),this.saveManualColumnWidths(),this.hot.runHooks("afterColumnResize",ie(oo,this),n,!1)};ie(hl,this)&&(this.hideHandleAndGuide(),jt(hl,this,!1),ie(oo,this)!==ie(Pu,this)&&(ie(Er,this).length>1?(M(ie(Er,this),r=>{e(r)}),t()):M(ie(Er,this),r=>{e(r,!0)})),this.setupHandlePosition(ie($o,this)))}function pre(){this.hideHandleAndGuide(),this.hot.rootElement.removeChild(ie(nr,this)),this.hot.rootElement.removeChild(ie(No,this)),jt(hl,this,!1),jt(Tm,this,!0),this.hot._registerImmediate(()=>{jt(Tm,this,!1)})}function wre(t,e){let n=t;if(this.enabled){const r=this.hot.toPhysicalColumn(e),i=ie(_r,this).getValueAtIndex(r);this.hot.getSettings()[Rm]&&i&&(n=i)}return n}function vre(t,e){const n=ie(_r,this).getValueAtIndex(this.hot.toPhysicalColumn(e));return typeof n=="number"?n:t}function Cre(){this.hot.view._wt.wtViewport.resetHasOversizedColumnHeadersMarked()}function fb(t,e,n){return(e=yre(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function yre(t){var e=bre(t,"string");return typeof e=="symbol"?e:e+""}function bre(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const gb=0,eH=1,tH=2,tu="px";let n$=class{constructor(e){fb(this,"hot",void 0),fb(this,"_element",null),fb(this,"state",gb),this.hot=e}appendTo(e){e.appendChild(this._element),this.state=tH}build(){this.state===gb&&(this._element=this.hot.rootDocument.createElement("div"),this.state=eH)}destroy(){this.isAppended()&&this._element.parentElement.removeChild(this._element),this._element=null,this.state=gb}isAppended(){return this.state===tH}isBuilt(){return this.state>=eH}setPosition(e,n){e!==void 0&&(this._element.style.top=e+tu),n!==void 0&&(this._element.style.left=n+tu)}getPosition(){return{top:this._element.style.top?parseInt(this._element.style.top,10):0,left:this._element.style.left?parseInt(this._element.style.left,10):0}}setSize(e,n){e&&(this._element.style.width=e+tu),n&&(this._element.style.height=n+tu)}getSize(){return{width:this._element.style.width?parseInt(this._element.style.width,10):0,height:this._element.style.height?parseInt(this._element.style.height,10):0}}setOffset(e,n){e&&(this._element.style.marginTop=e+tu),n&&(this._element.style.marginLeft=n+tu)}getOffset(){return{top:this._element.style.marginTop?parseInt(this._element.style.marginTop,10):0,left:this._element.style.marginLeft?parseInt(this._element.style.marginLeft,10):0}}};const Sre="ht__manualRowMove--backlight";class Rre extends n${build(){super.build(),G(this._element,Sre)}}const Ere="ht__manualRowMove--guideline";class Tre extends n${build(){super.build(),G(this._element,Ere)}}function _re(t,e){r$(t,e),e.add(t)}function nu(t,e,n){r$(t,e),e.set(t,n)}function r$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ja(t,e,n){return t.set(Os(t,e),n),n}function Ee(t,e){return t.get(Os(t,e))}function Os(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}re.getSingleton().register("beforeRowMove");re.getSingleton().register("afterRowMove");const mb="manualRowMove",Mre=140,nH="ht__manualRowMove",_m="show-ui",LS="on-moving--rows",$S="after-selection--rows";var jn=new WeakMap,As=new WeakMap,qo=new WeakMap,Vs=new WeakMap,hr=new WeakMap,Kf=new WeakMap,Ha=new WeakSet;class Ire extends Xe{constructor(){super(...arguments),_re(this,Ha),nu(this,jn,new Rre(this.hot)),nu(this,As,new Tre(this.hot)),nu(this,qo,[]),nu(this,Vs,void 0),nu(this,hr,{}),nu(this,Kf,void 0)}static get PLUGIN_KEY(){return mb}static get PLUGIN_PRIORITY(){return Mre}isEnabled(){return!!this.hot.getSettings()[mb]}enablePlugin(){var e=this;this.enabled||(this.addHook("beforeOnCellMouseDown",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Os(Ha,e,Pre).call(e,...r)}),this.addHook("beforeOnCellMouseOver",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Os(Ha,e,xre).call(e,...r)}),this.addHook("afterScrollHorizontally",()=>Os(Ha,this,Hre).call(this)),this.addHook("afterLoadData",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Os(Ha,e,Nre).call(e,...r)}),this.buildPluginUI(),this.registerEvents(),G(this.hot.rootElement,nH),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.moveBySettingsOrLoad(),super.updatePlugin()}disablePlugin(){pe(this.hot.rootElement,nH),this.unregisterEvents(),Ee(jn,this).destroy(),Ee(As,this).destroy(),super.disablePlugin()}moveRow(e,n){return this.moveRows([e],n)}moveRows(e,n){const r=Ee(Kf,this),i=this.isMovePossible(e,n),o=this.hot.runHooks("beforeRowMove",e,n,r,i);if(Ja(Kf,this,void 0),o===!1)return;i&&this.hot.rowIndexMapper.moveIndexes(e,n);const s=i&&this.isRowOrderChanged(e,n);return this.hot.runHooks("afterRowMove",e,n,r,i,s),s}dragRow(e,n){return this.dragRows([e],n)}dragRows(e,n){const r=this.countFinalIndex(e,n);return Ja(Kf,this,n),this.moveRows(e,r)}isMovePossible(e,n){const r=this.hot.rowIndexMapper.getNotTrimmedIndexesLength(),i=e.length+n>r,o=n<0,s=e.some(l=>l<0),a=e.some(l=>l>=r);return!(i||o||s||a)}isRowOrderChanged(e,n){return e.some((r,i)=>r-i!==n)}countFinalIndex(e,n){const r=fr(e,(i,o)=>(o<n&&(i+=1),i),0);return n-r}getRowsHeight(e,n){const r=this.hot.rowIndexMapper;let i=0;for(let o=e;o<=n;o++){const s=r.getRenderableFromVisualIndex(o);s!==null&&(i+=this.hot.view._wt.wtTable.getRowHeight(s)||this.hot.view.getDefaultRowHeight())}return i}moveBySettingsOrLoad(){const e=this.hot.getSettings()[mb];if(Array.isArray(e))this.moveRows(e,0);else if(e!==void 0){const n=this.persistentStateLoad();n.length&&this.moveRows(n,0)}}isFixedRowTop(e){return e<this.hot.getSettings().fixedRowsTop}isFixedRowBottom(e){return e>this.hot.countRows()-1-this.hot.getSettings().fixedRowsBottom}persistentStateSave(){this.hot.runHooks("persistentStateSave","manualRowMove",this.hot.rowIndexMapper.getIndexesSequence())}persistentStateLoad(){const e={};return this.hot.runHooks("persistentStateLoad","manualRowMove",e),e.value?e.value:[]}prepareRowsToMoving(){const e=this.hot.getSelectedRangeLast(),n=[];if(!e)return n;const{from:r,to:i}=e,o=Math.min(r.row,i.row),s=Math.max(r.row,i.row);return de(o,s,a=>{n.push(a)}),n}refreshPositions(){const e=Ee(hr,this).coords,n=this.hot.getFirstFullyVisibleRow(),r=this.hot.getLastFullyVisibleRow(),i=this.hot.countRows();this.isFixedRowTop(e.row)&&n>0&&this.hot.scrollViewportTo(this.hot.rowIndexMapper.getNearestNotHiddenIndex(n-1,-1)),this.isFixedRowBottom(e.row)&&r<i&&this.hot.scrollViewportTo(this.hot.rowIndexMapper.getNearestNotHiddenIndex(r+1,1),void 0,!0);const o=this.hot.view._wt.wtTable,s=Ee(hr,this).TD,a=this.hot.rootElement,l=An(a),u=jh(a),c=o.holder.scrollTop,h=this.hot.rootWindow!==u?u.scrollTop:0,d=l.top-h,f=Ee(hr,this).eventPageY-d+c,g=o.hider.offsetHeight,C=o.TBODY.offsetTop,y=Ee(jn,this).getOffset().top,E=Ee(jn,this).getSize().height,v=s.offsetHeight/2,P=s.offsetHeight;let O=this.hot.view.THEAD.offsetHeight+this.getRowsHeight(0,e.row-1);const L=f>=O+v;this.isFixedRowTop(e.row)&&(O+=this.hot.view._wt.wtOverlays.topOverlay.getOverlayOffset()),e.row<0?Ee(hr,this).row=n>0?n-1:n:L?(Ee(hr,this).row=e.row+1,O+=e.row===0?P-1:P):Ee(hr,this).row=e.row;let T=f,A=O;f+E+y>=g?T=g-E-y:f+y<C&&(T=C+Math.abs(y)),O>=g-1&&(A=g-1),Ee(jn,this).setPosition(T),Ee(As,this).setPosition(A)}registerEvents(){const{documentElement:e}=this.hot.rootDocument;this.eventManager.addEventListener(e,"mousemove",n=>Os(Ha,this,Ore).call(this,n)),this.eventManager.addEventListener(e,"mouseup",()=>Os(Ha,this,Are).call(this))}unregisterEvents(){this.eventManager.clear()}buildPluginUI(){Ee(jn,this).build(),Ee(As,this).build()}destroy(){Ee(jn,this).destroy(),Ee(As,this).destroy(),super.destroy()}}function Pre(t,e,n,r){const{wtTable:i,wtViewport:o}=this.hot.view._wt,s=this.hot.selection.isSelectedByRowHeader(),a=this.hot.getSelectedRangeLast();if(!a||!s||Ee(Vs,this)||t.button!==0){Ja(Vs,this,!1),Ee(qo,this).length=0,pe(this.hot.rootElement,[LS,_m]);return}const l=Ee(As,this).isBuilt()&&!Ee(As,this).isAppended(),u=Ee(jn,this).isBuilt()&&!Ee(jn,this).isAppended();l&&u&&(Ee(As,this).appendTo(i.hider),Ee(jn,this).appendTo(i.hider));const{from:c,to:h}=a,d=Math.min(c.row,h.row),f=Math.max(c.row,h.row);if(e.col<0&&e.row>=d&&e.row<=f){r.row=!0,Ja(Vs,this,!0),Ee(hr,this).eventPageY=t.pageY,Ee(hr,this).coords=e,Ee(hr,this).TD=n,Ja(qo,this,this.prepareRowsToMoving());const g=i.holder.scrollLeft+o.getRowHeaderWidth(),C=this.getRowsHeight(d,e.row-1)+(t.clientY-n.getBoundingClientRect().top);Ee(jn,this).setPosition(null,g),Ee(jn,this).setSize(i.hider.offsetWidth-g,this.getRowsHeight(d,f)),Ee(jn,this).setOffset(-C,null),G(this.hot.rootElement,LS),this.refreshPositions()}else pe(this.hot.rootElement,$S),Ja(Vs,this,!1),Ee(qo,this).length=0}function Ore(t){Ee(Vs,this)&&(Ee(hr,this).eventPageY=t.pageY,this.refreshPositions())}function xre(t,e,n,r){!this.hot.getSelectedRangeLast()||!Ee(Vs,this)||(Ee(qo,this).indexOf(e.row)>-1?pe(this.hot.rootElement,_m):G(this.hot.rootElement,_m),r.row=!0,r.column=!0,r.cell=!0,Ee(hr,this).coords=e,Ee(hr,this).TD=n)}function Are(){const t=Ee(hr,this).row,e=Ee(qo,this).length;if(Ja(Vs,this,!1),pe(this.hot.rootElement,[LS,_m,$S]),this.hot.selection.isSelectedByRowHeader()&&G(this.hot.rootElement,$S),e<1||t===void 0)return;const n=Ee(qo,this)[0],r=this.hot.toPhysicalRow(n),i=this.dragRows(Ee(qo,this),t);if(Ee(qo,this).length=0,i===!0){this.persistentStateSave(),this.hot.render(),this.hot.view.adjustElementsSize();const o=this.hot.toVisualRow(r),s=o+e-1;this.hot.selectRows(o,s)}}function Hre(){const t=this.hot.view._wt.wtTable,e=this.hot.view._wt.wtViewport.getRowHeaderWidth(),n=t.holder.scrollLeft,r=e+n;Ee(jn,this).setPosition(null,r),Ee(jn,this).setSize(t.hider.offsetWidth-r)}function Nre(){this.moveBySettingsOrLoad()}function Dre(t,e){i$(t,e),e.add(t)}function Mn(t,e,n){i$(t,e),e.set(t,n)}function i$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Nt(t,e,n){return t.set(Fo(t,e),n),n}function ne(t,e){return t.get(Fo(t,e))}function Fo(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const Mm="manualRowResize",kre=30,rH="manualRowHeights";var Ji=new WeakMap,Xf=new WeakMap,Tr=new WeakMap,Ah=new WeakMap,Hs=new WeakMap,fT=new WeakMap,Ou=new WeakMap,Zf=new WeakMap,Fn=new WeakMap,Xi=new WeakMap,dl=new WeakMap,Im=new WeakMap,Hh=new WeakMap,Nh=new WeakMap,Ci=new WeakMap,Dh=new WeakMap,bs=new WeakSet;class Lre extends Xe{static get PLUGIN_KEY(){return Mm}static get PLUGIN_PRIORITY(){return kre}constructor(e){super(e),Dre(this,bs),Mn(this,Ji,null),Mn(this,Xf,null),Mn(this,Tr,[]),Mn(this,Ah,null),Mn(this,Hs,null),Mn(this,fT,null),Mn(this,Ou,null),Mn(this,Zf,null),Mn(this,Fn,this.hot.rootDocument.createElement("DIV")),Mn(this,Xi,this.hot.rootDocument.createElement("DIV")),Mn(this,dl,!1),Mn(this,Im,!1),Mn(this,Hh,0),Mn(this,Nh,null),Mn(this,Ci,void 0),Mn(this,Dh,void 0),G(ne(Fn,this),"manualRowResizer"),G(ne(Xi,this),"manualRowResizerGuide")}get inlineDir(){return this.hot.isRtl()?"right":"left"}isEnabled(){return this.hot.getSettings()[Mm]}enablePlugin(){this.enabled||(Nt(Ci,this,new Zs),ne(Ci,this).addLocalHook("init",()=>Fo(bs,this,Ure).call(this)),this.hot.rowIndexMapper.registerMap(this.pluginName,ne(Ci,this)),this.addHook("modifyRowHeight",(e,n)=>Fo(bs,this,jre).call(this,e,n)),this.bindEvents(),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){Nt(Dh,this,ne(Ci,this).getValues()),this.hot.rowIndexMapper.unregisterMap(this.pluginName),super.disablePlugin()}saveManualRowHeights(){this.hot.runHooks("persistentStateSave",rH,ne(Ci,this).getValues())}loadManualRowHeights(){const e={};return this.hot.runHooks("persistentStateLoad",rH,e),e.value}setManualSize(e,n){const r=this.hot.toPhysicalRow(e),i=Math.max(n,this.hot.view.getDefaultRowHeight());return ne(Ci,this).setValueAtIndex(r,i),i}getLastDesiredRowHeight(){return ne(Ah,this)}setupHandlePosition(e){Nt(Ji,this,e);const{view:n}=this.hot,{_wt:r}=n,i=r.wtTable.getCoords(ne(Ji,this)),o=i.row;if(o<0)return;const s=qt(ne(Ji,this)),a=ne(Ji,this).getBoundingClientRect(),l=o<r.getSetting("fixedRowsTop"),u=o>=n.countNotHiddenRowIndexes(0,1)-r.getSetting("fixedRowsBottom");let c;l?c=r.wtOverlays.topInlineStartCornerOverlay.getRelativeCellPosition(ne(Ji,this),i.row,i.col):u&&(c=r.wtOverlays.bottomInlineStartCornerOverlay.getRelativeCellPosition(ne(Ji,this),i.row,i.col)),c||(c=r.wtOverlays.inlineStartOverlay.getRelativeCellPosition(ne(Ji,this),i.row,i.col)),Nt(Xf,this,this.hot.rowIndexMapper.getVisualFromRenderableIndex(o)),Nt(Tr,this,[]);const h=this.hot.selection.isSelectedByCorner()||this.hot.selection.isSelectedByRowHeader();if(this.hot.selection.isSelected()&&h){const d=this.hot.getSelectedRange();M(d,f=>{const g=f.getTopStartCorner().row,C=f.getBottomStartCorner().row;de(g,C,y=>{ne(Tr,this).includes(y)||ne(Tr,this).push(y)})})}ne(Tr,this).includes(ne(Xf,this))||Nt(Tr,this,[ne(Xf,this)]),Nt(Zf,this,c.top-6),Nt(Ou,this,parseInt(a.height,10)),ne(Fn,this).style.top=`${ne(Zf,this)+ne(Ou,this)}px`,ne(Fn,this).style[this.inlineDir]=`${c.start}px`,ne(Fn,this).style.width=`${s}px`,this.hot.rootElement.appendChild(ne(Fn,this))}refreshHandlePosition(){ne(Fn,this).style.top=`${ne(Zf,this)+ne(Ah,this)}px`}setupGuidePosition(){const e=parseInt(qt(ne(Fn,this)),10),n=parseInt(ne(Fn,this).style[this.inlineDir],10)+e,r=this.hot.view.getTableWidth();G(ne(Fn,this),"active"),G(ne(Xi,this),"active"),ne(Xi,this).style.top=ne(Fn,this).style.top,ne(Xi,this).style[this.inlineDir]=`${n}px`,ne(Xi,this).style.width=`${r-e}px`,this.hot.rootElement.appendChild(ne(Xi,this))}refreshGuidePosition(){ne(Xi,this).style.top=ne(Fn,this).style.top}hideHandleAndGuide(){pe(ne(Fn,this),"active"),pe(ne(Xi,this),"active")}checkIfRowHeader(e){const n=il(e,["TBODY"],this.hot.rootElement),{inlineStartOverlay:r,topInlineStartCornerOverlay:i,bottomInlineStartCornerOverlay:o}=this.hot.view._wt.wtOverlays;return[r.clone.wtTable.TBODY,i.clone.wtTable.TBODY,o.clone.wtTable.TBODY].includes(n)}getClosestTHParent(e){return e.tagName!=="TABLE"?e.tagName==="TH"?e:this.getClosestTHParent(e.parentNode):null}getActualRowHeight(e){const n=this.hot.view._wt.wtTable.getRowHeight(e);return n!==void 0&&ne(Hs,this)<n?n:ne(Hs,this)}afterMouseDownTimeout(){const e=()=>{this.hot.render(),this.hot.view.adjustElementsSize()},n=(r,i)=>{const o=this.hot.runHooks("beforeRowResize",this.getActualRowHeight(r),r,!0);o!==void 0&&Nt(Hs,this,o),this.setManualSize(r,ne(Hs,this)),this.hot.runHooks("afterRowResize",this.getActualRowHeight(r),r,!0),i&&e()};ne(Hh,this)>=2&&(ne(Tr,this).length>1?(M(ne(Tr,this),i=>{n(i)}),e()):M(ne(Tr,this),i=>{n(i,!0)})),Nt(Hh,this,0),Nt(Nh,this,null)}bindEvents(){const{rootElement:e,rootWindow:n}=this.hot;this.eventManager.addEventListener(e,"mouseover",r=>Fo(bs,this,$re).call(this,r)),this.eventManager.addEventListener(e,"mousedown",r=>Fo(bs,this,Fre).call(this,r)),this.eventManager.addEventListener(n,"mousemove",r=>Fo(bs,this,Vre).call(this,r)),this.eventManager.addEventListener(n,"mouseup",()=>Fo(bs,this,Wre).call(this)),this.eventManager.addEventListener(ne(Fn,this),"contextmenu",()=>Fo(bs,this,Bre).call(this))}destroy(){super.destroy()}}function $re(t){if(!NN(t.target)&&ne(Im,this)!==!0&&this.checkIfRowHeader(t.target)){const e=this.getClosestTHParent(t.target);e&&(ne(dl,this)||this.setupHandlePosition(e))}}function Fre(t){ve(t.target,"manualRowResizer")&&(this.setupHandlePosition(ne(Ji,this)),this.setupGuidePosition(),Nt(dl,this,!0),ne(Nh,this)===null&&(Nt(Nh,this,setTimeout(()=>this.afterMouseDownTimeout(),500)),this.hot._registerTimeout(ne(Nh,this))),Nt(Hh,this,ne(Hh,this)+1),Nt(fT,this,t.pageY),Nt(Hs,this,ne(Ou,this)))}function Vre(t){ne(dl,this)&&(Nt(Ah,this,ne(Ou,this)+(t.pageY-ne(fT,this))),M(ne(Tr,this),e=>{Nt(Hs,this,this.setManualSize(e,ne(Ah,this)))}),this.refreshHandlePosition(),this.refreshGuidePosition())}function Wre(){const t=()=>{this.hot.render(),this.hot.view.adjustElementsSize()},e=(n,r)=>{this.hot.runHooks("beforeRowResize",this.getActualRowHeight(n),n,!1),r&&t(),this.saveManualRowHeights(),this.hot.runHooks("afterRowResize",this.getActualRowHeight(n),n,!1)};ne(dl,this)&&(this.hideHandleAndGuide(),Nt(dl,this,!1),ne(Hs,this)!==ne(Ou,this)&&(ne(Tr,this).length>1?(M(ne(Tr,this),r=>{e(r)}),t()):M(ne(Tr,this),r=>{e(r,!0)})),this.setupHandlePosition(ne(Ji,this)))}function Bre(){this.hideHandleAndGuide(),this.hot.rootElement.removeChild(ne(Fn,this)),this.hot.rootElement.removeChild(ne(Xi,this)),Nt(dl,this,!1),Nt(Im,this,!0),this.hot._registerImmediate(()=>{Nt(Im,this,!1)})}function jre(t,e){let n=t;if(this.enabled){const r=this.hot.toPhysicalRow(e),i=ne(Ci,this).getValueAtIndex(r);this.hot.getSettings()[Mm]&&i&&(n=i)}return n}function Ure(){const t=this.hot.getSettings()[Mm],e=this.loadManualRowHeights();this.hot.batchExecution(()=>{typeof e<"u"?e.forEach((n,r)=>{ne(Ci,this).setValueAtIndex(r,n)}):Array.isArray(t)?(t.forEach((n,r)=>{ne(Ci,this).setValueAtIndex(r,n)}),Nt(Dh,this,t)):t===!0&&Array.isArray(ne(Dh,this))&&ne(Dh,this).forEach((n,r)=>{ne(Ci,this).setValueAtIndex(r,n)})},!0)}var iH={},oH;function zre(){if(oH)return iH;oH=1;var t=sp();return t("flatMap"),iH}zre();var sH={},aH={},pb,lH;function Yre(){if(lH)return pb;lH=1;var t=sn(),e=ln(),n=ho(),r=QS();return pb=function(i,o){(!o||typeof i!="string")&&e(i);var s=r(i);return n(e(s!==void 0?t(s,i):i))},pb}var uH;function Gre(){if(uH)return aH;uH=1;var t=dt(),e=sn(),n=dr(),r=ln(),i=ho(),o=Yre(),s=tR(),a=Ir(),l=Gs(),u=Ks(),c=!l&&u("flatMap",TypeError),h=s(function(){for(var d=this.iterator,f=this.mapper,g,C;;){if(C=this.inner)try{if(g=r(e(C.next,C.iterator)),!g.done)return g.value;this.inner=null}catch(y){a(d,"throw",y)}if(g=r(e(this.next,d)),this.done=!!g.done)return;try{this.inner=o(f(g.value,this.counter++),!1)}catch(y){a(d,"throw",y)}}});return t({target:"Iterator",proto:!0,real:!0,forced:l||c},{flatMap:function(f){r(this);try{n(f)}catch(g){a(this,"throw",g)}return c?e(c,this,f):new h(i(this),{mapper:f,inner:null})}}),aH}var cH;function qre(){return cH||(cH=1,Gre()),sH}qre();function Kre(t,e,n){Xre(t,e),e.set(t,n)}function Xre(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Na(t,e,n){return(e=Zre(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Zre(t){var e=Qre(t,"string");return typeof e=="symbol"?e:e+""}function Qre(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function hH(t,e){return t.get(o$(t,e))}function Qf(t,e,n){return t.set(o$(t,e),n),n}function o$(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Da=new WeakMap;class eo{constructor(e,n,r,i,o,s){Na(this,"row",void 0),Na(this,"col",void 0),Na(this,"rowspan",void 0),Na(this,"colspan",void 0),Na(this,"removed",!1),Na(this,"cellCoordsFactory",void 0),Na(this,"cellRangeFactory",void 0),Kre(this,Da,null),this.row=e,this.col=n,this.rowspan=r,this.colspan=i,this.cellCoordsFactory=o,this.cellRangeFactory=s}static NEGATIVE_VALUES_WARNING(e){let{row:n,col:r,rowspan:i,colspan:o}=e;return nt`The merged cell declared with {row: ${n}, col: ${r},\x20
|
|
268
|
+
rowspan: ${i}, colspan: ${o}} contains negative values, which is\x20
|
|
269
|
+
not supported. It will not be added to the collection.`}static IS_OUT_OF_BOUNDS_WARNING(e){let{row:n,col:r}=e;return nt`The merged cell declared at [${n}, ${r}] is positioned\x20
|
|
270
|
+
(or positioned partially) outside of the table range. It was not added to the table, please fix your setup.`}static IS_SINGLE_CELL(e){let{row:n,col:r}=e;return nt`The merged cell declared at [${n}, ${r}] has both "rowspan"\x20
|
|
271
|
+
and "colspan" declared as "1", which makes it a single cell. It cannot be added to the collection.`}static ZERO_SPAN_WARNING(e){let{row:n,col:r}=e;return nt`The merged cell declared at [${n}, ${r}] has "rowspan"\x20
|
|
272
|
+
or "colspan" declared as "0", which is not supported. It cannot be added to the collection.`}static containsNegativeValues(e){let{row:n,col:r,rowspan:i,colspan:o}=e;return n<0||r<0||i<0||o<0}static isSingleCell(e){let{rowspan:n,colspan:r}=e;return r===1&&n===1}static containsZeroSpan(e){let{rowspan:n,colspan:r}=e;return r===0||n===0}static isOutOfBounds(e,n,r){return e.row<0||e.col<0||e.row>=n||e.row+e.rowspan-1>=n||e.col>=r||e.col+e.colspan-1>=r}normalize(e){const n=e.countRows(),r=e.countCols();this.row<0?this.row=0:this.row>n-1&&(this.row=n-1),this.col<0?this.col=0:this.col>r-1&&(this.col=r-1),this.row+this.rowspan>n-1&&(this.rowspan=n-this.row),this.col+this.colspan>r-1&&(this.colspan=r-this.col),Qf(Da,this,null)}includes(e,n){return this.row<=e&&this.col<=n&&this.row+this.rowspan-1>=e&&this.col+this.colspan-1>=n}includesHorizontally(e){return this.col<=e&&this.col+this.colspan-1>=e}includesVertically(e){return this.row<=e&&this.row+this.rowspan-1>=e}shift(e,n){const r=e[0]||e[1],i=n+Math.abs(e[0]||e[1])-1,o=e[0]?"colspan":"rowspan",s=e[0]?"col":"row",a=Math.min(n,i),l=Math.max(n,i),u=this[s],c=this[s]+this[o]-1;if(u>=n&&(this[s]+=r),r>0)n<=c&&n>u&&(this[o]+=r);else if(r<0){if(a<=u&&l>=c)return this.removed=!0,Qf(Da,this,null),!1;if(u>=a&&u<=l){const h=l-u+1,d=Math.abs(r)-h;this[s]-=d+r,this[o]-=h}else if(u<=a&&c>=l)this[o]+=r;else if(u<=a&&c>=a&&c<l){const h=c-a+1;this[o]-=h}}return Qf(Da,this,null),!0}isFarther(e,n){return e?n==="down"?e.row+e.rowspan-1<this.row+this.rowspan-1:n==="up"?e.row>this.row:n==="right"?e.col+e.colspan-1<this.col+this.colspan-1:n==="left"?e.col>this.col:null:!0}getLastRow(){return this.row+this.rowspan-1}getLastColumn(){return this.col+this.colspan-1}getRange(){return hH(Da,this)||Qf(Da,this,this.cellRangeFactory(this.cellCoordsFactory(this.row,this.col),this.cellCoordsFactory(this.row,this.col),this.cellCoordsFactory(this.getLastRow(),this.getLastColumn()))),hH(Da,this)}}function Jre(t,e){eie(t,e),e.add(t)}function eie(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Jf(t,e,n){return(e=tie(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function tie(t){var e=nie(t,"string");return typeof e=="symbol"?e:e+""}function nie(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ka(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Ss=new WeakSet;class Pm{constructor(e){Jre(this,Ss),Jf(this,"plugin",void 0),Jf(this,"mergedCells",[]),Jf(this,"mergedCellsMatrix",new Map),Jf(this,"hot",void 0),this.plugin=e,this.hot=e.hot}static IS_OVERLAPPING_WARNING(e){let{row:n,col:r}=e;return nt`The merged cell declared at [${n}, ${r}], overlaps\x20
|
|
273
|
+
with the other declared merged cell. The overlapping merged cell was not added to the table, please\x20
|
|
274
|
+
fix your setup.`}get(e,n){var r;return this.mergedCellsMatrix.has(e)&&(r=this.mergedCellsMatrix.get(e).get(n))!==null&&r!==void 0?r:!1}getByRange(e){const{row:n,col:r}=e.getTopStartCorner(),{row:i,col:o}=e.getBottomEndCorner(),s=this.mergedCells.length;let a=!1;for(let l=0;l<s;l++){const u=this.mergedCells[l],{row:c,col:h,rowspan:d,colspan:f}=u;if(c>=n&&c+d-1<=i&&h>=r&&h+f-1<=o){a=u;break}}return a}filterOverlappingMergeCells(e){const n=new Set;return this.mergedCells.forEach(i=>{const{row:o,col:s,colspan:a,rowspan:l}=i;for(let u=o;u<o+l;u++)for(let c=s;c<s+a;c++)n.add(`r${u},c${c}`)}),e.filter(i=>{const{row:o,col:s,colspan:a,rowspan:l}=i,u=new Set;let c=!1;for(let h=o;h<o+l;h++){for(let d=s;d<s+a;d++){const f=`r${h},c${d}`;if(n.has(f)){Ze(Pm.IS_OVERLAPPING_WARNING(i)),c=!0;break}u.add(f)}if(c)break}return c||n.add(...u),!c})}getWithinRange(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const{row:r,col:i}=e.getTopStartCorner(),{row:o,col:s}=e.getBottomEndCorner(),a=[];for(let l=r;l<=o;l++)for(let u=i;u<=s;u++){const c=this.get(l,u);c&&(n||!n&&c.row===l&&c.col===u)&&a.push(c)}return a}add(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const r=e.row,i=e.col,o=e.rowspan,s=e.colspan,a=new eo(r,i,o,s,this.hot._createCellCoords,this.hot._createCellRange),l=this.get(r,i),u=n?!1:this.isOverlapping(a);return!l&&!u?(this.hot&&a.normalize(this.hot),this.mergedCells.push(a),ka(Ss,this,dH).call(this,a),a):(u&&Ze(Pm.IS_OVERLAPPING_WARNING(a)),!1)}remove(e,n){const r=this.get(e,n),i=r?this.mergedCells.indexOf(r):-1;return r&&i!==-1?(this.mergedCells.splice(i,1),ka(Ss,this,rie).call(this,r),r):!1}clear(){M(this.mergedCells,e=>{let{row:n,col:r,rowspan:i,colspan:o}=e;de(n,n+i,s=>{de(r,r+o,a=>{const l=this.hot.getCell(s,a);l&&(l.removeAttribute("rowspan"),l.removeAttribute("colspan"),l.style.display="")})})}),this.mergedCells.length=0,this.mergedCellsMatrix=new Map}isOverlapping(e){const n=e.getRange();for(let r=0;r<this.mergedCells.length;r++)if(this.mergedCells[r].getRange().overlaps(n))return!0;return!1}isFirstRenderableMergedCell(e,n){const r=this.get(e,n);if(!r)return!1;const{row:i,col:o,rowspan:s,colspan:a}=r,l=this.hot.view.getActiveOverlayName(),u=["top","top_inline_start_corner"].includes(l)?0:this.hot.getFirstRenderedVisibleRow(),c=["inline_start","top_inline_start_corner","bottom_inline_start_corner"].includes(l)?0:this.hot.getFirstRenderedVisibleColumn(),h=Ue(u,i,i+s-1),d=Ue(c,o,o+a-1);return this.hot.rowIndexMapper.getNearestNotHiddenIndex(h,1)===e&&this.hot.columnIndexMapper.getNearestNotHiddenIndex(d,1)===n}getFirstRenderableCoords(e,n){const r=this.get(e,n);if(!r||this.isFirstRenderableMergedCell(e,n))return this.hot._createCellCoords(e,n);const i=this.hot.rowIndexMapper.getNearestNotHiddenIndex(r.row,1),o=this.hot.columnIndexMapper.getNearestNotHiddenIndex(r.col,1);return this.hot._createCellCoords(i,o)}getStartMostColumnIndex(e,n){const r=ka(Ss,this,eg).call(this,e,"col",-1);let i=n;for(let o=0;o<r.length;o++)if(r[o]<=n){i=r[o];break}return i}getEndMostColumnIndex(e,n){const r=ka(Ss,this,eg).call(this,e,"col",1);let i=n;for(let o=0;o<r.length;o++)if(r[o]>=n){i=r[o];break}return i}getTopMostRowIndex(e,n){const r=ka(Ss,this,eg).call(this,e,"row",-1);let i=n;for(let o=0;o<r.length;o++)if(r[o]<=n){i=r[o];break}return i}getBottomMostRowIndex(e,n){const r=ka(Ss,this,eg).call(this,e,"row",1);let i=n;for(let o=0;o<r.length;o++)if(r[o]>=n){i=r[o];break}return i}shiftCollections(e,n,r){const i=[0,0];switch(e){case"right":i[0]+=r;break;case"left":i[0]-=r;break;case"down":i[1]+=r;break;case"up":i[1]-=r;break}const o=[];this.mergedCells.forEach(s=>{s.shift(i,n),s.removed&&o.push(s)}),o.forEach(s=>{this.mergedCells.splice(this.mergedCells.indexOf(s),1)}),this.mergedCellsMatrix.clear(),this.mergedCells.forEach(s=>{ka(Ss,this,dH).call(this,s)})}}function eg(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;const r=new Map,i=n===1?t.getTopStartCorner():t.getBottomEndCorner(),o=n===1?t.getBottomEndCorner():t.getTopStartCorner();for(let s=i.row;n===1?s<=o.row:s>=o.row;s+=n)for(let a=i.col;n===1?a<=o.col:a>=o.col;a+=n){const l=e==="row"?s:a,u=this.get(s,a);let c=l;u&&(c=n===1?u[e]+u[`${e}span`]-1:u[e]),r.has(l)||r.set(l,new Set),r.get(l).add(c)}return Array.from(new Set(Array.from(r.entries()).filter(s=>{let[,a]=s;return a.size===1}).flatMap(s=>{let[,a]=s;return Array.from(a)})))}function dH(t){for(let e=t.row;e<t.row+t.rowspan;e++)for(let n=t.col;n<t.col+t.colspan;n++)this.mergedCellsMatrix.has(e)||this.mergedCellsMatrix.set(e,new Map),this.mergedCellsMatrix.get(e).set(n,t)}function rie(t){for(let e=t.row;e<t.row+t.rowspan;e++)for(let n=t.col;n<t.col+t.colspan;n++)this.mergedCellsMatrix.get(e).delete(n)}function wb(t,e,n){return(e=iie(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function iie(t){var e=oie(t,"string");return typeof e=="symbol"?e:e+""}function oie(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class sie{constructor(e){wb(this,"plugin",void 0),wb(this,"mergedCellsCollection",void 0),wb(this,"currentFillData",null),this.plugin=e,this.mergedCellsCollection=this.plugin.mergedCellsCollection}getDirection(e,n){let r=null;return n[0]===e[0]&&n[1]===e[1]&&n[3]===e[3]?r="down":n[2]===e[2]&&n[1]===e[1]&&n[3]===e[3]?r="up":n[1]===e[1]&&n[2]===e[2]?r="right":r="left",r}snapDragArea(e,n,r,i){const o=n.slice(0),s=this.getAutofillSize(e,n,r),[a,l,u,c]=e,d=["up","down"].indexOf(r)>-1?u-a+1:c-l+1,f=Math.floor(s/d)*d,g=s-f,C=this.getFarthestCollection(e,n,r,i);if(C){if(r==="down"){const y=C.row+C.rowspan-a-g;o[2]+y>=this.plugin.hot.countRows()?o[2]-=g:o[2]+=g?y:0}else if(r==="right"){const y=C.col+C.colspan-l-g;o[3]+y>=this.plugin.hot.countCols()?o[3]-=g:o[3]+=g?y:0}else if(r==="up"){const y=u-g-C.row+1;o[0]+y<0?o[0]+=g:o[0]-=g?y:0}else if(r==="left"){const y=c-g-C.col+1;o[1]+y<0?o[1]+=g:o[1]-=g?y:0}}return this.updateCurrentFillCache({baseArea:e,dragDirection:r,foundMergedCells:i,fillSize:s,dragArea:o,cycleLength:d}),o}updateCurrentFillCache(e){this.currentFillData||(this.currentFillData={}),rn(this.currentFillData,e)}getAutofillSize(e,n,r){const[i,o,s,a]=e,[l,u,c,h]=n;switch(r){case"up":return i-l;case"down":return c-s;case"left":return o-u;case"right":return h-a;default:return null}}getDragArea(e,n,r){const[i,o,s,a]=e,[l,u,c,h]=n;switch(r){case"up":return[l,u,i-1,a];case"down":{const d=this.mergedCellsCollection.get(c,a),f=d?d.rowspan-1:0;return[s+1,o,c+f,a]}case"left":return[l,u,s,o-1];case"right":{const d=this.mergedCellsCollection.get(c,a),f=d?d.colspan-1:0;return[i,a+f,c,h]}default:return null}}getFarthestCollection(e,n,r,i){const[o,s,a,l]=e,u=["up","down"].indexOf(r)>-1,c=u?a:l,h=u?o:s,d=this.getAutofillSize(e,n,r),f=u?a-o+1:l-s+1,g=Math.floor(d/f)*f,C=d-g;let y=null,E=null,v=null;switch(r){case"up":y="includesVertically",v=c-C+1;break;case"left":y="includesHorizontally",v=c-C+1;break;case"down":y="includesVertically",v=h+C-1;break;case"right":y="includesHorizontally",v=h+C-1;break}return M(i,P=>{P[y](v)&&P.isFarther(E,r)&&(E=P)}),E}recreateAfterDataPopulation(e){if(!this.currentFillData)return;const n=this.getRangeFromChanges(e),r=this.currentFillData.foundMergedCells,i=this.currentFillData.dragDirection,o=(u,c)=>{switch(i){case"up":return u.row-c>=n.from.row;case"down":return u.row+u.rowspan-1+c<=n.to.row;case"left":return u.col-c>=n.from.column;case"right":return u.col+u.colspan-1+c<=n.to.column;default:return null}};let s=0,a=null,l=1;do for(let u=0;u<r.length;u+=1){if(a=r[u],s=l*this.currentFillData.cycleLength,o(a,s))switch(i){case"up":this.plugin.mergedCellsCollection.add({row:a.row-s,rowspan:a.rowspan,col:a.col,colspan:a.colspan},!0);break;case"down":this.plugin.mergedCellsCollection.add({row:a.row+s,rowspan:a.rowspan,col:a.col,colspan:a.colspan},!0);break;case"left":this.plugin.mergedCellsCollection.add({row:a.row,rowspan:a.rowspan,col:a.col-s,colspan:a.colspan},!0);break;case"right":this.plugin.mergedCellsCollection.add({row:a.row,rowspan:a.rowspan,col:a.col+s,colspan:a.colspan},!0);break}u===r.length-1&&(l+=1)}while(o(a,s));this.currentFillData=null,this.plugin.hot.render(),r.length>0&&this.plugin.ifChromeForceRepaint()}getRangeFromChanges(e){const n={min:null,max:null},r={min:null,max:null};return M(e,i=>{const o=i[0],s=this.plugin.hot.propToCol(i[1]);(n.min===null||o<n.min)&&(n.min=o),(n.max===null||o>n.max)&&(n.max=o),(r.min===null||s<r.min)&&(r.min=s),(r.max===null||s>r.max)&&(r.max=s)}),{from:{row:n.min,column:r.min},to:{row:n.max,column:r.max}}}dragAreaOverlapsCollections(e,n,r){const i=this.getDragArea(e,n,r),[o,s,a,l]=i,u=this.plugin.hot._createCellCoords(o,s),c=this.plugin.hot._createCellCoords(a,l),h=this.plugin.hot._createCellRange(u,u,c);if(this.mergedCellsCollection.getWithinRange(h,!0).length===0)return!1;const f=this.mergedCellsCollection.getWithinRange(h,!1);return f.length===0?!0:r==="up"||r==="down"?!f.every(g=>{let{colspan:C}=g;return C===h.getWidth()}):!f.every(g=>{let{rowspan:C}=g;return C===h.getHeight()})}}function vb(t,e,n){return(e=aie(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function aie(t){var e=lie(t,"string");return typeof e=="symbol"?e:e+""}function lie(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class uie{constructor(e){vb(this,"plugin",void 0),vb(this,"hot",void 0),vb(this,"fullySelectedMergedCellClassName","fullySelectedMergedCell"),this.plugin=e,this.hot=e.hot}getSelectedMergedCellClassName(e,n,r,i){const o=Math.min(r[0],r[2]),s=Math.min(r[1],r[3]),a=Math.max(r[0],r[2]),l=Math.max(r[1],r[3]);if(i===void 0||!this.plugin.mergedCellsCollection.isFirstRenderableMergedCell(e,n))return;const c=this.plugin.mergedCellsCollection.get(e,n);if(!c)return;const h=c.getLastRow(),d=c.getLastColumn();if(o<=c.row&&s<=c.col&&a>=h&&l>=d)return`${this.fullySelectedMergedCellClassName}-${i}`;if(this.isMergeCellFullySelected(c,this.plugin.hot.getSelectedRange()))return`${this.fullySelectedMergedCellClassName}-multiple`}isMergeCellFullySelected(e,n){const r=[];if(!n||!e)return!1;for(let i=0;i<e.rowspan;i+=1)for(let o=0;o<e.colspan;o+=1)r.push(this.hot._createCellCoords(e.row+i,e.col+o));for(let i=0;i<r.length;i+=1){const o=[];for(let s=0;s<n.length;s+=1)o[s]=n[s].includes(r[i]);if(!o.includes(!0))return!1}return!0}getSelectedMergedCellClassNameToRemove(){const e=[];for(let n=0;n<=7;n+=1)e.push(`${this.fullySelectedMergedCellClassName}-${n}`);return e.push(`${this.fullySelectedMergedCellClassName}-multiple`),e}}function cie(t){return{key:"mergeCells",name(){const e=this.getSelectedLast();if(e){const n=t.mergedCellsCollection.get(e[0],e[1]);if(n.row===e[0]&&n.col===e[1]&&n.row+n.rowspan-1===e[2]&&n.col+n.colspan-1===e[3])return this.getTranslatedPhrase(TE)}return this.getTranslatedPhrase(EE)},callback(){const e=this.getSelectedRangeLast();if(!e)return;e.setDirection(this.isRtl()?"NE-SW":"NW-SE");const{from:n,to:r}=e;t.toggleMerge(e),this.selectCell(n.row,n.col,r.row,r.col,!1)},disabled(){const e=this.getSelectedLast();return e?eo.isSingleCell({row:e[0],col:e[1],rowspan:e[2]-e[0]+1,colspan:e[3]-e[1]+1})||this.selection.isSelectedByCorner():!0},hidden:!1}}function kh(t,e,n){return(e=hie(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function hie(t){var e=die(t,"string");return typeof e=="symbol"?e:e+""}function die(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class fH{constructor(e){kh(this,"data",void 0),kh(this,"next",null),kh(this,"prev",null),this.data=e}}class tg{constructor(){kh(this,"first",null),kh(this,"last",null)}push(e){const n=new fH(e);if(this.first===null)this.first=n,this.last=n;else{const r=this.last;this.last=n,n.prev=r,r.next=n}return n}unshift(e){const n=new fH(e);if(this.first===null)this.first=n,this.last=n;else{const r=this.first;this.first=n,n.next=r,r.prev=n}}inorder(e){let n=this.first;for(;n;){const r=e(n);if(n===this.last||r===!0)break;n=n.next}}remove(e){if(this.first===null)return!1;let n=this.first,r,i;for(;n;){if(n.data===e)return r=n.next,i=n.prev,r&&(r.prev=i),i&&(i.next=r),n===this.first&&(this.first=r),n===this.last&&(this.last=i),!0;n=n.next}return!1}hasCycle(){let e=this.first,n=this.first;for(;;){if(e===null||(e=e.next,e===null))return!1;if(e=e.next,n=n.next,e===n)return!0}}pop(){if(this.last===null)return null;const e=this.last;return this.last=this.last.prev,e}shift(){if(this.first===null)return null;const e=this.first;return this.first=this.first.next,e}recursiveReverse(){function e(r,i){i&&(e(i,i.next),i.next=r)}if(!this.first)return;e(this.first,this.first.next),this.first.next=null;const n=this.first;this.first=this.last,this.last=n}reverse(){if(!this.first||!this.first.next)return;let e=this.first.next,n=this.first,r;for(;e;)r=e.next,e.next=n,n.prev=e,n=e,e=r;this.first.next=null,this.last.prev=null,r=this.first,this.first=n,this.last=r}}function fie(t,e){s$(t,e),e.add(t)}function La(t,e,n){s$(t,e),e.set(t,n)}function s$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function tt(t,e){return t.get(Om(t,e))}function wr(t,e,n){return t.set(Om(t,e),n),n}function Om(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var ji=new WeakMap,Ui=new WeakMap,zi=new WeakMap,Yi=new WeakMap,FS=new WeakMap,ng=new WeakMap,rg=new WeakMap,Cb=new WeakSet;class gie{constructor(e){let{mergedCellsGetter:n,rowIndexMapper:r,columnIndexMapper:i}=e;fie(this,Cb),La(this,ji,new tg),La(this,Ui,new tg),La(this,zi,null),La(this,Yi,null),La(this,FS,null),La(this,ng,null),La(this,rg,null),wr(FS,this,n),wr(ng,this,r),wr(rg,this,i)}getCurrentVerticalNode(){return tt(Yi,this).data}getFirstVerticalNode(){return tt(Ui,this).first.data}getNextVerticalNode(){return tt(Yi,this).next.data}getPrevVerticalNode(){return tt(Yi,this).prev.data}getCurrentHorizontalNode(){return tt(zi,this).data}getFirstHorizontalNode(){return tt(ji,this).first.data}getNextHorizontalNode(){return tt(zi,this).next.data}getPrevHorizontalNode(){return tt(zi,this).prev.data}setPrevNodeAsActive(){wr(Yi,this,tt(Yi,this).prev),wr(zi,this,tt(zi,this).prev)}setNextNodeAsActive(){wr(Yi,this,tt(Yi,this).next),wr(zi,this,tt(zi,this).next)}buildFocusOrder(e){const n=e.getTopStartCorner(),r=e.getBottomEndCorner(),i=new WeakSet;wr(ji,this,new tg);for(let s=n.row;s<=r.row;s++)if(!tt(ng,this).isHidden(s))for(let a=n.col;a<=r.col;a++){if(tt(rg,this).isHidden(a))continue;const l=Om(Cb,this,gH).call(this,e,tt(ji,this),i,s,a);l&&wr(zi,this,l)}tt(ji,this).first&&(tt(ji,this).first.prev=tt(ji,this).last,tt(ji,this).last.next=tt(ji,this).first);const o=new WeakSet;wr(Ui,this,new tg);for(let s=n.col;s<=r.col;s++)if(!tt(rg,this).isHidden(s))for(let a=n.row;a<=r.row;a++){if(tt(ng,this).isHidden(a))continue;const l=Om(Cb,this,gH).call(this,e,tt(Ui,this),o,a,s);l&&wr(Yi,this,l)}tt(Ui,this).first&&(tt(Ui,this).first.prev=tt(Ui,this).last,tt(Ui,this).last.next=tt(Ui,this).first)}setActiveNode(e,n){return tt(ji,this).inorder(r=>{const{rowStart:i,rowEnd:o,colStart:s,colEnd:a}=r.data;if(e>=i&&e<=o&&n>=s&&n<=a)return wr(zi,this,r),!1}),tt(Ui,this).inorder(r=>{const{rowStart:i,rowEnd:o,colStart:s,colEnd:a}=r.data;if(e>=i&&e<=o&&n>=s&&n<=a)return wr(Yi,this,r),!1}),this}}function gH(t,e,n,r,i){const o=t.getTopStartCorner(),s=t.getBottomEndCorner(),a=t.highlight.clone().normalize(),l=tt(FS,this).call(this,r,i);if(l&&n.has(l))return null;const u={colStart:i,colEnd:i,rowStart:r,rowEnd:r};if(l){if(n.add(l),l.row<o.row||l.row+l.rowspan-1>s.row||l.col<o.col||l.col+l.colspan-1>s.col)return null;u.colStart=l.col,u.colEnd=l.col+l.colspan-1,u.rowStart=l.row,u.rowEnd=l.row+l.rowspan-1}const c=e.push(u);return r===a.row&&i===a.col||l&&a.row>=l.row&&a.row<=l.row+l.rowspan-1&&a.col>=l.col&&a.col<=l.col+l.colspan-1?c:null}function a$(t,e,n){const{view:r,rowIndexMapper:i}=t,o=r.getStylesHandler(),s=r.getDefaultRowHeight();let a=0;for(let u=e;u<e+n;u++)if(!i.isHidden(u)){var l;a+=(l=t.getRowHeight(u))!==null&&l!==void 0?l:s,u===0&&!o.isClassicTheme()&&(a+=1)}return a}function mie(t){const{hot:e}=t,{rowIndexMapper:n,columnIndexMapper:r}=e,i=new Map;function o(){}function s(a,l,u){const c=t.mergedCellsCollection.get(l,u);if(!Ae(c)){a.removeAttribute("rowspan"),a.removeAttribute("colspan"),Qg()&&i.has(l)&&!e.getSettings().rowHeaders&&(a.style.height=`${i.get(l)}px`,i.delete(l)),a.style.display="";return}const{row:h,col:d,colspan:f,rowspan:g}=c,[C,y]=t.translateMergedCellToRenderable(h,g,d,f),E=t.getSetting("virtualized");if(Qg()&&d===0&&!e.getSettings().rowHeaders){const j=a$(e,h,g);i.set(l,j/g)}const v=n.getRenderableFromVisualIndex(l),P=r.getRenderableFromVisualIndex(u),O=C-v+1,L=y-P+1;let T=n.getNearestNotHiddenIndex(h,1),A=r.getNearestNotHiddenIndex(d,1);if(E){const j=e.view.getActiveOverlayName();["top","top_inline_start_corner"].includes(j)||(T=Math.max(T,e.getFirstRenderedVisibleRow())),["inline_start","top_inline_start_corner","bottom_inline_start_corner"].includes(j)||(A=Math.max(A,e.getFirstRenderedVisibleColumn()))}const q=Math.min(g,O),U=Math.min(f,L);T===l&&A===u?(a.setAttribute("rowspan",q),a.setAttribute("colspan",U)):(a.removeAttribute("rowspan"),a.removeAttribute("colspan"),a.style.display="none")}return{before:o,after:s}}function pie(t,e){l$(t,e),e.add(t)}function ig(t,e,n){l$(t,e),e.set(t,n)}function l$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function yb(t,e,n){return(e=wie(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function wie(t){var e=vie(t,"string");return typeof e=="symbol"?e:e+""}function vie(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function od(t,e,n){return t.set(rt(t,e),n),n}function ht(t,e){return t.get(rt(t,e))}function rt(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}re.getSingleton().register("beforeMergeCells");re.getSingleton().register("afterMergeCells");re.getSingleton().register("beforeUnmergeCells");re.getSingleton().register("afterUnmergeCells");const VS="mergeCells",Cie=150,mH=VS;var zr=new WeakMap,Yr=new WeakMap,so=new WeakMap,pH=new WeakMap,lt=new WeakSet;class yie extends Xe{constructor(){super(...arguments),pie(this,lt),yb(this,"mergedCellsCollection",null),yb(this,"autofillCalculations",null),yb(this,"selectionCalculations",null),ig(this,zr,null),ig(this,Yr,{row:0,col:0}),ig(this,so,new gie({mergedCellsGetter:(e,n)=>this.mergedCellsCollection.get(e,n),rowIndexMapper:this.hot.rowIndexMapper,columnIndexMapper:this.hot.columnIndexMapper})),ig(this,pH,mie(this))}static get PLUGIN_KEY(){return VS}static get PLUGIN_PRIORITY(){return Cie}static get DEFAULT_SETTINGS(){return{[Mk]:"cells",virtualized:!1,cells:[]}}isEnabled(){return!!this.hot.getSettings()[VS]}enablePlugin(){var e=this;this.enabled||(this.mergedCellsCollection=new Pm(this),this.autofillCalculations=new sie(this),this.selectionCalculations=new uie(this),this.addHook("afterInit",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rt(lt,e,bie).call(e,...r)}),this.addHook("modifyTransformFocus",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rt(lt,e,Rie).call(e,...r)}),this.addHook("modifyTransformStart",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rt(lt,e,Eie).call(e,...r)}),this.addHook("modifyTransformEnd",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rt(lt,e,Tie).call(e,...r)}),this.addHook("beforeSelectionHighlightSet",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rt(lt,e,_ie).call(e,...r)}),this.addHook("beforeSetRangeStart",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rt(lt,e,vH).call(e,...r)}),this.addHook("beforeSetRangeStartOnly",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rt(lt,e,vH).call(e,...r)}),this.addHook("beforeSelectionFocusSet",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rt(lt,e,Iie).call(e,...r)}),this.addHook("afterSelectionFocusSet",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rt(lt,e,Pie).call(e,...r)}),this.addHook("afterSelectionEnd",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rt(lt,e,Oie).call(e,...r)}),this.addHook("modifyGetCellCoords",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rt(lt,e,wH).call(e,...r)}),this.addHook("modifyGetCoordsElement",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rt(lt,e,wH).call(e,...r)}),this.addHook("afterIsMultipleSelection",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rt(lt,e,Sie).call(e,...r)}),this.addHook("afterRenderer",function(){return ht(pH,e).after(...arguments)}),this.addHook("afterContextMenuDefaultOptions",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rt(lt,e,Mie).call(e,...r)}),this.addHook("afterGetCellMeta",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rt(lt,e,xie).call(e,...r)}),this.addHook("afterViewportRowCalculatorOverride",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rt(lt,e,Aie).call(e,...r)}),this.addHook("afterViewportColumnCalculatorOverride",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rt(lt,e,Hie).call(e,...r)}),this.addHook("modifyAutofillRange",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rt(lt,e,Nie).call(e,...r)}),this.addHook("afterCreateCol",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rt(lt,e,Die).call(e,...r)}),this.addHook("afterRemoveCol",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rt(lt,e,kie).call(e,...r)}),this.addHook("afterCreateRow",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rt(lt,e,Lie).call(e,...r)}),this.addHook("afterRemoveRow",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rt(lt,e,$ie).call(e,...r)}),this.addHook("afterChange",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rt(lt,e,Fie).call(e,...r)}),this.addHook("beforeDrawBorders",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rt(lt,e,Vie).call(e,...r)}),this.addHook("afterDrawSelection",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rt(lt,e,Wie).call(e,...r)}),this.addHook("beforeRemoveCellClassNames",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rt(lt,e,Bie).call(e,...r)}),this.addHook("beforeBeginEditing",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rt(lt,e,jie).call(e,...r)}),this.addHook("modifyRowHeightByOverlayName",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rt(lt,e,Uie).call(e,...r)}),this.addHook("beforeUndoStackChange",(n,r)=>{if(r==="MergeCells")return!1}),this.registerShortcuts(),super.enablePlugin())}disablePlugin(){this.clearCollections(),this.unregisterShortcuts(),this.hot.render(),super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.generateFromSettings(),super.updatePlugin()}ifChromeForceRepaint(){if(!FN())return;const e=[];let n=[];this.mergedCellsCollection.mergedCells.forEach(r=>{const{row:i,rowspan:o}=r;for(let s=i+1;s<i+o;s++)n.push(s)}),n=[...new Set(n)],n.forEach(r=>{const i=this.hot.rowIndexMapper.getRenderableFromVisualIndex(r);this.hot.view._wt.wtOverlays.getOverlays(!0).map(o=>(o==null?void 0:o.name)==="master"?o:o.clone.wtTable).forEach(o=>{const s=o.getRow(i);s&&(s.style.background=Kg(s,"backgroundColor").replace(")",", 0.99)"),e.push(s))})}),this.hot._registerTimeout(()=>{e.forEach(r=>{var i;r.style.background=(i=Kg(r,"backgroundColor"))===null||i===void 0?void 0:i.replace(", 0.99)",")")})},1)}validateSetting(e){return e?eo.containsNegativeValues(e)?(Ze(eo.NEGATIVE_VALUES_WARNING(e)),!1):eo.isOutOfBounds(e,this.hot.countRows(),this.hot.countCols())?(Ze(eo.IS_OUT_OF_BOUNDS_WARNING(e)),!1):eo.isSingleCell(e)?(Ze(eo.IS_SINGLE_CELL(e)),!1):eo.containsZeroSpan(e)?(Ze(eo.ZERO_SPAN_WARNING(e)),!1):!0:!1}generateFromSettings(){const e=this.getSetting("cells").filter(i=>this.validateSetting(i)),n=this.mergedCellsCollection.filterOverlappingMergeCells(e),r=[];n.forEach(i=>{const{row:o,col:s,rowspan:a,colspan:l}=i,u=this.hot._createCellCoords(o,s),c=this.hot._createCellCoords(o+a-1,s+l-1),h=this.hot._createCellRange(u,u,c);this.mergeRange(h,!0,!0);for(let d=o;d<o+a;d++)for(let f=s;f<s+l;f++)(d!==o||f!==s)&&r.push([d,f,null])}),r.length!==0&&this.hot.setDataAtCell(r,void 0,void 0,this.pluginName)}clearCollections(){this.mergedCellsCollection.clear()}canMergeRange(e){return(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1)?!0:this.validateSetting(e)}mergeSelection(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.hot.getSelectedRangeLast();if(!e)return;e.setDirection(this.hot.isRtl()?"NE-SW":"NW-SE");const{from:n,to:r}=e;this.unmergeRange(e,!0),this.mergeRange(e),this.hot.selectCell(n.row,n.col,r.row,r.col,!1)}unmergeSelection(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.hot.getSelectedRangeLast();if(!e)return;const{from:n,to:r}=e;this.unmergeRange(e,!0),this.hot.selectCell(n.row,n.col,r.row,r.col,!1)}mergeRange(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=e.getTopStartCorner(),o=e.getBottomEndCorner(),s={row:i.row,col:i.col,rowspan:o.row-i.row+1,colspan:o.col-i.col+1},a=[];let l=null;return this.canMergeRange(s,n)?(this.hot.runHooks("beforeMergeCells",e,n),de(0,s.rowspan-1,c=>{de(0,s.colspan-1,h=>{let d=null;a[c]||(a[c]=[]),c===0&&h===0?d=this.hot.getSourceDataAtCell(this.hot.toPhysicalRow(s.row),this.hot.toPhysicalColumn(s.col)):this.hot.setCellMeta(s.row+c,s.col+h,"hidden",!0),a[c][h]=d})}),this.hot.setCellMeta(s.row,s.col,"spanned",!0),this.mergedCellsCollection.add(s,n)?(r?l=[s.row,s.col,a]:this.hot.populateFromArray(s.row,s.col,a,void 0,void 0,this.pluginName),n||this.ifChromeForceRepaint(),this.hot.runHooks("afterMergeCells",e,s,n),l):!0):!1}unmergeRange(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const r=this.mergedCellsCollection.getWithinRange(e);r.length!==0&&(this.hot.runHooks("beforeUnmergeCells",e,n),M(r,i=>{this.mergedCellsCollection.remove(i.row,i.col),de(0,i.rowspan-1,o=>{de(0,i.colspan-1,s=>{this.hot.removeCellMeta(i.row+o,i.col+s,"hidden"),this.hot.removeCellMeta(i.row+o,i.col+s,"copyable")})}),this.hot.removeCellMeta(i.row,i.col,"spanned")}),this.hot.runHooks("afterUnmergeCells",e,n),this.hot.render())}toggleMerge(e){const{from:n,to:r}=e.clone().normalize(),i=this.mergedCellsCollection.get(n.row,n.col);i.row===n.row&&i.col===n.col&&i.row+i.rowspan-1===r.row&&i.col+i.colspan-1===r.col?this.unmergeRange(e):this.mergeSelection(e)}merge(e,n,r,i){const o=this.hot._createCellCoords(e,n),s=this.hot._createCellCoords(r,i);this.mergeRange(this.hot._createCellRange(o,o,s))}unmerge(e,n,r,i){const o=this.hot._createCellCoords(e,n),s=this.hot._createCellCoords(r,i);this.unmergeRange(this.hot._createCellRange(o,o,s))}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Control","m"]],callback:()=>{const r=this.hot.getSelectedRangeLast();r&&!r.isSingleHeader()&&(this.toggleMerge(r),this.hot.render())},runOnlyIf:r=>!r.altKey,group:mH})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(mH)}modifyViewportRowStart(e,n){const r=this.hot.rowIndexMapper,i=r.getVisualFromRenderableIndex(e.startRow);for(let o=0;o<n;o+=1){const s=this.mergedCellsCollection.get(i,o);if(Ae(s)){const a=r.getRenderableFromVisualIndex(r.getNearestNotHiddenIndex(s.row,1));if(a<e.startRow){e.startRow=a,this.modifyViewportRowStart(e,n);return}}}}modifyViewportRowEnd(e,n){const r=this.hot.rowIndexMapper,i=r.getVisualFromRenderableIndex(e.endRow);for(let o=0;o<n;o+=1){const s=this.mergedCellsCollection.get(i,o);if(Ae(s)){const a=s.row+s.rowspan-1,l=r.getRenderableFromVisualIndex(r.getNearestNotHiddenIndex(a,-1));if(l>e.endRow){e.endRow=l,this.modifyViewportRowEnd(e,n);return}}}}modifyViewportColumnStart(e,n){const r=this.hot.columnIndexMapper,i=r.getVisualFromRenderableIndex(e.startColumn);for(let o=0;o<n;o+=1){const s=this.mergedCellsCollection.get(o,i);if(Ae(s)){const a=r.getRenderableFromVisualIndex(r.getNearestNotHiddenIndex(s.col,1));if(a<e.startColumn){e.startColumn=a,this.modifyViewportColumnStart(e,n);return}}}}modifyViewportColumnEnd(e,n){const r=this.hot.columnIndexMapper,i=r.getVisualFromRenderableIndex(e.endColumn);for(let o=0;o<n;o+=1){const s=this.mergedCellsCollection.get(o,i);if(Ae(s)){const a=s.col+s.colspan-1,l=r.getRenderableFromVisualIndex(r.getNearestNotHiddenIndex(a,-1));if(l>e.endColumn){e.endColumn=l,this.modifyViewportColumnEnd(e,n);return}}}}translateMergedCellToRenderable(e,n,r,i){const{rowIndexMapper:o,columnIndexMapper:s}=this.hot;let a,l;n===0?a=o.getNearestNotHiddenIndex(e,1):a=o.getNearestNotHiddenIndex(e+n-1,-1),i===0?l=s.getNearestNotHiddenIndex(r,1):l=s.getNearestNotHiddenIndex(r+i-1,-1);const u=e>=0?o.getRenderableFromVisualIndex(a):e,c=r>=0?s.getRenderableFromVisualIndex(l):r;return[u,c]}}function bie(){this.generateFromSettings(),this.hot.render()}function Sie(t){if(t){const e=this.mergedCellsCollection.mergedCells,n=this.hot.getSelectedRangeLast(),r=n.getTopStartCorner(),i=n.getBottomEndCorner();for(let o=0;o<e.length;o+=1)if(r.row===e[o].row&&r.col===e[o].col&&i.row===e[o].row+e[o].rowspan-1&&i.col===e[o].col+e[o].colspan-1)return!1}return t}function Rie(t){ht(Yr,this).row=t.row,ht(Yr,this).col=t.col}function Eie(t){const e=this.hot.getSelectedRangeLast(),{highlight:n}=e,{columnIndexMapper:r,rowIndexMapper:i}=this.hot;ht(zr,this)&&(i.getRenderableFromVisualIndex(ht(zr,this).row)!==null&&(n.row=ht(zr,this).row),r.getRenderableFromVisualIndex(ht(zr,this).col)!==null&&(n.col=ht(zr,this).col),od(zr,this,null));const o=this.mergedCellsCollection.get(n.row,n.col);if(!o)return;const s=o.col,a=o.col+o.colspan-1;if(t.col<0){const c=n.col>=s&&n.col<=a?s-1:a,h=r.getNearestNotHiddenIndex(c,-1);h===null?t.col=-this.hot.view.countRenderableColumnsInRange(0,n.col):t.col=-Math.max(this.hot.view.countRenderableColumnsInRange(h,n.col)-1,1)}else if(t.col>0){const c=n.col>=s&&n.col<=a?a+1:s,h=r.getNearestNotHiddenIndex(c,1);h===null?t.col=this.hot.view.countRenderableColumnsInRange(n.col,this.hot.countCols()):t.col=Math.max(this.hot.view.countRenderableColumnsInRange(n.col,h)-1,1)}const l=o.row,u=o.row+o.rowspan-1;if(t.row<0){const c=n.row>=l&&n.row<=u?l-1:u,h=i.getNearestNotHiddenIndex(c,-1);h===null?t.row=-this.hot.view.countRenderableRowsInRange(0,n.row):t.row=-Math.max(this.hot.view.countRenderableRowsInRange(h,n.row)-1,1)}else if(t.row>0){const c=n.row>=l&&n.row<=u?u+1:l,h=i.getNearestNotHiddenIndex(c,1);h===null?t.row=this.hot.view.countRenderableRowsInRange(n.row,this.hot.countRows()):t.row=Math.max(this.hot.view.countRenderableRowsInRange(n.row,h)-1,1)}}function Tie(t){const e=this.hot.getSelectedRangeLast(),n=e.clone(),{to:r}=e,{columnIndexMapper:i,rowIndexMapper:o}=this.hot,s=(a,l)=>{n.expand(this.hot._createCellCoords(a,l));for(let u=0;u<this.mergedCellsCollection.mergedCells.length;u+=1)n.expandByRange(this.mergedCellsCollection.mergedCells[u].getRange())};if(t.col<0){let a=this.mergedCellsCollection.getStartMostColumnIndex(e,r.col)+t.col;s(r.row,a),e.getHorizontalDirection()==="E-W"&&n.getHorizontalDirection()==="E-W"&&(a=n.getTopStartCorner().col);const l=i.getNearestNotHiddenIndex(a,1);l!==null&&(t.col=-Math.max(this.hot.view.countRenderableColumnsInRange(l,r.col)-1,1))}else if(t.col>0){let a=this.mergedCellsCollection.getEndMostColumnIndex(e,r.col)+t.col;s(r.row,a),e.getHorizontalDirection()==="W-E"&&n.getHorizontalDirection()==="W-E"&&(a=n.getBottomEndCorner().col);const l=i.getNearestNotHiddenIndex(a,-1);l!==null&&(t.col=Math.max(this.hot.view.countRenderableColumnsInRange(r.col,l)-1,1))}if(t.row<0){let a=this.mergedCellsCollection.getTopMostRowIndex(e,r.row)+t.row;s(a,r.col),e.getVerticalDirection()==="S-N"&&n.getVerticalDirection()==="S-N"&&(a=n.getTopStartCorner().row);const l=o.getNearestNotHiddenIndex(a,1);l!==null&&(t.row=-Math.max(this.hot.view.countRenderableRowsInRange(l,r.row)-1,1))}else if(t.row>0){let a=this.mergedCellsCollection.getBottomMostRowIndex(e,r.row)+t.row;s(a,r.col),e.getVerticalDirection()==="N-S"&&n.getVerticalDirection()==="N-S"&&(a=n.getBottomStartCorner().row);const l=o.getNearestNotHiddenIndex(a,-1);l!==null&&(t.row=Math.max(this.hot.view.countRenderableRowsInRange(r.row,l)-1,1))}}function _ie(){const t=this.hot.getSelectedRangeLast(),{highlight:e}=t;if(this.hot.selection.isSelectedByColumnHeader()||this.hot.selection.isSelectedByRowHeader()){od(zr,this,e.clone());return}for(let r=0;r<this.mergedCellsCollection.mergedCells.length;r+=1)t.expandByRange(this.mergedCellsCollection.mergedCells[r].getRange(),!1);for(let r=0;r<this.mergedCellsCollection.mergedCells.length;r+=1)t.expandByRange(this.mergedCellsCollection.mergedCells[r].getRange(),!1);const n=this.mergedCellsCollection.get(e.row,e.col);od(zr,this,e.clone()),n&&e.assign(n)}function wH(t,e,n,r){if(t<0||e<0)return;const i=this.mergedCellsCollection.get(t,e);if(!i)return;const{row:o,col:s,colspan:a,rowspan:l}=i,u=o,c=s,h=o+l-1,d=s+a-1;if(r==="render"&&this.getSetting("virtualized")){const f=this.hot.view.getActiveOverlayName(),g=["top","top_inline_start_corner"].includes(f)?0:this.hot.getFirstRenderedVisibleRow(),C=["inline_start","top_inline_start_corner","bottom_inline_start_corner"].includes(f)?0:this.hot.getFirstRenderedVisibleColumn();return[Ue(g,u,h),Ue(C,c,d),Ue(this.hot.getLastRenderedVisibleRow(),u,h),Ue(this.hot.getLastRenderedVisibleColumn(),c,d)]}return[u,c,h,d]}function Mie(t){t.items.push({name:"---------"},cie(this))}function vH(){od(zr,this,null)}function Iie(){if(ht(zr,this).isCell())return;const t=this.hot.getSelectedRangeLast(),e=t.getVerticalDirection(),n=t.getHorizontalDirection(),r=ht(zr,this).clone().normalize();ht(so,this).setActiveNode(r.row,r.col),ht(Yr,this).row>0||ht(Yr,this).col>0?ht(so,this).setPrevNodeAsActive():(n==="E-W"&&ht(Yr,this).col<0||e==="S-N"&&ht(Yr,this).row<0)&&ht(so,this).setNextNodeAsActive()}function Pie(t,e){const n=this.hot.getSelectedRangeLast(),{columnIndexMapper:r,rowIndexMapper:i}=this.hot;let o=null,s=null;if(ht(Yr,this).col<0){const{rowEnd:a,colEnd:l}=ht(so,this).getPrevHorizontalNode();s=r.getNearestNotHiddenIndex(l,-1),o=i.getNearestNotHiddenIndex(a,-1)}else if(ht(Yr,this).col>0){const{rowStart:a,colStart:l}=ht(so,this).getNextHorizontalNode();s=r.getNearestNotHiddenIndex(l,1),o=i.getNearestNotHiddenIndex(a,1)}else if(ht(Yr,this).row<0){const{rowEnd:a,colEnd:l}=ht(so,this).getPrevVerticalNode();s=r.getNearestNotHiddenIndex(l,-1),o=i.getNearestNotHiddenIndex(a,-1)}else if(ht(Yr,this).row>0){const{rowStart:a,colStart:l}=ht(so,this).getNextVerticalNode();s=r.getNearestNotHiddenIndex(l,1),o=i.getNearestNotHiddenIndex(a,1)}if(o!==null||s!==null){const a=this.hot._createCellCoords(o,s),l=this.mergedCellsCollection.get(a.row,a.col),u=this.hot.selection.highlight.getFocus();t=a.row,e=a.col,l?n.highlight.assign({row:this.hot.rowIndexMapper.getNearestNotHiddenIndex(l.row,1),col:this.hot.columnIndexMapper.getNearestNotHiddenIndex(l.col,1)}):n.highlight.assign(a),u.clear(),u.add(a).commit()}ht(so,this).setActiveNode(t,e),od(Yr,this,{row:0,col:0})}function Oie(){this.hot.getSelectedRangeLast().isHeader()||ht(so,this).buildFocusOrder(this.hot.getSelectedRangeLast())}function xie(t,e,n){const r=this.mergedCellsCollection.get(t,e);r&&(r.row!==t||r.col!==e?n.copyable=!1:(n.rowspan=r.rowspan,n.colspan=r.colspan))}function Aie(t){if(this.getSetting("virtualized"))return;const e=this.hot.countCols();this.modifyViewportRowStart(t,e),this.modifyViewportRowEnd(t,e)}function Hie(t){if(this.getSetting("virtualized"))return;const e=this.hot.countRows();this.modifyViewportColumnStart(t,e),this.modifyViewportColumnEnd(t,e)}function Nie(t,e){const n=this.autofillCalculations.getDirection(e,t);if(this.autofillCalculations.dragAreaOverlapsCollections(e,t,n))return e;const r=this.hot._createCellCoords(e[0],e[1]),i=this.hot._createCellCoords(e[2],e[3]),o=this.hot._createCellRange(r,r,i),s=this.mergedCellsCollection.getWithinRange(o);return s.length===0?t:this.autofillCalculations.snapDragArea(e,t,n,s)}function Die(t,e){this.mergedCellsCollection.shiftCollections("right",t,e)}function kie(t,e){this.mergedCellsCollection.shiftCollections("left",t,e)}function Lie(t,e,n){n!=="auto"&&this.mergedCellsCollection.shiftCollections("down",t,e)}function $ie(t,e){this.mergedCellsCollection.shiftCollections("up",t,e)}function Fie(t,e){e==="Autofill.fill"&&this.autofillCalculations.recreateAfterDataPopulation(t)}function Vie(t,e){if(e&&e==="area"){const n=this.hot.getSelectedRangeLast(),r=this.mergedCellsCollection.getWithinRange(n);M(r,i=>{n.getBottomEndCorner().row===i.getLastRow()&&n.getBottomEndCorner().col===i.getLastColumn()&&(t[2]=i.row,t[3]=i.col)})}}function Wie(t,e,n,r){if(n)return this.selectionCalculations.getSelectedMergedCellClassName(t,e,n,r)}function Bie(){return this.selectionCalculations.getSelectedMergedCellClassNameToRemove()}function jie(t,e,n,r){if(!(r instanceof MouseEvent))return;const i=this.hot.getSelectedRangeLast(),o=this.mergedCellsCollection.getByRange(i);if(!o)return;const s=this.hot._createCellCoords(o.row,o.col),a=this.hot._createCellCoords(o.row+o.rowspan-1,o.col+o.colspan-1);return this.hot.selection.getLayerLevel()===0&&i.isEqual(this.hot._createCellRange(s,s,a))}function Uie(t,e,n){if(this.hot.getSettings().rowHeaders||n==="bottom"||n==="bottom_inline_start_corner")return t;let r,i;if(n==="master")r=this.hot.getFirstRenderedVisibleColumn(),i=this.hot.getLastRenderedVisibleColumn();else{const d=this.hot.view.getOverlayByName(n);r=this.hot.columnIndexMapper.getVisualFromRenderableIndex(d.clone.wtTable.getFirstRenderedColumn()),i=this.hot.columnIndexMapper.getVisualFromRenderableIndex(d.clone.wtTable.getLastRenderedColumn())}if(!this.mergedCellsCollection.get(e,r))return t;const s=this.hot._createCellCoords(e,r),a=this.hot._createCellCoords(e,i),l=this.hot._createCellRange(s,s,a),u=this.mergedCellsCollection.getWithinRange(l,!0),c=u.reduce((d,f)=>{let{rowspan:g}=f;return Math.max(d,g)},1);let h=0;return u.length>1&&u[0].rowspan<c&&(h=c-u[0].rowspan),u.forEach(d=>{let{rowspan:f}=d,g=0;n==="top"||n==="top_inline_start_corner"?g=Math.min(c,this.hot.view.countNotHiddenFixedRowsTop()-e):g=f-h,t=Math.max(t??0,a$(this.hot,e,g))}),t}function zie(t,e){return function(n,r){const[,...i]=n,[,...o]=r;return function s(a){const l=t[a],u=e[a],c=i[a],h=o[a],d=u.multiColumnSorting,g=(d.compareFunctionFactory?d.compareFunctionFactory:$k(u.type))(l,u,d)(c,h);if(g===ao){const C=a+1;if(typeof e[C]<"u")return s(C)}return g}(0)}}const u$="sort";function Yie(t,e,n){const r=[];return n===!1||t.isColumnSorted(e)&&t.getNumberOfSortedColumns()>1&&r.push(`${u$}-${t.getIndexOfColumnInSortQueue(e)+1}`),r}function Gie(t){const e=t.className.split(" "),n=new RegExp(`^${u$}-[0-9]{1,2}$`);return e.filter(r=>n.test(r))}function qie(t,e,n){return(e=Kie(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Kie(t){var e=Xie(t,"string");return typeof e=="symbol"?e:e+""}function Xie(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const xm="multiColumnSorting",Zie=170,CH=xm;Lk(xm,zie);class Qie extends Gk{constructor(){super(...arguments),qie(this,"pluginKey",xm)}static get PLUGIN_KEY(){return xm}static get PLUGIN_PRIORITY(){return Zie}isEnabled(){return!!this.hot.getSettings()[this.pluginKey]}enablePlugin(){super.enablePlugin()}disablePlugin(){super.disablePlugin()}registerShortcuts(){super.registerShortcuts(),this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Shift","Enter"]],callback:()=>{const{highlight:e}=this.hot.getSelectedRangeLast();return e.row===-1&&e.col>=0&&this.sort(this.getNextSortConfig(e.col,dm)),!1},runOnlyIf:()=>{var e,n;const r=(e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;return r&&((n=this.hot.getSelectedRangeLast())===null||n===void 0?void 0:n.isSingle())&&this.hot.selection.isCellVisible(r)&&r.isHeader()},relativeToGroup:Qs,position:"before",group:CH})}unregisterShortcuts(){super.unregisterShortcuts(),this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(CH)}sort(e){super.sort(e)}clearSort(){super.clearSort()}isSorted(){return super.isSorted()}getSortConfig(e){return super.getSortConfig(e)}setSortConfig(e){super.setSortConfig(e)}getNormalizedSortConfigs(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return Array.isArray(e)?e:[e]}updateHeaderClasses(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];super.updateHeaderClasses(e,...r),pe(e,Gie(e)),this.enabled!==!1&&G(e,Yie(...r))}onAfterOnCellMouseDown(e,n){J0(n.row,n.col,e)!==!1&&this.wasClickableHeaderClicked(e,n.col)&&(this.hot.getShortcutManager().isCtrlPressed()?(this.hot.deselectCell(),this.hot.selectColumns(n.col),this.sort(this.getNextSortConfig(n.col,dm))):this.sort(this.getColumnNextConfig(n.col)))}}function yH(t,e,n){return(e=Jie(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Jie(t){var e=eoe(t,"string");return typeof e=="symbol"?e:e+""}function eoe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const toe="multipleSelectionHandles",noe=160;class roe extends Xe{constructor(){super(...arguments),yH(this,"dragged",[]),yH(this,"lastSetCell",null)}static get PLUGIN_KEY(){return toe}static get PLUGIN_PRIORITY(){return noe}isEnabled(){return zo()}enablePlugin(){this.enabled||(this.registerListeners(),super.enablePlugin())}registerListeners(){const e=this,{rootElement:n}=this.hot;function r(i){if(e.dragged.length===1)return e.dragged.splice(0,e.dragged.length),!0;const o=e.dragged.indexOf(i);if(o===-1)return!1;o===0?e.dragged=e.dragged.slice(0,1):o===1&&(e.dragged=e.dragged.slice(-1))}this.eventManager.addEventListener(n,"touchstart",i=>{let o;if(ve(i.target,"topSelectionHandle-HitArea"))return o=e.hot.getSelectedRangeLast(),e.dragged.push("top"),e.touchStartRange={width:o.getWidth(),height:o.getHeight(),direction:o.getDirection()},i.preventDefault(),!1;if(ve(i.target,"bottomSelectionHandle-HitArea"))return o=e.hot.getSelectedRangeLast(),e.dragged.push("bottom"),e.touchStartRange={width:o.getWidth(),height:o.getHeight(),direction:o.getDirection()},i.preventDefault(),!1}),this.eventManager.addEventListener(n,"touchend",i=>{if(ve(i.target,"topSelectionHandle-HitArea"))return r.call(e,"top"),e.touchStartRange=void 0,i.preventDefault(),!1;if(ve(i.target,"bottomSelectionHandle-HitArea"))return r.call(e,"bottom"),e.touchStartRange=void 0,i.preventDefault(),!1}),this.eventManager.addEventListener(n,"touchmove",i=>{const{rootDocument:o}=this.hot;let s,a,l,u,c,h;if(e.dragged.length===0)return;const d=o.elementFromPoint(i.touches[0].clientX,i.touches[0].clientY);!d||d===e.lastSetCell||((d.nodeName==="TD"||d.nodeName==="TH")&&(s=e.hot.getCoords(d),s.col===-1&&(s.col=0),a=e.hot.getSelectedRangeLast(),l=a.getWidth(),u=a.getHeight(),c=a.getDirection(),l===1&&u===1&&e.hot.selection.setRangeEnd(s),h=e.getCurrentRangeCoords(a,s,e.touchStartRange.direction,c,e.dragged[0]),h.start!==null&&e.hot.selection.setRangeStart(h.start),e.hot.selection.setRangeEnd(h.end),e.lastSetCell=d),i.preventDefault())})}getCurrentRangeCoords(e,n,r,i,o){const s=e.getTopStartCorner(),a=e.getBottomEndCorner(),l=e.getBottomStartCorner(),u=e.getTopEndCorner();let c={start:null,end:null};switch(r){case"NE-SW":switch(i){case"NE-SW":case"NW-SE":o==="top"?c={start:this.hot._createCellCoords(n.row,e.highlight.col),end:this.hot._createCellCoords(l.row,n.col)}:c={start:this.hot._createCellCoords(e.highlight.row,n.col),end:this.hot._createCellCoords(n.row,s.col)};break;case"SE-NW":o==="bottom"&&(c={start:this.hot._createCellCoords(a.row,n.col),end:this.hot._createCellCoords(n.row,s.col)});break}break;case"NW-SE":switch(i){case"NE-SW":o==="top"?c={start:n,end:l}:c.end=n;break;case"NW-SE":o==="top"?c={start:n,end:a}:c.end=n;break;case"SE-NW":o==="top"?c={start:n,end:s}:c.end=n;break;case"SW-NE":o==="top"?c={start:n,end:u}:c.end=n;break}break;case"SW-NE":switch(i){case"NW-SE":o==="bottom"?c={start:this.hot._createCellCoords(n.row,s.col),end:this.hot._createCellCoords(l.row,n.col)}:c={start:this.hot._createCellCoords(s.row,n.col),end:this.hot._createCellCoords(n.row,a.col)};break;case"SW-NE":o==="top"?c={start:this.hot._createCellCoords(e.highlight.row,n.col),end:this.hot._createCellCoords(n.row,a.col)}:c={start:this.hot._createCellCoords(n.row,s.col),end:this.hot._createCellCoords(s.row,n.col)};break;case"SE-NW":o==="bottom"?c={start:this.hot._createCellCoords(n.row,u.col),end:this.hot._createCellCoords(s.row,n.col)}:o==="top"&&(c={start:l,end:n});break}break;case"SE-NW":switch(i){case"NW-SE":case"NE-SW":case"SW-NE":o==="top"&&(c.end=n);break;case"SE-NW":o==="top"?c.end=n:c={start:n,end:s};break}break}return c}isDragged(){return this.dragged.length>0}}function WS(){let{label:t="",colspan:e=1,origColspan:n=1,collapsible:r=!1,crossHiddenColumns:i=[],isCollapsed:o=!1,isHidden:s=!1,isRoot:a=!1,isPlaceholder:l=!1,headerClassNames:u=[]}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{label:t,colspan:e,origColspan:n,collapsible:r,isCollapsed:o,crossHiddenColumns:i,isHidden:s,isRoot:a,isPlaceholder:l,headerClassNames:u}}function c$(){return{label:"",isPlaceholder:!0}}function ioe(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1/0;const n=[];if(e===0)return n;M(t,i=>{const o=[];let s=0;n.push(o),M(i,a=>{const l=WS();if(Ae(a)){const{label:c,colspan:h,headerClassName:d}=a;l.label=Pt(c),typeof h=="number"&&h>1&&(l.colspan=h,l.origColspan=h),typeof d=="string"&&(l.headerClassNames=[...d.split(" ")])}else l.label=Pt(a);s+=l.origColspan;let u=!1;if(s>=e&&(l.colspan=l.origColspan-(s-e),l.origColspan=l.colspan,u=!0),o.push(l),l.colspan>1)for(let c=0;c<l.colspan-1;c++)o.push(c$());return!u})});const r=Math.max(...Be(n,i=>i.length));return M(n,i=>{if(i.length<r){const o=Be(new Array(r-i.length),()=>WS());i.splice(i.length,0,...o)}}),n}function bb(t,e,n){ooe(t,e),e.set(t,n)}function ooe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function li(t,e){return t.get(h$(t,e))}function eh(t,e,n){return t.set(h$(t,e),n),n}function h$(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const bH=["label","collapsible"];var Oo=new WeakMap,$a=new WeakMap,Sb=new WeakMap;class soe{constructor(){bb(this,Oo,[]),bb(this,$a,0),bb(this,Sb,1/0)}setColumnsLimit(e){eh(Sb,this,e)}setData(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];eh(Oo,this,ioe(e,li(Sb,this))),eh($a,this,li(Oo,this).length)}getData(){return li(Oo,this)}mergeWith(e){M(e,n=>{let{row:r,col:i,...o}=n;const s=this.getHeaderSettings(r,i);s!==null&&rn(s,o,bH)})}map(e){M(li(Oo,this),n=>{M(n,r=>{const i=e({...r});Ae(i)&&rn(r,i,bH)})})}getHeaderSettings(e,n){var r;if(e>=li($a,this)||e<0)return null;const i=li(Oo,this)[e];return Array.isArray(i)===!1||n>=i.length?null:(r=i[n])!==null&&r!==void 0?r:null}getHeadersSettings(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;const i=[];if(e>=li($a,this)||e<0)return i;const o=li(Oo,this)[e];let s=0;for(let a=n;a<o.length;a++){const l=o[a];if(l.isPlaceholder)throw new Error("The first column settings cannot overlap the other header layers");if(s+=l.colspan,i.push(l),l.colspan>1&&(a+=l.colspan-1),s===r)break;if(s>r)throw new Error("The last column settings cannot overlap the other header layers")}return i}getLayersCount(){return li($a,this)}getColumnsCount(){return li($a,this)>0?li(Oo,this)[0].length:0}clear(){eh(Oo,this,[]),eh($a,this,0)}}function Rb(t,e,n){return(e=aoe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function aoe(t){var e=loe(t,"string");return typeof e=="symbol"?e:e+""}function loe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const d$="DF-pre-order";function f$(t,e){let n=t.call(e,this);for(let r=0;r<this.childs.length;r++){if(n===!1)return!1;n=f$.call(this.childs[r],t,e)}return n}const uoe="DF-post-order";function g$(t,e){for(let n=0;n<this.childs.length;n++)if(g$.call(this.childs[n],t,e)===!1)return!1;return t.call(e,this)}const m$="BF";function coe(t,e){const n=[this];function r(){if(n.length===0)return;const i=n.shift();n.push(...i.childs),t.call(e,i)!==!1&&r()}r()}const hoe=m$,SH=new Map([[d$,f$],[uoe,g$],[m$,coe]]);class Am{constructor(e){Rb(this,"data",{}),Rb(this,"parent",null),Rb(this,"childs",[]),this.data=e}addChild(e){e.parent=this,this.childs.push(e)}cloneTree(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this;const n=new Am({...e.data});for(let r=0;r<e.childs.length;r++)n.addChild(this.cloneTree(e.childs[r]));return n}replaceTreeWith(e){this.data={...e.data},this.childs=[];for(let n=0;n<e.childs.length;n++)this.addChild(e.childs[n])}walkDown(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:hoe;if(!SH.has(n))throw new Error(`Traversal strategy "${n}" does not exist`);SH.get(n).call(this,e,this)}walkUp(e){const n=this,r=i=>{e.call(n,i)!==!1&&i.parent!==null&&r(i.parent)};r(this)}}function Eb(t,e,n){doe(t,e),e.set(t,n)}function doe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function $n(t,e){return t.get(p$(t,e))}function foe(t,e,n){return t.set(p$(t,e),n),n}function p$(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var ru=new WeakMap,Fa=new WeakMap,iu=new WeakMap;class goe{constructor(e){Eb(this,ru,new Map),Eb(this,Fa,new Map),Eb(this,iu,null),foe(iu,this,e)}getRoots(){return Array.from($n(ru,this).values())}getRootByColumn(e){let n;return $n(Fa,this).has(e)&&(n=$n(ru,this).get($n(Fa,this).get(e))),n}getNode(e,n){const r=this.getRootByColumn(n);if(!r)return;const i=n-$n(Fa,this).get(n);let o=0,s;return r.walkDown(a=>{const{data:{origColspan:l,headerLevel:u}}=a;if(e===u){if(i>=o&&i<=o+l-1)return s=a,s.data.isRoot=n===s.data.columnIndex,!1;o+=l}}),s}rebuildTreeIndex(){let e=0;$n(Fa,this).clear(),M($n(ru,this),n=>{let[,{data:{colspan:r}}]=n;for(let i=e;i<e+r;i++)$n(Fa,this).set(i,e);e+=r})}buildTree(){this.clear();const e=$n(iu,this).getColumnsCount();let n=0;for(;n<e;){const r=$n(iu,this).getHeaderSettings(0,n),i=new Am;$n(ru,this).set(n,i),this.buildLeaves(i,n,0,r.origColspan),n+=r.origColspan}this.rebuildTreeIndex()}buildLeaves(e,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;const o=$n(iu,this).getHeadersSettings(r,n,i);r+=1,M(o,s=>{const a={...s,headerLevel:r-1,columnIndex:n};let l;r===1?(e.data=a,l=e):(l=new Am(a),e.addChild(l)),r<$n(iu,this).getLayersCount()&&this.buildLeaves(l,n,r,s.origColspan),n+=s.origColspan})}clear(){$n(ru,this).clear(),$n(Fa,this).clear()}}function w$(t,e){t.walkDown(n=>{let{data:r,childs:i}=n;if(!r.isHidden&&(e(r.columnIndex),i.length===0))for(let o=1;o<r.colspan;o++)e(r.columnIndex+o)})}function Hm(t,e){let{childs:n}=t;if(n.length!==0)return n[0].data[e]}function Nm(t){return Hm(t,"origColspan")===t.data.origColspan}function gT(t){const{data:e,childs:n}=t;if(!e.isCollapsed||e.isHidden||e.origColspan<=1)return{rollbackModification:()=>{},affectedColumns:[],colspanCompensation:0};if(Nm(t))return gT(n[0]);e.isCollapsed=!1;const i=n.slice(1),o=new Set;let s=0;if(i.length>0)M(i,a=>{a.replaceTreeWith(a.data.clonedTree),a.data.clonedTree=null;const l=a.data;s+=l.colspan,w$(a,u=>{o.add(u)})});else{const{colspan:a,origColspan:l,columnIndex:u}=e;s=l-a;for(let c=1;c<l;c++)o.add(u+c)}return t.walkUp(a=>{const{data:l}=a;l.colspan+=s,l.colspan>=l.origColspan?(l.colspan=l.origColspan,l.isCollapsed=!1):Nm(a)&&(l.isCollapsed=Hm(a,"isCollapsed"))}),{rollbackModification:()=>mT(t),affectedColumns:Array.from(o),colspanCompensation:s}}function mT(t){var e;const{data:n,childs:r}=t;if(n.isCollapsed||n.isHidden||n.origColspan<=1)return{rollbackModification:()=>{},affectedColumns:[],colspanCompensation:0};if(Nm(t))return mT(r[0]);n.isCollapsed=!0;const o=r.slice(1),s=new Set;if(o.length>0)M(o,l=>{w$(l,u=>{s.add(u)}),l.data.clonedTree=l.cloneTree(),l.walkDown(u=>{let{data:c}=u;c.isHidden=!0})});else{const{origColspan:l,columnIndex:u}=n;for(let c=1;c<l;c++){const h=u+c;s.add(h)}}const a=n.colspan-((e=Hm(t,"colspan"))!==null&&e!==void 0?e:1);return t.walkUp(l=>{const{data:u}=l;u.colspan-=a,u.colspan<=1?(u.colspan=1,u.isCollapsed=!0):Nm(l)&&(u.isCollapsed=Hm(l,"isCollapsed"))}),{rollbackModification:()=>gT(t),affectedColumns:Array.from(s),colspanCompensation:a}}function moe(t,e){if(!Number.isInteger(e))throw new Error("The passed gridColumnIndex argument has invalid type.");if(t.childs.length>0)throw new Error(nt`The passed node is not the last node on the tree. Only for\x20
|
|
275
|
+
the last node, the hide column modification can be applied.`);const{crossHiddenColumns:n}=t.data;if(n.includes(e))return;let r=!1;t.walkUp(i=>{const{data:{collapsible:o}}=i;if(o)return r=!0,!1}),!r&&t.walkUp(i=>{const{data:o}=i;o.crossHiddenColumns.push(e),o.colspan>1?o.colspan-=1:o.isHidden=!0})}function poe(t,e){if(!Number.isInteger(e))throw new Error("The passed gridColumnIndex argument has invalid type.");if(t.childs.length>0)throw new Error(nt`The passed node is not the last node on the tree. Only for\x20
|
|
276
|
+
the last node, the show column modification can be applied.`);const{crossHiddenColumns:n}=t.data;if(!n.includes(e))return;let r=!1;t.walkUp(i=>{const{data:{collapsible:o}}=i;if(o)return r=!0,!1}),!r&&t.walkUp(i=>{const{data:o}=i;o.crossHiddenColumns.splice(o.crossHiddenColumns.indexOf(e),1),!o.isHidden&&o.colspan<o.origColspan&&(o.colspan+=1),o.isHidden=!1})}const RH=new Map([["collapse",mT],["expand",gT],["hide-column",moe],["show-column",poe]]);function woe(t,e,n){if(!RH.has(t))throw new Error(`The node modifier action ("${t}") does not exist.`);return RH.get(t)(e,n)}function og(t){const e=[];return M(t,n=>{n.walkDown(r=>{const i=r.data,{origColspan:o,columnIndex:s,headerLevel:a,crossHiddenColumns:l}=i,u=Coe(e,a);let c=!1;for(let h=s;h<s+o;h++)if(l.includes(h)||c)u.push(c$());else{const f=voe(i);f.isRoot=!0,u.push(f),c=!0}})}),e}function voe(t){const{crossHiddenColumns:e,...n}=WS(t);return n}function Coe(t,e){let n;return Array.isArray(t[e])?n=t[e]:(n=[],t[e]=n),n}function Tb(t,e,n){yoe(t,e),e.set(t,n)}function yoe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function th(t,e,n){return t.set(v$(t,e),n),n}function xt(t,e){return t.get(v$(t,e))}function v$(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Gi=new WeakMap,tr=new WeakMap,Va=new WeakMap;class boe{constructor(){Tb(this,Gi,new soe),Tb(this,tr,new goe(xt(Gi,this))),Tb(this,Va,[[]])}setState(e){xt(Gi,this).setData(e);let n=!1;try{xt(tr,this).buildTree()}catch{xt(tr,this).clear(),xt(Gi,this).clear(),n=!0}return th(Va,this,og(xt(tr,this).getRoots())),n}setColumnsLimit(e){xt(Gi,this).setColumnsLimit(e)}mergeStateWith(e){const n=Be(e,r=>{let{row:i,...o}=r;return{row:i<0?this.rowCoordsToLevel(i):i,...o}});xt(Gi,this).mergeWith(n),xt(tr,this).buildTree(),th(Va,this,og(xt(tr,this).getRoots()))}mapState(e){xt(Gi,this).map(e),xt(tr,this).buildTree(),th(Va,this,og(xt(tr,this).getRoots()))}mapNodes(e){return fr(xt(tr,this).getRoots(),(n,r)=>(r.walkDown(i=>{const o=e(i.data);o!==void 0&&n.push(o)}),n),[])}triggerNodeModification(e,n,r){n<0&&(n=this.rowCoordsToLevel(n));const i=xt(tr,this).getNode(n,r);let o;return i&&(o=woe(e,i,r),th(Va,this,og(xt(tr,this).getRoots()))),o}triggerColumnModification(e,n){return this.triggerNodeModification(e,-1,n)}rowCoordsToLevel(e){if(e>=0)return null;const n=e+Math.max(this.getLayersCount(),1);return n<0?null:n}levelToRowCoords(e){if(e<0)return null;const n=e-Math.max(this.getLayersCount(),1);return n>=0?null:n}getHeaderSettings(e,n){var r,i;return e<0&&(e=this.rowCoordsToLevel(e)),e===null||e>=this.getLayersCount()?null:(r=(i=xt(Va,this)[e])===null||i===void 0?void 0:i[n])!==null&&r!==void 0?r:null}getHeaderTreeNodeData(e,n){const r=this.getHeaderTreeNode(e,n);return r?{...r.data}:null}getHeaderTreeNode(e,n){if(e<0&&(e=this.rowCoordsToLevel(e)),e===null||e>=this.getLayersCount())return null;const r=xt(tr,this).getNode(e,n);return r||null}findTopMostEntireHeaderLevel(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e;const r=n-e+1;let i=!1,o=null;for(let s=e;s<=n;s++){const a=xt(tr,this).getRootByColumn(s);if(!a)break;i=!0,a.walkDown(l=>{const{columnIndex:u,headerLevel:c,origColspan:h,isHidden:d}=l.data;d||h<=r&&u>=e&&u+h-1<=n&&(o===null||c<o)&&(o=c)},d$)}return i&&o===null?-1:this.levelToRowCoords(o??0)}findLeftMostColumnIndex(e,n){var r;const{isRoot:i}=(r=this.getHeaderSettings(e,n))!==null&&r!==void 0?r:{isRoot:!0};if(i)return n;let o=n-1;for(;o>=0;){var s;const{isRoot:a}=(s=this.getHeaderSettings(e,o))!==null&&s!==void 0?s:{isRoot:!0};if(a)break;o-=1}return o}findRightMostColumnIndex(e,n){var r;const{isRoot:i,origColspan:o}=(r=this.getHeaderSettings(e,n))!==null&&r!==void 0?r:{isRoot:!0,origColspan:1};if(i)return n+o-1;let s=n+1;for(;s<this.getColumnsCount();){var a;const{isRoot:l}=(a=this.getHeaderSettings(e,s))!==null&&a!==void 0?a:{isRoot:!0};if(l)break;s+=1}return s-1}getLayersCount(){return xt(Gi,this).getLayersCount()}getColumnsCount(){return xt(Gi,this).getColumnsCount()}clear(){th(Va,this,[]),xt(Gi,this).clear(),xt(tr,this).clear()}}function nh(t,e,n){return(e=Soe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Soe(t){var e=Roe(t,"string");return typeof e=="symbol"?e:e+""}function Roe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Eoe{constructor(e,n){nh(this,"hot",void 0),nh(this,"nestedHeaderSettingsGetter",void 0),nh(this,"layersCount",0),nh(this,"container",void 0),nh(this,"widthsMap",void 0),this.hot=e,this.nestedHeaderSettingsGetter=n,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 n=this.container.querySelectorAll("tr:last-of-type th"),r=n.length;this.widthsMap.clear();for(let i=0;i<r;i++){const o=this.hot.columnIndexMapper.getVisualFromRenderableIndex(i),s=this.hot.toPhysicalColumn(o);this.widthsMap.setValueAtIndex(s,n[i].offsetWidth)}this.container.parentNode.removeChild(this.container),this.container=null}_buildGhostTable(e){const{rootDocument:n,columnIndexMapper:r}=this.hot,i=n.createDocumentFragment(),o=n.createElement("table"),s=!!this.hot.getSettings().dropdownMenu,a=r.getRenderableIndexesLength();for(let l=0;l<this.layersCount;l++){const u=n.createElement("tr");for(let c=0;c<a;c++){let h=r.getVisualFromRenderableIndex(c);h===null&&(h=c);const d=n.createElement("th"),f=this.nestedHeaderSettingsGetter(l,h);if(f&&(!f.isPlaceholder||f.isHidden)){let g=f.label;s&&(g+='<button class="changeType"></button>'),Ku(d,g),d.colSpan=f.colspan,u.appendChild(d)}}o.appendChild(u)}i.appendChild(o),e.appendChild(i)}clear(){this.widthsMap.clear(),this.container=null}}function Toe(t,e){C$(t,e),e.add(t)}function EH(t,e,n){return(e=_oe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _oe(t){var e=Moe(t,"string");return typeof e=="symbol"?e:e+""}function Moe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function rh(t,e,n){C$(t,e),e.set(t,n)}function C$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ko(t,e,n){return t.set(At(t,e),n),n}function Ve(t,e){return t.get(At(t,e))}function At(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const TH="nestedHeaders",Ioe=280;var st=new WeakMap,Rs=new WeakMap,Lh=new WeakMap,Dp=new WeakMap,Dm=new WeakMap,Ft=new WeakSet;class Poe extends Xe{constructor(){super(...arguments),Toe(this,Ft),rh(this,st,new boe),rh(this,Rs,null),rh(this,Lh,null),rh(this,Dp,!1),rh(this,Dm,null),EH(this,"ghostTable",new Eoe(this.hot,(e,n)=>this.getHeaderSettings(e,n))),EH(this,"detectedOverlappedHeaders",!1)}static get PLUGIN_KEY(){return TH}static get PLUGIN_PRIORITY(){return Ioe}isEnabled(){return!!this.hot.getSettings()[TH]}enablePlugin(){var e=this;if(this.enabled)return;const{nestedHeaders:n}=this.hot.getSettings();(!Array.isArray(n)||!Array.isArray(n[0]))&&Ze(nt`Your Nested Headers plugin configuration is invalid. The settings has to be\x20
|
|
277
|
+
passed as an array of arrays e.q. [['A1', { label: 'A2', colspan: 2 }]]`),this.addHook("init",()=>At(Ft,this,zoe).call(this)),this.addHook("afterLoadData",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return At(Ft,e,Yoe).call(e,...i)}),this.addHook("beforeOnCellMouseDown",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return At(Ft,e,Hoe).call(e,...i)}),this.addHook("afterOnCellMouseDown",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return At(Ft,e,Noe).call(e,...i)}),this.addHook("beforeOnCellMouseOver",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return At(Ft,e,Doe).call(e,...i)}),this.addHook("beforeOnCellMouseUp",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return At(Ft,e,koe).call(e,...i)}),this.addHook("beforeSelectionHighlightSet",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return At(Ft,e,Loe).call(e,...i)}),this.addHook("modifyTransformStart",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return At(Ft,e,$oe).call(e,...i)}),this.addHook("afterSelection",()=>At(Ft,this,sg).call(this)),this.addHook("afterSelectionFocusSet",()=>At(Ft,this,sg).call(this)),this.addHook("beforeViewportScrollHorizontally",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return At(Ft,e,Ooe).call(e,...i)}),this.addHook("afterGetColumnHeaderRenderers",r=>At(Ft,this,Voe).call(this,r)),this.addHook("modifyColWidth",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return At(Ft,e,Boe).call(e,...i)}),this.addHook("modifyColumnHeaderValue",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return At(Ft,e,joe).call(e,...i)}),this.addHook("beforeHighlightingColumnHeader",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return At(Ft,e,xoe).call(e,...i)}),this.addHook("beforeCopy",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return At(Ft,e,Aoe).call(e,...i)}),this.addHook("beforeSelectColumns",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return At(Ft,e,Foe).call(e,...i)}),this.addHook("afterViewportColumnCalculatorOverride",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return At(Ft,e,Woe).call(e,...i)}),this.addHook("modifyFocusedElement",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return At(Ft,e,Uoe).call(e,...i)}),this.hot.columnIndexMapper.addLocalHook("cacheUpdated",()=>At(Ft,this,sg).call(this)),this.hot.rowIndexMapper.addLocalHook("cacheUpdated",()=>At(Ft,this,sg).call(this)),super.enablePlugin(),this.updatePlugin()}updatePlugin(){if(!this.hot.view)return;const{nestedHeaders:e}=this.hot.getSettings();Ve(st,this).setColumnsLimit(this.hot.countCols()),Array.isArray(e)&&(this.detectedOverlappedHeaders=Ve(st,this).setState(e)),this.detectedOverlappedHeaders&&Ze(nt`Your Nested Headers plugin setup contains overlapping headers. This kind of configuration\x20
|
|
278
|
+
is currently not supported.`),this.enabled&&this.hot.columnIndexMapper.hidingMapsCollection.getMergedValues().forEach((n,r)=>{const i=n===!0?"hide-column":"show-column";Ve(st,this).triggerColumnModification(i,r)}),!Ve(Rs,this)&&this.enabled&&Ko(Rs,this,this.hot.columnIndexMapper.createChangesObserver("hiding").subscribe(n=>{n.forEach(r=>{let{op:i,index:o,newValue:s}=r;if(i==="replace"){const a=s===!0?"hide-column":"show-column";Ve(st,this).triggerColumnModification(a,o)}}),this.ghostTable.buildWidthsMap()})),this.ghostTable.setLayersCount(this.getLayersCount()).buildWidthsMap(),super.updatePlugin()}disablePlugin(){this.clearColspans(),Ve(st,this).clear(),Ve(Rs,this).unsubscribe(),Ko(Rs,this,null),this.ghostTable.clear(),super.disablePlugin()}getStateManager(){return Ve(st,this)}getLayersCount(){return Ve(st,this).getLayersCount()}getHeaderSettings(e,n){return Ve(st,this).getHeaderSettings(e,n)}clearColspans(){if(!this.hot.view)return;const{_wt:e}=this.hot.view,n=e.getSetting("columnHeaders").length,r=e.wtTable.THEAD,i=e.wtOverlays.topOverlay.clone.wtTable.THEAD,o=e.wtOverlays.topInlineStartCornerOverlay?e.wtOverlays.topInlineStartCornerOverlay.clone.wtTable.THEAD:null;for(let s=0;s<n;s++){const a=r.childNodes[s];if(!a)break;const l=i.childNodes[s],u=o?o.childNodes[s]:null;for(let c=0,h=a.childNodes.length;c<h;c++)a.childNodes[c].removeAttribute("colspan"),pe(a.childNodes[c],"hiddenHeader"),l&&l.childNodes[c]&&(l.childNodes[c].removeAttribute("colspan"),pe(l.childNodes[c],"hiddenHeader")),o&&u&&u.childNodes[c]&&(u.childNodes[c].removeAttribute("colspan"),pe(u.childNodes[c],"hiddenHeader"))}}headerRendererFactory(e){var n=this;const r=this.hot.view._wt.getSetting("fixedColumnsStart");return(i,o)=>{var s;const{columnIndexMapper:a,view:l}=this.hot;let u=a.getVisualFromRenderableIndex(i);u===null&&(u=i),o.removeAttribute("colspan"),pe(o,"hiddenHeader"),pe(o,"hiddenHeaderText");const{colspan:c,isHidden:h,isPlaceholder:d,headerClassNames:f}=(s=Ve(st,this).getHeaderSettings(e,u))!==null&&s!==void 0?s:{};if(d||h)G(o,"hiddenHeader");else if(c>1){var g,C,y;const{wtOverlays:E}=l._wt,v=(g=E.topInlineStartCornerOverlay)===null||g===void 0?void 0:g.clone.wtTable.THEAD.contains(o),P=(C=E.inlineStartOverlay)===null||C===void 0?void 0:C.clone.wtTable.THEAD.contains(o);((y=E.topOverlay)===null||y===void 0?void 0:y.clone.wtTable.THEAD.contains(o))&&u<r&&G(o,"hiddenHeaderText");const L=v||P?Math.min(c,r-i):c;L>1&&o.setAttribute("colspan",L)}if(this.hot.view.appendColHeader(u,o,function(){return n.getColumnHeaderValue(...arguments)},e),!d&&!h){const E=o.querySelector("div.relative");E&&f&&f.length>0&&(pe(E,this.hot.getColumnMeta(u).headerClassName),G(E,f))}}}getColumnHeaderValue(e,n){var r;const{isHidden:i,isPlaceholder:o}=(r=Ve(st,this).getHeaderSettings(n,e))!==null&&r!==void 0?r:{};return o||i?"":this.hot.getColHeader(e,n)}destroy(){Ko(st,this,null),Ve(Rs,this)!==null&&(Ve(Rs,this).unsubscribe(),Ko(Rs,this,null)),super.destroy()}_getHeaderTreeNodeDataByCoords(e){if(!(e.row>=0||e.col<0))return Ve(st,this).getHeaderTreeNodeData(e.row,e.col)}}function sg(){var t;const e=(t=this.hot)===null||t===void 0?void 0:t.getSelectedRangeLast();if(!e)return;const{highlight:n}=e;if(n.isHeader()&&n.col>=0){const i=Ve(st,this).findLeftMostColumnIndex(n.row,n.col),o=this.hot.selection.highlight.getFocus();o.visualCellRange.highlight.col=i,o.visualCellRange.from.col=i,o.visualCellRange.to.col=i,o.commit()}}function Ooe(t,e){var n;const r=this.hot.getSelectedRangeLast();if(!r)return t;const{highlight:i}=r,{navigableHeaders:o}=this.hot.getSettings(),s=this.hot.selection.isSelectedByColumnHeader(),a=o?i.row:(n=Ve(Dm,this))===null||n===void 0?void 0:n.row,l=s?t:i.col,u=a<0&&l>=0;if(Ko(Dm,this,null),!u)return t;const c=this.hot.getFirstFullyVisibleColumn(),h=this.hot.getLastFullyVisibleColumn(),d=h-c+1,f=Ve(st,this).findLeftMostColumnIndex(a,l),g=Ve(st,this).findRightMostColumnIndex(a,l),C=g-f+1;if(f<c&&g>h)return f;if(s){let y=null;return f>=c&&g>h?C>d?(e.value="start",y=f):(e.value="end",y=g):f<c&&g<=h&&(C>d?(e.value="end",y=g):(e.value="start",y=f)),y}return f<=c?f:g}function xoe(t,e,n){const r=Ve(st,this).getHeaderTreeNodeData(e,t);if(!r)return t;const{columnCursor:i,selectionType:o,selectionWidth:s}=n,{isRoot:a,colspan:l}=Ve(st,this).getHeaderSettings(e,t);if(o===UR){if(!a)return r.columnIndex}else if(o===dD&&(l>s-i||!a))return null;return t}function Aoe(t,e,n){let{columnHeadersCount:r}=n;if(r!==0)for(let o=0;o<e.length;o++){const{startRow:s,startCol:a,endRow:l,endCol:u}=e[o],c=l-s+1,h=a-u+1;if(s>=0||h===1)break;for(let d=a;d<=u;d++)for(let f=s;f<=l;f++){var i;const g=c+f,C=d-a;if(C===0)continue;((i=Ve(st,this).getHeaderTreeNodeData(f,d))===null||i===void 0?void 0:i.isRoot)===!1&&(t[g][C]="")}}}function Hoe(t,e,n,r){this._getHeaderTreeNodeDataByCoords(e)&&(r.column=!0)}function Noe(t,e){const n=this._getHeaderTreeNodeDataByCoords(e);if(!n)return;Ko(Lh,this,e.clone()),Ko(Dp,this,!0);const{selection:r}=this.hot,i=r.isSelected()?r.getSelectedRange().current():null,o=[],{columnIndex:s,origColspan:a}=n,l=!r.inInSelection(e);t.shiftKey&&i?e.col<i.from.col?o.push(i.getTopEndCorner().col,s,e.row):e.col>i.from.col?o.push(i.getTopStartCorner().col,s+a-1,e.row):o.push(s,s+a-1,e.row):(HR(t)||sl(t)&&l||yz(t))&&o.push(s,s+a-1,e.row),r.selectColumns(...o)}function Doe(t,e,n,r){if(!this.hot.view.isMouseDown()||r.column)return;const i=this._getHeaderTreeNodeDataByCoords(e);if(!i)return;const{columnIndex:o,origColspan:s}=i,a=this.hot.getSelectedRangeLast(),l=a.getTopStartCorner(),u=a.getBottomEndCorner(),{from:c}=a;r.column=!0,r.cell=!0;const h=[],d=Ue(e.row,-1/0,-1);e.col<c.col?h.push(u.col,o,d):e.col>c.col?h.push(l.col,o+s-1,d):h.push(o,o+s-1,d),this.hot.selection.selectColumns(...h)}function koe(){Ko(Dp,this,!1)}function Loe(){const{navigableHeaders:t}=this.hot.getSettings();if(!this.hot.view.isMouseDown()||!Ve(Dp,this)||!t)return;const e=this.hot.getSelectedRangeLast(),n=e.getTopStartCorner().col,r=e.getBottomEndCorner().col,{columnIndex:i,origColspan:o}=Ve(st,this).getHeaderTreeNodeData(Ve(Lh,this).row,Ve(Lh,this).col);if(e.setHighlight(Ve(Lh,this)),o>e.getWidth()||i<n||i+o-1>r){const s=Ve(st,this).findTopMostEntireHeaderLevel(Ue(n,i,i+o-1),Ue(r,i,i+o-1));e.highlight.row=s,e.highlight.col=e.from.col}}function $oe(t){const{highlight:e}=this.hot.getSelectedRangeLast(),n=this.hot._createCellCoords(e.row+t.row,e.col+t.col);if(!(n.isHeader()&&n.col>=0))return;const i=Ve(st,this).findLeftMostColumnIndex(n.row,n.col),o=Ve(st,this).findRightMostColumnIndex(n.row,n.col);if(t.col<0){const s=e.col>=i&&e.col<=o?i-1:o,a=this.hot.columnIndexMapper.getNearestNotHiddenIndex(s,-1);a===null?t.col=-this.hot.view.countRenderableColumnsInRange(0,e.col):t.col=-Math.max(this.hot.view.countRenderableColumnsInRange(a,e.col)-1,1)}else if(t.col>0){const s=e.col>=i&&e.col<=o?o+1:i,a=this.hot.columnIndexMapper.getNearestNotHiddenIndex(s,1);a===null?t.col=this.hot.view.countRenderableColumnsInRange(e.col,this.hot.countCols()):t.col=Math.max(this.hot.view.countRenderableColumnsInRange(e.col,a)-1,1)}}function Foe(t,e,n){const r=t.row,i=this._getHeaderTreeNodeDataByCoords({row:r,col:t.col}),o=this._getHeaderTreeNodeDataByCoords({row:r,col:e.col});Ko(Dm,this,n.clone()),e.col<t.col?(i&&(t.col=i.columnIndex+i.origColspan-1),o&&(e.col=o.columnIndex)):e.col>=t.col&&(i&&(t.col=i.columnIndex),o&&(e.col=o.columnIndex+o.origColspan-1))}function Voe(t){if(Ve(st,this).getLayersCount()>0){t.length=0;for(let e=0;e<Ve(st,this).getLayersCount();e++)t.push(this.headerRendererFactory(e))}}function Woe(t){const e=Ve(st,this).getLayersCount();let n=t.startColumn,r=!!e;for(let i=0;i<e;i++){const o=Ve(st,this).findLeftMostColumnIndex(i,t.startColumn),s=this.hot.columnIndexMapper.getRenderableFromVisualIndex(o);if(o>=0&&(r=!1),Un(s)&&s<t.startColumn){n=s;break}}t.startColumn=r?Ve(st,this).getHeaderTreeNodeData(0,n).columnIndex:n}function Boe(t,e){const n=this.ghostTable.getWidth(e);return t>n?t:n}function joe(t,e,n){var r;const{label:i}=(r=Ve(st,this).getHeaderTreeNodeData(n,e))!==null&&r!==void 0?r:{label:""};return i}function Uoe(t,e){if(t<0)return this.hot.getCell(t,Ve(st,this).findLeftMostColumnIndex(t,e),!0)}function zoe(){this.updatePlugin()}function Yoe(t,e){e||this.updatePlugin()}function ih(t,e,n){return(e=Goe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Goe(t){var e=qoe(t,"string");return typeof e=="symbol"?e:e+""}function qoe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Koe{constructor(e,n){ih(this,"hot",void 0),ih(this,"data",null),ih(this,"plugin",void 0),ih(this,"parentReference",new WeakMap),ih(this,"cache",{levels:[],levelCount:0,rows:[],nodeInfo:new WeakMap}),this.hot=n,this.plugin=e}setData(e){this.data=e}getData(){return this.data}getRawSourceData(){let e=null;return this.plugin.disableCoreAPIModifiers(),e=this.hot.getSourceData(),this.plugin.enableCoreAPIModifiers(),e}updateWithData(e){this.setData(e),this.rewriteCache()}rewriteCache(){this.cache={levels:[],levelCount:0,rows:[],nodeInfo:new WeakMap},de(0,this.data.length-1,e=>{this.cacheNode(this.data[e],0,null)})}cacheNode(e,n,r){this.cache.levels[n]||(this.cache.levels[n]=[],this.cache.levelCount+=1),this.cache.levels[n].push(e),this.cache.rows.push(e),this.cache.nodeInfo.set(e,{parent:r,row:this.cache.rows.length-1,level:n}),this.hasChildren(e)&&M(e.__children,i=>{this.cacheNode(i,n+1,e)})}getDataObject(e){return e==null?null:this.cache.rows[e]}readTreeNodes(e,n,r,i){let o=!1,s=n;if(isNaN(s)&&s.end)return s;let a=e;return a||(a={__children:this.data},o=!0,s-=1),r!=null&&s===r?{result:a,end:!0}:i!=null&&a===i?{result:s,end:!0}:(s+=1,a.__children&&M(a.__children,l=>{if(this.parentReference.set(l,o?null:a),s=this.readTreeNodes(l,s,r,i),isNaN(s)&&s.end)return!1}),s)}mockParent(){const e=this.mockNode();return e.__children=this.data,e}mockNode(){const e={};return He(this.data[0],(n,r)=>{e[r]=null}),e}getRowIndex(e){return e==null?null:this.cache.nodeInfo.get(e).row}getRowIndexWithinParent(e){let n=null;isNaN(e)?n=e:n=this.getDataObject(e);const r=this.getRowParent(e);return r==null?this.data.indexOf(n):r.__children.indexOf(n)}countAllRows(){const e={__children:this.data};return this.countChildren(e)}countChildren(e){let n=0,r=e;return isNaN(r)||(r=this.getDataObject(r)),!r||!r.__children?0:(M(r.__children,i=>{n+=1,i.__children&&(n+=this.countChildren(i))}),n)}getRowParent(e){let n;return isNaN(e)?n=e:n=this.getDataObject(e),this.getRowObjectParent(n)}getRowObjectParent(e){return!e||typeof e!="object"?null:this.cache.nodeInfo.get(e).parent}getRowLevel(e){let n=null;return isNaN(e)?n=e:n=this.getDataObject(e),n?this.getRowObjectLevel(n):null}getRowObjectLevel(e){return e==null?null:this.cache.nodeInfo.get(e).level}hasChildren(e){let n=e;return isNaN(n)||(n=this.getDataObject(n)),!!(n.__children&&n.__children.length)}isChild(e){return this.getRowParent(e)!==null}getChild(e,n){var r;return((r=e.__children)===null||r===void 0?void 0:r[n])||null}isRowHighestLevel(e){return!this.isChild(e)}isParent(e){var n;let r=e;return isNaN(r)||(r=this.getDataObject(r)),r&&!!r.__children&&((n=r.__children)===null||n===void 0?void 0:n.length)!==0}addChild(e,n){let r=n;this.hot.runHooks("beforeAddChild",e,r);let i=null;e&&(i=this.getRowIndex(e)),this.hot.runHooks("beforeCreateRow",i+this.countChildren(e)+1,1);let o=e;e||(o=this.mockParent()),o.__children||(o.__children=[]),r||(r=this.mockNode()),o.__children.push(r),this.rewriteCache();const s=this.getRowIndex(r);this.hot.rowIndexMapper.insertIndexes(s,1),this.hot.runHooks("afterCreateRow",s,1),this.hot.runHooks("afterAddChild",e,r)}addChildAtIndex(e,n,r){let i=r,o;if(i||(i=this.mockNode()),this.hot.runHooks("beforeAddChild",e,i,n),e){const a=this.getRowIndex(e)+n+1;this.hot.runHooks("beforeCreateRow",a,1),e.__children.splice(n,null,i),this.rewriteCache(),this.plugin.disableCoreAPIModifiers(),this.hot.setSourceDataAtCell(this.getRowIndexWithinParent(e),"__children",e.__children,"NestedRows.addChildAtIndex"),this.hot.rowIndexMapper.insertIndexes(a,1),this.plugin.enableCoreAPIModifiers(),this.hot.runHooks("afterCreateRow",a,1),o=a}else this.plugin.disableCoreAPIModifiers(),this.hot.alter("insert_row_above",n,1,"NestedRows.addChildAtIndex"),this.plugin.enableCoreAPIModifiers(),o=this.getRowIndex(this.data[n]);i=this.getDataObject(o),this.hot.runHooks("afterAddChild",e,i,n)}addSibling(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"below";const r=this.translateTrimmedRow(e),i=this.getRowParent(r),o=this.getRowIndexWithinParent(r);switch(n){case"below":this.addChildAtIndex(i,o+1,null);break;case"above":this.addChildAtIndex(i,o,null);break}}detachFromParent(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=null;const i=[];Array.isArray(e)?(de(e[0],e[2],d=>{const f=this.translateTrimmedRow(d);i.push(this.getDataObject(f))}),de(0,i.length-2,d=>{this.detachFromParent(i[d],!1)}),r=i[i.length-1]):r=e;const o=this.getRowIndex(r),s=this.countChildren(r),a=this.getRowIndexWithinParent(r),l=this.getRowParent(r),u=this.getRowParent(l),c=this.getRowIndex(u);let h=null;if(this.hot.runHooks("beforeDetachChild",l,r),a!=null){const d=Array.from(new Array(o+s+1).keys()).splice(-1*(s+1));if(this.hot.runHooks("beforeRemoveRow",o,s+1,d,this.plugin.pluginName),l.__children.splice(a,1),this.rewriteCache(),this.hot.runHooks("afterRemoveRow",o,s+1,d,this.plugin.pluginName),u){h=c+this.countChildren(u);const f=this.getChild(u,this.countChildren(u)-1),g=this.getRowIndex(f);this.hot.runHooks("beforeCreateRow",g+1,s+1,this.plugin.pluginName),u.__children.push(r)}else h=this.hot.countRows()+1,this.hot.runHooks("beforeCreateRow",h-2,s+1,this.plugin.pluginName),this.data.push(r)}this.rewriteCache(),this.hot.runHooks("afterCreateRow",h-2,s+1,this.plugin.pluginName),this.hot.runHooks("afterDetachChild",l,r,this.getRowIndex(r)),n&&this.hot.render()}filterData(e,n,r){const i=[];M(r,o=>{i.push(this.getDataObject(o))}),M(i,o=>{const s=this.getRowIndexWithinParent(o),a=this.getRowParent(o);a===null?this.data.splice(s,1):a.__children.splice(s,1)}),this.rewriteCache()}spliceData(e,n,r){const i=this.getDataObject(e-1);let o=null,s=e;i&&i.__children&&i.__children.length===0?(o=i,s=0):e<this.countAllRows()&&(o=this.getRowParent(e),s=this.getRowIndexWithinParent(e)),o?r?o.__children.splice(s,n,...r):o.__children.splice(s,n):r?this.data.splice(s,n,...r):this.data.splice(s,n),this.rewriteCache()}syncRowWithRawSource(e){let n=e,r=n;do r=this.getRowParent(r),r!==null&&(n=r);while(r!==null);this.plugin.disableCoreAPIModifiers(),this.hot.setSourceDataAtCell(this.getRowIndexWithinParent(n),"__children",n.__children,"NestedRows.syncRowWithRawSource"),this.plugin.enableCoreAPIModifiers()}moveRow(e,n,r,i){const o=n===this.hot.countRows(),s=this.getRowParent(e),a=this.getRowIndexWithinParent(e),l=s.__children.slice(a,a+1),u=e>n;let c=o?this.getRowParent(n-1):this.getRowParent(n);c==null&&(c=this.getRowParent(n-1)),c==null&&(c=this.getDataObject(n-1)),c?c.__children||(c.__children=[]):(c=this.getDataObject(n),c.__children=[]);const h=o||r||i?c.__children.length:this.getRowIndexWithinParent(n),d=s===c;c.__children.splice(h,0,l[0]),s.__children.splice(a+(u&&d?1:0),1),this.syncRowWithRawSource(s),d||this.syncRowWithRawSource(c)}translateTrimmedRow(e){return this.plugin.collapsingUI?this.plugin.collapsingUI.translateTrimmedRow(e):e}untranslateTrimmedRow(e){return this.plugin.collapsingUI?this.plugin.collapsingUI.untranslateTrimmedRow(e):e}}function _H(t,e,n){return(e=Xoe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Xoe(t){var e=Zoe(t,"string");return typeof e=="symbol"?e:e+""}function Zoe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class pT{constructor(e,n){_H(this,"hot",void 0),_H(this,"plugin",void 0),this.hot=n,this.plugin=e}}class no extends pT{static get CSS_CLASSES(){return{indicatorContainer:"ht_nestingLevels",parent:"ht_nestingParent",indicator:"ht_nestingLevel",emptyIndicator:"ht_nestingLevel_empty",button:"ht_nestingButton",expandButton:"ht_nestingExpand",collapseButton:"ht_nestingCollapse"}}constructor(e,n){super(e,n),this.dataManager=this.plugin.dataManager,this.collapsingUI=this.plugin.collapsingUI,this.rowHeaderWidthCache=null}appendLevelIndicators(e,n){const r=this.hot.toPhysicalRow(e),i=this.dataManager.getRowLevel(r),o=this.dataManager.getDataObject(r),s=n.getElementsByTagName("DIV")[0],a=s.querySelector("span.rowHeader"),l=s.querySelectorAll('[class^="ht_nesting"]'),u=this.hot.getSettings().ariaTags;if(M(l,c=>{c&&s.removeChild(c)}),G(n,no.CSS_CLASSES.indicatorContainer),i){const{rootDocument:c}=this.hot,h=a.cloneNode(!0);s.innerHTML="",de(0,i-1,()=>{const d=c.createElement("SPAN");G(d,no.CSS_CLASSES.emptyIndicator),s.appendChild(d)}),s.appendChild(h)}if(this.dataManager.hasChildren(o)){const c=this.hot.rootDocument.createElement("DIV");u&&ye(c,[yl()]),G(n,no.CSS_CLASSES.parent),this.collapsingUI.areChildrenCollapsed(r)?(G(c,`${no.CSS_CLASSES.button} ${no.CSS_CLASSES.expandButton}`),u&&ye(n,[Gr(!1)])):(G(c,`${no.CSS_CLASSES.button} ${no.CSS_CLASSES.collapseButton}`),u&&ye(n,[Gr(!0)])),s.appendChild(c)}}updateRowHeaderWidth(e){let n=e;n||(n=this.dataManager.cache.levelCount);const r=this.hot.view.getStylesHandler();let i=11;r.isClassicTheme()||(i=r.getCSSVariableValue("cell-horizontal-padding")*2),this.rowHeaderWidthCache=Math.max(50,i+10*n+25),this.hot.render()}}class Qoe extends pT{constructor(e,n){var r;super(e,n),r=this,this.dataManager=this.plugin.dataManager,this.collapsedRows=[],this.collapsedRowsStash={stash:function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;r.lastCollapsedRows=r.collapsedRows.slice(0),r.expandMultipleChildren(r.lastCollapsedRows,i)},shiftStash:function(i,o){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;o==null&&(o=1/0),M(r.lastCollapsedRows,(a,l)=>{a>=i&&a<o&&(r.lastCollapsedRows[l]=a+s)})},applyStash:function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;r.collapseMultipleChildren(r.lastCollapsedRows,i),r.lastCollapsedRows=void 0},trimStash:(i,o)=>{de(i,i+o-1,s=>{const a=this.lastCollapsedRows.indexOf(s);a>-1&&this.lastCollapsedRows.splice(a,1)})}}}collapseChildren(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;const i=[];let o=null,s=null,a=null;return isNaN(e)?(o=e,s=this.dataManager.getRowIndex(o)):(o=this.dataManager.getDataObject(e),s=e),this.dataManager.hasChildren(o)&&M(o.__children,l=>{i.push(this.dataManager.getRowIndex(l))}),a=this.collapseRows(i,!0,!1),r&&this.trimRows(a),n&&this.renderAndAdjust(),this.collapsedRows.indexOf(s)===-1&&this.collapsedRows.push(s),a}collapseMultipleChildren(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;const i=[];M(e,o=>{i.push(...this.collapseChildren(o,!1,!1))}),r&&this.trimRows(i),n&&this.renderAndAdjust()}collapseRow(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.collapseRows([e],n)}collapseRows(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=[];return M(e,o=>{i.push(o),n&&this.collapseChildRows(o,i)}),r&&this.trimRows(i),i}collapseChildRows(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(this.dataManager.hasChildren(e)){const i=this.dataManager.getDataObject(e);M(i.__children,o=>{const s=this.dataManager.getRowIndex(o);n.push(s),this.collapseChildRows(s,n)})}r&&this.trimRows(n)}expandRow(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.expandRows([e],n)}expandRows(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=[];return M(e,o=>{i.push(o),n&&this.expandChildRows(o,i)}),r&&this.untrimRows(i),i}expandChildRows(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(this.dataManager.hasChildren(e)){const i=this.dataManager.getDataObject(e);M(i.__children,o=>{if(!this.isAnyParentCollapsed(o)){const s=this.dataManager.getRowIndex(o);n.push(s),this.expandChildRows(s,n)}})}r&&this.untrimRows(n)}expandChildren(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;const i=[];let o=null,s=null,a=null;return isNaN(e)?(o=e,s=this.dataManager.getRowIndex(e)):(o=this.dataManager.getDataObject(e),s=e),this.collapsedRows.splice(this.collapsedRows.indexOf(s),1),this.dataManager.hasChildren(o)&&M(o.__children,l=>{const u=this.dataManager.getRowIndex(l);i.push(u)}),a=this.expandRows(i,!0,!1),r&&this.untrimRows(a),n&&this.renderAndAdjust(),a}expandMultipleChildren(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;const i=[];M(e,o=>{i.push(...this.expandChildren(o,!1,!1))}),r&&this.untrimRows(i),n&&this.renderAndAdjust()}collapseAll(){const e=this.dataManager.getData(),n=[];M(e,r=>{this.dataManager.hasChildren(r)&&n.push(r)}),this.collapseMultipleChildren(n),this.renderAndAdjust()}expandAll(){const e=this.dataManager.getData(),n=[];M(e,r=>{this.dataManager.hasChildren(r)&&n.push(r)}),this.expandMultipleChildren(n),this.renderAndAdjust()}trimRows(e){this.hot.batchExecution(()=>{M(e,n=>{this.plugin.collapsedRowsMap.setValueAtIndex(n,!0)})},!0)}untrimRows(e){this.hot.batchExecution(()=>{M(e,n=>{this.plugin.collapsedRowsMap.setValueAtIndex(n,!1)})},!0)}areChildrenCollapsed(e){let n=isNaN(e)?e:this.dataManager.getDataObject(e),r=!0;return n===null&&(n={__children:this.dataManager.data}),this.dataManager.hasChildren(n)&&M(n.__children,i=>{const o=this.dataManager.getRowIndex(i);if(!this.plugin.collapsedRowsMap.getValueAtIndex(o))return r=!1,!1}),r}isAnyParentCollapsed(e){let n=e;for(;n!==null;){n=this.dataManager.getRowParent(n);const r=this.dataManager.getRowIndex(n);if(this.collapsedRows.indexOf(r)>-1)return!0}return!1}toggleState(e,n){if(n.col>=0)return;const r=this.translateTrimmedRow(n.row);ve(e.target,no.CSS_CLASSES.button)&&(this.areChildrenCollapsed(r)?this.expandChildren(r):this.collapseChildren(r),Pi(e))}translateTrimmedRow(e){return this.hot.toPhysicalRow(e)}untranslateTrimmedRow(e){return this.hot.toVisualRow(e)}renderAndAdjust(){this.hot.render(),this.hot.view.adjustElementsSize()}}function Joe(t,e,n){ese(t,e),e.set(t,n)}function ese(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function tse(t,e,n){return(e=nse(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function nse(t){var e=rse(t,"string");return typeof e=="symbol"?e:e+""}function rse(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ise(t,e){return t.get(ose(t,e))}function ose(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var MH=new WeakMap;class sse extends pT{constructor(){super(...arguments),tse(this,"dataManager",this.plugin.dataManager),Joe(this,MH,{row_above:(e,n)=>{const r=n[n.length-1];this.dataManager.addSibling(r.start.row,"above")},row_below:(e,n)=>{const r=n[n.length-1];this.dataManager.addSibling(r.start.row,"below")}})}appendOptions(e){const n=[{key:"add_child",name(){return this.getTranslatedPhrase(UE)},callback:()=>{const r=this.dataManager.translateTrimmedRow(this.hot.getSelectedLast()[0]),i=this.dataManager.getDataObject(r);this.dataManager.addChild(i)},disabled:()=>{const r=this.hot.getSelectedLast();return!r||r[0]<0||this.hot.selection.isSelectedByColumnHeader()||this.hot.countRows()>=this.hot.getSettings().maxRows}},{key:"detach_from_parent",name(){return this.getTranslatedPhrase(zE)},callback:()=>{this.dataManager.detachFromParent(this.hot.getSelectedLast())},disabled:()=>{const r=this.hot.getSelectedLast(),i=this.dataManager.translateTrimmedRow(r[0]);return!this.dataManager.getRowParent(i)||!r||r[0]<0||this.hot.selection.isSelectedByColumnHeader()||this.hot.countRows()>=this.hot.getSettings().maxRows}},{name:"---------"}];return de(0,e.items.length-1,r=>{if(r===0)return M(n,(i,o)=>{e.items.splice(r+o,0,i)}),!1}),this.modifyRowInsertingOptions(e)}modifyRowInsertingOptions(e){return de(0,e.items.length-1,n=>{const r=ise(MH,this)[e.items[n].key];r!=null&&(e.items[n].callback=r)}),e}}function ag(t,e,n){return(e=ase(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ase(t){var e=lse(t,"string");return typeof e=="symbol"?e:e+""}function lse(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class use{constructor(e){ag(this,"plugin",void 0),ag(this,"hot",void 0),ag(this,"dataManager",void 0),ag(this,"collapsingUI",void 0),this.plugin=e,this.hot=e.hot,this.dataManager=e.dataManager,this.collapsingUI=e.collapsingUI}onBeforeRowMove(e,n,r,i){if(this.displayAPICompatibilityWarning({rows:e,finalIndex:n,dropIndex:r,movePossible:i}))return!1;this.movedToCollapsed=!1;const s=r===this.hot.countRows(),a=s?this.hot.countSourceRows():this.dataManager.translateTrimmedRow(r);let l=!0;const u=e.map(g=>{if(!l)return!1;const C=this.dataManager.translateTrimmedRow(g);return l=this.shouldAllowMoving(C,a),C}),c=u.indexOf(a)===-1;if(!l||!c)return!1;const h=this.getBaseParent(u),d=this.getTargetParent(s,a),f=h===d;return this.movedToCollapsed=this.collapsingUI.areChildrenCollapsed(d),this.collapsingUI.collapsedRowsStash.stash(),this.shiftCollapsibleParentsLocations(u,a,f),this.moveRows(u,a,d),this.dataManager.rewriteCache(),this.moveCellsMeta(u,a),this.collapsingUI.collapsedRowsStash.applyStash(!1),this.hot.runHooks("afterRowMove",e,n,r,i,i&&this.isRowOrderChanged(e,n)),this.hot.render(),this.selectCells(e,r),!1}displayAPICompatibilityWarning(e){const{rows:n,finalIndex:r,dropIndex:i,movePossible:o}=e;let s=!1;return It(i)&&(Ze(nt`Since version 8.0.0 of the Handsontable the 'moveRows' method isn't used for moving rows\x20
|
|
279
|
+
when the NestedRows plugin is enabled. Please use the 'dragRows' method instead.`),this.hot.runHooks("afterRowMove",n,r,i,o,!1),s=!0),s}shouldAllowMoving(e,n){return!(this.dataManager.isParent(e)||this.dataManager.isRowHighestLevel(e)||e===n||n===0)}getBaseParent(e){return this.dataManager.getRowParent(e[0])}getTargetParent(e,n){let r=this.dataManager.getRowParent(e?n-1:n);return r==null&&(r=this.dataManager.getRowParent(n-1)),r}shiftCollapsibleParentsLocations(e,n,r){r||(Math.max(...e)<=n?this.collapsingUI.collapsedRowsStash.shiftStash(e[0],n,-1*e.length):this.collapsingUI.collapsedRowsStash.shiftStash(n,e[0],e.length))}moveRows(e,n,r){const i=n===this.dataManager.getRowIndex(r)+this.dataManager.countChildren(r)+1;this.hot.batchRender(()=>{e.forEach(o=>{this.dataManager.moveRow(o,n,this.movedToCollapsed,i)})})}moveCellsMeta(e,n){const r=[],i=Math.max(...e)<n;e.forEach(o=>{r.push(this.hot.getCellMetaAtRow(o))}),this.hot.spliceCellsMeta(e[0],e.length),this.hot.spliceCellsMeta(n-(i?r.length:0),0,...r)}selectCells(e,n){const r=e.length;let i=0,o=0;if(this.movedToCollapsed){let s=null;e[r-1]<n?s=this.dataManager.translateTrimmedRow(n-r):s=this.dataManager.translateTrimmedRow(n);const a=this.dataManager.getRowParent(s===null?this.hot.countSourceRows()-1:s-1),l=this.dataManager.getRowIndex(a);i=this.dataManager.untranslateTrimmedRow(l),o=i}else e[r-1]<n?(o=n-1,i=o-r+1):(i=n,o=i+r-1);this.hot.selectCells([[i,0,o,this.hot.countCols()-1]],!1)}isRowOrderChanged(e,n){return e.some((r,i)=>r-i!==n)}}function cse(t,e){y$(t,e),e.add(t)}function IH(t,e,n){y$(t,e),e.set(t,n)}function y$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _b(t,e,n){return(e=hse(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function hse(t){var e=dse(t,"string");return typeof e=="symbol"?e:e+""}function dse(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Vg(t,e){return t.get(hn(t,e))}function km(t,e,n){return t.set(hn(t,e),n),n}function hn(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const Lm="nestedRows",fse=300,PH=Lm,gse="The Nested Rows plugin requires an Array of Objects as a dataset to be provided. The plugin has been disabled.";var kp=new WeakMap,ou=new WeakMap,pn=new WeakSet;class mse extends Xe{constructor(){super(...arguments),cse(this,pn),_b(this,"dataManager",null),_b(this,"headersUI",null),_b(this,"collapsedRowsMap",null),IH(this,kp,!1),IH(this,ou,!1)}static get PLUGIN_KEY(){return Lm}static get PLUGIN_PRIORITY(){return fse}isEnabled(){return!!this.hot.getSettings()[Lm]}enablePlugin(){var e=this;this.enabled||(this.collapsedRowsMap=this.hot.rowIndexMapper.registerMap("nestedRows",new Rd),this.dataManager=new Koe(this,this.hot),this.collapsingUI=new Qoe(this,this.hot),this.headersUI=new no(this,this.hot),this.contextMenuUI=new sse(this,this.hot),this.rowMoveController=new use(this),this.addHook("afterInit",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return hn(pn,e,Pse).call(e,...r)}),this.addHook("beforeViewRender",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return hn(pn,e,Ose).call(e,...r)}),this.addHook("modifyRowData",function(){return e.onModifyRowData(...arguments)}),this.addHook("modifySourceLength",function(){return e.onModifySourceLength(...arguments)}),this.addHook("beforeDataSplice",function(){return e.onBeforeDataSplice(...arguments)}),this.addHook("filterData",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return hn(pn,e,vse).call(e,...r)}),this.addHook("afterContextMenuDefaultOptions",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return hn(pn,e,Cse).call(e,...r)}),this.addHook("afterGetRowHeader",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return hn(pn,e,yse).call(e,...r)}),this.addHook("beforeOnCellMouseDown",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return hn(pn,e,wse).call(e,...r)}),this.addHook("beforeRemoveRow",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return hn(pn,e,Rse).call(e,...r)}),this.addHook("afterRemoveRow",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return hn(pn,e,Sse).call(e,...r)}),this.addHook("beforeAddChild",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return hn(pn,e,Ese).call(e,...r)}),this.addHook("afterAddChild",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return hn(pn,e,Tse).call(e,...r)}),this.addHook("beforeDetachChild",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return hn(pn,e,_se).call(e,...r)}),this.addHook("afterDetachChild",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return hn(pn,e,Mse).call(e,...r)}),this.addHook("modifyRowHeaderWidth",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return hn(pn,e,bse).call(e,...r)}),this.addHook("afterCreateRow",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return hn(pn,e,Ise).call(e,...r)}),this.addHook("beforeRowMove",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return hn(pn,e,pse).call(e,...r)}),this.addHook("beforeLoadData",n=>hn(pn,this,OH).call(this,n)),this.addHook("beforeUpdateData",n=>hn(pn,this,OH).call(this,n)),this.registerShortcuts(),super.enablePlugin())}disablePlugin(){this.hot.rowIndexMapper.unregisterMap("nestedRows"),this.unregisterShortcuts(),super.disablePlugin()}updatePlugin(){this.disablePlugin();const e=this.dataManager.getData();this.enablePlugin(),this.dataManager.updateWithData(e),super.updatePlugin()}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Enter"]],callback:()=>{const{highlight:e}=this.hot.getSelectedRangeLast(),n=this.collapsingUI.translateTrimmedRow(e.row);return this.collapsingUI.areChildrenCollapsed(n)?this.collapsingUI.expandChildren(n):this.collapsingUI.collapseChildren(n),!1},runOnlyIf:()=>{var e,n;const r=(e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;return r&&((n=this.hot.getSelectedRangeLast())===null||n===void 0?void 0:n.isSingle())&&this.hot.selection.isCellVisible(r)&&r.col===-1&&r.row>=0},group:PH,relativeToGroup:Qs,position:"before"})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(PH)}disableCoreAPIModifiers(){km(ou,this,!0)}enableCoreAPIModifiers(){km(ou,this,!1)}onModifyRowData(e){if(!Vg(ou,this))return this.dataManager.getDataObject(e)}onModifySourceLength(){if(!Vg(ou,this))return this.dataManager.countAllRows()}onBeforeDataSplice(e,n,r){return Vg(ou,this)||this.dataManager.isRowHighestLevel(e)?!0:(this.dataManager.spliceData(e,n,r),!1)}destroy(){super.destroy()}}function pse(t,e,n,r){return this.rowMoveController.onBeforeRowMove(t,e,n,r)}function wse(t,e,n){this.collapsingUI.toggleState(t,e,n)}function vse(t,e,n){return this.collapsingUI.collapsedRowsStash.stash(),this.collapsingUI.collapsedRowsStash.trimStash(n[0],e),this.collapsingUI.collapsedRowsStash.shiftStash(n[0],null,-1*e),this.dataManager.filterData(t,e,n),km(kp,this,!0),this.dataManager.getData().slice()}function Cse(t){return this.contextMenuUI.appendOptions(t)}function yse(t,e){this.headersUI.appendLevelIndicators(t,e)}function bse(t){return Math.max(this.headersUI.rowHeaderWidthCache,t)}function Sse(t,e,n,r){r!==this.pluginName&&this.hot._registerTimeout(()=>{km(kp,this,!1),this.headersUI.updateRowHeaderWidth(),this.collapsingUI.collapsedRowsStash.applyStash()})}function Rse(t,e,n){const r=Array.from(n.reduce((i,o)=>{if(this.dataManager.isParent(o)){const s=this.dataManager.getDataObject(o).__children;return i.add(o),Array.isArray(s)&&s.forEach(a=>i.add(this.dataManager.getRowIndex(a))),i}return i.add(o)},new Set));n.length=0,n.push(...r)}function Ese(){this.collapsingUI.collapsedRowsStash.stash()}function Tse(t,e){this.collapsingUI.collapsedRowsStash.shiftStash(this.dataManager.getRowIndex(e)),this.collapsingUI.collapsedRowsStash.applyStash(),this.headersUI.updateRowHeaderWidth()}function _se(){this.collapsingUI.collapsedRowsStash.stash()}function Mse(t,e,n){this.collapsingUI.collapsedRowsStash.shiftStash(n,null,-1),this.collapsingUI.collapsedRowsStash.applyStash(),this.headersUI.updateRowHeaderWidth()}function Ise(){this.dataManager.rewriteCache()}function Pse(){this.headersUI.updateRowHeaderWidth()}function Ose(t,e){Vg(kp,this)&&(e.skipRender=!0)}function OH(t){if(!Hq(t)){NR(gse),this.hot.getSettings()[Lm]=!1,this.disablePlugin();return}this.dataManager.setData(t),this.dataManager.rewriteCache()}function Mb(t,e,n){return(e=xse(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function xse(t){var e=Ase(t,"string");return typeof e=="symbol"?e:e+""}function Ase(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Hse{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:window;Mb(this,"rootWindow",void 0),Mb(this,"prefix",void 0),Mb(this,"savedKeys",[]),this.rootWindow=n,this.prefix=e,this.loadSavedKeys()}saveValue(e,n){this.rootWindow.localStorage.setItem(`${this.prefix}_${e}`,JSON.stringify(n)),this.savedKeys.indexOf(e)===-1&&(this.savedKeys.push(e),this.saveSavedKeys())}loadValue(e,n){const r=typeof e>"u"?n:e,i=this.rootWindow.localStorage.getItem(`${this.prefix}_${r}`);return i===null?void 0:JSON.parse(i)}reset(e){this.rootWindow.localStorage.removeItem(`${this.prefix}_${e}`)}resetAll(){M(this.savedKeys,(e,n)=>{this.rootWindow.localStorage.removeItem(`${this.prefix}_${this.savedKeys[n]}`)}),this.clearSavedKeys()}loadSavedKeys(){const e=this.rootWindow.localStorage.getItem(`${this.prefix}__persistentStateKeys`),n=typeof e=="string"?JSON.parse(e):void 0;this.savedKeys=n||[]}saveSavedKeys(){this.rootWindow.localStorage.setItem(`${this.prefix}__persistentStateKeys`,JSON.stringify(this.savedKeys))}clearSavedKeys(){this.savedKeys.length=0,this.saveSavedKeys()}}function Nse(t,e,n){return(e=Dse(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Dse(t){var e=kse(t,"string");return typeof e=="symbol"?e:e+""}function kse(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}re.getSingleton().register("persistentStateSave");re.getSingleton().register("persistentStateLoad");re.getSingleton().register("persistentStateReset");const xH="persistentState",Lse=0;class $se extends Xe{constructor(){super(...arguments),Nse(this,"storage",void 0)}static get PLUGIN_KEY(){return xH}static get PLUGIN_PRIORITY(){return Lse}isEnabled(){return!!this.hot.getSettings()[xH]}enablePlugin(){this.enabled||(this.storage||(this.storage=new Hse(this.hot.rootElement.id,this.hot.rootWindow)),this.addHook("persistentStateSave",(e,n)=>this.saveValue(e,n)),this.addHook("persistentStateLoad",(e,n)=>this.loadValue(e,n)),this.addHook("persistentStateReset",()=>this.resetValue()),super.enablePlugin())}disablePlugin(){this.storage=void 0,super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}loadValue(e,n){n.value=this.storage.loadValue(e)}saveValue(e,n){this.storage.saveValue(e,n)}resetValue(e){typeof e>"u"?this.storage.resetAll():this.storage.reset(e)}destroy(){super.destroy()}}function Fse(t,e){Vse(t,e),e.add(t)}function Vse(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ib(t,e,n){return(e=Wse(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Wse(t){var e=Bse(t,"string");return typeof e=="symbol"?e:e+""}function Bse(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function AH(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const Pb="search",jse=190,Use="htSearchResult",zse=function(t,e,n,r,i){t.getCellMeta(e,n).isSearchResult=i},Yse=function(t,e,n){return It(t)||t===null||!t.toLocaleLowerCase||t.length===0||It(e)||e===null?!1:e.toString().toLocaleLowerCase(n.locale).indexOf(t.toLocaleLowerCase(n.locale))!==-1};var Ob=new WeakSet;class Gse extends Xe{constructor(){super(...arguments),Fse(this,Ob),Ib(this,"callback",zse),Ib(this,"queryMethod",Yse),Ib(this,"searchResultClass",Use)}static get PLUGIN_KEY(){return Pb}static get PLUGIN_PRIORITY(){return jse}isEnabled(){return this.hot.getSettings()[Pb]}enablePlugin(){var e=this;if(this.enabled)return;const n=this.hot.getSettings()[Pb];this.updatePluginSettings(n),this.addHook("beforeRenderer",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return AH(Ob,e,HH).call(e,...i)}),super.enablePlugin()}disablePlugin(){var e=this;const n=function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return AH(Ob,e,HH).call(e,...i)};this.hot.addHook("beforeRenderer",n),this.hot.addHookOnce("afterViewRender",()=>{this.hot.removeHook("beforeRenderer",n)}),super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}query(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getCallback(),r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.getQueryMethod();const i=this.hot.countRows(),o=this.hot.countCols(),s=[],a=this.hot;return de(0,i-1,l=>{de(0,o-1,u=>{const c=this.hot.getDataAtCell(l,u),h=this.hot.getCellMeta(l,u),d=h.search.callback||n,g=(h.search.queryMethod||r)(e,c,h);if(g){const C={row:l,col:u,data:c};s.push(C)}d&&d(a,l,u,c,g)})}),s}getCallback(){return this.callback}setCallback(e){this.callback=e}getQueryMethod(){return this.queryMethod}setQueryMethod(e){this.queryMethod=e}getSearchResultClass(){return this.searchResultClass}setSearchResultClass(e){this.searchResultClass=e}updatePluginSettings(e){Ae(e)&&(e.searchResultClass&&this.setSearchResultClass(e.searchResultClass),e.queryMethod&&this.setQueryMethod(e.queryMethod),e.callback&&this.setCallback(e.callback))}destroy(){super.destroy()}}function HH(t,e,n,r,i,o){const s=o.className||[];let a=[];typeof s=="string"?a=s.split(" "):a.push(...s),this.isEnabled()&&o.isSearchResult?a.includes(this.searchResultClass)||a.push(`${this.searchResultClass}`):a.includes(this.searchResultClass)&&a.splice(a.indexOf(this.searchResultClass),1),o.className=a.join(" ")}function lg(t,e,n){return(e=qse(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function qse(t){var e=Kse(t,"string");return typeof e=="symbol"?e:e+""}function Kse(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class b${constructor(e){lg(this,"viewportWidth",void 0),lg(this,"overwriteColumnWidthFn",void 0),lg(this,"baseWidths",new Map),lg(this,"stretchedWidths",new Map),this.overwriteColumnWidthFn=e}prepare(e){let{viewportWidth:n}=e;this.viewportWidth=n,this.baseWidths.clear(),this.stretchedWidths.clear()}setColumnBaseWidth(e,n){this.baseWidths.set(e,n)}calculate(){}getWidths(){return Array.from(this.stretchedWidths)}}class Xse extends b${calculate(){const e=Array.from(this.baseWidths).reduce((h,d)=>{let[,f]=d;return h+f},0);if(this.viewportWidth-e<0){this.stretchedWidths.clear();return}const r=this.viewportWidth/e,i=[],o=[];let s=this.viewportWidth,a=0;if(this.baseWidths.forEach((h,d)=>{const f=Math.round(h*r),g=this.overwriteColumnWidthFn(f,d);f===g&&f>=Hu?(i.push([d,g]),a+=g):f!==g&&(i.push([d,g]),o.push(d),s-=g)}),s<=Hu){this.stretchedWidths.clear();return}const l=s/a;let u=-1,c=0;i.forEach((h,d)=>{let[f,g]=h,C=g;o.includes(f)||(C=Math.round(g*l)),this.stretchedWidths.set(f,C),u=f,d<i.length-1&&(c+=C)}),this.stretchedWidths.size>1&&this.stretchedWidths.set(u,Math.round(this.viewportWidth-c))}}function NH(t,e,n){Zse(t,e),e.set(t,n)}function Zse(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function xb(t,e){return t.get(S$(t,e))}function ug(t,e,n){return t.set(S$(t,e),n),n}function S$(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var cg=new WeakMap,oh=new WeakMap;class Qse extends b${constructor(){super(...arguments),NH(this,cg,0),NH(this,oh,-1)}prepare(e){super.prepare(e),ug(cg,this,0),ug(oh,this,-1)}setColumnBaseWidth(e,n){super.setColumnBaseWidth(e,n),ug(oh,this,e),ug(cg,this,n)}calculate(){if(xb(oh,this)===-1)return;const e=Array.from(this.baseWidths).reduce((r,i)=>{let[,o]=i;return r+o},0),n=Math.max(this.viewportWidth-e+xb(cg,this),0);this.stretchedWidths.set(xb(oh,this),n)}}function Jse(t,e){R$(t,e),e.add(t)}function hg(t,e,n){R$(t,e),e.set(t,n)}function R$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Vt(t,e){return t.get(Su(t,e))}function Ab(t,e,n){return t.set(Su(t,e),n),n}function Su(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const eae="stretchColumns";var On=new WeakMap,su=new WeakMap,Hb=new WeakMap,dg=new WeakMap,sh=new WeakSet;class tae{constructor(e){Jse(this,sh),hg(this,On,void 0),hg(this,su,void 0),hg(this,Hb,new Map([["all",new Xse(Su(sh,this,DH).bind(this))],["last",new Qse(Su(sh,this,DH).bind(this))]])),hg(this,dg,"none"),Ab(On,this,e),Ab(su,this,Vt(On,this).columnIndexMapper.createAndRegisterIndexMap(eae,"physicalIndexToValue"))}useStrategy(e){Ab(dg,this,Vt(Hb,this).has(e)?e:"none")}refreshStretching(){if(Vt(dg,this)==="none"){Vt(su,this).clear();return}Vt(On,this).batchExecution(()=>{Vt(su,this).clear();const e=Vt(Hb,this).get(Vt(dg,this));let r=Vt(On,this).view.getViewportWidth();Su(sh,this,nae).call(this)&&(r-=vn(Vt(On,this).rootDocument)),e.prepare({viewportWidth:r});for(let i=0;i<Vt(On,this).countCols();i++)Vt(On,this).columnIndexMapper.isHidden(Vt(On,this).toPhysicalColumn(i))||e.setColumnBaseWidth(i,Su(sh,this,rae).call(this,i));e.calculate(),e.getWidths().forEach(i=>{let[o,s]=i;Vt(su,this).setValueAtIndex(Vt(On,this).toPhysicalColumn(o),s)})},!0)}getStretchedWidth(e){return Vt(su,this).getValueAtIndex(Vt(On,this).toPhysicalColumn(e))}}function nae(){const{view:t}=Vt(On,this);if(t.isVerticallyScrollableByWindow())return!1;const e=t.getViewportHeight(),n=Vt(On,this).countRows(),r=t.getStylesHandler().getDefaultRowHeight();let i=0,o=!1;for(let a=0;a<n;a++){var s;if(i+=((s=Vt(On,this).getRowHeight(a))!==null&&s!==void 0?s:r)+(a===0?1:0),i>e){o=!0;break}}return o}function rae(t){var e;return(e=Vt(On,this).getColWidth(t,"StretchColumns"))!==null&&e!==void 0?e:Hu}function DH(t,e){return Vt(On,this).runHooks("beforeStretchingColumnWidth",t,e)}function iae(t,e){E$(t,e),e.add(t)}function Nb(t,e,n){E$(t,e),e.set(t,n)}function E$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Db(t,e,n){return t.set($m(t,e),n),n}function Do(t,e){return t.get($m(t,e))}function $m(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const oae="stretchColumns",sae=155;var pu=new WeakMap,fg=new WeakMap,ah=new WeakMap,kb=new WeakSet;class aae extends Xe{constructor(){super(...arguments),iae(this,kb),Nb(this,pu,new tae(this.hot)),Nb(this,fg,null),Nb(this,ah,new ResizeObserver(e=>{requestAnimationFrame(()=>{var n;(n=this.hot)!==null&&n!==void 0&&n.view.isHorizontallyScrollableByWindow()&&e.forEach(r=>{let{contentRect:i}=r;Do(fg,this)!==null&&Do(fg,this)!==i.width&&(this.hot.refreshDimensions(),this.hot.view.adjustElementsSize()),Db(fg,this,i.width)})})}))}static get PLUGIN_KEY(){return oae}static get PLUGIN_PRIORITY(){return sae}static get SETTING_KEYS(){return!0}isEnabled(){return["all","last"].includes(this.hot.getSettings().stretchH)}enablePlugin(){var e=this;this.enabled||(Do(pu,this).useStrategy(this.hot.getSettings().stretchH),Do(ah,this).observe(this.hot.rootElement),this.addHook("beforeRender",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return $m(kb,e,uae).call(e,...r)}),this.addHook("modifyColWidth",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return $m(kb,e,lae).call(e,...r)},10),super.enablePlugin())}updatePlugin(){Do(pu,this).useStrategy(this.hot.getSettings().stretchH),super.updatePlugin()}disablePlugin(){super.disablePlugin(),Do(ah,this).unobserve(this.hot.rootElement)}getColumnWidth(e){return Do(pu,this).getStretchedWidth(e)}destroy(){Do(ah,this).disconnect(),Db(ah,this,null),Db(pu,this,null),super.destroy()}}function lae(t,e,n){if(n===this.pluginName)return;const r=this.getColumnWidth(e);return typeof r=="number"?r:t}function uae(t){t&&Do(pu,this).refreshStretching()}function cae(t,e){hae(t,e),e.add(t)}function hae(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function gg(t,e,n){return(e=dae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function dae(t){var e=fae(t,"string");return typeof e=="symbol"?e:e+""}function fae(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Lb(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const gae="touchScroll",mae=200;var mg=new WeakSet;class pae extends Xe{constructor(){super(...arguments),cae(this,mg),gg(this,"scrollbars",[]),gg(this,"clones",[]),gg(this,"lockedCollection",!1),gg(this,"freezeOverlays",!1)}static get PLUGIN_KEY(){return gae}static get PLUGIN_PRIORITY(){return mae}static get SETTING_KEYS(){return!0}isEnabled(){return $N()}enablePlugin(){this.enabled||(this.addHook("afterViewRender",()=>Lb(mg,this,wae).call(this)),this.registerEvents(),super.enablePlugin())}updatePlugin(){this.lockedCollection=!1,super.updatePlugin()}disablePlugin(){super.disablePlugin()}registerEvents(){this.addHook("beforeTouchScroll",()=>Lb(mg,this,vae).call(this)),this.addHook("afterMomentumScroll",()=>Lb(mg,this,Cae).call(this))}}function wae(){if(this.lockedCollection)return;const{topOverlay:t,bottomOverlay:e,inlineStartOverlay:n,topInlineStartCornerOverlay:r,bottomInlineStartCornerOverlay:i}=this.hot.view._wt.wtOverlays;this.lockedCollection=!0,this.scrollbars.length=0,this.scrollbars.push(t),e.clone&&this.scrollbars.push(e),this.scrollbars.push(n),r&&this.scrollbars.push(r),i&&i.clone&&this.scrollbars.push(i),this.clones=[],t.needFullRender&&this.clones.push(t.clone.wtTable.holder.parentNode),e.needFullRender&&this.clones.push(e.clone.wtTable.holder.parentNode),n.needFullRender&&this.clones.push(n.clone.wtTable.holder.parentNode),r&&this.clones.push(r.clone.wtTable.holder.parentNode),i&&i.clone&&this.clones.push(i.clone.wtTable.holder.parentNode)}function vae(){this.freezeOverlays=!0,M(this.clones,t=>{G(t,"hide-tween")})}function Cae(){this.freezeOverlays=!1,M(this.clones,t=>{pe(t,"hide-tween"),G(t,"show-tween")}),this.hot._registerTimeout(()=>{M(this.clones,t=>{pe(t,"show-tween")})},400),M(this.scrollbars,t=>{t.refresh(),t.resetFixedPosition()}),this.hot.view._wt.wtOverlays.syncScrollWithMaster()}function yae(t,e){bae(t,e),e.add(t)}function bae(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Sae(t,e,n){return(e=Rae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Rae(t){var e=Eae(t,"string");return typeof e=="symbol"?e:e+""}function Eae(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Tae(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const Wg="trimRows",_ae=330;var kH=new WeakSet;class Mae extends Xe{constructor(){super(...arguments),yae(this,kH),Sae(this,"trimmedRowsMap",null)}static get PLUGIN_KEY(){return Wg}static get PLUGIN_PRIORITY(){return _ae}isEnabled(){return!!this.hot.getSettings()[Wg]}enablePlugin(){this.enabled||(this.trimmedRowsMap=this.hot.rowIndexMapper.registerMap("trimRows",new Rd),this.trimmedRowsMap.addLocalHook("init",()=>Tae(kH,this,Iae).call(this)),super.enablePlugin())}updatePlugin(){const e=this.hot.getSettings()[Wg];Array.isArray(e)&&this.hot.batchExecution(()=>{this.trimmedRowsMap.clear(),M(e,n=>{this.trimmedRowsMap.setValueAtIndex(n,!0)})},!0),super.updatePlugin()}disablePlugin(){this.hot.rowIndexMapper.unregisterMap("trimRows"),super.disablePlugin()}getTrimmedRows(){return this.trimmedRowsMap.getTrimmedIndexes()}trimRows(e){const n=this.getTrimmedRows(),r=this.isValidConfig(e);let i=n;r&&(i=Array.from(new Set(n.concat(e)))),this.hot.runHooks("beforeTrimRow",n,i,r)!==!1&&(r&&this.hot.batchExecution(()=>{M(e,s=>{this.trimmedRowsMap.setValueAtIndex(s,!0)})},!0),this.hot.runHooks("afterTrimRow",n,i,r,r&&i.length>n.length))}trimRow(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.trimRows(n)}untrimRows(e){const n=this.getTrimmedRows(),r=this.isValidConfig(e);let i=n;const o=this.trimmedRowsMap.getValues().slice(),s=e.length>0;r&&s&&(M(e,l=>{o[l]=!1}),i=fr(o,(l,u,c)=>(u&&l.push(c),l),[])),this.hot.runHooks("beforeUntrimRow",n,i,r&&s)!==!1&&(r&&s&&this.trimmedRowsMap.setValues(o),this.hot.runHooks("afterUntrimRow",n,i,r&&s,r&&i.length<n.length))}untrimRow(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.untrimRows(n)}isTrimmed(e){return this.trimmedRowsMap.getValueAtIndex(e)||!1}untrimAll(){this.untrimRows(this.getTrimmedRows())}isValidConfig(e){const n=this.hot.countSourceRows();return e.every(r=>Number.isInteger(r)&&r>=0&&r<n)}destroy(){super.destroy()}}function Iae(){const t=this.hot.getSettings()[Wg];Array.isArray(t)&&this.hot.batchExecution(()=>{M(t,e=>{this.trimmedRowsMap.setValueAtIndex(e,!0)})},!0)}function Pae(t,e,n){return(e=Oae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Oae(t){var e=xae(t,"string");return typeof e=="symbol"?e:e+""}function xae(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class ei{constructor(e){Pae(this,"actionType",""),this.actionType=e}undo(){throw new Error("Not implemented")}redo(){throw new Error("Not implemented")}}function pg(t,e,n){return(e=Aae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Aae(t){var e=Hae(t,"string");return typeof e=="symbol"?e:e+""}function Hae(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class wT extends ei{constructor(e){let{stateBefore:n,range:r,type:i,alignment:o}=e;super("cell_alignment"),pg(this,"stateBefore",void 0),pg(this,"range",void 0),pg(this,"type",void 0),pg(this,"alignment",void 0),this.stateBefore=n,this.range=r,this.type=i,this.alignment=o}static startRegisteringEvents(e,n){e.addHook("beforeCellAlignment",(r,i,o,s)=>{n.done(()=>new wT({stateBefore:r,range:i,type:o,alignment:s}))})}undo(e,n){M(this.range,r=>{r.forAll((i,o)=>{i>=0&&o>=0&&e.setCellMeta(i,o,"className",this.stateBefore[i][o]||" htLeft")})}),e.addHookOnce("afterViewRender",n),e.render()}redo(e,n){Ts(this.range,this.type,this.alignment,(r,i)=>e.getCellMeta(r,i),(r,i,o,s)=>e.setCellMeta(r,i,o,s)),e.addHookOnce("afterViewRender",n),e.render()}}function LH(t,e,n){return(e=Nae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Nae(t){var e=Dae(t,"string");return typeof e=="symbol"?e:e+""}function Dae(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class vT extends ei{constructor(e){let{columns:n,finalIndex:r}=e;super("col_move"),LH(this,"columns",void 0),LH(this,"finalColumnIndex",void 0),this.columns=n.slice(),this.finalColumnIndex=r}static startRegisteringEvents(e,n){e.addHook("beforeColumnMove",(r,i)=>{r!==!1&&n.done(()=>new vT({columns:r,finalIndex:i}))})}undo(e,n){const r=e.getPlugin("manualColumnMove");e.addHookOnce("afterViewRender",n),dT(this.columns,this.finalColumnIndex,e.columnIndexMapper.getNumberOfIndexes()).reverse().forEach(o=>{let{from:s,to:a}=o;s<a&&(a-=1),r.moveColumn(a,s)}),e.render(),e.deselectCell(),e.selectColumns(this.columns[0],this.columns[0]+this.columns.length-1)}redo(e,n){const r=e.getPlugin("manualColumnMove");e.addHookOnce("afterViewRender",n),r.moveColumns(this.columns.slice(),this.finalColumnIndex),e.render(),e.deselectCell(),e.selectColumns(this.finalColumnIndex,this.finalColumnIndex+this.columns.length-1)}}function $H(t,e,n){return(e=kae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function kae(t){var e=Lae(t,"string");return typeof e=="symbol"?e:e+""}function Lae(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class CT extends ei{constructor(e){let{currentSortState:n,newSortState:r}=e;super("col_sort"),$H(this,"previousSortState",void 0),$H(this,"nextSortState",void 0),this.previousSortState=n,this.nextSortState=r}static startRegisteringEvents(e,n){e.addHook("beforeColumnSort",(r,i,o)=>{o&&n.done(()=>new CT({currentSortState:r,newSortState:i}))})}undo(e,n){const r=e.getPlugin("columnSorting"),i=e.getPlugin("multiColumnSorting"),o=i.isEnabled()?i:r;this.previousSortState.length?o.sort(this.previousSortState):o.clearSort(),n()}redo(e,n){const r=e.getPlugin("columnSorting"),i=e.getPlugin("multiColumnSorting");(i.isEnabled()?i:r).sort(this.nextSortState),n()}}function FH(t,e,n){return(e=$ae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function $ae(t){var e=Fae(t,"string");return typeof e=="symbol"?e:e+""}function Fae(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class yT extends ei{constructor(e){let{index:n,amount:r}=e;super("insert_col"),FH(this,"index",void 0),FH(this,"amount",void 0),this.index=n,this.amount=r}static startRegisteringEvents(e,n){e.addHook("afterCreateCol",(r,i,o)=>{n.done(()=>new yT({index:r,amount:i}),o)})}undo(e,n){e.addHookOnce("afterRemoveCol",n),e.alter("remove_col",this.index,this.amount,"UndoRedo.undo")}redo(e,n){e.addHookOnce("afterCreateCol",n),e.alter("insert_col_start",this.index,this.amount,"UndoRedo.redo")}}function VH(t,e,n){return(e=Vae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Vae(t){var e=Wae(t,"string");return typeof e=="symbol"?e:e+""}function Wae(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class bT extends ei{constructor(e){let{index:n,amount:r}=e;super("insert_row"),VH(this,"index",void 0),VH(this,"amount",void 0),this.index=n,this.amount=r}static startRegisteringEvents(e,n){e.addHook("afterCreateRow",(r,i,o)=>{n.done(()=>new bT({index:r,amount:i}),o)})}undo(e,n){const r=e.countRows(),i=e.getSettings().minSpareRows;this.index>=r&&this.index-i<r&&(this.index-=i),e.addHookOnce("afterRemoveRow",n),e.alter("remove_row",this.index,this.amount,"UndoRedo.undo")}redo(e,n){e.addHookOnce("afterCreateRow",n),e.alter("insert_row_above",this.index,this.amount,"UndoRedo.redo")}}function wg(t,e,n){return(e=Bae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Bae(t){var e=jae(t,"string");return typeof e=="symbol"?e:e+""}function jae(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class ST extends ei{constructor(e){let{changes:n,selected:r,countCols:i,countRows:o}=e;super("change"),wg(this,"changes",void 0),wg(this,"selected",void 0),wg(this,"countCols",void 0),wg(this,"countRows",void 0),this.changes=n,this.selected=r,this.countCols=i,this.countRows=o}static startRegisteringEvents(e,n){e.addHook("beforeChange",function(r,i){const o=r&&r.length;if(!o||!r.find(l=>{const[,,u,c]=l;return u!==c}))return;const a=()=>{const l=r.reduce((c,h)=>(c.push([...h]),c),[]);l.forEach(c=>{c[1]=e.propToCol(c[1])});const u=o>1?this.getSelected():[[l[0][0],l[0][1]]];return new ST({changes:l,selected:u,countCols:e.countCols(),countRows:e.countRows()})};n.done(a,i)})}undo(e,n){const r=Gn(this.changes);for(let s=0,a=r.length;s<a;s++)r[s].splice(3,1);e.addHookOnce("afterChange",n),e.setDataAtCell(r,null,null,"UndoRedo.undo");const i=e.countRows()-this.countRows;i>0&&e.alter("remove_row",null,i,"UndoRedo.undo");const o=e.countCols()-this.countCols;o>0&&e.isColumnModificationAllowed()&&e.alter("remove_col",null,o,"UndoRedo.undo"),e.scrollToFocusedCell(),e.selectCells(this.selected,!1,!1)}redo(e,n){const r=Gn(this.changes);for(let i=0,o=r.length;i<o;i++)r[i].splice(2,1);e.addHookOnce("afterChange",n),e.setDataAtCell(r,null,null,"UndoRedo.redo"),this.selected&&e.selectCells(this.selected,!1,!1)}}function WH(t,e,n){return(e=Uae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Uae(t){var e=zae(t,"string");return typeof e=="symbol"?e:e+""}function zae(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class RT extends ei{constructor(e){let{conditionsStack:n,previousConditionsStack:r}=e;super("filter"),WH(this,"conditionsStack",void 0),WH(this,"previousConditionsStack",void 0),this.conditionsStack=n,this.previousConditionsStack=r}static startRegisteringEvents(e,n){e.addHook("beforeFilter",(r,i)=>{n.done(()=>new RT({conditionsStack:r,previousConditionsStack:i}))})}undo(e,n){const r=e.getPlugin("filters");e.addHookOnce("afterViewRender",n),r.importConditions(this.previousConditionsStack),r.filter()}redo(e,n){const r=e.getPlugin("filters");e.addHookOnce("afterViewRender",n),r.importConditions(this.conditionsStack),r.filter()}}function Yae(t,e,n){return(e=Gae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Gae(t){var e=qae(t,"string");return typeof e=="symbol"?e:e+""}function qae(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class ET extends ei{constructor(e){let{data:n,cellRange:r}=e;super("merge_cells"),Yae(this,"cellRange",void 0),this.cellRange=r,this.data=n}static startRegisteringEvents(e,n){e.addHook("beforeMergeCells",(r,i)=>{if(i)return;const o=r.getTopStartCorner(),s=r.getBottomEndCorner(),a=e.getData(o.row,o.col,s.row,s.col);n.done(()=>new ET({data:a,cellRange:r}))})}undo(e,n){const r=e.getPlugin("mergeCells");e.addHookOnce("afterViewRender",n),r.unmergeRange(this.cellRange,!0);const i=this.cellRange.getTopStartCorner();e.populateFromArray(i.row,i.col,this.data,void 0,void 0,"MergeCells")}redo(e,n){const r=e.getPlugin("mergeCells");e.addHookOnce("afterViewRender",n),r.mergeRange(this.cellRange)}}function T$(t,e,n,r,i){const o=["visualRow","visualCol","row","col","prop"],s=o.length,a=[];return de(r,i,l=>{de(e,n,u=>{const c=t.getCellMeta(u,l);if(Object.keys(c).length!==s){const h=Object.fromEntries(Object.entries(c).filter(d=>{let[f]=d;return o.includes(f)===!1}));a.push([c.visualRow,c.visualCol,h])}})}),a}function xo(t,e,n){return(e=Kae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Kae(t){var e=Xae(t,"string");return typeof e=="symbol"?e:e+""}function Xae(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class TT extends ei{constructor(e){let{index:n,indexes:r,data:i,amount:o,headers:s,columnPositions:a,rowPositions:l,fixedColumnsStart:u,removedCellMetas:c}=e;super("remove_col"),xo(this,"index",void 0),xo(this,"indexes",void 0),xo(this,"data",void 0),xo(this,"amount",void 0),xo(this,"headers",void 0),xo(this,"columnPositions",void 0),xo(this,"rowPositions",void 0),xo(this,"fixedColumnsStart",void 0),xo(this,"removedCellMetas",void 0),this.index=n,this.indexes=r,this.data=i,this.amount=o,this.headers=s,this.columnPositions=a.slice(0),this.rowPositions=l.slice(0),this.fixedColumnsStart=u,this.removedCellMetas=c}static startRegisteringEvents(e,n){e.addHook("beforeRemoveCol",(r,i,o,s)=>{const a=()=>{const l=e.getSourceDataArray(),u=(e.countCols()+r)%e.countCols(),c=u+i-1,h=[],d=[],f=[];return de(l.length-1,g=>{const C=[],y=l[g];de(u,c,E=>{C.push(y[e.toPhysicalColumn(E)])}),h.push(C)}),de(i-1,g=>{f.push(e.toPhysicalColumn(u+g))}),Array.isArray(e.getSettings().colHeaders)&&de(i-1,g=>{d.push(e.getSettings().colHeaders[e.toPhysicalColumn(u+g)]||null)}),new TT({index:u,indexes:f,data:h,amount:i,headers:d,columnPositions:e.columnIndexMapper.getIndexesSequence(),rowPositions:e.rowIndexMapper.getIndexesSequence(),fixedColumnsStart:e.getSettings().fixedColumnsStart,removedCellMetas:T$(e,0,e.countRows(),u,c)})};n.done(a,s)})}undo(e,n){const r=e.getSettings();r.fixedColumnsStart=this.fixedColumnsStart;const i=this.indexes.slice(0).sort(),o=(c,h,d)=>d[this.indexes.indexOf(i[h])],s=this.data.length,a=[];for(let c=0;c<s;c++)a.push(Be(this.data[c],o));const l=Be(this.headers,o),u=[];e.columnIndexMapper.setIndexesSequence(this.columnPositions),e.alter("insert_col_start",e.toVisualColumn(this.indexes[0]),this.indexes.length,"UndoRedo.undo"),e.batchExecution(()=>{e.rowIndexMapper.setIndexesSequence(this.rowPositions),e.columnIndexMapper.setIndexesSequence(this.columnPositions)},!0),M(e.getSourceDataArray(),(c,h)=>{M(i,(d,f)=>{c[d]=a[h][f],u.push([h,d,c[d]])})}),typeof this.headers<"u"&&M(l,(c,h)=>{e.getSettings().colHeaders[i[h]]=c}),this.removedCellMetas.forEach(c=>{let[h,d,f]=c;e.setCellMetaObject(h,d,f)}),e.addHookOnce("afterViewRender",n),e.setSourceDataAtCell(u,null,null,"UndoRedo.undo")}redo(e,n){e.addHookOnce("afterRemoveCol",n),e.alter("remove_col",this.index,this.amount,"UndoRedo.redo")}}function au(t,e,n){return(e=Zae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Zae(t){var e=Qae(t,"string");return typeof e=="symbol"?e:e+""}function Qae(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class _T extends ei{constructor(e){let{index:n,data:r,fixedRowsBottom:i,fixedRowsTop:o,rowIndexesSequence:s,removedCellMetas:a}=e;super("remove_row"),au(this,"index",void 0),au(this,"data",void 0),au(this,"fixedRowsBottom",void 0),au(this,"fixedRowsTop",void 0),au(this,"rowIndexesSequence",void 0),au(this,"removedCellMetas",void 0),this.index=n,this.data=r,this.fixedRowsBottom=i,this.fixedRowsTop=o,this.rowIndexesSequence=s,this.removedCellMetas=a}static startRegisteringEvents(e,n){e.addHook("beforeRemoveRow",(r,i,o,s)=>{const a=()=>{const l=e.toPhysicalRow(r),u=l+i-1,c=Gn(e.getSourceData(l,0,l+i-1,e.countSourceCols()-1));return new _T({index:l,data:c,fixedRowsBottom:e.getSettings().fixedRowsBottom,fixedRowsTop:e.getSettings().fixedRowsTop,rowIndexesSequence:e.rowIndexMapper.getIndexesSequence(),removedCellMetas:T$(e,l,u,0,e.countCols()-1)})};n.done(a,s)})}undo(e,n){const r=e.getSettings(),i=[];r.fixedRowsBottom=this.fixedRowsBottom,r.fixedRowsTop=this.fixedRowsTop,this.data.forEach((o,s)=>{Object.keys(o).forEach(a=>{const l=parseInt(a,10);i.push([this.index+s,isNaN(l)?a:l,o[a]])})}),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(o=>{let[s,a,l]=o;e.setCellMetaObject(s,a,l)}),e.addHookOnce("afterViewRender",n),e.setSourceDataAtCell(i,null,null,"UndoRedo.undo")}redo(e,n){e.addHookOnce("afterRemoveRow",n),e.alter("remove_row",e.toVisualRow(this.index),this.data.length,"UndoRedo.redo")}}function BH(t,e,n){return(e=Jae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Jae(t){var e=ele(t,"string");return typeof e=="symbol"?e:e+""}function ele(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class MT extends ei{constructor(e){let{rows:n,finalIndex:r}=e;super("row_move"),BH(this,"rows",void 0),BH(this,"finalRowIndex",void 0),this.rows=n.slice(),this.finalRowIndex=r}static startRegisteringEvents(e,n){e.addHook("beforeRowMove",(r,i)=>{r!==!1&&n.done(()=>new MT({rows:r,finalIndex:i}))})}undo(e,n){const r=e.getPlugin("manualRowMove");e.addHookOnce("afterViewRender",n),dT(this.rows,this.finalRowIndex,e.rowIndexMapper.getNumberOfIndexes()).reverse().forEach(o=>{let{from:s,to:a}=o;s<a&&(a-=1),r.moveRow(a,s)}),e.render(),e.deselectCell(),e.selectRows(this.rows[0],this.rows[0]+this.rows.length-1)}redo(e,n){const r=e.getPlugin("manualRowMove");e.addHookOnce("afterViewRender",n),r.moveRows(this.rows.slice(),this.finalRowIndex),e.render(),e.deselectCell(),e.selectRows(this.finalRowIndex,this.finalRowIndex+this.rows.length-1)}}function tle(t,e,n){return(e=nle(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function nle(t){var e=rle(t,"string");return typeof e=="symbol"?e:e+""}function rle(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class IT extends ei{constructor(e){let{cellRange:n}=e;super("unmerge_cells"),tle(this,"cellRange",void 0),this.cellRange=n}static startRegisteringEvents(e,n){e.addHook("afterUnmergeCells",(r,i)=>{i||n.done(()=>new IT({cellRange:r}))})}undo(e,n){const r=e.getPlugin("mergeCells");e.addHookOnce("afterViewRender",n),r.mergeRange(this.cellRange,!0)}redo(e,n){const r=e.getPlugin("mergeCells");e.addHookOnce("afterViewRender",n),r.unmergeRange(this.cellRange,!0),e.render()}}function ile(t,e){[wT,vT,CT,yT,bT,ST,RT,ET,TT,_T,MT,IT].forEach(n=>n.startRegisteringEvents(t,e))}function ole(t,e){sle(t,e),e.add(t)}function sle(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function $b(t,e,n){return(e=ale(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ale(t){var e=lle(t,"string");return typeof e=="symbol"?e:e+""}function lle(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Fb(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const jH="undoRedo",ule="undoRedo",cle=1e3;re.getSingleton().register("beforeUndo");re.getSingleton().register("afterUndo");re.getSingleton().register("beforeRedo");re.getSingleton().register("afterRedo");const UH=new Set;var vg=new WeakSet;class hle extends Xe{static get PLUGIN_KEY(){return ule}static get PLUGIN_PRIORITY(){return cle}static get SETTING_KEYS(){return!0}constructor(e){super(e),ole(this,vg),$b(this,"doneActions",[]),$b(this,"undoneActions",[]),$b(this,"ignoreNewActions",!1),ile(e,this)}isEnabled(){return!!this.hot.getSettings().undo}enablePlugin(){var e=this;this.enabled||(this.addHook("afterChange",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Fb(vg,e,dle).call(e,...r)}),this.registerShortcuts(),Fb(vg,this,fle).call(this),super.enablePlugin())}disablePlugin(){super.disablePlugin(),this.clear(),this.unregisterShortcuts(),Fb(vg,this,gle).call(this)}registerShortcuts(){const n=this.hot.getShortcutManager().getContext("grid"),i={runOnlyIf:o=>!o.altKey,group:jH};n.addShortcuts([{keys:[["Control/Meta","z"]],callback:()=>{this.undo()}},{keys:[["Control/Meta","y"],["Control/Meta","Shift","z"]],callback:()=>{this.redo()}}],i)}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(jH)}done(e,n){if(this.ignoreNewActions||n==="UndoRedo.undo"||n==="UndoRedo.redo"||n==="auto")return;const i=this.doneActions.slice();if(this.hot.runHooks("beforeUndoStackChange",i,n)===!1)return;const s=e(),a=this.undoneActions.slice();this.doneActions.push(s),this.hot.runHooks("afterUndoStackChange",i,this.doneActions.slice()),this.hot.runHooks("beforeRedoStackChange",a),this.undoneActions.length=0,this.hot.runHooks("afterRedoStackChange",a,this.undoneActions.slice())}undo(){if(!this.isUndoAvailable())return;const e=this.doneActions.slice();this.hot.runHooks("beforeUndoStackChange",e);const n=this.doneActions.pop();this.hot.runHooks("afterUndoStackChange",e,this.doneActions.slice());const r=Gn(n);if(this.hot.runHooks("beforeUndo",r)===!1)return;this.ignoreNewActions=!0;const o=this.undoneActions.slice();this.hot.runHooks("beforeRedoStackChange",o),n.undo(this.hot,()=>{this.ignoreNewActions=!1,this.undoneActions.push(n)}),this.hot.runHooks("afterRedoStackChange",o,this.undoneActions.slice()),this.hot.runHooks("afterUndo",r)}redo(){if(!this.isRedoAvailable())return;const e=this.undoneActions.slice();this.hot.runHooks("beforeRedoStackChange",e);const n=this.undoneActions.pop();this.hot.runHooks("afterRedoStackChange",e,this.undoneActions.slice());const r=Gn(n);if(this.hot.runHooks("beforeRedo",r)===!1)return;this.ignoreNewActions=!0;const o=this.doneActions.slice();this.hot.runHooks("beforeUndoStackChange",o),n.redo(this.hot,()=>{this.ignoreNewActions=!1,this.doneActions.push(n)}),this.hot.runHooks("afterUndoStackChange",o,this.doneActions.slice()),this.hot.runHooks("afterRedo",r)}isUndoAvailable(){return this.doneActions.length>0}isRedoAvailable(){return this.undoneActions.length>0}clear(){this.doneActions.length=0,this.undoneActions.length=0}destroy(){this.clear(),this.doneActions=null,this.undoneActions=null,super.destroy()}}function dle(t,e){e==="loadData"&&this.clear()}function fle(){const t=e=>{UH.has(e)||(Ze(nt`The "${e}" method is deprecated and it will be removed\x20
|
|
280
|
+
from the Core API in the future. Please use the method from the UndoRedo plugin\x20
|
|
281
|
+
(e.g. \`hotInstance.getPlugin("undoRedo").${e}()\`).`),UH.add(e))};this.hot.undo=()=>{t("undo"),this.undo()},this.hot.redo=()=>{t("redo"),this.redo()},this.hot.isUndoAvailable=()=>(t("isUndoAvailable"),this.isUndoAvailable()),this.hot.isRedoAvailable=()=>(t("isRedoAvailable"),this.isRedoAvailable()),this.hot.clearUndo=()=>{t("clear"),this.clear()},this.hot.undoRedo=this}function gle(){delete this.hot.undo,delete this.hot.redo,delete this.hot.isUndoAvailable,delete this.hot.isRedoAvailable,delete this.hot.clearUndo,delete this.hot.undoRedo}function mle(){ze(Sh),ze(P8),ze(Rh),ze(s7),ze(g7),ze(Gk),ze(u5),ze(G5),ze(Pp),ze(nQ),ze(IQ),ze(kQ),ze(Ap),ze(vJ),ze(fte),ze(Yte),ze(Cne),ze(xne),ze(jne),ze(ere),ze(cre),ze(Ire),ze(Lre),ze(yie),ze(Qie),ze(roe),ze(Poe),ze(mse),ze($se),ze(Gse),ze(aae),ze(pae),ze(Mae),ze(hle)}function Dle(){J4(),S6(),x6(),Z6(),mle()}export{$E as $,e0 as A,JE as B,QE as C,ZE as D,XE as E,E0 as F,dp as G,KE as H,qE as I,GE as J,YE as K,zE as L,UE as M,bE as N,wE as O,TE as P,EE as Q,zH as R,PE as S,IE as T,ME as U,_E as V,jE as W,BE as X,WE as Y,VE as Z,FE as _,R0 as a,RE as a0,SE as a1,LE as a2,kE as a3,DE as a4,NE as a5,HE as a6,AE as a7,xE as a8,OE as a9,pE as aa,em as ab,mE as ac,gE as ad,fE as ae,dE as af,hE as ag,cE as ah,uE as ai,lE as aj,yE as ak,CE as al,vE as am,M0 as an,_0 as ao,aE as ap,Dle as aq,HD as ar,S4 as as,xD as at,g4 as au,S0 as b,b0 as c,y0 as d,C0 as e,v0 as f,fp as g,w0 as h,p0 as i,m0 as j,tm as k,g0 as l,f0 as m,d0 as n,h0 as o,c0 as p,u0 as q,N$ as r,l0 as s,a0 as t,s0 as u,o0 as v,i0 as w,r0 as x,n0 as y,t0 as z};
|