file-viewer-demo/public/dist/assets/XlsxTable-0a398d95.js
2024-01-30 08:54:29 +08:00

103 lines
987 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{c as fh,d as FS,m as BN,a as Uu,b as Yu,e as UN,r as Rl,g as YN,f as GN,h as zN,w as jN,o as KN,u as TR,i as XN,j as qN,k as mf,l as ZN,F as QN,n as JN,p as eL,q as tL,s as nL,t as rL,v as iL,_ as oL}from"./index-be50c070.js";import{r as bI}from"./worker-ref-b3abaee8.js";import{c as gh}from"./_commonjs-dynamic-modules-302442b1.js";const sL=""+new URL("xlsx-08add3c8.png",import.meta.url).href,aL=""+new URL("loading-43b144a3.gif",import.meta.url).href;var Zl=function(t){return t&&t.Math===Math&&t},_n=Zl(typeof globalThis=="object"&&globalThis)||Zl(typeof window=="object"&&window)||Zl(typeof self=="object"&&self)||Zl(typeof fh=="object"&&fh)||Zl(typeof fh=="object"&&fh)||function(){return this}()||Function("return this")(),WS={},Hr=function(t){try{return!!t()}catch{return!0}},lL=Hr,Ni=!lL(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),uL=Hr,hg=!uL(function(){var t=(function(){}).bind();return typeof t!="function"||t.hasOwnProperty("prototype")}),cL=hg,mh=Function.prototype.call,pa=cL?mh.bind(mh):function(){return mh.apply(mh,arguments)},RI={},EI={}.propertyIsEnumerable,TI=Object.getOwnPropertyDescriptor,hL=TI&&!EI.call({1:2},1);RI.f=hL?function(e){var n=TI(this,e);return!!n&&n.enumerable}:EI;var dg=function(t,e){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:e}},_I=hg,MI=Function.prototype,vC=MI.call,dL=_I&&MI.bind.bind(vC,vC),Un=_I?dL:function(t){return function(){return vC.apply(t,arguments)}},AI=Un,fL=AI({}.toString),gL=AI("".slice),$l=function(t){return gL(fL(t),8,-1)},mL=Un,pL=Hr,wL=$l,Hp=Object,vL=mL("".split),CL=pL(function(){return!Hp("z").propertyIsEnumerable(0)})?function(t){return wL(t)==="String"?vL(t,""):Hp(t)}:Hp,VS=function(t){return t==null},SL=VS,yL=TypeError,OI=function(t){if(SL(t))throw new yL("Can't call method on "+t);return t},bL=CL,RL=OI,fg=function(t){return bL(RL(t))},Dp=typeof document=="object"&&document.all,Mn=typeof Dp>"u"&&Dp!==void 0?function(t){return typeof t=="function"||t===Dp}:function(t){return typeof t=="function"},EL=Mn,ws=function(t){return typeof t=="object"?t!==null:EL(t)},Np=_n,TL=Mn,_L=function(t){return TL(t)?t:void 0},kc=function(t,e){return arguments.length<2?_L(Np[t]):Np[t]&&Np[t][e]},ML=Un,BS=ML({}.isPrototypeOf),US=typeof navigator<"u"&&String(navigator.userAgent)||"",II=_n,Lp=US,_R=II.process,MR=II.Deno,AR=_R&&_R.versions||MR&&MR.version,OR=AR&&AR.v8,Qr,pf;OR&&(Qr=OR.split("."),pf=Qr[0]>0&&Qr[0]<4?1:+(Qr[0]+Qr[1]));!pf&&Lp&&(Qr=Lp.match(/Edge\/(\d+)/),(!Qr||Qr[1]>=74)&&(Qr=Lp.match(/Chrome\/(\d+)/),Qr&&(pf=+Qr[1])));var AL=pf,IR=AL,OL=Hr,IL=_n,PL=IL.String,YS=!!Object.getOwnPropertySymbols&&!OL(function(){var t=Symbol("symbol detection");return!PL(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&IR&&IR<41}),xL=YS,PI=xL&&!Symbol.sham&&typeof Symbol.iterator=="symbol",HL=kc,DL=Mn,NL=BS,LL=PI,$L=Object,GS=LL?function(t){return typeof t=="symbol"}:function(t){var e=HL("Symbol");return DL(e)&&NL(e.prototype,$L(t))},kL=String,gg=function(t){try{return kL(t)}catch{return"Object"}},FL=Mn,WL=gg,VL=TypeError,mg=function(t){if(FL(t))return t;throw new VL(WL(t)+" is not a function")},BL=mg,UL=VS,zS=function(t,e){var n=t[e];return UL(n)?void 0:BL(n)},$p=pa,kp=Mn,Fp=ws,YL=TypeError,GL=function(t,e){var n,r;if(e==="string"&&kp(n=t.toString)&&!Fp(r=$p(n,t))||kp(n=t.valueOf)&&!Fp(r=$p(n,t))||e!=="string"&&kp(n=t.toString)&&!Fp(r=$p(n,t)))return r;throw new YL("Can't convert object to primitive value")},xI={exports:{}},PR=_n,zL=Object.defineProperty,jS=function(t,e){try{zL(PR,t,{value:e,configurable:!0,writable:!0})}catch{PR[t]=e}return e},jL=_n,KL=jS,xR="__core-js_shared__",XL=jL[xR]||KL(xR,{}),KS=XL,HR=KS;(xI.exports=function(t,e){return HR[t]||(HR[t]=e!==void 0?e:{})})("versions",[]).push({version:"3.35.1",mode:"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.35.1/LICENSE",source:"https://github.com/zloirock/core-js"});var HI=xI.exports,qL=OI,ZL=Object,pg=function(t){return ZL(qL(t))},QL=Un,JL=pg,e$=QL({}.hasOwnProperty),yo=Object.hasOwn||function(e,n){return e$(JL(e),n)},t$=Un,n$=0,r$=Math.random(),i$=t$(1 .toString),DI=function(t){return"Symbol("+(t===void 0?"":t)+")_"+i$(++n$+r$,36)},o$=_n,s$=HI,DR=yo,a$=DI,l$=YS,u$=PI,vl=o$.Symbol,Wp=s$("wks"),c$=u$?vl.for||vl:vl&&vl.withoutSetter||a$,kl=function(t){return DR(Wp,t)||(Wp[t]=l$&&DR(vl,t)?vl[t]:c$("Symbol."+t)),Wp[t]},h$=pa,NR=ws,LR=GS,d$=zS,f$=GL,g$=kl,m$=TypeError,p$=g$("toPrimitive"),w$=function(t,e){if(!NR(t)||LR(t))return t;var n=d$(t,p$),r;if(n){if(e===void 0&&(e="default"),r=h$(n,t,e),!NR(r)||LR(r))return r;throw new m$("Can't convert object to primitive value")}return e===void 0&&(e="number"),f$(t,e)},v$=w$,C$=GS,XS=function(t){var e=v$(t,"string");return C$(e)?e:e+""},S$=_n,$R=ws,CC=S$.document,y$=$R(CC)&&$R(CC.createElement),qS=function(t){return y$?CC.createElement(t):{}},b$=Ni,R$=Hr,E$=qS,NI=!b$&&!R$(function(){return Object.defineProperty(E$("div"),"a",{get:function(){return 7}}).a!==7}),T$=Ni,_$=pa,M$=RI,A$=dg,O$=fg,I$=XS,P$=yo,x$=NI,kR=Object.getOwnPropertyDescriptor;WS.f=T$?kR:function(e,n){if(e=O$(e),n=I$(n),x$)try{return kR(e,n)}catch{}if(P$(e,n))return A$(!_$(M$.f,e,n),e[n])};var vs={},H$=Ni,D$=Hr,LI=H$&&D$(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),N$=ws,L$=String,$$=TypeError,Cs=function(t){if(N$(t))return t;throw new $$(L$(t)+" is not an object")},k$=Ni,F$=NI,W$=LI,ph=Cs,FR=XS,V$=TypeError,Vp=Object.defineProperty,B$=Object.getOwnPropertyDescriptor,Bp="enumerable",Up="configurable",Yp="writable";vs.f=k$?W$?function(e,n,r){if(ph(e),n=FR(n),ph(r),typeof e=="function"&&n==="prototype"&&"value"in r&&Yp in r&&!r[Yp]){var i=B$(e,n);i&&i[Yp]&&(e[n]=r.value,r={configurable:Up in r?r[Up]:i[Up],enumerable:Bp in r?r[Bp]:i[Bp],writable:!1})}return Vp(e,n,r)}:Vp:function(e,n,r){if(ph(e),n=FR(n),ph(r),F$)try{return Vp(e,n,r)}catch{}if("get"in r||"set"in r)throw new V$("Accessors not supported");return"value"in r&&(e[n]=r.value),e};var U$=Ni,Y$=vs,G$=dg,Fc=U$?function(t,e,n){return Y$.f(t,e,G$(1,n))}:function(t,e,n){return t[e]=n,t},$I={exports:{}},SC=Ni,z$=yo,kI=Function.prototype,j$=SC&&Object.getOwnPropertyDescriptor,ZS=z$(kI,"name"),K$=ZS&&(function(){}).name==="something",X$=ZS&&(!SC||SC&&j$(kI,"name").configurable),q$={EXISTS:ZS,PROPER:K$,CONFIGURABLE:X$},Z$=Un,Q$=Mn,yC=KS,J$=Z$(Function.toString);Q$(yC.inspectSource)||(yC.inspectSource=function(t){return J$(t)});var ek=yC.inspectSource,tk=_n,nk=Mn,WR=tk.WeakMap,rk=nk(WR)&&/native code/.test(String(WR)),ik=HI,ok=DI,VR=ik("keys"),FI=function(t){return VR[t]||(VR[t]=ok(t))},QS={},sk=rk,WI=_n,ak=ws,lk=Fc,Gp=yo,zp=KS,uk=FI,ck=QS,BR="Object already initialized",bC=WI.TypeError,hk=WI.WeakMap,wf,Cc,vf,dk=function(t){return vf(t)?Cc(t):wf(t,{})},fk=function(t){return function(e){var n;if(!ak(e)||(n=Cc(e)).type!==t)throw new bC("Incompatible receiver, "+t+" required");return n}};if(sk||zp.state){var li=zp.state||(zp.state=new hk);li.get=li.get,li.has=li.has,li.set=li.set,wf=function(t,e){if(li.has(t))throw new bC(BR);return e.facade=t,li.set(t,e),e},Cc=function(t){return li.get(t)||{}},vf=function(t){return li.has(t)}}else{var Ea=uk("state");ck[Ea]=!0,wf=function(t,e){if(Gp(t,Ea))throw new bC(BR);return e.facade=t,lk(t,Ea,e),e},Cc=function(t){return Gp(t,Ea)?t[Ea]:{}},vf=function(t){return Gp(t,Ea)}}var gk={set:wf,get:Cc,has:vf,enforce:dk,getterFor:fk},JS=Un,mk=Hr,pk=Mn,wh=yo,RC=Ni,wk=q$.CONFIGURABLE,vk=ek,VI=gk,Ck=VI.enforce,Sk=VI.get,UR=String,Vd=Object.defineProperty,yk=JS("".slice),bk=JS("".replace),Rk=JS([].join),Ek=RC&&!mk(function(){return Vd(function(){},"length",{value:8}).length!==8}),Tk=String(String).split("String"),_k=$I.exports=function(t,e,n){yk(UR(e),0,7)==="Symbol("&&(e="["+bk(UR(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),n&&n.getter&&(e="get "+e),n&&n.setter&&(e="set "+e),(!wh(t,"name")||wk&&t.name!==e)&&(RC?Vd(t,"name",{value:e,configurable:!0}):t.name=e),Ek&&n&&wh(n,"arity")&&t.length!==n.arity&&Vd(t,"length",{value:n.arity});try{n&&wh(n,"constructor")&&n.constructor?RC&&Vd(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch{}var r=Ck(t);return wh(r,"source")||(r.source=Rk(Tk,typeof e=="string"?e:"")),t};Function.prototype.toString=_k(function(){return pk(this)&&Sk(this).source||vk(this)},"toString");var Mk=$I.exports,Ak=Mn,Ok=vs,Ik=Mk,Pk=jS,xk=function(t,e,n,r){r||(r={});var i=r.enumerable,o=r.name!==void 0?r.name:e;if(Ak(n)&&Ik(n,o,r),r.global)i?t[e]=n:Pk(e,n);else{try{r.unsafe?t[e]&&(i=!0):delete t[e]}catch{}i?t[e]=n:Ok.f(t,e,{value:n,enumerable:!1,configurable:!r.nonConfigurable,writable:!r.nonWritable})}return t},BI={},Hk=Math.ceil,Dk=Math.floor,Nk=Math.trunc||function(e){var n=+e;return(n>0?Dk:Hk)(n)},Lk=Nk,ey=function(t){var e=+t;return e!==e||e===0?0:Lk(e)},$k=ey,kk=Math.max,Fk=Math.min,Wk=function(t,e){var n=$k(t);return n<0?kk(n+e,0):Fk(n,e)},Vk=ey,Bk=Math.min,Uk=function(t){var e=Vk(t);return e>0?Bk(e,9007199254740991):0},Yk=Uk,Wc=function(t){return Yk(t.length)},Gk=fg,zk=Wk,jk=Wc,YR=function(t){return function(e,n,r){var i=Gk(e),o=jk(i),s=zk(r,o),a;if(t&&n!==n){for(;o>s;)if(a=i[s++],a!==a)return!0}else for(;o>s;s++)if((t||s in i)&&i[s]===n)return t||s||0;return!t&&-1}},Kk={includes:YR(!0),indexOf:YR(!1)},Xk=Un,jp=yo,qk=fg,Zk=Kk.indexOf,Qk=QS,GR=Xk([].push),UI=function(t,e){var n=qk(t),r=0,i=[],o;for(o in n)!jp(Qk,o)&&jp(n,o)&&GR(i,o);for(;e.length>r;)jp(n,o=e[r++])&&(~Zk(i,o)||GR(i,o));return i},ty=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Jk=UI,eF=ty,tF=eF.concat("length","prototype");BI.f=Object.getOwnPropertyNames||function(e){return Jk(e,tF)};var YI={};YI.f=Object.getOwnPropertySymbols;var nF=kc,rF=Un,iF=BI,oF=YI,sF=Cs,aF=rF([].concat),lF=nF("Reflect","ownKeys")||function(e){var n=iF.f(sF(e)),r=oF.f;return r?aF(n,r(e)):n},zR=yo,uF=lF,cF=WS,hF=vs,GI=function(t,e,n){for(var r=uF(e),i=hF.f,o=cF.f,s=0;s<r.length;s++){var a=r[s];!zR(t,a)&&!(n&&zR(n,a))&&i(t,a,o(e,a))}},dF=Hr,fF=Mn,gF=/#|\.prototype\./,Vc=function(t,e){var n=pF[mF(t)];return n===vF?!0:n===wF?!1:fF(e)?dF(e):!!e},mF=Vc.normalize=function(t){return String(t).replace(gF,".").toLowerCase()},pF=Vc.data={},wF=Vc.NATIVE="N",vF=Vc.POLYFILL="P",CF=Vc,vh=_n,SF=WS.f,yF=Fc,bF=xk,RF=jS,EF=GI,TF=CF,Ss=function(t,e){var n=t.target,r=t.global,i=t.stat,o,s,a,l,u,c;if(r?s=vh:i?s=vh[n]||RF(n,{}):s=vh[n]&&vh[n].prototype,s)for(a in e){if(u=e[a],t.dontCallGetSet?(c=SF(s,a),l=c&&c.value):l=s[a],o=TF(r?a:n+(i?".":"#")+a,t.forced),!o&&l!==void 0){if(typeof u==typeof l)continue;EF(u,l)}(t.sham||l&&l.sham)&&yF(u,"sham",!0),bF(s,a,u,t)}},_F=$l,zI=Array.isArray||function(e){return _F(e)==="Array"},MF=Ni,AF=zI,OF=TypeError,IF=Object.getOwnPropertyDescriptor,PF=MF&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}(),jI=PF?function(t,e){if(AF(t)&&!IF(t,"length").writable)throw new OF("Cannot set read only .length");return t.length=e}:function(t,e){return t.length=e},xF=TypeError,HF=9007199254740991,KI=function(t){if(t>HF)throw xF("Maximum allowed index exceeded");return t},DF=Ss,NF=pg,LF=Wc,$F=jI,kF=KI,FF=Hr,WF=FF(function(){return[].push.call({length:4294967296},1)!==4294967297}),VF=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(t){return t instanceof TypeError}},BF=WF||!VF();DF({target:"Array",proto:!0,arity:1,forced:BF},{push:function(e){var n=NF(this),r=LF(n),i=arguments.length;kF(r+i);for(var o=0;o<i;o++)n[r]=arguments[o],r++;return $F(n,r),r}});var UF=hg,XI=Function.prototype,jR=XI.apply,KR=XI.call,wg=typeof Reflect=="object"&&Reflect.apply||(UF?KR.bind(jR):function(){return KR.apply(jR,arguments)}),YF=Un,GF=mg,zF=function(t,e,n){try{return YF(GF(Object.getOwnPropertyDescriptor(t,e)[n]))}catch{}},jF=ws,KF=function(t){return jF(t)||t===null},XF=KF,qF=String,ZF=TypeError,QF=function(t){if(XF(t))return t;throw new ZF("Can't set "+qF(t)+" as a prototype")},JF=zF,eW=Cs,tW=QF,qI=Object.setPrototypeOf||("__proto__"in{}?function(){var t=!1,e={},n;try{n=JF(Object.prototype,"__proto__","set"),n(e,[]),t=e instanceof Array}catch{}return function(i,o){return eW(i),tW(o),t?n(i,o):i.__proto__=o,i}}():void 0),nW=vs.f,rW=function(t,e,n){n in t||nW(t,n,{configurable:!0,get:function(){return e[n]},set:function(r){e[n]=r}})},iW=Mn,oW=ws,XR=qI,sW=function(t,e,n){var r,i;return XR&&iW(r=e.constructor)&&r!==n&&oW(i=r.prototype)&&i!==n.prototype&&XR(t,i),t},aW=kl,lW=aW("toStringTag"),ZI={};ZI[lW]="z";var uW=String(ZI)==="[object z]",cW=uW,hW=Mn,Bd=$l,dW=kl,fW=dW("toStringTag"),gW=Object,mW=Bd(function(){return arguments}())==="Arguments",pW=function(t,e){try{return t[e]}catch{}},QI=cW?Bd:function(t){var e,n,r;return t===void 0?"Undefined":t===null?"Null":typeof(n=pW(e=gW(t),fW))=="string"?n:mW?Bd(e):(r=Bd(e))==="Object"&&hW(e.callee)?"Arguments":r},wW=QI,vW=String,JI=function(t){if(wW(t)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return vW(t)},CW=JI,SW=function(t,e){return t===void 0?arguments.length<2?"":e:CW(t)},yW=ws,bW=Fc,RW=function(t,e){yW(e)&&"cause"in e&&bW(t,"cause",e.cause)},EW=Un,eP=Error,TW=EW("".replace),_W=function(t){return String(new eP(t).stack)}("zxcasd"),tP=/\n\s*at [^:]*:[^\n]*/,MW=tP.test(_W),AW=function(t,e){if(MW&&typeof t=="string"&&!eP.prepareStackTrace)for(;e--;)t=TW(t,tP,"");return t},OW=Hr,IW=dg,PW=!OW(function(){var t=new Error("a");return"stack"in t?(Object.defineProperty(t,"stack",IW(1,7)),t.stack!==7):!0}),xW=Fc,HW=AW,DW=PW,qR=Error.captureStackTrace,NW=function(t,e,n,r){DW&&(qR?qR(t,e):xW(t,"stack",HW(n,r)))},ZR=kc,LW=yo,QR=Fc,$W=BS,JR=qI,eE=GI,tE=rW,kW=sW,FW=SW,WW=RW,VW=NW,BW=Ni,UW=function(t,e,n,r){var i="stackTraceLimit",o=r?2:1,s=t.split("."),a=s[s.length-1],l=ZR.apply(null,s);if(l){var u=l.prototype;if(LW(u,"cause")&&delete u.cause,!n)return l;var c=ZR("Error"),h=e(function(d,g){var p=FW(r?g:d,void 0),v=r?new l(d):new l;return p!==void 0&&QR(v,"message",p),VW(v,h,v.stack,2),this&&$W(u,this)&&kW(v,this,h),arguments.length>o&&WW(v,arguments[o]),v});h.prototype=u,a!=="Error"?JR?JR(h,c):eE(h,c,{name:!0}):BW&&i in l&&(tE(h,l,i),tE(h,l,"prepareStackTrace")),eE(h,l);try{u.name!==a&&QR(u,"name",a),u.constructor=h}catch{}return h}},nP=Ss,YW=_n,Li=wg,rP=UW,EC="WebAssembly",nE=YW[EC],Cf=new Error("e",{cause:7}).cause!==7,wa=function(t,e){var n={};n[t]=rP(t,e,Cf),nP({global:!0,constructor:!0,arity:1,forced:Cf},n)},ny=function(t,e){if(nE&&nE[t]){var n={};n[t]=rP(EC+"."+t,e,Cf),nP({target:EC,stat:!0,constructor:!0,arity:1,forced:Cf},n)}};wa("Error",function(t){return function(n){return Li(t,this,arguments)}});wa("EvalError",function(t){return function(n){return Li(t,this,arguments)}});wa("RangeError",function(t){return function(n){return Li(t,this,arguments)}});wa("ReferenceError",function(t){return function(n){return Li(t,this,arguments)}});wa("SyntaxError",function(t){return function(n){return Li(t,this,arguments)}});wa("TypeError",function(t){return function(n){return Li(t,this,arguments)}});wa("URIError",function(t){return function(n){return Li(t,this,arguments)}});ny("CompileError",function(t){return function(n){return Li(t,this,arguments)}});ny("LinkError",function(t){return function(n){return Li(t,this,arguments)}});ny("RuntimeError",function(t){return function(n){return Li(t,this,arguments)}});var GW=$l,zW=Un,jW=function(t){if(GW(t)==="Function")return zW(t)},rE=jW,KW=mg,XW=hg,qW=rE(rE.bind),iP=function(t,e){return KW(t),e===void 0?t:XW?qW(t,e):function(){return t.apply(e,arguments)}},ZW=kc,oP=ZW("document","documentElement"),QW=Un,ry=QW([].slice),JW=TypeError,sP=function(t,e){if(t<e)throw new JW("Not enough arguments");return t},eV=US,tV=/(?:ipad|iphone|ipod).*applewebkit/i.test(eV),nV=_n,rV=$l,iV=rV(nV.process)==="process",mr=_n,oV=wg,sV=iP,iE=Mn,aV=yo,aP=Hr,oE=oP,lV=ry,sE=qS,uV=sP,cV=tV,hV=iV,TC=mr.setImmediate,_C=mr.clearImmediate,dV=mr.process,Kp=mr.Dispatch,fV=mr.Function,aE=mr.MessageChannel,gV=mr.String,Xp=0,Zu={},lE="onreadystatechange",Sc,Rs,qp,Zp;aP(function(){Sc=mr.location});var iy=function(t){if(aV(Zu,t)){var e=Zu[t];delete Zu[t],e()}},Qp=function(t){return function(){iy(t)}},uE=function(t){iy(t.data)},cE=function(t){mr.postMessage(gV(t),Sc.protocol+"//"+Sc.host)};(!TC||!_C)&&(TC=function(e){uV(arguments.length,1);var n=iE(e)?e:fV(e),r=lV(arguments,1);return Zu[++Xp]=function(){oV(n,void 0,r)},Rs(Xp),Xp},_C=function(e){delete Zu[e]},hV?Rs=function(t){dV.nextTick(Qp(t))}:Kp&&Kp.now?Rs=function(t){Kp.now(Qp(t))}:aE&&!cV?(qp=new aE,Zp=qp.port2,qp.port1.onmessage=uE,Rs=sV(Zp.postMessage,Zp)):mr.addEventListener&&iE(mr.postMessage)&&!mr.importScripts&&Sc&&Sc.protocol!=="file:"&&!aP(cE)?(Rs=cE,mr.addEventListener("message",uE,!1)):lE in sE("script")?Rs=function(t){oE.appendChild(sE("script"))[lE]=function(){oE.removeChild(this),iy(t)}}:Rs=function(t){setTimeout(Qp(t),0)});var lP={set:TC,clear:_C},mV=Ss,pV=_n,hE=lP.clear;mV({global:!0,bind:!0,enumerable:!0,forced:pV.clearImmediate!==hE},{clearImmediate:hE});var wV=typeof Bun=="function"&&Bun&&typeof Bun.version=="string",uP=_n,vV=wg,CV=Mn,SV=wV,yV=US,bV=ry,RV=sP,EV=uP.Function,TV=/MSIE .\./.test(yV)||SV&&function(){var t=uP.Bun.version.split(".");return t.length<3||t[0]==="0"&&(t[1]<3||t[1]==="3"&&t[2]==="0")}(),_V=function(t,e){var n=e?2:1;return TV?function(r,i){var o=RV(arguments.length,1)>n,s=CV(r)?r:EV(r),a=o?bV(arguments,n):[],l=o?function(){vV(s,this,a)}:s;return e?t(l,i):t(l)}:t},MV=Ss,cP=_n,dE=lP.set,AV=_V,fE=cP.setImmediate?AV(dE,!1):dE;MV({global:!0,bind:!0,enumerable:!0,forced:cP.setImmediate!==fE},{setImmediate:fE});/*! @license DOMPurify 2.4.7 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.4.7/LICENSE */function jo(t){"@babel/helpers - typeof";return jo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},jo(t)}function MC(t,e){return MC=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},MC(t,e)}function OV(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ud(t,e,n){return OV()?Ud=Reflect.construct:Ud=function(i,o,s){var a=[null];a.push.apply(a,o);var l=Function.bind.apply(i,a),u=new l;return s&&MC(u,s.prototype),u},Ud.apply(null,arguments)}function jr(t){return IV(t)||PV(t)||xV(t)||HV()}function IV(t){if(Array.isArray(t))return AC(t)}function PV(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function xV(t,e){if(t){if(typeof t=="string")return AC(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return AC(t,e)}}function AC(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function HV(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var DV=Object.hasOwnProperty,gE=Object.setPrototypeOf,NV=Object.isFrozen,LV=Object.getPrototypeOf,$V=Object.getOwnPropertyDescriptor,Bn=Object.freeze,ni=Object.seal,kV=Object.create,hP=typeof Reflect<"u"&&Reflect,Sf=hP.apply,OC=hP.construct;Sf||(Sf=function(e,n,r){return e.apply(n,r)});Bn||(Bn=function(e){return e});ni||(ni=function(e){return e});OC||(OC=function(e,n){return Ud(e,jr(n))});var FV=Pr(Array.prototype.forEach),mE=Pr(Array.prototype.pop),Ql=Pr(Array.prototype.push),Yd=Pr(String.prototype.toLowerCase),Jp=Pr(String.prototype.toString),WV=Pr(String.prototype.match),$r=Pr(String.prototype.replace),VV=Pr(String.prototype.indexOf),BV=Pr(String.prototype.trim),Pn=Pr(RegExp.prototype.test),ew=UV(TypeError);function Pr(t){return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return Sf(t,e,r)}}function UV(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return OC(t,n)}}function je(t,e,n){var r;n=(r=n)!==null&&r!==void 0?r:Yd,gE&&gE(t,null);for(var i=e.length;i--;){var o=e[i];if(typeof o=="string"){var s=n(o);s!==o&&(NV(e)||(e[i]=s),o=s)}t[o]=!0}return t}function Es(t){var e=kV(null),n;for(n in t)Sf(DV,t,[n])===!0&&(e[n]=t[n]);return e}function Ch(t,e){for(;t!==null;){var n=$V(t,e);if(n){if(n.get)return Pr(n.get);if(typeof n.value=="function")return Pr(n.value)}t=LV(t)}function r(i){return console.warn("fallback value for",i),null}return r}var pE=Bn(["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"]),tw=Bn(["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"]),nw=Bn(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),YV=Bn(["animate","color-profile","cursor","discard","fedropshadow","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"]),rw=Bn(["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"]),GV=Bn(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),wE=Bn(["#text"]),vE=Bn(["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","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","xmlns","slot"]),iw=Bn(["accent-height","accumulate","additive","alignment-baseline","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","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","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","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","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"]),CE=Bn(["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"]),Sh=Bn(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),zV=ni(/\{\{[\w\W]*|[\w\W]*\}\}/gm),jV=ni(/<%[\w\W]*|[\w\W]*%>/gm),KV=ni(/\${[\w\W]*}/gm),XV=ni(/^data-[\-\w.\u00B7-\uFFFF]/),qV=ni(/^aria-[\-\w]+$/),ZV=ni(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),QV=ni(/^(?:\w+script|data):/i),JV=ni(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),eB=ni(/^html$/i),tB=function(){return typeof window>"u"?null:window},nB=function(e,n){if(jo(e)!=="object"||typeof e.createPolicy!="function")return null;var r=null,i="data-tt-policy-suffix";n.currentScript&&n.currentScript.hasAttribute(i)&&(r=n.currentScript.getAttribute(i));var o="dompurify"+(r?"#"+r:"");try{return e.createPolicy(o,{createHTML:function(a){return a},createScriptURL:function(a){return a}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}};function dP(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:tB(),e=function(x){return dP(x)};if(e.version="2.4.7",e.removed=[],!t||!t.document||t.document.nodeType!==9)return e.isSupported=!1,e;var n=t.document,r=t.document,i=t.DocumentFragment,o=t.HTMLTemplateElement,s=t.Node,a=t.Element,l=t.NodeFilter,u=t.NamedNodeMap,c=u===void 0?t.NamedNodeMap||t.MozNamedAttrMap:u,h=t.HTMLFormElement,d=t.DOMParser,g=t.trustedTypes,p=a.prototype,v=Ch(p,"cloneNode"),S=Ch(p,"nextSibling"),y=Ch(p,"childNodes"),R=Ch(p,"parentNode");if(typeof o=="function"){var T=r.createElement("template");T.content&&T.content.ownerDocument&&(r=T.content.ownerDocument)}var N=nB(g,n),I=N?N.createHTML(""):"",F=r,B=F.implementation,ee=F.createNodeIterator,U=F.createDocumentFragment,j=F.getElementsByTagName,re=n.importNode,ie={};try{ie=Es(r).documentMode?r.documentMode:{}}catch{}var oe={};e.isSupported=typeof R=="function"&&B&&B.createHTMLDocument!==void 0&&ie!==9;var ve=zV,_e=jV,rt=KV,Fe=XV,pe=qV,f=QV,m=JV,w=ZV,A=null,O=je({},[].concat(jr(pE),jr(tw),jr(nw),jr(rw),jr(wE))),D=null,z=je({},[].concat(jr(vE),jr(iw),jr(CE),jr(Sh))),G=Object.seal(Object.create(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}})),ne=null,Z=null,K=!0,Se=!0,Pe=!1,Oe=!0,He=!1,Y=!1,lt=!1,Be=!1,xe=!1,De=!1,be=!1,C=!0,b=!1,_="user-content-",k=!0,M=!1,$={},P=null,H=je({},["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"]),W=null,L=je({},["audio","video","img","source","image","track"]),V=null,te=je({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),he="http://www.w3.org/1998/Math/MathML",ye="http://www.w3.org/2000/svg",Me="http://www.w3.org/1999/xhtml",We=Me,St=!1,qe=null,ct=je({},[he,ye,Me],Jp),_t,Ra=["application/xhtml+xml","text/html"],Xl="text/html",Vt,cn=null,bs=r.createElement("form"),In=function(x){return x instanceof RegExp||x instanceof Function},Qt=function(x){cn&&cn===x||((!x||jo(x)!=="object")&&(x={}),x=Es(x),_t=Ra.indexOf(x.PARSER_MEDIA_TYPE)===-1?_t=Xl:_t=x.PARSER_MEDIA_TYPE,Vt=_t==="application/xhtml+xml"?Jp:Yd,A="ALLOWED_TAGS"in x?je({},x.ALLOWED_TAGS,Vt):O,D="ALLOWED_ATTR"in x?je({},x.ALLOWED_ATTR,Vt):z,qe="ALLOWED_NAMESPACES"in x?je({},x.ALLOWED_NAMESPACES,Jp):ct,V="ADD_URI_SAFE_ATTR"in x?je(Es(te),x.ADD_URI_SAFE_ATTR,Vt):te,W="ADD_DATA_URI_TAGS"in x?je(Es(L),x.ADD_DATA_URI_TAGS,Vt):L,P="FORBID_CONTENTS"in x?je({},x.FORBID_CONTENTS,Vt):H,ne="FORBID_TAGS"in x?je({},x.FORBID_TAGS,Vt):{},Z="FORBID_ATTR"in x?je({},x.FORBID_ATTR,Vt):{},$="USE_PROFILES"in x?x.USE_PROFILES:!1,K=x.ALLOW_ARIA_ATTR!==!1,Se=x.ALLOW_DATA_ATTR!==!1,Pe=x.ALLOW_UNKNOWN_PROTOCOLS||!1,Oe=x.ALLOW_SELF_CLOSE_IN_ATTR!==!1,He=x.SAFE_FOR_TEMPLATES||!1,Y=x.WHOLE_DOCUMENT||!1,xe=x.RETURN_DOM||!1,De=x.RETURN_DOM_FRAGMENT||!1,be=x.RETURN_TRUSTED_TYPE||!1,Be=x.FORCE_BODY||!1,C=x.SANITIZE_DOM!==!1,b=x.SANITIZE_NAMED_PROPS||!1,k=x.KEEP_CONTENT!==!1,M=x.IN_PLACE||!1,w=x.ALLOWED_URI_REGEXP||w,We=x.NAMESPACE||Me,G=x.CUSTOM_ELEMENT_HANDLING||{},x.CUSTOM_ELEMENT_HANDLING&&In(x.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(G.tagNameCheck=x.CUSTOM_ELEMENT_HANDLING.tagNameCheck),x.CUSTOM_ELEMENT_HANDLING&&In(x.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(G.attributeNameCheck=x.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),x.CUSTOM_ELEMENT_HANDLING&&typeof x.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(G.allowCustomizedBuiltInElements=x.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),He&&(Se=!1),De&&(xe=!0),$&&(A=je({},jr(wE)),D=[],$.html===!0&&(je(A,pE),je(D,vE)),$.svg===!0&&(je(A,tw),je(D,iw),je(D,Sh)),$.svgFilters===!0&&(je(A,nw),je(D,iw),je(D,Sh)),$.mathMl===!0&&(je(A,rw),je(D,CE),je(D,Sh))),x.ADD_TAGS&&(A===O&&(A=Es(A)),je(A,x.ADD_TAGS,Vt)),x.ADD_ATTR&&(D===z&&(D=Es(D)),je(D,x.ADD_ATTR,Vt)),x.ADD_URI_SAFE_ATTR&&je(V,x.ADD_URI_SAFE_ATTR,Vt),x.FORBID_CONTENTS&&(P===H&&(P=Es(P)),je(P,x.FORBID_CONTENTS,Vt)),k&&(A["#text"]=!0),Y&&je(A,["html","head","body"]),A.table&&(je(A,["tbody"]),delete ne.tbody),Bn&&Bn(x),cn=x)},yt=je({},["mi","mo","mn","ms","mtext"]),wR=je({},["foreignobject","desc","title","annotation-xml"]),kN=je({},["title","style","font","a","script"]),hh=je({},tw);je(hh,nw),je(hh,YV);var Ip=je({},rw);je(Ip,GV);var FN=function(x){var J=R(x);(!J||!J.tagName)&&(J={namespaceURI:We,tagName:"template"});var le=Yd(x.tagName),ut=Yd(J.tagName);return qe[x.namespaceURI]?x.namespaceURI===ye?J.namespaceURI===Me?le==="svg":J.namespaceURI===he?le==="svg"&&(ut==="annotation-xml"||yt[ut]):!!hh[le]:x.namespaceURI===he?J.namespaceURI===Me?le==="math":J.namespaceURI===ye?le==="math"&&wR[ut]:!!Ip[le]:x.namespaceURI===Me?J.namespaceURI===ye&&!wR[ut]||J.namespaceURI===he&&!yt[ut]?!1:!Ip[le]&&(kN[le]||!hh[le]):!!(_t==="application/xhtml+xml"&&qe[x.namespaceURI]):!1},Wi=function(x){Ql(e.removed,{element:x});try{x.parentNode.removeChild(x)}catch{try{x.outerHTML=I}catch{x.remove()}}},Pp=function(x,J){try{Ql(e.removed,{attribute:J.getAttributeNode(x),from:J})}catch{Ql(e.removed,{attribute:null,from:J})}if(J.removeAttribute(x),x==="is"&&!D[x])if(xe||De)try{Wi(J)}catch{}else try{J.setAttribute(x,"")}catch{}},vR=function(x){var J,le;if(Be)x="<remove></remove>"+x;else{var ut=WV(x,/^[\r\n\t ]+/);le=ut&&ut[0]}_t==="application/xhtml+xml"&&We===Me&&(x='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+x+"</body></html>");var Gn=N?N.createHTML(x):x;if(We===Me)try{J=new d().parseFromString(Gn,_t)}catch{}if(!J||!J.documentElement){J=B.createDocument(We,"template",null);try{J.documentElement.innerHTML=St?I:Gn}catch{}}var mn=J.body||J.documentElement;return x&&le&&mn.insertBefore(r.createTextNode(le),mn.childNodes[0]||null),We===Me?j.call(J,Y?"html":"body")[0]:Y?J.documentElement:mn},CR=function(x){return ee.call(x.ownerDocument||x,x,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT,null,!1)},WN=function(x){return x instanceof h&&(typeof x.nodeName!="string"||typeof x.textContent!="string"||typeof x.removeChild!="function"||!(x.attributes instanceof c)||typeof x.removeAttribute!="function"||typeof x.setAttribute!="function"||typeof x.namespaceURI!="string"||typeof x.insertBefore!="function"||typeof x.hasChildNodes!="function")},ql=function(x){return jo(s)==="object"?x instanceof s:x&&jo(x)==="object"&&typeof x.nodeType=="number"&&typeof x.nodeName=="string"},Vi=function(x,J,le){oe[x]&&FV(oe[x],function(ut){ut.call(e,J,le,cn)})},SR=function(x){var J;if(Vi("beforeSanitizeElements",x,null),WN(x)||Pn(/[\u0080-\uFFFF]/,x.nodeName))return Wi(x),!0;var le=Vt(x.nodeName);if(Vi("uponSanitizeElement",x,{tagName:le,allowedTags:A}),x.hasChildNodes()&&!ql(x.firstElementChild)&&(!ql(x.content)||!ql(x.content.firstElementChild))&&Pn(/<[/\w]/g,x.innerHTML)&&Pn(/<[/\w]/g,x.textContent)||le==="select"&&Pn(/<template/i,x.innerHTML))return Wi(x),!0;if(!A[le]||ne[le]){if(!ne[le]&&bR(le)&&(G.tagNameCheck instanceof RegExp&&Pn(G.tagNameCheck,le)||G.tagNameCheck instanceof Function&&G.tagNameCheck(le)))return!1;if(k&&!P[le]){var ut=R(x)||x.parentNode,Gn=y(x)||x.childNodes;if(Gn&&ut)for(var mn=Gn.length,hn=mn-1;hn>=0;--hn)ut.insertBefore(v(Gn[hn],!0),S(x))}return Wi(x),!0}return x instanceof a&&!FN(x)||(le==="noscript"||le==="noembed"||le==="noframes")&&Pn(/<\/no(script|embed|frames)/i,x.innerHTML)?(Wi(x),!0):(He&&x.nodeType===3&&(J=x.textContent,J=$r(J,ve," "),J=$r(J,_e," "),J=$r(J,rt," "),x.textContent!==J&&(Ql(e.removed,{element:x.cloneNode()}),x.textContent=J)),Vi("afterSanitizeElements",x,null),!1)},yR=function(x,J,le){if(C&&(J==="id"||J==="name")&&(le in r||le in bs))return!1;if(!(Se&&!Z[J]&&Pn(Fe,J))){if(!(K&&Pn(pe,J))){if(!D[J]||Z[J]){if(!(bR(x)&&(G.tagNameCheck instanceof RegExp&&Pn(G.tagNameCheck,x)||G.tagNameCheck instanceof Function&&G.tagNameCheck(x))&&(G.attributeNameCheck instanceof RegExp&&Pn(G.attributeNameCheck,J)||G.attributeNameCheck instanceof Function&&G.attributeNameCheck(J))||J==="is"&&G.allowCustomizedBuiltInElements&&(G.tagNameCheck instanceof RegExp&&Pn(G.tagNameCheck,le)||G.tagNameCheck instanceof Function&&G.tagNameCheck(le))))return!1}else if(!V[J]){if(!Pn(w,$r(le,m,""))){if(!((J==="src"||J==="xlink:href"||J==="href")&&x!=="script"&&VV(le,"data:")===0&&W[x])){if(!(Pe&&!Pn(f,$r(le,m,"")))){if(le)return!1}}}}}}return!0},bR=function(x){return x.indexOf("-")>0},RR=function(x){var J,le,ut,Gn;Vi("beforeSanitizeAttributes",x,null);var mn=x.attributes;if(mn){var hn={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:D};for(Gn=mn.length;Gn--;){J=mn[Gn];var dh=J,rn=dh.name,xp=dh.namespaceURI;if(le=rn==="value"?J.value:BV(J.value),ut=Vt(rn),hn.attrName=ut,hn.attrValue=le,hn.keepAttr=!0,hn.forceKeepAttr=void 0,Vi("uponSanitizeAttribute",x,hn),le=hn.attrValue,!hn.forceKeepAttr&&(Pp(rn,x),!!hn.keepAttr)){if(!Oe&&Pn(/\/>/i,le)){Pp(rn,x);continue}He&&(le=$r(le,ve," "),le=$r(le,_e," "),le=$r(le,rt," "));var ER=Vt(x.nodeName);if(yR(ER,ut,le)){if(b&&(ut==="id"||ut==="name")&&(Pp(rn,x),le=_+le),N&&jo(g)==="object"&&typeof g.getAttributeType=="function"&&!xp)switch(g.getAttributeType(ER,ut)){case"TrustedHTML":{le=N.createHTML(le);break}case"TrustedScriptURL":{le=N.createScriptURL(le);break}}try{xp?x.setAttributeNS(xp,rn,le):x.setAttribute(rn,le),mE(e.removed)}catch{}}}}Vi("afterSanitizeAttributes",x,null)}},VN=function Re(x){var J,le=CR(x);for(Vi("beforeSanitizeShadowDOM",x,null);J=le.nextNode();)Vi("uponSanitizeShadowNode",J,null),!SR(J)&&(J.content instanceof i&&Re(J.content),RR(J));Vi("afterSanitizeShadowDOM",x,null)};return e.sanitize=function(Re){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},J,le,ut,Gn,mn;if(St=!Re,St&&(Re="<!-->"),typeof Re!="string"&&!ql(Re))if(typeof Re.toString=="function"){if(Re=Re.toString(),typeof Re!="string")throw ew("dirty is not a string, aborting")}else throw ew("toString is not a function");if(!e.isSupported){if(jo(t.toStaticHTML)==="object"||typeof t.toStaticHTML=="function"){if(typeof Re=="string")return t.toStaticHTML(Re);if(ql(Re))return t.toStaticHTML(Re.outerHTML)}return Re}if(lt||Qt(x),e.removed=[],typeof Re=="string"&&(M=!1),M){if(Re.nodeName){var hn=Vt(Re.nodeName);if(!A[hn]||ne[hn])throw ew("root node is forbidden and cannot be sanitized in-place")}}else if(Re instanceof s)J=vR("<!---->"),le=J.ownerDocument.importNode(Re,!0),le.nodeType===1&&le.nodeName==="BODY"||le.nodeName==="HTML"?J=le:J.appendChild(le);else{if(!xe&&!He&&!Y&&Re.indexOf("<")===-1)return N&&be?N.createHTML(Re):Re;if(J=vR(Re),!J)return xe?null:be?I:""}J&&Be&&Wi(J.firstChild);for(var dh=CR(M?Re:J);ut=dh.nextNode();)ut.nodeType===3&&ut===Gn||SR(ut)||(ut.content instanceof i&&VN(ut.content),RR(ut),Gn=ut);if(Gn=null,M)return Re;if(xe){if(De)for(mn=U.call(J.ownerDocument);J.firstChild;)mn.appendChild(J.firstChild);else mn=J;return(D.shadowroot||D.shadowrootmod)&&(mn=re.call(n,mn,!0)),mn}var rn=Y?J.outerHTML:J.innerHTML;return Y&&A["!doctype"]&&J.ownerDocument&&J.ownerDocument.doctype&&J.ownerDocument.doctype.name&&Pn(eB,J.ownerDocument.doctype.name)&&(rn="<!DOCTYPE "+J.ownerDocument.doctype.name+`>
`+rn),He&&(rn=$r(rn,ve," "),rn=$r(rn,_e," "),rn=$r(rn,rt," ")),N&&be?N.createHTML(rn):rn},e.setConfig=function(Re){Qt(Re),lt=!0},e.clearConfig=function(){cn=null,lt=!1},e.isValidAttribute=function(Re,x,J){cn||Qt({});var le=Vt(Re),ut=Vt(x);return yR(le,ut,J)},e.addHook=function(Re,x){typeof x=="function"&&(oe[Re]=oe[Re]||[],Ql(oe[Re],x))},e.removeHook=function(Re){if(oe[Re])return mE(oe[Re])},e.removeHooks=function(Re){oe[Re]&&(oe[Re]=[])},e.removeAllHooks=function(){oe={}},e}var rB=dP();//! moment.js
//! version : 2.29.4
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
//! license : MIT
//! momentjs.com
var fP;function X(){return fP.apply(null,arguments)}function iB(t){fP=t}function ri(t){return t instanceof Array||Object.prototype.toString.call(t)==="[object Array]"}function ua(t){return t!=null&&Object.prototype.toString.call(t)==="[object Object]"}function st(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function oy(t){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(t).length===0;var e;for(e in t)if(st(t,e))return!1;return!0}function Qn(t){return t===void 0}function wo(t){return typeof t=="number"||Object.prototype.toString.call(t)==="[object Number]"}function Bc(t){return t instanceof Date||Object.prototype.toString.call(t)==="[object Date]"}function gP(t,e){var n=[],r,i=t.length;for(r=0;r<i;++r)n.push(e(t[r],r));return n}function Qo(t,e){for(var n in e)st(e,n)&&(t[n]=e[n]);return st(e,"toString")&&(t.toString=e.toString),st(e,"valueOf")&&(t.valueOf=e.valueOf),t}function $i(t,e,n,r){return kP(t,e,n,r,!0).utc()}function oB(){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 Ge(t){return t._pf==null&&(t._pf=oB()),t._pf}var IC;Array.prototype.some?IC=Array.prototype.some:IC=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 sy(t){if(t._isValid==null){var e=Ge(t),n=IC.call(e.parsedDateParts,function(i){return i!=null}),r=!isNaN(t._d.getTime())&&e.overflow<0&&!e.empty&&!e.invalidEra&&!e.invalidMonth&&!e.invalidWeekday&&!e.weekdayMismatch&&!e.nullInput&&!e.invalidFormat&&!e.userInvalidated&&(!e.meridiem||e.meridiem&&n);if(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 vg(t){var e=$i(NaN);return t!=null?Qo(Ge(e),t):Ge(e).userInvalidated=!0,e}var SE=X.momentProperties=[],ow=!1;function ay(t,e){var n,r,i,o=SE.length;if(Qn(e._isAMomentObject)||(t._isAMomentObject=e._isAMomentObject),Qn(e._i)||(t._i=e._i),Qn(e._f)||(t._f=e._f),Qn(e._l)||(t._l=e._l),Qn(e._strict)||(t._strict=e._strict),Qn(e._tzm)||(t._tzm=e._tzm),Qn(e._isUTC)||(t._isUTC=e._isUTC),Qn(e._offset)||(t._offset=e._offset),Qn(e._pf)||(t._pf=Ge(e)),Qn(e._locale)||(t._locale=e._locale),o>0)for(n=0;n<o;n++)r=SE[n],i=e[r],Qn(i)||(t[r]=i);return t}function Uc(t){ay(this,t),this._d=new Date(t._d!=null?t._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),ow===!1&&(ow=!0,X.updateOffset(this),ow=!1)}function ii(t){return t instanceof Uc||t!=null&&t._isAMomentObject!=null}function mP(t){X.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+t)}function Dr(t,e){var n=!0;return Qo(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+=`
[`+o+"] ";for(s in arguments[0])st(arguments[0],s)&&(i+=s+": "+arguments[0][s]+", ");i=i.slice(0,-2)}else i=arguments[o];r.push(i)}mP(t+`
Arguments: `+Array.prototype.slice.call(r).join("")+`
`+new Error().stack),n=!1}return e.apply(this,arguments)},e)}var yE={};function pP(t,e){X.deprecationHandler!=null&&X.deprecationHandler(t,e),yE[t]||(mP(e),yE[t]=!0)}X.suppressDeprecationWarnings=!1;X.deprecationHandler=null;function ki(t){return typeof Function<"u"&&t instanceof Function||Object.prototype.toString.call(t)==="[object Function]"}function sB(t){var e,n;for(n in t)st(t,n)&&(e=t[n],ki(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 PC(t,e){var n=Qo({},t),r;for(r in e)st(e,r)&&(ua(t[r])&&ua(e[r])?(n[r]={},Qo(n[r],t[r]),Qo(n[r],e[r])):e[r]!=null?n[r]=e[r]:delete n[r]);for(r in t)st(t,r)&&!st(e,r)&&ua(t[r])&&(n[r]=Qo({},n[r]));return n}function ly(t){t!=null&&this.set(t)}var xC;Object.keys?xC=Object.keys:xC=function(t){var e,n=[];for(e in t)st(t,e)&&n.push(e);return n};var aB={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function lB(t,e,n){var r=this._calendar[t]||this._calendar.sameElse;return ki(r)?r.call(e,n):r}function Di(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 uy=/(\[[^\[]*\])|(\\)?([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,yh=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,sw={},El={};function Te(t,e,n,r){var i=r;typeof r=="string"&&(i=function(){return this[r]()}),t&&(El[t]=i),e&&(El[e[0]]=function(){return Di(i.apply(this,arguments),e[1],e[2])}),n&&(El[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),t)})}function uB(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function cB(t){var e=t.match(uy),n,r;for(n=0,r=e.length;n<r;n++)El[e[n]]?e[n]=El[e[n]]:e[n]=uB(e[n]);return function(i){var o="",s;for(s=0;s<r;s++)o+=ki(e[s])?e[s].call(i,t):e[s];return o}}function Gd(t,e){return t.isValid()?(e=wP(e,t.localeData()),sw[e]=sw[e]||cB(e),sw[e](t)):t.localeData().invalidDate()}function wP(t,e){var n=5;function r(i){return e.longDateFormat(i)||i}for(yh.lastIndex=0;n>=0&&yh.test(t);)t=t.replace(yh,r),yh.lastIndex=0,n-=1;return t}var hB={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 dB(t){var e=this._longDateFormat[t],n=this._longDateFormat[t.toUpperCase()];return e||!n?e:(this._longDateFormat[t]=n.match(uy).map(function(r){return r==="MMMM"||r==="MM"||r==="DD"||r==="dddd"?r.slice(1):r}).join(""),this._longDateFormat[t])}var fB="Invalid date";function gB(){return this._invalidDate}var mB="%d",pB=/\d{1,2}/;function wB(t){return this._ordinal.replace("%d",t)}var vB={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 CB(t,e,n,r){var i=this._relativeTime[n];return ki(i)?i(t,e,n,r):i.replace(/%d/i,t)}function SB(t,e){var n=this._relativeTime[t>0?"future":"past"];return ki(n)?n(e):n.replace(/%s/i,e)}var Qu={};function An(t,e){var n=t.toLowerCase();Qu[n]=Qu[n+"s"]=Qu[e]=t}function Nr(t){return typeof t=="string"?Qu[t]||Qu[t.toLowerCase()]:void 0}function cy(t){var e={},n,r;for(r in t)st(t,r)&&(n=Nr(r),n&&(e[n]=t[r]));return e}var vP={};function On(t,e){vP[t]=e}function yB(t){var e=[],n;for(n in t)st(t,n)&&e.push({unit:n,priority:vP[n]});return e.sort(function(r,i){return r.priority-i.priority}),e}function Cg(t){return t%4===0&&t%100!==0||t%400===0}function Or(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=Or(e)),n}function Fl(t,e){return function(n){return n!=null?(CP(this,t,n),X.updateOffset(this,e),this):yf(this,t)}}function yf(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():NaN}function CP(t,e,n){t.isValid()&&!isNaN(n)&&(e==="FullYear"&&Cg(t.year())&&t.month()===1&&t.date()===29?(n=Je(n),t._d["set"+(t._isUTC?"UTC":"")+e](n,t.month(),Tg(n,t.month()))):t._d["set"+(t._isUTC?"UTC":"")+e](n))}function bB(t){return t=Nr(t),ki(this[t])?this[t]():this}function RB(t,e){if(typeof t=="object"){t=cy(t);var n=yB(t),r,i=n.length;for(r=0;r<i;r++)this[n[r].unit](t[n[r].unit])}else if(t=Nr(t),ki(this[t]))return this[t](e);return this}var SP=/\d/,wr=/\d\d/,yP=/\d{3}/,hy=/\d{4}/,Sg=/[+-]?\d{6}/,Tt=/\d\d?/,bP=/\d\d\d\d?/,RP=/\d\d\d\d\d\d?/,yg=/\d{1,3}/,dy=/\d{1,4}/,bg=/[+-]?\d{1,6}/,Wl=/\d+/,Rg=/[+-]?\d+/,EB=/Z|[+-]\d\d:?\d\d/gi,Eg=/Z|[+-]\d\d(?::?\d\d)?/gi,TB=/[+-]?\d+(\.\d{1,3})?/,Yc=/[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,bf;bf={};function fe(t,e,n){bf[t]=ki(e)?e:function(r,i){return r&&n?n:e}}function _B(t,e){return st(bf,t)?bf[t](e._strict,e._locale):new RegExp(MB(t))}function MB(t){return gr(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,n,r,i,o){return n||r||i||o}))}function gr(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var HC={};function mt(t,e){var n,r=e,i;for(typeof t=="string"&&(t=[t]),wo(e)&&(r=function(o,s){s[e]=Je(o)}),i=t.length,n=0;n<i;n++)HC[t[n]]=r}function Gc(t,e){mt(t,function(n,r,i,o){i._w=i._w||{},e(n,i._w,i,o)})}function AB(t,e,n){e!=null&&st(HC,t)&&HC[t](e,n._a,n,t)}var Rn=0,ao=1,Ai=2,tn=3,Jr=4,lo=5,na=6,OB=7,IB=8;function PB(t,e){return(t%e+e)%e}var zt;Array.prototype.indexOf?zt=Array.prototype.indexOf:zt=function(t){var e;for(e=0;e<this.length;++e)if(this[e]===t)return e;return-1};function Tg(t,e){if(isNaN(t)||isNaN(e))return NaN;var n=PB(e,12);return t+=(e-n)/12,n===1?Cg(t)?29:28:31-n%7%2}Te("M",["MM",2],"Mo",function(){return this.month()+1});Te("MMM",0,0,function(t){return this.localeData().monthsShort(this,t)});Te("MMMM",0,0,function(t){return this.localeData().months(this,t)});An("month","M");On("month",8);fe("M",Tt);fe("MM",Tt,wr);fe("MMM",function(t,e){return e.monthsShortRegex(t)});fe("MMMM",function(t,e){return e.monthsRegex(t)});mt(["M","MM"],function(t,e){e[ao]=Je(t)-1});mt(["MMM","MMMM"],function(t,e,n,r){var i=n._locale.monthsParse(t,r,n._strict);i!=null?e[ao]=i:Ge(n).invalidMonth=t});var xB="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),EP="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),TP=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,HB=Yc,DB=Yc;function NB(t,e){return t?ri(this._months)?this._months[t.month()]:this._months[(this._months.isFormat||TP).test(e)?"format":"standalone"][t.month()]:ri(this._months)?this._months:this._months.standalone}function LB(t,e){return t?ri(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[TP.test(e)?"format":"standalone"][t.month()]:ri(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function $B(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=$i([2e3,r]),this._shortMonthsParse[r]=this.monthsShort(o,"").toLocaleLowerCase(),this._longMonthsParse[r]=this.months(o,"").toLocaleLowerCase();return n?e==="MMM"?(i=zt.call(this._shortMonthsParse,s),i!==-1?i:null):(i=zt.call(this._longMonthsParse,s),i!==-1?i:null):e==="MMM"?(i=zt.call(this._shortMonthsParse,s),i!==-1?i:(i=zt.call(this._longMonthsParse,s),i!==-1?i:null)):(i=zt.call(this._longMonthsParse,s),i!==-1?i:(i=zt.call(this._shortMonthsParse,s),i!==-1?i:null))}function kB(t,e,n){var r,i,o;if(this._monthsParseExact)return $B.call(this,t,e,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;r<12;r++){if(i=$i([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 _P(t,e){var n;if(!t.isValid())return t;if(typeof e=="string"){if(/^\d+$/.test(e))e=Je(e);else if(e=t.localeData().monthsParse(e),!wo(e))return t}return n=Math.min(t.date(),Tg(t.year(),e)),t._d["set"+(t._isUTC?"UTC":"")+"Month"](e,n),t}function MP(t){return t!=null?(_P(this,t),X.updateOffset(this,!0),this):yf(this,"Month")}function FB(){return Tg(this.year(),this.month())}function WB(t){return this._monthsParseExact?(st(this,"_monthsRegex")||AP.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):(st(this,"_monthsShortRegex")||(this._monthsShortRegex=HB),this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex)}function VB(t){return this._monthsParseExact?(st(this,"_monthsRegex")||AP.call(this),t?this._monthsStrictRegex:this._monthsRegex):(st(this,"_monthsRegex")||(this._monthsRegex=DB),this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex)}function AP(){function t(s,a){return a.length-s.length}var e=[],n=[],r=[],i,o;for(i=0;i<12;i++)o=$i([2e3,i]),e.push(this.monthsShort(o,"")),n.push(this.months(o,"")),r.push(this.months(o,"")),r.push(this.monthsShort(o,""));for(e.sort(t),n.sort(t),r.sort(t),i=0;i<12;i++)e[i]=gr(e[i]),n[i]=gr(n[i]);for(i=0;i<24;i++)r[i]=gr(r[i]);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")}Te("Y",0,0,function(){var t=this.year();return t<=9999?Di(t,4):"+"+t});Te(0,["YY",2],0,function(){return this.year()%100});Te(0,["YYYY",4],0,"year");Te(0,["YYYYY",5],0,"year");Te(0,["YYYYYY",6,!0],0,"year");An("year","y");On("year",1);fe("Y",Rg);fe("YY",Tt,wr);fe("YYYY",dy,hy);fe("YYYYY",bg,Sg);fe("YYYYYY",bg,Sg);mt(["YYYYY","YYYYYY"],Rn);mt("YYYY",function(t,e){e[Rn]=t.length===2?X.parseTwoDigitYear(t):Je(t)});mt("YY",function(t,e){e[Rn]=X.parseTwoDigitYear(t)});mt("Y",function(t,e){e[Rn]=parseInt(t,10)});function Ju(t){return Cg(t)?366:365}X.parseTwoDigitYear=function(t){return Je(t)+(Je(t)>68?1900:2e3)};var OP=Fl("FullYear",!0);function BB(){return Cg(this.year())}function UB(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 yc(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 Rf(t,e,n){var r=7+e-n,i=(7+yc(t,0,r).getUTCDay()-e)%7;return-i+r-1}function IP(t,e,n,r,i){var o=(7+n-r)%7,s=Rf(t,r,i),a=1+7*(e-1)+o+s,l,u;return a<=0?(l=t-1,u=Ju(l)+a):a>Ju(t)?(l=t+1,u=a-Ju(t)):(l=t,u=a),{year:l,dayOfYear:u}}function bc(t,e,n){var r=Rf(t.year(),e,n),i=Math.floor((t.dayOfYear()-r-1)/7)+1,o,s;return i<1?(s=t.year()-1,o=i+po(s,e,n)):i>po(t.year(),e,n)?(o=i-po(t.year(),e,n),s=t.year()+1):(s=t.year(),o=i),{week:o,year:s}}function po(t,e,n){var r=Rf(t,e,n),i=Rf(t+1,e,n);return(Ju(t)-r+i)/7}Te("w",["ww",2],"wo","week");Te("W",["WW",2],"Wo","isoWeek");An("week","w");An("isoWeek","W");On("week",5);On("isoWeek",5);fe("w",Tt);fe("ww",Tt,wr);fe("W",Tt);fe("WW",Tt,wr);Gc(["w","ww","W","WW"],function(t,e,n,r){e[r.substr(0,1)]=Je(t)});function YB(t){return bc(t,this._week.dow,this._week.doy).week}var GB={dow:0,doy:6};function zB(){return this._week.dow}function jB(){return this._week.doy}function KB(t){var e=this.localeData().week(this);return t==null?e:this.add((t-e)*7,"d")}function XB(t){var e=bc(this,1,4).week;return t==null?e:this.add((t-e)*7,"d")}Te("d",0,"do","day");Te("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)});Te("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)});Te("dddd",0,0,function(t){return this.localeData().weekdays(this,t)});Te("e",0,0,"weekday");Te("E",0,0,"isoWeekday");An("day","d");An("weekday","e");An("isoWeekday","E");On("day",11);On("weekday",11);On("isoWeekday",11);fe("d",Tt);fe("e",Tt);fe("E",Tt);fe("dd",function(t,e){return e.weekdaysMinRegex(t)});fe("ddd",function(t,e){return e.weekdaysShortRegex(t)});fe("dddd",function(t,e){return e.weekdaysRegex(t)});Gc(["dd","ddd","dddd"],function(t,e,n,r){var i=n._locale.weekdaysParse(t,r,n._strict);i!=null?e.d=i:Ge(n).invalidWeekday=t});Gc(["d","e","E"],function(t,e,n,r){e[r]=Je(t)});function qB(t,e){return typeof t!="string"?t:isNaN(t)?(t=e.weekdaysParse(t),typeof t=="number"?t:null):parseInt(t,10)}function ZB(t,e){return typeof t=="string"?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}function fy(t,e){return t.slice(e,7).concat(t.slice(0,e))}var QB="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),PP="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),JB="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),eU=Yc,tU=Yc,nU=Yc;function rU(t,e){var n=ri(this._weekdays)?this._weekdays:this._weekdays[t&&t!==!0&&this._weekdays.isFormat.test(e)?"format":"standalone"];return t===!0?fy(n,this._week.dow):t?n[t.day()]:n}function iU(t){return t===!0?fy(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort}function oU(t){return t===!0?fy(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin}function sU(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=$i([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=zt.call(this._weekdaysParse,s),i!==-1?i:null):e==="ddd"?(i=zt.call(this._shortWeekdaysParse,s),i!==-1?i:null):(i=zt.call(this._minWeekdaysParse,s),i!==-1?i:null):e==="dddd"?(i=zt.call(this._weekdaysParse,s),i!==-1||(i=zt.call(this._shortWeekdaysParse,s),i!==-1)?i:(i=zt.call(this._minWeekdaysParse,s),i!==-1?i:null)):e==="ddd"?(i=zt.call(this._shortWeekdaysParse,s),i!==-1||(i=zt.call(this._weekdaysParse,s),i!==-1)?i:(i=zt.call(this._minWeekdaysParse,s),i!==-1?i:null)):(i=zt.call(this._minWeekdaysParse,s),i!==-1||(i=zt.call(this._weekdaysParse,s),i!==-1)?i:(i=zt.call(this._shortWeekdaysParse,s),i!==-1?i:null))}function aU(t,e,n){var r,i,o;if(this._weekdaysParseExact)return sU.call(this,t,e,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(i=$i([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 lU(t){if(!this.isValid())return t!=null?this:NaN;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return t!=null?(t=qB(t,this.localeData()),this.add(t-e,"d")):e}function uU(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 cU(t){if(!this.isValid())return t!=null?this:NaN;if(t!=null){var e=ZB(t,this.localeData());return this.day(this.day()%7?e:e-7)}else return this.day()||7}function hU(t){return this._weekdaysParseExact?(st(this,"_weekdaysRegex")||gy.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(st(this,"_weekdaysRegex")||(this._weekdaysRegex=eU),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)}function dU(t){return this._weekdaysParseExact?(st(this,"_weekdaysRegex")||gy.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(st(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=tU),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function fU(t){return this._weekdaysParseExact?(st(this,"_weekdaysRegex")||gy.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(st(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=nU),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function gy(){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=$i([2e3,1]).day(o),a=gr(this.weekdaysMin(s,"")),l=gr(this.weekdaysShort(s,"")),u=gr(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 my(){return this.hours()%12||12}function gU(){return this.hours()||24}Te("H",["HH",2],0,"hour");Te("h",["hh",2],0,my);Te("k",["kk",2],0,gU);Te("hmm",0,0,function(){return""+my.apply(this)+Di(this.minutes(),2)});Te("hmmss",0,0,function(){return""+my.apply(this)+Di(this.minutes(),2)+Di(this.seconds(),2)});Te("Hmm",0,0,function(){return""+this.hours()+Di(this.minutes(),2)});Te("Hmmss",0,0,function(){return""+this.hours()+Di(this.minutes(),2)+Di(this.seconds(),2)});function xP(t,e){Te(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}xP("a",!0);xP("A",!1);An("hour","h");On("hour",13);function HP(t,e){return e._meridiemParse}fe("a",HP);fe("A",HP);fe("H",Tt);fe("h",Tt);fe("k",Tt);fe("HH",Tt,wr);fe("hh",Tt,wr);fe("kk",Tt,wr);fe("hmm",bP);fe("hmmss",RP);fe("Hmm",bP);fe("Hmmss",RP);mt(["H","HH"],tn);mt(["k","kk"],function(t,e,n){var r=Je(t);e[tn]=r===24?0:r});mt(["a","A"],function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t});mt(["h","hh"],function(t,e,n){e[tn]=Je(t),Ge(n).bigHour=!0});mt("hmm",function(t,e,n){var r=t.length-2;e[tn]=Je(t.substr(0,r)),e[Jr]=Je(t.substr(r)),Ge(n).bigHour=!0});mt("hmmss",function(t,e,n){var r=t.length-4,i=t.length-2;e[tn]=Je(t.substr(0,r)),e[Jr]=Je(t.substr(r,2)),e[lo]=Je(t.substr(i)),Ge(n).bigHour=!0});mt("Hmm",function(t,e,n){var r=t.length-2;e[tn]=Je(t.substr(0,r)),e[Jr]=Je(t.substr(r))});mt("Hmmss",function(t,e,n){var r=t.length-4,i=t.length-2;e[tn]=Je(t.substr(0,r)),e[Jr]=Je(t.substr(r,2)),e[lo]=Je(t.substr(i))});function mU(t){return(t+"").toLowerCase().charAt(0)==="p"}var pU=/[ap]\.?m?\.?/i,wU=Fl("Hours",!0);function vU(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"}var DP={calendar:aB,longDateFormat:hB,invalidDate:fB,ordinal:mB,dayOfMonthOrdinalParse:pB,relativeTime:vB,months:xB,monthsShort:EP,week:GB,weekdays:QB,weekdaysMin:JB,weekdaysShort:PP,meridiemParse:pU},Ot={},Jl={},Rc;function CU(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 bE(t){return t&&t.toLowerCase().replace("_","-")}function SU(t){for(var e=0,n,r,i,o;e<t.length;){for(o=bE(t[e]).split("-"),n=o.length,r=bE(t[e+1]),r=r?r.split("-"):null;n>0;){if(i=_g(o.slice(0,n).join("-")),i)return i;if(r&&r.length>=n&&CU(o,r)>=n-1)break;n--}e++}return Rc}function yU(t){return t.match("^[^/\\\\]*$")!=null}function _g(t){var e=null,n;if(Ot[t]===void 0&&typeof module<"u"&&module&&module.exports&&yU(t))try{e=Rc._abbr,n=require,n("./locale/"+t),is(e)}catch{Ot[t]=null}return Ot[t]}function is(t,e){var n;return t&&(Qn(e)?n=bo(t):n=py(t,e),n?Rc=n:typeof console<"u"&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),Rc._abbr}function py(t,e){if(e!==null){var n,r=DP;if(e.abbr=t,Ot[t]!=null)pP("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=Ot[t]._config;else if(e.parentLocale!=null)if(Ot[e.parentLocale]!=null)r=Ot[e.parentLocale]._config;else if(n=_g(e.parentLocale),n!=null)r=n._config;else return Jl[e.parentLocale]||(Jl[e.parentLocale]=[]),Jl[e.parentLocale].push({name:t,config:e}),null;return Ot[t]=new ly(PC(r,e)),Jl[t]&&Jl[t].forEach(function(i){py(i.name,i.config)}),is(t),Ot[t]}else return delete Ot[t],null}function bU(t,e){if(e!=null){var n,r,i=DP;Ot[t]!=null&&Ot[t].parentLocale!=null?Ot[t].set(PC(Ot[t]._config,e)):(r=_g(t),r!=null&&(i=r._config),e=PC(i,e),r==null&&(e.abbr=t),n=new ly(e),n.parentLocale=Ot[t],Ot[t]=n),is(t)}else Ot[t]!=null&&(Ot[t].parentLocale!=null?(Ot[t]=Ot[t].parentLocale,t===is()&&is(t)):Ot[t]!=null&&delete Ot[t]);return Ot[t]}function bo(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return Rc;if(!ri(t)){if(e=_g(t),e)return e;t=[t]}return SU(t)}function RU(){return xC(Ot)}function wy(t){var e,n=t._a;return n&&Ge(t).overflow===-2&&(e=n[ao]<0||n[ao]>11?ao:n[Ai]<1||n[Ai]>Tg(n[Rn],n[ao])?Ai:n[tn]<0||n[tn]>24||n[tn]===24&&(n[Jr]!==0||n[lo]!==0||n[na]!==0)?tn:n[Jr]<0||n[Jr]>59?Jr:n[lo]<0||n[lo]>59?lo:n[na]<0||n[na]>999?na:-1,Ge(t)._overflowDayOfYear&&(e<Rn||e>Ai)&&(e=Ai),Ge(t)._overflowWeeks&&e===-1&&(e=OB),Ge(t)._overflowWeekday&&e===-1&&(e=IB),Ge(t).overflow=e),t}var EU=/^\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)?)?$/,TU=/^\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)?)?$/,_U=/Z|[+-]\d\d(?::?\d\d)?/,bh=[["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]],aw=[["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/]],MU=/^\/?Date\((-?\d+)/i,AU=/^(?:(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}))$/,OU={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 NP(t){var e,n,r=t._i,i=EU.exec(r)||TU.exec(r),o,s,a,l,u=bh.length,c=aw.length;if(i){for(Ge(t).iso=!0,e=0,n=u;e<n;e++)if(bh[e][1].exec(i[1])){s=bh[e][0],o=bh[e][2]!==!1;break}if(s==null){t._isValid=!1;return}if(i[3]){for(e=0,n=c;e<n;e++)if(aw[e][1].exec(i[3])){a=(i[2]||" ")+aw[e][0];break}if(a==null){t._isValid=!1;return}}if(!o&&a!=null){t._isValid=!1;return}if(i[4])if(_U.exec(i[4]))l="Z";else{t._isValid=!1;return}t._f=s+(a||"")+(l||""),Cy(t)}else t._isValid=!1}function IU(t,e,n,r,i,o){var s=[PU(t),EP.indexOf(e),parseInt(n,10),parseInt(r,10),parseInt(i,10)];return o&&s.push(parseInt(o,10)),s}function PU(t){var e=parseInt(t,10);return e<=49?2e3+e:e<=999?1900+e:e}function xU(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function HU(t,e,n){if(t){var r=PP.indexOf(t),i=new Date(e[0],e[1],e[2]).getDay();if(r!==i)return Ge(n).weekdayMismatch=!0,n._isValid=!1,!1}return!0}function DU(t,e,n){if(t)return OU[t];if(e)return 0;var r=parseInt(n,10),i=r%100,o=(r-i)/100;return o*60+i}function LP(t){var e=AU.exec(xU(t._i)),n;if(e){if(n=IU(e[4],e[3],e[2],e[5],e[6],e[7]),!HU(e[1],n,t))return;t._a=n,t._tzm=DU(e[8],e[9],e[10]),t._d=yc.apply(null,t._a),t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),Ge(t).rfc2822=!0}else t._isValid=!1}function NU(t){var e=MU.exec(t._i);if(e!==null){t._d=new Date(+e[1]);return}if(NP(t),t._isValid===!1)delete t._isValid;else return;if(LP(t),t._isValid===!1)delete t._isValid;else return;t._strict?t._isValid=!1:X.createFromInputFallback(t)}X.createFromInputFallback=Dr("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 gl(t,e,n){return t??e??n}function LU(t){var e=new Date(X.now());return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}function vy(t){var e,n,r=[],i,o,s;if(!t._d){for(i=LU(t),t._w&&t._a[Ai]==null&&t._a[ao]==null&&$U(t),t._dayOfYear!=null&&(s=gl(t._a[Rn],i[Rn]),(t._dayOfYear>Ju(s)||t._dayOfYear===0)&&(Ge(t)._overflowDayOfYear=!0),n=yc(s,0,t._dayOfYear),t._a[ao]=n.getUTCMonth(),t._a[Ai]=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[tn]===24&&t._a[Jr]===0&&t._a[lo]===0&&t._a[na]===0&&(t._nextDay=!0,t._a[tn]=0),t._d=(t._useUTC?yc:UB).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[tn]=24),t._w&&typeof t._w.d<"u"&&t._w.d!==o&&(Ge(t).weekdayMismatch=!0)}}function $U(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=gl(e.GG,t._a[Rn],bc(Et(),1,4).year),r=gl(e.W,1),i=gl(e.E,1),(i<1||i>7)&&(l=!0)):(o=t._locale._week.dow,s=t._locale._week.doy,u=bc(Et(),o,s),n=gl(e.gg,t._a[Rn],u.year),r=gl(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>po(n,o,s)?Ge(t)._overflowWeeks=!0:l!=null?Ge(t)._overflowWeekday=!0:(a=IP(n,r,i,o,s),t._a[Rn]=a.year,t._dayOfYear=a.dayOfYear)}X.ISO_8601=function(){};X.RFC_2822=function(){};function Cy(t){if(t._f===X.ISO_8601){NP(t);return}if(t._f===X.RFC_2822){LP(t);return}t._a=[],Ge(t).empty=!0;var e=""+t._i,n,r,i,o,s,a=e.length,l=0,u,c;for(i=wP(t._f,t._locale).match(uy)||[],c=i.length,n=0;n<c;n++)o=i[n],r=(e.match(_B(o,t))||[])[0],r&&(s=e.substr(0,e.indexOf(r)),s.length>0&&Ge(t).unusedInput.push(s),e=e.slice(e.indexOf(r)+r.length),l+=r.length),El[o]?(r?Ge(t).empty=!1:Ge(t).unusedTokens.push(o),AB(o,r,t)):t._strict&&!r&&Ge(t).unusedTokens.push(o);Ge(t).charsLeftOver=a-l,e.length>0&&Ge(t).unusedInput.push(e),t._a[tn]<=12&&Ge(t).bigHour===!0&&t._a[tn]>0&&(Ge(t).bigHour=void 0),Ge(t).parsedDateParts=t._a.slice(0),Ge(t).meridiem=t._meridiem,t._a[tn]=kU(t._locale,t._a[tn],t._meridiem),u=Ge(t).era,u!==null&&(t._a[Rn]=t._locale.erasConvertYear(u,t._a[Rn])),vy(t),wy(t)}function kU(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 FU(t){var e,n,r,i,o,s,a=!1,l=t._f.length;if(l===0){Ge(t).invalidFormat=!0,t._d=new Date(NaN);return}for(i=0;i<l;i++)o=0,s=!1,e=ay({},t),t._useUTC!=null&&(e._useUTC=t._useUTC),e._f=t._f[i],Cy(e),sy(e)&&(s=!0),o+=Ge(e).charsLeftOver,o+=Ge(e).unusedTokens.length*10,Ge(e).score=o,a?o<r&&(r=o,n=e):(r==null||o<r||s)&&(r=o,n=e,s&&(a=!0));Qo(t,n||e)}function WU(t){if(!t._d){var e=cy(t._i),n=e.day===void 0?e.date:e.day;t._a=gP([e.year,e.month,n,e.hour,e.minute,e.second,e.millisecond],function(r){return r&&parseInt(r,10)}),vy(t)}}function VU(t){var e=new Uc(wy($P(t)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function $P(t){var e=t._i,n=t._f;return t._locale=t._locale||bo(t._l),e===null||n===void 0&&e===""?vg({nullInput:!0}):(typeof e=="string"&&(t._i=e=t._locale.preparse(e)),ii(e)?new Uc(wy(e)):(Bc(e)?t._d=e:ri(n)?FU(t):n?Cy(t):BU(t),sy(t)||(t._d=null),t))}function BU(t){var e=t._i;Qn(e)?t._d=new Date(X.now()):Bc(e)?t._d=new Date(e.valueOf()):typeof e=="string"?NU(t):ri(e)?(t._a=gP(e.slice(0),function(n){return parseInt(n,10)}),vy(t)):ua(e)?WU(t):wo(e)?t._d=new Date(e):X.createFromInputFallback(t)}function kP(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),(ua(t)&&oy(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,VU(o)}function Et(t,e,n,r){return kP(t,e,n,r,!1)}var UU=Dr("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:vg()}),YU=Dr("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:vg()});function FP(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 GU(){var t=[].slice.call(arguments,0);return FP("isBefore",t)}function zU(){var t=[].slice.call(arguments,0);return FP("isAfter",t)}var jU=function(){return Date.now?Date.now():+new Date},eu=["year","quarter","month","week","day","hour","minute","second","millisecond"];function KU(t){var e,n=!1,r,i=eu.length;for(e in t)if(st(t,e)&&!(zt.call(eu,e)!==-1&&(t[e]==null||!isNaN(t[e]))))return!1;for(r=0;r<i;++r)if(t[eu[r]]){if(n)return!1;parseFloat(t[eu[r]])!==Je(t[eu[r]])&&(n=!0)}return!0}function XU(){return this._isValid}function qU(){return si(NaN)}function Mg(t){var e=cy(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=KU(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=bo(),this._bubble()}function zd(t){return t instanceof Mg}function DC(t){return t<0?Math.round(-1*t)*-1:Math.round(t)}function ZU(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++)(n&&t[s]!==e[s]||!n&&Je(t[s])!==Je(e[s]))&&o++;return o+i}function WP(t,e){Te(t,0,0,function(){var n=this.utcOffset(),r="+";return n<0&&(n=-n,r="-"),r+Di(~~(n/60),2)+e+Di(~~n%60,2)})}WP("Z",":");WP("ZZ","");fe("Z",Eg);fe("ZZ",Eg);mt(["Z","ZZ"],function(t,e,n){n._useUTC=!0,n._tzm=Sy(Eg,t)});var QU=/([\+\-]|\d\d)/gi;function Sy(t,e){var n=(e||"").match(t),r,i,o;return n===null?null:(r=n[n.length-1]||[],i=(r+"").match(QU)||["-",0,0],o=+(i[1]*60)+Je(i[2]),o===0?0:i[0]==="+"?o:-o)}function yy(t,e){var n,r;return e._isUTC?(n=e.clone(),r=(ii(t)||Bc(t)?t.valueOf():Et(t).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+r),X.updateOffset(n,!1),n):Et(t).local()}function NC(t){return-Math.round(t._d.getTimezoneOffset())}X.updateOffset=function(){};function JU(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=Sy(Eg,t),t===null)return this}else Math.abs(t)<16&&!n&&(t=t*60);return!this._isUTC&&e&&(i=NC(this)),this._offset=t,this._isUTC=!0,i!=null&&this.add(i,"m"),r!==t&&(!e||this._changeInProgress?UP(this,si(t-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,X.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?r:NC(this)}function e2(t,e){return t!=null?(typeof t!="string"&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}function t2(t){return this.utcOffset(0,t)}function n2(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(NC(this),"m")),this}function r2(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var t=Sy(EB,this._i);t!=null?this.utcOffset(t):this.utcOffset(0,!0)}return this}function i2(t){return this.isValid()?(t=t?Et(t).utcOffset():0,(this.utcOffset()-t)%60===0):!1}function o2(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function s2(){if(!Qn(this._isDSTShifted))return this._isDSTShifted;var t={},e;return ay(t,this),t=$P(t),t._a?(e=t._isUTC?$i(t._a):Et(t._a),this._isDSTShifted=this.isValid()&&ZU(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function a2(){return this.isValid()?!this._isUTC:!1}function l2(){return this.isValid()?this._isUTC:!1}function VP(){return this.isValid()?this._isUTC&&this._offset===0:!1}var u2=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,c2=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function si(t,e){var n=t,r=null,i,o,s;return zd(t)?n={ms:t._milliseconds,d:t._days,M:t._months}:wo(t)||!isNaN(+t)?(n={},e?n[e]=+t:n.milliseconds=+t):(r=u2.exec(t))?(i=r[1]==="-"?-1:1,n={y:0,d:Je(r[Ai])*i,h:Je(r[tn])*i,m:Je(r[Jr])*i,s:Je(r[lo])*i,ms:Je(DC(r[na]*1e3))*i}):(r=c2.exec(t))?(i=r[1]==="-"?-1:1,n={y:Ts(r[2],i),M:Ts(r[3],i),w:Ts(r[4],i),d:Ts(r[5],i),h:Ts(r[6],i),m:Ts(r[7],i),s:Ts(r[8],i)}):n==null?n={}:typeof n=="object"&&("from"in n||"to"in n)&&(s=h2(Et(n.from),Et(n.to)),n={},n.ms=s.milliseconds,n.M=s.months),o=new Mg(n),zd(t)&&st(t,"_locale")&&(o._locale=t._locale),zd(t)&&st(t,"_isValid")&&(o._isValid=t._isValid),o}si.fn=Mg.prototype;si.invalid=qU;function Ts(t,e){var n=t&&parseFloat(t.replace(",","."));return(isNaN(n)?0:n)*e}function RE(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 h2(t,e){var n;return t.isValid()&&e.isValid()?(e=yy(e,t),t.isBefore(e)?n=RE(t,e):(n=RE(e,t),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function BP(t,e){return function(n,r){var i,o;return r!==null&&!isNaN(+r)&&(pP(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=si(n,r),UP(this,i,t),this}}function UP(t,e,n,r){var i=e._milliseconds,o=DC(e._days),s=DC(e._months);t.isValid()&&(r=r??!0,s&&_P(t,yf(t,"Month")+s*n),o&&CP(t,"Date",yf(t,"Date")+o*n),i&&t._d.setTime(t._d.valueOf()+i*n),r&&X.updateOffset(t,o||s))}var d2=BP(1,"add"),f2=BP(-1,"subtract");function YP(t){return typeof t=="string"||t instanceof String}function g2(t){return ii(t)||Bc(t)||YP(t)||wo(t)||p2(t)||m2(t)||t===null||t===void 0}function m2(t){var e=ua(t)&&!oy(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||st(t,o);return e&&n}function p2(t){var e=ri(t),n=!1;return e&&(n=t.filter(function(r){return!wo(r)&&YP(t)}).length===0),e&&n}function w2(t){var e=ua(t)&&!oy(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||st(t,o);return e&&n}function v2(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 C2(t,e){arguments.length===1&&(arguments[0]?g2(arguments[0])?(t=arguments[0],e=void 0):w2(arguments[0])&&(e=arguments[0],t=void 0):(t=void 0,e=void 0));var n=t||Et(),r=yy(n,this).startOf("day"),i=X.calendarFormat(this,r)||"sameElse",o=e&&(ki(e[i])?e[i].call(this,n):e[i]);return this.format(o||this.localeData().calendar(i,this,Et(n)))}function S2(){return new Uc(this)}function y2(t,e){var n=ii(t)?t:Et(t);return this.isValid()&&n.isValid()?(e=Nr(e)||"millisecond",e==="millisecond"?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(e).valueOf()):!1}function b2(t,e){var n=ii(t)?t:Et(t);return this.isValid()&&n.isValid()?(e=Nr(e)||"millisecond",e==="millisecond"?this.valueOf()<n.valueOf():this.clone().endOf(e).valueOf()<n.valueOf()):!1}function R2(t,e,n,r){var i=ii(t)?t:Et(t),o=ii(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 E2(t,e){var n=ii(t)?t:Et(t),r;return this.isValid()&&n.isValid()?(e=Nr(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 T2(t,e){return this.isSame(t,e)||this.isAfter(t,e)}function _2(t,e){return this.isSame(t,e)||this.isBefore(t,e)}function M2(t,e,n){var r,i,o;if(!this.isValid())return NaN;if(r=yy(t,this),!r.isValid())return NaN;switch(i=(r.utcOffset()-this.utcOffset())*6e4,e=Nr(e),e){case"year":o=jd(this,r)/12;break;case"month":o=jd(this,r);break;case"quarter":o=jd(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:Or(o)}function jd(t,e){if(t.date()<e.date())return-jd(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 A2(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function O2(t){if(!this.isValid())return null;var e=t!==!0,n=e?this.clone().utc():this;return n.year()<0||n.year()>9999?Gd(n,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):ki(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Gd(n,"Z")):Gd(n,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function I2(){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 P2(t){t||(t=this.isUtc()?X.defaultFormatUtc:X.defaultFormat);var e=Gd(this,t);return this.localeData().postformat(e)}function x2(t,e){return this.isValid()&&(ii(t)&&t.isValid()||Et(t).isValid())?si({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function H2(t){return this.from(Et(),t)}function D2(t,e){return this.isValid()&&(ii(t)&&t.isValid()||Et(t).isValid())?si({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function N2(t){return this.to(Et(),t)}function GP(t){var e;return t===void 0?this._locale._abbr:(e=bo(t),e!=null&&(this._locale=e),this)}var zP=Dr("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 jP(){return this._locale}var Ef=1e3,Tl=60*Ef,Tf=60*Tl,KP=(365*400+97)*24*Tf;function _l(t,e){return(t%e+e)%e}function XP(t,e,n){return t<100&&t>=0?new Date(t+400,e,n)-KP:new Date(t,e,n).valueOf()}function qP(t,e,n){return t<100&&t>=0?Date.UTC(t+400,e,n)-KP:Date.UTC(t,e,n)}function L2(t){var e,n;if(t=Nr(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?qP:XP,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-=_l(e+(this._isUTC?0:this.utcOffset()*Tl),Tf);break;case"minute":e=this._d.valueOf(),e-=_l(e,Tl);break;case"second":e=this._d.valueOf(),e-=_l(e,Ef);break}return this._d.setTime(e),X.updateOffset(this,!0),this}function $2(t){var e,n;if(t=Nr(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?qP:XP,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+=Tf-_l(e+(this._isUTC?0:this.utcOffset()*Tl),Tf)-1;break;case"minute":e=this._d.valueOf(),e+=Tl-_l(e,Tl)-1;break;case"second":e=this._d.valueOf(),e+=Ef-_l(e,Ef)-1;break}return this._d.setTime(e),X.updateOffset(this,!0),this}function k2(){return this._d.valueOf()-(this._offset||0)*6e4}function F2(){return Math.floor(this.valueOf()/1e3)}function W2(){return new Date(this.valueOf())}function V2(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]}function B2(){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 U2(){return this.isValid()?this.toISOString():null}function Y2(){return sy(this)}function G2(){return Qo({},Ge(this))}function z2(){return Ge(this).overflow}function j2(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}Te("N",0,0,"eraAbbr");Te("NN",0,0,"eraAbbr");Te("NNN",0,0,"eraAbbr");Te("NNNN",0,0,"eraName");Te("NNNNN",0,0,"eraNarrow");Te("y",["y",1],"yo","eraYear");Te("y",["yy",2],0,"eraYear");Te("y",["yyy",3],0,"eraYear");Te("y",["yyyy",4],0,"eraYear");fe("N",by);fe("NN",by);fe("NNN",by);fe("NNNN",iY);fe("NNNNN",oY);mt(["N","NN","NNN","NNNN","NNNNN"],function(t,e,n,r){var i=n._locale.erasParse(t,r,n._strict);i?Ge(n).era=i:Ge(n).invalidEra=t});fe("y",Wl);fe("yy",Wl);fe("yyy",Wl);fe("yyyy",Wl);fe("yo",sY);mt(["y","yy","yyy","yyyy"],Rn);mt(["yo"],function(t,e,n,r){var i;n._locale._eraYearOrdinalRegex&&(i=t.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?e[Rn]=n._locale.eraYearOrdinalParse(t,i):e[Rn]=parseInt(t,10)});function K2(t,e){var n,r,i,o=this._eras||bo("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 X2(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 q2(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 Z2(){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 Q2(){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 J2(){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 eY(){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 tY(t){return st(this,"_erasNameRegex")||Ry.call(this),t?this._erasNameRegex:this._erasRegex}function nY(t){return st(this,"_erasAbbrRegex")||Ry.call(this),t?this._erasAbbrRegex:this._erasRegex}function rY(t){return st(this,"_erasNarrowRegex")||Ry.call(this),t?this._erasNarrowRegex:this._erasRegex}function by(t,e){return e.erasAbbrRegex(t)}function iY(t,e){return e.erasNameRegex(t)}function oY(t,e){return e.erasNarrowRegex(t)}function sY(t,e){return e._eraYearOrdinalRegex||Wl}function Ry(){var t=[],e=[],n=[],r=[],i,o,s=this.eras();for(i=0,o=s.length;i<o;++i)e.push(gr(s[i].name)),t.push(gr(s[i].abbr)),n.push(gr(s[i].narrow)),r.push(gr(s[i].name)),r.push(gr(s[i].abbr)),r.push(gr(s[i].narrow));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")}Te(0,["gg",2],0,function(){return this.weekYear()%100});Te(0,["GG",2],0,function(){return this.isoWeekYear()%100});function Ag(t,e){Te(0,[t,t.length],0,e)}Ag("gggg","weekYear");Ag("ggggg","weekYear");Ag("GGGG","isoWeekYear");Ag("GGGGG","isoWeekYear");An("weekYear","gg");An("isoWeekYear","GG");On("weekYear",1);On("isoWeekYear",1);fe("G",Rg);fe("g",Rg);fe("GG",Tt,wr);fe("gg",Tt,wr);fe("GGGG",dy,hy);fe("gggg",dy,hy);fe("GGGGG",bg,Sg);fe("ggggg",bg,Sg);Gc(["gggg","ggggg","GGGG","GGGGG"],function(t,e,n,r){e[r.substr(0,2)]=Je(t)});Gc(["gg","GG"],function(t,e,n,r){e[r]=X.parseTwoDigitYear(t)});function aY(t){return ZP.call(this,t,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)}function lY(t){return ZP.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)}function uY(){return po(this.year(),1,4)}function cY(){return po(this.isoWeekYear(),1,4)}function hY(){var t=this.localeData()._week;return po(this.year(),t.dow,t.doy)}function dY(){var t=this.localeData()._week;return po(this.weekYear(),t.dow,t.doy)}function ZP(t,e,n,r,i){var o;return t==null?bc(this,r,i).year:(o=po(t,r,i),e>o&&(e=o),fY.call(this,t,e,n,r,i))}function fY(t,e,n,r,i){var o=IP(t,e,n,r,i),s=yc(o.year,0,o.dayOfYear);return this.year(s.getUTCFullYear()),this.month(s.getUTCMonth()),this.date(s.getUTCDate()),this}Te("Q",0,"Qo","quarter");An("quarter","Q");On("quarter",7);fe("Q",SP);mt("Q",function(t,e){e[ao]=(Je(t)-1)*3});function gY(t){return t==null?Math.ceil((this.month()+1)/3):this.month((t-1)*3+this.month()%3)}Te("D",["DD",2],"Do","date");An("date","D");On("date",9);fe("D",Tt);fe("DD",Tt,wr);fe("Do",function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient});mt(["D","DD"],Ai);mt("Do",function(t,e){e[Ai]=Je(t.match(Tt)[0])});var QP=Fl("Date",!0);Te("DDD",["DDDD",3],"DDDo","dayOfYear");An("dayOfYear","DDD");On("dayOfYear",4);fe("DDD",yg);fe("DDDD",yP);mt(["DDD","DDDD"],function(t,e,n){n._dayOfYear=Je(t)});function mY(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return t==null?e:this.add(t-e,"d")}Te("m",["mm",2],0,"minute");An("minute","m");On("minute",14);fe("m",Tt);fe("mm",Tt,wr);mt(["m","mm"],Jr);var pY=Fl("Minutes",!1);Te("s",["ss",2],0,"second");An("second","s");On("second",15);fe("s",Tt);fe("ss",Tt,wr);mt(["s","ss"],lo);var wY=Fl("Seconds",!1);Te("S",0,0,function(){return~~(this.millisecond()/100)});Te(0,["SS",2],0,function(){return~~(this.millisecond()/10)});Te(0,["SSS",3],0,"millisecond");Te(0,["SSSS",4],0,function(){return this.millisecond()*10});Te(0,["SSSSS",5],0,function(){return this.millisecond()*100});Te(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3});Te(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4});Te(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5});Te(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6});An("millisecond","ms");On("millisecond",16);fe("S",yg,SP);fe("SS",yg,wr);fe("SSS",yg,yP);var Jo,JP;for(Jo="SSSS";Jo.length<=9;Jo+="S")fe(Jo,Wl);function vY(t,e){e[na]=Je(("0."+t)*1e3)}for(Jo="S";Jo.length<=9;Jo+="S")mt(Jo,vY);JP=Fl("Milliseconds",!1);Te("z",0,0,"zoneAbbr");Te("zz",0,0,"zoneName");function CY(){return this._isUTC?"UTC":""}function SY(){return this._isUTC?"Coordinated Universal Time":""}var Q=Uc.prototype;Q.add=d2;Q.calendar=C2;Q.clone=S2;Q.diff=M2;Q.endOf=$2;Q.format=P2;Q.from=x2;Q.fromNow=H2;Q.to=D2;Q.toNow=N2;Q.get=bB;Q.invalidAt=z2;Q.isAfter=y2;Q.isBefore=b2;Q.isBetween=R2;Q.isSame=E2;Q.isSameOrAfter=T2;Q.isSameOrBefore=_2;Q.isValid=Y2;Q.lang=zP;Q.locale=GP;Q.localeData=jP;Q.max=YU;Q.min=UU;Q.parsingFlags=G2;Q.set=RB;Q.startOf=L2;Q.subtract=f2;Q.toArray=V2;Q.toObject=B2;Q.toDate=W2;Q.toISOString=O2;Q.inspect=I2;typeof Symbol<"u"&&Symbol.for!=null&&(Q[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"});Q.toJSON=U2;Q.toString=A2;Q.unix=F2;Q.valueOf=k2;Q.creationData=j2;Q.eraName=Z2;Q.eraNarrow=Q2;Q.eraAbbr=J2;Q.eraYear=eY;Q.year=OP;Q.isLeapYear=BB;Q.weekYear=aY;Q.isoWeekYear=lY;Q.quarter=Q.quarters=gY;Q.month=MP;Q.daysInMonth=FB;Q.week=Q.weeks=KB;Q.isoWeek=Q.isoWeeks=XB;Q.weeksInYear=hY;Q.weeksInWeekYear=dY;Q.isoWeeksInYear=uY;Q.isoWeeksInISOWeekYear=cY;Q.date=QP;Q.day=Q.days=lU;Q.weekday=uU;Q.isoWeekday=cU;Q.dayOfYear=mY;Q.hour=Q.hours=wU;Q.minute=Q.minutes=pY;Q.second=Q.seconds=wY;Q.millisecond=Q.milliseconds=JP;Q.utcOffset=JU;Q.utc=t2;Q.local=n2;Q.parseZone=r2;Q.hasAlignedHourOffset=i2;Q.isDST=o2;Q.isLocal=a2;Q.isUtcOffset=l2;Q.isUtc=VP;Q.isUTC=VP;Q.zoneAbbr=CY;Q.zoneName=SY;Q.dates=Dr("dates accessor is deprecated. Use date instead.",QP);Q.months=Dr("months accessor is deprecated. Use month instead",MP);Q.years=Dr("years accessor is deprecated. Use year instead",OP);Q.zone=Dr("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",e2);Q.isDSTShifted=Dr("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",s2);function yY(t){return Et(t*1e3)}function bY(){return Et.apply(null,arguments).parseZone()}function ex(t){return t}var at=ly.prototype;at.calendar=lB;at.longDateFormat=dB;at.invalidDate=gB;at.ordinal=wB;at.preparse=ex;at.postformat=ex;at.relativeTime=CB;at.pastFuture=SB;at.set=sB;at.eras=K2;at.erasParse=X2;at.erasConvertYear=q2;at.erasAbbrRegex=nY;at.erasNameRegex=tY;at.erasNarrowRegex=rY;at.months=NB;at.monthsShort=LB;at.monthsParse=kB;at.monthsRegex=VB;at.monthsShortRegex=WB;at.week=YB;at.firstDayOfYear=jB;at.firstDayOfWeek=zB;at.weekdays=rU;at.weekdaysMin=oU;at.weekdaysShort=iU;at.weekdaysParse=aU;at.weekdaysRegex=hU;at.weekdaysShortRegex=dU;at.weekdaysMinRegex=fU;at.isPM=mU;at.meridiem=vU;function _f(t,e,n,r){var i=bo(),o=$i().set(r,e);return i[n](o,t)}function tx(t,e,n){if(wo(t)&&(e=t,t=void 0),t=t||"",e!=null)return _f(t,e,n,"month");var r,i=[];for(r=0;r<12;r++)i[r]=_f(t,r,n,"month");return i}function Ey(t,e,n,r){typeof t=="boolean"?(wo(e)&&(n=e,e=void 0),e=e||""):(e=t,n=e,t=!1,wo(e)&&(n=e,e=void 0),e=e||"");var i=bo(),o=t?i._week.dow:0,s,a=[];if(n!=null)return _f(e,(n+o)%7,r,"day");for(s=0;s<7;s++)a[s]=_f(e,(s+o)%7,r,"day");return a}function RY(t,e){return tx(t,e,"months")}function EY(t,e){return tx(t,e,"monthsShort")}function TY(t,e,n){return Ey(t,e,n,"weekdays")}function _Y(t,e,n){return Ey(t,e,n,"weekdaysShort")}function MY(t,e,n){return Ey(t,e,n,"weekdaysMin")}is("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=Dr("moment.lang is deprecated. Use moment.locale instead.",is);X.langData=Dr("moment.langData is deprecated. Use moment.localeData instead.",bo);var Bi=Math.abs;function AY(){var t=this._data;return this._milliseconds=Bi(this._milliseconds),this._days=Bi(this._days),this._months=Bi(this._months),t.milliseconds=Bi(t.milliseconds),t.seconds=Bi(t.seconds),t.minutes=Bi(t.minutes),t.hours=Bi(t.hours),t.months=Bi(t.months),t.years=Bi(t.years),this}function nx(t,e,n,r){var i=si(e,n);return t._milliseconds+=r*i._milliseconds,t._days+=r*i._days,t._months+=r*i._months,t._bubble()}function OY(t,e){return nx(this,t,e,1)}function IY(t,e){return nx(this,t,e,-1)}function EE(t){return t<0?Math.floor(t):Math.ceil(t)}function PY(){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+=EE(LC(n)+e)*864e5,e=0,n=0),r.milliseconds=t%1e3,i=Or(t/1e3),r.seconds=i%60,o=Or(i/60),r.minutes=o%60,s=Or(o/60),r.hours=s%24,e+=Or(s/24),l=Or(rx(e)),n+=l,e-=EE(LC(l)),a=Or(n/12),n%=12,r.days=e,r.months=n,r.years=a,this}function rx(t){return t*4800/146097}function LC(t){return t*146097/4800}function xY(t){if(!this.isValid())return NaN;var e,n,r=this._milliseconds;if(t=Nr(t),t==="month"||t==="quarter"||t==="year")switch(e=this._days+r/864e5,n=this._months+rx(e),t){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(e=this._days+Math.round(LC(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 HY(){return this.isValid()?this._milliseconds+this._days*864e5+this._months%12*2592e6+Je(this._months/12)*31536e6:NaN}function Ro(t){return function(){return this.as(t)}}var DY=Ro("ms"),NY=Ro("s"),LY=Ro("m"),$Y=Ro("h"),kY=Ro("d"),FY=Ro("w"),WY=Ro("M"),VY=Ro("Q"),BY=Ro("y");function UY(){return si(this)}function YY(t){return t=Nr(t),this.isValid()?this[t+"s"]():NaN}function va(t){return function(){return this.isValid()?this._data[t]:NaN}}var GY=va("milliseconds"),zY=va("seconds"),jY=va("minutes"),KY=va("hours"),XY=va("days"),qY=va("months"),ZY=va("years");function QY(){return Or(this.days()/7)}var no=Math.round,Cl={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function JY(t,e,n,r,i){return i.relativeTime(e||1,!!n,t,r)}function eG(t,e,n,r){var i=si(t).abs(),o=no(i.as("s")),s=no(i.as("m")),a=no(i.as("h")),l=no(i.as("d")),u=no(i.as("M")),c=no(i.as("w")),h=no(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,JY.apply(null,d)}function tG(t){return t===void 0?no:typeof t=="function"?(no=t,!0):!1}function nG(t,e){return Cl[t]===void 0?!1:e===void 0?Cl[t]:(Cl[t]=e,t==="s"&&(Cl.ss=e-1),!0)}function rG(t,e){if(!this.isValid())return this.localeData().invalidDate();var n=!1,r=Cl,i,o;return typeof t=="object"&&(e=t,t=!1),typeof t=="boolean"&&(n=t),typeof e=="object"&&(r=Object.assign({},Cl,e),e.s!=null&&e.ss==null&&(r.ss=e.s-1)),i=this.localeData(),o=eG(this,!n,r,i),n&&(o=i.pastFuture(+this,o)),i.postformat(o)}var lw=Math.abs;function Ta(t){return(t>0)-(t<0)||+t}function Og(){if(!this.isValid())return this.localeData().invalidDate();var t=lw(this._milliseconds)/1e3,e=lw(this._days),n=lw(this._months),r,i,o,s,a=this.asSeconds(),l,u,c,h;return a?(r=Or(t/60),i=Or(r/60),t%=60,r%=60,o=Or(n/12),n%=12,s=t?t.toFixed(3).replace(/\.?0+$/,""):"",l=a<0?"-":"",u=Ta(this._months)!==Ta(a)?"-":"",c=Ta(this._days)!==Ta(a)?"-":"",h=Ta(this._milliseconds)!==Ta(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 nt=Mg.prototype;nt.isValid=XU;nt.abs=AY;nt.add=OY;nt.subtract=IY;nt.as=xY;nt.asMilliseconds=DY;nt.asSeconds=NY;nt.asMinutes=LY;nt.asHours=$Y;nt.asDays=kY;nt.asWeeks=FY;nt.asMonths=WY;nt.asQuarters=VY;nt.asYears=BY;nt.valueOf=HY;nt._bubble=PY;nt.clone=UY;nt.get=YY;nt.milliseconds=GY;nt.seconds=zY;nt.minutes=jY;nt.hours=KY;nt.days=XY;nt.weeks=QY;nt.months=qY;nt.years=ZY;nt.humanize=rG;nt.toISOString=Og;nt.toString=Og;nt.toJSON=Og;nt.locale=GP;nt.localeData=jP;nt.toIsoString=Dr("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Og);nt.lang=zP;Te("X",0,0,"unix");Te("x",0,0,"valueOf");fe("x",Rg);fe("X",TB);mt("X",function(t,e,n){n._d=new Date(parseFloat(t)*1e3)});mt("x",function(t,e,n){n._d=new Date(Je(t))});//! moment.js
X.version="2.29.4";iB(Et);X.fn=Q;X.min=GU;X.max=zU;X.now=jU;X.utc=$i;X.unix=yY;X.months=RY;X.isDate=Bc;X.locale=is;X.invalid=vg;X.duration=si;X.isMoment=ii;X.weekdays=TY;X.parseZone=bY;X.localeData=bo;X.isDuration=zd;X.monthsShort=EY;X.weekdaysMin=MY;X.defineLocale=py;X.updateLocale=bU;X.locales=RU;X.weekdaysShort=_Y;X.normalizeUnits=Nr;X.relativeTimeRounding=tG;X.relativeTimeThreshold=nG;X.calendarFormat=v2;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 ix(t){const e=t.length;let n=0;for(;n<e;)t[n]=[t[n]],n+=1}function $C(t,e){const n=e.length;let r=0;for(;r<n;)t.push(e[r]),r+=1}function ec(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 Yt(t,e,n,r){let i=-1,o=t,s=n;Array.isArray(t)||(o=Array.from(t));const a=o.length;for(r&&a&&(i+=1,s=o[i]),i+=1;i<a;)s=e(s,o[i],i,o),i+=1;return s}function pr(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 Ue(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 E(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 ox(t){return Yt(t,(e,n)=>e+n,0)}function iG(t){return Yt(t,(e,n)=>e>n?e:n,Array.isArray(t)?t[0]:void 0)}function oG(t){return Yt(t,(e,n)=>e<n?e:n,Array.isArray(t)?t[0]:void 0)}function sG(t){return t.length?ox(t)/t.length:0}function sx(t){return Yt(t,(e,n)=>e.concat(Array.isArray(n)?sx(n):n),[])}function Ty(t){const e=[];return E(t,n=>{e.indexOf(n)===-1&&e.push(n)}),e}function kC(){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 E(i,s=>{o=o.filter(a=>!s.includes(a))}),o}function aG(){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 E(i,s=>{o=o.filter(a=>s.includes(a))}),o}function lG(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];const[r,...i]=[...e],o=new Set(r);return E(i,s=>{E(s,a=>{o.has(a)||o.add(a)})}),Array.from(o)}function FC(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:" ";return t.split(e)}const uG=Object.freeze(Object.defineProperty({__proto__:null,arrayAvg:sG,arrayEach:E,arrayFilter:pr,arrayFlatten:sx,arrayMap:Ue,arrayMax:iG,arrayMin:oG,arrayReduce:Yt,arraySum:ox,arrayUnique:Ty,extendArray:$C,getDifferenceOfArrays:kC,getIntersectionOfArrays:aG,getUnionOfArrays:lG,pivot:ec,stringToArray:FC,to2dArray:ix},Symbol.toStringTag,{value:"Module"}));function ht(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 Yt(t,(o,s,a)=>{const l=s.replace(/\r?\n\s*/g,""),u=n[a]?n[a]:"";return o+l+u},"").trim()}function Ft(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 ue(t){return typeof t<"u"}function Ct(t){return typeof t>"u"}function Zt(t){return t===null||t===""||Ct(t)}function ax(t){return Object.prototype.toString.call(t)==="[object RegExp]"}const Gu="length",tc=t=>parseInt(t,16),TE=t=>parseInt(t,10),Mf=(t,e,n)=>t.substr(e,n),nc=t=>t.codePointAt(0)-65,WC=t=>`${t}`.replace(/\-/g,""),cG=t=>tc(Mf(WC(t),tc("12"),nc("F")))/(tc(Mf(WC(t),nc("B"),~~![][Gu]))||9),hG=()=>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 _E=!1;const ME={invalid:()=>ht`
The license key for Handsontable is invalid.\x20
If you need any help, contact us at support@handsontable.com.`,expired:t=>{let{keyValidityDate:e,hotVersion:n}=t;return ht`
The license key for Handsontable expired on ${e}, and is not valid for the installed\x20
version ${n}. Renew your license key at handsontable.com or downgrade to a version released prior\x20
to ${e}. If you need any help, contact us at sales@handsontable.com.`},missing:()=>ht`
The license key for Handsontable is missing. Use your purchased key to activate the product.\x20
Alternatively, you can activate Handsontable to use for non-commercial purposes by\x20
passing the key: 'non-commercial-and-evaluation'. If you need any help, contact\x20
us at support@handsontable.com.`,non_commercial:()=>""},AE={invalid:()=>ht`
The license key for Handsontable is invalid.\x20
<a href="https://handsontable.com/docs/tutorial-license-key.html" target="_blank">Read more</a> on how to\x20
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 ht`
The license key for Handsontable expired on ${e}, and is not valid for the installed\x20
version ${n}. <a href="https://handsontable.com/pricing" target="_blank">Renew</a> your\x20
license key or downgrade to a version released prior to ${e}. If you need any\x20
help, contact us at <a href="mailto:sales@handsontable.com">sales@handsontable.com</a>.`},missing:()=>ht`
The license key for Handsontable is missing. Use your purchased key to activate the product.\x20
Alternatively, you can activate Handsontable to use for non-commercial purposes by\x20
passing the key: 'non-commercial-and-evaluation'.\x20
<a href="https://handsontable.com/docs/tutorial-license-key.html" target="_blank">Read more</a> about it in\x20
the documentation or contact us at <a href="mailto:support@handsontable.com">support@handsontable.com</a>.`,non_commercial:()=>""};function lx(t,e){const n=!Zt(t),r=typeof t=="string"&&t.toLowerCase()==="non-commercial-and-evaluation",i="14.1.0";let o,s="invalid",a="invalid";t=WC(t||"");const l=dG(t);if(n||r||l)if(l){const u=X("16/01/2024","DD/MM/YYYY"),c=Math.floor(u.toDate().getTime()/864e5),h=cG(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(hG()&&(s="valid",a="valid"),!_E&&s!=="valid"&&(ME[s]({keyValidityDate:o,hotVersion:i})&&console[s==="non_commercial"?"info":"warn"](ME[s]({keyValidityDate:o,hotVersion:i})),_E=!0),a!=="valid"&&e.parentNode&&AE[a]({keyValidityDate:o,hotVersion:i})){const c=document.createElement("div");c.className="hot-display-license-info",c.innerHTML=AE[a]({keyValidityDate:o,hotVersion:i}),e.parentNode.insertBefore(c,e.nextSibling)}}function dG(t){let e=[][Gu],n=e;if(t[Gu]!==nc("Z"))return!1;for(let r="",i="B<H4P+".split(""),o=nc(i.shift());o;o=nc(i.shift()||"A"))--o<""[Gu]?n=n|(TE(`${TE(tc(r)+(tc(Mf(t,Math.abs(o),2))+[]).padStart(2,"0"))}`)%97||2)>>1:r=Mf(t,o,o?i[Gu]===1?9:8:6);return n===e}const fG=Object.freeze(Object.defineProperty({__proto__:null,_injectProductInfo:lx,isDefined:ue,isEmpty:Zt,isRegExp:ax,isUndefined:Ct,stringify:Ft},Symbol.toStringTag,{value:"Module"}));function En(t){return t[0].toUpperCase()+t.substr(1)}function gG(){const t=[];for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];let i=n.length;for(;i;){i-=1;const o=Ft(n[i]).toLowerCase();t.indexOf(o)===-1&&t.push(o)}return t.length===1}function _y(){function t(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}return t()+t()+t()+t()}function My(t){return/^([0-9][0-9]?%$)|(^100%$)/.test(t)}function Ay(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 VC(t){return Ig(`${t}`,{ALLOWED_TAGS:[]})}function Ig(t,e){return rB.sanitize(t,e)}const mG=Object.freeze(Object.defineProperty({__proto__:null,equalsIgnoreCase:gG,isPercentValue:My,randomString:_y,sanitize:Ig,stripTags:VC,substitute:Ay,toUpperCaseFirst:En},Symbol.toStringTag,{value:"Module"})),Vl=t=>["tabindex",t],pG=()=>["role","treegrid"],Pi=()=>["role","presentation"],wG=()=>["role","gridcell"],vG=()=>["role","rowheader"],ux=()=>["role","rowgroup"],CG=()=>["role","columnheader"],BC=()=>["role","row"],SG=()=>["role","menu"],yG=()=>["role","menuitem"],bG=()=>["role","combobox"],cx=()=>["role","listbox"],RG=()=>["role","option"],EG=()=>["role","checkbox"],TG=()=>["scope","col"],_G=()=>["scope","row"],MG=()=>["type","text"],Oy=t=>["aria-label",t],Eo=()=>["aria-hidden","true"],AG=()=>["aria-disabled","true"],OG=()=>["aria-multiselectable","true"],hx=t=>["aria-haspopup",t],dx=t=>["aria-rowcount",t],Pg=t=>["aria-colcount",t],fx=t=>["aria-rowindex",t],Iy=t=>["aria-colindex",t],Ir=t=>["aria-expanded",t],IG=t=>["aria-sort",t],OE=()=>["aria-readonly","true"],IE=()=>["aria-invalid","true"],PG=t=>["aria-checked",t],Py=()=>["aria-selected","true"],xG=()=>["aria-autocomplete","list"],HG=t=>["aria-controls",t],DG=t=>["aria-activedescendant",t],NG=t=>["aria-live",t],LG=t=>["aria-relevant",t],$G=t=>["aria-setsize",t],kG=t=>["aria-posinset",t];function gx(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 mx(t,e){const n=t.closest(".handsontable");return!!n&&(n.parentNode===e||n===e)}function px(t){return Object.getPrototypeOf(t.parent)&&t.frameElement}function Ec(t){return px(t)&&t.parent}function FG(t){return!!Object.getPrototypeOf(t.parent)}function cs(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 zu(t,e,n){const r=[];let i=t;for(;i&&(i=cs(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 os(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 wx(t){let e=0,n=t;if(n.previousSibling)for(;n=n.previousSibling;)e+=1;return e}function Uo(t,e,n){const r=n.parentElement.querySelector(`.ht_clone_${t}`);return r?r.contains(e):null}function vx(t){return!t||!t.length?[]:t.filter(e=>!!e)}function Cx(t,e){if(!t||!t.length)return e?{regexFree:[],regexes:[]}:[];const n=[],r=[];return r.push(...t.filter(i=>{const o=i instanceof RegExp;return o&&e&&n.push(i),!o})),e?{regexFree:r,regexes:n}:r}function Ie(t,e){return t.classList===void 0||typeof e!="string"||e===""?!1:t.classList.contains(e)}function q(t,e){typeof e=="string"&&(e=e.split(" ")),e=vx(e),e.length>0&&t.classList.add(...e)}function Le(t,e){typeof e=="string"?e=e.split(" "):e instanceof RegExp&&(e=[e]);let{regexFree:n,regexes:r}=Cx(e,!0);n=vx(n),n.length>0&&t.classList.remove(...n),r.forEach(i=>{t.classList.forEach(o=>{i.test(o)&&t.classList.remove(o)})})}function Ee(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 Ca(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}=Cx(e,!0);n.forEach(i=>{i!==""&&t.removeAttribute(i)}),r.forEach(i=>{t.getAttributeNames().forEach(o=>{i.test(o)&&t.removeAttribute(o)})})}function xy(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--)xy(e[n])}}function oi(t){let e;for(;e=t.lastChild;)t.removeChild(e)}const Sx=/(<(.*)>|&(.*);)/;function Sa(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;Sx.test(e)?t.innerHTML=n?Ig(e):e:hs(t,e)}function hs(t,e){const n=t.firstChild;n&&n.nodeType===3&&n.nextSibling===null?n.textContent=e:(oi(t),t.appendChild(t.ownerDocument.createTextNode(e)))}function ds(t){const e=t.ownerDocument.documentElement;let n=t;for(;n!==e;){if(n===null)return!1;if(n.nodeType===Node.DOCUMENT_FRAGMENT_NODE)if(n.host){if(n.host.impl)return ds(n.host.impl);if(n.host)return ds(n.host);throw new Error("Lost in Web Components world")}else return!1;else if(vo(n).display==="none")return!1;n=n.parentNode}return!0}function en(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 Hy(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:window).scrollY}function xg(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:window).scrollX}function Hg(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:window;return t===e?Hy(e):t.scrollTop}function Dy(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:window;return t===e?xg(e):t.scrollLeft}function Tc(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 ca(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=vo(r,n),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 xl(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=vo(t,n);if(i[e]!==""&&i[e]!==void 0)return i[e]}function WG(t,e){const{selectorText:n}=e;let r=!1;return e.type===CSSRule.STYLE_RULE&&n&&(t.msMatchesSelector?r=t.msMatchesSelector(n):t.matches&&(r=t.matches(n))),r}function vo(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:window;return t.currentStyle||e.getComputedStyle(t)}function ft(t){return t.offsetWidth}function Pt(t){return t.offsetHeight}function ra(t){return t.clientHeight||t.innerHeight}function Ny(t){return t.clientWidth||t.innerWidth}function VG(t,e,n){t.addEventListener(e,n,!1)}function BG(t,e,n){t.removeEventListener(e,n,!1)}function Ly(t){return t.selectionStart?t.selectionStart:0}function yx(t){return t.selectionEnd?t.selectionEnd:0}function UG(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window;const e=t.document;let n="";return t.getSelection?n=t.getSelection().toString():e.selection&&e.selection.type!=="Control"&&(n=e.selection.createRange().text),n}function UC(){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 zc(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 uw;function YG(){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 nn(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;return uw===void 0&&(uw=YG(t)),uw}function bx(t){return t.offsetWidth!==t.clientWidth}function Rx(t){return t.offsetHeight!==t.clientHeight}function Dg(t,e,n){t.style.transform=`translate3d(${e},${n},0)`}function GG(t){let e;return t.style.transform&&(e=t.style.transform)!==""?["transform",e]:-1}function jc(t){t.style.transform&&t.style.transform!==""&&(t.style.transform="")}function rc(t){return t&&(["INPUT","SELECT","TEXTAREA"].indexOf(t.nodeName)>-1||t.contentEditable==="true")}function Ng(t){return rc(t)&&t.hasAttribute("data-hot-input")===!1}function zG(t){const e=t.ownerDocument.activeElement;Ng(e)||t.select()}function $y(t){return!t.parentNode}function Ex(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 ky(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();Ee(t,"contenteditable",!0),n&&Ee(t,...Eo()),e&&q(t,"invisibleSelection"),i.selectNodeContents(t),o.removeAllRanges(),o.addRange(i)}function Fy(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&&Le(t,"invisibleSelection"),t.removeAttribute("contenteditable")}function Tx(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;ky(t,n),e(),Fy(t,n)}const jG=Object.freeze(Object.defineProperty({__proto__:null,HTML_CHARACTERS:Sx,addClass:q,addEvent:VG,clearTextSelection:UC,closest:cs,closestDown:zu,empty:oi,fastInnerHTML:Sa,fastInnerText:hs,getCaretPosition:Ly,getComputedStyle:vo,getCssTransform:GG,getFrameElement:px,getParent:gx,getParentWindow:Ec,getScrollLeft:Dy,getScrollTop:Hg,getScrollableElement:Tc,getScrollbarWidth:nn,getSelectionEndPosition:yx,getSelectionText:UG,getStyle:xl,getTrimmingContainer:ca,getWindowScrollLeft:xg,getWindowScrollTop:Hy,hasAccessToParentWindow:FG,hasClass:Ie,hasHorizontalScrollbar:Rx,hasVerticalScrollbar:bx,index:wx,innerHeight:ra,innerWidth:Ny,isChildOf:os,isDetached:$y,isInput:rc,isOutsideInput:Ng,isThisHotChild:mx,isVisible:ds,makeElementContentEditableAndSelectItsContent:ky,matchesCSSRules:WG,observeVisibilityChangeOnce:Ex,offset:en,outerHeight:Pt,outerWidth:ft,overlayContainsElement:Uo,removeAttribute:Ca,removeClass:Le,removeContentEditableFromElementAndDeselect:Fy,removeEvent:BG,removeTextNodes:xy,resetCssTransform:jc,runWithSelectedContendEditableElement:Tx,selectElementIfAllowed:zG,setAttribute:Ee,setCaretPosition:zc,setOverlayPosition:Dg},Symbol.toStringTag,{value:"Module"}));function vt(t){return typeof t=="function"}function _x(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:200,n=0;const r={lastCallThrottled:!0};let i=null;function o(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];const u=Date.now();let c=!1;r.lastCallThrottled=!0,n||(n=u,c=!0);const h=e-(u-n);return c?(r.lastCallThrottled=!1,t.apply(this,a)):(i&&clearTimeout(i),i=setTimeout(()=>{r.lastCallThrottled=!1,t.apply(this,a),n=0,i=void 0},h)),r}return o}function KG(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:200,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:10;const r=_x(t,e);let i=n;function o(){i=n}function s(){for(var a=arguments.length,l=new Array(a),u=0;u<a;u++)l[u]=arguments[u];return i?(i-=1,t.apply(this,l)):r.apply(this,l)}return s.clearHits=o,s}function Lg(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 XG(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];const[r,...i]=e;return function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];return Yt(i,(u,c)=>c(u),r.apply(this,a))}}function Wy(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 Mx(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 qG(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.reverse());let u;return l.length>=e?u=t.apply(this,l):u=n(l),u}}return n([])}function Af(t,e,n,r,i,o,s,a){return ue(a)?t.call(e,n,r,i,o,s,a):ue(s)?t.call(e,n,r,i,o,s):ue(o)?t.call(e,n,r,i,o):ue(i)?t.call(e,n,r,i):ue(r)?t.call(e,n,r):ue(n)?t.call(e,n):t.call(e)}const ZG=Object.freeze(Object.defineProperty({__proto__:null,curry:Mx,curryRight:qG,debounce:Lg,fastCall:Af,isFunction:vt,partial:Wy,pipe:XG,throttle:_x,throttleAfterHits:KG},Symbol.toStringTag,{value:"Module"}));var QG=Un,PE=zI,JG=Mn,xE=$l,ez=JI,HE=QG([].push),tz=function(t){if(JG(t))return t;if(PE(t)){for(var e=t.length,n=[],r=0;r<e;r++){var i=t[r];typeof i=="string"?HE(n,i):(typeof i=="number"||xE(i)==="Number"||xE(i)==="String")&&HE(n,ez(i))}var o=n.length,s=!0;return function(a,l){if(s)return s=!1,l;if(PE(this))return l;for(var u=0;u<o;u++)if(n[u]===a)return l}}},nz=Ss,Ax=kc,Ox=wg,rz=pa,Kc=Un,Ix=Hr,DE=Mn,NE=GS,Px=ry,iz=tz,oz=YS,sz=String,ss=Ax("JSON","stringify"),Rh=Kc(/./.exec),LE=Kc("".charAt),az=Kc("".charCodeAt),lz=Kc("".replace),uz=Kc(1 .toString),cz=/[\uD800-\uDFFF]/g,$E=/^[\uD800-\uDBFF]$/,kE=/^[\uDC00-\uDFFF]$/,FE=!oz||Ix(function(){var t=Ax("Symbol")("stringify detection");return ss([t])!=="[null]"||ss({a:t})!=="{}"||ss(Object(t))!=="{}"}),WE=Ix(function(){return ss("\uDF06\uD834")!=='"\\udf06\\ud834"'||ss("\uDEAD")!=='"\\udead"'}),hz=function(t,e){var n=Px(arguments),r=iz(e);if(!(!DE(r)&&(t===void 0||NE(t))))return n[1]=function(i,o){if(DE(r)&&(o=rz(r,this,sz(i),o)),!NE(o))return o},Ox(ss,null,n)},dz=function(t,e,n){var r=LE(n,e-1),i=LE(n,e+1);return Rh($E,t)&&!Rh(kE,i)||Rh(kE,t)&&!Rh($E,r)?"\\u"+uz(az(t,0),16):t};ss&&nz({target:"JSON",stat:!0,arity:3,forced:FE||WE},{stringify:function(e,n,r){var i=Px(arguments),o=Ox(FE?hz:ss,null,i);return WE&&typeof o=="string"?lz(o,cz,dz):o}});function Hl(t){let e;return Array.isArray(t)?e=t.length?new Array(t.length).fill(null):[]:(e={},Ye(t,(n,r)=>{r!=="__children"&&(n&&typeof n=="object"&&!Array.isArray(n)?e[r]=Hl(n):Array.isArray(n)?n.length&&typeof n[0]=="object"&&!Array.isArray(n[0])?e[r]=[Hl(n[0])]:e[r]=[]:e[r]=null)})),e}function To(t,e){return e.prototype.constructor=e,t.prototype=new e,t.prototype.constructor=t,t}function jt(t,e,n){const r=Array.isArray(n);return Ye(e,(i,o)=>{(r===!1||n.includes(o))&&(t[o]=i)}),t}function Xc(t,e){Ye(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]={}),Xc(t[r],e[r])):t[r]=e[r]})}function Tn(t){return typeof t=="object"?JSON.parse(JSON.stringify(t)):t}function Vn(t){const e={};return Ye(t,(n,r)=>{e[r]=n}),e}function pt(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 E(n,i=>{t.MIXINS.push(i.MIXIN_NAME),Ye(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}`,g=p=>{let v=p;return(Array.isArray(v)||Ve(v))&&(v=Tn(v)),v};return function(){return this[d]===void 0&&(this[d]=g(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 $g(t,e){return JSON.stringify(t)===JSON.stringify(e)}function Ve(t){return Object.prototype.toString.call(t)==="[object Object]"}function Fi(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 Ye(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 xx(t,e){const n=e.split(".");let r=t;return Ye(n,i=>{if(r=r[i],r===void 0)return r=void 0,!1}),r}function Kd(t,e,n){const r=e.split(".");let i=t;r.forEach((o,s)=>{s!==r.length-1?(It(i,o)||(i[o]={}),i=i[o]):i[o]=n})}function kg(t){if(!Ve(t))return 0;const e=function(n){let r=0;return Ve(n)?Ye(n,(i,o)=>{o!=="__children"&&(r+=e(i))}):r+=1,r};return e(t)}function ei(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 It(t,e){return Object.prototype.hasOwnProperty.call(t,e)}const fz=Object.freeze(Object.defineProperty({__proto__:null,clone:Vn,createObjectPropListener:ei,deepClone:Tn,deepExtend:Xc,deepObjectSize:kg,defineGetter:Fi,duckSchema:Hl,extend:jt,getProperty:xx,hasOwnProperty:It,inherit:To,isObject:Ve,isObjectEqual:$g,mixin:pt,objectEach:Ye,setProperty:Kd},Symbol.toStringTag,{value:"Module"}));function Fg(t){return window.requestAnimationFrame(t)}function _c(t){window.cancelAnimationFrame(t)}function Vy(){return"ontouchstart"in window}function Hx(){return typeof window<"u"}let _a;function Dx(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return _a||(typeof Intl=="object"?_a=new Intl.Collator(t,e).compare:typeof String.prototype.localeCompare=="function"?_a=(n,r)=>`${n}`.localeCompare(r):_a=(n,r)=>n===r?0:n>r?-1:1,_a)}const gz=Object.freeze(Object.defineProperty({__proto__:null,cancelAnimationFrame:_c,getComparisonFunction:Dx,isCSR:Hx,isTouchSupported:Vy,requestAnimationFrame:Fg},Symbol.toStringTag,{value:"Module"})),Tr=t=>{const e={value:!1};return e.test=(n,r)=>{e.value=t(n,r)},e},_o={chrome:Tr((t,e)=>/Chrome/.test(t)&&/Google/.test(e)),chromeWebKit:Tr(t=>/CriOS/.test(t)),edge:Tr(t=>/Edge/.test(t)),edgeWebKit:Tr(t=>/EdgiOS/.test(t)),firefox:Tr(t=>/Firefox/.test(t)),firefoxWebKit:Tr(t=>/FxiOS/.test(t)),mobile:Tr(t=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(t)),safari:Tr((t,e)=>/Safari/.test(t)&&/Apple Computer/.test(e))},Bl={mac:Tr(t=>/^Mac/.test(t)),win:Tr(t=>/^Win/.test(t)),linux:Tr(t=>/^Linux/.test(t)),ios:Tr(t=>/iPhone|iPad|iPod/i.test(t))};function Nx(){let{userAgent:t=navigator.userAgent,vendor:e=navigator.vendor}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ye(_o,n=>{let{test:r}=n;return void r(t,e)})}function Lx(){let{platform:t=navigator.platform}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ye(Bl,e=>{let{test:n}=e;return void n(t)})}Hx()&&(Nx(),Lx());function By(){return _o.chrome.value}function $x(){return _o.chromeWebKit.value}function Xd(){return _o.firefox.value}function kx(){return _o.firefoxWebKit.value}function Uy(){return _o.safari.value}function Fx(){return _o.edge.value}function mz(){return _o.edgeWebKit.value}function uo(){return _o.mobile.value}function Yy(){return Bl.ios.value}function Gy(){let{maxTouchPoints:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:navigator;return t>2&&Bl.mac.value}function YC(){return Bl.win.value}function Mc(){return Bl.mac.value}function pz(){return Bl.linux.value}const wz=Object.freeze(Object.defineProperty({__proto__:null,isChrome:By,isChromeWebKit:$x,isEdge:Fx,isEdgeWebKit:mz,isFirefox:Xd,isFirefoxWebKit:kx,isIOS:Yy,isIpadOS:Gy,isLinuxOS:pz,isMacOS:Mc,isMobileBrowser:uo,isSafari:Uy,isWindowsOS:YC,setBrowserMeta:Nx,setPlatformMeta:Lx},Symbol.toStringTag,{value:"Module"})),we={ALT:18,ARROW_DOWN:40,ARROW_LEFT:37,ARROW_RIGHT:39,ARROW_UP:38,AUDIO_DOWN:Xd()?182:174,AUDIO_MUTE:Xd()?181:173,AUDIO_UP:Xd()?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},vz=[we.ALT,we.ARROW_DOWN,we.ARROW_LEFT,we.ARROW_RIGHT,we.ARROW_UP,we.AUDIO_DOWN,we.AUDIO_MUTE,we.AUDIO_UP,we.BACKSPACE,we.CAPS_LOCK,we.DELETE,we.END,we.ENTER,we.ESCAPE,we.F1,we.F2,we.F3,we.F4,we.F5,we.F6,we.F7,we.F8,we.F9,we.F10,we.F11,we.F12,we.F13,we.F14,we.F15,we.F16,we.F17,we.F18,we.F19,we.HOME,we.INSERT,we.MEDIA_NEXT,we.MEDIA_PLAY_PAUSE,we.MEDIA_PREV,we.MEDIA_STOP,we.NULL,we.NUM_LOCK,we.PAGE_DOWN,we.PAGE_UP,we.PAUSE,we.SCROLL_LOCK,we.SHIFT,we.TAB];function Wx(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 zy(t){return vz.includes(t)}function Cz(t){const e=[];return Mc()?e.push(we.COMMAND_LEFT,we.COMMAND_RIGHT,we.COMMAND_FIREFOX):e.push(we.CONTROL),e.includes(t)}function Vx(t){return[we.CONTROL,we.COMMAND_LEFT,we.COMMAND_RIGHT,we.COMMAND_FIREFOX].includes(t)}function Ul(t,e){const n=e.split("|");let r=!1;return E(n,i=>{if(t===we[i])return r=!0,!1}),r}const Sz=Object.freeze(Object.defineProperty({__proto__:null,KEY_CODES:we,isCtrlKey:Cz,isCtrlMetaKey:Vx,isFunctionKey:zy,isKey:Ul,isPrintableChar:Wx},Symbol.toStringTag,{value:"Module"}));function Lr(t){t.isImmediatePropagationEnabled=!1,t.cancelBubble=!0}function Ko(t){return t.isImmediatePropagationEnabled===!1}function fs(t){return t.button===2}function Wg(t){return t.button===0}function Bx(t,e){const n={x:t.offsetX,y:t.offsetY};let r=t.target;if(!(e instanceof HTMLElement)||r!==e&&r.contains(e))return n;for(;r!==e;)n.x+=r.offsetLeft,n.y+=r.offsetTop,r=r.offsetParent;return n}const yz=Object.freeze(Object.defineProperty({__proto__:null,isImmediatePropagationStopped:Ko,isLeftClick:Wg,isRightClick:fs,offsetRelativeTo:Bx,stopImmediatePropagation:Lr},Symbol.toStringTag,{value:"Module"}));function gt(){ue(console)&&console.warn(...arguments)}function jy(){ue(console)&&console.error(...arguments)}function bz(t,e,n){return e=Rz(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Rz(t){var e=Ez(t,"string");return typeof e=="symbol"?e:String(e)}function Ez(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const Ma=["afterCellMetaReset","afterChange","afterContextMenuDefaultOptions","beforeContextMenuSetItems","afterDropdownMenuDefaultOptions","beforeDropdownMenuSetItems","afterContextMenuHide","beforeContextMenuShow","afterContextMenuShow","afterCopyLimit","beforeCreateCol","afterColumnSequenceChange","afterCreateCol","beforeCreateRow","afterCreateRow","afterDeselect","afterDestroy","afterDocumentKeyDown","afterDrawSelection","beforeRemoveCellClassNames","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","beforeSelectColumns","afterSelectColumns","beforeSelectRows","afterSelectRows","afterSetCellMeta","afterRemoveCellMeta","afterSetDataAtCell","afterSetDataAtRowProp","afterSetSourceDataAtCell","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","beforeSetRangeStartOnly","beforeSetRangeStart","beforeSetRangeEnd","beforeSelectionHighlightSet","beforeTouchScroll","beforeValidate","beforeValueRender","construct","init","modifyColHeader","modifyColWidth","modifyFocusedElement","modifyRowHeader","modifyRowHeight","modifyData","modifySourceData","modifyRowData","modifyGetCellCoords","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","modifyTransformStart","modifyTransformEnd","afterModifyTransformStart","afterModifyTransformEnd","afterViewportRowCalculatorOverride","afterViewportColumnCalculatorOverride","afterPluginsInitialized","beforeHideRows","afterHideRows","beforeUnhideRows","afterUnhideRows","beforeHideColumns","afterHideColumns","beforeUnhideColumns","afterUnhideColumns","beforeTrimRow","afterTrimRow","beforeUntrimRow","afterUntrimRow","beforeDropdownMenuShow","afterDropdownMenuShow","afterDropdownMenuHide","beforeAddChild","afterAddChild","beforeDetachChild","afterDetachChild","afterBeginEditing","beforeMergeCells","afterMergeCells","beforeUnmergeCells","afterUnmergeCells","afterListen","afterUnlisten","afterRefreshDimensions","beforeRefreshDimensions","beforeColumnCollapse","afterColumnCollapse","beforeColumnExpand","afterColumnExpand","modifyAutoColumnSizeSeed"],Tz=ht`The plugin hook "[hookName]" was removed in Handsontable [removedInVersion].\x20
Please consult release notes https://github.com/handsontable/handsontable/releases/tag/[removedInVersion] to\x20
learn about the migration path.`,cw=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"]]),hw=new Map([[]]);class Ux{static getSingleton(){return Mz()}constructor(){bz(this,"globalBucket",void 0),this.globalBucket=this.createEmptyBucket()}createEmptyBucket(){const e=Object.create(null);return E(Ma,n=>e[n]=[]),e}getBucket(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return e?(e.pluginHookBucket||(e.pluginHookBucket=this.createEmptyBucket()),e.pluginHookBucket):this.globalBucket}add(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(Array.isArray(n))E(n,i=>this.add(e,i,r));else{cw.has(e)&&gt(Ay(Tz,{hookName:e,removedInVersion:cw.get(e)})),hw.has(e)&&gt(hw.get(e));const i=this.getBucket(r);if(typeof i[e]>"u"&&(this.register(e),i[e]=[]),n.skip=!1,i[e].indexOf(n)===-1){let o=!1;n.initialHook&&E(i[e],(s,a)=>{if(s.initialHook)return i[e][a]=n,o=!0,!1}),o||i[e].push(n)}}return this}once(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;Array.isArray(n)?E(n,i=>this.once(e,i,r)):(n.runOnce=!0,this.add(e,n,r))}remove(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;const i=this.getBucket(r);return typeof i[e]<"u"&&i[e].indexOf(n)>=0?(n.skip=!0,!0):!1}has(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const r=this.getBucket(n);return!!(r[e]!==void 0&&r[e].length)}run(e,n,r,i,o,s,a,l){{const u=this.globalBucket[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=Af(u[h],e,r,i,o,s,a,l);d!==void 0&&(r=d),u[h]&&u[h].runOnce&&this.remove(n,u[h]),h+=1}}{const u=this.getBucket(e)[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=Af(u[h],e,r,i,o,s,a,l);d!==void 0&&(r=d),u[h]&&u[h].runOnce&&this.remove(n,u[h],e),h+=1}}return r}destroy(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;Ye(this.getBucket(e),(n,r,i)=>i[r].length=0)}register(e){this.isRegistered(e)||Ma.push(e)}deregister(e){this.isRegistered(e)&&Ma.splice(Ma.indexOf(e),1)}isDeprecated(e){return hw.has(e)||cw.has(e)}isRegistered(e){return Ma.indexOf(e)>=0}getRegistered(){return Ma}}const _z=new Ux;function Mz(){return _z}const de=Ux,dw=new Map;function ai(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"common";dw.has(t)||dw.set(t,new Map);const e=dw.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 GC=new WeakMap,{register:Az,getItem:Yx,hasItem:Gx,getNames:Oz,getValues:rce}=ai("editors");function Iz(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]},de.getSingleton().add("afterDestroy",function(){e[this.guid]=null})}function zx(t,e){let n;if(typeof t=="function")GC.get(t)||Jn(null,t),n=GC.get(t);else if(typeof t=="string")n=Yx(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 Of(t){if(typeof t=="function")return t;if(!Gx(t))throw Error(`No registered editor found under "${t}" name`);return Yx(t).getConstructor()}function Jn(t,e){t&&typeof t!="string"&&(e=t,t=e.EDITOR_TYPE);const n=new Iz(e);typeof t=="string"&&Az(t,n),GC.set(e,n)}function Pz(t,e,n){return e=xz(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function xz(t){var e=Hz(t,"string");return typeof e=="symbol"?e:String(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||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}let qd=0;class Dz{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;Pz(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,Nz(s))}return this.context.eventListeners.push({element:e,event:n,callback:r,callbackProxy:o,options:i,eventManager:this}),e.addEventListener(n,o,i),qd+=1,()=>{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),qd-=1}}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),qd-=1)}}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,relatedTarget:void 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 Nz(t){const e=t.stopImmediatePropagation;return t.stopImmediatePropagation=function(){e.apply(this),Lr(this)},t}const xr=Dz;function Lz(){return qd}function VE(t,e){$z(t,e),e.add(t)}function $z(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Oo(t,e,n){return e=kz(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function kz(t){var e=Fz(t,"string");return typeof e=="symbol"?e:String(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||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function BE(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}const Vg="editorManager.navigation";var UE=new WeakSet,YE=new WeakSet;class zC{constructor(e,n,r){VE(this,YE),VE(this,UE),Oo(this,"hot",void 0),Oo(this,"tableMeta",void 0),Oo(this,"selection",void 0),Oo(this,"eventManager",void 0),Oo(this,"destroyed",!1),Oo(this,"lock",!1),Oo(this,"activeEditor",void 0),Oo(this,"cellProperties",void 0),this.hot=e,this.tableMeta=n,this.selection=r,this.eventManager=new xr(e),this.hot.addHook("afterDocumentKeyDown",i=>BE(this,UE,Wz).call(this,i)),this.eventManager.addEventListener(this.hot.rootDocument.documentElement,"compositionstart",i=>{!this.destroyed&&this.hot.isListening()&&this.openEditor("",i)}),this.hot.view._wt.update("onCellDblClick",(i,o,s)=>BE(this,YE,Vz).call(this,i,o,s))}lockEditor(){this.lock=!0}unlockEditor(){this.lock=!1}destroyEditor(e){this.lock||this.closeEditor(e)}getActiveEditor(){return this.activeEditor}prepareEditor(){var e;if(this.lock)return;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);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=zx(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}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(event):this.tableMeta.enterMoves;e?this.selection.transformStart(-n.row,-n.col):this.selection.transformStart(n.row,n.col,!0)}destroy(){this.destroyed=!0,this.eventManager.destroy()}}function Wz(t){const e=this.hot.getSelectedRangeLast();if(!this.hot.isListening()||!e||e.highlight.isHeader()||Ko(t))return;const{keyCode:n}=t,r=(t.ctrlKey||t.metaKey)&&!t.altKey;if((!this.activeEditor||this.activeEditor&&!this.activeEditor.isWaiting())&&!zy(n)&&!Vx(n)&&!r&&!this.isEditorOpened()){const o=this.hot.getShortcutManager().getContext("editor"),s={runOnlyIf:()=>ue(this.hot.getSelected()),group:Vg};o.addShortcuts([{keys:[["ArrowUp"]],callback:()=>{this.hot.selection.transformStart(-1,0)}},{keys:[["ArrowDown"]],callback:()=>{this.hot.selection.transformStart(1,0)}},{keys:[["ArrowLeft"]],callback:()=>{this.hot.selection.transformStart(0,-1*this.hot.getDirectionFactor())}},{keys:[["ArrowRight"]],callback:()=>{this.hot.selection.transformStart(0,this.hot.getDirectionFactor())}}],s),this.openEditor("",t)}}function Vz(t,e,n){n.nodeName==="TD"&&this.openEditor(null,t,!0)}const GE=new WeakMap;zC.getInstance=function(t,e,n){let r=GE.get(t);return r||(r=new zC(t,e,n),GE.set(t,r)),r};const Bz=zC;function Eh(t,e){jx(t,e),e.add(t)}function tu(t,e,n){jx(t,e),e.set(t,n)}function jx(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Sl(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}function Nt(t,e){var n=Kx(t,e,"get");return Uz(t,n)}function Uz(t,e){return e.get?e.get.call(t):e.value}function nu(t,e,n){var r=Kx(t,e,"set");return Yz(t,r,n),n}function Kx(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}function Yz(t,e,n){if(e.set)e.set.call(t,n);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=n}}const es=Object.freeze({CELL:"cell",MIXED:"mixed"});var gn=new WeakMap,Th=new WeakMap,_h=new WeakMap,Mh=new WeakMap,Ah=new WeakMap,If=new WeakSet,zE=new WeakSet,jE=new WeakSet,KE=new WeakSet;class Gz{constructor(e){var n=this;Eh(this,KE),Eh(this,jE),Eh(this,zE),Eh(this,If),tu(this,gn,{writable:!0,value:void 0}),tu(this,Th,{writable:!0,value:void 0}),tu(this,_h,{writable:!0,value:50}),tu(this,Mh,{writable:!0,value:null}),tu(this,Ah,{writable:!0,value:new Map});const r=e.getSettings();nu(this,gn,e),nu(this,Th,r.imeFastEdit?es.MIXED:es.CELL),Nt(this,gn).addHook("afterUpdateSettings",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return Sl(n,KE,Kz).call(n,...o)}),Nt(this,gn).addHook("afterSelection",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return Sl(n,zE,zz).call(n,...o)}),Nt(this,gn).addHook("afterSelectionEnd",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return Sl(n,jE,jz).call(n,...o)})}getFocusMode(){return Nt(this,Th)}setFocusMode(e){Object.values(es).includes(e)?nu(this,Th,e):gt(`"${e}" is not a valid focus mode.`)}getRefocusDelay(){return Nt(this,_h)}setRefocusDelay(e){nu(this,_h,e)}setRefocusElementGetter(e){nu(this,Mh,e)}getRefocusElement(){if(typeof Nt(this,Mh)=="function")return Nt(this,Mh).call(this);var e;return(e=Nt(this,gn).getActiveEditor())===null||e===void 0?void 0:e.TEXTAREA}focusOnHighlightedCell(e){const n=r=>{var i,o;const s=(i=Nt(this,gn).getSelectedRangeLast())===null||i===void 0?void 0:i.highlight;if(!s)return;let a=Nt(this,gn).runHooks("modifyFocusedElement",s.row,s.col,r);a instanceof HTMLElement||(a=r),a&&!((o=Nt(this,gn).getActiveEditor())!==null&&o!==void 0&&o.isOpened())&&a.focus({preventScroll:!0})};e?n(e):Sl(this,If,Ky).call(this,r=>n(r))}refocusToEditorTextarea(){var e;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Nt(this,_h);const r=this.getRefocusElement();Nt(this,gn).getSettings().imeFastEdit&&!((e=Nt(this,gn).getActiveEditor())!==null&&e!==void 0&&e.isOpened())&&r&&(Nt(this,Ah).has(n)||Nt(this,Ah).set(n,Lg(()=>{r.select()},n)),Nt(this,Ah).get(n)())}}function Ky(t){var e;const n=(e=Nt(this,gn).getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;if(!n||!Nt(this,gn).selection.isCellVisible(n)){t(null);return}const r=Nt(this,gn).getCell(n.row,n.col,!0);r===null?Nt(this,gn).addHookOnce("afterScroll",()=>{t(Nt(this,gn).getCell(n.row,n.col,!0))}):t(r)}function zz(){Sl(this,If,Ky).call(this,t=>{const{activeElement:e}=Nt(this,gn).rootDocument;e&&Ng(e)&&e.blur(),this.focusOnHighlightedCell(t)})}function jz(){Sl(this,If,Ky).call(this,t=>{this.getFocusMode()===es.MIXED&&t.nodeName==="TD"&&this.refocusToEditorTextarea()})}function Kz(t){t.imeFastEdit&&this.getFocusMode()!==es.MIXED?this.setFocusMode(es.MIXED):!t.imeFastEdit&&this.getFocusMode()!==es.CELL&&this.setFocusMode(es.CELL)}const Xx={"&nbsp;":" ","&amp;":"&","&lt;":"<","&gt;":">"},Xz=new RegExp(Object.keys(Xx).map(t=>`(${t})`).join("|"),"gi");function qz(t){return(t&&t.nodeName||"")==="TABLE"}function jC(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 g=e&&d===0,p=[];for(let S=0;S<s;S+=1){const y=!g&&n&&S===0;let R="";if(g)R=`<th>${t.getColHeader(S-c)}</th>`;else if(y)R=`<th>${t.getRowHeader(d-h)}</th>`;else{const T=i[d][S],{hidden:N,rowspan:I,colspan:F}=t.getCellMeta(d-h,S-c);if(!N){const B=[];if(I&&B.push(`rowspan="${I}"`),F&&B.push(`colspan="${F}"`),Zt(T))R=`<td ${B.join(" ")}></td>`;else{const ee=T.toString().replace("<","&lt;").replace(">","&gt;").replace(/(<br(\s*|\/)>(\r\n|\n)?|\r\n|\n)/g,`<br>\r
`).replace(/\x20/gi,"&nbsp;").replace(/\t/gi,"&#9;");R=`<td ${B.join(" ")}>${ee}</td>`}}}p.push(R)}const v=["<tr>",...p,"</tr>"].join("");g?l.splice(1,0,v):u.splice(-1,0,v)}return a.splice(1,0,l.join(""),u.join("")),a.join("")}function KC(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=Zt(l)?"":l.toString().replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/(<br(\s*|\/)>(\r\n|\n)?|\r\n|\n)/g,`<br>\r
`).replace(/\x20{2,}/gi,c=>`<span style="mso-spacerun: yes">${"&nbsp;".repeat(c.length-1)} </span>`).replace(/\t/gi,"&#9;");s.push(`<td>${u}</td>`)}n.push("<tr>",...s,"</tr>"),r+1===e&&n.push("</tbody>")}return n.push("</table>"),n.join("")}function qx(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 T=o.replace(/<td\b[^>]*?>([\s\S]*?)<\/\s*td>/g,N=>{const I=N.match(/<td\b[^>]*?>/g)[0],F=N.substring(I.length,N.lastIndexOf("<")).replace(/(<(?!br)([^>]+)>)/gi,"");return`${I}${F}</td>`});i.insertAdjacentHTML("afterbegin",`${T}`),o=i.querySelector("table")}if(!o||!qz(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((T,N)=>T+N.colSpan,0)-(a?1:0):0,c=o.tFoot&&Array.from(o.tFoot.rows)||[],h=[];let d=!1,g=0,p=0;if(o.tHead){const T=Array.from(o.tHead.rows).filter(N=>{const I=N.querySelector("td")!==null;return I&&h.push(N),!I});g=T.length,d=g>0,g>1?n.nestedHeaders=Array.from(T).reduce((N,I)=>{const F=Array.from(I.cells).reduce((B,ee,U)=>{if(a&&U===0)return B;const{colSpan:j,innerHTML:re}=ee,ie=j>1?{label:re,colspan:j}:re;return B.push(ie),B},[]);return N.push(F),N},[]):d&&(n.colHeaders=Array.from(T[0].children).reduce((N,I,F)=>(a&&F===0||N.push(I.innerHTML),N),[]))}h.length&&(n.fixedRowsTop=h.length),c.length&&(n.fixedRowsBottom=c.length);const v=[...h,...Array.from(o.tBodies).reduce((T,N)=>(T.push(...Array.from(N.rows)),T),[]),...c];p=v.length;const S=new Array(p);for(let T=0;T<p;T++)S[T]=new Array(u);const y=[],R=[];for(let T=0;T<p;T++){const N=v[T],I=Array.from(N.cells),F=I.length;for(let B=0;B<F;B++){const ee=I[B],{nodeName:U,innerHTML:j,rowSpan:re,colSpan:ie}=ee,oe=S[T].findIndex(ve=>ve===void 0);if(U==="TD"){if(re>1||ie>1){for(let Fe=T;Fe<T+re;Fe++)if(Fe<p)for(let pe=oe;pe<oe+ie;pe++)S[Fe][pe]=null;const _e=ee.getAttribute("style");_e&&_e.includes("mso-ignore:colspan")||y.push({col:oe,row:T,rowspan:re,colspan:ie})}let ve="";s&&/excel/gi.test(s.content)?ve=j.replace(/[\r\n][\x20]{0,2}/g," ").replace(/<br(\s*|\/)>[\r\n]?[\x20]{0,3}/gim,`\r
`):ve=j.replace(/<br(\s*|\/)>[\r\n]?/gim,`\r
`),S[T][oe]=ve.replace(Xz,_e=>Xx[_e])}else R.push(j)}}return y.length&&(n.mergeCells=y),R.length&&(n.rowHeaders=R),S.length&&(n.data=S),n}const Zz=Object.freeze(Object.defineProperty({__proto__:null,_dataToHTML:KC,htmlToGridSettings:qx,instanceToHTML:jC},Symbol.toStringTag,{value:"Module"}));function Wn(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(`^[+-]?\\s*(((${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 Zx(t){return Wn(t,[","])}function me(t,e,n){let r=-1;for(typeof e=="function"?(n=e,e=t):r=t-1;++r<=e&&n(r)!==!1;);}function Pf(t,e,n){let r=t+1;for(typeof e=="function"&&(n=e,e=0);--r>=e&&n(r)!==!1;);}function Xy(t,e){return e=parseInt(e.toString().replace("%",""),10),e=isNaN(e)?0:e,parseInt(t*e/100,10)}function ir(t,e,n){return Math.min(t,e)===t?e:Math.max(t,n)===t?n:t}const Qz=Object.freeze(Object.defineProperty({__proto__:null,clamp:ir,isNumeric:Wn,isNumericLike:Zx,rangeEach:me,rangeEachReverse:Pf,valueAccordingPercent:Xy},Symbol.toStringTag,{value:"Module"})),XC="asc",Jz="desc",XE=new Map([[XC,[-1,1]],[Jz,[1,-1]]]),ej=t=>`The priority '${t}' is already declared in a map.`,tj=t=>`The priority '${t}' is not a number.`;function nj(){let{errorPriorityExists:t,errorPriorityNaN:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=new Map;t=vt(t)?t:ej,e=vt(e)?e:tj;function r(o,s){if(!Wn(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]:XC;const[s,a]=XE.get(o)||XE.get(XC);return[...n].sort((l,u)=>l[0]<u[0]?s:a).map(l=>l[1])}return{addItem:r,getItems:i}}const rj=t=>`The id '${t}' is already declared in a map.`;function Bg(){let{errorIdExists:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const e=new Map;t=vt(t)?t:rj;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,g]=h;return u===g?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 ij=t=>`'${t}' value is already declared in a unique set.`;function oj(){let{errorItemExists:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const e=new Set;t=vt(t)?t:ij;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 qy=t=>`There is already registered "${t}" plugin.`,sj=t=>`There is already registered plugin on priority "${t}".`,aj=t=>`The priority "${t}" is not a number.`,Qx=nj({errorPriorityExists:sj,errorPriorityNaN:aj}),Jx=oj({errorItemExists:qy}),qC=Bg({errorIdExists:qy});function Zy(){return[...Qx.getItems(),...Jx.getItems()]}function qc(t){const e=En(t);return qC.getItem(e)}function lj(t){return!!qc(t)}function tt(t,e,n){[t,e,n]=cj(t,e,n),qc(t)===void 0&&uj(t,e,n)}function uj(t,e,n){const r=En(t);if(qC.hasItem(r))throw new Error(qy(r));n===void 0?Jx.addItem(r):Qx.addItem(n,r),qC.addItem(r,e)}function cj(t,e,n){return typeof t=="function"&&(e=t,t=e.PLUGIN_KEY,n=e.PLUGIN_PRIORITY),[t,e,n]}const{register:hj,getItem:dj,hasItem:e1,getNames:fj,getValues:ice}=ai("renderers");function xf(t){if(typeof t=="function")return t;if(!e1(t))throw Error(`No registered renderer found under "${t}" name`);return dj(t)}function lr(t,e){typeof t!="string"&&(e=t,t=e.RENDERER_TYPE),hj(t,e)}const{register:gj,getItem:mj,hasItem:t1,getNames:pj,getValues:oce}=ai("validators");function Qy(t){if(typeof t=="function")return t;if(!t1(t))throw Error(`No registered validator found under "${t}" name`);return mj(t)}function ta(t,e){typeof t!="string"&&(e=t,t=e.VALIDATOR_TYPE),gj(t,e)}function Oh(t,e,n){return e=wj(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function wj(t){var e=vj(t,"string");return typeof e=="symbol"?e:String(e)}function vj(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Cj{constructor(e){Oh(this,"count",0),Oh(this,"startColumn",0),Oh(this,"endColumn",0),Oh(this,"startPosition",0),this.count=e.totalColumns,this.endColumn=this.count-1}}function Ih(t,e,n){return e=Sj(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Sj(t){var e=yj(t,"string");return typeof e=="symbol"?e:String(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||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class bj{constructor(e){Ih(this,"count",0),Ih(this,"startRow",0),Ih(this,"endRow",0),Ih(this,"startPosition",0),this.count=e.totalRows,this.endRow=this.count-1}}var n1={},Rj=UI,Ej=ty,Tj=Object.keys||function(e){return Rj(e,Ej)},_j=Ni,Mj=LI,Aj=vs,Oj=Cs,Ij=fg,Pj=Tj;n1.f=_j&&!Mj?Object.defineProperties:function(e,n){Oj(e);for(var r=Ij(n),i=Pj(n),o=i.length,s=0,a;o>s;)Aj.f(e,a=i[s++],r[a]);return e};var xj=Cs,Hj=n1,qE=ty,Dj=QS,Nj=oP,Lj=qS,$j=FI,ZE=">",QE="<",ZC="prototype",QC="script",r1=$j("IE_PROTO"),fw=function(){},i1=function(t){return QE+QC+ZE+t+QE+"/"+QC+ZE},JE=function(t){t.write(i1("")),t.close();var e=t.parentWindow.Object;return t=null,e},kj=function(){var t=Lj("iframe"),e="java"+QC+":",n;return t.style.display="none",Nj.appendChild(t),t.src=String(e),n=t.contentWindow.document,n.open(),n.write(i1("document.F=Object")),n.close(),n.F},Ph,Zd=function(){try{Ph=new ActiveXObject("htmlfile")}catch{}Zd=typeof document<"u"?document.domain&&Ph?JE(Ph):kj():JE(Ph);for(var t=qE.length;t--;)delete Zd[ZC][qE[t]];return Zd()};Dj[r1]=!0;var Fj=Object.create||function(e,n){var r;return e!==null?(fw[ZC]=xj(e),r=new fw,fw[ZC]=null,r[r1]=e):r=Zd(),n===void 0?r:Hj.f(r,n)},Wj=kl,Vj=Fj,Bj=vs.f,JC=Wj("unscopables"),eS=Array.prototype;eS[JC]===void 0&&Bj(eS,JC,{configurable:!0,value:Vj(null)});var o1=function(t){eS[JC][t]=!0},Uj=Ss,Yj=pg,Gj=Wc,zj=ey,jj=o1;Uj({target:"Array",proto:!0},{at:function(e){var n=Yj(this),r=Gj(n),i=zj(e),o=i>=0?i:r+i;return o<0||o>=r?void 0:n[o]}});jj("at");const Go=1,yn=2;function Kj(t,e,n){Xj(t,e),e.set(t,n)}function Xj(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ru(t,e,n){return e=qj(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function qj(t){var e=Zj(t,"string");return typeof e=="symbol"?e:String(e)}function Zj(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Aa(t,e){var n=s1(t,e,"get");return Qj(t,n)}function Qj(t,e){return e.get?e.get.call(t):e.value}function Jj(t,e,n){var r=s1(t,e,"set");return eK(t,r,n),n}function s1(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}function eK(t,e,n){if(e.set)e.set.call(t,n);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=n}}var Io=new WeakMap;class Zc{static get DEFAULT_WIDTH(){return 50}constructor(e){ru(this,"count",0),ru(this,"startColumn",null),ru(this,"endColumn",null),ru(this,"startPosition",null),ru(this,"isVisibleInTrimmingContainer",!1),Kj(this,Io,{writable:!0,value:void 0}),Jj(this,Io,e),this.calculate()}calculate(){const{calculationType:e,overrideFn:n,scrollOffset:r,totalColumns:i,viewportWidth:o}=Aa(this,Io),s=Math.max(Aa(this,Io).scrollOffset,0),a=s>0?o+1:o;let l=0,u=!0;const c=[];let h,d=0,g=0;for(let y=0;y<i;y++)if(h=this._getColumnWidth(y),l<=s&&e!==yn&&(this.startColumn=y,d=h),l>=s&&l+(e===yn?h:0)<=s+a&&((this.startColumn===null||this.startColumn===void 0)&&(this.startColumn=y,d=h),this.endColumn=y),c.push(l),l+=h,g=h,e!==yn&&(this.endColumn=y),l>=s+o){u=!1;break}const p=r+o-a,v=e===yn?0:g,S=e===yn?d:0;if(p<-1*Aa(this,Io).inlineStartOffset||r>c.at(-1)+v||-1*Aa(this,Io).scrollOffset-Aa(this,Io).viewportWidth>-1*S?this.isVisibleInTrimmingContainer=!1:this.isVisibleInTrimmingContainer=!0,this.endColumn===i-1&&u)for(this.startColumn=this.endColumn;this.startColumn>0;){const y=c[this.endColumn]+h-c[this.startColumn-1];if((y<=o||e!==yn)&&(this.startColumn-=1),y>o)break}e===Go&&this.startColumn!==null&&n&&n(this),this.startPosition=c[this.startColumn],this.startPosition===void 0&&(this.startPosition=null),i<this.endColumn&&(this.endColumn=i-1),this.startColumn!==null&&(this.count=this.endColumn-this.startColumn+1)}_getColumnWidth(e){let n=Aa(this,Io).columnWidthFn(e);return isNaN(n)&&(n=Zc.DEFAULT_WIDTH),n}}function tK(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 iu(t,e,n){return e=rK(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function rK(t){var e=iK(t,"string");return typeof e=="symbol"?e:String(e)}function iK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function gw(t,e){var n=a1(t,e,"get");return oK(t,n)}function oK(t,e){return e.get?e.get.call(t):e.value}function sK(t,e,n){var r=a1(t,e,"set");return aK(t,r,n),n}function a1(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}function aK(t,e,n){if(e.set)e.set.call(t,n);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=n}}var ou=new WeakMap;class Ug{static get DEFAULT_HEIGHT(){return 23}constructor(e){iu(this,"count",0),iu(this,"startRow",null),iu(this,"endRow",null),iu(this,"startPosition",null),iu(this,"isVisibleInTrimmingContainer",!1),tK(this,ou,{writable:!0,value:void 0}),sK(this,ou,e),this.calculate()}calculate(){const{calculationType:e,overrideFn:n,rowHeightFn:r,scrollOffset:i,totalRows:o,viewportHeight:s}=gw(this,ou),a=Math.max(gw(this,ou).scrollOffset,0),l=gw(this,ou).horizontalScrollbarHeight||0;let u=0,c=!0;const h=[];let d,g=0,p=0;for(let R=0;R<o;R++)if(d=r(R),isNaN(d)&&(d=Ug.DEFAULT_HEIGHT),u<=a&&e!==yn&&(this.startRow=R,g=d),u>=a&&u+(e===yn?d:0)<=a+s-l&&(this.startRow===null&&(this.startRow=R,g=d),this.endRow=R),h.push(u),u+=d,p=d,e!==yn&&(this.endRow=R),u>=a+s-l){c=!1;break}const v=i+s-l,S=e===yn?g:0,y=e===yn?0:p;if(v<S||i>h.at(-1)+y?this.isVisibleInTrimmingContainer=!1:this.isVisibleInTrimmingContainer=!0,this.endRow===o-1&&c)for(this.startRow=this.endRow;this.startRow>0;){const R=h[this.endRow]+d-h[this.startRow-1];if((R<=s-l||e!==yn)&&(this.startRow-=1),R>=s-l)break}e===Go&&this.startRow!==null&&n&&n(this),this.startPosition=h[this.startRow],this.startPosition===void 0&&(this.startPosition=null),o<this.endRow&&(this.endRow=o-1),this.startRow!==null&&(this.count=this.endRow-this.startRow+1)}}function lK(t,e,n){uK(t,e),e.set(t,n)}function uK(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function e0(t,e,n){return e=cK(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function cK(t){var e=hK(t,"string");return typeof e=="symbol"?e:String(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||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Oa(t,e){var n=l1(t,e,"get");return dK(t,n)}function dK(t,e){return e.get?e.get.call(t):e.value}function t0(t,e,n){var r=l1(t,e,"set");return fK(t,r,n),n}function l1(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}function fK(t,e,n){if(e.set)e.set.call(t,n);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=n}}var Ui=new WeakMap;class Hf{constructor(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;e0(this,"row",null),e0(this,"col",null),lK(this,Ui,{writable:!0,value:!1}),t0(this,Ui,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 Oa(this,Ui)}isSouthEastOf(e){return this.row>=e.row&&(Oa(this,Ui)?this.col<=e.col:this.col>=e.col)}isNorthWestOf(e){return this.row<=e.row&&(Oa(this,Ui)?this.col>=e.col:this.col<=e.col)}isSouthWestOf(e){return this.row>=e.row&&(Oa(this,Ui)?this.col>=e.col:this.col<=e.col)}isNorthEastOf(e){return this.row<=e.row&&(Oa(this,Ui)?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 Hf&&t0(this,Ui,e.isRtl()),this}clone(){return new Hf(this.row,this.col,Oa(this,Ui))}toObject(){return{row:this.row,col:this.col}}}const Df=Hf;function gK(t,e,n){mK(t,e),e.set(t,n)}function mK(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function mw(t,e,n){return e=pK(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function pK(t){var e=wK(t,"string");return typeof e=="symbol"?e:String(e)}function wK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function vr(t,e){var n=u1(t,e,"get");return vK(t,n)}function vK(t,e){return e.get?e.get.call(t):e.value}function CK(t,e,n){var r=u1(t,e,"set");return SK(t,r,n),n}function u1(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}function SK(t,e,n){if(e.set)e.set.call(t,n);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=n}}var zn=new WeakMap;class Jy{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;mw(this,"highlight",null),mw(this,"from",null),mw(this,"to",null),gK(this,zn,{writable:!0,value:!1}),this.highlight=e.clone(),this.from=n.clone(),this.to=r.clone(),CK(this,zn,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}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}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){if(this.includesRange(e)||!this.overlaps(e))return!1;const n=this.getOuterTopStartCorner(),r=this.getOuterBottomEndCorner(),i=this.getDirection(),o=e.getOuterTopStartCorner(),s=e.getOuterBottomEndCorner(),a=Math.min(n.row,o.row),l=Math.min(n.col,o.col),u=Math.max(r.row,s.row),c=Math.max(r.col,s.col),h=this._createCellCoords(a,l),d=this._createCellCoords(u,c);return this.from=h,this.to=d,this.setDirection(i),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 vr(this,zn)?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 vr(this,zn)?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 vr(this,zn)?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 vr(this,zn)?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 vr(this,zn)?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 vr(this,zn)?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 vr(this,zn)?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 vr(this,zn)?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 Df))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(vr(this,zn)?"left":"right"),n.bottom===r.bottom&&i.push("bottom"),n.left===r.left&&i.push(vr(this,zn)?"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 Jy(this.highlight,this.from,this.to,vr(this,zn))}toObject(){return{from:this.from.toObject(),to:this.to.toObject()}}_createCellCoords(e,n){return new Df(e,n,vr(this,zn))}}const eb=Jy;function ui(t,e,n){yK(t,e),e.set(t,n)}function yK(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ce(t,e){var n=c1(t,e,"get");return bK(t,n)}function bK(t,e){return e.get?e.get.call(t):e.value}function Po(t,e,n){var r=c1(t,e,"set");return RK(t,r,n),n}function c1(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}function RK(t,e,n){if(e.set)e.set.call(t,n);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=n}}var Cr=new WeakMap,pw=new WeakMap,on=new WeakMap,Ia=new WeakMap,xh=new WeakMap,kr=new WeakMap,ww=new WeakMap,su=new WeakMap,_s=new WeakMap,ci=new WeakMap;let EK=class{constructor(e,n,r,i,o,s){let a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:null;ui(this,Cr,{writable:!0,value:void 0}),ui(this,pw,{writable:!0,value:void 0}),ui(this,on,{writable:!0,value:void 0}),ui(this,Ia,{writable:!0,value:void 0}),ui(this,xh,{writable:!0,value:void 0}),ui(this,kr,{writable:!0,value:void 0}),ui(this,ww,{writable:!0,value:void 0}),ui(this,su,{writable:!0,value:void 0}),ui(this,_s,{writable:!0,value:[null,null]}),ui(this,ci,{writable:!0,value:[null,null]}),Po(this,Cr,r),Po(this,pw,n),Po(this,on,o),Po(this,Ia,s),Po(this,xh,a),Po(this,kr,i),Po(this,ww,e),this.registerEvents()}registerEvents(){Ce(this,kr).addEventListener(Ce(this,on).holder,"contextmenu",r=>this.onContextMenu(r)),Ce(this,kr).addEventListener(Ce(this,on).TABLE,"mouseover",r=>this.onMouseOver(r)),Ce(this,kr).addEventListener(Ce(this,on).TABLE,"mouseout",r=>this.onMouseOut(r));const e=()=>{Ce(this,kr).addEventListener(Ce(this,on).holder,"touchstart",r=>this.onTouchStart(r)),Ce(this,kr).addEventListener(Ce(this,on).holder,"touchend",r=>this.onTouchEnd(r)),this.momentumScrolling||(this.momentumScrolling={}),Ce(this,kr).addEventListener(Ce(this,on).holder,"scroll",()=>{clearTimeout(this.momentumScrolling._timeout),this.momentumScrolling.ongoing||Ce(this,Cr).getSetting("onBeforeTouchScroll"),this.momentumScrolling.ongoing=!0,this.momentumScrolling._timeout=setTimeout(()=>{this.touchApplied||(this.momentumScrolling.ongoing=!1,Ce(this,Cr).getSetting("onAfterMomentumScroll"))},200)})},n=()=>{Ce(this,kr).addEventListener(Ce(this,on).holder,"mouseup",r=>this.onMouseUp(r)),Ce(this,kr).addEventListener(Ce(this,on).holder,"mousedown",r=>this.onMouseDown(r))};uo()?e():(Vy()&&e(),n())}selectedCellWasTouched(e){const r=this.parentCell(e).coords;if(Ce(this,su)&&r){const[i,o]=[r.row,Ce(this,su).from.row],[s,a]=[r.col,Ce(this,su).from.col];return i===o&&s===a}return!1}parentCell(e){const n={},r=Ce(this,on).TABLE,i=zu(e,["TD","TH"],r);return i?(n.coords=Ce(this,on).getCoords(i),n.TD=i):Ie(e,"wtBorder")&&Ie(e,"current")?(n.coords=Ce(this,Ia).getFocusSelection().cellRange.highlight,n.TD=Ce(this,on).getCell(n.coords)):Ie(e,"wtBorder")&&Ie(e,"area")&&Ce(this,Ia).getAreaSelection().cellRange&&(n.coords=Ce(this,Ia).getAreaSelection().cellRange.to,n.TD=Ce(this,on).getCell(n.coords)),n}onMouseDown(e){const n=Ce(this,pw).rootDocument.activeElement,r=Wy(gx,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);Ie(i,"corner")?Ce(this,Cr).getSetting("onCellCornerMouseDown",e,i):o.TD&&Ce(this,Cr).has("onCellMouseDown")&&this.callListener("onCellMouseDown",e,o.coords,o.TD),(e.button===0||this.touchApplied)&&o.TD&&(Ce(this,ci)[0]=o.TD,clearTimeout(Ce(this,_s)[0]),Ce(this,_s)[0]=setTimeout(()=>{Ce(this,ci)[0]=null},1e3))}onContextMenu(e){if(Ce(this,Cr).has("onCellContextMenu")){const n=this.parentCell(e.target);n.TD&&this.callListener("onCellContextMenu",e,n.coords,n.TD)}}onMouseOver(e){if(!Ce(this,Cr).has("onCellMouseOver"))return;const n=Ce(this,on).TABLE,r=zu(e.target,["TD","TH"],n),i=Ce(this,xh)||this;r&&r!==i.lastMouseOver&&os(r,n)&&(i.lastMouseOver=r,this.callListener("onCellMouseOver",e,Ce(this,on).getCoords(r),r))}onMouseOut(e){if(!Ce(this,Cr).has("onCellMouseOut"))return;const n=Ce(this,on).TABLE,r=zu(e.target,["TD","TH"],n),i=zu(e.relatedTarget,["TD","TH"],n),o=Ce(this,xh)||this;r&&r!==i&&os(r,n)&&(this.callListener("onCellMouseOut",e,Ce(this,on).getCoords(r),r),i===null&&(o.lastMouseOver=null))}onMouseUp(e){const n=this.parentCell(e.target);n.TD&&Ce(this,Cr).has("onCellMouseUp")&&this.callListener("onCellMouseUp",e,n.coords,n.TD),!(e.button!==0&&!this.touchApplied)&&(n.TD===Ce(this,ci)[0]&&n.TD===Ce(this,ci)[1]?(Ie(e.target,"corner")?this.callListener("onCellCornerDblClick",e,n.coords,n.TD):this.callListener("onCellDblClick",e,n.coords,n.TD),Ce(this,ci)[0]=null,Ce(this,ci)[1]=null):n.TD===Ce(this,ci)[0]&&(Ce(this,ci)[1]=n.TD,clearTimeout(Ce(this,_s)[1]),Ce(this,_s)[1]=setTimeout(()=>{Ce(this,ci)[1]=null},500)))}onTouchStart(e){Po(this,su,Ce(this,Ia).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=ue(i)&&i.row>=0&&i.col>=0;if(e.cancelable&&o&&Ce(this,Cr).getSetting("isDataViewInstance")){const a=["A","BUTTON","INPUT"];Yy()&&($x()||kx())&&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=Ce(this,Cr).getSettingPure(e);o&&o(n,r,i,Ce(this,ww).call(this))}destroy(){clearTimeout(Ce(this,_s)[0]),clearTimeout(Ce(this,_s)[1]),Ce(this,kr).destroy()}};const h1=EK;function vw(t,e,n){return e=TK(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function TK(t){var e=_K(t,"string");return typeof e=="symbol"?e:String(e)}function _K(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class MK{constructor(e,n,r){vw(this,"offset",void 0),vw(this,"total",void 0),vw(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))}}const AK=MK;function Cw(t,e,n){return e=OK(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function OK(t){var e=IK(t,"string");return typeof e=="symbol"?e:String(e)}function IK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class PK{constructor(e,n,r){Cw(this,"offset",void 0),Cw(this,"total",void 0),Cw(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))}}const xK=PK,HK=0,Nf=1,Lf=2;function Hh(t,e,n){return e=DK(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function DK(t){var e=NK(t,"string");return typeof e=="symbol"?e:String(e)}function NK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class n0{constructor(){Hh(this,"currentSize",0),Hh(this,"nextSize",0),Hh(this,"currentOffset",0),Hh(this,"nextOffset",0)}setSize(e){this.currentSize=this.nextSize,this.nextSize=e}setOffset(e){this.currentOffset=this.nextOffset,this.nextOffset=e}}function Sw(t,e,n){return e=LK(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function LK(t){var e=$K(t,"string");return typeof e=="symbol"?e:String(e)}function $K(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class kK{constructor(){Sw(this,"size",new n0),Sw(this,"workingSpace",HK),Sw(this,"sharedSize",null)}setSize(e){this.size.setSize(e)}setOffset(e){this.size.setOffset(e)}getViewSize(){return this.size}isShared(){return this.sharedSize instanceof n0}isPlaceOn(e){return this.workingSpace===e}append(e){this.workingSpace=Nf,e.workingSpace=Lf,this.sharedSize=e.getViewSize()}prepend(e){this.workingSpace=Lf,e.workingSpace=Nf,this.sharedSize=e.getViewSize()}}function Pa(t,e,n){return e=FK(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function FK(t){var e=WK(t,"string");return typeof e=="symbol"?e:String(e)}function WK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class d1{constructor(e,n,r){Pa(this,"rootNode",void 0),Pa(this,"nodesPool",void 0),Pa(this,"sizeSet",new kK),Pa(this,"childNodeType",void 0),Pa(this,"visualIndex",0),Pa(this,"collectedNodes",[]),this.rootNode=e,this.nodesPool=n,this.childNodeType=r.toUpperCase()}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}getRenderedChildCount(){const{rootNode:e,sizeSet:n}=this;let r=0;if(this.isSharedViewSet()){let i=e.firstElementChild;for(;i;){if(i.tagName===this.childNodeType)r+=1;else if(n.isPlaceOn(Nf))break;i=i.nextElementSibling}}else r=e.childElementCount;return r}start(){this.collectedNodes.length=0,this.visualIndex=0;const{rootNode:e,sizeSet:n}=this,r=this.isSharedViewSet(),{nextSize:i}=n.getViewSize();let o=this.getRenderedChildCount();for(;o<i;){const a=this.nodesPool();!r||r&&n.isPlaceOn(Lf)?e.appendChild(a):e.insertBefore(a,e.firstChild),o+=1}const s=r&&n.isPlaceOn(Nf);for(;o>i;)e.removeChild(s?e.firstChild:e.lastChild),o-=1}render(){const{rootNode:e,sizeSet:n}=this;let r=this.visualIndex;this.isSharedViewSet()&&n.isPlaceOn(Lf)&&(r+=n.sharedSize.nextSize);let i=e.childNodes[r];if(i.tagName!==this.childNodeType){const o=this.nodesPool();e.replaceChild(o,i),i=o}this.collectedNodes.push(i),this.visualIndex+=1}end(){}}class f1 extends d1{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 VK(t,e,n){return e=BK(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function BK(t){var e=UK(t,"string");return typeof e=="symbol"?e:String(e)}function UK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class YK{constructor(e){VK(this,"nodeType",void 0),this.nodeType=e.toUpperCase()}setRootDocument(e){this.rootDocument=e}obtain(){return this.rootDocument.createElement(this.nodeType)}}function au(t,e,n){return e=GK(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function GK(t){var e=zK(t,"string");return typeof e=="symbol"?e:String(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||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Qc{constructor(e,n){au(this,"nodesPool",null),au(this,"nodeType",void 0),au(this,"rootNode",void 0),au(this,"table",null),au(this,"renderedNodes",0),this.nodesPool=typeof e=="string"?new YK(e):null,this.nodeType=e,this.rootNode=n}setTable(e){this.nodesPool&&this.nodesPool.setRootDocument(e.rootDocument),this.table=e}adjust(){}render(){}}function r0(t,e,n){return e=jK(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function jK(t){var e=KK(t,"string");return typeof e=="symbol"?e:String(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||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class XK extends Qc{constructor(){super("TH"),r0(this,"orderViews",new WeakMap),r0(this,"sourceRowIndex",0)}obtainOrderView(e){let n;return this.orderViews.has(e)?n=this.orderViews.get(e):(n=new f1(e,r=>this.nodesPool.obtain(this.sourceRowIndex,r),this.nodeType),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(this.table.renderedColumnToSource(0)).start();for(let h=0;h<r;h++){u.render();const d=u.getCurrentNode();d.className="",d.removeAttribute("style"),Ca(d,[new RegExp("aria-(.*)"),new RegExp("role")]),this.table.isAriaEnabled()&&Ee(d,[vG(),_G(),Iy(h+1),Vl(-1)]),n[h](a,d,h)}u.end()}}}class qK extends Qc{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&&oi(r)}render(){const{columnHeadersCount:e}=this.table;this.table.isAriaEnabled()&&Ee(this.rootNode,[ux()]);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()&&Ee(s,[BC(),fx(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"),Ca(u,[new RegExp("aria-(.*)"),new RegExp("role")]),this.table.isAriaEnabled()&&Ee(u,[Iy(a+1+this.table.rowHeadersCount),Vl(-1),CG(),...a>=0?[TG()]:[BC()]]),r[n](l,u,n)}}}}let i0=!1;class ZK extends Qc{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;!i0&&e>1e3&&(i0=!0,gt(ht`Performance tip: Handsontable rendered more than 1000 visible columns.\x20
Consider limiting the number of rendered columns by specifying the table width and/or\x20
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.getStretchedColumnWidth(o);this.rootNode.childNodes[i+n].style.width=`${s}px`}const r=this.rootNode.firstChild;r&&q(r,"rowHeader")}}function QK(t,e,n){return e=JK(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function JK(t){var e=e3(t,"string");return typeof e=="symbol"?e:String(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||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}let o0=!1;class t3 extends Qc{constructor(e){super("TR",e),QK(this,"orderView",void 0),this.orderView=new d1(e,n=>this.nodesPool.obtain(n),this.nodeType)}getRenderedNode(e){return this.orderView.getNode(e)}render(){const{rowsToRender:e}=this.table;!o0&&e>1e3&&(o0=!0,gt(ht`Performance tip: Handsontable rendered more than 1000 visible rows.\x20
Consider limiting the number of rendered rows by specifying the table height and/or\x20
turning off the "renderAllRows" option.`)),this.table.isAriaEnabled()&&Ee(this.rootNode,[ux()]),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;Ee(o,[BC(),fx(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)])}}this.orderView.end()}}function s0(t,e,n){return e=n3(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function n3(t){var e=r3(t,"string");return typeof e=="symbol"?e:String(e)}function r3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class i3 extends Qc{constructor(){super("TD"),s0(this,"orderViews",new WeakMap),s0(this,"sourceRowIndex",0)}obtainOrderView(e){let n;return this.orderViews.has(e)?n=this.orderViews.get(e):(n=new f1(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(this.table.renderedColumnToSource(0)).start();for(let d=0;d<n;d++){c.render();const g=c.getCurrentNode(),p=this.table.renderedColumnToSource(d);if(Ie(g,"hide")||(g.className=""),g.removeAttribute("style"),g.removeAttribute("dir"),Ca(g,[new RegExp("aria-(.*)"),new RegExp("role")]),this.table.cellRenderer(l,p,g),this.table.isAriaEnabled()){var o,s;Ee(g,[...g.hasAttribute("role")?[]:[wG()],Vl(-1),Iy(p+((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 sn(t,e,n){return e=o3(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function o3(t){var e=s3(t,"string");return typeof e=="symbol"?e:String(e)}function s3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class a3{constructor(e){let{cellRenderer:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};sn(this,"rootNode",void 0),sn(this,"rootDocument",void 0),sn(this,"rowHeaders",null),sn(this,"columnHeaders",null),sn(this,"colGroup",null),sn(this,"rows",null),sn(this,"cells",null),sn(this,"rowFilter",null),sn(this,"columnFilter",null),sn(this,"rowUtils",null),sn(this,"columnUtils",null),sn(this,"rowsToRender",0),sn(this,"columnsToRender",0),sn(this,"rowHeaderFunctions",[]),sn(this,"rowHeadersCount",0),sn(this,"columnHeaderFunctions",[]),sn(this,"columnHeadersCount",0),sn(this,"cellRenderer",void 0),this.rootNode=e,this.rootDocument=this.rootNode.ownerDocument,this.cellRenderer=n}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);if(i.firstChild){const o=this.renderedRowToSource(r),s=this.rowUtils.getHeight(o);s?i.firstChild.style.height=`${s-1}px`:i.firstChild.style.height=""}}}}class l3{constructor(){let{TABLE:e,THEAD:n,COLGROUP:r,TBODY:i,rowUtils:o,columnUtils:s,cellRenderer:a}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.renderer=new a3(e,{cellRenderer:a}),this.renderer.setRenderers({rowHeaders:new XK,columnHeaders:new qK(n),colGroup:new ZK(r),rows:new t3(i),cells:new i3}),this.renderer.setAxisUtils(o,s)}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 lu(t,e,n){u3(t,e),e.set(t,n)}function u3(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Dh(t,e,n){return e=c3(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function c3(t){var e=h3(t,"string");return typeof e=="symbol"?e:String(e)}function h3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function pn(t,e){var n=g1(t,e,"get");return d3(t,n)}function d3(t,e){return e.get?e.get.call(t):e.value}function uu(t,e,n){var r=g1(t,e,"set");return f3(t,r,n),n}function g1(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}function f3(t,e,n){if(e.set)e.set.call(t,n);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=n}}var Nh=new WeakMap,xa=new WeakMap,cu=new WeakMap,Lh=new WeakMap,Ms=new WeakMap;class tb{static get DEFAULT_WIDTH(){return 50}constructor(e){let{totalColumns:n,stretchMode:r,stretchingColumnWidthFn:i,columnWidthFn:o}=e;Dh(this,"stretchAllRatio",0),Dh(this,"stretchLastWidth",0),Dh(this,"stretchAllColumnsWidth",[]),lu(this,Nh,{writable:!0,value:0}),Dh(this,"needVerifyLastColumnWidth",!0),lu(this,xa,{writable:!0,value:()=>0}),lu(this,cu,{writable:!0,value:s=>s}),lu(this,Lh,{writable:!0,value:s=>s}),lu(this,Ms,{writable:!0,value:()=>"none"}),uu(this,xa,n),uu(this,Ms,r),uu(this,cu,i??pn(this,cu)),uu(this,Lh,o??pn(this,Lh))}refreshStretching(e){if(pn(this,Ms).call(this)==="none")return;uu(this,Nh,e);let n=0;for(let i=0;i<pn(this,xa).call(this);i++){const o=this._getColumnWidth(i),s=pn(this,cu).call(this,void 0,i);typeof s=="number"?e-=s:n+=o}const r=e-n;if(pn(this,Ms).call(this)==="all"&&r>0)this.stretchAllRatio=e/n,this.stretchAllColumnsWidth=[],this.needVerifyLastColumnWidth=!0;else if(pn(this,Ms).call(this)==="last"&&e!==1/0){const i=this._getColumnWidth(pn(this,xa).call(this)-1),o=r+i;this.stretchLastWidth=o>=0?o:i}}getStretchedColumnWidth(e,n){let r=null;return pn(this,Ms).call(this)==="all"&&this.stretchAllRatio!==0?r=this._getStretchedAllColumnWidth(e,n):pn(this,Ms).call(this)==="last"&&this.stretchLastWidth!==0&&(r=this._getStretchedLastColumnWidth(e)),r}_getStretchedAllColumnWidth(e,n){let r=0;if(!this.stretchAllColumnsWidth[e]){const i=Math.round(n*this.stretchAllRatio),o=pn(this,cu).call(this,i,e);o===void 0?this.stretchAllColumnsWidth[e]=i:this.stretchAllColumnsWidth[e]=isNaN(o)?this._getColumnWidth(e):o}if(this.stretchAllColumnsWidth.length===pn(this,xa).call(this)&&this.needVerifyLastColumnWidth){this.needVerifyLastColumnWidth=!1;for(let i=0;i<this.stretchAllColumnsWidth.length;i++)r+=this.stretchAllColumnsWidth[i];r!==pn(this,Nh)&&(this.stretchAllColumnsWidth[this.stretchAllColumnsWidth.length-1]+=pn(this,Nh)-r)}return this.stretchAllColumnsWidth[e]}_getStretchedLastColumnWidth(e){return e===pn(this,xa).call(this)-1?this.stretchLastWidth:null}_getColumnWidth(e){let n=pn(this,Lh).call(this,e);return isNaN(n)&&(n=tb.DEFAULT_WIDTH),n}}function $h(t,e,n){return e=g3(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function g3(t){var e=m3(t,"string");return typeof e=="symbol"?e:String(e)}function m3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class p3{constructor(e,n){$h(this,"dataAccessObject",void 0),$h(this,"wtSettings",void 0),$h(this,"headerWidths",new Map),$h(this,"stretching",void 0),this.dataAccessObject=e,this.wtSettings=n,this.stretching=new tb({totalColumns:()=>this.wtSettings.getSetting("totalColumns"),stretchMode:()=>this.wtSettings.getSetting("stretchH"),stretchingColumnWidthFn:(r,i)=>this.wtSettings.getSetting("onBeforeStretchingColumnWidth",r,i),columnWidthFn:r=>this.dataAccessObject.wtTable.getColumnWidth(r)})}getWidth(e){return this.wtSettings.getSetting("columnWidth",e)||this.wtSettings.getSetting("defaultColumnWidth")}getStretchedColumnWidth(e){let n=this.getWidth(e);const r=this.stretching.getStretchedColumnWidth(e,n);return r&&(n=r),n}getHeaderHeight(e){let n=this.wtSettings.getSetting("defaultRowHeight");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))}refreshStretching(){const{wtTable:e,wtViewport:n,cloneSource:r}=this.dataAccessObject,i=r?r.wtTable.holder:e.holder,o=i.offsetHeight<i.scrollHeight?nn():0;this.stretching.refreshStretching(n.getViewportWidth()-o)}calculateWidths(){const{wtSettings:e}=this;let n=e.getSetting("rowHeaderWidth");if(this.refreshStretching(),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 a0(t,e,n){return e=w3(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function w3(t){var e=v3(t,"string");return typeof e=="symbol"?e:String(e)}function v3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class C3{constructor(e,n){a0(this,"dataAccessObject",void 0),a0(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}}function hi(t,e,n){return e=S3(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function S3(t){var e=y3(t,"string");return typeof e=="symbol"?e:String(e)}function y3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class b3{constructor(e,n,r,i,o){hi(this,"wtSettings",null),hi(this,"domBindings",void 0),hi(this,"TBODY",null),hi(this,"THEAD",null),hi(this,"COLGROUP",null),hi(this,"hasTableHeight",!0),hi(this,"hasTableWidth",!0),hi(this,"isTableVisible",!1),hi(this,"tableOffset",0),hi(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,xy(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 C3(this.dataAccessObject,this.wtSettings),this.columnUtils=new p3(this.dataAccessObject,this.wtSettings),this.tableRenderer=new l3({TABLE:this.TABLE,THEAD:this.THEAD,COLGROUP:this.COLGROUP,TBODY:this.TBODY,rowUtils:this.rowUtils,columnUtils:this.columnUtils,cellRenderer:this.wtSettings.getSettingPure("cellRenderer")})}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||!Ie(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")&&Ee(r,[Pi()]),r}createHider(e){const n=e.parentNode;let r;return(!n||n.nodeType!==Node.ELEMENT_NODE||!Ie(n,"wtHolder"))&&(r=this.domBindings.rootDocument.createElement("div"),r.className="wtHider",n&&n.insertBefore(r,e),r.appendChild(e)),this.wtSettings.getSetting("ariaTags")&&Ee(r,[Pi()]),r}createHolder(e){const n=e.parentNode;let r;return(!n||n.nodeType!==Node.ELEMENT_NODE||!Ie(n,"wtHolder"))&&(r=this.domBindings.rootDocument.createElement("div"),r.style.position="relative",r.className="wtHolder",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")&&Ee(r.parentNode,[Pi()])),r.appendChild(e)),this.wtSettings.getSetting("ariaTags")&&Ee(r,[Pi()]),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=!1,d=e;if(this.isMaster&&(this.holderOffset=en(this.holder),d=i.createRenderCalculators(d),l&&!n.getSetting("fixedColumnsStart"))){const p=r.inlineStartOverlay.getScrollPosition(),v=this.correctHeaderWidth;this.correctHeaderWidth=p!==0,v!==this.correctHeaderWidth&&(d=!1)}if(this.isMaster&&(h=r.updateStateOfRendering()),d)this.isMaster&&i.createVisibleCalculators(),r&&r.refresh(!0);else{this.isMaster?this.tableOffset=en(this.TABLE):this.tableOffset=this.dataAccessObject.parentTableOffset;const p=o>0?this.getFirstRenderedRow():0,v=s>0?this.getFirstRenderedColumn():0;this.rowFilter=new xK(p,o,c),this.columnFilter=new AK(v,s,l);let S=!0;if(this.isMaster){this.alignOverlaysWithTrimmingContainer();const y={};this.wtSettings.getSetting("beforeDraw",!0,y),S=y.skipRender!==!0}if(S){this.tableRenderer.setHeaderContentRenderers(a,u),(this.is(Oi)||this.is(as))&&this.tableRenderer.setHeaderContentRenderers(a,[]),this.resetOversizedRows(),this.tableRenderer.setViewportSize(this.getRenderedRowsCount(),this.getRenderedColumnsCount()).setFilters(this.rowFilter,this.columnFilter).render();let y;if(this.isMaster&&(y=this.dataAccessObject.workspaceWidth,this.dataAccessObject.wtViewport.containerWidth=null,this.markOversizedColumnHeaders()),this.adjustColumnHeaderHeights(),(this.isMaster||this.is(Oi))&&this.markOversizedRows(),this.isMaster){this.dataAccessObject.wtViewport.createVisibleCalculators(),this.dataAccessObject.wtOverlays.refresh(!1),this.dataAccessObject.wtOverlays.applyToDOM();const R=ft(this.hider),T=ft(this.TABLE);R!==0&&T!==R&&(this.columnUtils.calculateWidths(),this.tableRenderer.renderer.colGroup.render()),y!==this.dataAccessObject.wtViewport.getWorkspaceWidth()&&(this.dataAccessObject.wtViewport.containerWidth=null,this.columnUtils.calculateWidths(),this.tableRenderer.renderer.colGroup.render()),this.wtSettings.getSetting("onDraw",!0)}else this.is(Oi)&&this.dataAccessObject.cloneSource.wtOverlays.adjustElementsSize()}}let g=!1;return this.isMaster&&(g=r.topOverlay.resetFixedPosition(),r.bottomOverlay.clone&&(g=r.bottomOverlay.resetFixedPosition()||g),g=r.inlineStartOverlay.resetFixedPosition()||g,r.topInlineStartCornerOverlay&&r.topInlineStartCornerOverlay.resetFixedPosition(),r.bottomInlineStartCornerOverlay&&r.bottomInlineStartCornerOverlay.clone&&r.bottomInlineStartCornerOverlay.resetFixedPosition()),g?(r.refreshAll(),r.adjustElementsSize()):this.dataAccessObject.selectionManager.setActiveOverlay(this.facadeGetter()).render(d),h&&r.syncScrollWithMaster(),this.dataAccessObject.drawn=!0,this}markIfOversizedColumnHeader(e){const n=this.columnFilter.renderedToSource(e);let r=this.wtSettings.getSetting("columnHeaders").length;const i=this.wtSettings.getSetting("defaultRowHeight");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=ra(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(Oi))&&!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);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=cs(n,["TD","TH"])),n===null)return null;const r=n.parentNode,i=r.parentNode;let o=wx(r),s=n.cellIndex;return Uo(fa,n,this.wtRootElement)||Uo(ha,n,this.wtRootElement)?i.nodeName==="THEAD"&&(o-=i.childNodes.length):Uo(as,n,this.wtRootElement)||Uo(Oi,n,this.wtRootElement)?o=this.wtSettings.getSetting("totalRows")-i.childNodes.length+o:i===this.THEAD?o=this.rowFilter.visibleColHeadedRowToSourceRow(o):o=this.rowFilter.renderedToSource(o),Uo(fa,n,this.wtRootElement)||Uo(da,n,this.wtRootElement)||Uo(as,n,this.wtRootElement)?s=this.columnFilter.offsettedTH(s):s=this.columnFilter.visibleRowHeadedColumnToSourceColumn(s),this.wot.createCellCoords(o,s)}markOversizedRows(){if(this.wtSettings.getSetting("externalRowCalculator"))return;let e=this.TBODY.childNodes.length;const n=e*this.wtSettings.getSetting("defaultRowHeight"),r=ra(this.TBODY)-1;let i,o,s,a,l;if(!(n===r&&!this.wtSettings.getSetting("fixedRowsBottom")))for(;e;)e-=1,s=this.rowFilter.renderedToSource(e),i=this.getRowHeight(s),a=this.getTrForRow(s),l=a.querySelector("th"),l?o=ra(l):o=ra(a)-1,(!i&&this.wtSettings.getSetting("defaultRowHeight")<o||i<o)&&(o+=1,this.dataAccessObject.wtViewport.oversizedRows[s]=o)}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)}getStretchedColumnWidth(e){return this.columnUtils.getStretchedColumnWidth(e)}hasDefinedSize(){return this.hasTableHeight&&this.hasTableWidth}getWidth(){return ft(this.TABLE)}getHeight(){return Pt(this.TABLE)}getTotalWidth(){const e=ft(this.hider);return e!==0?e:this.getWidth()}getTotalHeight(){const e=Pt(this.hider);return e!==0?e:this.getHeight()}isVisible(){return ds(this.TABLE)}_modifyRowHeaderWidth(e){let n=vt(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 Yl=b3,R3="stickyRowsBottom",m1={getFirstRenderedRow(){const t=this.wtSettings.getSetting("totalRows"),e=this.wtSettings.getSetting("fixedRowsBottom"),n=t-e;return t===0||e===0?-1:n<0?0:n},getFirstVisibleRow(){return this.getFirstRenderedRow()},getLastRenderedRow(){return this.wtSettings.getSetting("totalRows")-1},getLastVisibleRow(){return this.getLastRenderedRow()},getRenderedRowsCount(){const t=this.wtSettings.getSetting("totalRows");return Math.min(this.wtSettings.getSetting("fixedRowsBottom"),t)},getVisibleRowsCount(){return this.getRenderedRowsCount()},getColumnHeadersCount(){return 0}};Fi(m1,"MIXIN_NAME",R3,{writable:!1,enumerable:!1});const p1=m1,E3="stickyColumnsStart",w1={getFirstRenderedColumn(){return this.wtSettings.getSetting("totalColumns")===0?-1:0},getFirstVisibleColumn(){return this.getFirstRenderedColumn()},getLastRenderedColumn(){return this.getRenderedColumnsCount()-1},getLastVisibleColumn(){return this.getLastRenderedColumn()},getRenderedColumnsCount(){const t=this.wtSettings.getSetting("totalColumns");return Math.min(this.wtSettings.getSetting("fixedColumnsStart"),t)},getVisibleColumnsCount(){return this.getRenderedColumnsCount()},getRowHeadersCount(){return this.dataAccessObject.rowHeaders.length}};Fi(w1,"MIXIN_NAME",E3,{writable:!1,enumerable:!1});const nb=w1;class rb extends Yl{constructor(e,n,r,i){super(e,n,r,i,as)}}pt(rb,p1);pt(rb,nb);const T3=rb,ha="top",Oi="bottom",da="inline_start",fa="top_inline_start_corner",as="bottom_inline_start_corner",_3=[ha,Oi,da,fa,as],M3=new Map([[ha,`ht_clone_${ha}`],[Oi,`ht_clone_${Oi}`],[da,`ht_clone_${da} ht_clone_left`],[fa,`ht_clone_${fa} ht_clone_top_left_corner`],[as,`ht_clone_${as} ht_clone_bottom_left_corner`]]);function yw(t,e,n){return e=A3(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function A3(t){var e=O3(t,"string");return typeof e=="symbol"?e:String(e)}function O3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class I3{constructor(e){yw(this,"dataAccessObject",void 0),yw(this,"lastScrolledColumnPos",-1),yw(this,"lastScrolledRowPos",-1),this.dataAccessObject=e}scrollViewport(e,n,r,i,o){const s=this.scrollViewportHorizontally(e.col,r,o),a=this.scrollViewportVertically(e.row,n,i);return s||a}scrollViewportHorizontally(e,n,r){const{drawn:i,totalColumns:o}=this.dataAccessObject;if(!i||!Number.isInteger(e)||e<0||e>o)return!1;const s=this.getFirstVisibleColumn(),a=this.getLastVisibleColumn(),l=n===void 0&&r===void 0,{fixedColumnsStart:u,inlineStartOverlay:c}=this.dataAccessObject;if(l&&e<u)return!1;let h=!1;return e=this.dataAccessObject.wtSettings.getSetting("onBeforeViewportScrollHorizontally",e),s===-1?h=c.scrollTo(e,l?e>this.lastScrolledColumnPos:n):(l&&(e<s||e>a)||!l)&&(h=c.scrollTo(e,l?e>a:n)),h&&(this.lastScrolledColumnPos=e),h}scrollViewportVertically(e,n,r){const{drawn:i,totalRows:o}=this.dataAccessObject;if(!i||!Number.isInteger(e)||e<0||e>o)return!1;const s=this.getFirstVisibleRow(),a=this.getLastVisibleRow(),l=n===void 0&&r===void 0,{fixedRowsBottom:u,fixedRowsTop:c,topOverlay:h}=this.dataAccessObject;if(l&&(e<c||e>o-u-1))return!1;let d=!1;return e=this.dataAccessObject.wtSettings.getSetting("onBeforeViewportScrollVertically",e),s===-1?d=h.scrollTo(e,l?e>this.lastScrolledRowPos:r):(l&&(e<s||e>a)||!l)&&(d=h.scrollTo(e,l?e>a:r)),d&&(this.lastScrolledRowPos=e),d}getFirstVisibleRow(){return this.dataAccessObject.wtTable.getFirstVisibleRow()}getLastVisibleRow(){const{topOverlay:e,wtTable:n,wtViewport:r,totalRows:i,rootWindow:o}=this.dataAccessObject;let s=n.getLastVisibleRow();if(e.mainTableScrollableElement===o){const a=en(n.wtRootElement),l=Hg(o,o);if(a.top>l){const u=ra(o);let c=r.getColumnHeaderHeight();for(let h=1;h<=i;h++)if(c+=e.sumCellSizes(h-1,h),a.top+c-l>=u){s=h-2;break}}}return s}getFirstVisibleColumn(){return this.dataAccessObject.wtTable.getFirstVisibleColumn()}getLastVisibleColumn(){const{wtSettings:e,inlineStartOverlay:n,wtTable:r,wtViewport:i,totalColumns:o,rootWindow:s}=this.dataAccessObject;let a=r.getLastVisibleColumn();if(n.mainTableScrollableElement===s){const l=e.getSetting("rtlMode");let u=null;if(l){const h=r.TABLE.getBoundingClientRect(),g=this.dataAccessObject.rootWindow.document.documentElement.offsetWidth;u=Math.abs(h.right-g)}else u=en(r.wtRootElement).left;const c=Math.abs(Dy(s,s));if(u>c){const h=Ny(s);let d=i.getRowHeaderWidth();for(let g=1;g<=o;g++)if(d+=n.sumCellSizes(g-1,g),u+d-c>=h){a=g-2;break}}}return a}}const P3=I3;function Fr(t,e,n){return e=x3(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function x3(t){var e=H3(t,"string");return typeof e=="symbol"?e:String(e)}function H3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class ib{get eventManager(){return new xr(this)}constructor(e,n){Fr(this,"wtTable",void 0),Fr(this,"wtScroll",void 0),Fr(this,"wtViewport",void 0),Fr(this,"wtOverlays",void 0),Fr(this,"selectionManager",void 0),Fr(this,"wtEvent",void 0),Fr(this,"guid",`wt_${_y()}`),Fr(this,"drawInterrupted",!1),Fr(this,"drawn",!1),Fr(this,"domBindings",void 0),Fr(this,"wtSettings",void 0),this.domBindings={rootTable:e,rootDocument:e.ownerDocument,rootWindow:e.ownerDocument.defaultView},this.wtSettings=n,this.wtScroll=new P3(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){hs(r,e[n])}])}}createCellCoords(e,n){return new Df(e,n,this.wtSettings.getSetting("rtlMode"))}createCellRange(e,n,r){return new eb(e,n,r,this.wtSettings.getSetting("rtlMode"))}draw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return this.drawInterrupted=!1,!e&&!this.wtTable.isVisible()?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,i,o){return e.col<0||e.row<0?!1:this.wtScroll.scrollViewport(e,n,r,i,o)}scrollViewportHorizontally(e,n,r){return e<0?!1:this.wtScroll.scrollViewportHorizontally(e,n,r)}scrollViewportVertically(e,n,r){return e<0?!1:this.wtScroll.scrollViewportVertically(e,n,r)}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 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 endColumnRendered(){return e.wtViewport.columnsRenderCalculator.endColumn},get endColumnVisible(){return e.wtViewport.columnsVisibleCalculator.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 endRowRendered(){return e.wtViewport.rowsRenderCalculator.endRow},get endRowVisible(){return e.wtViewport.rowsVisibleCalculator.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 l0(t,e,n){return e=D3(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function D3(t){var e=N3(t,"string");return typeof e=="symbol"?e:String(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||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class L3 extends ib{constructor(e,n,r){super(e,n),l0(this,"cloneSource",void 0),l0(this,"cloneOverlay",void 0);const i=this.wtSettings.getSetting("facade",this);this.cloneSource=r.source,this.cloneOverlay=r.overlay,this.wtTable=this.cloneOverlay.createTable(this.getTableDao(),i,this.domBindings,this.wtSettings),this.wtViewport=r.viewport,this.selectionManager=r.selectionManager,this.wtEvent=new h1(i,this.domBindings,this.wtSettings,this.eventManager,this.wtTable,this.selectionManager,r.event),this.findOriginalHeaders()}}function $3(t,e,n){return e=k3(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function k3(t){var e=F3(t,"string");return typeof e=="symbol"?e:String(e)}function F3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Jc{constructor(e,n,r,i,o){$3(this,"wtSettings",null),Fi(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=ca(this.hider.parentNode.parentNode),this.updateStateOfRendering(),this.clone=this.makeClone()}updateStateOfRendering(){const e=this.needFullRender;this.needFullRender=this.shouldBeRendered();const n=e!==this.needFullRender;return n&&!this.needFullRender&&this.reset(),n}shouldBeRendered(){return!0}updateTrimmingContainer(){this.trimmingContainer=ca(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=Tc(e.TABLE)}getRelativeCellPosition(e,n,r){if(this.clone.wtTable.holder.contains(e)===!1){gt(`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+nn())),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(_3.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=`${M3.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")&&Ee(o,[Pi()]),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===ha||u==="vertical"&&this.type===da?this.mainTableScrollableElement=i:i.getComputedStyle(a).getPropertyValue("overflow")==="hidden"?this.mainTableScrollableElement=e.holder:this.mainTableScrollableElement=Tc(e.TABLE),new L3(s,this.wtSettings,{source:this.wot,overlay:this,viewport:this.wot.wtViewport,event:this.wot.wtEvent,selectionManager:this.wot.selectionManager})}refresh(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const n=this.shouldBeRendered();this.clone&&(this.needFullRender||n)&&this.clone.draw(e),this.needFullRender=n}reset(){if(!this.clone)return;const e=this.clone.wtTable.holder,n=this.clone.wtTable.hider,r=e.style,i=n.style,o=e.parentNode.style;E([r,i,o],s=>{s.width="",s.height=""})}isRtl(){return this.wtSettings.getSetting("rtlMode")}destroy(){this.clone.eventManager.destroy()}}class W3 extends Jc{constructor(e,n,r,i,o,s){super(e,n,as,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 T3(...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 jc(n),this.repositionOverlay();let r=Pt(this.clone.wtTable.TABLE);const i=ft(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+=nn(r)),i.style.bottom=`${o}px`}}const V3="calculatedColumns",v1={getFirstRenderedColumn(){const t=this.dataAccessObject.startColumnRendered;return t===null?-1:t},getFirstVisibleColumn(){const t=this.dataAccessObject.startColumnVisible;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},getRenderedColumnsCount(){return this.dataAccessObject.countColumnsRendered},getVisibleColumnsCount(){return this.dataAccessObject.countColumnsVisible},getRowHeadersCount(){return this.dataAccessObject.rowHeaders.length}};Fi(v1,"MIXIN_NAME",V3,{writable:!1,enumerable:!1});const ob=v1;class sb extends Yl{constructor(e,n,r,i){super(e,n,r,i,Oi)}}pt(sb,p1);pt(sb,ob);const B3=sb;function U3(t,e,n){return e=Y3(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Y3(t){var e=G3(t,"string");return typeof e=="symbol"?e:String(e)}function G3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class z3 extends Jc{constructor(e,n,r,i){super(e,n,Oi,r,i),U3(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 B3(...n)}shouldBeRendered(){return this.wtSettings.getSetting("shouldRenderBottomOverlay")}resetFixedPosition(){if(!this.needFullRender||!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+=nn(r)),i.style.bottom=`${o}px`}setScrollPosition(e){const{rootWindow:n}=this.domBindings;let r=!1;return this.mainTableScrollableElement===n?(n.scrollTo(xg(n),e),r=!0):this.mainTableScrollableElement.scrollTop!==e&&(this.mainTableScrollableElement.scrollTop=e,r=!0),r}onScroll(){this.wtSettings.getSetting("onScrollHorizontally")}sumCellSizes(e,n){const{wtTable:r,wtSettings:i}=this.wot,o=i.getSetting("defaultRowHeight");let s=e,a=0;for(;s<n;){const l=r.getRowHeight(s);a+=l===void 0?o:l,s+=1}return a}adjustElementsSize(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this.updateTrimmingContainer(),(this.needFullRender||e)&&(this.adjustRootElementSize(),this.adjustRootChildrenSize())}adjustRootElementSize(){const{wtTable:e,wtViewport:n}=this.wot,{rootDocument:r,rootWindow:i}=this.domBindings,o=nn(r),a=this.clone.wtTable.holder.parentNode.style,l=this.wtSettings.getSetting("preventOverflow");if(this.trimmingContainer!==i||l==="horizontal"){let c=n.getWorkspaceWidth();this.wot.wtOverlays.hasScrollbarRight&&(c-=o),c=Math.min(c,e.wtRootElement.scrollWidth),a.width=`${c}px`}else a.width="";this.clone.wtTable.holder.style.width=a.width;let u=Pt(this.clone.wtTable.TABLE);this.wot.wtTable.hasDefinedSize()||(u=0),a.height=`${u}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=nn(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 Hg(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=Ie(s,"innerBorderBottom");this.cachedFixedRowsBottom=this.wtSettings.getSetting("fixedRowsBottom"),e||this.wtSettings.getSetting("totalRows")===0?(q(s,"innerBorderBottom"),o=!a):(Le(s,"innerBorderBottom"),o=a)}return o}}const j3="calculatedRows",C1={getFirstRenderedRow(){const t=this.dataAccessObject.startRowRendered;return t===null?-1:t},getFirstVisibleRow(){const t=this.dataAccessObject.startRowVisible;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},getRenderedRowsCount(){return this.dataAccessObject.countRowsRendered},getVisibleRowsCount(){return this.dataAccessObject.countRowsVisible},getColumnHeadersCount(){return this.dataAccessObject.columnHeaders.length}};Fi(C1,"MIXIN_NAME",j3,{writable:!1,enumerable:!1});const S1=C1;class ab extends Yl{constructor(e,n,r,i){super(e,n,r,i,da)}}pt(ab,S1);pt(ab,nb);const K3=ab,X3="localHooks",y1={_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++)Af(this._localHooks[t][l],this,e,n,r,i,o,s)}},clearLocalHooks(){return this._localHooks={},this}};Fi(y1,"MIXIN_NAME",X3,{writable:!1,enumerable:!1});const or=y1;let b1=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")}};pt(b1,or);const q3=b1,R1="active-header",lb="header",ub="area",cb="focus",Z3="fill",Q3="row",J3="column",eX="custom-selection",hb=Object.freeze({width:"6px",height:"6px",borderWidth:"1px",borderStyle:"solid",borderColor:"#FFF"});var tX=o1;tX("flat");function nX(t,e){E1(t,e),e.add(t)}function u0(t,e,n){E1(t,e),e.set(t,n)}function E1(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function bw(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}function Gt(t,e){var n=T1(t,e,"get");return rX(t,n)}function rX(t,e){return e.get?e.get.call(t):e.value}function c0(t,e,n){var r=T1(t,e,"set");return iX(t,r,n),n}function T1(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}function iX(t,e,n){if(e.set)e.set.call(t,n);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=n}}var Wr=new WeakMap,Xn=new WeakMap,kh=new WeakSet;class oX{constructor(){nX(this,kh),u0(this,Wr,{writable:!0,value:void 0}),u0(this,Xn,{writable:!0,value:void 0})}setActiveOverlay(e){return c0(this,Xn,e),this}setActiveSelection(e){return c0(this,Wr,e),this}scan(){const e=Gt(this,Wr).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]=Gt(this,Wr).getCorners(),{wtTable:s}=Gt(this,Xn),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 g=d+l;let p=s.getColumnHeader(h,g);const v=Gt(this,Xn).getSetting("onBeforeHighlightingColumnHeader",h,g,{selectionType:Gt(this,Wr).settings.selectionType,columnCursor:u,selectionWidth:o-r+1});v!==null&&(v!==h&&(p=s.getColumnHeader(v,g)),e(p))}u+=1}}}scanRowsInHeadersRange(e){const[n,r,i,o]=Gt(this,Wr).getCorners(),{wtTable:s}=Gt(this,Xn),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 g=d+l;let p=s.getRowHeader(h,g);const v=Gt(this,Xn).getSetting("onBeforeHighlightingRowHeader",h,g,{selectionType:Gt(this,Wr).settings.selectionType,rowCursor:u,selectionHeight:i-n+1});v!==null&&(v!==h&&(p=s.getRowHeader(v,g)),e(p))}u+=1}}}scanCellsRange(e){const[n,r,i,o]=Gt(this,Wr).getCorners(),{wtTable:s}=Gt(this,Xn);bw(this,kh,Rw).call(this,(a,l)=>{if(a>=n&&a<=i&&l>=r&&l<=o){const u=s.getCell(Gt(this,Xn).createCellCoords(a,l)),c=Gt(this,Xn).getSetting("onAfterDrawSelection",a,l,Gt(this,Wr).settings.layerLevel);typeof c=="string"&&q(u,c),e(u)}})}scanRowsInCellsRange(e){const[n,,r]=Gt(this,Wr).getCorners(),{wtTable:i}=Gt(this,Xn);bw(this,kh,Rw).call(this,(o,s)=>{if(o>=n&&o<=r){const a=i.getCell(Gt(this,Xn).createCellCoords(o,s));e(a)}})}scanColumnsInCellsRange(e){const[,n,,r]=Gt(this,Wr).getCorners(),{wtTable:i}=Gt(this,Xn);bw(this,kh,Rw).call(this,(o,s)=>{if(s>=n&&s<=r){const a=i.getCell(Gt(this,Xn).createCellCoords(o,s));e(a)}})}}function Rw(t){const{wtTable:e}=Gt(this,Xn),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 sX{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=hb,this.cornerCenterPointOffset=-(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(),Lr(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,this.cornerStyle.height=this.cornerDefaultStyle.height,this.cornerStyle.border=[this.cornerDefaultStyle.borderWidth,this.cornerDefaultStyle.borderStyle,this.cornerDefaultStyle.borderColor].join(" "),uo()&&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}=this.wot;this.selectionHandles={top:e.createElement("DIV"),topHitArea:e.createElement("DIV"),bottom:e.createElement("DIV"),bottomHitArea:e.createElement("DIV")};const n=10,r=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 i={position:"absolute",height:`${r}px`,width:`${r}px`,"border-radius":`${parseInt(r/1.5,10)}px`};Ye(i,(s,a)=>{this.selectionHandles.styles.bottomHitArea[a]=s,this.selectionHandles.styles.topHitArea[a]=s});const o={position:"absolute",height:`${n}px`,width:`${n}px`,"border-radius":`${parseInt(n/1.5,10)}px`,background:"#F5F5FF",border:"1px solid #4285c8"};Ye(o,(s,a)=>{this.selectionHandles.styles.bottom[a]=s,this.selectionHandles.styles.top[a]=s}),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,g=parseInt(u.borderWidth,10),p=parseInt(u.width,10),v=parseInt(c.width,10),S=this.wot.wtTable.getWidth(),y=this.wot.wtTable.getHeight();u.top=`${parseInt(r-p-1,10)}px`,u[l]=`${parseInt(i-p-1,10)}px`,c.top=`${parseInt(r-v/4*3,10)}px`,c[l]=`${parseInt(i-v/4*3,10)}px`;const R=Math.min(parseInt(i+o,10),S-p-g*2),T=Math.min(parseInt(i+o-v/4,10),S-v-g*2);h[l]=`${R}px`,d[l]=`${T}px`;const N=Math.min(parseInt(r+s,10),y-p-g*2),I=Math.min(parseInt(r+s-v/4,10),y-v-g*2);h.top=`${N}px`,d.top=`${I}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;const{wtTable:n,rootDocument:r,rootWindow:i}=this.wot;let o,s,a,l,u,c;const h=n.getRenderedRowsCount();for(let pe=0;pe<h;pe+=1){const f=n.rowFilter.renderedToSource(pe);if(f>=e[0]&&f<=e[2]){o=f,u=e[0];break}}for(let pe=h-1;pe>=0;pe-=1){const f=n.rowFilter.renderedToSource(pe);if(f>=e[0]&&f<=e[2]){s=f;break}}const d=n.getRenderedColumnsCount();for(let pe=0;pe<d;pe+=1){const f=n.columnFilter.renderedToSource(pe);if(f>=e[1]&&f<=e[3]){a=f,c=e[1];break}}for(let pe=d-1;pe>=0;pe-=1){const f=n.columnFilter.renderedToSource(pe);if(f>=e[1]&&f<=e[3]){l=f;break}}if(o===void 0||a===void 0){this.disappear();return}let g=n.getCell(this.wot.createCellCoords(o,a));const p=o!==s||a!==l,v=p?n.getCell(this.wot.createCellCoords(s,l)):g,S=en(g),y=p?en(v):S,R=en(n.TABLE),T=ft(n.TABLE),N=S.top,I=S.left,F=this.wot.wtSettings.getSetting("rtlMode");let B=0,ee=0;if(F){const pe=ft(g),f=i.innerWidth-R.left-T;ee=I+pe-y.left,B=i.innerWidth-I-pe-f-1}else ee=y.left+ft(v)-I,B=I-R.left-1;if(this.isEntireColumnSelected(o,s)){const pe=this.getDimensionsFromHeader("columns",a,l,u,R);let f=null;pe&&([f,B,ee]=pe),f&&(g=f)}let U=N-R.top-1,j=y.top+Pt(v)-N;if(this.isEntireRowSelected(a,l)){const pe=this.getDimensionsFromHeader("rows",o,s,c,R);let f=null;pe&&([f,U,j]=pe),f&&(g=f)}const re=vo(g,i);parseInt(re.borderTopWidth,10)>0&&(U+=1,j=j>0?j-1:0),parseInt(re[F?"borderRightWidth":"borderLeftWidth"],10)>0&&(B+=1,ee=ee>0?ee-1:0);const ie=F?"right":"left";this.topStyle.top=`${U}px`,this.topStyle[ie]=`${B}px`,this.topStyle.width=`${ee}px`,this.topStyle.display="block",this.startStyle.top=`${U}px`,this.startStyle[ie]=`${B}px`,this.startStyle.height=`${j}px`,this.startStyle.display="block";const oe=Math.floor(this.settings.border.width/2);this.bottomStyle.top=`${U+j-oe}px`,this.bottomStyle[ie]=`${B}px`,this.bottomStyle.width=`${ee}px`,this.bottomStyle.display="block",this.endStyle.top=`${U}px`,this.endStyle[ie]=`${B+ee-oe}px`,this.endStyle.height=`${j+1}px`,this.endStyle.display="block";let ve=this.settings.border.cornerVisible;ve=typeof ve=="function"?ve(this.settings.layerLevel):ve;const _e=this.wot.getSetting("onModifyGetCellCoords",s,l);let[rt,Fe]=[s,l];if(_e&&Array.isArray(_e)&&([,,rt,Fe]=_e),uo()||!ve||this.isPartRange(rt,Fe))this.cornerStyle.display="none";else{this.cornerStyle.top=`${U+j+this.cornerCenterPointOffset-1}px`,this.cornerStyle[ie]=`${B+ee+this.cornerCenterPointOffset-1}px`,this.cornerStyle.borderRightWidth=this.cornerDefaultStyle.borderWidth,this.cornerStyle.width=this.cornerDefaultStyle.width,this.cornerStyle.display="none";let pe=ca(n.TABLE);const f=pe===i;f&&(pe=r.documentElement);const m=parseInt(this.cornerDefaultStyle.width,10)/2,w=parseInt(this.cornerDefaultStyle.height,10)/2;if(l===this.wot.getSetting("totalColumns")-1){const A=f?v.getBoundingClientRect().left:v.offsetLeft;let O=!1,D=0;F?(D=A-parseInt(this.cornerDefaultStyle.width,10)/2,O=D<0):(D=A+ft(v)+parseInt(this.cornerDefaultStyle.width,10)/2,O=D>=Ny(pe)),O&&(this.cornerStyle[ie]=`${Math.floor(B+ee+this.cornerCenterPointOffset-m)}px`,this.cornerStyle[F?"borderLeftWidth":"borderRightWidth"]=0)}s===this.wot.getSetting("totalRows")-1&&(f?v.getBoundingClientRect().top:v.offsetTop)+Pt(v)+parseInt(this.cornerDefaultStyle.height,10)/2>=ra(pe)&&(this.cornerStyle.top=`${Math.floor(U+j+this.cornerCenterPointOffset-w)}px`,this.cornerStyle.borderBottomWidth=0),this.cornerStyle.display="block"}uo()&&this.updateMultipleSelectionHandlesPosition(s,l,U,B,ee,j)}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,g=null,p=null,v=null;switch(e){case"rows":l=function(){return s.getRowHeader(...arguments)},u=function(){return Pt(...arguments)},c="ht__selection--rows",g="top";break;case"columns":l=function(){return s.getColumnHeader(...arguments)},u=function(){return ft(...arguments)},c="ht__selection--columns",g="left";break}if(a.classList.contains(c)){const S=this.wot.getSetting("columnHeaders").length;if(p=l(n,S-i),v=l(r,S-i),!p||!v)return!1;const y=en(p),R=en(v);return p&&v&&(h=y[g]-o[g]-1,d=R[g]+u(v)-y[g]),[p,h,d]}return!1}changeBorderStyle(e,n){const r=this[e].style,i=n[e];!i||i.hide?q(this[e],"hidden"):(Ie(this[e],"hidden")&&Le(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?q(this[e],"hidden"):Le(this[e],"hidden")}disappear(){this.topStyle.display="none",this.bottomStyle.display="none",this.startStyle.display="none",this.endStyle.display="none",this.cornerStyle.display="none",uo()&&(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)}}const h0=sX;function aX(t,e){_1(t,e),e.add(t)}function Ha(t,e,n){_1(t,e),e.set(t,n)}function _1(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function lX(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}function Xe(t,e){var n=M1(t,e,"get");return uX(t,n)}function uX(t,e){return e.get?e.get.call(t):e.value}function d0(t,e,n){var r=M1(t,e,"set");return cX(t,r,n),n}function M1(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}function cX(t,e,n){if(e.set)e.set.call(t,n);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=n}}var Sn=new WeakMap,er=new WeakMap,Ew=new WeakMap,ju=new WeakMap,Tw=new WeakMap,As=new WeakMap,f0=new WeakSet;class hX{constructor(e){aX(this,f0),Ha(this,Sn,{writable:!0,value:void 0}),Ha(this,er,{writable:!0,value:void 0}),Ha(this,Ew,{writable:!0,value:new oX}),Ha(this,ju,{writable:!0,value:new WeakMap}),Ha(this,Tw,{writable:!0,value:new WeakSet}),Ha(this,As,{writable:!0,value:new Map}),d0(this,er,e)}setActiveOverlay(e){return d0(this,Sn,e),Xe(this,Ew).setActiveOverlay(Xe(this,Sn)),Xe(this,ju).has(Xe(this,Sn))||Xe(this,ju).set(Xe(this,Sn),new Set),this}getFocusSelection(){return Xe(this,er)!==null?Xe(this,er).getFocus():null}getAreaSelection(){return Xe(this,er)!==null?Xe(this,er).createLayeredArea():null}getBorderInstance(e){if(!e.settings.border)return null;if(Xe(this,As).has(e)){const r=Xe(this,As).get(e);if(r.has(Xe(this,Sn)))return r.get(Xe(this,Sn));const i=new h0(Xe(this,Sn),e.settings);return r.set(Xe(this,Sn),i),i}const n=new h0(Xe(this,Sn),e.settings);return Xe(this,As).set(e,new Map([[Xe(this,Sn),n]])),n}getBorderInstances(e){var n,r;return Array.from((n=(r=Xe(this,As).get(e))===null||r===void 0?void 0:r.values())!==null&&n!==void 0?n:[])}destroyBorders(e){Xe(this,As).get(e).forEach(n=>n.destroy()),Xe(this,As).delete(e)}render(e){if(Xe(this,er)===null)return;e&&lX(this,f0,dX).call(this);const n=Array.from(Xe(this,er)),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;Xe(this,Tw).has(s)||(Xe(this,Tw).add(s),s.addLocalHook("destroy",()=>this.destroyBorders(s)));const h=this.getBorderInstance(s);if(s.isEmpty()){h==null||h.disappear();continue}a&&Xe(this,Ew).setActiveSelection(s).scan().forEach(p=>{if(r.has(p)){const v=r.get(p);v.has(a)&&u===!0?v.set(a,v.get(a)+1):v.set(a,1)}else r.set(p,new Map([[a,1]]));l&&(i.has(p)||i.set(p,[]),p.nodeName==="TH"&&i.get(p).push(...l))});const d=s.getCorners();Xe(this,Sn).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,g)=>`${c}-${g+1}`)]}).flat();l.forEach(u=>Xe(this,ju).get(Xe(this,Sn)).add(u)),q(s,l),s.nodeName==="TD"&&Array.isArray((a=Xe(this,er).options)===null||a===void 0?void 0:a.cellAttributes)&&Ee(s,Xe(this,er).options.cellAttributes)}),Array.from(i.keys()).forEach(o=>{Ee(o,[...i.get(o)])})}}function dX(){const t=Xe(this,ju).get(Xe(this,Sn)),e=Xe(this,Sn).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=Xe(this,Sn).wtTable.TABLE.querySelectorAll(`.${n}`);let s=[];Array.isArray((r=Xe(this,er).options)===null||r===void 0?void 0:r.cellAttributes)&&(s=Xe(this,er).options.cellAttributes.map(a=>a[0])),Array.isArray((i=Xe(this,er).options)===null||i===void 0?void 0:i.headerAttributes)&&(s=[...s,...Xe(this,er).options.headerAttributes.map(a=>a[0])]);for(let a=0,l=o.length;a<l;a++)Le(o[a],n),Ca(o[a],s)}),t.clear()}class fX extends Jc{constructor(e,n,r,i){super(e,n,da,r,i)}createTable(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return new K3(...n)}shouldBeRendered(){return this.wtSettings.getSetting("shouldRenderInlineStartOverlay")}resetFixedPosition(){const{wtTable:e}=this.wot;if(!this.needFullRender||!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),Dg(r,`${o}px`,"0px")):(o=this.getScrollPosition(),jc(r));const s=this.adjustHeaderBordersPosition(o);return this.adjustElementsSize(),s}setScrollPosition(e){const{rootWindow:n}=this.domBindings;let r=!1;return this.isRtl()&&(e=-e),this.mainTableScrollableElement===n&&n.scrollX!==e?(n.scrollTo(e,Hy(n)),r=!0):this.mainTableScrollableElement.scrollLeft!==e&&(this.mainTableScrollableElement.scrollLeft=e,r=!0),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.getStretchedColumnWidth(i)||r,i+=1;return o}adjustElementsSize(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this.updateTrimmingContainer(),(this.needFullRender||e)&&(this.adjustRootElementSize(),this.adjustRootChildrenSize())}adjustRootElementSize(){const{wtTable:e}=this.wot,{rootDocument:n,rootWindow:r}=this.domBindings,i=nn(n),s=this.clone.wtTable.holder.parentNode.style,a=this.wtSettings.getSetting("preventOverflow");if(this.trimmingContainer!==r||a==="vertical"){let u=this.wot.wtViewport.getWorkspaceHeight();this.wot.wtOverlays.hasScrollbarBottom&&(u-=i),u=Math.min(u,e.wtRootElement.scrollHeight),s.height=`${u}px`}else s.height="";this.clone.wtTable.holder.style.height=s.height;const l=ft(this.clone.wtTable.TABLE);s.width=`${l}px`}adjustRootChildrenSize(){const{holder:e}=this.clone.wtTable,n=this.wot.selectionManager.getFocusSelection()?parseInt(hb.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)+n}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){let r=this.getTableParentOffset();const o=(this.wot.cloneSource?this.wot.cloneSource:this.wot).wtTable.holder;let s=0;if(n){const a=this.wot.wtTable.getColumnWidth(e),l=this.wot.wtViewport.getViewportWidth();a>l&&(n=!1)}return n&&o.offsetWidth!==o.clientWidth&&(s=nn(this.domBindings.rootDocument)),n?(r+=this.sumCellSizes(0,e+1),r-=this.wot.wtViewport.getViewportWidth()):r+=this.sumCellSizes(this.wtSettings.getSetting("fixedColumnsStart"),e),r+=s,this.setScrollPosition(r)}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(Dy(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 n=this.wot.wtTable.holder.parentNode,r=this.wtSettings.getSetting("rowHeaders"),i=this.wtSettings.getSetting("fixedColumnsStart");this.wtSettings.getSetting("totalRows")?Le(n,"emptyRows"):q(n,"emptyRows");let s=!1;if(i&&!r.length)q(n,"innerBorderLeft innerBorderInlineStart");else if(!i&&r.length){const a=Ie(n,"innerBorderInlineStart");e?(q(n,"innerBorderLeft innerBorderInlineStart"),s=!a):(Le(n,"innerBorderLeft innerBorderInlineStart"),s=a)}return s}}const gX="stickyRowsTop",A1={getFirstRenderedRow(){return this.wtSettings.getSetting("totalRows")===0?-1:0},getFirstVisibleRow(){return this.getFirstRenderedRow()},getLastRenderedRow(){return this.getRenderedRowsCount()-1},getLastVisibleRow(){return this.getLastRenderedRow()},getRenderedRowsCount(){const t=this.wtSettings.getSetting("totalRows");return Math.min(this.wtSettings.getSetting("fixedRowsTop"),t)},getVisibleRowsCount(){return this.getRenderedRowsCount()},getColumnHeadersCount(){return this.dataAccessObject.columnHeaders.length}};Fi(A1,"MIXIN_NAME",gX,{writable:!1,enumerable:!1});const O1=A1;class db extends Yl{constructor(e,n,r,i){super(e,n,r,i,fa)}}pt(db,O1);pt(db,nb);const mX=db;function g0(t,e,n){return e=pX(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function pX(t){var e=wX(t,"string");return typeof e=="symbol"?e:String(e)}function wX(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class vX extends Jc{constructor(e,n,r,i,o,s){super(e,n,fa,r,i),g0(this,"topOverlay",void 0),g0(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 mX(...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();Dg(e,`${i}px`,`${o}px`)}else jc(e);let n=Pt(this.clone.wtTable.TABLE);const r=ft(this.clone.wtTable.TABLE);return this.wot.wtTable.hasDefinedSize()||(n=0),e.style.height=`${n}px`,e.style.width=`${r}px`,!1}}class fb extends Yl{constructor(e,n,r,i){super(e,n,r,i,ha)}}pt(fb,O1);pt(fb,ob);const CX=fb;function SX(t,e,n){return e=yX(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function yX(t){var e=bX(t,"string");return typeof e=="symbol"?e:String(e)}function bX(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class RX extends Jc{constructor(e,n,r,i){super(e,n,ha,r,i),SX(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 CX(...n)}shouldBeRendered(){return this.wtSettings.getSetting("shouldRenderTopOverlay")}resetFixedPosition(){if(!this.needFullRender||!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(),Dg(e,"0px",`${i}px`)}else i=this.getScrollPosition(),jc(e);const s=this.adjustHeaderBordersPosition(i,o);return this.adjustElementsSize(),s}setScrollPosition(e){const n=this.domBindings.rootWindow;let r=!1;return this.mainTableScrollableElement===n&&n.scrollY!==e?(n.scrollTo(xg(n),e),r=!0):this.mainTableScrollableElement.scrollTop!==e&&(this.mainTableScrollableElement.scrollTop=e,r=!0),r}onScroll(){this.wtSettings.getSetting("onScrollHorizontally")}sumCellSizes(e,n){const r=this.wtSettings.getSetting("defaultRowHeight");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(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this.updateTrimmingContainer(),(this.needFullRender||e)&&(this.adjustRootElementSize(),this.adjustRootChildrenSize())}adjustRootElementSize(){const{wtTable:e}=this.wot,{rootDocument:n,rootWindow:r}=this.domBindings,i=nn(n),s=this.clone.wtTable.holder.parentNode.style,a=this.wtSettings.getSetting("preventOverflow");if(this.trimmingContainer!==r||a==="horizontal"){let u=this.wot.wtViewport.getWorkspaceWidth();this.wot.wtOverlays.hasScrollbarRight&&(u-=i),u=Math.min(u,e.wtRootElement.scrollWidth),s.width=`${u}px`}else s.width="";this.clone.wtTable.holder.style.width=s.width;let l=Pt(this.clone.wtTable.TABLE);this.wot.wtTable.hasDefinedSize()||(l=0),s.height=`${l}px`}adjustRootChildrenSize(){const{holder:e}=this.clone.wtTable,n=this.wot.selectionManager.getFocusSelection()?parseInt(hb.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)+n}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;let a=this.getTableParentOffset(),l=0;if(n){const u=this.wot.wtTable.getRowHeight(e),c=this.wot.wtViewport.getViewportHeight();u>c&&(n=!1)}if(n&&s.offsetHeight!==s.clientHeight&&(l=nn(this.domBindings.rootDocument)),n){const u=i.getSetting("fixedRowsBottom"),c=i.getSetting("totalRows");a+=this.sumCellSizes(0,e+1),a-=r.wtViewport.getViewportHeight()-this.sumCellSizes(c-u,c),a+=1}else a+=this.sumCellSizes(i.getSetting("fixedRowsTop"),e);return a+=l,this.setScrollPosition(a)}getTableParentOffset(){return this.mainTableScrollableElement===this.domBindings.rootWindow?this.wot.wtTable.holderOffset.top:0}getScrollPosition(){return Hg(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 r=this.wot.wtTable.holder.parentNode;this.wtSettings.getSetting("totalColumns")?Le(r,"emptyColumns"):q(r,"emptyColumns");let o=!1;if(!n){const s=this.wtSettings.getSetting("fixedRowsTop"),a=this.cachedFixedRowsTop!==s,l=this.wtSettings.getSetting("columnHeaders");if((a||s===0)&&l.length>0){const u=Ie(r,"innerBorderTop");this.cachedFixedRowsTop=this.wtSettings.getSetting("fixedRowsTop"),e||this.wtSettings.getSetting("totalRows")===0?(q(r,"innerBorderTop"),o=!u):(Le(r,"innerBorderTop"),o=u)}}return o}}function Yi(t,e,n){return e=EX(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function EX(t){var e=TX(t,"string");return typeof e=="symbol"?e:String(e)}function TX(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class _X{constructor(e,n,r,i,o,s){Yi(this,"wot",null),Yi(this,"topOverlay",null),Yi(this,"bottomOverlay",null),Yi(this,"inlineStartOverlay",null),Yi(this,"topInlineStartCornerOverlay",null),Yi(this,"bottomInlineStartCornerOverlay",null),Yi(this,"browserLineHeight",void 0),Yi(this,"wtSettings",null),Yi(this,"resizeObserver",new ResizeObserver(c=>{Fg(()=>{!Array.isArray(c)||!c.length||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=nn(a);const u=l.getComputedStyle(s.wtRootElement.parentNode).getPropertyValue("overflow")==="hidden";this.scrollableElement=u?s.holder:Tc(s.TABLE),this.initOverlays(),this.hasScrollbarBottom=!1,this.hasScrollbarRight=!1,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=[this.topOverlay,this.topInlineStartCornerOverlay,this.inlineStartOverlay,this.bottomOverlay,this.bottomInlineStartCornerOverlay];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 RX(...e),this.bottomOverlay=new z3(...e),this.inlineStartOverlay=new fX(...e),this.topInlineStartCornerOverlay=new vX(...e,this.topOverlay,this.inlineStartOverlay),this.bottomInlineStartCornerOverlay=new W3(...e,this.bottomOverlay,this.inlineStartOverlay)}updateStateOfRendering(){let e=this.topOverlay.updateStateOfRendering();return e=this.bottomOverlay.updateStateOfRendering()||e,e=this.inlineStartOverlay.updateStateOfRendering()||e,this.inlineStartOverlay.needFullRender&&(this.topOverlay.needFullRender&&(e=this.topInlineStartCornerOverlay.updateStateOfRendering()||e),this.bottomOverlay.needFullRender&&(e=this.bottomInlineStartCornerOverlay.updateStateOfRendering()||e)),e}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||!By())&&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=>{if(h&&h.needFullRender){const{holder:d}=h.clone.wtTable;this.eventManager.addEventListener(d,"wheel",g=>this.onCloneWheel(g,a),l)}});let c;this.eventManager.addEventListener(n,"resize",()=>{clearTimeout(c),c=setTimeout(()=>{this.wtSettings.getSetting("onWindowResize")},200)}),s||this.resizeObserver.observe(this.wtTable.wtRootElement.parentElement)}deregisterListeners(){this.eventManager.clearEvents(!0)}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))return;const u=this.translateMouseWheelToScroll(e);(n||this.scrollableElement!==r&&u)&&e.preventDefault()}onKeyDown(e){this.keyPressed=Ul(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{rootWindow:e}=this.domBindings,n=this.topOverlay.clone.wtTable.holder,r=this.inlineStartOverlay.clone.wtTable.holder,[i,o]=[this.scrollableElement.scrollLeft,this.scrollableElement.scrollTop];if(this.horizontalScrolling=n.scrollLeft!==i||this.lastScrollX!==e.scrollX,this.verticalScrolling=r.scrollTop!==o||this.lastScrollY!==e.scrollY,this.lastScrollX=e.scrollX,this.lastScrollY=e.scrollY,this.horizontalScrolling){n.scrollLeft=i;const s=this.bottomOverlay.needFullRender?this.bottomOverlay.clone.wtTable.holder:null;s&&(s.scrollLeft=i)}this.verticalScrolling&&(r.scrollTop=o),this.refreshAll()}syncScrollWithMaster(){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)}updateMainScrollableElements(){this.deregisterListeners(),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=Tc(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(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const{wtViewport:n}=this.wot,{wtTable:r}=this,i=this.wtSettings.getSetting("totalColumns"),o=this.wtSettings.getSetting("totalRows"),s=n.getRowHeaderWidth(),a=n.getColumnHeaderHeight(),l=r.hider.style;if(l.width=`${s+this.inlineStartOverlay.sumCellSizes(0,i)}px`,l.height=`${a+this.topOverlay.sumCellSizes(0,o)+1}px`,this.scrollbarSize>0){const{scrollHeight:u,scrollWidth:c}=r.wtRootElement,{scrollHeight:h,scrollWidth:d}=r.holder;this.hasScrollbarRight=u<h,this.hasScrollbarBottom=c<d,this.hasScrollbarRight&&r.hider.scrollWidth+this.scrollbarSize>c?this.hasScrollbarBottom=!0:this.hasScrollbarBottom&&r.hider.scrollHeight+this.scrollbarSize>u&&(this.hasScrollbarRight=!0)}this.topOverlay.adjustElementsSize(e),this.inlineStartOverlay.adjustElementsSize(e),this.bottomOverlay.adjustElementsSize(e)}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 E(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];E(n,r=>{r&&(r.clone.wtTable.TABLE.className=e.className)})}}const MX=_X;function m0(t,e,n){return e=AX(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function AX(t){var e=OX(t,"string");return typeof e=="symbol"?e:String(e)}function OX(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class IX{constructor(e){m0(this,"settings",{}),m0(this,"defaults",Object.freeze(this.getDefaults())),Ye(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,stretchH:"none",currentRowClassName:null,currentColumnClassName:null,preventOverflow(){return!1},preventWheel:!1,data:void 0,freezeOverlays:!1,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);hs(r,i??"")},columnWidth(){},rowHeight(){},defaultRowHeight:23,defaultColumnWidth:50,selections:null,hideBorderOnMouseDownOver:!1,viewportRowCalculatorOverride:null,viewportColumnCalculatorOverride: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,onBeforeStretchingColumnWidth:e=>e,onModifyRowHeaderWidth:null,onModifyGetCellCoords: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?Ye(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 gb extends Yl{constructor(e,n,r,i){super(e,n,r,i,"master")}alignOverlaysWithTrimmingContainer(){const e=ca(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=xl(e,"height",n),o=xl(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 g=parseInt(vo(d,n).height,10);r.removeChild(d),g===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=ds(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}}}pt(gb,S1);pt(gb,ob);const PX=gb;class xX{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.containerWidth=NaN,this.rowHeaderWidth=NaN,this.rowsVisibleCalculator=null,this.columnsVisibleCalculator=null,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=Pt(n)>0&&n.clientHeight>0?n.clientHeight:1/0,r}getWorkspaceWidth(){const{wtSettings:e}=this,{rootDocument:n,rootWindow:r}=this.domBindings,i=this.dataAccessObject.inlineStartOverlayTrimmingContainer,o=n.documentElement.offsetWidth,s=e.getSetting("totalColumns"),a=e.getSetting("preventOverflow"),l=e.getSetting("rtlMode"),u=this.wtTable.TABLE.getBoundingClientRect(),c=l?u.right-o:u.left,h=o-c;let d,g;if(a)return ft(this.wtTable.wtRootElement);if(e.getSetting("freezeOverlays")?d=Math.min(h,o):d=Math.min(this.getContainerFillWidth(),h,o),i===r&&s>0&&this.sumColumnWidths(0,s-1)>d)return n.documentElement.clientWidth;if(i!==r&&(g=xl(this.dataAccessObject.inlineStartOverlayTrimmingContainer,"overflow",r),g==="scroll"||g==="hidden"||g==="auto"))return Math.max(d,i.clientWidth);const p=e.getSetting("stretchH");return p==="none"||!p?Math.max(d,ft(this.wtTable.TABLE)):d}hasVerticalScroll(){return this.wtTable.hider.offsetHeight>this.getWorkspaceHeight()}hasHorizontalScroll(){return this.wtTable.hider.offsetWidth>this.getWorkspaceWidth()}sumColumnWidths(e,n){let r=0,i=e;for(;i<n;)r+=this.wtTable.getColumnWidth(i),i+=1;return r}getContainerFillWidth(){if(this.containerWidth)return this.containerWidth;const e=this.wtTable.holder,n=this.domBindings.rootDocument.createElement("div");n.style.width="100%",n.style.height="1px",e.appendChild(n);const r=n.offsetWidth;return this.containerWidth=r,e.removeChild(n),r}getWorkspaceOffset(){return en(this.wtTable.TABLE)}getColumnHeaderHeight(){return this.wtSettings.getSetting("columnHeaders").length?isNaN(this.columnHeaderHeight)&&(this.columnHeaderHeight=Pt(this.wtTable.THEAD)):this.columnHeaderHeight=0,this.columnHeaderHeight}getViewportHeight(){let e=this.getWorkspaceHeight();if(e===1/0)return e;const n=this.getColumnHeaderHeight();return n>0&&(e-=n),e}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+=ft(r),r=r.nextSibling):this.rowHeaderWidth+=50}else this.rowHeaderWidth=0;return this.rowHeaderWidth=this.wtSettings.getSetting("onModifyRowHeaderWidth",this.rowHeaderWidth)||this.rowHeaderWidth,this.rowHeaderWidth}getViewportWidth(){const e=this.getWorkspaceWidth();if(e===1/0)return e;const n=this.getRowHeaderWidth();return n>0?e-n:e}createRowsCalculator(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Go;const{wtSettings:n,wtTable:r}=this;if(n.getSetting("renderAllRows")&&e===Go)return new bj({totalRows:n.getSetting("totalRows")});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=nn(this.domBindings.rootDocument),new Ug({viewportHeight:i,scrollOffset:a,totalRows:n.getSetting("totalRows"),rowHeightFn:h=>r.getRowHeight(h),overrideFn:n.getSettingPure("viewportRowCalculatorOverride"),calculationType:e,horizontalScrollbarHeight:o})}createColumnsCalculator(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Go;const{wtSettings:n,wtTable:r}=this;if(n.getSetting("renderAllColumns")&&e===Go)return new Cj({totalColumns:n.getSetting("totalColumns")});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-=nn(this.domBindings.rootDocument)),new Zc({viewportWidth:i,scrollOffset:o,totalColumns:n.getSetting("totalColumns"),columnWidthFn:a=>r.getColumnWidth(a),overrideFn:n.getSettingPure("viewportColumnCalculatorOverride"),calculationType:e,inlineStartOffset:this.dataAccessObject.inlineStartParentOffset})}createRenderCalculators(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const{wtSettings:n}=this;if(e&&!n.getSetting("renderAllRows")){const r=this.createRowsCalculator(yn);e=this.areAllProposedVisibleRowsAlreadyRendered(r)}if(e&&!n.getSetting("renderAllColumns")){const r=this.createColumnsCalculator(yn);e=this.areAllProposedVisibleColumnsAlreadyRendered(r)}return e||(this.rowsRenderCalculator=this.createRowsCalculator(Go),this.columnsRenderCalculator=this.createColumnsCalculator(Go)),this.rowsVisibleCalculator=null,this.columnsVisibleCalculator=null,e}createVisibleCalculators(){this.rowsVisibleCalculator=this.createRowsCalculator(yn),this.columnsVisibleCalculator=this.createColumnsCalculator(yn)}areAllProposedVisibleRowsAlreadyRendered(e){if(!this.rowsVisibleCalculator)return!1;const{startRow:n,endRow:r,isVisibleInTrimmingContainer:i}=e;if(n===null&&r===null)return!i;const{startRow:o,endRow:s}=this.rowsRenderCalculator;return n<o||n===o&&n>0?!1:!(r>s||r===s&&r<this.wtSettings.getSetting("totalRows")-1)}areAllProposedVisibleColumnsAlreadyRendered(e){if(!this.columnsVisibleCalculator)return!1;const{startColumn:n,endColumn:r,isVisibleInTrimmingContainer:i}=e;if(n===null&&r===null)return!i;const{startColumn:o,endColumn:s}=this.columnsRenderCalculator;return n<o||n===o&&n>0?!1:!(r>s||r===s&&r<this.wtSettings.getSetting("totalColumns")-1)}resetHasOversizedColumnHeadersMarked(){Ye(this.hasOversizedColumnHeadersMarked,(e,n,r)=>{r[n]=void 0})}}const HX=xX;class DX extends ib{constructor(e,n){super(e,new IX(n));const r=this.wtSettings.getSetting("facade",this);this.wtTable=new PX(this.getTableDao(),r,this.domBindings,this.wtSettings),this.wtViewport=new HX(this.getViewportDao(),this.domBindings,this.wtSettings,this.eventManager,this.wtTable),this.selectionManager=new hX(this.wtSettings.getSetting("selections")),this.wtEvent=new h1(r,this.domBindings,this.wtSettings,this.eventManager,this.wtTable,this.selectionManager),this.wtOverlays=new MX(this,r,this.domBindings,this.wtSettings,this.eventManager,this.wtTable),this.exportSettingsAsClassNames(),this.findOriginalHeaders()}exportSettingsAsClassNames(){const e={rowHeaders:"htRowHeaders",columnHeaders:"htColumnHeaders"},n=[],r=[];Ye(e,(i,o)=>{this.wtSettings.getSetting(o).length&&r.push(i),n.push(i)}),Le(this.wtTable.wtRootElement.parentNode,n),q(this.wtTable.wtRootElement.parentNode,r)}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 mb{constructor(e){e instanceof ib?this._wot=e:this._initFromSettings(e)}_initFromSettings(e){e.facade=n=>{const r=new mb(n);return()=>r},this._wot=new DX(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 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}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,i,o){return this._wot.scrollViewport(e,n,r,i,o)}scrollViewportHorizontally(e,n,r){return this._wot.scrollViewportHorizontally(e,n,r)}scrollViewportVertically(e,n,r){return this._wot.scrollViewportVertically(e,n,r)}getViewport(){return this._wot.getViewport()}getOverlayName(){return this._wot.cloneOverlay?this._wot.cloneOverlay.type:"master"}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 p0(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(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}})}}function NX(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();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)}const LX=new Map([["mousedown",p0],["mouseover",NX],["touchstart",p0]]);function w0(t,e){let{coords:n,selection:r,controller:i,cellCoordsFactory:o}=e;LX.get(t.type)({coords:n,selection:r,controller:i,cellCoordsFactory:o,isShiftKey:t.shiftKey,isLeftClick:Wg(t)||t.type==="touchstart",isRightClick:fs(t)})}const I1=new WeakMap,pb=Symbol("rootInstance");function $X(t){I1.set(t,!0)}function kX(t){return t===pb}function Qd(t){return I1.has(t)}function v0(t,e){P1(t,e),e.add(t)}function Os(t,e,n){P1(t,e),e.set(t,n)}function P1(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function xo(t,e,n){return e=FX(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function FX(t){var e=WX(t,"string");return typeof e=="symbol"?e:String(e)}function WX(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function tS(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}function an(t,e){var n=x1(t,e,"get");return VX(t,n)}function VX(t,e){return e.get?e.get.call(t):e.value}function Sr(t,e,n){var r=x1(t,e,"set");return BX(t,r,n),n}function x1(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}function BX(t,e,n){if(e.set)e.set.call(t,n);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=n}}var _w=new WeakMap,Fh=new WeakMap,Wh=new WeakMap,Gi=new WeakMap,Vr=new WeakMap,Mw=new WeakMap,Aw=new WeakMap,nS=new WeakSet,C0=new WeakSet;class UX{constructor(e){v0(this,C0),v0(this,nS),xo(this,"hot",void 0),xo(this,"eventManager",void 0),xo(this,"settings",void 0),xo(this,"THEAD",void 0),xo(this,"TBODY",void 0),xo(this,"_wt",void 0),xo(this,"activeWt",void 0),Os(this,_w,{writable:!0,value:0}),Os(this,Fh,{writable:!0,value:0}),xo(this,"postponedAdjustElementsSize",!1),Os(this,Wh,{writable:!0,value:!1}),Os(this,Gi,{writable:!0,value:void 0}),Os(this,Vr,{writable:!0,value:void 0}),Os(this,Mw,{writable:!0,value:0}),Os(this,Aw,{writable:!0,value:0}),this.hot=e,this.eventManager=new xr(this.hot),this.settings=this.hot.getSettings(),this.createElements(),this.registerEvents(),this.initializeWalkontable()}render(){this.hot.isRenderSuspended()||(this.hot.runHooks("beforeRender",this.hot.forceFullRender),this.postponedAdjustElementsSize&&(this.postponedAdjustElementsSize=!1,this.adjustElementsSize(!0)),this._wt.draw(!this.hot.forceFullRender),this.hot.runHooks("afterRender",this.hot.forceFullRender),this.hot.forceFullRender=!1,this.hot.renderCall=!1)}adjustElementsSize(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this.hot.isRenderSuspended()?this.postponedAdjustElementsSize=!0:this._wt.wtOverlays.adjustElementsSize(e)}getCellAtCoords(e,n){const r=this._wt.getCell(e,n);return r<0?null:r}scrollViewport(e,n,r,i,o){return this._wt.scrollViewport(e,n,r,i,o)}scrollViewportHorizontally(e,n,r){return this._wt.scrollViewportHorizontally(e,n,r)}scrollViewportVertically(e,n,r){return this._wt.scrollViewportVertically(e,n,r)}createElements(){const{rootElement:e,rootDocument:n}=this.hot,r=e.getAttribute("style");r&&e.setAttribute("data-originalstyle",r),q(e,"handsontable"),Sr(this,Vr,n.createElement("TABLE")),q(an(this,Vr),"htCore"),this.hot.getSettings().tableClassName&&q(an(this,Vr),this.hot.getSettings().tableClassName),this.settings.ariaTags&&(Ee(an(this,Vr),[Pi()]),Ee(e,[pG(),dx(-1),Pg(this.hot.countCols()),OG()])),this.THEAD=n.createElement("THEAD"),an(this,Vr).appendChild(this.THEAD),this.TBODY=n.createElement("TBODY"),an(this,Vr).appendChild(this.TBODY),this.hot.table=an(this,Vr),this.hot.container.insertBefore(an(this,Vr),this.hot.container.firstChild)}registerEvents(){const{rootElement:e,rootDocument:n,selection:r}=this.hot,i=n.documentElement;this.eventManager.addEventListener(e,"mousedown",o=>{if(Sr(this,Wh,!0),!this.isTextSelectionAllowed(o.target)){const{rootWindow:s}=this.hot;UC(s),o.preventDefault(),s.focus()}}),this.eventManager.addEventListener(e,"mouseup",()=>{Sr(this,Wh,!1)}),this.eventManager.addEventListener(e,"mousemove",o=>{an(this,Wh)&&!this.isTextSelectionAllowed(o.target)&&(this.settings.fragmentSelection&&UC(this.hot.rootWindow),o.preventDefault())}),this.eventManager.addEventListener(i,"keyup",o=>{r.isInProgress()&&!o.shiftKey&&r.finish()}),this.eventManager.addEventListener(i,"mouseup",o=>{r.isInProgress()&&Wg(o)&&r.finish(),Sr(this,Gi,!1);const s=Ng(n.activeElement);rc(n.activeElement)&&!s||(s||!r.isSelected()&&!r.isSelectedByAnyHeader()&&!e.contains(o.target)&&!fs(o))&&this.hot.unlisten()}),this.eventManager.addEventListener(i,"contextmenu",o=>{r.isInProgress()&&fs(o)&&(r.finish(),Sr(this,Gi,!1))}),this.eventManager.addEventListener(i,"touchend",()=>{r.isInProgress()&&r.finish(),Sr(this,Gi,!1)}),this.eventManager.addEventListener(i,"mousedown",o=>{const s=o.target,a=o.x||o.clientX,l=o.y||o.clientY;let u=o.target;if(an(this,Gi)||!e||!this.hot.view)return;const{holder:c}=this.hot.view._wt.wtTable;if(u===c){const d=nn(n);if(n.elementFromPoint(a+d,l)!==c||n.elementFromPoint(a,l+d)!==c)return}else for(;u!==i;){if(u===null){if(o.isTargetWebComponent)break;return}if(u===e)return;u=u.parentNode}(typeof this.settings.outsideClickDeselects=="function"?this.settings.outsideClickDeselects(s):this.settings.outsideClickDeselects)?this.hot.deselectCell():this.hot.destroyEditor(!1,!1)}),this.eventManager.addEventListener(an(this,Vr),"selectstart",o=>{this.settings.fragmentSelection||rc(o.target)||o.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}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:an(this,Vr),isDataViewInstance:()=>Qd(this.hot),preventOverflow:()=>this.settings.preventOverflow,preventWheel:()=>this.settings.preventWheel,stretchH:()=>this.settings.stretchH,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),Sr(this,Fh,o.length),this.hot.getSettings().ariaTags&&tS(this,nS,H1).call(this)===this.hot.countCols()&&tS(this,C0,YX).call(this,an(this,Fh)),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),Sr(this,_w,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)},cellRenderer:(o,s,a)=>{const[l,u]=this.translateFromRenderableToVisualIndex(o,s),c=this.hot.runHooks("modifyGetCellCoords",l,u);let h=l,d=u;Array.isArray(c)&&([h,d]=c);const g=this.hot.getCellMeta(h,d),p=this.hot.colToProp(d);let v=this.hot.getDataAtRowProp(h,p);this.hot.hasHook("beforeValueRender")&&(v=this.hot.runHooks("beforeValueRender",v,g)),this.hot.runHooks("beforeRenderer",a,l,u,p,v,g),this.hot.getCellRenderer(g)(this.hot,a,l,u,p,v,g),this.hot.runHooks("afterRenderer",a,l,u,p,v,g)},selections:this.hot.selection.highlight,hideBorderOnMouseDownOver:()=>this.settings.fragmentSelection,onWindowResize:()=>{this.hot&&!this.hot.isDestroyed&&this.hot.refreshDimensions()},onContainerElementResize:()=>{this.hot&&!this.hot.isDestroyed&&ds(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,Sr(this,Gi,!0),this.hot.runHooks("beforeOnCellMouseDown",o,u,a,c),!Ko(o)&&(w0(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,Sr(this,Gi,!1),this.hot.selection.isInProgress()&&this.hot.selection.finish(),this.hot.runHooks("beforeOnCellContextMenu",o,u,a),!Ko(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),!Ko(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),!Ko(o)&&(an(this,Gi)&&w0(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)},onCellMouseUp:(o,s,a,l)=>{const u=this.translateFromRenderableToVisualCoords(s);this.activeWt=l,this.hot.runHooks("beforeOnCellMouseUp",o,u,a),!(Ko(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=>{const s=this.hot.rowIndexMapper,a=o<0;let l=o;return!a&&(l=s.getVisualFromRenderableIndex(o),l===null)?o:(l=this.hot.runHooks("beforeViewportScrollVertically",l),this.hot.runHooks("beforeViewportScroll"),a?l:s.getRenderableFromVisualIndex(l))},onBeforeViewportScrollHorizontally:o=>{const s=this.hot.columnIndexMapper,a=o<0;let l=o;return!a&&(l=s.getVisualFromRenderableIndex(o),l===null)?o:(l=this.hot.runHooks("beforeViewportScrollHorizontally",l),this.hot.runHooks("beforeViewportScroll"),a?l:s.getRenderableFromVisualIndex(l))},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 g=h.peekByIndex(a??0);l=[g.from.row,g.from.col,g.to.row,g.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"),onBeforeStretchingColumnWidth:(o,s)=>{const a=this.hot.columnIndexMapper.getVisualFromRenderableIndex(s);return this.hot.runHooks("beforeStretchingColumnWidth",o,a)},onModifyRowHeaderWidth:o=>this.hot.runHooks("modifyRowHeaderWidth",o),onModifyGetCellCoords:(o,s,a)=>{const l=this.hot.rowIndexMapper,u=this.hot.columnIndexMapper,c=s>=0?u.getVisualFromRenderableIndex(s):s,h=o>=0?l.getVisualFromRenderableIndex(o):o,d=this.hot.runHooks("modifyGetCellCoords",h,c,a);if(Array.isArray(d)){const[g,p,v,S]=d;return[g>=0?l.getRenderableFromVisualIndex(l.getNearestNotHiddenIndex(g,1)):g,p>=0?u.getRenderableFromVisualIndex(u.getNearestNotHiddenIndex(p,1)):p,v>=0?l.getRenderableFromVisualIndex(l.getNearestNotHiddenIndex(v,-1)):v,S>=0?u.getRenderableFromVisualIndex(u.getNearestNotHiddenIndex(S,-1)):S]}},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.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.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 mb(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.forceFullRender=!0,this.render())})}isTextSelectionAllowed(e){if(rc(e))return!0;const n=os(e,this.hot.view._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 an(this,Gi)}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(!Ie(r,"relative")){oi(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;if(n.firstChild){const o=n.firstChild;Ie(o,"relative")?this.updateCellHeader(o.querySelector(".colHeader"),e,r,i):(oi(n),this.appendColHeader(e,n,r,i))}else{const{rootDocument:o}=this.hot,s=o.createElement("div"),a=o.createElement("span");s.className="relative",a.className="colHeader",this.settings.ariaTags&&(Ee(s,...Pi()),Ee(a,...Pi())),this.updateCellHeader(a,e,r,i),s.appendChild(a),n.appendChild(s)}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&&(Ie(e,"colHeader")?o=s.wtTable.columnFilter.sourceToRendered(n):Ie(e,"rowHeader")&&(o=s.wtTable.rowFilter.sourceToRendered(n))),o>-1?Sa(e,r(n,i)):(hs(e,String.fromCharCode(160)),q(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){Sr(this,Mw,e),Sr(this,Aw,n)}getLastSize(){return{width:an(this,Mw),height:an(this,Aw)}}getFirstFullyVisibleRow(){return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this.hot.view._wt.wtScroll.getFirstVisibleRow())}getLastFullyVisibleRow(){return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this.hot.view._wt.wtScroll.getLastVisibleRow())}getFirstFullyVisibleColumn(){return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this.hot.view._wt.wtScroll.getFirstVisibleColumn())}getLastFullyVisibleColumn(){return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this.hot.view._wt.wtScroll.getLastVisibleColumn())}getColumnHeadersCount(){return an(this,_w)}getRowHeadersCount(){return an(this,Fh)}destroy(){this._wt.destroy(),this.eventManager.destroy()}}function H1(){return parseInt(this.hot.rootElement.getAttribute(Pg()[0]),10)}function YX(t){const e=tS(this,nS,H1).call(this)+t;Ee(this.hot.rootElement,...Pg(e))}const GX=UX,D1="ABCDEFGHIJKLMNOPQRSTUVWXYZ",rS=D1.length;function Yg(t){let e=t+1,n="",r;for(;e>0;)r=(e-1)%rS,n=String.fromCharCode(65+r)+n,e=parseInt((e-r)/rS,10);return n}function zX(t){let e=0;if(t)for(let n=0,r=t.length-1;n<t.length;n+=1,r-=1)e+=rS**r*(D1.indexOf(t[n])+1);return e-=1,e}function jX(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:100,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:4;const n=[];let r,i;for(r=0;r<t;r++){const o=[];for(i=0;i<e;i++)o.push(Yg(i)+(r+1));n.push(o)}return n}function KX(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:100,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:4;const n=[];let r,i;for(r=0;r<t;r++){const o={};for(i=0;i<e;i++)o[`prop${i}`]=Yg(i)+(r+1);n.push(o)}return n}function XX(t,e){const n=[];let r;for(let i=0;i<t;i++){r=[];for(let o=0;o<e;o++)r.push("");n.push(r)}return n}function wb(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 vb(t){let e=0;return Array.isArray(t)&&(t[0]&&Array.isArray(t[0])?e=t[0].length:t[0]&&Ve(t[0])&&(e=kg(t[0]))),e}function N1(t){return!!(Array.isArray(t)&&t.length&&t.every(e=>Array.isArray(e)))}function L1(t){return!!(Array.isArray(t)&&t.length&&t.every(e=>typeof e=="object"&&!Array.isArray(e)&&e!==null))}const qX=Object.freeze(Object.defineProperty({__proto__:null,countFirstRowKeys:vb,createEmptySpreadsheetData:XX,createSpreadsheetData:jX,createSpreadsheetObjectData:KX,dataRowToChangesArray:wb,isArrayOfArrays:N1,isArrayOfObjects:L1,spreadsheetColumnIndex:zX,spreadsheetColumnLabel:Yg},Symbol.toStringTag,{value:"Module"}));function hu(t,e,n){return e=ZX(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ZX(t){var e=QX(t,"string");return typeof e=="symbol"?e:String(e)}function QX(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class JX{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];hu(this,"hot",void 0),hu(this,"data",void 0),hu(this,"dataType","array"),hu(this,"colToProp",()=>{}),hu(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 E(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;let s=null,a=null;if(s=this.modifyRowData(e),Array.isArray(s))a=[],o?s.forEach((l,u)=>{a[u]=this.getAtPhysicalCell(e,u,s)}):me(n,r,l=>{a[l-n]=this.getAtPhysicalCell(e,l,s)});else if(Ve(s)||vt(s))if(i?a=[]:a={},!o||i){const u=this.countFirstRowKeys()-1;me(0,u,c=>{const h=this.colToProp(c);if(c>=(n||0)&&c<=(r||u)&&!Number.isInteger(h)){const d=this.getAtPhysicalCell(e,h,s);i?a.push(d):Kd(a,h,d)}})}else Ye(s,(l,u)=>{Kd(a,u,this.getAtPhysicalCell(e,u,s))});return a}setAtCell(e,n,r){if(!(e>=this.countRows()||n>=this.countFirstRowKeys())){if(this.hot.hasHook("modifySourceData")){const i=ei(r);this.hot.runHooks("modifySourceData",e,n,i,"set"),i.isTouched()&&(r=i.value)}Number.isInteger(n)?this.data[e][n]=r:Kd(this.data[e],n,r)}}getAtPhysicalCell(e,n,r){let i=null;if(r&&(typeof n=="string"?i=xx(r,n):typeof n=="function"?i=n(r):i=r[n]),this.hot.hasHook("modifySourceData")){const o=ei(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 me(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 vb(this.data)}destroy(){this.data=null,this.hot=null}}const e4=JX;function S0(t,e,n){return e=t4(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function t4(t){var e=n4(t,"string");return typeof e=="symbol"?e:String(e)}function n4(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class ya{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;S0(this,"indexedValues",[]),S0(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,vt(this.initValueOrFn)?me(e-1,n=>this.indexedValues.push(this.initValueOrFn(n))):me(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}}pt(ya,or);function Cb(t,e,n,r){const i=n.length?n[0]:void 0;return[...t.slice(0,i),...n.map((o,s)=>vt(r)?r(o,s):r),...i===void 0?[]:t.slice(i)]}function Sb(t,e){return pr(t,(n,r)=>e.includes(r)===!1)}class ys extends ya{insert(e,n){this.indexedValues=Cb(this.indexedValues,e,n,this.initValueOrFn),super.insert(e,n)}remove(e){this.indexedValues=Sb(this.indexedValues,e),super.remove(e)}}class Gg extends ys{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;super(e)}getHiddenIndexes(){return Yt(this.getValues(),(e,n,r)=>(n&&e.push(r),e),[])}}function yb(t,e,n){return[...t.slice(0,e),...n,...t.slice(e)]}function Ac(t,e){return pr(t,n=>e.includes(n)===!1)}function bb(t,e){return Ue(t,n=>n-e.filter(r=>r<n).length)}function Rb(t,e){const n=e[0],r=e.length;return Ue(t,i=>i>=n?i+r:i)}function r4(t,e,n){return e=i4(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i4(t){var e=o4(t,"string");return typeof e=="symbol"?e:String(e)}function o4(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class zg extends ya{constructor(){super(...arguments),r4(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=Ac(this.orderOfIndexes,[e]),vt(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=Cb(this.indexedValues,e,n,this.initValueOrFn),this.orderOfIndexes=Rb(this.orderOfIndexes,n),super.insert(e,n)}remove(e){this.indexedValues=Sb(this.indexedValues,e),this.orderOfIndexes=Ac(this.orderOfIndexes,e),this.orderOfIndexes=bb(this.orderOfIndexes,e),super.remove(e)}getEntries(){return this.orderOfIndexes.map(e=>[e,this.getValueAtIndex(e)])}}class eh extends ys{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;super(e)}getTrimmedIndexes(){return Yt(this.getValues(),(e,n,r)=>(n&&e.push(r),e),[])}}const y0=new Map([["indexesSequence",{getListWithInsertedItems:yb,getListWithRemovedItems:Ac}],["physicallyIndexed",{getListWithInsertedItems:Cb,getListWithRemovedItems:Sb}]]),$1=t=>{if(y0.has(t)===!1)throw new Error(`Alter strategy with ID '${t}' does not exist.`);return y0.get(t)};class k1 extends ya{constructor(){super(e=>e)}insert(e,n){const r=Rb(this.indexedValues,n);this.indexedValues=yb(r,e,n),super.insert(e,n)}remove(e){const n=Ac(this.indexedValues,e);this.indexedValues=bb(n,e),super.remove(e)}}const b0=new Map([["hiding",Gg],["index",ya],["linkedPhysicalIndexToValue",zg],["physicalIndexToValue",ys],["trimming",eh]]);function s4(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!b0.has(t))throw new Error(`The provided map type ("${t}") does not exist.`);return new(b0.get(t))(e)}function a4(t,e,n){return e=l4(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function l4(t){var e=u4(t,"string");return typeof e=="symbol"?e:String(e)}function u4(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}let iS=0;class Eb{constructor(){a4(this,"collection",new Map)}register(e,n){this.collection.has(e)===!1&&(this.collection.set(e,n),n.addLocalHook("change",()=>this.runLocalHooks("change",n)),iS+=1)}unregister(e){const n=this.collection.get(e);ue(n)&&(n.destroy(),this.collection.delete(e),this.runLocalHooks("change",n),iS-=1)}unregisterAll(){this.collection.forEach((e,n)=>this.unregister(n)),this.collection.clear()}get(e){return Ct(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)})}}pt(Eb,or);function c4(){return iS}function Ow(t,e,n){return e=h4(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function h4(t){var e=d4(t,"string");return typeof e=="symbol"?e:String(e)}function d4(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class R0 extends Eb{constructor(e,n){super(),Ow(this,"mergedValuesCache",[]),Ow(this,"aggregationFunction",void 0),Ow(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=Ue(this.get(),o=>o.getValues()),r=[],i=ue(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 Ue(r,this.aggregationFunction)}getMergedValueAtIndex(e,n){const r=this.getMergedValues(n)[e];return ue(r)?r:this.fallbackValue}updateCache(){this.mergedValuesCache=this.getMergedValues(!1)}}function f4(t,e,n){g4(t,e),e.set(t,n)}function g4(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function m4(t,e,n){var r=F1(t,e,"set");return p4(t,r,n),n}function p4(t,e,n){if(e.set)e.set.call(t,n);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=n}}function w4(t,e){var n=F1(t,e,"get");return v4(t,n)}function F1(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}function v4(t,e){return e.get?e.get.call(t):e.value}var Iw=new WeakMap;class W1{constructor(){f4(this,Iw,{writable:!0,value:[]})}subscribe(e){return this.addLocalHook("change",e),this._write(w4(this,Iw)),this}unsubscribe(){return this.runLocalHooks("unsubscribe"),this.clearLocalHooks(),this}_write(e){return e.length>0&&this.runLocalHooks("change",e),this}_writeInitialChanges(e){m4(this,Iw,e)}}pt(W1,or);function E0(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 du(t,e,n){C4(t,e),e.set(t,n)}function C4(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function yr(t,e){var n=V1(t,e,"get");return S4(t,n)}function S4(t,e){return e.get?e.get.call(t):e.value}function Vh(t,e,n){var r=V1(t,e,"set");return y4(t,r,n),n}function V1(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}function y4(t,e,n){if(e.set)e.set.call(t,n);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=n}}var Bh=new WeakMap,fu=new WeakMap,Uh=new WeakMap,Yh=new WeakMap,Gh=new WeakMap;class b4{constructor(){let{initialIndexValue:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};du(this,Bh,{writable:!0,value:new Set}),du(this,fu,{writable:!0,value:[]}),du(this,Uh,{writable:!0,value:[]}),du(this,Yh,{writable:!0,value:!1}),du(this,Gh,{writable:!0,value:!1}),Vh(this,Gh,e??!1)}createObserver(){const e=new W1;return yr(this,Bh).add(e),e.addLocalHook("unsubscribe",()=>{yr(this,Bh).delete(e)}),e._writeInitialChanges(E0(yr(this,fu),yr(this,Uh))),e}emit(e){let n=yr(this,Uh);(!yr(this,Yh)||yr(this,fu).length!==e.length)&&(e.length===0?e=new Array(n.length).fill(yr(this,Gh)):Vh(this,fu,new Array(e.length).fill(yr(this,Gh))),yr(this,Yh)||(Vh(this,Yh,!0),n=yr(this,fu)));const r=E0(n,e);yr(this,Bh).forEach(i=>i._write(r)),Vh(this,Uh,e)}}function xn(t,e,n){return e=R4(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function R4(t){var e=E4(t,"string");return typeof e=="symbol"?e:String(e)}function E4(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class oS{constructor(){xn(this,"indexesSequence",new k1),xn(this,"trimmingMapsCollection",new R0(e=>e.some(n=>n===!0),!1)),xn(this,"hidingMapsCollection",new R0(e=>e.some(n=>n===!0),!1)),xn(this,"variousMapsCollection",new Eb),xn(this,"hidingChangesObservable",new b4({initialIndexValue:!1})),xn(this,"notTrimmedIndexesCache",[]),xn(this,"notHiddenIndexesCache",[]),xn(this,"isBatched",!1),xn(this,"indexesSequenceChanged",!1),xn(this,"indexesChangeSource",void 0),xn(this,"trimmedIndexesChanged",!1),xn(this,"hiddenIndexesChanged",!1),xn(this,"renderablePhysicalIndexesCache",[]),xn(this,"fromPhysicalToVisualIndexesCache",new Map),xn(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,s4(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 eh?this.trimmingMapsCollection.register(e,n):n instanceof Gg?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 ue(n)?n:null}getPhysicalFromRenderableIndex(e){const n=this.renderablePhysicalIndexesCache[e];return ue(n)?n:null}getVisualFromPhysicalIndex(e){const n=this.fromPhysicalToVisualIndexesCache.get(e);return ue(n)?n:null}getVisualFromRenderableIndex(e){return this.getVisualFromPhysicalIndex(this.getPhysicalFromRenderableIndex(e))}getRenderableFromVisualIndex(e){const n=this.fromVisualToRenderableIndexesCache.get(e);return ue(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=Ue(e,u=>this.getPhysicalFromVisualIndex(u)),i=this.getNotTrimmedIndexesLength(),o=e.length,s=Ac(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(yb(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=ue(r)?r:this.getNumberOfIndexes(),o=this.getIndexesSequence().includes(r)?this.getIndexesSequence().indexOf(r):this.getNumberOfIndexes(),s=Ue(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)}}}pt(oS,or);function T4(t,e){return Ye(e,(n,r)=>{Ct(t[r])&&(t[r]=n)}),t}function B1(t){const n=/^([a-zA-Z]{2})-([a-zA-Z]{2})$/.exec(t);return n?`${n[1].toLowerCase()}-${n[2].toUpperCase()}`:t}function U1(t){ue(t)&&jy(ht`Language with code "${t}" was not found. You should register particular language\x20
before using it. Read more about this issue at: https://docs.handsontable.com/i18n/missing-language-code.`)}function _4(t,e){return Array.isArray(t)&&Number.isInteger(e)?t[e]:t}const{register:M4,getValues:A4}=ai("phraseFormatters");function O4(t,e){M4(t,e)}function I4(){return A4()}O4("pluralize",_4);const Y1="ContextMenu:items",ke=Y1,Tb=`${ke}.noItems`,jg=`${ke}.insertRowAbove`,Kg=`${ke}.insertRowBelow`,Xg=`${ke}.insertColumnOnTheLeft`,qg=`${ke}.insertColumnOnTheRight`,Zg=`${ke}.removeRow`,Qg=`${ke}.removeColumn`,Jg=`${ke}.undo`,em=`${ke}.redo`,tm=`${ke}.readOnly`,nm=`${ke}.clearColumn`,rm=`${ke}.copy`,im=`${ke}.copyWithHeaders`,om=`${ke}.copyWithGroupHeaders`,sm=`${ke}.copyHeadersOnly`,am=`${ke}.cut`,lm=`${ke}.freezeColumn`,um=`${ke}.unfreezeColumn`,cm=`${ke}.mergeCells`,hm=`${ke}.unmergeCells`,dm=`${ke}.addComment`,fm=`${ke}.editComment`,gm=`${ke}.removeComment`,mm=`${ke}.readOnlyComment`,pm=`${ke}.align`,wm=`${ke}.align.left`,vm=`${ke}.align.center`,Cm=`${ke}.align.right`,Sm=`${ke}.align.justify`,ym=`${ke}.align.top`,bm=`${ke}.align.middle`,Rm=`${ke}.align.bottom`,Em=`${ke}.borders`,Tm=`${ke}.borders.top`,_m=`${ke}.borders.right`,Mm=`${ke}.borders.bottom`,Am=`${ke}.borders.left`,Om=`${ke}.borders.remove`,Im=`${ke}.nestedHeaders.insertChildRow`,Pm=`${ke}.nestedHeaders.detachFromParent`,xm=`${ke}.hideColumn`,Hm=`${ke}.showColumn`,Dm=`${ke}.hideRow`,Nm=`${ke}.showRow`,Yn="Filters:",Wt=`${Yn}conditions`,th=`${Wt}.none`,Lm=`${Wt}.isEmpty`,$m=`${Wt}.isNotEmpty`,km=`${Wt}.isEqualTo`,Fm=`${Wt}.isNotEqualTo`,Wm=`${Wt}.beginsWith`,Vm=`${Wt}.endsWith`,Bm=`${Wt}.contains`,Um=`${Wt}.doesNotContain`,P4=`${Wt}.byValue`,Ym=`${Wt}.greaterThan`,Gm=`${Wt}.greaterThanOrEqualTo`,zm=`${Wt}.lessThan`,jm=`${Wt}.lessThanOrEqualTo`,Km=`${Wt}.isBetween`,Xm=`${Wt}.isNotBetween`,qm=`${Wt}.after`,Zm=`${Wt}.before`,Qm=`${Wt}.today`,Jm=`${Wt}.tomorrow`,ep=`${Wt}.yesterday`,tp=`${Yn}labels.filterByCondition`,np=`${Yn}labels.filterByValue`,rp=`${Yn}labels.conjunction`,nh=`${Yn}labels.disjunction`,Oc=`${Yn}values.blankCells`,ip=`${Yn}buttons.selectAll`,op=`${Yn}buttons.clear`,sp=`${Yn}buttons.ok`,ap=`${Yn}buttons.cancel`,lp=`${Yn}buttons.placeholder.search`,up=`${Yn}buttons.placeholder.value`,cp=`${Yn}buttons.placeholder.secondValue`,_b="CheckboxRenderer:",Mb=`${_b}checked`,Ab=`${_b}unchecked`,x4=Object.freeze(Object.defineProperty({__proto__:null,CHECKBOX_CHECKED:Mb,CHECKBOX_RENDERER_NAMESPACE:_b,CHECKBOX_UNCHECKED:Ab,CONTEXTMENU_ITEMS_ADD_COMMENT:dm,CONTEXTMENU_ITEMS_ALIGNMENT:pm,CONTEXTMENU_ITEMS_ALIGNMENT_BOTTOM:Rm,CONTEXTMENU_ITEMS_ALIGNMENT_CENTER:vm,CONTEXTMENU_ITEMS_ALIGNMENT_JUSTIFY:Sm,CONTEXTMENU_ITEMS_ALIGNMENT_LEFT:wm,CONTEXTMENU_ITEMS_ALIGNMENT_MIDDLE:bm,CONTEXTMENU_ITEMS_ALIGNMENT_RIGHT:Cm,CONTEXTMENU_ITEMS_ALIGNMENT_TOP:ym,CONTEXTMENU_ITEMS_BORDERS:Em,CONTEXTMENU_ITEMS_BORDERS_BOTTOM:Mm,CONTEXTMENU_ITEMS_BORDERS_LEFT:Am,CONTEXTMENU_ITEMS_BORDERS_RIGHT:_m,CONTEXTMENU_ITEMS_BORDERS_TOP:Tm,CONTEXTMENU_ITEMS_CLEAR_COLUMN:nm,CONTEXTMENU_ITEMS_COPY:rm,CONTEXTMENU_ITEMS_COPY_COLUMN_HEADERS_ONLY:sm,CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_GROUP_HEADERS:om,CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_HEADERS:im,CONTEXTMENU_ITEMS_CUT:am,CONTEXTMENU_ITEMS_EDIT_COMMENT:fm,CONTEXTMENU_ITEMS_FREEZE_COLUMN:lm,CONTEXTMENU_ITEMS_HIDE_COLUMN:xm,CONTEXTMENU_ITEMS_HIDE_ROW:Dm,CONTEXTMENU_ITEMS_INSERT_LEFT:Xg,CONTEXTMENU_ITEMS_INSERT_RIGHT:qg,CONTEXTMENU_ITEMS_MERGE_CELLS:cm,CONTEXTMENU_ITEMS_NESTED_ROWS_DETACH_CHILD:Pm,CONTEXTMENU_ITEMS_NESTED_ROWS_INSERT_CHILD:Im,CONTEXTMENU_ITEMS_NO_ITEMS:Tb,CONTEXTMENU_ITEMS_READ_ONLY:tm,CONTEXTMENU_ITEMS_READ_ONLY_COMMENT:mm,CONTEXTMENU_ITEMS_REDO:em,CONTEXTMENU_ITEMS_REMOVE_BORDERS:Om,CONTEXTMENU_ITEMS_REMOVE_COLUMN:Qg,CONTEXTMENU_ITEMS_REMOVE_COMMENT:gm,CONTEXTMENU_ITEMS_REMOVE_ROW:Zg,CONTEXTMENU_ITEMS_ROW_ABOVE:jg,CONTEXTMENU_ITEMS_ROW_BELOW:Kg,CONTEXTMENU_ITEMS_SHOW_COLUMN:Hm,CONTEXTMENU_ITEMS_SHOW_ROW:Nm,CONTEXTMENU_ITEMS_UNDO:Jg,CONTEXTMENU_ITEMS_UNFREEZE_COLUMN:um,CONTEXTMENU_ITEMS_UNMERGE_CELLS:hm,CONTEXT_MENU_ITEMS_NAMESPACE:Y1,FILTERS_BUTTONS_CANCEL:ap,FILTERS_BUTTONS_CLEAR:op,FILTERS_BUTTONS_OK:sp,FILTERS_BUTTONS_PLACEHOLDER_SEARCH:lp,FILTERS_BUTTONS_PLACEHOLDER_SECOND_VALUE:cp,FILTERS_BUTTONS_PLACEHOLDER_VALUE:up,FILTERS_BUTTONS_SELECT_ALL:ip,FILTERS_CONDITIONS_AFTER:qm,FILTERS_CONDITIONS_BEFORE:Zm,FILTERS_CONDITIONS_BEGINS_WITH:Wm,FILTERS_CONDITIONS_BETWEEN:Km,FILTERS_CONDITIONS_BY_VALUE:P4,FILTERS_CONDITIONS_CONTAINS:Bm,FILTERS_CONDITIONS_EMPTY:Lm,FILTERS_CONDITIONS_ENDS_WITH:Vm,FILTERS_CONDITIONS_EQUAL:km,FILTERS_CONDITIONS_GREATER_THAN:Ym,FILTERS_CONDITIONS_GREATER_THAN_OR_EQUAL:Gm,FILTERS_CONDITIONS_LESS_THAN:zm,FILTERS_CONDITIONS_LESS_THAN_OR_EQUAL:jm,FILTERS_CONDITIONS_NAMESPACE:Wt,FILTERS_CONDITIONS_NONE:th,FILTERS_CONDITIONS_NOT_BETWEEN:Xm,FILTERS_CONDITIONS_NOT_CONTAIN:Um,FILTERS_CONDITIONS_NOT_EMPTY:$m,FILTERS_CONDITIONS_NOT_EQUAL:Fm,FILTERS_CONDITIONS_TODAY:Qm,FILTERS_CONDITIONS_TOMORROW:Jm,FILTERS_CONDITIONS_YESTERDAY:ep,FILTERS_DIVS_FILTER_BY_CONDITION:tp,FILTERS_DIVS_FILTER_BY_VALUE:np,FILTERS_LABELS_CONJUNCTION:rp,FILTERS_LABELS_DISJUNCTION:nh,FILTERS_NAMESPACE:Yn,FILTERS_VALUES_BLANK_CELLS:Oc},Symbol.toStringTag,{value:"Module"}));/**
* @preserve
* Authors: Handsoncode
* Last updated: Nov 15, 2017
*
* Description: Definition file for English - United States language-country.
*/const H4={languageCode:"en-US",[Tb]:"No available options",[jg]:"Insert row above",[Kg]:"Insert row below",[Xg]:"Insert column left",[qg]:"Insert column right",[Zg]:["Remove row","Remove rows"],[Qg]:["Remove column","Remove columns"],[Jg]:"Undo",[em]:"Redo",[tm]:"Read only",[nm]:"Clear column",[pm]:"Alignment",[wm]:"Left",[vm]:"Center",[Cm]:"Right",[Sm]:"Justify",[ym]:"Top",[bm]:"Middle",[Rm]:"Bottom",[lm]:"Freeze column",[um]:"Unfreeze column",[Em]:"Borders",[Tm]:"Top",[_m]:"Right",[Mm]:"Bottom",[Am]:"Left",[Om]:"Remove border(s)",[dm]:"Add comment",[fm]:"Edit comment",[gm]:"Delete comment",[mm]:"Read-only comment",[cm]:"Merge cells",[hm]:"Unmerge cells",[rm]:"Copy",[im]:["Copy with header","Copy with headers"],[om]:["Copy with group header","Copy with group headers"],[sm]:["Copy header only","Copy headers only"],[am]:"Cut",[Im]:"Insert child row",[Pm]:"Detach from parent",[xm]:["Hide column","Hide columns"],[Hm]:["Show column","Show columns"],[Dm]:["Hide row","Hide rows"],[Nm]:["Show row","Show rows"],[th]:"None",[Lm]:"Is empty",[$m]:"Is not empty",[km]:"Is equal to",[Fm]:"Is not equal to",[Wm]:"Begins with",[Vm]:"Ends with",[Bm]:"Contains",[Um]:"Does not contain",[Ym]:"Greater than",[Gm]:"Greater than or equal to",[zm]:"Less than",[jm]:"Less than or equal to",[Km]:"Is between",[Xm]:"Is not between",[qm]:"After",[Zm]:"Before",[Qm]:"Today",[Jm]:"Tomorrow",[ep]:"Yesterday",[Oc]:"Blank cells",[tp]:"Filter by condition",[np]:"Filter by value",[rp]:"And",[nh]:"Or",[ip]:"Select all",[op]:"Clear",[sp]:"OK",[ap]:"Cancel",[lp]:"Search",[up]:"Value",[cp]:"Second value",[Mb]:"Checked",[Ab]:"Unchecked"},G1=H4,D4=x4,sS=G1.languageCode,{register:N4,getItem:z1,hasItem:L4,getValues:$4}=ai("languagesDictionaries");Ob(G1);function Ob(t,e){let n=t,r=e;return Ve(t)&&(r=t,n=r.languageCode),k4(n,r),N4(n,Tn(r)),Tn(r)}function k4(t,e){t!==sS&&T4(e,z1(sS))}function j1(t){return Ib(t)?Tn(z1(t)):null}function Ib(t){return L4(t)}function F4(){return $4()}function K1(t,e,n){const r=j1(t);if(r===null)return null;const i=r[e];if(Ct(i))return null;const o=W4(i,n);return Array.isArray(o)?o[0]:o}function W4(t,e){let n=t;return E(I4(),r=>{n=r(t,e)}),n}function V4(t){let e=B1(t);return Ib(e)||(e=sS,U1(t)),e}function B4(t,e,n){return e=U4(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function U4(t){var e=Y4(t,"string");return typeof e=="symbol"?e:String(e)}function Y4(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class G4 extends q3{constructor(e,n){super(e,null),B4(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)}}const Mo=G4;function Pw(t){let{activeHeaderClassName:e,...n}=t;return new Mo({className:e,...n,selectionType:R1})}function z4(t){let{areaCornerVisible:e,...n}=t;return new Mo({className:"area",createLayers:!0,border:{width:1,color:"#4b89ff",cornerVisible:e},...n,selectionType:ub})}function j4(t){let{...e}=t;return new Mo({className:"highlight",...e,selectionType:ub})}function K4(t){let{columnClassName:e,...n}=t;return new Mo({className:e,...n,selectionType:J3})}function X4(t){let{cellCornerVisible:e,...n}=t;return new Mo({className:"current",headerAttributes:[Py()],border:{width:2,color:"#4b89ff",cornerVisible:e},...n,selectionType:cb})}function q4(t){let{border:e,visualCellRange:n,...r}=t;return new Mo({...e,...r,selectionType:eX},n)}function Z4(t){let{...e}=t;return new Mo({className:"fill",border:{width:1,color:"#ff0000"},...e,selectionType:Z3})}function T0(t){let{headerClassName:e,...n}=t;return new Mo({className:e,...n,selectionType:lb})}function Q4(t){let{rowClassName:e,...n}=t;return new Mo({className:e,...n,selectionType:Q3})}let X1;function J4(t,e){eq(t,e),e.add(t)}function eq(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function jn(t,e,n){return e=tq(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function tq(t){var e=nq(t,"string");return typeof e=="symbol"?e:String(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||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function zi(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}var di=new WeakSet;X1=Symbol.iterator;class rq{constructor(e){J4(this,di),jn(this,"options",void 0),jn(this,"layerLevel",0),jn(this,"focus",void 0),jn(this,"fill",void 0),jn(this,"layeredAreas",new Map),jn(this,"areas",new Map),jn(this,"rowHeaders",new Map),jn(this,"columnHeaders",new Map),jn(this,"activeRowHeaders",new Map),jn(this,"activeColumnHeaders",new Map),jn(this,"activeCornerHeaders",new Map),jn(this,"rowHighlights",new Map),jn(this,"columnHighlights",new Map),jn(this,"customSelections",[]),this.options=e,this.focus=X4(e),this.fill=Z4(e)}isEnabledFor(e,n){let r=e;e===cb&&(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 zi(this,di,ji).call(this,this.layeredAreas,z4)}getLayeredAreas(){return[...this.layeredAreas.values()]}createArea(){return zi(this,di,ji).call(this,this.areas,j4)}getAreas(){return[...this.areas.values()]}createRowHeader(){return zi(this,di,ji).call(this,this.rowHeaders,T0)}getRowHeaders(){return[...this.rowHeaders.values()]}createColumnHeader(){return zi(this,di,ji).call(this,this.columnHeaders,T0)}getColumnHeaders(){return[...this.columnHeaders.values()]}createActiveRowHeader(){return zi(this,di,ji).call(this,this.activeRowHeaders,Pw)}getActiveRowHeaders(){return[...this.activeRowHeaders.values()]}createActiveColumnHeader(){return zi(this,di,ji).call(this,this.activeColumnHeaders,Pw)}getActiveColumnHeaders(){return[...this.activeColumnHeaders.values()]}createActiveCornerHeader(){return zi(this,di,ji).call(this,this.activeCornerHeaders,Pw)}getActiveCornerHeaders(){return[...this.activeCornerHeaders.values()]}createRowHighlight(){return zi(this,di,ji).call(this,this.rowHighlights,Q4)}getRowHighlights(){return[...this.rowHighlights.values()]}createColumnHighlight(){return zi(this,di,ji).call(this,this.columnHighlights,K4)}getColumnHighlights(){return[...this.columnHighlights.values()]}getCustomSelections(){return[...this.customSelections.values()]}addCustomSelection(e){this.customSelections.push(q4({...this.options,...e}))}clear(){this.focus.clear(),this.fill.clear(),E(this.areas.values(),e=>void e.clear()),E(this.layeredAreas.values(),e=>void e.clear()),E(this.rowHeaders.values(),e=>void e.clear()),E(this.columnHeaders.values(),e=>void e.clear()),E(this.activeRowHeaders.values(),e=>void e.clear()),E(this.activeColumnHeaders.values(),e=>void e.clear()),E(this.activeCornerHeaders.values(),e=>void e.clear()),E(this.rowHighlights.values(),e=>void e.clear()),E(this.columnHighlights.values(),e=>void e.clear())}[X1](){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 ji(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}const iq=rq;let q1;function _0(t,e,n){return e=oq(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function oq(t){var e=sq(t,"string");return typeof e=="symbol"?e:String(e)}function sq(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}q1=Symbol.iterator;class aq{constructor(e){_0(this,"ranges",[]),_0(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}[q1](){return this.ranges[Symbol.iterator]()}}const lq=aq;function gu(t,e){Z1(t,e),e.add(t)}function xw(t,e,n){Z1(t,e),e.set(t,n)}function Z1(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Qe(t,e){var n=Q1(t,e,"get");return uq(t,n)}function uq(t,e){return e.get?e.get.call(t):e.value}function qn(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}function aS(t,e,n){var r=Q1(t,e,"set");return cq(t,r,n),n}function Q1(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}function cq(t,e,n){if(e.set)e.set.call(t,n);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=n}}var zh=new WeakMap,ot=new WeakMap,gs=new WeakMap,Hw=new WeakSet,Dw=new WeakSet,lS=new WeakSet,Nw=new WeakSet,Is=new WeakSet;class J1{constructor(e,n){gu(this,Is),gu(this,Nw),gu(this,lS),gu(this,Dw),gu(this,Hw),xw(this,zh,{writable:!0,value:void 0}),xw(this,ot,{writable:!0,value:void 0}),xw(this,gs,{writable:!0,value:{x:0,y:0}}),aS(this,zh,e),aS(this,ot,n)}transformStart(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;qn(this,Hw,M0).call(this,{x:Qe(this,ot).navigableHeaders()?Qe(this,ot).countRowHeaders():0,y:Qe(this,ot).navigableHeaders()?Qe(this,ot).countColHeaders():0});const i=Qe(this,ot).createCellCoords(e,n);let o=Qe(this,zh).current().highlight;const s=Qe(this,ot).visualToRenderableCoords(o);let a=0,l=0;if(this.runLocalHooks("beforeTransformStart",i),s.row!==null&&s.col!==null){const{width:u,height:c}=qn(this,lS,eH).call(this),{row:h,col:d}=qn(this,Nw,O0).call(this,o),g=Qe(this,ot).fixedRowsBottom(),p=Qe(this,ot).minSpareRows(),v=Qe(this,ot).minSpareCols(),S=Qe(this,ot).autoWrapRow(),y=Qe(this,ot).autoWrapCol(),R=Qe(this,ot).createCellCoords(h+i.row,d+i.col);if(R.row>=c){const I=ei(r&&p>0&&g===0),F=R.col+1,B=Qe(this,ot).createCellCoords(R.row-c,F>=u?F-u:F);this.runLocalHooks("beforeColumnWrap",I,qn(this,Is,Da).call(this,B),F>=u),I.value?this.runLocalHooks("insertRowRequire",Qe(this,ot).countRenderableRows()):y&&R.assign(B)}else if(R.row<0){const I=ei(y),F=R.col-1,B=Qe(this,ot).createCellCoords(c+R.row,F<0?u+F:F);this.runLocalHooks("beforeColumnWrap",I,qn(this,Is,Da).call(this,B),F<0),y&&R.assign(B)}if(R.col>=u){const I=ei(r&&v>0),F=R.row+1,B=Qe(this,ot).createCellCoords(F>=c?F-c:F,R.col-u);this.runLocalHooks("beforeRowWrap",I,qn(this,Is,Da).call(this,B),F>=c),I.value?this.runLocalHooks("insertColRequire",Qe(this,ot).countRenderableColumns()):S&&R.assign(B)}else if(R.col<0){const I=ei(S),F=R.row-1,B=Qe(this,ot).createCellCoords(F<0?c+F:F,u+R.col);this.runLocalHooks("beforeRowWrap",I,qn(this,Is,Da).call(this,B),F<0),S&&R.assign(B)}const{rowDir:T,colDir:N}=qn(this,Dw,A0).call(this,R);a=T,l=N,o=qn(this,Is,Da).call(this,R)}return this.runLocalHooks("afterTransformStart",o,a,l),o}transformEnd(e,n){qn(this,Hw,M0).call(this,{x:Qe(this,ot).navigableHeaders()?Qe(this,ot).countRowHeaders():0,y:Qe(this,ot).navigableHeaders()?Qe(this,ot).countColHeaders():0});const r=Qe(this,ot).createCellCoords(e,n),i=Qe(this,zh).current(),o=Qe(this,ot).visualToRenderableCoords(i.highlight),s=i.to.clone();let a=0,l=0;if(this.runLocalHooks("beforeTransformEnd",r),o.row!==null&&o.col!==null){const{row:u,col:c}=qn(this,Nw,O0).call(this,i.to),h=Qe(this,ot).createCellCoords(u+r.row,c+r.col),{rowDir:d,colDir:g}=qn(this,Dw,A0).call(this,h);a=d,l=g;const p=qn(this,Is,Da).call(this,h);r.row===0&&r.col!==0?s.col=p.col:r.row!==0&&r.col===0?s.row=p.row:(s.row=p.row,s.col=p.col)}return this.runLocalHooks("afterTransformEnd",s,a,l),s}}function M0(t){let{x:e,y:n}=t;aS(this,gs,{x:e,y:n})}function A0(t){const{width:e,height:n}=qn(this,lS,eH).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 eH(){return{width:Qe(this,gs).x+Qe(this,ot).countRenderableColumns(),height:Qe(this,gs).y+Qe(this,ot).countRenderableRows()}}function O0(t){const{row:e,col:n}=Qe(this,ot).visualToRenderableCoords(t);return Qe(this,ot).createCellCoords(Qe(this,gs).y+e,Qe(this,gs).x+n)}function Da(t){const e=t.clone();return e.col=t.col-Qe(this,gs).x,e.row=t.row-Qe(this,gs).y,Qe(this,ot).renderableToVisualCoords(e)}pt(J1,or);const hq=J1,hp=0,dp=1,tH=2,Pb=3,dq=[Pb,tH],fq=[["number"],["number","string"],["number","undefined"],["number","string","undefined"]],Lw=Symbol("root"),I0=Symbol("child");function Dl(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Lw;if(e!==Lw&&e!==I0)throw new Error("The second argument is used internally only and cannot be overwritten.");const n=Array.isArray(t),r=e===Lw;let i=hp;if(n){const o=t[0];t.length===0?i=dp:r&&o instanceof eb?i=Pb:r&&Array.isArray(o)?i=Dl(o,I0):t.length>=2&&t.length<=4&&!t.some((a,l)=>!fq[l].includes(typeof a))&&(i=tH)}return i}function Ic(t){let{createCellCoords:e,createCellRange:n,keepDirection:r=!1,propToCol:i}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!dq.includes(t))throw new Error("Unsupported selection ranges schema type was provided.");return function(o){const s=t===Pb;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))),Ct(u)&&(u=a),Ct(c)&&(c=l),!r){const g=a,p=l,v=u,S=c;a=Math.min(g,v),l=Math.min(p,S),u=Math.max(g,v),c=Math.max(p,S)}const h=e(a,l),d=e(u,c);return n(h,h,d)}}function gq(t){const e=Dl(t.getSelected());if(e===hp||e===dp)return[];const n=Ic(e,{createCellCoords:t._createCellCoords.bind(t),createCellRange:t._createCellRange.bind(t)}),r=new Set;E(t.getSelected(),s=>{const{from:a,to:l}=n(s),u=Math.max(a.col,0),c=l.col-u+1;E(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 Yt(i,(s,a,l,u)=>(l!==0&&a===u[l-1]+1?s[s.length-1][1]+=1:s.push([a,1]),s),[])}function mq(t){const e=Dl(t.getSelected());if(e===hp||e===dp)return[];const n=Ic(e,{createCellCoords:t._createCellCoords.bind(t),createCellRange:t._createCellRange.bind(t)}),r=new Set;E(t.getSelected(),s=>{const{from:a,to:l}=n(s),u=Math.max(a.row,0),c=l.row-u+1;E(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 Yt(i,(s,a,l,u)=>(l!==0&&a===u[l-1]+1?s[s.length-1][1]+=1:s.push([a,1]),s),[])}function pq(t,e,n){wq(t,e),e.set(t,n)}function wq(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=vq(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function vq(t){var e=Cq(t,"string");return typeof e=="symbol"?e:String(e)}function Cq(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function P0(t,e,n){var r=nH(t,e,"set");return Sq(t,r,n),n}function Sq(t,e,n){if(e.set)e.set.call(t,n);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=n}}function x0(t,e){var n=nH(t,e,"get");return yq(t,n)}function nH(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}function yq(t,e){return e.get?e.get.call(t):e.value}var mu=new WeakMap;class rH{constructor(e,n){var r=this;Ho(this,"settings",void 0),Ho(this,"tableProps",void 0),Ho(this,"inProgress",!1),Ho(this,"selectedRange",new lq((i,o,s)=>this.tableProps.createCellRange(i,o,s))),Ho(this,"highlight",void 0),Ho(this,"transformation",void 0),Ho(this,"selectedByRowHeader",new Set),Ho(this,"selectedByColumnHeader",new Set),pq(this,mu,{writable:!0,value:!1}),this.settings=e,this.tableProps=n,this.highlight=new iq({headerClassName:e.currentHeaderClassName,activeHeaderClassName:e.activeHeaderClassName,rowClassName:e.currentRowClassName,columnClassName:e.currentColClassName,cellAttributes:[Py()],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)}),this.transformation=new hq(this.selectedRange,{rowIndexMapper:this.tableProps.rowIndexMapper,columnIndexMapper:this.tableProps.columnIndexMapper,countRenderableRows:()=>this.tableProps.countRenderableRows(),countRenderableColumns:()=>this.tableProps.countRenderableColumns(),countRowHeaders:()=>this.tableProps.countRowHeaders(),countColHeaders:()=>this.tableProps.countColHeaders(),visualToRenderableCoords:i=>this.tableProps.visualToRenderableCoords(i),renderableToVisualCoords:i=>this.tableProps.renderableToVisualCoords(i),createCellCoords:(i,o)=>this.tableProps.createCellCoords(i,o),navigableHeaders:()=>e.navigableHeaders,fixedRowsBottom:()=>e.fixedRowsBottom,minSpareRows:()=>e.minSpareRows,minSpareCols:()=>e.minSpareCols,autoWrapRow:()=>e.autoWrapRow,autoWrapCol:()=>e.autoWrapCol}),this.transformation.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)}),this.transformation.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)}),this.transformation.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)}),this.transformation.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)}),this.transformation.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)}),this.transformation.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)}),this.transformation.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)}),this.transformation.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)})}getSelectedRange(){return this.selectedRange}begin(){this.inProgress=!0}finish(){this.runLocalHooks("afterSelectionFinished",Array.from(this.selectedRange)),this.inProgress=!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=Ct(n)?this.tableProps.getShortcutManager().isCtrlPressed():n,a=e.clone();this.runLocalHooks(`beforeSetRangeStart${r?"Only":""}`,a),(!o||o&&!s&&Ct(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();this.settings.navigableHeaders||s.highlight.normalize(),this.settings.selectionMode==="single"?(s.setFrom(s.highlight),s.setTo(s.highlight)):s.setTo(n),r>0&&i>0&&(!this.settings.navigableHeaders||this.settings.navigableHeaders&&!s.isSingleHeader())&&s.to.normalize(),this.runLocalHooks("beforeHighlightSet");const a=this.highlight.getFocus();a.clear(),this.highlight.isEnabledFor(cb,s.highlight)&&a.add(this.selectedRange.current().highlight).commit().syncWith(s);const l=this.getLayerLevel();l<this.highlight.layerLevel&&(E(this.highlight.getAreas(),R=>void R.clear()),E(this.highlight.getLayeredAreas(),R=>void R.clear()),E(this.highlight.getRowHeaders(),R=>void R.clear()),E(this.highlight.getColumnHeaders(),R=>void R.clear()),E(this.highlight.getActiveRowHeaders(),R=>void R.clear()),E(this.highlight.getActiveColumnHeaders(),R=>void R.clear()),E(this.highlight.getActiveCornerHeaders(),R=>void R.clear()),E(this.highlight.getRowHighlights(),R=>void R.clear()),E(this.highlight.getColumnHighlights(),R=>void R.clear())),this.highlight.useLayerLevel(l);const u=this.highlight.createArea(),c=this.highlight.createLayeredArea(),h=this.highlight.createRowHeader(),d=this.highlight.createColumnHeader(),g=this.highlight.createActiveRowHeader(),p=this.highlight.createActiveColumnHeader(),v=this.highlight.createActiveCornerHeader(),S=this.highlight.createRowHighlight(),y=this.highlight.createColumnHighlight();if(u.clear(),c.clear(),h.clear(),d.clear(),g.clear(),p.clear(),v.clear(),S.clear(),y.clear(),this.highlight.isEnabledFor(ub,s.highlight)&&(this.isMultiple()||l>=1)&&(u.add(s.from).add(s.to).commit(),c.add(s.from).add(s.to).commit(),l===1)){const R=this.selectedRange.previous();this.highlight.useLayerLevel(l-1),this.highlight.createArea().add(R.from).commit().syncWith(R),this.highlight.createLayeredArea().add(R.from).commit().syncWith(R),this.highlight.useLayerLevel(l)}if(this.highlight.isEnabledFor(lb,s.highlight)){if(!s.isSingleHeader()){const N=this.tableProps.createCellCoords(Math.max(s.from.row,0),-1),I=this.tableProps.createCellCoords(s.to.row,-1),F=this.tableProps.createCellCoords(-1,Math.max(s.from.col,0)),B=this.tableProps.createCellCoords(-1,s.to.col);this.settings.selectionMode==="single"?(h.add(N).commit(),d.add(F).commit(),S.add(N).commit(),y.add(F).commit()):(h.add(N).add(I).commit(),d.add(F).add(B).commit(),S.add(N).add(I).commit(),y.add(F).add(B).commit())}const R=!x0(this,mu)&&this.isEntireRowSelected()&&(i>0&&i===s.getWidth()||i===0&&this.isSelectedByRowHeader()),T=!x0(this,mu)&&this.isEntireColumnSelected()&&(r>0&&r===s.getHeight()||r===0&&this.isSelectedByColumnHeader());R&&g.add(this.tableProps.createCellCoords(Math.max(s.from.row,0),Math.min(-this.tableProps.countRowHeaders(),-1))).add(this.tableProps.createCellCoords(Math.max(s.to.row,0),-1)).commit(),T&&p.add(this.tableProps.createCellCoords(Math.min(-this.tableProps.countColHeaders(),-1),Math.max(s.from.col,0))).add(this.tableProps.createCellCoords(-1,Math.max(s.to.col,0))).commit(),R&&T&&v.add(this.tableProps.createCellCoords(-this.tableProps.countColHeaders(),-this.tableProps.countRowHeaders())).add(this.tableProps.createCellCoords(-1,-1)).commit()}this.runLocalHooks("afterSetRangeEnd",e)}isMultiple(){const e=ei(!this.selectedRange.current().isSingle());return this.runLocalHooks("afterIsMultipleSelection",e),e.value}transformStart(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.setRangeStart(this.transformation.transformStart(e,n,r))}transformEnd(e,n){this.setRangeEnd(this.transformation.transformEnd(e,n))}getLayerLevel(){return this.selectedRange.size()-1}isSelected(){return!this.selectedRange.isEmpty()}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:g}=i;P0(this,mu,g),d&&Number.isInteger(d==null?void 0:d.row)&&Number.isInteger(d==null?void 0:d.col)&&(h=this.tableProps.createCellCoords(ir(d.row,u,o-1),ir(d.col,c,s-1)));const p=this.tableProps.createCellCoords(u,c),v=this.tableProps.createCellCoords(o-1,s-1);this.clear(),this.setRangeStartOnly(p,void 0,h),c<0&&this.selectedByRowHeader.add(this.getLayerLevel()),u<0&&this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(v),this.finish(),P0(this,mu,!1)}selectCells(e){var n=this;const r=Dl(e);if(r===dp)return!1;if(r===hp)throw new Error(ht`Unsupported format of the selection ranges was passed. To select cells pass\x20
the coordinates as an array of arrays ([[rowStart, columnStart/columnPropStart, rowEnd,\x20
columnEnd/columnPropEnd]]) or as an array of CellRange objects.`);const i=Ic(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(),E(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){const g=l===0?0:ir(r,u,-1),p=s-1,v=this.tableProps.createCellCoords(g,i),S=this.tableProps.createCellCoords(p,o),y=this.tableProps.createCellCoords(ir(r,u,s-1),i);this.runLocalHooks("beforeSelectColumns",v,S,y),v.row=g,S.row=p,this.setRangeStartOnly(v,void 0,y),this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(S),this.runLocalHooks("afterSelectColumns",v,S,y),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){const h=s===0?0:ir(r,a,-1),d=o-1,g=this.tableProps.createCellCoords(e,h),p=this.tableProps.createCellCoords(n,d),v=this.tableProps.createCellCoords(e,ir(r,a,o-1));this.runLocalHooks("beforeSelectRows",g,p,v),g.col=h,p.col=d,this.setRangeStartOnly(g,void 0,v),this.selectedByRowHeader.add(this.getLayerLevel()),this.setRangeEnd(p),this.runLocalHooks("afterSelectRows",g,p,v),this.finish()}return c}refresh(){if(this.highlight.getCustomSelections().forEach(i=>{i.commit()}),!this.isSelected())return;const n=this.highlight.getFocus(),r=this.getLayerLevel();n.commit().syncWith(this.selectedRange.current());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(),g=this.highlight.createColumnHighlight();o.commit(),s.commit(),a.commit(),l.commit(),u.commit(),c.commit(),h.commit(),d.commit(),g.commit()}this.highlight.useLayerLevel(r)}}pt(rH,or);const bq=rH,H0=/^(\r\n|\n\r|\r|\n)/,Rq=/^[^\t\r\n]+/,D0=/^\t/;function Eq(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(D0))t=t.replace(D0,""),n+=1,e[r][n]="";else if(t.match(H0))t=t.replace(H0,""),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(Rq);o=s?s[0]:"",t=t.slice(o.length)}e[r][n]=o}return e}function ic(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(`
`)>-1?o+=`"${s.replace(/"/g,'""')}"`:o+=s:s==null?o+="":o+=s;e!==n-1&&(o+=`
`)}return o}function Ps(t,e,n){return e=Tq(e),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:String(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||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class yl{static get DESTINATION_RENDERER(){return 1}static get DESTINATION_CLIPBOARD_GENERATOR(){return 2}constructor(e,n,r){Ps(this,"hot",void 0),Ps(this,"metaManager",void 0),Ps(this,"tableMeta",void 0),Ps(this,"dataSource",void 0),Ps(this,"duckSchema",void 0),Ps(this,"colToPropCache",void 0),Ps(this,"propToColCache",void 0),this.hot=e,this.metaManager=r,this.tableMeta=r.getTableMeta(),this.dataSource=n,this.duckSchema=this.createDuckSchema(),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=kg(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(Ve(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 vb(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)&&Ye(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&&ue(this.colToPropCache[n])?this.colToPropCache[n]:n}propToCol(e){const n=this.propToColCache.get(e);if(ue(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]?Hl(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 p=null;this.hot.dataType==="array"?this.tableMeta.dataSchema?p=Tn(this.getSchema()):(p=[],me(h-1,()=>p.push(null))):this.hot.dataType==="function"?p=this.tableMeta.dataSchema(l+a):(p={},Xc(p,this.getSchema())),d.push(p),a+=1}this.hot.rowIndexMapper.insertIndexes(l,a),i==="below"&&(s=Math.min(s+1,o)),this.spliceData(s,0,d);const g=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",g,a,r),this.hot.forceFullRender=!0,{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(),g=0,p=c;i==="end"&&(p=Math.min(p+1,a));const v=p;for(;g<n&&d<s;){if(typeof l!="number"||l>=d)if(h>0)for(let y=0;y<h;y+=1)typeof o[y]>"u"&&(o[y]=[]),o[y].push(null);else o.push([null]);else for(let y=0;y<h;y++)o[y].splice(p,0,null);g+=1,p+=1,d+=1}this.hot.columnIndexMapper.insertIndexes(l,g),g>0&&(e==null?this.metaManager.createColumn(null,g):r!=="auto"&&this.metaManager.createColumn(v,n));const S=this.hot.toVisualColumn(v);return this.hot.runHooks("afterCreateCol",S,g,r),this.hot.forceFullRender=!0,this.refreshDuckSchema(),{delta:g,startPhysicalIndex:v}}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=ue(this.tableMeta.columns)||ue(this.tableMeta.dataSchema);this.hot.rowIndexMapper.getNotTrimmedIndexesLength()===0&&c===!1&&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),this.hot.forceFullRender=!0,!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 g=0;g<u;g++)c[h].splice(s[g],1),h===0&&this.metaManager.removeColumn(s[g],1);return i<this.hot.countCols()&&(this.hot.columnIndexMapper.removeIndexes(o),this.hot.columnIndexMapper.getNotTrimmedIndexesLength()===0&&this.hot.rowIndexMapper.setIndexesSequence([])),this.hot.runHooks("afterRemoveCol",i,n,o,r),this.hot.forceFullRender=!0,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];$C(l,s);let c=0;for(;c<r;)l.push(null),c+=1;return ix(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];$C(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;let s=null;if(i&&i.hasOwnProperty&&It(i,n))s=i[n];else if(typeof n=="string"&&n.indexOf(".")>-1){const a=n.split(".");let l=i;if(!l)return null;for(let u=0,c=a.length;u<c;u++)if(l=l[a[u]],typeof l>"u")return null;s=l}else typeof n=="function"&&(s=n(this.dataSource.slice(r,r+1)[0]));if(this.hot.hasHook("modifyData")){const a=ei(s);this.hot.runHooks("modifyData",r,this.propToCol(n),a,"get"),a.isTouched()&&(s=a.value)}return s}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 l=ei(o);this.hot.runHooks("modifyData",i,this.propToCol(n),l,"set"),l.isTouched()&&(o=l.value)}if(s&&s.hasOwnProperty&&It(s,n))s[n]=o;else if(typeof n=="string"&&n.indexOf(".")>-1){const l=n.split(".");let u=s,c=0,h;for(c=0,h=l.length-1;c<h;c++)typeof u[l[c]]>"u"&&(u[l[c]]={}),u=u[l[c]];u[l[c]]=o}else typeof n=="function"?n(this.dataSource.slice(i,i+1)[0],o):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,yl.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===yl.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 g=o>=0?this.hot.toPhysicalRow(o):o;for(s=Math.min(e.col,n.col);s<=d&&g!==null;s++)a.push(c.call(this,o,this.colToProp(s)));g!==null&&i.push(a)}return i}getText(e,n){return ic(this.getRange(e,n,yl.DESTINATION_RENDERER))}getCopyableText(e,n){return ic(this.getRange(e,n,yl.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 Mq=yl,{register:Aq,getItem:Oq,hasItem:iH,getNames:Iq,getValues:lce}=ai("cellTypes");function xb(t){if(!iH(t))throw Error(`You declared cell type "${t}" as a string that is not mapped to a known object.
Cell type must be an object or a string mapped to an object registered by
"Handsontable.cellTypes.registerCellType" method`);return Oq(t)}function br(t,e){typeof t!="string"&&(e=t,t=e.CELL_TYPE);const{editor:n,renderer:r,validator:i}=e;n&&Jn(t,n),r&&lr(t,r),i&&ta(t,i),Aq(t,e)}function Pq(t,e){var n;return t==="CELL_TYPE"?!1:((n=e._automaticallyAssignedMetaProps)===null||n===void 0?void 0:n.has(t))||!It(e,t)}function fp(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t;const r=typeof e.type=="string"?xb(e.type):e.type;if(t._automaticallyAssignedMetaProps&&Ye(e,(o,s)=>void t._automaticallyAssignedMetaProps.delete(s)),!Ve(r))return;n===t&&!t._automaticallyAssignedMetaProps&&(t._automaticallyAssignedMetaProps=new Set);const i={};Ye(r,(o,s)=>{if(Pq(s,n)){var a;i[s]=o,(a=t._automaticallyAssignedMetaProps)===null||a===void 0||a.add(s)}}),jt(t,i)}function xq(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];function n(){}To(n,t);for(let r=0;r<e.length;r++)n.prototype[e[r]]=void 0;return n}function Jd(t){return Number.isInteger(t)&&t>=0}function ef(t,e){if(!t())throw new Error(`Assertion failed: ${e}`)}function jh(t){return t==null}const oH=()=>({_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,dataSchema:void 0,dateFormat:"DD/MM/YYYY",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,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),Zt(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),Zt(r)===!1)return typeof r=="object"?(i=this.getCellMeta(t,e),$g(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,tabMoves:{row:0,col:1},title:void 0,trimDropdown:!0,trimRows:void 0,trimWhitespace:!0,type:"text",uncheckedTemplate:void 0,undo:void 0,validator:void 0,viewportColumnRenderingOffset:"auto",viewportRowRenderingOffset:"auto",visibleRows:10,width:void 0,wordWrap:!0});function N0(t,e,n){return e=Hq(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Hq(t){var e=Dq(t,"string");return typeof e=="symbol"?e:String(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||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Nq(){return class{}}class Lq{constructor(e){N0(this,"metaCtor",Nq()),N0(this,"meta",void 0),this.meta=this.metaCtor.prototype,jt(this.meta,oH()),this.meta.instance=e}getMetaConstructor(){return this.metaCtor}getMeta(){return this.meta}updateMeta(e){var n;jt(this.meta,e),fp(this.meta,{...e,type:(n=e.type)!==null&&n!==void 0?n:this.meta.type},e)}}function $q(t,e,n){return e=kq(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function kq(t){var e=Fq(t,"string");return typeof e=="symbol"?e:String(e)}function Fq(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Wq{constructor(e){$q(this,"meta",void 0);const n=e.getMetaConstructor();this.meta=new n}getMeta(){return this.meta}updateMeta(e){jt(this.meta,e),fp(this.meta,e,e)}}let sH;function Kh(t,e,n){return e=Vq(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Vq(t){var e=Bq(t,"string");return typeof e=="symbol"?e:String(e)}function Bq(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}sH=Symbol.iterator;class $f{constructor(e){Kh(this,"valueFactory",void 0),Kh(this,"data",[]),Kh(this,"index",[]),Kh(this,"holes",new Set),this.valueFactory=e}obtain(e){ef(()=>Jd(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;ef(()=>Jd(e)||jh(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=jh(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;ef(()=>Jd(e)||jh(e),"Expecting an unsigned number or null/undefined argument.");const r=this.index.splice(jh(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 pr(this.data,(e,n)=>!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&&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)}[sH](){return this.entries()}}function L0(t,e,n){return e=Uq(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Uq(t){var e=Yq(t,"string");return typeof e=="symbol"?e:String(e)}function Yq(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const Gq=["data","width"];class zq{constructor(e){L0(this,"globalMeta",void 0),L0(this,"metas",new $f(()=>this._createMeta())),this.globalMeta=e,this.metas=new $f(()=>this._createMeta())}updateMeta(e,n){const r=this.getMeta(e);jt(r,n),fp(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 xq(this.globalMeta.getMetaConstructor(),Gq).prototype}}function $0(t,e,n){return e=jq(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function jq(t){var e=Kq(t,"string");return typeof e=="symbol"?e:String(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||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Xq{constructor(e){$0(this,"columnMeta",void 0),$0(this,"metas",new $f(()=>this._createRow())),this.columnMeta=e}updateMeta(e,n,r){const i=this.getMeta(e,n);jt(i,r),fp(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++)e.push(...n[r].values());return e}getMetasAtRow(e){ef(()=>Jd(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 $f(e=>this._createMeta(e))}_createMeta(e){const n=this.columnMeta.getMetaConstructor(e);return new n}}class aH{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 Lq(e),this.tableMeta=new Wq(this.globalMeta),this.columnMeta=new zq(this.globalMeta),this.cellMeta=new Xq(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){let{visualRow:i,visualColumn:o}=r;const s=this.cellMeta.getMeta(e,n);return s.visualRow=i,s.visualCol=o,s.row=e,s.col=n,this.runLocalHooks("afterGetCellMeta",s),s}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()}}pt(aH,or);function k0(t,e,n,r){const{hotInstance:i,dataMap:o,dataSource:s,internalSource:a,source:l,metaManager:u,firstRun:c}=r,h=En(a),d=i.getSettings();Array.isArray(d.dataSchema)?i.dataType="array":vt(d.dataSchema)?i.dataType="function":i.dataType="object",o&&o.destroy(),t=i.runHooks(`before${h}`,t,c,l);const g=new Mq(i,t,u);if(e(g),typeof t=="object"&&t!==null)t.push&&t.splice||(t=[t]);else if(t===null){const p=g.getSchema();t=[];let v,S=0,y=0;for(S=0,y=d.startRows;S<y;S++)if((i.dataType==="object"||i.dataType==="function")&&d.dataSchema)v=Tn(p),t.push(v);else if(i.dataType==="array")v=Tn(p[0]),t.push(v);else{v=[];for(let R=0,T=d.startCols;R<T;R++)v.push(null);t.push(v)}}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,g.dataSource=t,s.data=t,s.dataType=i.dataType,s.colToProp=g.colToProp.bind(g),s.propToCol=g.propToCol.bind(g),s.countCachedColumns=g.countCachedColumns.bind(g),n(g),i.runHooks(`after${h}`,t,c,l),c||(i.runHooks("afterChange",null,a),i.render()),i.getSettings().ariaTags&&Ee(i.rootElement,[dx(-1),Pg(i.countCols()+(i.view?i.countRowHeaders():0))])}function F0(t,e,n){return e=qq(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function qq(t){var e=Zq(t,"string");return typeof e=="symbol"?e:String(e)}function Zq(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Qq{constructor(e){F0(this,"metaManager",void 0),F0(this,"metaSyncMemo",new Map),this.metaManager=e,e.addLocalHook("afterGetCellMeta",n=>this.extendCellMeta(n)),de.getSingleton().add("beforeRender",n=>{n&&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=It(e,"type")?e.type:null;let c=vt(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 $w(t,e,n){return e=Jq(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Jq(t){var e=e6(t,"string");return typeof e=="symbol"?e:String(e)}function e6(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class t6{constructor(e){$w(this,"metaManager",void 0),$w(this,"usageTracker",new Set),$w(this,"propDescriptors",new Map([["ariaTags",{onChange(n,r,i){if(!i)throw new Error(`The \`${n}\` option can not be updated after the Handsontable instance was initialized.`)}}],["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",{onChange(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{target:r,onChange:i=()=>{}}=e,o=typeof r=="string",s=o?r:n,a=`_${s}`;this.metaManager.globalMeta.meta[a]=this.metaManager.globalMeta.meta[s],this.installPropWatcher(n,a,i),o&&this.installPropWatcher(r,a,i)})}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 lH="gridDefault",Hb="editorManager.handlingEditor",n6={name:"editorCloseAndSave",callback(t,e,n){const r=t._getEditorManager();r.closeEditorAndSaveChanges(e.ctrlKey||e.metaKey),r.moveSelectionAfterEnter(n.includes("shift"))}},r6={name:"editorCloseWithoutSaving",callback(t){const e=t._getEditorManager();e.closeEditorAndRestoreOriginalValue(t.getShortcutManager().isCtrlPressed()),e.activeEditor.focus()}},i6={name:"editorFastOpen",callback(t,e){const{highlight:n}=t.getSelectedRangeLast();n.isHeader()||t._getEditorManager().openEditor(null,e,!0)}},o6={name:"editorOpen",callback(t,e,n){const r=t._getEditorManager(),{highlight:i}=t.getSelectedRangeLast();i.isHeader()||(t.getSettings().enterBeginsEditing?r.cellProperties.readOnly?r.moveSelectionAfterEnter():r.openEditor(null,e,!0):r.moveSelectionAfterEnter(n.includes("shift")),Lr(e))}};function s6(){return[n6,r6,i6,o6]}const a6={name:"extendCellsSelectionDown",callback(t){const{highlight:e}=t.getSelectedRangeLast();(e.isCell()||e.isHeader()&&t.selection.isSelectedByRowHeader())&&t.selection.transformEnd(1,0)}},l6={name:"extendCellsSelectionDownByViewportHeight",callback(t){const{to:e}=t.getSelectedRangeLast(),n=Math.min(e.row+t.countVisibleRows(),t.countRows()-1),r=t.rowIndexMapper.getNearestNotHiddenIndex(n,-1);if(r!==null){const i=t._createCellCoords(r,e.col),o=e.row-t.view.getFirstFullyVisibleRow(),s=Math.min(i.row-o,t.countRows()-1);t.selection.setRangeEnd(i),t.scrollViewportTo({row:s,verticalSnap:"top",horizontalSnap:"start"})}}},u6={name:"extendCellsSelectionLeft",callback(t){const{highlight:e}=t.getSelectedRangeLast();(e.isCell()||e.isHeader()&&t.selection.isSelectedByColumnHeader())&&t.selection.transformEnd(0,-1*t.getDirectionFactor())}},c6={name:"extendCellsSelectionRight",callback(t){const{highlight:e}=t.getSelectedRangeLast();(e.isCell()||e.isHeader()&&t.selection.isSelectedByColumnHeader())&&t.selection.transformEnd(0,t.getDirectionFactor())}},h6={name:"extendCellsSelectionToColumns",callback(t){const{highlight:e,from:n,to:r}=t.getSelectedRangeLast();t.selection.isSelectedByRowHeader()?t.selection.selectAll(!0,!0):t.selectColumns(n.col,r.col,e.row)}},d6={name:"extendCellsSelectionToMostBottom",callback(t){const{selection:e,rowIndexMapper:n}=t,{highlight:r,from:i,to:o}=t.getSelectedRangeLast(),s=r.isHeader()&&t.selection.isSelectedByRowHeader();if(r.isCell()||s){const a=n.getNearestNotHiddenIndex(t.countRows()-1,-1);e.setRangeStart(i.clone()),s&&e.selectedByRowHeader.add(e.getLayerLevel()),e.setRangeEnd(t._createCellCoords(a,o.col))}}},f6={name:"extendCellsSelectionToMostInlineEnd",callback(t){const{selection:e,columnIndexMapper:n}=t,{highlight:r}=t.getSelectedRangeLast();r.isCell()&&e.setRangeEnd(t._createCellCoords(e.selectedRange.current().from.row,n.getNearestNotHiddenIndex(t.countCols()-1,-1)))}},g6={name:"extendCellsSelectionToMostInlineStart",callback(t){const{selection:e,columnIndexMapper:n}=t,{highlight:r}=t.getSelectedRangeLast();r.isCell()&&e.setRangeEnd(t._createCellCoords(e.selectedRange.current().from.row,n.getNearestNotHiddenIndex(0,1)))}},m6={name:"extendCellsSelectionToMostLeft",callback(t){const{selection:e,columnIndexMapper:n}=t,{highlight:r,from:i,to:o}=t.getSelectedRangeLast(),s=r.isHeader()&&t.selection.isSelectedByColumnHeader();if(r.isCell()||s){const a=n.getNearestNotHiddenIndex(...t.isRtl()?[t.countCols()-1,-1]:[0,1]);e.setRangeStart(i.clone()),s&&e.selectedByColumnHeader.add(e.getLayerLevel()),e.setRangeEnd(t._createCellCoords(o.row,a))}}},p6={name:"extendCellsSelectionToMostRight",callback(t){const{selection:e,columnIndexMapper:n}=t,{highlight:r,from:i,to:o}=t.getSelectedRangeLast(),s=r.isHeader()&&t.selection.isSelectedByColumnHeader();if(r.isCell()||s){const a=n.getNearestNotHiddenIndex(...t.isRtl()?[0,1]:[t.countCols()-1,-1]);e.setRangeStart(i.clone()),s&&e.selectedByColumnHeader.add(e.getLayerLevel()),e.setRangeEnd(t._createCellCoords(o.row,a))}}},w6={name:"extendCellsSelectionToMostTop",callback(t){const{selection:e,rowIndexMapper:n}=t,{highlight:r,from:i,to:o}=t.getSelectedRangeLast(),s=r.isHeader()&&t.selection.isSelectedByRowHeader();if(r.isCell()||s){const a=n.getNearestNotHiddenIndex(0,1);e.setRangeStart(i.clone()),s&&e.selectedByRowHeader.add(e.getLayerLevel()),e.setRangeEnd(t._createCellCoords(a,o.col))}}},v6={name:"extendCellsSelectionToRows",callback(t){const{highlight:e,from:n,to:r}=t.getSelectedRangeLast();t.selection.isSelectedByColumnHeader()?t.selection.selectAll(!0,!0):t.selectRows(n.row,r.row,e.col)}},C6={name:"extendCellsSelectionUp",callback(t){const{highlight:e}=t.getSelectedRangeLast();(e.isCell()||e.isHeader()&&t.selection.isSelectedByRowHeader())&&t.selection.transformEnd(-1,0)}},S6={name:"extendCellsSelectionUpByViewportHeight",callback(t){const{to:e}=t.getSelectedRangeLast(),n=Math.max(e.row-t.countVisibleRows(),0),r=t.rowIndexMapper.getNearestNotHiddenIndex(n,1);if(r!==null){const i=t._createCellCoords(r,e.col),o=e.row-t.view.getFirstFullyVisibleRow(),s=Math.max(i.row-o,0);t.selection.setRangeEnd(i),t.scrollViewportTo({row:s,verticalSnap:"top",horizontalSnap:"start"})}}};function y6(){return[a6,l6,u6,c6,h6,d6,f6,g6,m6,p6,w6,v6,C6,S6]}const b6={name:"moveCellSelectionDown",callback(t){let{selection:e}=t;e.transformStart(1,0)}},R6={name:"moveCellSelectionDownByViewportHeight",callback(t){const{navigableHeaders:e}=t.getSettings(),n=e?t.countColHeaders():0,{row:r}=t.getSelectedRangeLast().highlight;let i=t.countVisibleRows()+n;r===t.countRows()-1?i=1:r+i>t.countRows()&&(i=t.countRows()-r-1),t.selection.transformStart(i,0),t.getSelectedRangeLast().highlight.row<0&&t.scrollViewportTo({row:0})}},E6={name:"moveCellSelectionInlineEnd",callback(t,e){const n=t.getSettings(),r=typeof n.tabMoves=="function"?n.tabMoves(e):n.tabMoves;t.selection.transformStart(-r.row,-r.col)}},T6={name:"moveCellSelectionInlineStart",callback(t,e){const n=t.getSettings(),r=typeof n.tabMoves=="function"?n.tabMoves(e):n.tabMoves;t.selection.transformStart(r.row,r.col)}},_6={name:"moveCellSelectionLeft",callback(t){t.selection.transformStart(0,-1*t.getDirectionFactor())}},M6={name:"moveCellSelectionRight",callback(t){t.selection.transformStart(0,t.getDirectionFactor())}},A6={name:"moveCellSelectionToMostBottom",callback(t){const{col:e}=t.getSelectedRangeLast().highlight;let n=t.rowIndexMapper.getNearestNotHiddenIndex(t.countRows()-1,-1);n===null&&(n=-1),t.selection.setRangeStart(t._createCellCoords(n,e))}},O6={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.setRangeStart(t._createCellCoords(o,s))}},I6={name:"moveCellSelectionToMostInlineEnd",callback(t){const{selection:e,columnIndexMapper:n}=t;e.setRangeStart(t._createCellCoords(t.getSelectedRangeLast().highlight.row,n.getNearestNotHiddenIndex(t.countCols()-1,-1)))}},P6={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.setRangeStart(t._createCellCoords(i,o))}},x6={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.setRangeStart(t._createCellCoords(r,i))}},H6={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.setRangeStart(t._createCellCoords(r,i))}},D6={name:"moveCellSelectionToMostTop",callback(t){const{col:e}=t.getSelectedRangeLast().highlight;let n=t.rowIndexMapper.getNearestNotHiddenIndex(0,1);n===null&&(n=-t.countColHeaders()),t.selection.setRangeStart(t._createCellCoords(n,e))}},N6={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.setRangeStart(t._createCellCoords(s,a))}},L6={name:"moveCellSelectionUp",callback(t){let{selection:e}=t;e.transformStart(-1,0)}},$6={name:"moveCellSelectionUpByViewportHight",callback(t){const{navigableHeaders:e}=t.getSettings(),n=e?t.countColHeaders():0,{row:r}=t.getSelectedRangeLast().highlight;let i=-(t.countVisibleRows()+n);r===-n?i=-1:r+i<n&&(i=-(r+n)),t.selection.transformStart(i,0),t.getSelectedRangeLast().highlight.row<0&&t.scrollViewportTo({row:0})}};function k6(){return[b6,R6,E6,T6,_6,M6,A6,O6,I6,P6,x6,H6,D6,N6,L6,$6]}const F6={name:"emptySelectedCells",callback(t){t.emptySelectedCells(),t._getEditorManager().prepareEditor()}},W6={name:"scrollToFocusedCell",callback(t){const{highlight:e}=t.getSelectedRangeLast(),n=t.view.getFirstFullyVisibleRow()-1,r=t.view.getFirstFullyVisibleColumn()-1,i=t.view.getLastFullyVisibleRow()+1,o=t.view.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"})}}},V6={name:"selectAllCells",callback(t){t.selection.selectAll(!0,!0,{disableHeadersHighlight:!0})}},B6={name:"selectAllCellsAndHeaders",callback(t){t.selection.selectAll(!0,!0,{disableHeadersHighlight:!1})}},U6={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()))}},Y6=[...s6(),...y6(),...k6(),F6,W6,V6,B6,U6];function uH(t){const e={};return Y6.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 G6(t){const e=t.getShortcutManager().addContext("editor"),n=uH(t),r={group:Hb};e.addShortcuts([{keys:[["Enter"],["Enter","Shift"]],callback:(i,o)=>n.editorCloseAndSave(i,o)},{keys:[["Enter","Control/Meta"],["Enter","Control/Meta","Shift"]],captureCtrl:!0,callback:(i,o)=>n.editorCloseAndSave(i,o)},{keys:[["Escape"],["Escape","Control/Meta"]],callback:()=>n.editorCloseWithoutSaving()}],r)}function z6(t){const e=t.getShortcutManager().addContext("grid"),n=uH(t),r={runOnlyIf:()=>{const{navigableHeaders:i}=t.getSettings();return ue(t.getSelected())&&(i||!i&&t.countRenderedRows()>0&&t.countRenderedCols()>0)},group:lH};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:Hb,runOnlyIf:()=>ue(t.getSelected())}),e.addShortcuts([{keys:[["Control/Meta","A"]],callback:()=>n.selectAllCells()},{keys:[["Control/Meta","Shift","Space"]],callback:()=>n.selectAllCellsAndHeaders()},{keys:[["Control/Meta","Enter"]],callback:()=>n.populateSelectedCellsData(),runOnlyIf:()=>!t.getSelectedRangeLast().highlight.isHeader()&&t.getSelectedRangeLast().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:()=>n.moveCellSelectionInlineStart()},{keys:[["Shift","Tab"]],preventDefault:!1,callback:()=>n.moveCellSelectionInlineEnd()},{keys:[["Control/Meta","Backspace"]],callback:()=>n.scrollToFocusedCell()}],r)}function j6(t){[G6,z6].forEach(e=>e(t))}function K6(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n=t.rootElement,r=W0(t),i=W0(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 W0(t){const n=t.rootDocument.createElement("input");return n.type="text",n.classList.add("htFocusCatcher"),t.getSettings().ariaTags&&Ee(n,[Pi(),Eo()]),n}function X6(t){const e=q6(t);let n;const{activate:r,deactivate:i}=K6(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,g,p,v)=>{if(a&&(o.wrapped&&o.flipped||l)&&(l=!1,v.value=!0),s){var S;n=(S=t.getSelectedRangeLast())===null||S===void 0?void 0:S.highlight}}),t.addHook("beforeRowWrap",(h,d,g)=>{o.wrapped=!0,o.flipped=g});function u(){o.wrapped=!1,o.flipped=!1,t.deselectCell(),t.unlisten()}const c={keys:[["Tab"],["Shift","Tab"]],preventDefault:!1,stopPropagation:!1,relativeToGroup:lH,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:g}=t.getSettings();if(a=!1,s=!0,!d||!t.selection.isSelected()||g&&o.wrapped&&o.flipped||!g&&o.wrapped)return g&&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 q6(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}}const V0=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"]]),Xh=t=>t.map(e=>{const n=e.toLowerCase();return V0.has(n)?V0.get(n):n}).sort().join("+"),Z6=t=>t.split("+"),B0=new RegExp("^(?:Key|Digit)([A-Z0-9])$"),Q6=new Set(["Backquote","Minus","Equal","BracketLeft","BracketRight","Backslash","Semicolon","Quote","Comma","Period","Slash"]),kw=t=>{let{key:e,code:n}=t,r=e;return B0.test(n)?r=n.replace(B0,"$1"):Q6.has(n)&&(r=n),r.toLowerCase()},cH=Symbol("shortcut-context");function hH(t){return Ve(t)&&t.__kindOf===cH}const J6=t=>{const e=Bg({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:g=!0,stopPropagation:p=!1,relativeToGroup:v,position:S,forwardToContext:y}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Ct(c))throw new Error("You need to define the shortcut's group.");if(vt(u)===!1)throw new Error("The shortcut's callback needs to be a function.");if(Array.isArray(l)===!1)throw new Error(ht`Pass the shortcut\'s keys as an array of arrays,\x20
using the KeyboardEvent.key properties:\x20
https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values.`);const R={callback:u,group:c,runOnlyIf:h,captureCtrl:d,preventDefault:g,stopPropagation:p};ue(v)&&([R.relativeToGroup,R.position]=[v,S]),hH(y)&&(R.forwardToContext=y),l.forEach(T=>{const N=Xh(T);if(e.hasItem(N)){const F=e.getItem(N);let B=F.findIndex(ee=>ee.group===v);B!==-1?S==="before"?B-=1:B+=1:B=F.length,F.splice(B,0,R)}else e.addItem(N,[R])})},r=function(l){let u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};l.forEach(c=>{Ye(u,(h,d)=>{Object.prototype.hasOwnProperty.call(c,d)===!1&&(c[d]=u[d])}),n(c)})},i=l=>{const u=Xh(l);e.removeItem(u)};return{__kindOf:cH,addShortcut:n,addShortcuts:r,getShortcuts:l=>{const u=Xh(l),c=e.getItem(u);return ue(c)?c.slice():[]},hasShortcut:l=>{const u=Xh(l);return e.hasItem(u)},removeShortcutsByKeys:i,removeShortcutsByGroup:l=>{e.getItems().forEach(c=>{let[h,d]=c;const g=d.filter(p=>p.group!==l);g.length===0?i(Z6(h)):(d.length=0,d.push(...g))})}}};function e9(){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 t9=["meta","alt","shift","control"],pu=e9();let qh=0;function n9(t,e,n,r,i){const o=g=>t9.includes(g),s=function(g){let p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const v=[];return g.altKey&&v.push("alt"),p&&(g.ctrlKey||g.metaKey)?v.push("control/meta"):(g.ctrlKey&&v.push("control"),g.metaKey&&v.push("meta")),g.shiftKey&&v.push("shift"),v},a=g=>{if(e(g)===!1)return;const p=n(g);if(g.keyCode===229||p===!1||Ko(g))return;const v=kw(g);let S=[];o(v)||(S=s(g));const y=[v].concat(S);!i(g,y)&&(Mc()&&S.includes("meta")||!Mc()&&S.includes("control"))&&i(g,[v].concat(s(g,!0))),r(g)},l=g=>{const p=kw(g);o(p)&&pu.press(p)},u=g=>{const p=kw(g);o(p)&&pu.release(p)},c=()=>{pu.releaseAll()};return{mount:()=>{let g=t;for(qh+=1;g;)qh===1&&(g.document.documentElement.addEventListener("keydown",l),g.document.documentElement.addEventListener("keyup",u)),g.document.documentElement.addEventListener("keydown",a),g.document.documentElement.addEventListener("blur",c),g=Ec(g)},unmount:()=>{let g=t;for(qh-=1;g;)qh===0&&(g.document.documentElement.removeEventListener("keydown",l),g.document.documentElement.removeEventListener("keyup",u)),g.document.documentElement.removeEventListener("keydown",a),g.document.documentElement.removeEventListener("blur",c),g=Ec(g)},isPressed:g=>pu.isPressed(g),releasePressedKeys:()=>pu.releaseAll()}}const r9=t=>{let{ownerWindow:e,handleEvent:n,beforeKeyDown:r,afterKeyDown:i}=t;const o=Bg({errorIdExists:p=>`The "${p}" context name is already registered.`});let s="grid";const a=p=>{const v=J6(p);return o.addItem(p,v),v},l=()=>s,u=p=>o.getItem(p),c=p=>{if(!o.hasItem(p))throw new Error(ht`You've tried to activate the "${p}" shortcut context\x20
that does not exist. Before activation, register the context using the "addContext" method.`);s=p};let h=!1;const d=function(p,v){let S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:l();const y=hH(S)?S:u(S);let R=!1;if(!y.hasShortcut(v))return R;const T=y.getShortcuts(v);for(let N=0;N<T.length;N++){const{callback:I,runOnlyIf:F,preventDefault:B,stopPropagation:ee,captureCtrl:U,forwardToContext:j}=T[N];if(F(p)===!0){if(h=U,R=I(p,v)===!1,h=!1,B&&p.preventDefault(),ee&&(Lr(p),p.stopPropagation()),R)break;j&&d(p,v,j)}}return R},g=n9(e,n,r,i,d);return g.mount(),{addContext:a,getActiveContextName:l,getContext:u,setActiveContextName:c,isCtrlPressed:()=>!h&&(g.isPressed("control")||g.isPressed("meta")),releasePressedKeys:()=>g.releasePressedKeys(),destroy:()=>g.unmount()}};let Fw=null;const Ww=new Map;function dH(t,e){var n,r=this;let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,o=!1,s=this;const a=new xr(s);let l,u,c,h,d,g=!0;kX(i)&&$X(this),this.rootElement=t,this.rootDocument=t.ownerDocument,this.rootWindow=this.rootDocument.defaultView,this.isDestroyed=!1,this.renderSuspendedCounter=0,this.executionSuspendedCounter=0;const p=(n=e==null?void 0:e.layoutDirection)!==null&&n!==void 0?n:"inherit",v=["rtl","ltr"].includes(p)?p:this.rootWindow.getComputedStyle(this.rootElement).direction;this.rootElement.setAttribute("dir",v),this.isRtl=function(){return v==="rtl"},this.isLtr=function(){return!s.isRtl()},this.getDirectionFactor=function(){return s.isLtr()?1:-1},e.language=V4(e.language);const S=new aH(s,e,[Qq,t6]),y=S.getTableMeta(),R=S.getGlobalMeta(),T=Bg();this.container=this.rootDocument.createElement("div"),this.renderCall=!1,t.insertBefore(this.container,t.firstChild),Qd(this)&&lx(e.licenseKey,t),this.guid=`ht_${_y()}`,Ww.set(this.guid,this),this.columnIndexMapper=new oS,this.rowIndexMapper=new oS,this.columnIndexMapper.addLocalHook("indexesSequenceChange",f=>{s.runHooks("afterColumnSequenceChange",f)}),this.rowIndexMapper.addLocalHook("indexesSequenceChange",f=>{s.runHooks("afterRowSequenceChange",f)}),u=new e4(s),(!this.rootElement.id||this.rootElement.id.substring(0,3)==="ht_")&&(this.rootElement.id=this.guid);const N=f=>{const{row:m,col:w}=f;return s._createCellCoords(m>=0?s.rowIndexMapper.getRenderableFromVisualIndex(m):m,w>=0?s.columnIndexMapper.getRenderableFromVisualIndex(w):w)},I=f=>{const{row:m,col:w}=f;return s._createCellCoords(m>=0?s.rowIndexMapper.getVisualFromRenderableIndex(m):m,w>=0?s.columnIndexMapper.getVisualFromRenderableIndex(w):w)};let F=new bq(y,{rowIndexMapper:s.rowIndexMapper,columnIndexMapper:s.columnIndexMapper,countCols:()=>s.countCols(),countRows:()=>s.countRows(),propToCol:f=>l.propToCol(f),isEditorOpened:()=>s.getActiveEditor()?s.getActiveEditor().isOpened():!1,countRenderableColumns:()=>this.view.countRenderableColumns(),countRenderableRows:()=>this.view.countRenderableRows(),countRowHeaders:()=>this.countRowHeaders(),countColHeaders:()=>this.countColHeaders(),getShortcutManager:()=>s.getShortcutManager(),createCellCoords:(f,m)=>s._createCellCoords(f,m),createCellRange:(f,m,w)=>s._createCellRange(f,m,w),visualToRenderableCoords:N,renderableToVisualCoords:I,isDisabledCellSelection:(f,m)=>f<0||m<0?s.getSettings().disableVisualSelection:s.getCellMeta(f,m).disableVisualSelection});this.selection=F;const B=f=>{let{hiddenIndexesChanged:m}=f;m&&this.selection.refresh()};this.columnIndexMapper.addLocalHook("cacheUpdated",B),this.rowIndexMapper.addLocalHook("cacheUpdated",B),this.selection.addLocalHook("afterSetRangeEnd",f=>{const m=ei(!1),w=this.selection.getSelectedRange(),{from:A,to:O}=w.current(),D=w.size()-1;this.runHooks("afterSelection",A.row,A.col,O.row,O.col,m,D),this.runHooks("afterSelectionByProp",A.row,s.colToProp(A.col),O.row,s.colToProp(O.col),m,D);let z=!0;o&&(z=!1),m.isTouched()&&(z=!m.value);const G=this.selection.selectedRange.current(),ne=this.selection.isSelectedByAnyHeader(),Z=this.selection.isSelectedByRowHeader(),K=this.selection.isSelectedByColumnHeader();if(z!==!1)if(ne)Z?this.scrollViewportTo({row:f.row}):K&&this.scrollViewportTo({col:f.col});else if(G&&!this.selection.isMultiple()){const{row:Se,col:Pe}=G.from;Se<0&&Pe>=0?this.scrollViewportTo({col:Pe}):Pe<0&&Se>=0?this.scrollViewportTo({row:Se}):this.scrollViewportTo({row:Se,col:Pe})}else this.scrollViewportTo(f.toObject());Z&&K?q(this.rootElement,["ht__selection--rows","ht__selection--columns"]):Z?(Le(this.rootElement,"ht__selection--columns"),q(this.rootElement,"ht__selection--rows")):K?(Le(this.rootElement,"ht__selection--rows"),q(this.rootElement,"ht__selection--columns")):Le(this.rootElement,["ht__selection--rows","ht__selection--columns"]),this._refreshBorders(null)}),this.selection.addLocalHook("afterSelectionFinished",f=>{const m=f.length-1,{from:w,to:A}=f[m];this.runHooks("afterSelectionEnd",w.row,w.col,A.row,A.col,m),this.runHooks("afterSelectionEndByProp",w.row,s.colToProp(w.col),A.row,s.colToProp(A.col),m)}),this.selection.addLocalHook("afterIsMultipleSelection",f=>{const m=this.runHooks("afterIsMultipleSelection",f.value);f.value&&(f.value=m)}),this.selection.addLocalHook("afterDeselect",()=>{h.destroyEditor(),this._refreshBorders(),Le(this.rootElement,["ht__selection--rows","ht__selection--columns"]),this.runHooks("afterDeselect")}),this.selection.addLocalHook("beforeHighlightSet",()=>this.runHooks("beforeSelectionHighlightSet")).addLocalHook("beforeSetRangeStart",function(){for(var f=arguments.length,m=new Array(f),w=0;w<f;w++)m[w]=arguments[w];return r.runHooks("beforeSetRangeStart",...m)}).addLocalHook("beforeSetRangeStartOnly",function(){for(var f=arguments.length,m=new Array(f),w=0;w<f;w++)m[w]=arguments[w];return r.runHooks("beforeSetRangeStartOnly",...m)}).addLocalHook("beforeSetRangeEnd",function(){for(var f=arguments.length,m=new Array(f),w=0;w<f;w++)m[w]=arguments[w];return r.runHooks("beforeSetRangeEnd",...m)}).addLocalHook("beforeSelectColumns",function(){for(var f=arguments.length,m=new Array(f),w=0;w<f;w++)m[w]=arguments[w];return r.runHooks("beforeSelectColumns",...m)}).addLocalHook("afterSelectColumns",function(){for(var f=arguments.length,m=new Array(f),w=0;w<f;w++)m[w]=arguments[w];return r.runHooks("afterSelectColumns",...m)}).addLocalHook("beforeSelectRows",function(){for(var f=arguments.length,m=new Array(f),w=0;w<f;w++)m[w]=arguments[w];return r.runHooks("beforeSelectRows",...m)}).addLocalHook("afterSelectRows",function(){for(var f=arguments.length,m=new Array(f),w=0;w<f;w++)m[w]=arguments[w];return r.runHooks("afterSelectRows",...m)}).addLocalHook("beforeModifyTransformStart",function(){for(var f=arguments.length,m=new Array(f),w=0;w<f;w++)m[w]=arguments[w];return r.runHooks("modifyTransformStart",...m)}).addLocalHook("afterModifyTransformStart",function(){for(var f=arguments.length,m=new Array(f),w=0;w<f;w++)m[w]=arguments[w];return r.runHooks("afterModifyTransformStart",...m)}).addLocalHook("beforeModifyTransformEnd",function(){for(var f=arguments.length,m=new Array(f),w=0;w<f;w++)m[w]=arguments[w];return r.runHooks("modifyTransformEnd",...m)}).addLocalHook("afterModifyTransformEnd",function(){for(var f=arguments.length,m=new Array(f),w=0;w<f;w++)m[w]=arguments[w];return r.runHooks("afterModifyTransformEnd",...m)}).addLocalHook("beforeRowWrap",function(){for(var f=arguments.length,m=new Array(f),w=0;w<f;w++)m[w]=arguments[w];return r.runHooks("beforeRowWrap",...m)}).addLocalHook("beforeColumnWrap",function(){for(var f=arguments.length,m=new Array(f),w=0;w<f;w++)m[w]=arguments[w];return r.runHooks("beforeColumnWrap",...m)}).addLocalHook("insertRowRequire",f=>this.alter("insert_row_above",f,1,"auto")).addLocalHook("insertColRequire",f=>this.alter("insert_col_start",f,1,"auto")),c={alter(f,m){var w,A;let O=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,D=arguments.length>3?arguments[3]:void 0,z=arguments.length>4?arguments[4]:void 0;const G=ne=>{if(ne.length===0)return[];const Z=[...ne];return Z.sort((Se,Pe)=>{let[Oe]=Se,[He]=Pe;return Oe===He?0:Oe>He?1:-1}),Yt(Z,(Se,Pe)=>{let[Oe,He]=Pe;const Y=Se[Se.length-1],[lt,Be]=Y,xe=lt+Be;if(Oe<=xe){const De=Math.max(He-(xe-Oe),0);Y[1]+=De}else Se.push([Oe,He]);return Se},[Z[0]])};switch(f){case"insert_row_below":case"insert_row_above":const ne=s.countSourceRows();if(y.maxRows===ne)return;const Z=f==="insert_row_below"?"below":"above";m=(w=m)!==null&&w!==void 0?w:Z==="below"?ne:0;const{delta:K,startPhysicalIndex:Se}=l.createRow(m,O,{source:D,mode:Z});if(K){const Be=F.selectedRange.current(),xe=Be==null?void 0:Be.from,De=xe==null?void 0:xe.row,be=s.toVisualRow(Se);if(F.isSelectedByCorner())F.selectAll(!0,!0,{disableHeadersHighlight:!0});else if(ue(De)&&De>=be){const{row:C,col:b}=Be.to;let _=xe.col;F.isSelectedByRowHeader()&&(_=-1),F.getSelectedRange().pop(),F.setRangeStartOnly(s._createCellCoords(De+K,_),!0),F.setRangeEnd(s._createCellCoords(C+K,b))}else s._refreshBorders()}break;case"insert_col_start":case"insert_col_end":const Pe=f==="insert_col_end"?"end":"start";m=(A=m)!==null&&A!==void 0?A:Pe==="end"?s.countSourceCols():0;const{delta:Oe,startPhysicalIndex:He}=l.createCol(m,O,{source:D,mode:Pe});if(Oe){if(Array.isArray(y.colHeaders)){const C=[s.toVisualColumn(He),0];C.length+=Oe,Array.prototype.splice.apply(y.colHeaders,C)}const Be=F.selectedRange.current(),xe=Be==null?void 0:Be.from,De=xe==null?void 0:xe.col,be=s.toVisualColumn(He);if(F.isSelectedByCorner())F.selectAll(!0,!0,{disableHeadersHighlight:!0});else if(ue(De)&&De>=be){const{row:C,col:b}=Be.to;let _=xe.row;F.isSelectedByColumnHeader()&&(_=-1),F.getSelectedRange().pop(),F.setRangeStartOnly(s._createCellCoords(_,De+Oe),!0),F.setRangeEnd(s._createCellCoords(C,b+Oe))}else s._refreshBorders()}break;case"remove_row":const Y=Be=>{let xe=0;E(Be,De=>{let[be,C]=De;const b=Zt(be)?s.countRows()-1:Math.max(be-xe,0);if(Number.isInteger(be)&&(be=Math.max(be-xe,0)),!l.removeRow(be,C,D))return;const k=s.countRows(),M=y.fixedRowsTop;M>=b+1&&(y.fixedRowsTop-=Math.min(C,M-b));const $=y.fixedRowsBottom;$&&b>=k-$&&(y.fixedRowsBottom-=Math.min(C,$)),xe+=C})};Array.isArray(m)?Y(G(m)):Y([[m,O]]),c.adjustRowsAndCols(),s._refreshBorders();break;case"remove_col":const lt=Be=>{let xe=0;E(Be,De=>{let[be,C]=De;const b=Zt(be)?s.countCols()-1:Math.max(be-xe,0);let _=s.toPhysicalColumn(b);if(Number.isInteger(be)&&(be=Math.max(be-xe,0)),!l.removeCol(be,C,D))return;const M=y.fixedColumnsStart;M>=b+1&&(y.fixedColumnsStart-=Math.min(C,M-b)),Array.isArray(y.colHeaders)&&(typeof _>"u"&&(_=-1),y.colHeaders.splice(_,C)),xe+=C})};Array.isArray(m)?lt(G(m)):lt([[m,O]]),c.adjustRowsAndCols(),s._refreshBorders();break;default:throw new Error(`There is no such action "${f}"`)}z||c.adjustRowsAndCols()},adjustRowsAndCols(){const f=y.minRows,m=y.minSpareRows,w=y.minCols,A=y.minSpareCols;if(s.countRows()===0&&s.countCols()===0&&F.deselect(),f){const O=s.countRows();O<f&&l.createRow(O,f-O,{source:"auto"})}if(m){const O=s.countEmptyRows(!0);if(O<m){const D=m-O,z=Math.min(D,y.maxRows-s.countSourceRows());l.createRow(s.countRows(),z,{source:"auto"})}}{let O;(w||A)&&(O=s.countEmptyCols(!0));let D=s.countCols();if(w&&!y.columns&&D<w){const z=w-D;O+=z,l.createCol(D,z,{source:"auto"})}if(A&&!y.columns&&s.dataType==="array"&&O<A){D=s.countCols();const z=A-O,G=Math.min(z,y.maxCols-D);l.createCol(D,G,{source:"auto"})}}if(F.isSelected()){const O=s.countRows(),D=s.countCols();E(F.selectedRange,z=>{let G=!1,ne=z.from.row,Z=z.from.col,K=z.to.row,Se=z.to.col;ne>O-1?(ne=O-1,G=!0,K>ne&&(K=ne)):K>O-1&&(K=O-1,G=!0,ne>K&&(ne=K)),Z>D-1?(Z=D-1,G=!0,Se>Z&&(Se=Z)):Se>D-1&&(Se=D-1,G=!0,Z>Se&&(Z=Se)),G&&(Z<0?s.selectRows(ne,K,Z):ne<0?s.selectColumns(Z,Se,ne):s.selectCell(ne,Z,K,Se))})}s.view&&s.view.adjustElementsSize()},populateFromArray(f,m,w,A,O){let D,z,G,ne;const Z=[],K={},Se=[],Pe=f.row,Oe=f.col;if(z=m.length,z===0)return!1;let He=0,Y=0;switch(Ve(w)&&(He=w.col-Oe+1,Y=w.row-Pe+1),O){case"shift_down":const lt=ec(m),Be=lt.length,xe=Math.max(Be,He),De=s.getData().slice(Pe),be=ec(De).slice(Oe,Oe+xe);for(G=0;G<xe;G+=1)if(G<Be){for(D=0,z=lt[G].length;D<Y-z;D+=1)lt[G].push(lt[G][D%z]);G<be.length?Se.push(lt[G].concat(be[G])):Se.push(lt[G].concat(new Array(De.length).fill(null)))}else Se.push(lt[G%Be].concat(be[G]));s.populateFromArray(Pe,Oe,ec(Se));break;case"shift_right":const C=m.length,b=Math.max(C,Y),_=s.getData().slice(Pe).map(V=>V.slice(Oe));for(D=0;D<b;D+=1)if(D<C){for(G=0,ne=m[D].length;G<He-ne;G+=1)m[D].push(m[D][G%ne]);if(D<_.length)for(let V=0;V<_[D].length;V+=1)m[D].push(_[D][V]);else m[D].push(...new Array(_[0].length).fill(null))}else m.push(m[D%z].slice(0,b).concat(_[D]));s.populateFromArray(Pe,Oe,m);break;case"overwrite":default:K.row=f.row,K.col=f.col;let k=0,M=0,$=!0,P;const H=function(te){let he=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const ye=m[te%m.length];return he!==null?ye[he%ye.length]:ye},W=m.length,L=w?w.row-f.row+1:0;for(w?z=L:z=Math.max(W,L),D=0;D<z&&!(w&&K.row>w.row&&L>W||!y.allowInsertRow&&K.row>s.countRows()-1||K.row>=y.maxRows);D++){const V=D-k,te=H(V).length,he=w?w.col-f.col+1:0;if(w?ne=he:ne=Math.max(te,he),K.col=f.col,P=s.getCellMeta(K.row,K.col),(A==="CopyPaste.paste"||A==="Autofill.fill")&&P.skipRowOnPaste){k+=1,K.row+=1,z+=1;continue}for(M=0,G=0;G<ne&&!(w&&K.col>w.col&&he>te||!y.allowInsertColumn&&K.col>s.countCols()-1||K.col>=y.maxCols);G++){if(P=s.getCellMeta(K.row,K.col),(A==="CopyPaste.paste"||A==="Autofill.fill")&&P.skipColumnOnPaste){M+=1,K.col+=1,ne+=1;continue}if(P.readOnly&&A!=="UndoRedo.undo"){K.col+=1;continue}const ye=G-M;let Me=H(V,ye),We=s.getDataAtCell(K.row,K.col);if(Me!==null&&typeof Me=="object")if(Array.isArray(Me)&&We===null&&(We=[]),We===null||typeof We!="object")$=!1;else{const St=Hl(Array.isArray(We)?We:We[0]||We),qe=Hl(Array.isArray(Me)?Me:Me[0]||Me);$g(St,qe)||Array.isArray(St)&&Array.isArray(qe)?Me=Tn(Me):$=!1}else We!==null&&typeof We=="object"&&($=!1);$&&Z.push([K.row,K.col,Me]),$=!0,K.col+=1}K.row+=1}s.setDataAtCell(Z,null,null,A||"populateFromArray");break}}};function ee(f){const m=B1(f);Ib(m)?(s.runHooks("beforeLanguageChange",m),R.language=m,s.runHooks("afterLanguageChange",m)):U1(f)}function U(f,m){const w=f==="className"?s.rootElement:s.table;if(g)q(w,m);else{let A=[],O=[];R[f]&&(A=Array.isArray(R[f])?R[f]:FC(R[f])),m&&(O=Array.isArray(m)?m:FC(m));const D=kC(A,O),z=kC(O,A);D.length&&Le(w,D),z.length&&q(w,z)}R[f]=m}this.init=function(){u.setData(y.data),s.runHooks("beforeInit"),(uo()||Gy())&&q(s.rootElement,"mobile"),this.updateSettings(y,!0),this.view=new GX(this),h=Bz.getInstance(s,y,F),d=new Gz(s),Qd(this)&&X6(s),s.runHooks("init"),this.forceFullRender=!0,this.view.render(),g&&s.rootElement.offsetParent===null&&Ex(s.rootElement,()=>{s.view._wt.wtOverlays.updateLastSpreaderSize(),s.render(),s.view.adjustElementsSize()}),typeof g=="object"&&(s.runHooks("afterChange",g[0],g[1]),g=!1),s.runHooks("afterInit")};function j(){let f=!1;return{validatorsInQueue:0,valid:!0,addValidatorToQueue(){this.validatorsInQueue+=1,f=!1},removeValidatorFormQueue(){this.validatorsInQueue=this.validatorsInQueue-1<0?0:this.validatorsInQueue-1,this.checkIfQueueIsEmpty()},onQueueEmpty(){},checkIfQueueIsEmpty(){this.validatorsInQueue===0&&f===!1&&(f=!0,this.onQueueEmpty(this.valid))}}}function re(f){const m=f.replace(",",".");return isNaN(parseFloat(m))===!1?parseFloat(m):f}function ie(f,m,w){if(!f.length)return;const A=s.getActiveEditor(),O=new j;let D=!0;O.onQueueEmpty=z=>{A&&D&&A.cancelChanges(),w(z)};for(let z=f.length-1;z>=0;z--){const[G,ne,,Z]=f[z],K=l.propToCol(ne),Se=s.getCellMeta(G,K);Se.type==="numeric"&&typeof Z=="string"&&Zx(Z)&&(f[z][3]=re(Z)),s.getCellValidator(Se)&&(O.addValidatorToQueue(),s.validateCell(f[z][3],Se,function(Pe,Oe){return function(He){if(typeof He!="boolean")throw new Error("Validation error: result is not boolean");if(He===!1&&Oe.allowInvalid===!1){D=!1,f.splice(Pe,1),Oe.valid=!0;const Y=s.getCell(Oe.visualRow,Oe.visualCol);Y!==null&&Le(Y,y.invalidCellClassName)}O.removeValidatorFormQueue()}}(z,Se),m))}O.checkIfQueueIsEmpty()}function oe(f,m){let w=f.length-1;if(w<0)return;for(;w>=0;w--){let O=!1;if(f[w]===null){f.splice(w,1);continue}if(!((f[w][2]===null||f[w][2]===void 0)&&(f[w][3]===null||f[w][3]===void 0))){if(y.allowInsertRow)for(;f[w][0]>s.countRows()-1;){const{delta:D}=l.createRow(void 0,void 0,{source:m});if(D===0){O=!0;break}}if(s.dataType==="array"&&(!y.columns||y.columns.length===0)&&y.allowInsertColumn)for(;l.propToCol(f[w][1])>s.countCols()-1;){const{delta:D}=l.createCol(void 0,void 0,{source:m});if(D===0){O=!0;break}}O||l.set(f[w][0],f[w][1],f[w][3])}}s.forceFullRender=!0,c.adjustRowsAndCols(),s.runHooks("beforeChangeRender",f,m),h.lockEditor(),s._refreshBorders(null),h.unlockEditor(),s.view.adjustElementsSize(),s.runHooks("afterChange",f,m||"edit");const A=s.getActiveEditor();A&&ue(A.refreshValue)&&A.refreshValue()}this._createCellCoords=function(f,m){return s.view._wt.createCellCoords(f,m)},this._createCellRange=function(f,m,w){return s.view._wt.createCellRange(f,m,w)},this.validateCell=function(f,m,w,A){let O=s.getCellValidator(m);function D(z){if(!(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0)||m.hidden===!0){w(z);return}const ne=m.visualCol,Z=m.visualRow,K=s.getCell(Z,ne,!0);if(K&&K.nodeName!=="TH"){const Se=s.rowIndexMapper.getRenderableFromVisualIndex(Z),Pe=s.columnIndexMapper.getRenderableFromVisualIndex(ne);s.view._wt.getSetting("cellRenderer",Se,Pe,K)}w(z)}ax(O)&&(O=function(z){return function(G,ne){ne(z.test(G))}}(O)),vt(O)?(f=s.runHooks("beforeValidate",f,m.visualRow,m.prop,A),s._registerImmediate(()=>{O.call(m,f,z=>{s&&(z=s.runHooks("afterValidate",z,f,m.visualRow,m.prop,A),m.valid=z,D(z),s.runHooks("postAfterValidate",z,f,m.visualRow,m.prop,A))})})):s._registerImmediate(()=>{m.valid=!0,D(m.valid,!1)})};function ve(f,m,w){return Array.isArray(f)?f:[[f,m,w]]}function _e(f,m){const w=s.getActiveEditor(),A=s.runHooks("beforeChange",f,m||"edit"),O=f.filter(D=>D!==null);return A===!1||O.length===0?(w&&w.cancelChanges(),[]):O}this.setDataAtCell=function(f,m,w,A){const O=ve(f,m,w),D=[];let z=A,G,ne,Z;for(G=0,ne=O.length;G<ne;G++){if(typeof O[G]!="object")throw new Error("Method `setDataAtCell` accepts row number or changes array of arrays as its first parameter");if(typeof O[G][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`");O[G][1]>=this.countCols()?Z=O[G][1]:Z=l.colToProp(O[G][1]),D.push([O[G][0],Z,u.getAtCell(this.toPhysicalRow(O[G][0]),O[G][1]),O[G][2]])}!z&&typeof f=="object"&&(z=m);const K=_e(D,A);s.runHooks("afterSetDataAtCell",K,z),ie(K,z,()=>{oe(K,z)})},this.setDataAtRowProp=function(f,m,w,A){const O=ve(f,m,w),D=[];let z=A,G,ne;for(G=0,ne=O.length;G<ne;G++)D.push([O[G][0],O[G][1],u.getAtCell(this.toPhysicalRow(O[G][0]),O[G][1]),O[G][2]]);!z&&typeof f=="object"&&(z=m);const Z=_e(D,A);s.runHooks("afterSetDataAtRowProp",Z,z),ie(Z,z,()=>{oe(Z,z)})},this.listen=function(){s&&!s.isListening()&&(Ww.forEach(f=>{s!==f&&f.unlisten()}),Fw=s.guid,s.runHooks("afterListen"))},this.unlisten=function(){this.isListening()&&(Fw=null,s.runHooks("afterUnlisten"))},this.isListening=function(){return Fw===s.guid},this.destroyEditor=function(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;s._refreshBorders(f,m)},this.populateFromArray=function(f,m,w,A,O,D,z){if(!(typeof w=="object"&&typeof w[0]=="object"))throw new Error("populateFromArray parameter `input` must be an array of arrays");const G=typeof A=="number"?s._createCellCoords(A,O):null;return c.populateFromArray(s._createCellCoords(f,m),w,G,D,z)},this.spliceCol=function(f,m,w){for(var A=arguments.length,O=new Array(A>3?A-3:0),D=3;D<A;D++)O[D-3]=arguments[D];return l.spliceCol(f,m,w,...O)},this.spliceRow=function(f,m,w){for(var A=arguments.length,O=new Array(A>3?A-3:0),D=3;D<A;D++)O[D-3]=arguments[D];return l.spliceRow(f,m,w,...O)},this.getSelected=function(){if(F.isSelected())return Ue(F.getSelectedRange(),f=>{let{from:m,to:w}=f;return[m.row,m.col,w.row,w.col]})},this.getSelectedLast=function(){const f=this.getSelected();let m;return f&&f.length>0&&(m=f[f.length-1]),m},this.getSelectedRange=function(){if(F.isSelected())return Array.from(F.getSelectedRange())},this.getSelectedRangeLast=function(){const f=this.getSelectedRange();let m;return f&&f.length>0&&(m=f[f.length-1]),m},this.emptySelectedCells=function(f){if(!F.isSelected()||this.countRows()===0||this.countCols()===0)return;const m=[];E(F.getSelectedRange(),w=>{if(w.isSingleHeader())return;const A=w.getTopStartCorner(),O=w.getBottomEndCorner();me(A.row,O.row,D=>{me(A.col,O.col,z=>{this.getCellMeta(D,z).readOnly||m.push([D,z,null])})})}),m.length>0&&this.setDataAtCell(m,f)},this.isRenderSuspended=function(){return this.renderSuspendedCounter>0},this.suspendRender=function(){this.renderSuspendedCounter+=1},this.resumeRender=function(){const f=this.renderSuspendedCounter-1;this.renderSuspendedCounter=Math.max(f,0),!this.isRenderSuspended()&&f===this.renderSuspendedCounter&&(this.renderCall?this.render():this._refreshBorders(null))},this.render=function(){this.view&&(this.renderCall=!0,this.forceFullRender=!0,this.isRenderSuspended()||(h.lockEditor(),this._refreshBorders(null),h.unlockEditor()))},this.batchRender=function(f){this.suspendRender();const m=f();return this.resumeRender(),m},this.isExecutionSuspended=function(){return this.executionSuspendedCounter>0},this.suspendExecution=function(){this.executionSuspendedCounter+=1,this.columnIndexMapper.suspendOperations(),this.rowIndexMapper.suspendOperations()},this.resumeExecution=function(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const m=this.executionSuspendedCounter-1;this.executionSuspendedCounter=Math.max(m,0),(!this.isExecutionSuspended()&&m===this.executionSuspendedCounter||f)&&(this.columnIndexMapper.resumeOperations(),this.rowIndexMapper.resumeOperations())},this.batchExecution=function(f){let m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;this.suspendExecution();const w=f();return this.resumeExecution(m),w},this.batch=function(f){this.suspendRender(),this.suspendExecution();const m=f();return this.resumeExecution(),this.resumeRender(),m},this.refreshDimensions=function(){if(!s.view)return;const{width:f,height:m}=s.view.getLastSize(),{width:w,height:A}=s.rootElement.getBoundingClientRect(),O=w!==f||A!==m;s.runHooks("beforeRefreshDimensions",{width:f,height:m},{width:w,height:A},O)!==!1&&((O||s.view._wt.wtOverlays.scrollableElement===s.rootWindow)&&(s.view.setLastSize(w,A),s.render()),s.runHooks("afterRefreshDimensions",{width:f,height:m},{width:w,height:A},O))},this.updateData=function(f,m){k0(f,w=>{l=w},w=>{l=w,s.columnIndexMapper.fitToLength(this.getInitialColumnCount()),s.rowIndexMapper.fitToLength(this.countSourceRows()),c.adjustRowsAndCols()},{hotInstance:s,dataMap:l,dataSource:u,internalSource:"updateData",source:m,metaManager:S,firstRun:g})},this.loadData=function(f,m){k0(f,w=>{l=w},()=>{S.clearCellsCache(),s.initIndexMappers(),c.adjustRowsAndCols(),g&&(g=[null,"loadData"])},{hotInstance:s,dataMap:l,dataSource:u,internalSource:"loadData",source:m,metaManager:S,firstRun:g})},this.getInitialColumnCount=function(){const f=y.columns;let m=0;if(Array.isArray(f))m=f.length;else if(vt(f))if(s.dataType==="array"){const w=this.countSourceCols();for(let A=0;A<w;A+=1)f(A)&&(m+=1)}else(s.dataType==="object"||s.dataType==="function")&&(m=l.colToPropCache.length);else if(ue(y.dataSchema)){const w=l.getSchema();m=Array.isArray(w)?w.length:kg(w)}else m=this.countSourceCols();return m},this.initIndexMappers=function(){this.columnIndexMapper.initToLength(this.getInitialColumnCount()),this.rowIndexMapper.initToLength(this.countSourceRows())},this.getData=function(f,m,w,A){return Ct(f)?l.getAll():l.getRange(s._createCellCoords(f,m),s._createCellCoords(w,A),l.DESTINATION_RENDERER)},this.getCopyableText=function(f,m,w,A){return l.getCopyableText(s._createCellCoords(f,m),s._createCellCoords(w,A))},this.getCopyableData=function(f,m){return l.getCopyable(f,l.colToProp(m))},this.getSchema=function(){return l.getSchema()},this.updateSettings=function(f){let m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const w=(g?s.loadData:s.updateData).bind(this);let A=!1,O,D;if(ue(f.rows))throw new Error('The "rows" setting is no longer supported. Do you mean startRows, minRows or maxRows?');if(ue(f.cols))throw new Error('The "cols" setting is no longer supported. Do you mean startCols, minCols or maxCols?');if(ue(f.ganttChart))throw new Error('Since 8.0.0 the "ganttChart" setting is no longer supported.');for(O in f)O==="data"||(O==="language"?ee(f.language):O==="className"?U("className",f.className):O==="tableClassName"&&s.table?(U("tableClassName",f.tableClassName),s.view._wt.wtOverlays.syncOverlayTableClassNames()):de.getSingleton().isRegistered(O)||de.getSingleton().isDeprecated(O)?(vt(f[O])||Array.isArray(f[O]))&&(f[O].initialHook=!0,s.addHook(O,f[O])):!m&&It(f,O)&&(R[O]=f[O]));f.data===void 0&&y.data===void 0?w(null,"updateSettings"):f.data!==void 0?w(f.data,"updateSettings"):f.columns!==void 0&&(l.createMap(),s.initIndexMappers());const z=s.countCols(),G=y.columns;if(G&&vt(G)&&(A=!0),(f.cell!==void 0||f.cells!==void 0||f.columns!==void 0)&&S.clearCache(),z>0)for(O=0,D=0;O<z;O++){if(G){const K=A?G(O):G[D];K&&S.updateColumnMeta(D,K)}D+=1}ue(f.cell)&&Ye(f.cell,K=>{s.setCellMetaObject(K.row,K.col,K)}),s.runHooks("afterCellMetaReset");let ne=s.rootElement.style.height;ne!==""&&(ne=parseInt(s.rootElement.style.height,10));let Z=f.height;if(vt(Z)&&(Z=Z()),m&&s.rootElement.getAttribute("style")&&s.rootElement.setAttribute("data-initialstyle",s.rootElement.getAttribute("style")),Z===null){const K=s.rootElement.getAttribute("data-initialstyle");K&&(K.indexOf("height")>-1||K.indexOf("overflow")>-1)?s.rootElement.setAttribute("style",K):(s.rootElement.style.height="",s.rootElement.style.overflow="")}else Z!==void 0&&(s.rootElement.style.height=isNaN(Z)?`${Z}`:`${Z}px`,s.rootElement.style.overflow="hidden");if(typeof f.width<"u"){let K=f.width;vt(K)&&(K=K()),s.rootElement.style.width=isNaN(K)?`${K}`:`${K}px`}m||(s.view&&(s.view._wt.wtViewport.resetHasOversizedColumnHeadersMarked(),s.view._wt.exportSettingsAsClassNames()),s.runHooks("afterUpdateSettings",f)),c.adjustRowsAndCols(),s.view&&!g&&(s.forceFullRender=!0,h.lockEditor(),s._refreshBorders(null),s.view._wt.wtOverlays.adjustElementsSize(),h.unlockEditor()),!m&&s.view&&(ne===""||Z===""||Z===void 0)&&ne!==Z&&s.view._wt.wtOverlays.updateMainScrollableElements()},this.getValue=function(){const f=s.getSelectedLast();if(y.getValue){if(vt(y.getValue))return y.getValue.call(s);if(f)return s.getData()[f[0][0]][y.getValue]}else if(f)return s.getDataAtCell(f[0],f[1])},this.getSettings=function(){return y},this.clear=function(){this.selectAll(),this.emptySelectedCells()},this.alter=function(f,m,w,A,O){c.alter(f,m,w,A,O)},this.getCell=function(f,m){let w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,A=m,O=f;if(m>=0){if(this.columnIndexMapper.isHidden(this.toPhysicalColumn(m)))return null;A=this.columnIndexMapper.getRenderableFromVisualIndex(m)}if(f>=0){if(this.rowIndexMapper.isHidden(this.toPhysicalRow(f)))return null;O=this.rowIndexMapper.getRenderableFromVisualIndex(f)}return O===null||A===null?null:s.view.getCellAtCoords(s._createCellCoords(O,A),w)},this.getCoords=function(f){const m=this.view._wt.wtTable.getCoords(f);if(m===null)return null;const{row:w,col:A}=m;let O=w,D=A;return w>=0&&(O=this.rowIndexMapper.getVisualFromRenderableIndex(w)),A>=0&&(D=this.columnIndexMapper.getVisualFromRenderableIndex(A)),s._createCellCoords(O,D)},this.colToProp=function(f){return l.colToProp(f)},this.propToCol=function(f){return l.propToCol(f)},this.toVisualRow=f=>this.rowIndexMapper.getVisualFromPhysicalIndex(f),this.toVisualColumn=f=>this.columnIndexMapper.getVisualFromPhysicalIndex(f),this.toPhysicalRow=f=>this.rowIndexMapper.getPhysicalFromVisualIndex(f),this.toPhysicalColumn=f=>this.columnIndexMapper.getPhysicalFromVisualIndex(f),this.getDataAtCell=function(f,m){return l.get(f,l.colToProp(m))},this.getDataAtRowProp=function(f,m){return l.get(f,m)},this.getDataAtCol=function(f){const m=[],w=l.getRange(s._createCellCoords(0,f),s._createCellCoords(y.data.length-1,f),l.DESTINATION_RENDERER);for(let A=0;A<w.length;A+=1)for(let O=0;O<w[A].length;O+=1)m.push(w[A][O]);return m},this.getDataAtProp=function(f){const m=[],w=l.getRange(s._createCellCoords(0,l.propToCol(f)),s._createCellCoords(y.data.length-1,l.propToCol(f)),l.DESTINATION_RENDERER);for(let A=0;A<w.length;A+=1)for(let O=0;O<w[A].length;O+=1)m.push(w[A][O]);return m},this.getSourceData=function(f,m,w,A){let O;return f===void 0?O=u.getData():O=u.getByRange(s._createCellCoords(f,m),s._createCellCoords(w,A)),O},this.getSourceDataArray=function(f,m,w,A){let O;return f===void 0?O=u.getData(!0):O=u.getByRange(s._createCellCoords(f,m),s._createCellCoords(w,A),!0),O},this.getSourceDataAtCol=function(f){return u.getAtColumn(f)},this.setSourceDataAtCell=function(f,m,w,A){const O=ve(f,m,w),D=this.hasHook("afterSetSourceDataAtCell"),z=[];D&&E(O,ne=>{let[Z,K,Se]=ne;z.push([Z,K,u.getAtCell(Z,K),Se])}),E(O,ne=>{let[Z,K,Se]=ne;u.setAtCell(Z,K,Se)}),D&&this.runHooks("afterSetSourceDataAtCell",z,A),this.render();const G=s.getActiveEditor();G&&ue(G.refreshValue)&&G.refreshValue()},this.getSourceDataAtRow=function(f){return u.getAtRow(f)},this.getSourceDataAtCell=function(f,m){return u.getAtCell(f,m)},this.getDataAtRow=function(f){return l.getRange(s._createCellCoords(f,0),s._createCellCoords(f,this.countCols()-1),l.DESTINATION_RENDERER)[0]||[]},this.getDataType=function(f,m,w,A){const O=f===void 0?[0,0,this.countRows(),this.countCols()]:[f,m,w,A],[D,z]=O;let[,,G,ne]=O,Z=null,K=null;G===void 0&&(G=D),ne===void 0&&(ne=z);let Se="mixed";return me(Math.max(Math.min(D,G),0),Math.max(D,G),Pe=>{let Oe=!0;return me(Math.max(Math.min(z,ne),0),Math.max(z,ne),He=>(K=this.getCellMeta(Pe,He).type,Z?Oe=Z===K:Z=K,Oe)),Se=Oe?K:"mixed",Oe}),Se},this.removeCellMeta=function(f,m,w){const[A,O]=[this.toPhysicalRow(f),this.toPhysicalColumn(m)];let D=S.getCellMetaKeyValue(A,O,w);s.runHooks("beforeRemoveCellMeta",f,m,w,D)!==!1&&(S.removeCellMeta(A,O,w),s.runHooks("afterRemoveCellMeta",f,m,w,D)),D=null},this.spliceCellsMeta=function(f){let m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;for(var w=arguments.length,A=new Array(w>2?w-2:0),O=2;O<w;O++)A[O-2]=arguments[O];if(A.length>0&&!Array.isArray(A[0]))throw new Error("The 3rd argument (cellMetaRows) has to be passed as an array of cell meta objects array.");m>0&&S.removeRow(this.toPhysicalRow(f),m),A.length>0&&E(A.reverse(),D=>{S.createRow(this.toPhysicalRow(f)),E(D,(z,G)=>this.setCellMetaObject(f,G,z))}),s.render()},this.setCellMetaObject=function(f,m,w){typeof w=="object"&&Ye(w,(A,O)=>{this.setCellMeta(f,m,O,A)})},this.setCellMeta=function(f,m,w,A){if(s.runHooks("beforeSetCellMeta",f,m,w,A)===!1)return;let D=f,z=m;f<this.countRows()&&(D=this.toPhysicalRow(f)),m<this.countCols()&&(z=this.toPhysicalColumn(m)),S.setCellMeta(D,z,w,A),s.runHooks("afterSetCellMeta",f,m,w,A)},this.getCellsMeta=function(){return S.getCellsMeta()},this.getCellMeta=function(f,m){let w=this.toPhysicalRow(f),A=this.toPhysicalColumn(m);return w===null&&(w=f),A===null&&(A=m),S.getCellMeta(w,A,{visualRow:f,visualColumn:m})},this.getCellMetaAtRow=function(f){return S.getCellsMetaAtRow(f)},this.isColumnModificationAllowed=function(){return!(s.dataType==="object"||y.columns)},this.getCellRenderer=function(f,m){const w=typeof f=="number"?s.getCellMeta(f,m).renderer:f.renderer;return typeof w=="string"?xf(w):Ct(w)?xf("text"):w},this.getCellEditor=function(f,m){const w=typeof f=="number"?s.getCellMeta(f,m).editor:f.editor;return typeof w=="string"?Of(w):Ct(w)?Of("text"):w},this.getCellValidator=function(f,m){const w=typeof f=="number"?s.getCellMeta(f,m).validator:f.validator;return typeof w=="string"?Qy(w):w},this.validateCells=function(f){this._validateCells(f)},this.validateRows=function(f,m){if(!Array.isArray(f))throw new Error("validateRows parameter `rows` must be an array");this._validateCells(m,f)},this.validateColumns=function(f,m){if(!Array.isArray(f))throw new Error("validateColumns parameter `columns` must be an array");this._validateCells(m,void 0,f)},this._validateCells=function(f,m,w){const A=new j;f&&(A.onQueueEmpty=f);let O=s.countRows()-1;for(;O>=0;){if(m!==void 0&&m.indexOf(O)===-1){O-=1;continue}let D=s.countCols()-1;for(;D>=0;){if(w!==void 0&&w.indexOf(D)===-1){D-=1;continue}A.addValidatorToQueue(),s.validateCell(s.getDataAtCell(O,D),s.getCellMeta(O,D),z=>{if(typeof z!="boolean")throw new Error("Validation error: result is not boolean");z===!1&&(A.valid=!1),A.removeValidatorFormQueue()},"validateCells"),D-=1}O-=1}A.checkIfQueueIsEmpty()},this.getRowHeader=function(f){let m=y.rowHeaders,w=f;return w!==void 0&&(w=s.runHooks("modifyRowHeader",w)),w===void 0?(m=[],me(s.countRows()-1,A=>{m.push(s.getRowHeader(A))})):Array.isArray(m)&&m[w]!==void 0?m=m[w]:vt(m)?m=m(w):m&&typeof m!="string"&&typeof m!="number"&&(m=w+1),m},this.hasRowHeaders=function(){return!!y.rowHeaders},this.hasColHeaders=function(){if(y.colHeaders!==void 0&&y.colHeaders!==null)return!!y.colHeaders;for(let f=0,m=s.countCols();f<m;f++)if(s.getColHeader(f))return!0;return!1},this.getColHeader=function(f){let m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1;const w=s.runHooks("modifyColHeader",f);if(w===void 0){const G=[],ne=s.countCols();for(let Z=0;Z<ne;Z++)G.push(s.getColHeader(Z));return G}let A=y.colHeaders;const O=function(G){const ne=[],Z=s.countCols();let K=0;for(;K<Z;K++)vt(y.columns)&&y.columns(K)&&ne.push(K);return ne[G]},D=s.toPhysicalColumn(w),z=O(D);return y.colHeaders===!1?A=null:y.columns&&vt(y.columns)&&y.columns(z)&&y.columns(z).title?A=y.columns(z).title:y.columns&&y.columns[D]&&y.columns[D].title?A=y.columns[D].title:Array.isArray(y.colHeaders)&&y.colHeaders[D]!==void 0?A=y.colHeaders[D]:vt(y.colHeaders)?A=y.colHeaders(D):y.colHeaders&&typeof y.colHeaders!="string"&&typeof y.colHeaders!="number"&&(A=Yg(w)),A=s.runHooks("modifyColumnHeaderValue",A,f,m),A},this._getColWidthFromSettings=function(f){let m;if(f>=0&&(m=s.getCellMeta(0,f).width),(m===void 0||m===y.width)&&(m=y.colWidths),m!=null){switch(typeof m){case"object":m=m[f];break;case"function":m=m(f);break}typeof m=="string"&&(m=parseInt(m,10))}return m},this.getColWidth=function(f){let m=s._getColWidthFromSettings(f);return m=s.runHooks("modifyColWidth",m,f),m===void 0&&(m=Zc.DEFAULT_WIDTH),m},this._getRowHeightFromSettings=function(f){let m=y.rowHeights;if(m!=null){switch(typeof m){case"object":m=m[f];break;case"function":m=m(f);break}typeof m=="string"&&(m=parseInt(m,10))}return m},this.getRowHeight=function(f){let m=s._getRowHeightFromSettings(f);return m=s.runHooks("modifyRowHeight",m,f),m},this.countSourceRows=function(){return u.countRows()},this.countSourceCols=function(){return u.countFirstRowKeys()},this.countRows=function(){return l.getLength()},this.countCols=function(){const f=y.maxCols,m=this.columnIndexMapper.getNotTrimmedIndexesLength();return Math.min(f,m)},this.countRenderedRows=function(){return s.view._wt.drawn?s.view._wt.wtTable.getRenderedRowsCount():-1},this.countVisibleRows=function(){return s.view._wt.drawn?s.view._wt.wtTable.getVisibleRowsCount():-1},this.countRenderedCols=function(){return s.view._wt.drawn?s.view._wt.wtTable.getRenderedColumnsCount():-1},this.countVisibleCols=function(){return s.view._wt.drawn?s.view._wt.wtTable.getVisibleColumnsCount():-1},this.countRowHeaders=function(){return this.view.getRowHeadersCount()},this.countColHeaders=function(){return this.view.getColumnHeadersCount()},this.countEmptyRows=function(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,m=0;return Pf(s.countRows()-1,w=>{if(s.isEmptyRow(w))m+=1;else if(f===!0)return!1}),m},this.countEmptyCols=function(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,m=0;return Pf(s.countCols()-1,w=>{if(s.isEmptyCol(w))m+=1;else if(f===!0)return!1}),m},this.isEmptyRow=function(f){return y.isEmptyRow.call(s,f)},this.isEmptyCol=function(f){return y.isEmptyCol.call(s,f)},this.selectCell=function(f,m,w,A){let O=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,D=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;return Ct(f)||Ct(m)?!1:this.selectCells([[f,m,w,A]],O,D)},this.selectCells=function(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[[]],m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;m===!1&&(o=!0);const A=F.selectCells(f);return A&&w&&s.listen(),o=!1,A},this.selectColumns=function(f){let m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f,w=arguments.length>2?arguments[2]:void 0;return F.selectColumns(f,m,w)},this.selectRows=function(f){let m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f,w=arguments.length>2?arguments[2]:void 0;return F.selectRows(f,m,w)},this.deselectCell=function(){F.deselect()},this.selectAll=function(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f,w=arguments.length>2?arguments[2]:void 0;o=!0,F.selectAll(f,m,w),o=!1};const rt=(f,m)=>f.getNearestNotHiddenIndex(m,1,!0);this.scrollViewportTo=function(f){var m;if(typeof f=="number"){var w;f={row:arguments[0],col:arguments[1],verticalSnap:arguments[2]?"bottom":"top",horizontalSnap:arguments[3]?"end":"start",considerHiddenIndexes:(w=arguments[4])!==null&&w!==void 0?w:!0}}const{row:A,col:O,verticalSnap:D,horizontalSnap:z,considerHiddenIndexes:G}=(m=f)!==null&&m!==void 0?m:{};let ne,Z,K,Se;D!==void 0&&(ne=D==="top",Z=!ne),z!==void 0&&(K=z==="start",Se=!K);let Pe=A,Oe=O;if(G===void 0||G){const lt=Number.isInteger(A)&&A>=0,Be=Number.isInteger(O)&&O>=0,xe=lt?rt(this.rowIndexMapper,A):void 0,De=Be?rt(this.columnIndexMapper,O):void 0;if(xe===null||De===null)return!1;Pe=lt?s.rowIndexMapper.getRenderableFromVisualIndex(xe):A,Oe=Be?s.columnIndexMapper.getRenderableFromVisualIndex(De):O}const He=Number.isInteger(Pe),Y=Number.isInteger(Oe);return He&&Pe>=0&&Y&&Oe>=0?s.view.scrollViewport(s._createCellCoords(Pe,Oe),ne,Se,Z,K):He&&Pe>=0&&(Y&&Oe<0||!Y)?s.view.scrollViewportVertically(Pe,ne,Z):Y&&Oe>=0&&(He&&Pe<0||!He)?s.view.scrollViewportHorizontally(Oe,Se,K):!1},this.scrollToFocusedCell=function(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:()=>{};if(!this.selection.isSelected())return;this.addHookOnce("afterScroll",f);const{highlight:m}=this.getSelectedRangeLast();this.scrollViewportTo(m.toObject())?this.view.render():(this.removeHook("afterScroll",f),this._registerImmediate(()=>f()))},this.destroy=function(){if(s._clearTimeouts(),s._clearImmediates(),s.view&&s.view.destroy(),u&&u.destroy(),u=null,this.getShortcutManager().destroy(),S.clearCache(),Ww.delete(this.guid),Qd(s)){const f=this.rootDocument.querySelector(".hot-display-license-info");f&&f.parentNode.removeChild(f)}oi(s.rootElement),a.destroy(),h&&h.destroy(),s.batchExecution(()=>{s.rowIndexMapper.unregisterAll(),s.columnIndexMapper.unregisterAll(),T.getItems().forEach(f=>{let[,m]=f;m.destroy()}),T.clear(),s.runHooks("afterDestroy")},!0),de.getSingleton().destroy(s),Ye(s,(f,m,w)=>{vt(f)?w[m]=Fe(m):m!=="guid"&&(w[m]=null)}),s.isDestroyed=!0,l&&l.destroy(),l=null,c=null,F=null,h=null,s=null};function Fe(f){return()=>{throw new Error(`The "${f}" method cannot be called because this Handsontable instance has been destroyed`)}}this.getActiveEditor=function(){return h.getActiveEditor()},this.getPlugin=function(f){const m=En(f);return m==="UndoRedo"?this.undoRedo:T.getItem(m)},this.getPluginName=function(f){return f===this.undoRedo?this.undoRedo.constructor.PLUGIN_KEY:T.getId(f)},this.getInstance=function(){return s},this.addHook=function(f,m){de.getSingleton().add(f,m,s)},this.hasHook=function(f){return de.getSingleton().has(f,s)||de.getSingleton().has(f)},this.addHookOnce=function(f,m){de.getSingleton().once(f,m,s)},this.removeHook=function(f,m){de.getSingleton().remove(f,m,s)},this.runHooks=function(f,m,w,A,O,D,z){return de.getSingleton().run(s,f,m,w,A,O,D,z)},this.getTranslatedPhrase=function(f,m){return K1(y.language,f,m)},this.toHTML=()=>jC(this),this.toTableElement=()=>{const f=this.rootDocument.createElement("div");return f.insertAdjacentHTML("afterbegin",jC(this)),f.firstElementChild},this.timeouts=[],this._registerTimeout=function(f){let m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,w=f;typeof w=="function"&&(w=setTimeout(w,m)),this.timeouts.push(w)},this._clearTimeouts=function(){E(this.timeouts,f=>{clearTimeout(f)})},this.immediates=[],this._registerImmediate=function(f){this.immediates.push(setImmediate(f))},this._clearImmediates=function(){E(this.immediates,f=>{clearImmediate(f)})},this._refreshBorders=function(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;h.destroyEditor(f),s.view.render(),m&&F.isSelected()&&h.prepareEditor()},this._getEditorManager=function(){return h},this.isRtl=function(){return s.rootWindow.getComputedStyle(s.rootElement).direction==="rtl"},this.isLtr=function(){return!s.isRtl()},this.getDirectionFactor=function(){return s.isLtr()?1:-1};const pe=r9({handleEvent(){return s.isListening()},beforeKeyDown:f=>this.runHooks("beforeKeyDown",f),afterKeyDown:f=>{this.isDestroyed||s.runHooks("afterDocumentKeyDown",f)},ownerWindow:this.rootWindow});this.addHook("beforeOnCellMouseDown",f=>{f.ctrlKey===!1&&f.metaKey===!1&&pe.releasePressedKeys()}),this.getShortcutManager=function(){return pe},this.getFocusManager=function(){return d},Zy().forEach(f=>{const m=qc(f);T.addItem(f,new m(this))}),j6(s),pe.setActiveContextName("grid"),de.getSingleton().run(s,"construct")}const i9="hooksRefRegisterer",fH={_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){E(this._hooksStorage[t]||[],e=>{this.hot.removeHook(t,e)})},clearHooks(){Ye(this._hooksStorage,(t,e)=>this.removeHooksByKey(e)),this._hooksStorage={}}};Fi(fH,"MIXIN_NAME",i9,{writable:!1,enumerable:!1});const o9=fH;function Br(t,e,n){return e=s9(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function s9(t){var e=a9(t,"string");return typeof e=="symbol"?e:String(e)}function a9(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const l9="base",qt=Object.freeze({VIRGIN:"STATE_VIRGIN",EDITING:"STATE_EDITING",WAITING:"STATE_WAITING",FINISHED:"STATE_FINISHED"}),hS="baseEditor";class Gl{static get EDITOR_TYPE(){return l9}constructor(e){Br(this,"hot",void 0),Br(this,"state",qt.VIRGIN),Br(this,"_opened",!1),Br(this,"_fullEditMode",!1),Br(this,"_closeCallback",null),Br(this,"TD",null),Br(this,"row",null),Br(this,"col",null),Br(this,"prop",null),Br(this,"originalValue",null),Br(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=qt.VIRGIN}extend(){return class extends this.constructor{}}saveValue(e,n){let r,i,o,s;if(n){const h=this.hot.getSelectedLast();r=Math.max(Math.min(h[0],h[2]),0),i=Math.max(Math.min(h[1],h[3]),0),o=Math.max(h[0],h[2]),s=Math.max(h[1],h[3])}else[r,i,o,s]=[this.row,this.col,null,null];const a=this.hot.runHooks("modifyGetCellCoords",r,i);Array.isArray(a)&&([r,i]=a);const u=this.hot.getShortcutManager().getContext("editor"),c={runOnlyIf:()=>ue(this.hot.getSelected()),group:hS};this.isInFullEditMode()&&u.addShortcuts([{keys:[["ArrowUp"]],callback:()=>{this.hot.selection.transformStart(-1,0)}},{keys:[["ArrowDown"]],callback:()=>{this.hot.selection.transformStart(1,0)}},{keys:[["ArrowLeft"]],callback:()=>{this.hot.selection.transformStart(0,-1*this.hot.getDirectionFactor())}},{keys:[["ArrowRight"]],callback:()=>{this.hot.selection.transformStart(0,this.hot.getDirectionFactor())}}],c),this.hot.populateFromArray(r,i,e,o,s,"edit")}beginEditing(e,n){if(this.state!==qt.VIRGIN)return;const r=this.hot,i=r.rowIndexMapper.getRenderableFromVisualIndex(this.row),o=r.columnIndexMapper.getRenderableFromVisualIndex(this.col);if(r.view.scrollViewport(r._createCellCoords(i,o)),this.state=qt.EDITING,this.isInFullEditMode()){const s=typeof e=="string"?e:Ft(this.originalValue);this.setValue(s)}this.open(n),this._opened=!0,this.focus(),r.view.render(),r.runHooks("afterBeginEditing",this.row,this.col)}finishEditing(e,n,r){let i;if(r){const a=this._closeCallback;this._closeCallback=l=>{a&&a(l),r(l),this.hot.view.render()}}if(this.isWaiting())return;const s=this.hot.getShortcutManager().getContext("editor");if(s.removeShortcutsByGroup(hS),s.removeShortcutsByGroup(Vg),this.state===qt.VIRGIN){this.hot._registerTimeout(()=>{this._fireCallbacks(!0)});return}if(this.state===qt.EDITING){if(e){this.cancelChanges(),this.hot.view.render();return}const a=this.getValue();this.cellProperties.trimWhitespace?i=[[typeof a=="string"?String.prototype.trim.call(a||""):a]]:i=[[a]],this.state=qt.WAITING,this.saveValue(i,n),this.hot.getCellValidator(this.cellProperties)?this.hot.addHookOnce("postAfterValidate",l=>{this.state=qt.FINISHED,this.discardEditor(l)}):(this.state=qt.FINISHED,this.discardEditor(!0))}}cancelChanges(){this.state=qt.FINISHED,this.discardEditor()}discardEditor(e){this.state===qt.FINISHED&&(e===!1&&this.cellProperties.allowInvalid!==!0?(this.hot.selectCell(this.row,this.col),this.focus(),this.state=qt.EDITING,this._fireCallbacks(!1)):(this.close(),this._opened=!1,this._fullEditMode=!1,this.state=qt.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===qt.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=en(n),a=ft(n),l=en(this.hot.rootElement),u=ft(this.hot.rootElement),c=r.topOverlay.holder,h=r.inlineStartOverlay.holder,d=c!==o?c.scrollTop:0,g=h!==o?h.scrollLeft:0,p=o.innerWidth-l.left-u,{wtTable:v}=(e=r.getParentOverlay(n))!==null&&e!==void 0?e:this.hot.view._wt,S=v.name,y=["master","inline_start"].includes(S)?d:0,R=["master","top","bottom"].includes(S)?g:0,T=s.top===l.top?0:1;let N=s.top-l.top-T-y,I=0;this.hot.isRtl()?I=o.innerWidth-s.left-a-p-1+R:I=s.left-l.left-1-R,["top","top_inline_start_corner"].includes(S)&&(N+=r.topOverlay.getOverlayOffset()),["inline_start","top_inline_start_corner"].includes(S)&&(I+=Math.abs(r.inlineStartOverlay.getOverlayOffset()));const F=this.hot.hasColHeaders(),B=this.hot.rowIndexMapper.getRenderableFromVisualIndex(this.row),ee=this.hot.columnIndexMapper.getRenderableFromVisualIndex(this.col),j=this.hot.rowIndexMapper.getRenderableIndexesLength()-this.hot.view._wt.getSetting("fixedRowsBottom");(F&&B<=0||B===j)&&(N+=1),ee<=0&&(I+=1);const re=i.rowsRenderCalculator.startPosition,ie=i.columnsRenderCalculator.startPosition,oe=Math.abs(r.inlineStartOverlay.getScrollPosition()),ve=r.topOverlay.getScrollPosition(),_e=nn(this.hot.rootDocument);let rt=n.offsetTop;if(["inline_start","master"].includes(S)&&(rt+=re-ve),["bottom","bottom_inline_start_corner"].includes(S)){const{wtViewport:Z,wtTable:K}=r.bottomOverlay.clone;rt+=Z.getWorkspaceHeight()-K.getHeight()-_e}let Fe=n.offsetLeft;this.hot.isRtl()?(Fe>=0?Fe=v.getWidth()-n.offsetLeft:Fe=Math.abs(Fe),Fe+=ie-oe-a):["top","master","bottom"].includes(S)&&(Fe+=ie-oe);const pe=vo(this.TD,this.hot.rootWindow),f=this.hot.isRtl()?"borderRightWidth":"borderLeftWidth",m=parseInt(pe[f],10)>0?0:1,w=parseInt(pe.borderTopWidth,10)>0?0:1,A=ft(n)+m,O=Pt(n)+w,D=bx(c)?_e:0,z=Rx(h)?_e:0,G=this.hot.view.maximumVisibleElementWidth(Fe)-D+m,ne=Math.max(this.hot.view.maximumVisibleElementHeight(rt)-z+w,23);return{top:N,start:I,height:O,maxHeight:ne,width:A,maxWidth:G}}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}}pt(Gl,o9);function U0(t,e,n){t.addEventListener(e,n,!1)}function Y0(t,e,n){t.removeEventListener(e,n,!1)}function G0(t){return t.ownerDocument.defaultView.getComputedStyle(t)}function u9(t){const e={minHeight:200,maxHeight:300,minWidth:100,maxWidth:300},n=t.body,r=t.createTextNode(""),i=t.createElement("span");let o;function s(){r.textContent=o.value,i.style.position="absolute",i.style.fontSize=G0(o).fontSize,i.style.fontFamily=G0(o).fontFamily,i.style.whiteSpace="pre",n.appendChild(i);const c=i.clientWidth+2;n.removeChild(i);const h=o.style;h.height=`${e.minHeight}px`,e.minWidth>c?h.width=`${e.minWidth}px`:c>e.maxWidth?h.width=`${e.maxWidth}px`:h.width=`${c}px`;const d=o.scrollHeight?o.scrollHeight-1:0;e.minHeight>d?h.height=`${e.minHeight}px`:e.maxHeight<d?(h.height=`${e.maxHeight}px`,h.overflowY="visible"):h.height=`${d}px`}function a(){t.defaultView.setTimeout(s,0)}function l(c){if(c&&c.minHeight)if(c.minHeight==="inherit")e.minHeight=o.clientHeight;else{const h=parseInt(c.minHeight,10);isNaN(h)||(e.minHeight=h)}if(c&&c.maxHeight)if(c.maxHeight==="inherit")e.maxHeight=o.clientHeight;else{const h=parseInt(c.maxHeight,10);isNaN(h)||(e.maxHeight=h)}if(c&&c.minWidth)if(c.minWidth==="inherit")e.minWidth=o.clientWidth;else{const h=parseInt(c.minWidth,10);isNaN(h)||(e.minWidth=h)}if(c&&c.maxWidth)if(c.maxWidth==="inherit")e.maxWidth=o.clientWidth;else{const h=parseInt(c.maxWidth,10);isNaN(h)||(e.maxWidth=h)}i.firstChild||(i.className="autoResize",i.style.display="inline-block",i.appendChild(r))}function u(c,h){let d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;o=c,l(h),o.nodeName==="TEXTAREA"&&(o.style.resize="none",o.style.overflowY="",o.style.height=`${e.minHeight}px`,o.style.minWidth=`${e.minWidth}px`,o.style.maxWidth=`${e.maxWidth}px`,o.style.overflowY="hidden"),d&&(U0(o,"input",s),U0(o,"keydown",a)),s()}return{init:u,resize:s,unObserve(){Y0(o,"input",s),Y0(o,"keydown",a)}}}function z0(t,e){const n=Ly(e),r=e.value.split(`
`);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}zc(e,i)}function xs(t,e,n){return e=c9(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function c9(t){var e=h9(t,"string");return typeof e=="symbol"?e:String(e)}function h9(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const d9="ht_editor_visible",Zh="ht_editor_hidden",j0="textEditor",f9="text";class ba extends Gl{static get EDITOR_TYPE(){return f9}constructor(e){super(e),xs(this,"eventManager",new xr(this)),xs(this,"autoResize",u9(this.hot.rootDocument)),xs(this,"TEXTAREA",void 0),xs(this,"textareaStyle",void 0),xs(this,"TEXTAREA_PARENT",void 0),xs(this,"textareaParentStyle",void 0),xs(this,"layerClass",void 0),this.eventManager=new xr(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(),mx(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.TEXTAREA.value=""),a!==qt.FINISHED&&this.hideEditableElement()}}beginEditing(e,n){this.state===qt.VIRGIN&&(this.TEXTAREA.value="",super.beginEditing(e,n))}focus(){this.TEXTAREA.select(),zc(this.TEXTAREA,this.TEXTAREA.value.length)}createElements(){const{rootDocument:e}=this.hot;this.TEXTAREA=e.createElement("TEXTAREA"),Ee(this.TEXTAREA,[["data-hot-input",""],Vl(-1)]),this.hot.getSettings().ariaTags&&Ee(this.TEXTAREA,[Eo()]),q(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"),q(this.TEXTAREA_PARENT,"handsontableInputHolder"),Ie(this.TEXTAREA_PARENT,this.layerClass)&&Le(this.TEXTAREA_PARENT,this.layerClass),q(this.TEXTAREA_PARENT,Zh),this.textareaParentStyle=this.TEXTAREA_PARENT.style,this.TEXTAREA_PARENT.appendChild(this.TEXTAREA),this.hot.rootElement.appendChild(this.TEXTAREA_PARENT)}hideEditableElement(){Fx()&&(this.textareaStyle.textIndent="-99999px"),this.textareaStyle.overflowY="visible",this.textareaParentStyle.opacity="0",this.textareaParentStyle.height="1px",Le(this.TEXTAREA_PARENT,this.layerClass),q(this.TEXTAREA_PARENT,Zh)}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="",this.textareaStyle.overflowY="hidden";const e=this.TEXTAREA_PARENT.childNodes;let n=!1;me(e.length-1,r=>{const i=e[r];if(Ie(i,"handsontableEditor"))return n=!0,!1}),Ie(this.TEXTAREA_PARENT,Zh)&&Le(this.TEXTAREA_PARENT,Zh),n?(this.layerClass=d9,q(this.TEXTAREA_PARENT,this.layerClass)):(this.layerClass=this.getEditedCellsLayerClass(),q(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!==qt.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=vo(this.TD,this.hot.rootWindow);this.TEXTAREA.style.fontSize=l.fontSize,this.TEXTAREA.style.fontFamily=l.fontFamily,this.TEXTAREA.style.backgroundColor=this.TD.style.backgroundColor;const u=vo(this.TEXTAREA),c=parseInt(u.paddingLeft,10)+parseInt(u.paddingRight,10),h=parseInt(u.paddingTop,10)+parseInt(u.paddingBottom,10),d=i-c,g=s-h,p=o-c,v=a-h;this.autoResize.init(this.TEXTAREA,{minWidth:Math.min(d,p),minHeight:Math.min(g,v),maxWidth:p,maxHeight:v},!0)}bindEvents(){Yy()&&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===qt.EDITING&&this.focus()}),this.addHook("afterRowResize",()=>{this.refreshDimensions(),this.state===qt.EDITING&&this.focus()})}allowKeyEventPropagation(){}destroy(){this.eventManager.destroy(),this.clearHooks()}registerShortcuts(){const e=this.hot.getShortcutManager(),n=e.getContext("editor"),r=e.getContext("grid"),i={runOnlyIf:()=>ue(this.hot.getSelected()),group:j0},o=()=>{this.hot.rootDocument.execCommand("insertText",!1,`
`)};n.addShortcuts([{keys:[["Tab"],["Shift","Tab"],["PageUp"],["PageDown"]],forwardToContext:r,callback:()=>{}},{keys:[["Control","Enter"]],callback:()=>(o(),!1),runOnlyIf:s=>!this.hot.selection.isMultiple()&&!s.altKey},{keys:[["Meta","Enter"]],callback:()=>(o(),!1),runOnlyIf:()=>!this.hot.selection.isMultiple()},{keys:[["Alt","Enter"]],callback:()=>(o(),!1)},{keys:[["Home"]],callback:(s,a)=>{let[l]=a;z0(l,this.TEXTAREA)}},{keys:[["End"]],callback:(s,a)=>{let[l]=a;z0(l,this.TEXTAREA)}}],i)}unregisterShortcuts(){const n=this.hot.getShortcutManager().getContext("editor");n.removeShortcutsByGroup(Vg),n.removeShortcutsByGroup(j0),n.removeShortcutsByGroup(hS)}}const g9="base";function rh(t,e,n,r,i,o,s){const a=s.ariaTags,l=[],u=[],c=[],h=[];s.className&&q(e,s.className),s.readOnly?(l.push(s.readOnlyCellClassName),a&&h.push(OE())):a&&c.push(OE()[0]),s.valid===!1&&s.invalidCellClassName?(l.push(s.invalidCellClassName),a&&h.push(IE())):(u.push(s.invalidCellClassName),a&&c.push(IE()[0])),s.wordWrap===!1&&s.noWordWrapClassName&&l.push(s.noWordWrapClassName),!o&&s.placeholder&&l.push(s.placeholderCellClassName),Le(e,u),q(e,l),Ca(e,c),Ee(e,h)}rh.RENDERER_TYPE=g9;const m9="text";function Ao(t,e,n,r,i,o,s){rh.apply(this,[t,e,n,r,i,o,s]);let a=o;if(!a&&s.placeholder&&(a=s.placeholder),a=Ft(a),s.trimWhitespace&&(a=a.trim()),s.rendererTemplate){oi(e);const l=t.rootDocument.createElement("TEMPLATE");l.setAttribute("bind","{{}}"),l.innerHTML=s.rendererTemplate,HTMLTemplateElement.decorate(l),l.model=t.getSourceDataAtRow(n),e.appendChild(l)}else hs(e,a)}Ao.RENDERER_TYPE=m9;const p9="text",gH={CELL_TYPE:p9,editor:ba,renderer:Ao};br(gH);Ae.editors={BaseEditor:Gl};function Ae(t,e){const n=new dH(t,e||{},pb);return n.init(),n}Ae.Core=function(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return new dH(t,e,pb)};Ae.DefaultSettings=oH();Ae.hooks=de.getSingleton();Ae.CellCoords=Df;Ae.CellRange=eb;Ae.packageName="handsontable";Ae.buildDate="16/01/2024 10:27:23";Ae.version="14.1.0";Ae.languages={dictionaryKeys:D4,getLanguageDictionary:j1,getLanguagesDictionaries:F4,registerLanguageDictionary:Ob,getTranslatedPhrase:K1};function K0(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 w9(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?K0(Object(n),!0).forEach(function(r){S9(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):K0(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function v9(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function C9(t){var e=v9(t,"string");return typeof e=="symbol"?e:String(e)}function dS(t){"@babel/helpers - typeof";return dS=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},dS(t)}function S9(t,e,n){return e=C9(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Ml=Symbol("unassigned"),y9="The Handsontable instance bound to this component was destroyed and cannot be used properly.";function kf(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function mH(t){var e=Ae.hooks.getRegistered(),n={};Object.assign(n,Ae.DefaultSettings);for(var r in n)n[r]={default:Ml};for(var i=0;i<e.length;i++)n[e[i]]={default:Ml};return n.settings={default:Ml},t==="HotTable"&&(n.id={type:String,default:"hot-".concat(Math.random().toString(36).substring(5))}),n}function pH(t){var e={},n=t.settings;if(n!==Ml)for(var r in n)kf(n,r)&&n[r]!==Ml&&(e[r]=n[r]);for(var i in t)kf(t,i)&&i!=="settings"&&t[i]!==Ml&&(e[i]=t[i]);return e}function X0(t,e){var n=pH(t),r=t.settings?t.settings:n,i=t.settings?n:null,o={};for(var s in r)kf(r,s)&&r[s]!==void 0&&(!(e&&s!=="data")||!q0(e[s],r[s]))&&(o[s]=r[s]);for(var a in i)kf(i,a)&&a!=="id"&&a!=="settings"&&i[a]!==void 0&&(!(e&&a!=="data")||!q0(e[a],i[a]))&&(o[a]=i[a]);return o}function q0(t,e){var n=function(){var r=new WeakSet;return function(i,o){if(dS(o)==="object"&&o!==null){if(r.has(o))return;r.add(o)}return o}}();return JSON.stringify(t,n)===JSON.stringify(e,n)}var b9="14.1.0",Db=FS({name:"HotTable",props:mH("HotTable"),provide:function(){return{columnsCache:this.columnsCache}},watch:{$props:{handler:function(e){var n=X0(e,this.hotInstance?this.hotInstance.getSettings():void 0);!this.hotInstance||n===void 0||(n.data&&(this.hotInstance.isColumnModificationAllowed()||!this.hotInstance.isColumnModificationAllowed()&&this.hotInstance.countSourceCols()===this.miscCache.currentSourceColumns)&&(this.matchHotMappersSize(),delete n.data),Object.keys(n).length?this.hotInstance.updateSettings(n):this.hotInstance.render(),this.miscCache.currentSourceColumns=this.hotInstance.countSourceCols())},deep:!0,immediate:!0}},data:function(){return{__hotInstance:null,miscCache:{currentSourceColumns:null},columnSettings:null,columnsCache:new Map,get hotInstance(){return!this.__hotInstance||this.__hotInstance&&!this.__hotInstance.isDestroyed?this.__hotInstance:(console.warn(y9),null)},set hotInstance(e){this.__hotInstance=e}}},methods:{hotInit:function(){var e=X0(this.$props);e.columns=this.columnSettings?this.columnSettings:e.columns,this.hotInstance=BN(new Ae.Core(this.$el,e)),this.hotInstance.init(),this.miscCache.currentSourceColumns=this.hotInstance.countSourceCols()},matchHotMappersSize:function(){var e=this;if(this.hotInstance){var n=this.hotInstance.getSourceData(),r=[],i=[],o=this.hotInstance.rowIndexMapper.getNumberOfIndexes(),s=this.hotInstance.isColumnModificationAllowed(),a=0;if(n&&n.length!==o&&n.length<o)for(var l=n.length;l<o;l++)r.push(l);if(s){var u;if(a=this.hotInstance.columnIndexMapper.getNumberOfIndexes(),n&&n[0]&&((u=n[0])===null||u===void 0?void 0:u.length)!==a&&n[0].length<a)for(var c=n[0].length;c<a;c++)i.push(c)}this.hotInstance.batch(function(){r.length>0?e.hotInstance.rowIndexMapper.removeIndexes(r):e.hotInstance.rowIndexMapper.insertIndexes(o-1,n.length-o),s&&n.length!==0&&(i.length>0?e.hotInstance.columnIndexMapper.removeIndexes(i):e.hotInstance.columnIndexMapper.insertIndexes(a-1,n[0].length-a))})}},getColumnSettings:function(){var e=Array.from(this.columnsCache.values());return e.length?e:void 0}},mounted:function(){this.columnSettings=this.getColumnSettings(),this.hotInit()},beforeUnmount:function(){this.hotInstance&&this.hotInstance.destroy()},version:b9}),R9=["id"];function E9(t,e,n,r,i,o){return Uu(),Yu("div",{id:t.id},[UN(t.$slots,"default")],8,R9)}Db.render=E9;Db.__file="src/HotTable.vue";var T9=FS({name:"HotColumn",props:mH("HotColumn"),inject:["columnsCache"],methods:{createColumnSettings:function(){var e=pH(this.$props),n=w9({},e);e.renderer&&(n.renderer=e.renderer),e.editor&&(n.editor=e.editor),this.columnsCache.set(this,n)}},mounted:function(){this.createColumnSettings()},unmounted:function(){this.columnsCache.delete(this)},render:function(){return null}});T9.__file="src/HotColumn.vue";function _9(t,e){return`${t}-${e}`}(()=>{if(!window.matchMedia)return{value:Rl(null)};const t=Rl(window.matchMedia("(prefers-color-scheme: dark)").matches);return window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",e=>t.value=e.matches),{value:t}})();const M9={create(){return bI("xlsx.worker.js").defaults(()=>new Worker(new URL(""+new URL("xlsx.worker-9278a0aa.js",import.meta.url).href,self.location),{type:"module"}))}},A9={create(){return bI("sheet.worker.js").defaults(()=>new Worker(new URL(""+new URL("sheet.worker-d79186a2.js",import.meta.url).href,self.location),{type:"module"}))}},Z0="handsontableEditor",O9="handsontable";class Nb extends ba{static get EDITOR_TYPE(){return O9}open(){super.open(),this.htEditor&&this.htEditor.destroy(),this.htContainer.style.display==="none"&&(this.htContainer.style.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(),zc(this.TEXTAREA,0,this.TEXTAREA.value.length),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,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&&jt(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)}assignHooks(){this.hot.addHook("afterDestroy",()=>{this.htEditor&&this.htEditor.destroy()})}registerShortcuts(){const n=this.hot.getShortcutManager().getContext("editor");super.registerShortcuts();const r={group:Z0,relativeToGroup:Vg,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(),Lr(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(Z0)}}function I9(t,e,n){P9(t,e),e.set(t,n)}function P9(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Qh(t,e,n){return e=x9(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function x9(t){var e=H9(t,"string");return typeof e=="symbol"?e:String(e)}function H9(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Q0(t,e){var n=D9(t,e,"get");return N9(t,n)}function D9(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}function N9(t,e){return e.get?e.get.call(t):e.value}const L9="autocomplete";var Vw=new WeakMap;class Lb extends Nb{constructor(){super(...arguments),Qh(this,"query",null),Qh(this,"strippedChoices",[]),Qh(this,"rawChoices",[]),I9(this,Vw,{writable:!0,value:this.hot.guid.slice(0,9)}),Qh(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=VC(Ft(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,g)=>{if(g.index===-1)return-1;if(d.index===-1)return 1;if(d.index<g.index)return-1;if(g.index<d.index)return 1;if(d.index===g.index){if(d.charsLeft<g.charsLeft)return-1;if(d.charsLeft>g.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 L9}getValue(){const e=this.rawChoices.find(n=>this.stripValueIfNeeded(n)===this.TEXTAREA.value);return ue(e)?e:this.TEXTAREA.value}createElements(){super.createElements(),q(this.htContainer,"autocompleteEditor"),q(this.htContainer,this.hot.rootWindow.navigator.platform.indexOf("Mac")===-1?"":"htMacScroll"),this.hot.getSettings().ariaTags&&Ee(this.TEXTAREA,[MG(),bG(),hx("listbox"),xG()])}prepare(e,n,r,i,o,s){super.prepare(e,n,r,i,o,s),this.hot.getSettings().ariaTags&&Ee(this.TEXTAREA,[Ir("false"),HG(`${Q0(this,Vw)}-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();let a=nn();a===0&&Mc()&&(a+=15),this.addHook("beforeKeyDown",l=>this.onBeforeKeyDown(l)),this.htEditor.updateSettings({colWidths:e?[ft(this.TEXTAREA)-2]:void 0,width:e?ft(this.TEXTAREA)+a:void 0,autoColumnSize:!0,renderer:(l,u,c,h,d,g,p)=>{Ao(l,u,c,h,d,g,p);const{filteringCaseSensitive:v,allowHtml:S,locale:y}=this.cellProperties,R=this.query;let T=Ft(g),N,I;T&&!S&&(N=v===!0?T.indexOf(R):T.toLocaleLowerCase(y).indexOf(R.toLocaleLowerCase(y)),N!==-1&&(I=T.substr(N,R.length),T=T.replace(I,`<strong>${I}</strong>`))),n&&Ee(u,[RG(),...r?[$G(i)]:[],...r?[kG(r.indexOf(g)+1)]:[],["id",`${this.htEditor.rootElement.id}_${c}-${h}`]]),u.innerHTML=T},afterSelection:(l,u)=>{if(n){const c=this.htEditor.getCell(l,u,!0);Ee(c,[Py()]),Ee(this.TEXTAREA,...DG(c.id))}}}),n&&(Ee(this.htEditor.view._wt.wtOverlays.wtTable.TABLE,...Pi()),Ee(this.htEditor.rootElement,[cx(),NG("polite"),LG("text"),["id",`${Q0(this,Vw)}-listbox-${o}-${s}`]]),Ee(this.TEXTAREA,...Ir("true"))),this.hot._registerTimeout(()=>{this.queryChoices(this.TEXTAREA.value)})}close(){this.removeHooksByKey("beforeKeyDown"),super.close(),this.hot.getSettings().ariaTags&&Ee(this.TEXTAREA,[Ir("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=Ly(this.TEXTAREA),r=yx(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,this.htEditor.loadData(ec([l])),l.length===0?this.htEditor.rootElement.style.display="none":(this.htEditor.rootElement.style.display="",this.updateDropdownHeight(),this.flipDropdownIfNeeded(),this.cellProperties.strict===!0&&this.highlightBestMatchingChoice(a)),this.hot.listen(),zc(this.TEXTAREA,n,n===r?void 0:r)}flipDropdownIfNeeded(){const e=ca(this.hot.view._wt.wtTable.TABLE),n=e===this.hot.rootWindow,r=this.cellProperties.preventOverflow;if(n||!n&&(r||r==="horizontal"))return!1;const i=en(this.TEXTAREA),o=Pt(this.TEXTAREA),s=this.getDropdownHeight(),a=e.scrollTop,l=Pt(this.hot.view._wt.wtTable.THEAD),u=en(e),c=i.top-u.top-l+a,h=e.scrollHeight-c-l-o,d=s>h&&c>h;return d?this.flipDropdown(s):this.unflipDropdown(),this.limitDropdownIfNeeded(d?c:h,s),d}limitDropdownIfNeeded(e,n){if(n>e){let r=0,i=0,o=0,s=null;do o=this.htEditor.getRowHeight(i)||this.htEditor.view._wt.getSetting("defaultRowHeight"),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}updateDropdownHeight(){const e=this.htEditor.getColWidth(0)+nn(this.hot.rootDocument)+2,n=this.cellProperties.trimDropdown;this.htEditor.updateSettings({height:this.getDropdownHeight(),width:n?void 0:e}),this.htEditor.view._wt.wtTable.alignOverlaysWithTrimmingContainer()}setDropdownHeight(e){this.htEditor.updateSettings({height:e})}highlightBestMatchingChoice(e){typeof e=="number"?this.htEditor.selectCell(e,0,void 0,void 0,void 0,!1):this.htEditor.deselectCell()}getDropdownHeight(){const e=this.htEditor.getRowHeight(0)||23,n=this.cellProperties.visibleRows;return this.strippedChoices.length>=n?n*e:this.strippedChoices.length*e+8}stripValueIfNeeded(e){return this.stripValuesIfNeeded([e])[0]}stripValuesIfNeeded(e){const{allowHtml:n}=this.cellProperties,r=Ue(e,o=>Ft(o));return Ue(r,o=>n?o:VC(o))}allowKeyEventPropagation(e){const n=this.htEditor.getSelectedRangeLast(),r={row:n?n.from.row:-1};let i=!1;return e===we.ARROW_DOWN&&r.row>0&&r.row<this.htEditor.countRows()-1&&(i=!0),e===we.ARROW_UP&&r.row>-1&&(i=!0),i}onBeforeKeyDown(e){if(Wx(e.keyCode)||e.keyCode===we.BACKSPACE||e.keyCode===we.DELETE||e.keyCode===we.INSERT){let n=10;if(e.keyCode===we.C&&(e.ctrlKey||e.metaKey))return;this.isOpened()||(n+=10),this.htEditor&&this.hot._registerTimeout(()=>{this.queryChoices(this.TEXTAREA.value)},n)}}}const $9="checkbox";class wH extends Gl{static get EDITOR_TYPE(){return $9}beginEditing(e,n){if(n&&n.type==="mouseup"){const r=this.TD.querySelector('input[type="checkbox"]');Ie(r,"htBadValue")||r.click()}}finishEditing(){}init(){}open(){}close(){}getValue(){}setValue(){}focus(){}}/*!
* Pikaday
*
* Copyright © 2014 David Bushell | BSD & MIT license | https://github.com/Pikaday/Pikaday
*/const ts=()=>window,Mr=()=>window.document,fS=(t,e)=>window.setTimeout(t,e),bi=function(t,e,n,r){t.addEventListener(e,n,!!r)},Ki=function(t,e,n,r){t.removeEventListener(e,n,!!r)},k9=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},ar=function(t,e){return(" "+t.className+" ").indexOf(" "+e+" ")!==-1},Bw=function(t,e){ar(t,e)||(t.className=t.className===""?e:t.className+" "+e)},Uw=function(t,e){t.className=k9((" "+t.className+" ").replace(" "+e+" "," "))},$b=function(t){return/Array/.test(Object.prototype.toString.call(t))},ur=function(t){return/Date/.test(Object.prototype.toString.call(t))&&!isNaN(t.getTime())},F9=function(t){let e=t.getDay();return e===0||e===6},W9=function(t){return t%4===0&&t%100!==0||t%400===0},J0=function(t,e){return[31,W9(t)?29:28,31,30,31,30,31,31,30,31,30,31][e]},Jh=function(t){ur(t)&&t.setHours(0,0,0,0)},ed=function(t,e){return t.getTime()===e.getTime()},Ff=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?ur(e[r])?n&&(t[r]=new Date(e[r].getTime())):$b(e[r])?n&&(t[r]=e[r].slice(0)):t[r]=Ff({},e[r],n):(n||!i)&&(t[r]=e[r]);return t},eT=function(t,e,n){let r=Mr().createEvent("HTMLEvents");r.initEvent(e,!0,!1),r=Ff(r,n),t.dispatchEvent(r)},tT=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},fi={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},nT=function(t,e,n){for(e+=t.firstDay;e>=7;)e-=7;return n?t.i18n.weekdaysShort[e]:t.i18n.weekdays[e]},V9=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>"},B9=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)},U9=function(t,e,n,r,i){let o=new Date(r,n,e);return'<td class="pika-week">'+(t.hasMoment?t.moment(o).isoWeek():B9(o,i))+"</td>"},Y9=function(t,e,n,r){return'<tr class="pika-row'+(n?" pick-whole-week":"")+(r?" is-selected":"")+'">'+(e?t.reverse():t).join("")+"</tr>"},G9=function(t){return"<tbody>"+t.join("")+"</tbody>"},z9=function(t){let e,n=[];for(t.showWeekNumber&&n.push("<th></th>"),e=0;e<7;e++)n.push('<th scope="col"><abbr title="'+nT(t,e)+'">'+nT(t,e,!0)+"</abbr></th>");return"<thead><tr>"+(t.isRTL?n.reverse():n).join("")+"</tr></thead>"},j9=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">',g,p,v=!0,S=!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(g='<div class="pika-label">'+u.i18n.months[r]+'<select class="pika-select pika-select-month" tabindex="-1">'+l.join("")+"</select></div>",$b(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 p='<div class="pika-label">'+n+u.yearSuffix+'<select class="pika-select pika-select-year" tabindex="-1">'+l.join("")+"</select></div>",u.showMonthAfterYear?d+=p+g:d+=g+p,c&&(r===0||u.minMonth>=r)&&(v=!1),h&&(r===11||u.maxMonth<=r)&&(S=!1),e===0&&(d+='<button class="pika-prev'+(v?"":" is-disabled")+'" type="button">'+u.i18n.previousMonth+"</button>"),e===t._o.numberOfMonths-1&&(d+='<button class="pika-next'+(S?"":" is-disabled")+'" type="button">'+u.i18n.nextMonth+"</button>"),d+="</div>"},K9=function(t,e,n){return'<table cellpadding="0" cellspacing="0" class="pika-table" role="grid" aria-labelledby="'+n+'">'+z9(t)+G9(e)+"</table>"};function gS(t){let e=this,n=e.config(t);e._onMouseDown=function(i){if(!e._v)return;i=i||ts().event;let o=i.target||i.srcElement;if(o)if(ar(o,"is-disabled")||(ar(o,"pika-button")&&!ar(o,"is-empty")&&!ar(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&&fS(function(){e.hide(),n.blurFieldOnSelect&&n.field&&n.field.blur()},100)):ar(o,"pika-prev")?e.prevMonth():ar(o,"pika-next")&&e.nextMonth()),ar(o,"pika-select"))e._c=!0;else if(i.preventDefault)i.preventDefault();else return i.returnValue=!1,!1},e._onChange=function(i){i=i||ts().event;let o=i.target||i.srcElement;o&&(ar(o,"pika-select-month")?e.gotoMonth(o.value):ar(o,"pika-select-year")&&e.gotoYear(o.value))},e._onKeyChange=function(i){if(i=i||ts().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(),ur(o)&&e.setDate(o),e._v||e.show())},e._onInputFocus=function(){e.show()},e._onInputClick=function(){e.show()},e._onInputBlur=function(){let i=Mr().activeElement;do if(ar(i,"pika-single"))return;while(i=i.parentNode);e._c||(e._b=fS(function(){e.hide()},50)),e._c=!1},e._onClick=function(i){i=i||ts().event;let o=i.target||i.srcElement,s=o;if(o){!hasEventListeners&&ar(o,"pika-select")&&(o.onchange||(o.setAttribute("onchange","return;"),bi(o,"change",e._onChange)));do if(ar(s,"pika-single")||s===n.trigger)return;while(s=s.parentNode);e._v&&o!==n.trigger&&s!==n.trigger&&e.hide()}},e.el=Mr().createElement("div"),e.el.className="pika-single"+(n.isRTL?" is-rtl":"")+(n.theme?" "+n.theme:""),bi(e.el,"mousedown",e._onMouseDown,!0),bi(e.el,"touchend",e._onMouseDown,!0),bi(e.el,"change",e._onChange),n.keyboardInput&&bi(Mr(),"keydown",e._onKeyChange),n.field&&(n.container?n.container.appendChild(e.el):n.bound?Mr().body.appendChild(e.el):n.field.parentNode.insertBefore(e.el,n.field.nextSibling),bi(n.field,"change",e._onInputChange),n.defaultDate||(n.defaultDate=e._parseFieldValue(),n.setDefaultDate=!0));let r=n.defaultDate;ur(r)?n.setDefaultDate?e.setDate(r,!0):e.gotoDate(r):e.gotoDate(new Date),n.bound?(this.hide(),e.el.className+=" is-bound",bi(n.trigger,"click",e._onInputClick),bi(n.trigger,"focus",e._onInputFocus),bi(n.trigger,"blur",e._onInputBlur)):this.show()}gS.prototype={config:function(t){this._o||(this._o=Ff({},fi,!0));let e=Ff(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,ur(e.minDate)||(e.minDate=!1),ur(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),$b(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))||fi.yearRange,e.yearRange>100&&(e.yearRange=100);return e},toString:function(t){return t=t||this._o.format,ur(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 ur(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="",eT(this._o.field,"change",{firedBy:this})),this.draw();if(typeof t=="string"&&(t=new Date(Date.parse(t))),!ur(t))return;let n=this._o.minDate,r=this._o.maxDate;ur(n)&&t<n?t=n:ur(r)&&t>r&&(t=r),this._d=new Date(t.getTime()),Jh(this._d),this.gotoDate(this._d),this._o.field&&(this._o.field.value=this.toString(),eT(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(ur(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]=tT(this.calendars[0]);for(let t=1;t<this._o.numberOfMonths;t++)this.calendars[t]=tT({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?(Jh(t),this._o.minDate=t,this._o.minYear=t.getFullYear(),this._o.minMonth=t.getMonth()):(this._o.minDate=fi.minDate,this._o.minYear=fi.minYear,this._o.minMonth=fi.minMonth,this._o.startRange=fi.startRange),this.draw()},setMaxDate:function(t){t instanceof Date?(Jh(t),this._o.maxDate=t,this._o.maxYear=t.getFullYear(),this._o.maxMonth=t.getMonth()):(this._o.maxDate=fi.maxDate,this._o.maxYear=fi.maxYear,this._o.maxMonth=fi.maxMonth,this._o.endRange=fi.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">'+j9(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"&&fS(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=ts().innerWidth||Mr().documentElement.clientWidth,i=ts().innerHeight||Mr().documentElement.clientHeight,o=Mr().body.scrollTop||Mr().documentElement.scrollTop,u=!0,c=!0,l=t.getBoundingClientRect(),s=l.left+ts().pageXOffset,a=l.bottom+ts().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",Bw(this.el,u?"left-aligned":"right-aligned"),Bw(this.el,c?"bottom-aligned":"top-aligned"),Uw(this.el,u?"right-aligned":"left-aligned"),Uw(this.el,c?"top-aligned":"bottom-aligned"))},render:function(t,e,n){let r=this._o,i=new Date,o=J0(t,e),s=new Date(t,e,1).getDay(),a=[],l=[];Jh(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,g=J0(h,u),p=o+s,v=p;for(;v>7;)v-=7;p+=7-v;let S=!1;for(let y=0,R=0;y<p;y++){let T=new Date(t,e,1+(y-s)),N=ur(this._d)?ed(T,this._d):!1,I=ed(T,i),F=r.events.indexOf(T.toDateString())!==-1,B=y<s||y>=o+s,ee=1+(y-s),U=e,j=t,re=r.startRange&&ed(r.startRange,T),ie=r.endRange&&ed(r.endRange,T),oe=r.startRange&&r.endRange&&r.startRange<T&&T<r.endRange,ve=r.minDate&&T<r.minDate||r.maxDate&&T>r.maxDate||r.disableWeekends&&F9(T)||r.disableDayFn&&r.disableDayFn(T);B&&(y<s?(ee=g+ee,U=u,j=h):(ee=ee-o,U=c,j=d));let _e={day:ee,month:U,year:j,hasEvent:F,isSelected:N,isToday:I,isDisabled:ve,isEmpty:B,isStartRange:re,isEndRange:ie,isInRange:oe,showDaysInNextAndPreviousMonths:r.showDaysInNextAndPreviousMonths,enableSelectionDaysInNextAndPreviousMonths:r.enableSelectionDaysInNextAndPreviousMonths};r.pickWholeWeek&&N&&(S=!0),l.push(V9(_e)),++R===7&&(r.showWeekNumber&&l.unshift(U9(this,y-s,e,t,r.firstWeekOfYearMinDays)),a.push(Y9(l,r.isRTL,r.pickWholeWeek,S)),l=[],R=0,S=!1)}return K9(r,a,n)},isVisible:function(){return this._v},show:function(){this.isVisible()||(this._v=!0,this.draw(),Uw(this.el,"is-hidden"),this._o.bound&&(bi(Mr(),"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&&Ki(Mr(),"click",this._onClick),this._o.container||(this.el.style.position="static",this.el.style.left="auto",this.el.style.top="auto"),Bw(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(),Ki(this.el,"mousedown",this._onMouseDown,!0),Ki(this.el,"touchend",this._onMouseDown,!0),Ki(this.el,"change",this._onChange),t.keyboardInput&&Ki(Mr(),"keydown",this._onKeyChange),t.field&&(Ki(t.field,"change",this._onInputChange),t.bound&&(Ki(t.trigger,"click",this._onInputClick),Ki(t.trigger,"focus",this._onInputFocus),Ki(t.trigger,"blur",this._onInputBlur))),this.el.parentNode&&this.el.parentNode.removeChild(this.el)}};function Yw(t,e,n){return e=X9(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function X9(t){var e=q9(t,"string");return typeof e=="symbol"?e:String(e)}function q9(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const vH="date",rT="dateEditor";class CH extends ba{constructor(){super(...arguments),Yw(this,"defaultDateFormat","DD/MM/YYYY"),Yw(this,"parentDestroyed",!1),Yw(this,"$datePicker",null)}static get EDITOR_TYPE(){return vH}init(){if(typeof X!="function")throw new Error("You need to include moment.js to your project.");if(typeof gS!="function")throw new Error("You need to include Pikaday to your project.");super.init(),this.hot.addHook("afterDestroy",()=>{this.parentDestroyed=!0,this.destroyElements()})}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"),q(this.datePicker,"htDatepickerHolder"),this.hot.rootDocument.body.appendChild(this.datePicker),this.eventManager.addEventListener(this.datePicker,"mousedown",e=>{Ie(e.target,"pika-day")&&this.hideDatepicker(),e.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");super.open(),this.showDatepicker(e),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:rT})}close(){var e;this._opened=!1,(e=this.$datePicker)!==null&&e!==void 0&&e.destroy&&this.$datePicker.destroy(),this.hot._registerTimeout(()=>{this.hot._refreshBorders()}),this.hot.getShortcutManager().getContext("editor").removeShortcutsByGroup(rT),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=this.TD.getBoundingClientRect(),r=this.cellProperties.dateFormat||this.defaultDateFormat,i=this.hot.view.isMouseDown(),o=e?zy(e.keyCode):!1;let s;this.datePicker.style.display="block",this.$datePicker=new gS(this.getDatePickerConfig()),typeof this.$datePicker.useMoment=="function"&&this.$datePicker.useMoment(X),this.$datePicker._onInputFocus=function(){},this.datePickerStyle.top=`${this.hot.rootWindow.pageYOffset+n.top+Pt(this.TD)}px`;let a=this.hot.rootWindow.pageXOffset;this.hot.isRtl()?a=n.right-ft(this.datePicker):a=n.left,this.datePickerStyle.left=`${a}px`,this.originalValue?(s=this.originalValue,X(s,r,!0).isValid()&&this.$datePicker.setMoment(X(s,r),!0),this.getValue()!==this.originalValue&&this.setValue(this.originalValue),!o&&!i&&this.setValue("")):this.cellProperties.defaultDate?(s=this.cellProperties.defaultDate,X(s,r,!0).isValid()&&this.$datePicker.setMoment(X(s,r),!0),!o&&!i&&this.setValue("")):this.$datePicker.gotoToday()}hideDatepicker(){this.datePickerStyle.display="none",this.$datePicker.hide()}getDatePickerConfig(){const e=this.TEXTAREA,n={};this.cellProperties&&this.cellProperties.datePickerConfig&&Xc(n,this.cellProperties.datePickerConfig);const r=n.onSelect,i=n.onClose;return n.field=e,n.trigger=e,n.container=this.datePicker,n.bound=!1,n.keyboardInput=!1,n.format=n.format||this.defaultDateFormat,n.reposition=n.reposition||!1,n.isRTL=!1,n.onSelect=o=>{let s=o;isNaN(s.getTime())||(s=X(s).format(this.cellProperties.dateFormat||this.defaultDateFormat)),this.setValue(s),r&&r()},n.onClose=()=>{this.parentDestroyed||this.finishEditing(!1),i&&i()},n}}const Z9="dropdown";class kb extends Lb{static get EDITOR_TYPE(){return Z9}prepare(e,n,r,i,o,s){super.prepare(e,n,r,i,o,s),this.cellProperties.filter=!1,this.cellProperties.strict=!0}}de.getSingleton().add("beforeValidate",function(t,e,n){const r=this.getCellMeta(e,this.propToCol(n));r.editor===kb&&r.strict===void 0&&(r.filter=!1,r.strict=!0)});const Q9="numeric";class SH extends ba{static get EDITOR_TYPE(){return Q9}}const J9="password";class yH extends ba{static get EDITOR_TYPE(){return J9}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,this.hot.getSettings().ariaTags&&Ee(this.TEXTAREA,[Eo()]),oi(this.TEXTAREA_PARENT),this.TEXTAREA_PARENT.appendChild(this.TEXTAREA)}}const Gw="ht_editor_visible",iT="selectEditor",e7="select";class bH extends Gl{static get EDITOR_TYPE(){return e7}init(){this.select=this.hot.rootDocument.createElement("select"),this.select.setAttribute("data-hot-input","true"),this.select.style.display="none",q(this.select,"htSelectEditor"),this.hot.rootElement.appendChild(this.select),this.registerHooks()}getValue(){return this.select.value}setValue(e){this.select.value=e}open(){this._opened=!0,this.refreshDimensions(),this.select.style.display="",this.hot.getShortcutManager().setActiveContextName("editor"),this.registerShortcuts()}close(){this._opened=!1,this.select.style.display="none",Ie(this.select,Gw)&&Le(this.select,Gw),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),oi(this.select),Ye(l,(u,c)=>{const h=this.hot.rootDocument.createElement("OPTION");h.value=c,Sa(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!==qt.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.select.style;o.height=`${i}px`,o.width=`${r}px`,o.top=`${e}px`,o[this.hot.isRtl()?"right":"left"]=`${n}px`,o.margin="0px",q(this.select,Gw)}registerShortcuts(){const e=this.hot.getShortcutManager(),n=e.getContext("editor"),r=e.getContext("grid"),i={group:iT};this.isInFullEditMode()!==!1&&n.addShortcuts([{keys:[["Tab"],["Shift","Tab"]],forwardToContext:r,callback:()=>{}},{keys:[["ArrowUp"]],callback:()=>{const o=this.select.selectedIndex-1;o>=0&&(this.select[o].selected=!0)}},{keys:[["ArrowDown"]],callback:()=>{const o=this.select.selectedIndex+1;o<=this.select.length-1&&(this.select[o].selected=!0)}}],i)}unregisterShortcuts(){this.hot.getShortcutManager().getContext("editor").removeShortcutsByGroup(iT)}}const t7="time";class RH extends ba{static get EDITOR_TYPE(){return t7}prepare(e,n,r,i,o,s){super.prepare(e,n,r,i,o,s),this.TEXTAREA.dir="ltr"}}function n7(){Jn(Gl),Jn(Lb),Jn(wH),Jn(CH),Jn(kb),Jn(Nb),Jn(SH),Jn(yH),Jn(bH),Jn(ba),Jn(RH)}const r7="html";function Fb(t,e,n,r,i,o,s){rh.apply(this,[t,e,n,r,i,o,s]),Sa(e,o??"",!1)}Fb.RENDERER_TYPE=r7;const i7="autocomplete";function zl(t,e,n,r,i,o,s){const{rootDocument:a}=t,l=s.allowHtml?Fb:Ao,u=a.createElement("DIV"),c=t.getSettings().ariaTags;if(u.className="htAutocompleteArrow",c&&u.setAttribute(...Eo()),u.appendChild(a.createTextNode(String.fromCharCode(9660))),l.apply(this,[t,e,n,r,i,o,s]),e.firstChild||e.appendChild(a.createTextNode(String.fromCharCode(160))),e.insertBefore(u,e.firstChild),q(e,"htAutocomplete"),!t.acArrowListener){const h=new xr(t);t.acArrowListener=function(d){Ie(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()})}}zl.RENDERER_TYPE=i7;const o7="dropdown";function Wb(t,e,n,r,i,o,s){zl.apply(this,[t,e,n,r,i,o,s])}Wb.RENDERER_TYPE=o7;const oT=new WeakMap,sT=new WeakMap,s7="htBadValue",Nl="data-row",Ll="data-col",a7="checkboxRenderer",EH="checkbox";de.getSingleton().add("modifyAutoColumnSizeSeed",function(t,e,n){const{label:r,type:i,row:o,column:s,prop:a}=e;if(i===EH){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 Vb(t,e,n,r,i,o,s){const{rootDocument:a}=t,l=t.getSettings().ariaTags;rh.apply(this,[t,e,n,r,i,o,s]),l7(t);let u=u7(a);const c=s.label;let h=!1;if(typeof s.checkedTemplate>"u"&&(s.checkedTemplate=!0),typeof s.uncheckedTemplate>"u"&&(s.uncheckedTemplate=!1),oi(e),o===s.checkedTemplate||Ft(o).toLocaleLowerCase(s.locale)===Ft(s.checkedTemplate).toLocaleLowerCase(s.locale)?u.checked=!0:o===s.uncheckedTemplate||Ft(o).toLocaleLowerCase(s.locale)===Ft(s.uncheckedTemplate).toLocaleLowerCase(s.locale)?u.checked=!1:Zt(o)?q(u,"noValue"):(u.style.display="none",q(u,s7),h=!0),Ee(u,[[Nl,n],[Ll,r]]),l&&Ee(u,[Oy(u.checked?t.getTranslatedPhrase(Mb):t.getTranslatedPhrase(Ab)),PG(u.checked),EG()]),!h&&c){let v="";if(c.value)v=typeof c.value=="function"?c.value.call(this,n,r,i,o):c.value;else if(c.property){const y=t.getDataAtRowProp(n,c.property);v=y!==null?y:""}const S=c7(a,v,c.separated!==!0);c.position==="before"?c.separated?(e.appendChild(S),e.appendChild(u)):(S.appendChild(u),u=S):(!c.position||c.position==="after")&&(c.separated?(e.appendChild(u),e.appendChild(S)):(S.insertBefore(u,S.firstChild),u=S))}(!c||c&&!c.separated)&&e.appendChild(u),h&&e.appendChild(a.createTextNode("#bad-value#")),oT.has(t)||(oT.set(t,!0),d());function d(){const S=t.getShortcutManager().getContext("grid"),y={group:a7};S.addShortcuts([{keys:[["space"]],callback:()=>(g(),!p())},{keys:[["enter"]],callback:()=>(g(),!p()),runOnlyIf:()=>t.getSettings().enterBeginsEditing},{keys:[["delete"],["backspace"]],callback:()=>(g(!0),!p()),relativeToGroup:Hb,position:"before"}],y)}function g(){let v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const S=t.getSelectedRange();if(S)for(let y=0;y<S.length;y++){const{row:R,col:T}=S[y].getTopStartCorner(),{row:N,col:I}=S[y].getBottomEndCorner(),F=[];for(let B=R;B<=N;B+=1)for(let ee=T;ee<=I;ee+=1){const U=t.getCellMeta(B,ee);if(U.type!=="checkbox")return;if(U.readOnly===!0)continue;typeof U.checkedTemplate>"u"&&(U.checkedTemplate=!0),typeof U.uncheckedTemplate>"u"&&(U.uncheckedTemplate=!1);const j=t.getDataAtCell(B,ee);v===!1?[U.checkedTemplate,U.checkedTemplate.toString()].includes(j)?F.push([B,ee,U.uncheckedTemplate]):[U.uncheckedTemplate,U.uncheckedTemplate.toString(),null,void 0].includes(j)&&F.push([B,ee,U.checkedTemplate]):F.push([B,ee,U.uncheckedTemplate])}F.length>0&&t.setDataAtCell(F)}}function p(){const v=t.getSelectedRange();if(v){for(let S=0;S<v.length;S++){const y=v[S].getTopStartCorner(),R=v[S].getBottomEndCorner();for(let T=y.row;T<=R.row;T++)for(let N=y.col;N<=R.col;N++){const I=t.getCellMeta(T,N);if(I.type!=="checkbox")return!1;const F=t.getCell(T,N);if(F==null)return!0;if(F.querySelectorAll("input[type=checkbox]").length>0&&!I.readOnly)return!0}}return!1}}}Vb.RENDERER_TYPE=EH;function l7(t){let e=sT.get(t);if(!e){const{rootElement:n}=t;e=new xr(t),e.addEventListener(n,"click",r=>d7(r,t)),e.addEventListener(n,"mouseup",r=>h7(r,t)),e.addEventListener(n,"change",r=>f7(r,t)),sT.set(t,e)}return e}function u7(t){const e=t.createElement("input");return e.className="htCheckboxRendererInput",e.type="checkbox",e.setAttribute("tabindex","-1"),e.cloneNode(!1)}function c7(t,e,n){const r=t.createElement("label");return r.className=`htCheckboxRendererLabel ${n?"fullWidth":""}`,r.appendChild(t.createTextNode(e)),r.cloneNode(!0)}function h7(t,e){const{target:n}=t;Bb(n)&&(!n.hasAttribute(Nl)||!n.hasAttribute(Ll)||setTimeout(e.listen,10))}function d7(t,e){const{target:n}=t;if(!Bb(n)||!n.hasAttribute(Nl)||!n.hasAttribute(Ll))return;const r=parseInt(n.getAttribute(Nl),10),i=parseInt(n.getAttribute(Ll),10);e.getCellMeta(r,i).readOnly&&t.preventDefault()}function f7(t,e){const{target:n}=t;if(!Bb(n)||!n.hasAttribute(Nl)||!n.hasAttribute(Ll))return;const r=parseInt(n.getAttribute(Nl),10),i=parseInt(n.getAttribute(Ll),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 Bb(t){return t.tagName==="INPUT"&&t.getAttribute("type")==="checkbox"}const g7="handsontable";function Ub(t,e,n,r,i,o,s){zl.apply(this,[t,e,n,r,i,o,s])}Ub.RENDERER_TYPE=g7;var TH={exports:{}};(function(t,e){(function(n){t.exports=n()})(function(){return function n(r,i,o){function s(u,c){if(!i[u]){if(!r[u]){var h=typeof gh=="function"&&gh;if(!c&&h)return h(u,!0);if(a)return a(u,!0);var d=new Error("Cannot find module '"+u+"'");throw d.code="MODULE_NOT_FOUND",d}var g=i[u]={exports:{}};r[u][0].call(g.exports,function(p){return s(r[u][1][p]||p)},g,g.exports,n,r,i,o)}return i[u].exports}for(var a=typeof gh=="function"&&gh,l=0;l<o.length;l++)s(o[l]);return s}({1:[function(n,r,i){(function(o){var s,a=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,l=Math.ceil,u=Math.floor,c="[BigNumber Error] ",h=c+"Number primitive has more than 15 significant digits: ",d=1e14,g=14,p=9007199254740991,v=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],S=1e7,y=1e9;function R(U){var j=0|U;return 0<U||U===j?j:j-1}function T(U){for(var j,re,ie=1,oe=U.length,ve=U[0]+"";ie<oe;){for(j=U[ie++]+"",re=g-j.length;re--;j="0"+j);ve+=j}for(oe=ve.length;ve.charCodeAt(--oe)===48;);return ve.slice(0,oe+1||1)}function N(U,j){var re,ie,oe=U.c,ve=j.c,_e=U.s,rt=j.s,Fe=U.e,pe=j.e;if(!_e||!rt)return null;if(re=oe&&!oe[0],ie=ve&&!ve[0],re||ie)return re?ie?0:-rt:_e;if(_e!=rt)return _e;if(re=_e<0,ie=Fe==pe,!oe||!ve)return ie?0:!oe^re?1:-1;if(!ie)return pe<Fe^re?1:-1;for(rt=(Fe=oe.length)<(pe=ve.length)?Fe:pe,_e=0;_e<rt;_e++)if(oe[_e]!=ve[_e])return oe[_e]>ve[_e]^re?1:-1;return Fe==pe?0:pe<Fe^re?1:-1}function I(U,j,re,ie){if(U<j||re<U||U!==(U<0?l(U):u(U)))throw Error(c+(ie||"Argument")+(typeof U=="number"?U<j||re<U?" out of range: ":" not an integer: ":" not a primitive number: ")+String(U))}function F(U){var j=U.c.length-1;return R(U.e/g)==j&&U.c[j]%2!=0}function B(U,j){return(1<U.length?U.charAt(0)+"."+U.slice(1):U)+(j<0?"e":"e+")+j}function ee(U,j,re){var ie,oe;if(j<0){for(oe=re+".";++j;oe+=re);U=oe+U}else if(++j>(ie=U.length)){for(oe=re,j-=ie;--j;oe+=re);U+=oe}else j<ie&&(U=U.slice(0,j)+"."+U.slice(j));return U}(s=function U(j){var re,ie,oe,ve,_e,rt,Fe,pe,f,m,w=Y.prototype={constructor:Y,toString:null,valueOf:null},A=new Y(1),O=20,D=4,z=-7,G=21,ne=-1e7,Z=1e7,K=!1,Se=1,Pe=0,Oe={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},He="0123456789abcdefghijklmnopqrstuvwxyz";function Y(C,b){var _,k,M,$,P,H,W,L,V=this;if(!(V instanceof Y))return new Y(C,b);if(b==null){if(C instanceof Y)return V.s=C.s,V.e=C.e,void(V.c=(C=C.c)?C.slice():C);if((H=typeof C=="number")&&0*C==0){if(V.s=1/C<0?(C=-C,-1):1,C===~~C){for($=0,P=C;10<=P;P/=10,$++);return V.e=$,void(V.c=[C])}L=String(C)}else{if(L=String(C),!a.test(L))return oe(V,L,H);V.s=L.charCodeAt(0)==45?(L=L.slice(1),-1):1}-1<($=L.indexOf("."))&&(L=L.replace(".","")),0<(P=L.search(/e/i))?($<0&&($=P),$+=+L.slice(P+1),L=L.substring(0,P)):$<0&&($=L.length)}else{if(I(b,2,He.length,"Base"),L=String(C),b==10)return De(V=new Y(C instanceof Y?C:L),O+V.e+1,D);if(H=typeof C=="number"){if(0*C!=0)return oe(V,L,H,b);if(V.s=1/C<0?(L=L.slice(1),-1):1,Y.DEBUG&&15<L.replace(/^0\.0*|\./,"").length)throw Error(h+C);H=!1}else V.s=L.charCodeAt(0)===45?(L=L.slice(1),-1):1;for(_=He.slice(0,b),$=P=0,W=L.length;P<W;P++)if(_.indexOf(k=L.charAt(P))<0){if(k=="."){if($<P){$=W;continue}}else if(!M&&(L==L.toUpperCase()&&(L=L.toLowerCase())||L==L.toLowerCase()&&(L=L.toUpperCase()))){M=!0,P=-1,$=0;continue}return oe(V,String(C),H,b)}-1<($=(L=ie(L,b,10,V.s)).indexOf("."))?L=L.replace(".",""):$=L.length}for(P=0;L.charCodeAt(P)===48;P++);for(W=L.length;L.charCodeAt(--W)===48;);if(L=L.slice(P,++W)){if(W-=P,H&&Y.DEBUG&&15<W&&(p<C||C!==u(C)))throw Error(h+V.s*C);if(Z<($=$-P-1))V.c=V.e=null;else if($<ne)V.c=[V.e=0];else{if(V.e=$,V.c=[],P=($+1)%g,$<0&&(P+=g),P<W){for(P&&V.c.push(+L.slice(0,P)),W-=g;P<W;)V.c.push(+L.slice(P,P+=g));L=L.slice(P),P=g-L.length}else P-=W;for(;P--;L+="0");V.c.push(+L)}}else V.c=[V.e=0]}function lt(C,b,_,k){var M,$,P,H,W;if(_==null?_=D:I(_,0,8),!C.c)return C.toString();if(M=C.c[0],P=C.e,b==null)W=T(C.c),W=k==1||k==2&&(P<=z||G<=P)?B(W,P):ee(W,P,"0");else if($=(C=De(new Y(C),b,_)).e,H=(W=T(C.c)).length,k==1||k==2&&(b<=$||$<=z)){for(;H<b;W+="0",H++);W=B(W,$)}else if(b-=P,W=ee(W,$,"0"),H<$+1){if(0<--b)for(W+=".";b--;W+="0");}else if(0<(b+=$-H))for($+1==H&&(W+=".");b--;W+="0");return C.s<0&&M?"-"+W:W}function Be(C,b){for(var _,k=1,M=new Y(C[0]);k<C.length;k++){if(!(_=new Y(C[k])).s){M=_;break}b.call(M,_)&&(M=_)}return M}function xe(C,b,_){for(var k=1,M=b.length;!b[--M];b.pop());for(M=b[0];10<=M;M/=10,k++);return(_=k+_*g-1)>Z?C.c=C.e=null:C.c=_<ne?[C.e=0]:(C.e=_,b),C}function De(C,b,_,k){var M,$,P,H,W,L,V,te=C.c,he=v;if(te){e:{for(M=1,H=te[0];10<=H;H/=10,M++);if(($=b-M)<0)$+=g,P=b,V=(W=te[L=0])/he[M-P-1]%10|0;else if((L=l(($+1)/g))>=te.length){if(!k)break e;for(;te.length<=L;te.push(0));W=V=0,P=($%=g)-g+(M=1)}else{for(W=H=te[L],M=1;10<=H;H/=10,M++);V=(P=($%=g)-g+M)<0?0:W/he[M-P-1]%10|0}if(k=k||b<0||te[L+1]!=null||(P<0?W:W%he[M-P-1]),k=_<4?(V||k)&&(_==0||_==(C.s<0?3:2)):5<V||V==5&&(_==4||k||_==6&&(0<$?0<P?W/he[M-P]:0:te[L-1])%10&1||_==(C.s<0?8:7)),b<1||!te[0])return te.length=0,k?(b-=C.e+1,te[0]=he[(g-b%g)%g],C.e=-b||0):te[0]=C.e=0,C;if($==0?(te.length=L,H=1,L--):(te.length=L+1,H=he[g-$],te[L]=0<P?u(W/he[M-P]%he[P])*H:0),k)for(;;){if(L==0){for($=1,P=te[0];10<=P;P/=10,$++);for(P=te[0]+=H,H=1;10<=P;P/=10,H++);$!=H&&(C.e++,te[0]==d&&(te[0]=1));break}if(te[L]+=H,te[L]!=d)break;te[L--]=0,H=1}for($=te.length;te[--$]===0;te.pop());}C.e>Z?C.c=C.e=null:C.e<ne&&(C.c=[C.e=0])}return C}function be(C){var b,_=C.e;return _===null?C.toString():(b=T(C.c),b=_<=z||G<=_?B(b,_):ee(b,_,"0"),C.s<0?"-"+b:b)}return Y.clone=U,Y.ROUND_UP=0,Y.ROUND_DOWN=1,Y.ROUND_CEIL=2,Y.ROUND_FLOOR=3,Y.ROUND_HALF_UP=4,Y.ROUND_HALF_DOWN=5,Y.ROUND_HALF_EVEN=6,Y.ROUND_HALF_CEIL=7,Y.ROUND_HALF_FLOOR=8,Y.EUCLID=9,Y.config=Y.set=function(C){var b,_;if(C!=null){if(typeof C!="object")throw Error(c+"Object expected: "+C);if(C.hasOwnProperty(b="DECIMAL_PLACES")&&(I(_=C[b],0,y,b),O=_),C.hasOwnProperty(b="ROUNDING_MODE")&&(I(_=C[b],0,8,b),D=_),C.hasOwnProperty(b="EXPONENTIAL_AT")&&((_=C[b])&&_.pop?(I(_[0],-y,0,b),I(_[1],0,y,b),z=_[0],G=_[1]):(I(_,-y,y,b),z=-(G=_<0?-_:_))),C.hasOwnProperty(b="RANGE"))if((_=C[b])&&_.pop)I(_[0],-y,-1,b),I(_[1],1,y,b),ne=_[0],Z=_[1];else{if(I(_,-y,y,b),!_)throw Error(c+b+" cannot be zero: "+_);ne=-(Z=_<0?-_:_)}if(C.hasOwnProperty(b="CRYPTO")){if((_=C[b])!==!!_)throw Error(c+b+" not true or false: "+_);if(_){if(typeof crypto>"u"||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw K=!_,Error(c+"crypto unavailable");K=_}else K=_}if(C.hasOwnProperty(b="MODULO_MODE")&&(I(_=C[b],0,9,b),Se=_),C.hasOwnProperty(b="POW_PRECISION")&&(I(_=C[b],0,y,b),Pe=_),C.hasOwnProperty(b="FORMAT")){if(typeof(_=C[b])!="object")throw Error(c+b+" not an object: "+_);Oe=_}if(C.hasOwnProperty(b="ALPHABET")){if(typeof(_=C[b])!="string"||/^.$|[+-.\s]|(.).*\1/.test(_))throw Error(c+b+" invalid: "+_);He=_}}return{DECIMAL_PLACES:O,ROUNDING_MODE:D,EXPONENTIAL_AT:[z,G],RANGE:[ne,Z],CRYPTO:K,MODULO_MODE:Se,POW_PRECISION:Pe,FORMAT:Oe,ALPHABET:He}},Y.isBigNumber=function(C){return C instanceof Y||C&&C._isBigNumber===!0||!1},Y.maximum=Y.max=function(){return Be(arguments,w.lt)},Y.minimum=Y.min=function(){return Be(arguments,w.gt)},Y.random=(ve=9007199254740992,_e=Math.random()*ve&2097151?function(){return u(Math.random()*ve)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(C){var b,_,k,M,$,P=0,H=[],W=new Y(A);if(C==null?C=O:I(C,0,y),M=l(C/g),K)if(crypto.getRandomValues){for(b=crypto.getRandomValues(new Uint32Array(M*=2));P<M;)9e15<=($=131072*b[P]+(b[P+1]>>>11))?(_=crypto.getRandomValues(new Uint32Array(2)),b[P]=_[0],b[P+1]=_[1]):(H.push($%1e14),P+=2);P=M/2}else{if(!crypto.randomBytes)throw K=!1,Error(c+"crypto unavailable");for(b=crypto.randomBytes(M*=7);P<M;)9e15<=($=281474976710656*(31&b[P])+1099511627776*b[P+1]+4294967296*b[P+2]+16777216*b[P+3]+(b[P+4]<<16)+(b[P+5]<<8)+b[P+6])?crypto.randomBytes(7).copy(b,P):(H.push($%1e14),P+=7);P=M/7}if(!K)for(;P<M;)($=_e())<9e15&&(H[P++]=$%1e14);for(M=H[--P],C%=g,M&&C&&($=v[g-C],H[P]=u(M/$)*$);H[P]===0;H.pop(),P--);if(P<0)H=[k=0];else{for(k=-1;H[0]===0;H.splice(0,1),k-=g);for(P=1,$=H[0];10<=$;$/=10,P++);P<g&&(k-=g-P)}return W.e=k,W.c=H,W}),Y.sum=function(){for(var C=1,b=arguments,_=new Y(b[0]);C<b.length;)_=_.plus(b[C++]);return _},ie=function(){var C="0123456789";function b(_,k,M,$){for(var P,H,W=[0],L=0,V=_.length;L<V;){for(H=W.length;H--;W[H]*=k);for(W[0]+=$.indexOf(_.charAt(L++)),P=0;P<W.length;P++)W[P]>M-1&&(W[P+1]==null&&(W[P+1]=0),W[P+1]+=W[P]/M|0,W[P]%=M)}return W.reverse()}return function(_,k,M,$,P){var H,W,L,V,te,he,ye,Me,We=_.indexOf("."),St=O,qe=D;for(0<=We&&(V=Pe,Pe=0,_=_.replace(".",""),he=(Me=new Y(k)).pow(_.length-We),Pe=V,Me.c=b(ee(T(he.c),he.e,"0"),10,M,C),Me.e=Me.c.length),L=V=(ye=b(_,k,M,P?(H=He,C):(H=C,He))).length;ye[--V]==0;ye.pop());if(!ye[0])return H.charAt(0);if(We<0?--L:(he.c=ye,he.e=L,he.s=$,ye=(he=re(he,Me,St,qe,M)).c,te=he.r,L=he.e),We=ye[W=L+St+1],V=M/2,te=te||W<0||ye[W+1]!=null,te=qe<4?(We!=null||te)&&(qe==0||qe==(he.s<0?3:2)):V<We||We==V&&(qe==4||te||qe==6&&1&ye[W-1]||qe==(he.s<0?8:7)),W<1||!ye[0])_=te?ee(H.charAt(1),-St,H.charAt(0)):H.charAt(0);else{if(ye.length=W,te)for(--M;++ye[--W]>M;)ye[W]=0,W||(++L,ye=[1].concat(ye));for(V=ye.length;!ye[--V];);for(We=0,_="";We<=V;_+=H.charAt(ye[We++]));_=ee(_,L,H.charAt(0))}return _}}(),re=function(){function C(k,M,$){var P,H,W,L,V=0,te=k.length,he=M%S,ye=M/S|0;for(k=k.slice();te--;)V=((H=he*(W=k[te]%S)+(P=ye*W+(L=k[te]/S|0)*he)%S*S+V)/$|0)+(P/S|0)+ye*L,k[te]=H%$;return V&&(k=[V].concat(k)),k}function b(k,M,$,P){var H,W;if($!=P)W=P<$?1:-1;else for(H=W=0;H<$;H++)if(k[H]!=M[H]){W=k[H]>M[H]?1:-1;break}return W}function _(k,M,$,P){for(var H=0;$--;)k[$]-=H,H=k[$]<M[$]?1:0,k[$]=H*P+k[$]-M[$];for(;!k[0]&&1<k.length;k.splice(0,1));}return function(k,M,$,P,H){var W,L,V,te,he,ye,Me,We,St,qe,ct,_t,Ra,Xl,Vt,cn,bs,In=k.s==M.s?1:-1,Qt=k.c,yt=M.c;if(!(Qt&&Qt[0]&&yt&&yt[0]))return new Y(k.s&&M.s&&(Qt?!yt||Qt[0]!=yt[0]:yt)?Qt&&Qt[0]==0||!yt?0*In:In/0:NaN);for(St=(We=new Y(In)).c=[],In=$+(L=k.e-M.e)+1,H||(H=d,L=R(k.e/g)-R(M.e/g),In=In/g|0),V=0;yt[V]==(Qt[V]||0);V++);if(yt[V]>(Qt[V]||0)&&L--,In<0)St.push(1),te=!0;else{for(Xl=Qt.length,cn=yt.length,In+=2,1<(he=u(H/(yt[V=0]+1)))&&(yt=C(yt,he,H),Qt=C(Qt,he,H),cn=yt.length,Xl=Qt.length),Ra=cn,ct=(qe=Qt.slice(0,cn)).length;ct<cn;qe[ct++]=0);bs=yt.slice(),bs=[0].concat(bs),Vt=yt[0],yt[1]>=H/2&&Vt++;do{if(he=0,(W=b(yt,qe,cn,ct))<0){if(_t=qe[0],cn!=ct&&(_t=_t*H+(qe[1]||0)),1<(he=u(_t/Vt)))for(H<=he&&(he=H-1),Me=(ye=C(yt,he,H)).length,ct=qe.length;b(ye,qe,Me,ct)==1;)he--,_(ye,cn<Me?bs:yt,Me,H),Me=ye.length,W=1;else he==0&&(W=he=1),Me=(ye=yt.slice()).length;if(Me<ct&&(ye=[0].concat(ye)),_(qe,ye,ct,H),ct=qe.length,W==-1)for(;b(yt,qe,cn,ct)<1;)he++,_(qe,cn<ct?bs:yt,ct,H),ct=qe.length}else W===0&&(he++,qe=[0]);St[V++]=he,qe[0]?qe[ct++]=Qt[Ra]||0:(qe=[Qt[Ra]],ct=1)}while((Ra++<Xl||qe[0]!=null)&&In--);te=qe[0]!=null,St[0]||St.splice(0,1)}if(H==d){for(V=1,In=St[0];10<=In;In/=10,V++);De(We,$+(We.e=V+L*g-1)+1,P,te)}else We.e=L,We.r=+te;return We}}(),rt=/^(-?)0([xbo])(?=\w[\w.]*$)/i,Fe=/^([^.]+)\.$/,pe=/^\.([^.]+)$/,f=/^-?(Infinity|NaN)$/,m=/^\s*\+(?=[\w.])|^\s+|\s+$/g,oe=function(C,b,_,k){var M,$=_?b:b.replace(m,"");if(f.test($))C.s=isNaN($)?null:$<0?-1:1,C.c=C.e=null;else{if(!_&&($=$.replace(rt,function(P,H,W){return M=(W=W.toLowerCase())=="x"?16:W=="b"?2:8,k&&k!=M?P:H}),k&&(M=k,$=$.replace(Fe,"$1").replace(pe,"0.$1")),b!=$))return new Y($,M);if(Y.DEBUG)throw Error(c+"Not a"+(k?" base "+k:"")+" number: "+b);C.c=C.e=C.s=null}},w.absoluteValue=w.abs=function(){var C=new Y(this);return C.s<0&&(C.s=1),C},w.comparedTo=function(C,b){return N(this,new Y(C,b))},w.decimalPlaces=w.dp=function(C,b){var _,k,M;if(C!=null)return I(C,0,y),b==null?b=D:I(b,0,8),De(new Y(this),C+this.e+1,b);if(!(_=this.c))return null;if(k=((M=_.length-1)-R(this.e/g))*g,M=_[M])for(;M%10==0;M/=10,k--);return k<0&&(k=0),k},w.dividedBy=w.div=function(C,b){return re(this,new Y(C,b),O,D)},w.dividedToIntegerBy=w.idiv=function(C,b){return re(this,new Y(C,b),0,1)},w.exponentiatedBy=w.pow=function(C,b){var _,k,M,$,P,H,W,L,V=this;if((C=new Y(C)).c&&!C.isInteger())throw Error(c+"Exponent not an integer: "+be(C));if(b!=null&&(b=new Y(b)),P=14<C.e,!V.c||!V.c[0]||V.c[0]==1&&!V.e&&V.c.length==1||!C.c||!C.c[0])return L=new Y(Math.pow(+be(V),P?2-F(C):+be(C))),b?L.mod(b):L;if(H=C.s<0,b){if(b.c?!b.c[0]:!b.s)return new Y(NaN);(k=!H&&V.isInteger()&&b.isInteger())&&(V=V.mod(b))}else{if(9<C.e&&(0<V.e||V.e<-1||(V.e==0?1<V.c[0]||P&&24e7<=V.c[1]:V.c[0]<8e13||P&&V.c[0]<=9999975e7)))return $=V.s<0&&F(C)?-0:0,-1<V.e&&($=1/$),new Y(H?1/$:$);Pe&&($=l(Pe/g+2))}for(W=P?(_=new Y(.5),H&&(C.s=1),F(C)):(M=Math.abs(+be(C)))%2,L=new Y(A);;){if(W){if(!(L=L.times(V)).c)break;$?L.c.length>$&&(L.c.length=$):k&&(L=L.mod(b))}if(M){if((M=u(M/2))===0)break;W=M%2}else if(De(C=C.times(_),C.e+1,1),14<C.e)W=F(C);else{if((M=+be(C))==0)break;W=M%2}V=V.times(V),$?V.c&&V.c.length>$&&(V.c.length=$):k&&(V=V.mod(b))}return k?L:(H&&(L=A.div(L)),b?L.mod(b):$?De(L,Pe,D,void 0):L)},w.integerValue=function(C){var b=new Y(this);return C==null?C=D:I(C,0,8),De(b,b.e+1,C)},w.isEqualTo=w.eq=function(C,b){return N(this,new Y(C,b))===0},w.isFinite=function(){return!!this.c},w.isGreaterThan=w.gt=function(C,b){return 0<N(this,new Y(C,b))},w.isGreaterThanOrEqualTo=w.gte=function(C,b){return(b=N(this,new Y(C,b)))===1||b===0},w.isInteger=function(){return!!this.c&&R(this.e/g)>this.c.length-2},w.isLessThan=w.lt=function(C,b){return N(this,new Y(C,b))<0},w.isLessThanOrEqualTo=w.lte=function(C,b){return(b=N(this,new Y(C,b)))===-1||b===0},w.isNaN=function(){return!this.s},w.isNegative=function(){return this.s<0},w.isPositive=function(){return 0<this.s},w.isZero=function(){return!!this.c&&this.c[0]==0},w.minus=function(C,b){var _,k,M,$,P=this,H=P.s;if(b=(C=new Y(C,b)).s,!H||!b)return new Y(NaN);if(H!=b)return C.s=-b,P.plus(C);var W=P.e/g,L=C.e/g,V=P.c,te=C.c;if(!W||!L){if(!V||!te)return V?(C.s=-b,C):new Y(te?P:NaN);if(!V[0]||!te[0])return te[0]?(C.s=-b,C):new Y(V[0]?P:D==3?-0:0)}if(W=R(W),L=R(L),V=V.slice(),H=W-L){for((M=($=H<0)?(H=-H,V):(L=W,te)).reverse(),b=H;b--;M.push(0));M.reverse()}else for(k=($=(H=V.length)<(b=te.length))?H:b,H=b=0;b<k;b++)if(V[b]!=te[b]){$=V[b]<te[b];break}if($&&(M=V,V=te,te=M,C.s=-C.s),0<(b=(k=te.length)-(_=V.length)))for(;b--;V[_++]=0);for(b=d-1;H<k;){if(V[--k]<te[k]){for(_=k;_&&!V[--_];V[_]=b);--V[_],V[k]+=d}V[k]-=te[k]}for(;V[0]==0;V.splice(0,1),--L);return V[0]?xe(C,V,L):(C.s=D==3?-1:1,C.c=[C.e=0],C)},w.modulo=w.mod=function(C,b){var _,k,M=this;return C=new Y(C,b),!M.c||!C.s||C.c&&!C.c[0]?new Y(NaN):!C.c||M.c&&!M.c[0]?new Y(M):(Se==9?(k=C.s,C.s=1,_=re(M,C,0,3),C.s=k,_.s*=k):_=re(M,C,0,Se),(C=M.minus(_.times(C))).c[0]||Se!=1||(C.s=M.s),C)},w.multipliedBy=w.times=function(C,b){var _,k,M,$,P,H,W,L,V,te,he,ye,Me,We,St,qe=this,ct=qe.c,_t=(C=new Y(C,b)).c;if(!(ct&&_t&&ct[0]&&_t[0]))return!qe.s||!C.s||ct&&!ct[0]&&!_t||_t&&!_t[0]&&!ct?C.c=C.e=C.s=null:(C.s*=qe.s,ct&&_t?(C.c=[0],C.e=0):C.c=C.e=null),C;for(k=R(qe.e/g)+R(C.e/g),C.s*=qe.s,(W=ct.length)<(te=_t.length)&&(Me=ct,ct=_t,_t=Me,M=W,W=te,te=M),M=W+te,Me=[];M--;Me.push(0));for(We=d,St=S,M=te;0<=--M;){for(_=0,he=_t[M]%St,ye=_t[M]/St|0,$=M+(P=W);M<$;)_=((L=he*(L=ct[--P]%St)+(H=ye*L+(V=ct[P]/St|0)*he)%St*St+Me[$]+_)/We|0)+(H/St|0)+ye*V,Me[$--]=L%We;Me[$]=_}return _?++k:Me.splice(0,1),xe(C,Me,k)},w.negated=function(){var C=new Y(this);return C.s=-C.s||null,C},w.plus=function(C,b){var _,k=this,M=k.s;if(b=(C=new Y(C,b)).s,!M||!b)return new Y(NaN);if(M!=b)return C.s=-b,k.minus(C);var $=k.e/g,P=C.e/g,H=k.c,W=C.c;if(!$||!P){if(!H||!W)return new Y(M/0);if(!H[0]||!W[0])return W[0]?C:new Y(H[0]?k:0*M)}if($=R($),P=R(P),H=H.slice(),M=$-P){for((_=0<M?(P=$,W):(M=-M,H)).reverse();M--;_.push(0));_.reverse()}for((M=H.length)-(b=W.length)<0&&(_=W,W=H,H=_,b=M),M=0;b;)M=(H[--b]=H[b]+W[b]+M)/d|0,H[b]=d===H[b]?0:H[b]%d;return M&&(H=[M].concat(H),++P),xe(C,H,P)},w.precision=w.sd=function(C,b){var _,k,M;if(C!=null&&C!==!!C)return I(C,1,y),b==null?b=D:I(b,0,8),De(new Y(this),C,b);if(!(_=this.c))return null;if(k=(M=_.length-1)*g+1,M=_[M]){for(;M%10==0;M/=10,k--);for(M=_[0];10<=M;M/=10,k++);}return C&&this.e+1>k&&(k=this.e+1),k},w.shiftedBy=function(C){return I(C,-p,p),this.times("1e"+C)},w.squareRoot=w.sqrt=function(){var C,b,_,k,M,$=this,P=$.c,H=$.s,W=$.e,L=O+4,V=new Y("0.5");if(H!==1||!P||!P[0])return new Y(!H||H<0&&(!P||P[0])?NaN:P?$:1/0);if((_=(H=Math.sqrt(+be($)))==0||H==1/0?(((b=T(P)).length+W)%2==0&&(b+="0"),H=Math.sqrt(+b),W=R((W+1)/2)-(W<0||W%2),new Y(b=H==1/0?"1e"+W:(b=H.toExponential()).slice(0,b.indexOf("e")+1)+W)):new Y(H+"")).c[0]){for((H=(W=_.e)+L)<3&&(H=0);;)if(M=_,_=V.times(M.plus(re($,M,L,1))),T(M.c).slice(0,H)===(b=T(_.c)).slice(0,H)){if(_.e<W&&--H,(b=b.slice(H-3,H+1))!="9999"&&(k||b!="4999")){+b&&(+b.slice(1)||b.charAt(0)!="5")||(De(_,_.e+O+2,1),C=!_.times(_).eq($));break}if(!k&&(De(M,M.e+O+2,0),M.times(M).eq($))){_=M;break}L+=4,H+=4,k=1}}return De(_,_.e+O+1,D,C)},w.toExponential=function(C,b){return C!=null&&(I(C,0,y),C++),lt(this,C,b,1)},w.toFixed=function(C,b){return C!=null&&(I(C,0,y),C=C+this.e+1),lt(this,C,b)},w.toFormat=function(C,b,_){var k;if(_==null)C!=null&&b&&typeof b=="object"?(_=b,b=null):C&&typeof C=="object"?(_=C,C=b=null):_=Oe;else if(typeof _!="object")throw Error(c+"Argument not an object: "+_);if(k=this.toFixed(C,b),this.c){var M,$=k.split("."),P=+_.groupSize,H=+_.secondaryGroupSize,W=_.groupSeparator||"",L=$[0],V=$[1],te=this.s<0,he=te?L.slice(1):L,ye=he.length;if(H&&(M=P,P=H,ye-=H=M),0<P&&0<ye){for(M=ye%P||P,L=he.substr(0,M);M<ye;M+=P)L+=W+he.substr(M,P);0<H&&(L+=W+he.slice(M)),te&&(L="-"+L)}k=V?L+(_.decimalSeparator||"")+((H=+_.fractionGroupSize)?V.replace(new RegExp("\\d{"+H+"}\\B","g"),"$&"+(_.fractionGroupSeparator||"")):V):L}return(_.prefix||"")+k+(_.suffix||"")},w.toFraction=function(C){var b,_,k,M,$,P,H,W,L,V,te,he,ye=this,Me=ye.c;if(C!=null&&(!(H=new Y(C)).isInteger()&&(H.c||H.s!==1)||H.lt(A)))throw Error(c+"Argument "+(H.isInteger()?"out of range: ":"not an integer: ")+be(H));if(!Me)return new Y(ye);for(b=new Y(A),L=_=new Y(A),k=W=new Y(A),he=T(Me),$=b.e=he.length-ye.e-1,b.c[0]=v[(P=$%g)<0?g+P:P],C=!C||0<H.comparedTo(b)?0<$?b:L:H,P=Z,Z=1/0,H=new Y(he),W.c[0]=0;V=re(H,b,0,1),(M=_.plus(V.times(k))).comparedTo(C)!=1;)_=k,k=M,L=W.plus(V.times(M=L)),W=M,b=H.minus(V.times(M=b)),H=M;return M=re(C.minus(_),k,0,1),W=W.plus(M.times(L)),_=_.plus(M.times(k)),W.s=L.s=ye.s,te=re(L,k,$*=2,D).minus(ye).abs().comparedTo(re(W,_,$,D).minus(ye).abs())<1?[L,k]:[W,_],Z=P,te},w.toNumber=function(){return+be(this)},w.toPrecision=function(C,b){return C!=null&&I(C,1,y),lt(this,C,b,2)},w.toString=function(C){var b,_=this,k=_.s,M=_.e;return M===null?k?(b="Infinity",k<0&&(b="-"+b)):b="NaN":(b=C==null?M<=z||G<=M?B(T(_.c),M):ee(T(_.c),M,"0"):C===10?ee(T((_=De(new Y(_),O+M+1,D)).c),_.e,"0"):(I(C,2,He.length,"Base"),ie(ee(T(_.c),M,"0"),10,C,k,!0)),k<0&&_.c[0]&&(b="-"+b)),b},w.valueOf=w.toJSON=function(){return be(this)},w._isBigNumber=!0,typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"&&(w[Symbol.toStringTag]="BigNumber",w[Symbol.for("nodejs.util.inspect.custom")]=w.valueOf),j!=null&&Y.set(j),Y}()).default=s.BigNumber=s,r!==void 0&&r.exports?r.exports=s:(o||(o=typeof self<"u"&&self?self:window),o.BigNumber=s)})(this)},{}],2:[function(n,r,i){r.exports={languageTag:"en-US",delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},spaceSeparated:!1,ordinal:function(o){var s=o%10;return~~(o%100/10)==1?"th":s===1?"st":s===2?"nd":s===3?"rd":"th"},currency:{symbol:"$",position:"prefix",code:"USD"},currencyFormat:{thousandSeparated:!0,totalLength:4,spaceSeparated:!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}}}},{}],3:[function(n,r,i){function o(R,T){return function(N){if(Array.isArray(N))return N}(R)||function(N,I){var F=[],B=!0,ee=!1,U=void 0;try{for(var j,re=N[Symbol.iterator]();!(B=(j=re.next()).done)&&(F.push(j.value),!I||F.length!==I);B=!0);}catch(ie){ee=!0,U=ie}finally{try{B||re.return==null||re.return()}finally{if(ee)throw U}}return F}(R,T)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var s=n("./globalState"),a=n("./validating"),l=n("./parsing"),u=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],c={general:{scale:1024,suffixes:u,marker:"bd"},binary:{scale:1024,suffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],marker:"b"},decimal:{scale:1e3,suffixes:u,marker:"d"}},h={totalLength:0,characteristic:0,forceAverage:!1,average:!1,mantissa:-1,optionalMantissa:!0,thousandSeparated:!1,spaceSeparated:!1,negative:"sign",forceSign:!1};function d(R){var T=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{},N=2<arguments.length?arguments[2]:void 0;if(typeof T=="string"&&(T=l.parseFormat(T)),!a.validateFormat(T))return"ERROR: invalid format";var I=T.prefix||"",F=T.postfix||"",B=function(ee,U,j){switch(U.output){case"currency":return U=y(U,s.currentCurrencyDefaultFormat()),function(He,Y,lt){var Be=lt.currentCurrency(),xe=Object.assign({},h,Y),De=void 0,be="",C=!!xe.totalLength||!!xe.forceAverage||xe.average,b=Y.currencyPosition||Be.position,_=Y.currencySymbol||Be.symbol;xe.spaceSeparated&&(be=" "),b==="infix"&&(De=be+_+be);var k=S({instance:He,providedFormat:Y,state:lt,decimalSeparator:De});return b==="prefix"&&(k=He._value<0&&xe.negative==="sign"?"-".concat(be).concat(_).concat(k.slice(1)):_+be+k),b&&b!=="postfix"||(k=k+(be=C?"":be)+_),k}(ee,U,s);case"percent":return U=y(U,s.currentPercentageDefaultFormat()),function(He,Y,lt,Be){var xe=Y.prefixSymbol,De=S({instance:Be(100*He._value),providedFormat:Y,state:lt}),be=Object.assign({},h,Y);return xe?"%".concat(be.spaceSeparated?" ":"").concat(De):"".concat(De).concat(be.spaceSeparated?" ":"","%")}(ee,U,s,j);case"byte":return U=y(U,s.currentByteDefaultFormat()),A=ee,D=s,z=j,G=(O=U).base||"binary",ne=c[G],Z=g(A._value,ne.suffixes,ne.scale),K=Z.value,Se=Z.suffix,Pe=S({instance:z(K),providedFormat:O,state:D,defaults:D.currentByteDefaultFormat()}),Oe=D.currentAbbreviations(),"".concat(Pe).concat(Oe.spaced?" ":"").concat(Se);case"time":return U=y(U,s.currentTimeDefaultFormat()),pe=ee,f=Math.floor(pe._value/60/60),m=Math.floor((pe._value-60*f*60)/60),w=Math.round(pe._value-60*f*60-60*m),"".concat(f,":").concat(m<10?"0":"").concat(m,":").concat(w<10?"0":"").concat(w);case"ordinal":return U=y(U,s.currentOrdinalDefaultFormat()),re=ee,ie=U,ve=(oe=s).currentOrdinal(),_e=Object.assign({},h,ie),rt=S({instance:re,providedFormat:ie,state:oe}),Fe=ve(re._value),"".concat(rt).concat(_e.spaceSeparated?" ":"").concat(Fe);case"number":default:return S({instance:ee,providedFormat:U,numbro:j})}var re,ie,oe,ve,_e,rt,Fe,pe,f,m,w,A,O,D,z,G,ne,Z,K,Se,Pe,Oe}(R,T,N);return B=(B=I+B)+F}function g(R,T,N){var I=T[0],F=Math.abs(R);if(N<=F){for(var B=1;B<T.length;++B){var ee=Math.pow(N,B),U=Math.pow(N,B+1);if(ee<=F&&F<U){I=T[B],R/=ee;break}}I===T[0]&&(R/=Math.pow(N,T.length-1),I=T[T.length-1])}return{value:R,suffix:I}}function p(R){for(var T="",N=0;N<R;N++)T+="0";return T}function v(R,T){return R.toString().indexOf("e")!==-1?function(N,I){var F=N.toString(),B=o(F.split("e"),2),ee=B[0],U=B[1],j=o(ee.split("."),2),re=j[0],ie=j[1],oe=ie===void 0?"":ie;if(0<+U)F=re+oe+p(U-oe.length);else{var ve=".";ve=+re<0?"-0".concat(ve):"0".concat(ve);var _e=(p(-U-1)+Math.abs(re)+oe).substr(0,I);_e.length<I&&(_e+=p(I-_e.length)),F=ve+_e}return 0<+U&&0<I&&(F+=".".concat(p(I))),F}(R,T):(Math.round(+"".concat(R,"e+").concat(T))/Math.pow(10,T)).toFixed(T)}function S(R){var T=R.instance,N=R.providedFormat,I=R.state,F=I===void 0?s:I,B=R.decimalSeparator,ee=R.defaults,U=ee===void 0?F.currentDefaults():ee,j=T._value;if(j===0&&F.hasZeroFormat())return F.getZeroFormat();if(!isFinite(j))return j.toString();var re,ie,oe,ve,_e,rt,Fe,pe,f=Object.assign({},h,U,N),m=f.totalLength,w=m?0:f.characteristic,A=f.optionalCharacteristic,O=f.forceAverage,D=!!m||!!O||f.average,z=m?-1:D&&N.mantissa===void 0?0:f.mantissa,G=!m&&(N.optionalMantissa===void 0?z===-1:f.optionalMantissa),ne=f.trimMantissa,Z=f.thousandSeparated,K=f.spaceSeparated,Se=f.negative,Pe=f.forceSign,Oe=f.exponential,He="";if(D){var Y=function(C){var b=C.value,_=C.forceAverage,k=C.abbreviations,M=C.spaceSeparated,$=M!==void 0&&M,P=C.totalLength,H=P===void 0?0:P,W="",L=Math.abs(b),V=-1;if(L>=Math.pow(10,12)&&!_||_==="trillion"?(W=k.trillion,b/=Math.pow(10,12)):L<Math.pow(10,12)&&L>=Math.pow(10,9)&&!_||_==="billion"?(W=k.billion,b/=Math.pow(10,9)):L<Math.pow(10,9)&&L>=Math.pow(10,6)&&!_||_==="million"?(W=k.million,b/=Math.pow(10,6)):(L<Math.pow(10,6)&&L>=Math.pow(10,3)&&!_||_==="thousand")&&(W=k.thousand,b/=Math.pow(10,3)),W&&(W=($?" ":"")+W),H){var te=b.toString().split(".")[0];V=Math.max(H-te.length,0)}return{value:b,abbreviation:W,mantissaPrecision:V}}({value:j,forceAverage:O,abbreviations:F.currentAbbreviations(),spaceSeparated:K,totalLength:m});j=Y.value,He+=Y.abbreviation,m&&(z=Y.mantissaPrecision)}if(Oe){var lt=(ie=(re={value:j,characteristicPrecision:w}).value,oe=re.characteristicPrecision,ve=oe===void 0?0:oe,_e=o(ie.toExponential().split("e"),2),rt=_e[0],Fe=_e[1],pe=+rt,ve&&1<ve&&(pe*=Math.pow(10,ve-1),Fe=0<=(Fe=+Fe-(ve-1))?"+".concat(Fe):Fe),{value:pe,abbreviation:"e".concat(Fe)});j=lt.value,He=lt.abbreviation+He}var Be,xe,De,be=function(C,b,_,k,M){if(k===-1)return C;var $=v(b,k),P=o($.toString().split("."),2),H=P[0],W=P[1],L=W===void 0?"":W;if(L.match(/^0+$/)&&(_||M))return H;var V=L.match(/0+$/);return M&&V?"".concat(H,".").concat(L.toString().slice(0,V.index)):$.toString()}(j.toString(),j,G,z,ne);return be=function(C,b,_,k,M){var $=k.currentDelimiters(),P=$.thousands;M=M||$.decimal;var H=$.thousandsSize||3,W=C.toString(),L=W.split(".")[0],V=W.split(".")[1];return _&&(b<0&&(L=L.slice(1)),function(te,he){for(var ye=[],Me=0,We=te;0<We;We--)Me===he&&(ye.unshift(We),Me=0),Me++;return ye}(L.length,H).forEach(function(te,he){L=L.slice(0,te+he)+P+L.slice(te+he)}),b<0&&(L="-".concat(L))),W=V?L+M+V:L}(be=function(C,b,_,k){var M=C,$=o(M.toString().split("."),2),P=$[0],H=$[1];if(P.match(/^-?0$/)&&_)return H?"".concat(P.replace("0",""),".").concat(H):P.replace("0","");if(P.length<k)for(var W=k-P.length,L=0;L<W;L++)M="0".concat(M);return M.toString()}(be,0,A,w),j,Z,F,B),(D||Oe)&&(be=be+He),(Pe||j<0)&&(Be=be,De=Se,be=(xe=j)===0?Be:+Be==0?Be.replace("-",""):0<xe?"+".concat(Be):De==="sign"?Be:"(".concat(Be.replace("-",""),")")),be}function y(R,T){if(!R)return T;var N=Object.keys(R);return N.length===1&&N[0]==="output"?T:R}r.exports=function(R){return{format:function(){for(var T=arguments.length,N=new Array(T),I=0;I<T;I++)N[I]=arguments[I];return d.apply(void 0,N.concat([R]))},getByteUnit:function(){for(var T=arguments.length,N=new Array(T),I=0;I<T;I++)N[I]=arguments[I];return(function(F){var B=c.general;return g(F._value,B.suffixes,B.scale).suffix}).apply(void 0,N.concat([R]))},getBinaryByteUnit:function(){for(var T=arguments.length,N=new Array(T),I=0;I<T;I++)N[I]=arguments[I];return(function(F){var B=c.binary;return g(F._value,B.suffixes,B.scale).suffix}).apply(void 0,N.concat([R]))},getDecimalByteUnit:function(){for(var T=arguments.length,N=new Array(T),I=0;I<T;I++)N[I]=arguments[I];return(function(F){var B=c.decimal;return g(F._value,B.suffixes,B.scale).suffix}).apply(void 0,N.concat([R]))},formatOrDefault:y}}},{"./globalState":4,"./parsing":8,"./validating":10}],4:[function(n,r,i){var o=n("./en-US"),s=n("./validating"),a=n("./parsing"),l={},u=void 0,c={},h=null,d={};function g(v){u=v}function p(){return c[u]}l.languages=function(){return Object.assign({},c)},l.currentLanguage=function(){return u},l.currentCurrency=function(){return p().currency},l.currentAbbreviations=function(){return p().abbreviations},l.currentDelimiters=function(){return p().delimiters},l.currentOrdinal=function(){return p().ordinal},l.currentDefaults=function(){return Object.assign({},p().defaults,d)},l.currentOrdinalDefaultFormat=function(){return Object.assign({},l.currentDefaults(),p().ordinalFormat)},l.currentByteDefaultFormat=function(){return Object.assign({},l.currentDefaults(),p().byteFormat)},l.currentPercentageDefaultFormat=function(){return Object.assign({},l.currentDefaults(),p().percentageFormat)},l.currentCurrencyDefaultFormat=function(){return Object.assign({},l.currentDefaults(),p().currencyFormat)},l.currentTimeDefaultFormat=function(){return Object.assign({},l.currentDefaults(),p().timeFormat)},l.setDefaults=function(v){v=a.parseFormat(v),s.validateFormat(v)&&(d=v)},l.getZeroFormat=function(){return h},l.setZeroFormat=function(v){return h=typeof v=="string"?v:null},l.hasZeroFormat=function(){return h!==null},l.languageData=function(v){if(v){if(c[v])return c[v];throw new Error('Unknown tag "'.concat(v,'"'))}return p()},l.registerLanguage=function(v){var S=1<arguments.length&&arguments[1]!==void 0&&arguments[1];if(!s.validateLanguage(v))throw new Error("Invalid language data");c[v.languageTag]=v,S&&g(v.languageTag)},l.setLanguage=function(v){var S=1<arguments.length&&arguments[1]!==void 0?arguments[1]:o.languageTag;if(!c[v]){var y=v.split("-")[0],R=Object.keys(c).find(function(T){return T.split("-")[0]===y});return c[R]?void g(R):void g(S)}g(v)},l.registerLanguage(o),u=o.languageTag,r.exports=l},{"./en-US":2,"./parsing":8,"./validating":10}],5:[function(n,r,i){r.exports=function(o){return{loadLanguagesInNode:function(s){return a=o,void s.forEach(function(l){var u=void 0;try{u=n("../languages/".concat(l))}catch{console.error('Unable to load "'.concat(l,'". No matching language file found.'))}u&&a.registerLanguage(u)});var a}}}},{}],6:[function(n,r,i){var o=n("bignumber.js");function s(a,l,u){var c=new o(a._value),h=l;return u.isNumbro(l)&&(h=l._value),h=new o(h),a._value=c.minus(h).toNumber(),a}r.exports=function(a){return{add:function(l,u){return h=u,d=a,g=new o((c=l)._value),p=h,d.isNumbro(h)&&(p=h._value),p=new o(p),c._value=g.plus(p).toNumber(),c;var c,h,d,g,p},subtract:function(l,u){return s(l,u,a)},multiply:function(l,u){return h=u,d=a,g=new o((c=l)._value),p=h,d.isNumbro(h)&&(p=h._value),p=new o(p),c._value=g.times(p).toNumber(),c;var c,h,d,g,p},divide:function(l,u){return h=u,d=a,g=new o((c=l)._value),p=h,d.isNumbro(h)&&(p=h._value),p=new o(p),c._value=g.dividedBy(p).toNumber(),c;var c,h,d,g,p},set:function(l,u){return c=l,d=h=u,a.isNumbro(h)&&(d=h._value),c._value=d,c;var c,h,d},difference:function(l,u){return c=u,s(d=(h=a)(l._value),c,h),Math.abs(d._value);var c,h,d}}}},{"bignumber.js":1}],7:[function(n,r,i){function o(S,y){for(var R=0;R<y.length;R++){var T=y[R];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(S,T.key,T)}}var s=n("./globalState"),a=n("./validating"),l=n("./loading")(v),u=n("./unformatting"),c=n("./formatting")(v),h=n("./manipulating")(v),d=n("./parsing"),g=function(){function S(T){(function(N,I){if(!(N instanceof I))throw new TypeError("Cannot call a class as a function")})(this,S),this._value=T}var y,R;return y=S,(R=[{key:"clone",value:function(){return v(this._value)}},{key:"format",value:function(){var T=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{};return c.format(this,T)}},{key:"formatCurrency",value:function(T){return typeof T=="string"&&(T=d.parseFormat(T)),(T=c.formatOrDefault(T,s.currentCurrencyDefaultFormat())).output="currency",c.format(this,T)}},{key:"formatTime",value:function(){var T=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{};return T.output="time",c.format(this,T)}},{key:"binaryByteUnits",value:function(){return c.getBinaryByteUnit(this)}},{key:"decimalByteUnits",value:function(){return c.getDecimalByteUnit(this)}},{key:"byteUnits",value:function(){return c.getByteUnit(this)}},{key:"difference",value:function(T){return h.difference(this,T)}},{key:"add",value:function(T){return h.add(this,T)}},{key:"subtract",value:function(T){return h.subtract(this,T)}},{key:"multiply",value:function(T){return h.multiply(this,T)}},{key:"divide",value:function(T){return h.divide(this,T)}},{key:"set",value:function(T){return h.set(this,p(T))}},{key:"value",value:function(){return this._value}},{key:"valueOf",value:function(){return this._value}}])&&o(y.prototype,R),S}();function p(S){var y=S;return v.isNumbro(S)?y=S._value:typeof S=="string"?y=v.unformat(S):isNaN(S)&&(y=NaN),y}function v(S){return new g(p(S))}v.version="2.1.2",v.isNumbro=function(S){return S instanceof g},v.language=s.currentLanguage,v.registerLanguage=s.registerLanguage,v.setLanguage=s.setLanguage,v.languages=s.languages,v.languageData=s.languageData,v.zeroFormat=s.setZeroFormat,v.defaultFormat=s.currentDefaults,v.setDefaults=s.setDefaults,v.defaultCurrencyFormat=s.currentCurrencyDefaultFormat,v.validate=a.validate,v.loadLanguagesInNode=l.loadLanguagesInNode,v.unformat=u.unformat,r.exports=v},{"./formatting":3,"./globalState":4,"./loading":5,"./manipulating":6,"./parsing":8,"./unformatting":9,"./validating":10}],8:[function(n,r,i){r.exports={parseFormat:function(o){var s,a,l,u,c,h,d,g,p,v,S,y,R,T,N,I,F,B,ee,U,j=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{};return typeof o!="string"?o:(a=j,o=(l=(s=o).match(/^{([^}]*)}/))?(a.prefix=l[1],s.slice(l[0].length)):s,c=j,function(re,ie){if(re.indexOf("$")===-1){if(re.indexOf("%")===-1)return re.indexOf("bd")!==-1?(ie.output="byte",ie.base="general"):re.indexOf("b")!==-1?(ie.output="byte",ie.base="binary"):re.indexOf("d")!==-1?(ie.output="byte",ie.base="decimal"):re.indexOf(":")===-1?re.indexOf("o")!==-1&&(ie.output="ordinal"):ie.output="time";ie.output="percent"}else ie.output="currency"}(o=(h=(u=o).match(/{([^}]*)}$/))?(c.postfix=h[1],u.slice(0,-h[0].length)):u,j),d=j,(g=o.match(/[1-9]+[0-9]*/))&&(d.totalLength=+g[0]),p=j,(v=o.split(".")[0].match(/0+/))&&(p.characteristic=v[0].length),function(re,ie){if(re.indexOf(".")!==-1){var oe=re.split(".")[0];ie.optionalCharacteristic=oe.indexOf("0")===-1}}(o,j),S=j,o.indexOf("a")!==-1&&(S.average=!0),R=j,(y=o).indexOf("K")!==-1?R.forceAverage="thousand":y.indexOf("M")!==-1?R.forceAverage="million":y.indexOf("B")!==-1?R.forceAverage="billion":y.indexOf("T")!==-1&&(R.forceAverage="trillion"),function(re,ie){var oe=re.split(".")[1];if(oe){var ve=oe.match(/0+/);ve&&(ie.mantissa=ve[0].length)}}(o,j),N=j,(T=o).match(/\[\.]/)?N.optionalMantissa=!0:T.match(/\./)&&(N.optionalMantissa=!1),I=j,o.indexOf(",")!==-1&&(I.thousandSeparated=!0),F=j,o.indexOf(" ")!==-1&&(F.spaceSeparated=!0),ee=j,(B=o).match(/^\+?\([^)]*\)$/)&&(ee.negative="parenthesis"),B.match(/^\+?-/)&&(ee.negative="sign"),U=j,o.match(/^\+/)&&(U.forceSign=!0),j)}}},{}],9:[function(n,r,i){var o=[{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 s(l){return l.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function a(l,u){var c=2<arguments.length&&arguments[2]!==void 0?arguments[2]:"",h=3<arguments.length?arguments[3]:void 0,d=4<arguments.length?arguments[4]:void 0,g=5<arguments.length?arguments[5]:void 0,p=6<arguments.length?arguments[6]:void 0;if(l!=="")return l===d?0:function v(S,y){var R=2<arguments.length&&arguments[2]!==void 0?arguments[2]:"",T=3<arguments.length?arguments[3]:void 0,N=4<arguments.length?arguments[4]:void 0,I=5<arguments.length?arguments[5]:void 0,F=6<arguments.length?arguments[6]:void 0;if(!isNaN(+S))return+S;var B="",ee=S.replace(/(^[^(]*)\((.*)\)([^)]*$)/,"$1$2$3");if(ee!==S)return-1*v(ee,y,R,T,N,I,F);for(var U=0;U<o.length;U++){var j=o[U];if((B=S.replace(j.key,""))!==S)return v(B,y,R,T,N,I,F)*j.factor}if((B=S.replace("%",""))!==S)return v(B,y,R,T,N,I,F)/100;var re=parseFloat(S);if(!isNaN(re)){var ie=T(re);if(ie&&ie!=="."&&(B=S.replace(new RegExp("".concat(s(ie),"$")),""))!==S)return v(B,y,R,T,N,I,F);var oe={};Object.keys(I).forEach(function(m){oe[I[m]]=m});for(var ve=Object.keys(oe).sort().reverse(),_e=ve.length,rt=0;rt<_e;rt++){var Fe=ve[rt],pe=oe[Fe];if((B=S.replace(Fe,""))!==S){var f=void 0;switch(pe){case"thousand":f=Math.pow(10,3);break;case"million":f=Math.pow(10,6);break;case"billion":f=Math.pow(10,9);break;case"trillion":f=Math.pow(10,12)}return v(B,y,R,T,N,I,F)*f}}}}(function(v,S){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:"",R=v.replace(y,"");return R=(R=R.replace(new RegExp("([0-9])".concat(s(S.thousands),"([0-9])"),"g"),"$1$2")).replace(S.decimal,".")}(l,u,c),u,c,h,d,g,p)}r.exports={unformat:function(l,u){var c,h,d,g=n("./globalState"),p=g.currentDelimiters(),v=g.currentCurrency().symbol,S=g.currentOrdinal(),y=g.getZeroFormat(),R=g.currentAbbreviations(),T=void 0;if(typeof l=="string")T=function(N,I){if(!N.indexOf(":")||I.thousands===":")return!1;var F=N.split(":");if(F.length!==3)return!1;var B=+F[0],ee=+F[1],U=+F[2];return!isNaN(B)&&!isNaN(ee)&&!isNaN(U)}(l,p)?(c=l.split(":"),h=+c[0],d=+c[1],+c[2]+60*d+3600*h):a(l,p,v,S,y,R,u);else{if(typeof l!="number")return;T=l}if(T!==void 0)return T}}},{"./globalState":4}],10:[function(n,r,i){function o(p){return function(v){if(Array.isArray(v)){for(var S=0,y=new Array(v.length);S<v.length;S++)y[S]=v[S];return y}}(p)||function(v){if(Symbol.iterator in Object(v)||Object.prototype.toString.call(v)==="[object Arguments]")return Array.from(v)}(p)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function s(p){return(s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(v){return typeof v}:function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v})(p)}var a=n("./unformatting"),l=/^[a-z]{2,3}(-[a-zA-Z]{4})?(-([A-Z]{2}|[0-9]{3}))?$/,u={output:{type:"string",validValues:["currency","percent","byte","time","ordinal","number"]},base:{type:"string",validValues:["decimal","binary","general"],restriction:function(p,v){return v.output==="byte"},message:"`base` must be provided only when the output is `byte`",mandatory:function(p){return p.output==="byte"}},characteristic:{type:"number",restriction:function(p){return 0<=p},message:"value must be positive"},prefix:"string",postfix:"string",forceAverage:{type:"string",validValues:["trillion","billion","million","thousand"]},average:"boolean",currencyPosition:{type:"string",validValues:["prefix","infix","postfix"]},currencySymbol:"string",totalLength:{type:"number",restrictions:[{restriction:function(p){return 0<=p},message:"value must be positive"},{restriction:function(p,v){return!v.exponential},message:"`totalLength` is incompatible with `exponential`"}]},mantissa:{type:"number",restriction:function(p){return 0<=p},message:"value must be positive"},optionalMantissa:"boolean",trimMantissa:"boolean",optionalCharacteristic:"boolean",thousandSeparated:"boolean",spaceSeparated:"boolean",abbreviations:{type:"object",children:{thousand:"string",million:"string",billion:"string",trillion:"string"}},negative:{type:"string",validValues:["sign","parenthesis"]},forceSign:"boolean",exponential:{type:"boolean"},prefixSymbol:{type:"boolean",restriction:function(p,v){return v.output==="percent"},message:"`prefixSymbol` can be provided only when the output is `percent`"}},c={languageTag:{type:"string",mandatory:!0,restriction:function(p){return p.match(l)},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:{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},spaceSeparated:"boolean",ordinal:{type:"function",mandatory:!0},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(p){return!!a.unformat(p)}function d(p,v,S){var y=3<arguments.length&&arguments[3]!==void 0&&arguments[3],R=Object.keys(p).map(function(T){if(!v[T])return console.error("".concat(S," Invalid key: ").concat(T)),!1;var N=p[T],I=v[T];if(typeof I=="string"&&(I={type:I}),I.type==="format"){if(!d(N,u,"[Validate ".concat(T,"]"),!0))return!1}else if(s(N)!==I.type)return console.error("".concat(S," ").concat(T,' type mismatched: "').concat(I.type,'" expected, "').concat(s(N),'" provided')),!1;if(I.restrictions&&I.restrictions.length)for(var F=I.restrictions.length,B=0;B<F;B++){var ee=I.restrictions[B],U=ee.restriction,j=ee.message;if(!U(N,p))return console.error("".concat(S," ").concat(T," invalid value: ").concat(j)),!1}return I.restriction&&!I.restriction(N,p)?(console.error("".concat(S," ").concat(T," invalid value: ").concat(I.message)),!1):I.validValues&&I.validValues.indexOf(N)===-1?(console.error("".concat(S," ").concat(T," invalid value: must be among ").concat(JSON.stringify(I.validValues),', "').concat(N,'" provided')),!1):!(I.children&&!d(N,I.children,"[Validate ".concat(T,"]")))});return y||R.push.apply(R,o(Object.keys(v).map(function(T){var N=v[T];if(typeof N=="string"&&(N={type:N}),N.mandatory){var I=N.mandatory;if(typeof I=="function"&&(I=I(p)),I&&p[T]===void 0)return console.error("".concat(S,' Missing mandatory key "').concat(T,'"')),!1}return!0}))),R.reduce(function(T,N){return T&&N},!0)}function g(p){return d(p,u,"[Validate format]")}r.exports={validate:function(p,v){var S=h(p),y=g(v);return S&&y},validateFormat:g,validateInput:h,validateLanguage:function(p){return d(p,c,"[Validate language]")}}},{"./unformatting":9}]},{},[7])(7)})})(TH);var m7=TH.exports;const Hs=YN(m7),p7="numeric";function Yb(t,e,n,r,i,o,s){let a=o;if(Wn(a)){const l=s.numericFormat,u=l&&l.culture||"-",c=l&&l.pattern,h=s.className||"",d=h.length?h.split(" "):[];if(typeof u<"u"&&!Hs.languages()[u]){const g=u.replace("-",""),p=Hs.allLanguages?Hs.allLanguages[u]:Hs[g];p&&Hs.registerLanguage(p)}Hs.setLanguage(u),a=Hs(a).format(c||"0"),d.indexOf("htLeft")<0&&d.indexOf("htCenter")<0&&d.indexOf("htRight")<0&&d.indexOf("htJustify")<0&&d.push("htRight"),d.indexOf("htNumeric")<0&&d.push("htNumeric"),s.className=d.join(" "),e.dir="ltr"}Ao(t,e,n,r,i,a,s)}Yb.RENDERER_TYPE=p7;const w7="password";function Gb(t,e,n,r,i,o,s){Ao.apply(this,[t,e,n,r,i,o,s]);const a=s.hashLength||e.innerHTML.length,l=s.hashSymbol||"*";let u="";me(a-1,()=>{u+=l}),Sa(e,u)}Gb.RENDERER_TYPE=w7;const v7="select";function zb(t,e,n,r,i,o,s){Ao.apply(this,[t,e,n,r,i,o,s])}zb.RENDERER_TYPE=v7;const C7="time";function jb(t,e,n,r,i,o,s){Ao.apply(this,[t,e,n,r,i,o,s]),e.dir="ltr"}jb.RENDERER_TYPE=C7;function S7(){lr(zl),lr(rh),lr(Vb),lr(Wb),lr(Ub),lr(Fb),lr(Yb),lr(Gb),lr(zb),lr(Ao),lr(jb)}const y7="autocomplete";function gp(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,aT(n,e)):aT(n,e)(this.source):e(!0)}gp.VALIDATOR_TYPE=y7;function aT(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 _H(t){const e=new Date(t);return isNaN(new Date(`${t}T00:00`).getDate())?e:new Date(e.getTime()+e.getTimezoneOffset()*6e4)}const b7=Object.freeze(Object.defineProperty({__proto__:null,getNormalizedDate:_H},Symbol.toStringTag,{value:"Module"})),R7="date";function Kb(t,e){const n=zx(vH,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=E7(r,this.dateFormat),l=this.instance.toVisualRow(this.row),u=this.instance.toVisualColumn(this.col);this.instance.setDataAtCell(l,u,a,"dateValidator"),i=!0}else i=!1;e(i)}Kb.VALIDATOR_TYPE=R7;function E7(t,e){const n=X(_H(t)),r=X(t,e),i=t.search(/[A-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 T7="dropdown";function Xb(t,e){gp.apply(this,[t,e])}Xb.VALIDATOR_TYPE=T7;const _7="numeric";function qb(t,e){let n=t;n==null&&(n=""),this.allowEmpty&&n===""?e(!0):e(n===""?!1:Wn(t))}qb.VALIDATOR_TYPE=_7;const M7=["YYYY-MM-DDTHH:mm:ss.SSSZ","X","x"],A7="time";function Zb(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,M7,!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),c=this.instance.toVisualRow(this.row),h=this.instance.toVisualColumn(this.col);this.instance.setDataAtCell(c,h,u,"timeValidator"),r=!0}else r=!1;e(r)}Zb.VALIDATOR_TYPE=A7;function O7(){ta(gp),ta(Xb),ta(Kb),ta(qb),ta(Zb)}const I7="autocomplete",P7={CELL_TYPE:I7,editor:Lb,renderer:zl,validator:gp},x7="checkbox",H7={CELL_TYPE:x7,editor:wH,renderer:Vb},D7="date";function MH(t,e,n,r,i,o,s){zl.apply(this,[t,e,n,r,i,o,s])}MH.RENDERER_TYPE=D7;const N7="date",L7={CELL_TYPE:N7,editor:CH,renderer:MH,validator:Kb},$7="dropdown",k7={CELL_TYPE:$7,editor:kb,renderer:Wb,validator:Xb},F7="handsontable",W7={CELL_TYPE:F7,editor:Nb,renderer:Ub},V7="numeric",B7={CELL_TYPE:V7,editor:SH,renderer:Yb,validator:qb,dataType:"number"},U7="password",Y7={CELL_TYPE:U7,editor:yH,renderer:Gb,copyable:!1},G7="select",z7={CELL_TYPE:G7,editor:bH,renderer:zb},j7="time",K7={CELL_TYPE:j7,editor:RH,renderer:jb,validator:Zb};function X7(){br(P7),br(H7),br(L7),br(k7),br(W7),br(B7),br(Y7),br(z7),br(gH),br(K7)}function q7(t,e){AH(t,e),e.add(t)}function Z7(t,e,n){AH(t,e),e.set(t,n)}function AH(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=Q7(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Q7(t){var e=J7(t,"string");return typeof e=="symbol"?e:String(e)}function J7(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function e8(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}function La(t,e){var n=t8(t,e,"get");return n8(t,n)}function t8(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}function n8(t,e){return e.get?e.get.call(t):e.value}const lT=new Map([["plugin",lj],["cell-type",iH],["editor",Gx],["renderer",e1],["validator",t1]]),r8="base",zw=[];let gi=null;var Ds=new WeakMap,uT=new WeakSet;class it{static get PLUGIN_KEY(){return r8}static get SETTING_KEYS(){return[this.PLUGIN_KEY]}constructor(e){q7(this,uT),Na(this,"eventManager",new xr(this)),Na(this,"pluginName",null),Na(this,"pluginsInitializedCallbacks",[]),Na(this,"isPluginsReady",!1),Na(this,"enabled",!1),Na(this,"initialized",!1),Z7(this,Ds,{writable:!0,value:{}}),Fi(this,"hot",e,{writable:!1}),gi=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(!lT.has(s))throw new Error(`Unknown plugin dependency type "${s}" was found.`);lT.get(s)(a)||i.push(` - ${a} (${s})`)}),i.length>0){const o=[`The ${this.pluginName} plugin requires the following modules:
`,`${i.join(`
`)}
`].join("");zw.push(o)}}if(gi||(gi=Zy()),gi.indexOf("UndoRedo")>=0&&gi.splice(gi.indexOf("UndoRedo"),1),gi.indexOf(this.pluginName)>=0&&gi.splice(gi.indexOf(this.pluginName),1),this.hot.addHookOnce("afterPluginsInitialized",()=>{this.isEnabled&&this.isEnabled()&&this.enablePlugin()}),gi.length===0){if(zw.length>0){const i=[`${zw.join(`
`)}
`,"You have to import and register them manually."].join("");throw 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}addHook(e,n){La(this,Ds)[e]=La(this,Ds)[e]||[];const r=La(this,Ds)[e];this.hot.addHook(e,n),r.push(n),La(this,Ds)[e]=r}removeHooks(e){E(La(this,Ds)[e]||[],n=>{this.hot.removeHook(e,n)})}clearHooks(){const e=La(this,Ds);Ye(e,(n,r)=>this.removeHooks(r)),e.length=0}callOnPluginsReady(e){this.isPluginsReady?e():this.pluginsInitializedCallbacks.push(e)}onAfterPluginsInitialized(){E(this.pluginsInitializedCallbacks,e=>e()),this.pluginsInitializedCallbacks.length=0,this.isPluginsReady=!0}onUpdateSettings(e){const n=e8(this,uT,i8).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(),Ye(this,(n,r)=>{r!=="hot"&&(this[r]=null)}),delete this.t,delete this.hot}}function i8(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 Ns(t,e,n){return e=o8(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function o8(t){var e=s8(t,"string");return typeof e=="symbol"?e:String(e)}function s8(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}let a8=class{constructor(e){Ns(this,"hot",null),Ns(this,"container",null),Ns(this,"injected",!1),Ns(this,"rows",[]),Ns(this,"columns",[]),Ns(this,"samples",null),Ns(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)),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),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(),E(this.rows,n=>{e(n.row,Pt(n.table)-1)})}getWidths(e){this.injected||this.injectTable(),E(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=>{E(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=>{E(o.strings,s=>{const a=s.col,l=this.hot.getCellMeta(e,a);l.col=a,l.row=e;const 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=>{E(i.strings,o=>{const s=o.col,a=e.createElement("th");r.push([s,a]),n.appendChild(a)})}),this.table.tHead.appendChild(n),E(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=>{E(i.strings,o=>{const s=o.row,a=this.hot.getCellMeta(s,e);a.col=e,a.row=s;const 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.view._wt.wtTable.getStretchedColumnWidth(e);if(i>1)for(let s=e+1;s<e+i;s++)o+=this.hot.view._wt.wtTable.getStretchedColumnWidth(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),q(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 q(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)}};const Qb=a8;function td(t,e,n){return e=l8(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function l8(t){var e=u8(t,"string");return typeof e=="symbol"?e:String(e)}function u8(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Jb{static get SAMPLE_COUNT(){return 3}constructor(e){td(this,"samples",null),td(this,"dataFactory",null),td(this,"customSampleCount",null),td(this,"allowDuplicates",!1),this.dataFactory=e}getSampleCount(){return this.customSampleCount?this.customSampleCount:Jb.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 me(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 me(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:Ve(u)?d=`${Object.keys(u).length}`:Array.isArray(u)?d=`${u.length}`:d=`${Ft(u).length}`,i.has(d)||i.set(d,{needed:this.getSampleCount(),strings:[]});const g=i.get(d);g.needed&&(!(s.indexOf(u)>-1)||this.allowDuplicates||h)&&(g.strings.push({value:u,[o]:a}),s.push(u),g.needed-=1)}),i}}const OH=Jb;function $a(t,e){IH(t,e),e.add(t)}function c8(t,e,n){IH(t,e),e.set(t,n)}function IH(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ka(t,e,n){return e=h8(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function h8(t){var e=d8(t,"string");return typeof e=="symbol"?e:String(e)}function d8(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function f8(t,e,n){var r=PH(t,e,"set");return g8(t,r,n),n}function g8(t,e,n){if(e.set)e.set.call(t,n);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=n}}function nd(t,e){var n=PH(t,e,"get");return m8(t,n)}function PH(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}function m8(t,e){return e.get?e.get.call(t):e.value}function Ls(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}de.getSingleton().register("modifyAutoColumnSizeSeed");const wu="autoColumnSize",p8=10,w8="autoColumnSize";var ml=new WeakMap,cT=new WeakSet,hT=new WeakSet,dT=new WeakSet,jw=new WeakSet,fT=new WeakSet,gT=new WeakSet;class oc extends it{static get PLUGIN_KEY(){return wu}static get PLUGIN_PRIORITY(){return p8}static get SETTING_KEYS(){return!0}static get CALCULATION_STEP(){return 50}static get SYNC_CALCULATION_LIMIT(){return 50}constructor(e){super(e),$a(this,gT),$a(this,fT),$a(this,jw),$a(this,dT),$a(this,hT),$a(this,cT),ka(this,"ghostTable",new Qb(this.hot)),ka(this,"samplesGenerator",new OH((n,r)=>{const i=this.hot.getCellMeta(n,r);let o="";i.spanned||(o=this.hot.getDataAtCell(n,r));let s="";return this.hot.hasHook("modifyAutoColumnSizeSeed")&&(s=this.hot.runHooks("modifyAutoColumnSizeSeed",s,i,o)),{value:o,bundleSeed:s}})),ka(this,"firstCalculation",!0),ka(this,"inProgress",!1),ka(this,"measuredColumns",0),ka(this,"columnWidthsMap",new ys),c8(this,ml,{writable:!0,value:[]}),this.hot.columnIndexMapper.registerMap(w8,this.columnWidthsMap),this.addHook("beforeColumnResize",(n,r,i)=>Ls(this,jw,mT).call(this,n,r,i))}isEnabled(){return this.hot.getSettings()[wu]!==!1&&!this.hot.getSettings().colWidths}enablePlugin(){var e=this;if(this.enabled)return;const n=this.hot.getSettings()[wu];n&&n.useHeaders!==null&&n.useHeaders!==void 0&&this.ghostTable.setSetting("useHeaders",n.useHeaders),this.setSamplingOptions(),this.addHook("afterLoadData",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ls(e,hT,C8).call(e,...i)}),this.addHook("beforeChangeRender",r=>Ls(this,dT,S8).call(this,r)),this.addHook("afterFormulasValuesUpdate",r=>Ls(this,gT,b8).call(this,r)),this.addHook("beforeViewRender",r=>Ls(this,cT,v8).call(this,r)),this.addHook("modifyColWidth",(r,i)=>this.getColumnWidth(i,r)),this.addHook("afterInit",()=>Ls(this,fT,y8).call(this)),super.enablePlugin()}updatePlugin(){const e=this.findColumnsWhereHeaderWasChanged();e.length&&(this.clearCache(e),this.calculateVisibleColumnsWidth()),super.updatePlugin()}disablePlugin(){super.disablePlugin(),this.addHook("beforeColumnResize",(e,n,r)=>Ls(this,jw,mT).call(this,e,n,r))}calculateVisibleColumnsWidth(){if(!this.hot.countRows())return;const n=this.hot.renderCall,r=this.getFirstVisibleColumn(),i=this.getLastVisibleColumn();r===-1||i===-1||this.calculateColumnsWidth({from:r,to:i},void 0,n)}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;me(i.from,i.to,s=>{let a=this.hot.toPhysicalColumn(s);if(a===null&&(a=s),r||this.columnWidthsMap.getValueAtIndex(a)===null&&!this.hot._getColWidthFromSettings(a)){const l=this.samplesGenerator.generateColumnSamples(s,o);E(l,u=>{let[c,h]=u;return this.ghostTable.addColumn(c,h)})}}),this.ghostTable.columns.length&&(this.hot.batchExecution(()=>{this.ghostTable.getWidths((s,a)=>{const l=this.hot.toPhysicalColumn(s);this.columnWidthsMap.setValueAtIndex(l,a)})},!0),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=0;const r=this.hot.countCols()-1;let i=null;this.inProgress=!0;const o=()=>{if(!this.hot){_c(i),this.inProgress=!1;return}this.calculateColumnsWidth({from:n,to:Math.min(n+oc.CALCULATION_STEP,r)},e),n=n+oc.CALCULATION_STEP+1,n<r?i=Fg(o):(_c(i),this.inProgress=!1,this.hot.view.adjustElementsSize())},s=this.getSyncCalculationLimit();this.firstCalculation&&s>=0&&(this.calculateColumnsWidth({from:0,to:s},e),this.firstCalculation=!1,n=s+1),n<r?o():this.inProgress=!1}setSamplingOptions(){const e=this.hot.getSettings()[wu],n=e&&It(e,"samplingRatio")?e.samplingRatio:void 0,r=e&&It(e,"allowSampleDuplicates")?e.allowSampleDuplicates:void 0;n&&!isNaN(n)&&this.samplesGenerator.setSampleCount(parseInt(n,10)),r&&this.samplesGenerator.setAllowDuplicates(r)}recalculateAllColumnsWidth(){this.hot.view&&this.hot.view._wt.wtTable.isVisible()&&(this.clearCache(),this.calculateAllColumnsWidth())}getSyncCalculationLimit(){const e=this.hot.getSettings()[wu];let n=oc.SYNC_CALCULATION_LIMIT;const r=this.hot.countCols()-1;return Ve(e)&&(n=e.syncLimit,My(n)?n=Xy(r,n):n>>=0),Math.min(n,r)}getColumnWidth(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,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,Zc.DEFAULT_WIDTH))),i}getFirstVisibleColumn(){const e=this.hot.view._wt;if(e.wtViewport.columnsVisibleCalculator){const n=e.wtTable.getFirstVisibleColumn();if(n!==-1)return this.hot.columnIndexMapper.getVisualFromRenderableIndex(n)}if(e.wtViewport.columnsRenderCalculator){const n=e.wtTable.getFirstRenderedColumn();if(n!==-1)return this.hot.columnIndexMapper.getVisualFromRenderableIndex(n)}return-1}getLastVisibleColumn(){const e=this.hot.view._wt;if(e.wtViewport.columnsVisibleCalculator){const n=e.wtTable.getLastVisibleColumn();if(n!==-1)return this.hot.columnIndexMapper.getVisualFromRenderableIndex(n)}if(e.wtViewport.columnsRenderCalculator){const n=e.wtTable.getLastRenderedColumn();if(n!==-1)return this.hot.columnIndexMapper.getVisualFromRenderableIndex(n)}return-1}findColumnsWhereHeaderWasChanged(){const e=this.hot.getColHeader();return Yt(e,(r,i,o)=>{const s=nd(this,ml).length;return(s-1<o||nd(this,ml)[o]!==i)&&r.push(o),s-1<o?nd(this,ml).push(i):nd(this,ml)[o]=i,r},[])}clearCache(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];e.length?this.hot.batchExecution(()=>{E(e,n=>{this.columnWidthsMap.setValueAtIndex(n,null)})},!0):this.columnWidthsMap.clear()}isNeedRecalculate(){return!!pr(this.columnWidthsMap.getValues().slice(0,this.measuredColumns),e=>e===null).length}destroy(){this.ghostTable.clean(),super.destroy()}}function v8(){this.calculateVisibleColumnsWidth(),this.isNeedRecalculate()&&!this.inProgress&&this.calculateAllColumnsWidth()}function C8(){this.hot.view?this.recalculateAllColumnsWidth():setTimeout(()=>{this.hot&&this.recalculateAllColumnsWidth()},0)}function S8(t){const e=Ue(t,n=>{let[,r]=n;return this.hot.toPhysicalColumn(this.hot.propToCol(r))});this.clearCache(Array.from(new Set(e)))}function mT(t,e,n){let r=t;return n&&(this.calculateColumnsWidth(e,void 0,!0),r=this.getColumnWidth(e,void 0,!1)),r}function y8(){f8(this,ml,this.hot.getColHeader())}function b8(t){const e=pr(t,r=>{var i;return ue((i=r.address)===null||i===void 0?void 0:i.col)}),n=Ue(e,r=>r.address.col);this.clearCache(Array.from(new Set(n)))}const ia={horizontal:"horizontal",vertical:"vertical"};function R8(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 E8(t){const e={};return t===!0?(e.directions=Object.keys(ia),e.autoInsertRow=!0):Ve(t)?(ue(t.autoInsertRow)?t.direction===ia.horizontal?e.autoInsertRow=!1:e.autoInsertRow=t.autoInsertRow:e.autoInsertRow=!1,ue(t.direction)?e.directions=[t.direction]:e.directions=Object.keys(ia)):typeof t=="string"?(e.directions=[t],e.autoInsertRow=!0):(e.directions=[],e.autoInsertRow=!1),e}function vu(t,e){T8(t,e),e.add(t)}function T8(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Fa(t,e,n){return e=_8(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _8(t){var e=M8(t,"string");return typeof e=="symbol"?e:String(e)}function M8(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Cu(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}de.getSingleton().register("modifyAutofillRange");de.getSingleton().register("beforeAutofill");de.getSingleton().register("afterAutofill");const pT="autofill",A8=20,O8=["fillHandle"],I8="insert_row_below",P8=200;var wT=new WeakSet,vT=new WeakSet,CT=new WeakSet,ST=new WeakSet,yT=new WeakSet;class x8 extends it{constructor(){super(...arguments),vu(this,yT),vu(this,ST),vu(this,CT),vu(this,vT),vu(this,wT),Fa(this,"addingStarted",!1),Fa(this,"mouseDownOnCellCorner",!1),Fa(this,"mouseDragOutside",!1),Fa(this,"handleDraggedCells",0),Fa(this,"directions",[]),Fa(this,"autoInsertRow",!1)}static get PLUGIN_KEY(){return pT}static get PLUGIN_PRIORITY(){return A8}static get SETTING_KEYS(){return[pT,...O8]}isEnabled(){return this.hot.getSettings().fillHandle}enablePlugin(){this.enabled||(this.mapSettings(),this.registerEvents(),this.addHook("afterOnCellCornerMouseDown",e=>Cu(this,vT,D8).call(this,e)),this.addHook("afterOnCellCornerDblClick",e=>Cu(this,wT,H8).call(this,e)),this.addHook("beforeOnCellMouseOver",(e,n)=>Cu(this,CT,N8).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 E(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)}),E(a,c=>{const h=[];E(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}=R8(l,u,(g,p)=>this.hot._createCellCoords(g,p));if(h&&h.row>-1&&h.col>-1){const g=this.getSelectionData(),p=o.clone(),v=this.hot._createCellRange(h,h,d),S=this.hot.runHooks("beforeAutofill",g,p,v,c);if(S===!1)return this.hot.selection.highlight.getFill().clear(),this.hot.render(),!1;let y=S;const R=S;if(["up","left"].indexOf(c)>-1&&!(R.length===1&&R[0].length===0))if(y=[],c==="up"){const T=d.row-h.row+1,N=T%R.length;for(let I=0;I<T;I++)y.push(R[(I+(R.length-N))%R.length])}else{const T=d.col-h.col+1,N=T%R[0].length;for(let I=0;I<R.length;I++){y.push([]);for(let F=0;F<T;F++)y[I].push(R[I][(F+(R[I].length-N))%R[I].length])}}this.hot.populateFromArray(h.row,h.col,y,d.row,d.col,`${this.pluginName}.fill`,null),this.setSelection(u),this.hot.runHooks("afterAutofill",y,p,v,c),this.hot.render()}else this.hot._refreshBorders();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(ia.vertical)&&this.directions.includes(ia.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(ia.vertical))i=this.hot._createCellCoords(e.row,r.col);else if(this.directions.includes(ia.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(I8,void 0,1,`${this.pluginName}.fill`),this.addingStarted=!1},P8)}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++)if(n[o][l])return-1;const s=n[o][e[1]-1],a=n[o][e[3]+1];(s||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(...Ue(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=en(this.hot.table).top-(this.hot.rootWindow.pageYOffset||n.scrollTop)+Pt(this.hot.table),i=en(this.hot.table).left-(this.hot.rootWindow.pageXOffset||n.scrollLeft)+ft(this.hot.table);return e.clientY>r&&e.clientX<=i}registerEvents(){const{documentElement:e}=this.hot.rootDocument;this.eventManager.addEventListener(e,"mouseup",()=>Cu(this,ST,L8).call(this)),this.eventManager.addEventListener(e,"mousemove",n=>Cu(this,yT,$8).call(this,n))}clearMappedSettings(){this.directions.length=0,this.autoInsertRow=!1}mapSettings(){const e=E8(this.hot.getSettings().fillHandle);this.directions=e.directions,this.autoInsertRow=e.autoInsertRow}destroy(){super.destroy()}}function H8(){this.selectAdjacent()&&this.fillIn()}function D8(){this.handleDraggedCells=1,this.mouseDownOnCellCorner=!0}function N8(t){this.mouseDownOnCellCorner&&!this.hot.view.isMouseDown()&&this.handleDraggedCells&&(this.handleDraggedCells+=1,this.showBorder(t),this.addNewRowIfNeeded())}function L8(){this.handleDraggedCells&&(this.handleDraggedCells>1&&this.fillIn(),this.handleDraggedCells=0,this.mouseDownOnCellCorner=!1)}function $8(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 rd(t,e){k8(t,e),e.add(t)}function k8(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function $s(t,e,n){return e=F8(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function F8(t){var e=W8(t,"string");return typeof e=="symbol"?e:String(e)}function W8(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Su(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}const id="autoRowSize",V8=40,B8="autoRowSize";var bT=new WeakSet,Kw=new WeakSet,RT=new WeakSet,ET=new WeakSet;class sc extends it{static get PLUGIN_KEY(){return id}static get PLUGIN_PRIORITY(){return V8}static get SETTING_KEYS(){return!0}static get CALCULATION_STEP(){return 50}static get SYNC_CALCULATION_LIMIT(){return 500}constructor(e){super(e),rd(this,ET),rd(this,RT),rd(this,Kw),rd(this,bT),$s(this,"headerHeight",null),$s(this,"ghostTable",new Qb(this.hot)),$s(this,"samplesGenerator",new OH((n,r)=>{if(n>=0&&r>=0&&this.hot.getCellMeta(n,r).hidden)return!1;let i;return n>=0?i=this.hot.getDataAtCell(n,r):n===-1&&(i=this.hot.getColHeader(r)),{value:i}})),$s(this,"firstCalculation",!0),$s(this,"inProgress",!1),$s(this,"measuredRows",0),$s(this,"rowHeightsMap",new ys),this.hot.rowIndexMapper.registerMap(B8,this.rowHeightsMap),this.addHook("beforeRowResize",(n,r,i)=>Su(this,Kw,TT).call(this,n,r,i))}isEnabled(){const e=this.hot.getSettings()[id];return e===!0||Ve(e)}enablePlugin(){var e=this;this.enabled||(this.setSamplingOptions(),this.addHook("afterLoadData",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Su(e,RT,Y8).call(e,...r)}),this.addHook("beforeChangeRender",n=>Su(this,ET,G8).call(this,n)),this.addHook("beforeColumnResize",()=>this.recalculateAllRowsHeight()),this.addHook("beforeViewRender",n=>Su(this,bT,U8).call(this,n)),this.addHook("modifyRowHeight",(n,r)=>this.getRowHeight(r,n)),this.addHook("modifyColumnHeaderHeight",()=>this.getColumnHeaderHeight()),super.enablePlugin())}disablePlugin(){this.headerHeight=null,super.disablePlugin(),this.addHook("beforeRowResize",(e,n,r)=>Su(this,Kw,TT).call(this,e,n,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))}me(i.from,i.to,s=>{if(r||this.rowHeightsMap.getValueAtIndex(s)===null){const a=this.samplesGenerator.generateRowSamples(s,o);E(a,l=>{let[u,c]=l;return this.ghostTable.addRow(u,c)})}}),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=0;const r=this.hot.countRows()-1;let i=null;this.inProgress=!0;const o=()=>{if(!this.hot){_c(i),this.inProgress=!1;return}this.calculateRowsHeight({from:n,to:Math.min(n+sc.CALCULATION_STEP,r)},e),n=n+sc.CALCULATION_STEP+1,n<r?i=Fg(o):(_c(i),this.inProgress=!1,this.hot.view.adjustElementsSize(!0),this.hot.view._wt.wtOverlays.inlineStartOverlay.needFullRender&&this.hot.view._wt.wtOverlays.inlineStartOverlay.clone.draw())},s=this.getSyncCalculationLimit();this.firstCalculation&&s>=0&&(this.calculateRowsHeight({from:0,to:s},e),this.firstCalculation=!1,n=s+1),n<r?o():(this.inProgress=!1,this.hot.view.adjustElementsSize(!1))}setSamplingOptions(){const e=this.hot.getSettings()[id],n=e&&It(e,"samplingRatio")?e.samplingRatio:void 0,r=e&&It(e,"allowSampleDuplicates")?e.allowSampleDuplicates:void 0;n&&!isNaN(n)&&this.samplesGenerator.setSampleCount(parseInt(n,10)),r&&this.samplesGenerator.setAllowDuplicates(r)}recalculateAllRowsHeight(){ds(this.hot.view._wt.wtTable.TABLE)&&(this.clearCache(),this.calculateAllRowsHeight())}getSyncCalculationLimit(){const e=this.hot.getSettings()[id];let n=sc.SYNC_CALCULATION_LIMIT;const r=this.hot.countRows()-1;return Ve(e)&&(n=e.syncLimit,My(n)?n=Xy(r,n):n>>=0),Math.min(n,r)}getRowHeight(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0;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(){const e=this.hot.view._wt;return e.wtViewport.rowsVisibleCalculator?e.wtTable.getFirstVisibleRow():e.wtViewport.rowsRenderCalculator?e.wtTable.getFirstRenderedRow():-1}getLastVisibleRow(){const e=this.hot.view._wt;return e.wtViewport.rowsVisibleCalculator?e.wtTable.getLastVisibleRow():e.wtViewport.rowsRenderCalculator?e.wtTable.getLastRenderedRow():-1}clearCache(){this.headerHeight=null,this.rowHeightsMap.init()}clearCacheByRange(e){const{from:n,to:r}=typeof e=="number"?{from:e,to:e}:e;this.hot.batchExecution(()=>{me(Math.min(n,r),Math.max(n,r),i=>{this.rowHeightsMap.setValueAtIndex(i,null)})},!0)}isNeedRecalculate(){return!!pr(this.rowHeightsMap.getValues().slice(0,this.measuredRows),e=>e===null).length}destroy(){this.ghostTable.clean(),super.destroy()}}function U8(){const t=this.hot.renderCall,e=this.hot.getSettings().fixedRowsBottom,n=this.getFirstVisibleRow(),r=this.getLastVisibleRow();if(!(n===-1||r===-1)){if(this.calculateRowsHeight({from:n,to:r},void 0,t),e){const i=this.hot.countRows()-1;this.calculateRowsHeight({from:i-e,to:i})}this.isNeedRecalculate()&&!this.inProgress&&this.calculateAllRowsHeight()}}function TT(t,e,n){let r=t;return n&&(this.calculateRowsHeight(e,void 0,!0),r=this.getRowHeight(e)),r}function Y8(){this.hot.view?this.recalculateAllRowsHeight():this.hot._registerTimeout(()=>{this.hot&&this.recalculateAllRowsHeight()})}function G8(t){let e=null;t.length===1?e=t[0][0]:t.length>1&&(e={from:t[0][0],to:t[t.length-1][0]}),e!==null&&this.clearCacheByRange(e)}const{getListWithInsertedItems:z8,getListWithRemovedItems:j8}=$1("physicallyIndexed");class K8 extends ya{constructor(){super(e=>e)}insert(e,n){const r=Rb(this.indexedValues,n);this.indexedValues=z8(r,e,n,this.initValueOrFn),super.insert(e,n)}remove(e){const n=j8(this.indexedValues,e);this.indexedValues=bb(n,e),super.remove(e)}}const X8=K8,{getListWithInsertedItems:q8,getListWithRemovedItems:Z8}=$1("physicallyIndexed");class Q8 extends ya{constructor(){super(e=>e)}insert(e,n){this.indexedValues=q8(this.indexedValues,e,n,(r,i)=>this.getNextValue(i)),super.insert(e,n)}remove(e){this.indexedValues=Z8(this.indexedValues,e),super.remove(e)}getNextValue(e){return Math.max(...this.getValues())+1+e}}const J8=Q8;function e5(t,e){t5(t,e),e.add(t)}function t5(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function n5(t,e,n){return e=r5(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function r5(t){var e=i5(t,"string");return typeof e=="symbol"?e:String(e)}function i5(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function o5(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}const Xw="bindRowsWithHeaders",s5=210,a5="loose",l5=new Map([["loose",X8],["strict",J8]]);var _T=new WeakSet;class u5 extends it{constructor(){super(...arguments),e5(this,_T),n5(this,"headerIndexes",null)}static get PLUGIN_KEY(){return Xw}static get PLUGIN_PRIORITY(){return s5}isEnabled(){return!!this.hot.getSettings()[Xw]}enablePlugin(){if(this.enabled)return;let e=this.hot.getSettings()[Xw];typeof e!="string"&&(e=a5);const n=l5.get(e);this.headerIndexes=this.hot.rowIndexMapper.registerMap("bindRowsWithHeaders",new n),this.addHook("modifyRowHeader",r=>o5(this,_T,c5).call(this,r)),super.enablePlugin()}disablePlugin(){this.hot.rowIndexMapper.unregisterMap("bindRowsWithHeaders"),super.disablePlugin()}destroy(){super.destroy()}}function c5(t){return this.headerIndexes.getValueAtIndex(this.hot.toPhysicalRow(t))}function od(t,e){xH(t,e),e.add(t)}function h5(t,e,n){xH(t,e),e.set(t,n)}function xH(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function MT(t,e,n){return e=d5(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function d5(t){var e=f5(t,"string");return typeof e=="symbol"?e:String(e)}function f5(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function AT(t,e){var n=HH(t,e,"get");return g5(t,n)}function g5(t,e){return e.get?e.get.call(t):e.value}function sd(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}function qw(t,e,n){var r=HH(t,e,"set");return m5(t,r,n),n}function HH(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}function m5(t,e,n){if(e.set)e.set.call(t,n);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=n}}const tf="collapsibleColumns",p5=290,w5=["nestedHeaders"],Al="collapsibleIndicator",OT=tf,IT=new Map([["collapse",{hideColumn:!0,beforeHook:"beforeColumnCollapse",afterHook:"afterColumnCollapse"}],["expand",{hideColumn:!1,beforeHook:"beforeColumnExpand",afterHook:"afterColumnExpand"}]]);var Wa=new WeakMap,PT=new WeakSet,xT=new WeakSet,HT=new WeakSet,DT=new WeakSet;class v5 extends it{constructor(){super(...arguments),od(this,DT),od(this,HT),od(this,xT),od(this,PT),MT(this,"nestedHeadersPlugin",null),MT(this,"headerStateManager",null),h5(this,Wa,{writable:!0,value:null})}static get PLUGIN_KEY(){return tf}static get PLUGIN_PRIORITY(){return p5}static get PLUGIN_DEPS(){return["plugin:NestedHeaders"]}static get SETTING_KEYS(){return[tf,...w5]}isEnabled(){return!!this.hot.getSettings()[tf]}enablePlugin(){var e=this;if(this.enabled)return;const{nestedHeaders:n}=this.hot.getSettings();n||gt("You need to configure the Nested Headers plugin in order to use collapsible headers."),qw(this,Wa,this.hot.columnIndexMapper.createAndRegisterIndexMap(this.pluginName,"hiding")),this.nestedHeadersPlugin=this.hot.getPlugin("nestedHeaders"),this.headerStateManager=this.nestedHeadersPlugin.getStateManager(),this.addHook("init",()=>sd(this,HT,y5).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 sd(e,DT,b5).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 sd(e,PT,C5).call(e,...i)}),this.addHook("beforeOnCellMouseDown",(r,i,o)=>sd(this,xT,S5).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),qw(this,Wa,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:{};i&&(o?this.expandSection({row:n,col:s}):this.collapseSection({row:n,col:s}))},runOnlyIf:()=>{var e;return(e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight.isHeader()},group:OT})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(OT)}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)};me(0,e-1,s=>{const a=n.childNodes[s],l=r.childNodes[s],u=i?i.childNodes[s]:null;me(0,a.childNodes.length-1,c=>{let h=a.childNodes[c].querySelector(`.${Al}`);o(h),l&&l.childNodes[c]&&(h=l.childNodes[c].querySelector(`.${Al}`),o(h)),i&&u&&u.childNodes[c]&&(h=u.childNodes[c].querySelector(`.${Al}`),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(!IT.has(n))throw new Error(`Unsupported action is passed (${n}).`);if(!Array.isArray(e))return;const r=pr(e,d=>{let{row:g}=d;return g<0});let i=r.length>0;E(r,d=>{var g;let{row:p,col:v}=d;const{collapsible:S,isCollapsed:y}=(g=this.headerStateManager.getHeaderSettings(p,v))!==null&&g!==void 0?g:{};if(!S||y&&n==="collapse"||!y&&n==="expand")return i=!1,!1});const o=[],s=[];i&&E(r,d=>{let{row:g,col:p}=d;const{colspanCompensation:v,affectedColumns:S,rollbackModification:y}=this.headerStateManager.triggerNodeModification(n,g,p);v>0&&(s.push(...S),o.push(y))});const a=this.getCollapsedColumns();let l=[];n==="collapse"?l=Ty([...a,...s]):n==="expand"&&(l=pr(a,d=>!s.includes(d)));const u=IT.get(n);if(this.hot.runHooks(u.beforeHook,a,l,i)===!1){E(o,d=>{d()});return}this.hot.batchExecution(()=>{E(s,d=>{AT(this,Wa).setValueAtIndex(this.hot.toPhysicalColumn(d),u.hideColumn)})},!0);const h=this.getCollapsedColumns().length!==a.length;this.hot.runHooks(u.afterHook,a,l,i,h),this.hot.render(),this.hot.view.adjustElementsSize(!0)}getCollapsedColumns(){return AT(this,Wa).getHiddenIndexes()}destroy(){qw(this,Wa,null),super.destroy()}}function C5(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(`.${Al}`);if(Ca(e,[Ir("")[0]]),a)u||(u=this.hot.rootDocument.createElement("div"),q(u,Al),e.querySelector("div:first-child").appendChild(u)),Le(u,["collapsed","expanded"]),s?(q(u,"collapsed"),hs(u,"+"),l&&Ee(e,...Ir(!1))):(q(u,"expanded"),hs(u,"-"),l&&Ee(e,...Ir(!0))),l&&Ee(u,...Eo());else{var c;(c=u)===null||c===void 0||c.remove()}}function S5(t,e){Ie(t.target,Al)&&(Ie(t.target,"expanded")?(this.eventManager.fireEvent(t.target,"mouseup"),this.toggleCollapsibleSection([e],"collapse")):Ie(t.target,"collapsed")&&(this.eventManager.fireEvent(t.target,"mouseup"),this.toggleCollapsibleSection([e],"expand")),Lr(t))}function y5(){this.updatePlugin()}function b5(t,e){e||this.updatePlugin()}function ks(t,e,n){return e=R5(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function R5(t){var e=E5(t,"string");return typeof e=="symbol"?e:String(e)}function E5(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const T5=["sortEmptyCells","indicator","headerAction","compareFunctionFactory"],_5=!1,M5=!0,A5=!0;class O5{constructor(e,n){ks(this,"hot",void 0),ks(this,"sortingStates",new zg),ks(this,"sortEmptyCells",_5),ks(this,"indicator",M5),ks(this,"headerAction",A5),ks(this,"compareFunctionFactory",void 0),ks(this,"mapName",void 0),this.hot=e,this.mapName=n,this.hot.columnIndexMapper.registerMap(n,this.sortingStates)}updateAllColumnsProperties(e){Ve(e)&&Ye(e,(n,r)=>{T5.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 Ve(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(ue(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}}const Wf="asc",Vf="desc",DH="colHeader";function I5(t){if(Ve(t)===!1)return!1;const{column:e,sortOrder:n}=t;return Number.isInteger(e)&&[Wf,Vf].includes(n)}function P5(t){if(t.some(n=>I5(n)===!1))return!1;const e=t.map(n=>{let{column:r}=n;return r});return new Set(e).size===e.length}function NT(t){if(t!==Vf)return t===Wf?Vf:Wf}function NH(t){return t.querySelector(`.${DH}`)}function LH(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 eR(t,e,n){return t===-1&&e>=0&&fs(n)===!1}const x5="ascending",H5="descending",$H="indicatorDisabled",kH="columnSorting",FH="sortAction",WH=new Map([[Wf,x5],[Vf,H5]]);function D5(t,e,n,r){const i=[kH];if(r&&i.push(FH),n===!1)return i.push($H),i;const o=t.getSortOrderOfColumn(e);return ue(o)&&i.push(WH.get(o)),i}function N5(){return Array.from(WH.values()).concat(FH,$H,kH)}function VH(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?Hi:Zt(i)?Zt(o)?Hi:s&&t==="asc"?$t:kt:Zt(o)?s&&t==="asc"?kt:$t:isNaN(i)&&!isNaN(o)?t==="asc"?kt:$t:!isNaN(i)&&isNaN(o)||(isNaN(i)||isNaN(o)||(i=parseFloat(i),o=parseFloat(o)),i<o)?t==="asc"?$t:kt:i>o?t==="asc"?kt:$t:Hi}}const BH="default";function L5(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 Hi;if(a){if(Zt(r))return t==="asc"?$t:kt;if(Zt(i))return t==="asc"?kt:$t}return isNaN(o)?kt:isNaN(s)?$t:o<s?t==="asc"?$t:kt:o>s?t==="asc"?kt:$t:Hi}}const $5="numeric";function k5(t,e,n){const r=e.checkedTemplate,i=e.uncheckedTemplate,{sortEmptyCells:o}=n;return function(s,a){const l=Zt(s),u=Zt(a),c=l?i:s,h=u?i:a,d=c===i||c===r,g=h===i||h===r;if(o===!1){if(l&&u===!1)return kt;if(l===!1&&u)return $t}return d===!1&&g?t==="asc"?$t:kt:d&&g===!1?t==="asc"?kt:$t:d===!1&&g===!1?VH(t,e,n)(s,a):c===i&&h===r?t==="asc"?$t:kt:c===r&&h===i?t==="asc"?kt:$t:Hi}}const F5="checkbox";function W5(t,e,n){return function(r,i){const{sortEmptyCells:o}=n;if(r===i)return Hi;if(Zt(r))return Zt(i)?Hi:o&&t==="asc"?$t:kt;if(Zt(i))return o&&t==="asc"?kt:$t;const s=e.dateFormat,a=X(r,s),l=X(i,s);return a.isValid()?l.isValid()?l.isAfter(a)?t==="asc"?$t:kt:l.isBefore(a)?t==="asc"?kt:$t:Hi:$t:kt}}const V5="date",{register:mp,getItem:LT,hasItem:B5}=ai("sorting.compareFunctionFactory"),{register:UH,getItem:U5}=ai("sorting.mainSortComparator");function YH(t){return B5(t)?LT(t):LT(BH)}mp($5,L5);mp(F5,k5);mp(V5,W5);mp(BH,VH);const Hi=0,$t=-1,kt=1;function Y5(t,e){const n=U5(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))}function G5(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:YH(u.type))(l,u,d)(c,h)}(0)}}function ad(t,e){z5(t,e),e.add(t)}function z5(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ld(t,e,n){return e=j5(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function j5(t){var e=K5(t,"string");return typeof e=="symbol"?e:String(e)}function K5(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function pl(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}const Bf="columnSorting",X5=50,Uf="append",q5="replace",$T=Bf;UH(Bf,G5);de.getSingleton().register("beforeColumnSort");de.getSingleton().register("afterColumnSort");var nf=new WeakSet,kT=new WeakSet,FT=new WeakSet,WT=new WeakSet;class GH extends it{constructor(){super(...arguments),ad(this,WT),ad(this,FT),ad(this,kT),ad(this,nf),ld(this,"columnStatesManager",null),ld(this,"columnMetaCache",null),ld(this,"pluginKey",Bf),ld(this,"indexesSequenceCache",null)}static get PLUGIN_KEY(){return Bf}static get PLUGIN_PRIORITY(){return X5}isEnabled(){return!!this.hot.getSettings()[this.pluginKey]}enablePlugin(){var e=this;this.enabled||(this.columnStatesManager=new O5(this.hot,`${this.pluginKey}.sortingStates`),this.columnMetaCache=new ys(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)=>pl(this,kT,Z5).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 pl(e,WT,J5).call(e,...r)}),this.addHook("afterOnCellMouseDown",(n,r)=>this.onAfterOnCellMouseDown(n,r)),this.addHook("afterInit",()=>pl(this,nf,mS).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 pl(e,FT,Q5).call(e,...r)}),this.hot.view&&pl(this,nf,mS).call(this),this.registerShortcuts(),super.enablePlugin())}disablePlugin(){const e=(n,r)=>{const i=NH(r);LH(n,r)===!1||i===null||this.updateHeaderClasses(i)};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))},!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();e.row===-1&&e.col>=0&&this.sort(this.getColumnNextConfig(e.col))},runOnlyIf:()=>{var e;const n=(e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;return n&&this.hot.selection.isCellVisible(n)&&n.isHeader()},group:$T})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup($T)}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 k1),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(),this.hot.forceFullRender=!1,this.hot.view.render()))}clearSort(){this.sort([])}isSorted(){return this.enabled&&!this.columnStatesManager.isListOfSortedColumnsEmpty()}getSortConfig(e){return ue(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 P5(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=Ue(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 ue(n)&&Array.isArray(n.initialConfig)&&(n.initialConfig=Ue(n.initialConfig,r)),n}getColumnNextConfig(e){const n=this.columnStatesManager.getSortOrderOfColumn(e);if(ue(n)){const i=NT(n);return ue(i)?{column:e,sortOrder:i}:void 0}const r=this.hot.countCols();if(Number.isInteger(e)&&e>=0&&e<r)return{column:e,sortOrder:NT()}}getNextSortConfig(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Uf;const r=this.columnStatesManager.getIndexOfColumnInSortQueue(e),i=r!==-1,o=this.getSortConfig(),s=this.getColumnNextConfig(e);if(i){if(Ct(s))return[...o.slice(0,r),...o.slice(r+1)];if(n===Uf)return[...o.slice(0,r),...o.slice(r+1),s];if(n===q5)return[...o.slice(0,r),s,...o.slice(r+1)]}return ue(s)?o.concat(s):o}getPluginColumnConfig(e){if(Ve(e)){const n=e[this.pluginKey];if(Ve(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])):vt(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(e.length===0){this.hot.rowIndexMapper.setIndexesSequence(this.indexesSequenceCache.getValues());return}const n=[],r=this.hot.countRows(),i=u=>Ue(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=Ue(n,u=>u[0]);Y5(n,this.pluginKey,Ue(e,u=>u.sortOrder),Ue(e,u=>this.getFirstCellSettings(u.column)));for(let u=n.length;u<r;u+=1)n.push([u].concat(i(u)));const s=Ue(n,u=>u[0]),a=new Map(Ue(o,(u,c)=>[u,s[c]])),l=Ue(this.hot.rowIndexMapper.getIndexesSequence(),u=>a.has(u)?a.get(u):u);this.hot.rowIndexMapper.setIndexesSequence(l)}sortBySettings(e){if(Ve(e)){this.columnStatesManager.updateAllColumnsProperties(e);const n=e.initialConfig;(Array.isArray(n)||Ve(n))&&this.sort(n)}else this.hot.render()}updateHeaderClasses(e){if(Le(e,N5()),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];q(e,D5(...r))}}onUpdateSettings(e){super.onUpdateSettings(),this.columnMetaCache!==null&&this.columnMetaCache.init(this.hot.columnIndexMapper.getNumberOfIndexes()),ue(e[this.pluginKey])&&this.sortBySettings(e[this.pluginKey])}wasClickableHeaderClicked(e,n){return this.getFirstCellSettings(n)[this.pluginKey].headerAction&&Ie(e.target,DH)}onAfterOnCellMouseDown(e,n){eR(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.getColumnNextConfig(n.col)))}destroy(){var e;(e=this.columnStatesManager)===null||e===void 0||e.destroy(),super.destroy()}}function mS(){const t=this.getAllSavedSortSettings();if(Ve(t))this.sortBySettings(t);else{const e=this.hot.getSettings()[this.pluginKey];this.sortBySettings(e)}}function Z5(t,e){const n=NH(e);if(LH(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);Ee(e,...IG(s?`${s}ending`:"none"))}}function Q5(t){t===!0&&this.hot.view&&pl(this,nf,mS).call(this)}function J5(t,e,n,r){eR(e.row,e.col,t)!==!1&&this.wasClickableHeaderClicked(t,e.col)&&this.hot.getShortcutManager().isCtrlPressed()&&(r.column=!0)}function Fs(t,e,n){return e=eZ(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function eZ(t){var e=tZ(t,"string");return typeof e=="symbol"?e:String(e)}function tZ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class nZ{constructor(e,n){Fs(this,"plugin",void 0),Fs(this,"hot",void 0),Fs(this,"endpoints",[]),Fs(this,"settings",void 0),Fs(this,"settingsType","array"),Fs(this,"currentEndpoint",null),Fs(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),E(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(`
You must provide a destination row for the Column Summary plugin in order to work properly!
`)),this.assignSetting(i,o,"destinationColumn",new Error(`
You must provide a destination column for the Column Summary plugin in order to work properly!
`)),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();E(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;E(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?E(u,d=>{this.extendEndpointRanges(d,h,i[0],i.length),this.recreatePhysicalRanges(d),this.clearOffsetInformation(d)}):E(u,d=>{this.shiftEndpointCoordinates(d,h)}),s&&this.refreshAllEndpoints()}clearOffsetInformation(e){e.alterRowOffset=void 0,e.alterColumnOffset=void 0}extendEndpointRanges(e,n,r,i){E(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=[];E(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)}),E(i,o=>{let s=[];E(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,E(e.ranges,r=>{E(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=[],E(e,i=>{this.resetEndpointValue(i,n)}),this.hot.setDataAtCell(this.cellsToSetCache,"ColumnSummary.reset"),this.cellsToSetCache=[])}refreshAllEndpoints(){this.cellsToSetCache=[],E(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=[],E(e,(r,i,o)=>{`${r[2]||""}`!=`${r[3]}`&&E(this.getAllEndpoints(),(s,a)=>{this.hot.propToCol(o[i][1])===s.sourceColumn&&n.indexOf(a)===-1&&n.push(a)})}),E(n,r=>{this.refreshEndpoint(this.getEndpoint(r))}),this.hot.setDataAtCell(this.cellsToSetCache,"ColumnSummary.reset"),this.cellsToSetCache=[]}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(){gt("One of the Column Summary plugins' destination points you provided is beyond the table boundaries!")}}const rZ=nZ;function Zw(t){return t==null||isNaN(t)}function Qw(t,e){iZ(t,e),e.add(t)}function iZ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function oZ(t,e,n){return e=sZ(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function sZ(t){var e=aZ(t,"string");return typeof e=="symbol"?e:String(e)}function aZ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Jw(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}const ev="columnSummary",lZ=220;var VT=new WeakSet,BT=new WeakSet,UT=new WeakSet;class uZ extends it{constructor(){super(...arguments),Qw(this,UT),Qw(this,BT),Qw(this,VT),oZ(this,"endpoints",null)}static get PLUGIN_KEY(){return ev}static get PLUGIN_PRIORITY(){return lZ}isEnabled(){return!!this.hot.getSettings()[ev]}enablePlugin(){var e=this;this.enabled||(this.settings=this.hot.getSettings()[ev],this.endpoints=new rZ(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 Jw(e,VT,cZ).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 Jw(e,BT,hZ).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 Jw(e,UT,dZ).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 Ye(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=Zw(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 Ye(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=Zw(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=Zw(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 Ye(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(ht`ColumnSummary plugin: cell at (${e}, ${n}) is not in a\x20
numeric format. Cannot do the calculation.`);return o}}function cZ(){this.endpoints.initEndpoints()}function hZ(t,e){t&&e!=="ColumnSummary.reset"&&e!=="ColumnSummary.set"&&e!=="loadData"&&this.endpoints.refreshChangedEndpoints(t)}function dZ(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 Va(t,e,n){return e=fZ(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function fZ(t){var e=gZ(t,"string");return typeof e=="symbol"?e:String(e)}function gZ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class bl{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){Va(this,"rootDocument",void 0),Va(this,"isRtl",!1),Va(this,"container",null),Va(this,"editor",void 0),Va(this,"editorStyle",void 0),Va(this,"hidden",!0),this.rootDocument=e,this.isRtl=n,this.editor=this.createEditor(),this.editorStyle=this.editor.style,this.hide()}setPosition(e,n){this.editorStyle.left=`${e}px`,this.editorStyle.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:ft(this.getInputElement()),height:Pt(this.getInputElement())}}resetSize(){const e=this.getInputElement();e.style.width="",e.style.height=""}setReadOnlyState(e){const n=this.getInputElement();n.readOnly=e}show(){this.editorStyle.display="block",this.hidden=!1}hide(){this.hidden||(this.editorStyle.display="none"),this.hidden=!0}isVisible(){return this.editorStyle.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 this.rootDocument.activeElement===this.getInputElement()}focus(){this.getInputElement().focus()}createEditor(){const e=this.rootDocument.createElement("div"),n=this.rootDocument.createElement("textarea");return e.style.display="none",this.container=this.rootDocument.createElement("div"),this.container.setAttribute("dir",this.isRtl?"rtl":"ltr"),q(this.container,bl.CLASS_EDITOR_CONTAINER),this.rootDocument.body.appendChild(this.container),q(e,bl.CLASS_EDITOR),q(n,bl.CLASS_INPUT),n.setAttribute("data-hot-input",!0),e.appendChild(n),this.container.appendChild(e),e}getInputElement(){return this.editor.querySelector(`.${bl.CLASS_INPUT}`)}destroy(){const e=this.container?this.container.parentNode:null;this.editor.parentNode.removeChild(this.editor),this.editor=null,this.editorStyle=null,e&&e.removeChild(this.container)}}const mZ=bl;function tv(t,e,n){return e=pZ(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function pZ(t){var e=wZ(t,"string");return typeof e=="symbol"?e:String(e)}function wZ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const vZ=250,CZ=250;class zH{constructor(e){tv(this,"wasLastActionShow",!0),tv(this,"showDebounced",null),tv(this,"hidingTimer",null),this.updateDelay(e)}hide(){this.wasLastActionShow=!1,this.hidingTimer=setTimeout(()=>{this.wasLastActionShow===!1&&this.runLocalHooks("hide")},CZ)}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]:vZ;this.showDebounced=Lg(n=>{this.wasLastActionShow&&this.runLocalHooks("show",n.from.row,n.from.col)},e)}destroy(){this.clearLocalHooks()}}pt(zH,or);const SZ=zH;function yZ(t,e){return t.indexOf(e)!==-1?t:`${t.replace("htTop","").replace("htMiddle","").replace("htBottom","").replace(" ","")} ${e}`}function bZ(t,e){return t.indexOf(e)!==-1?t:`${t.replace("htLeft","").replace("htCenter","").replace("htRight","").replace("htJustify","").replace(" ","")} ${e}`}function Ws(t,e){const n={};return E(t,r=>{r.forAll((i,o)=>{i>=0&&o>=0&&(n[i]||(n[i]=[]),n[i][o]=e(i,o))})}),n}function Yo(t,e,n,r,i){E(t,o=>{o.forAll((s,a)=>{s>=0&&a>=0&&RZ(s,a,e,n,r,i)})})}function RZ(t,e,n,r,i,o){const s=i(t,e);let a=r;s.className&&(n==="vertical"?a=yZ(s.className,r):a=bZ(s.className,r)),o(t,e,"className",a)}function ro(t){return`<span class="selected">${String.fromCharCode(10003)}</span>${t}`}function Mi(t,e){let n=!1;return Array.isArray(t)&&E(t,r=>(r.forAll((i,o)=>{if(i>=0&&o>=0&&e(i,o))return n=!0,!1}),n)),n}function pp(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 ze="---------";function EZ(){return{name:ze}}const _r="alignment";function TZ(){return{key:_r,name(){return this.getTranslatedPhrase(pm)},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:`${_r}:left`,name(){let t=this.getTranslatedPhrase(wm);return Mi(this.getSelectedRange(),(n,r)=>{const i=this.getCellMeta(n,r).className;if(i&&i.indexOf("htLeft")!==-1)return!0})&&(t=ro(t)),t},callback(){const t=this.getSelectedRange(),e=Ws(t,(i,o)=>this.getCellMeta(i,o).className),n="horizontal",r="htLeft";this.runHooks("beforeCellAlignment",e,t,n,r),Yo(t,n,r,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1},{key:`${_r}:center`,name(){let t=this.getTranslatedPhrase(vm);return Mi(this.getSelectedRange(),(n,r)=>{const i=this.getCellMeta(n,r).className;if(i&&i.indexOf("htCenter")!==-1)return!0})&&(t=ro(t)),t},callback(){const t=this.getSelectedRange(),e=Ws(t,(i,o)=>this.getCellMeta(i,o).className),n="horizontal",r="htCenter";this.runHooks("beforeCellAlignment",e,t,n,r),Yo(t,n,r,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1},{key:`${_r}:right`,name(){let t=this.getTranslatedPhrase(Cm);return Mi(this.getSelectedRange(),(n,r)=>{const i=this.getCellMeta(n,r).className;if(i&&i.indexOf("htRight")!==-1)return!0})&&(t=ro(t)),t},callback(){const t=this.getSelectedRange(),e=Ws(t,(i,o)=>this.getCellMeta(i,o).className),n="horizontal",r="htRight";this.runHooks("beforeCellAlignment",e,t,n,r),Yo(t,n,r,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1},{key:`${_r}:justify`,name(){let t=this.getTranslatedPhrase(Sm);return Mi(this.getSelectedRange(),(n,r)=>{const i=this.getCellMeta(n,r).className;if(i&&i.indexOf("htJustify")!==-1)return!0})&&(t=ro(t)),t},callback(){const t=this.getSelectedRange(),e=Ws(t,(i,o)=>this.getCellMeta(i,o).className),n="horizontal",r="htJustify";this.runHooks("beforeCellAlignment",e,t,n,r),Yo(t,n,r,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1},{name:ze},{key:`${_r}:top`,name(){let t=this.getTranslatedPhrase(ym);return Mi(this.getSelectedRange(),(n,r)=>{const i=this.getCellMeta(n,r).className;if(i&&i.indexOf("htTop")!==-1)return!0})&&(t=ro(t)),t},callback(){const t=this.getSelectedRange(),e=Ws(t,(i,o)=>this.getCellMeta(i,o).className),n="vertical",r="htTop";this.runHooks("beforeCellAlignment",e,t,n,r),Yo(t,n,r,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1},{key:`${_r}:middle`,name(){let t=this.getTranslatedPhrase(bm);return Mi(this.getSelectedRange(),(n,r)=>{const i=this.getCellMeta(n,r).className;if(i&&i.indexOf("htMiddle")!==-1)return!0})&&(t=ro(t)),t},callback(){const t=this.getSelectedRange(),e=Ws(t,(i,o)=>this.getCellMeta(i,o).className),n="vertical",r="htMiddle";this.runHooks("beforeCellAlignment",e,t,n,r),Yo(t,n,r,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1},{key:`${_r}:bottom`,name(){let t=this.getTranslatedPhrase(Rm);return Mi(this.getSelectedRange(),(n,r)=>{const i=this.getCellMeta(n,r).className;if(i&&i.indexOf("htBottom")!==-1)return!0})&&(t=ro(t)),t},callback(){const t=this.getSelectedRange(),e=Ws(t,(i,o)=>this.getCellMeta(i,o).className),n="vertical",r="htBottom";this.runHooks("beforeCellAlignment",e,t,n,r),Yo(t,n,r,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1}]}}}const wp="clear_column";function _Z(){return{key:wp,name(){return this.getTranslatedPhrase(nm)},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();return!t||t.isSingleHeader()&&t.highlight.col<0?!0:!this.selection.isSelectedByColumnHeader()}}}const ih="col_left";function MZ(){return{key:ih,name(){return this.getTranslatedPhrase(Xg)},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||t.isSingleHeader()&&t.highlight.col<0?!0:this.selection.isSelectedByCorner()?this.countCols()===0:this.selection.isSelectedByRowHeader()||this.countCols()>=this.getSettings().maxCols},hidden(){return!this.getSettings().allowInsertColumn}}}const oh="col_right";function AZ(){return{key:oh,name(){return this.getTranslatedPhrase(qg)},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||t.isSingleHeader()&&t.highlight.col<0?!0:this.selection.isSelectedByCorner()?!1:this.selection.isSelectedByRowHeader()||this.countCols()>=this.getSettings().maxCols},hidden(){return!this.getSettings().allowInsertColumn}}}const sh="make_read_only";function OZ(){return{key:sh,name(){let t=this.getTranslatedPhrase(tm);return Mi(this.getSelectedRange(),(n,r)=>this.getCellMeta(n,r).readOnly)&&(t=ro(t)),t},callback(){const t=this.getSelectedRange(),e=Mi(t,(n,r)=>this.getCellMeta(n,r).readOnly);E(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 vp="redo";function IZ(){return{key:vp,name(){return this.getTranslatedPhrase(em)},callback(){this.redo()},hidden(){const t=this.getPlugin("undoRedo");return!t||!t.isEnabled()},disabled(){return!this.getPlugin("undoRedo").isRedoAvailable()}}}const ah="remove_col";function PZ(){return{key:ah,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(Qg,e)},callback(){this.alter("remove_col",gq(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 Cp="remove_row";function xZ(){return{key:Cp,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(Zg,e)},callback(){this.alter("remove_row",mq(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 Sp="row_above";function HZ(){return{key:Sp,name(){return this.getTranslatedPhrase(jg)},callback(){const t=this.getSelectedRangeLast().getTopLeftCorner();this.alter("insert_row_above",t.row,1,"ContextMenu.rowAbove")},disabled(){const t=this.getSelectedRangeLast();return!t||t.isSingleHeader()&&t.highlight.row<0?!0:this.selection.isSelectedByCorner()?this.countRows()===0:this.selection.isSelectedByColumnHeader()||this.countRows()>=this.getSettings().maxRows},hidden(){return!this.getSettings().allowInsertRow}}}const yp="row_below";function DZ(){return{key:yp,name(){return this.getTranslatedPhrase(Kg)},callback(){const t=this.getSelectedRangeLast().getBottomRightCorner();this.alter("insert_row_below",t.row,1,"ContextMenu.rowBelow")},disabled(){const t=this.getSelectedRangeLast();return!t||t.isSingleHeader()&&t.highlight.row<0?!0:this.selection.isSelectedByCorner()?!1:this.selection.isSelectedByColumnHeader()||this.countRows()>=this.getSettings().maxRows},hidden(){return!this.getSettings().allowInsertRow}}}const Pc="no_items";function NZ(){return{key:Pc,name(){return this.getTranslatedPhrase(Tb)},disabled:!0,isCommand:!1}}const bp="undo";function LZ(){return{key:bp,name(){return this.getTranslatedPhrase(Jg)},callback(){this.undo()},hidden(){const t=this.getPlugin("undoRedo");return!t||!t.isEnabled()},disabled(){return!this.getPlugin("undoRedo").isUndoAvailable()}}}const $Z=[Sp,yp,ih,oh,wp,Cp,ah,bp,vp,sh,_r,ze,Pc],kZ={[ze]:EZ,[Pc]:NZ,[Sp]:HZ,[yp]:DZ,[ih]:MZ,[oh]:AZ,[wp]:_Z,[Cp]:xZ,[ah]:PZ,[bp]:LZ,[vp]:IZ,[sh]:OZ,[_r]:TZ};function jH(){const t={};return Ye(kZ,(e,n)=>{t[n]=e()}),t}function FZ(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(fm):this.getTranslatedPhrase(dm)},callback(){const e=this.getSelectedRangeLast();this.deselectCell(),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 WZ(t){return{key:"commentsRemove",name(){return this.getTranslatedPhrase(gm)},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 VZ(t){return{key:"commentsReadOnly",name(){const e=this.getTranslatedPhrase(mm);return Mi(this.getSelectedRange(),(r,i)=>t.getCommentMeta(r,i,rf))?ro(e):e},callback(){this.getSelectedRangeLast().forAll((n,r)=>{if(n>=0&&r>=0){const i=!!t.getCommentMeta(n,r,rf);t.updateCommentMeta(n,r,{[rf]:!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 mi(t,e){KH(t,e),e.add(t)}function Vs(t,e,n){KH(t,e),e.set(t,n)}function KH(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function BZ(t,e,n){return e=UZ(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function UZ(t){var e=YZ(t,"string");return typeof e=="symbol"?e:String(e)}function YZ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function pi(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}function co(t,e,n){var r=XH(t,e,"set");return GZ(t,r,n),n}function GZ(t,e,n){if(e.set)e.set.call(t,n);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=n}}function Ze(t,e){var n=XH(t,e,"get");return zZ(t,n)}function XH(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}function zZ(t,e){return e.get?e.get.call(t):e.value}const ac="comments",jZ=60,io="comment",Ku="value",qH="style",rf="readOnly",ud=ac,pS=`plugin:${ac}`;var Rt=new WeakMap,Xr=new WeakMap,Rp=new WeakMap,of=new WeakMap,Yf=new WeakMap,wS=new WeakMap,Gf=new WeakMap,YT=new WeakSet,GT=new WeakSet,zT=new WeakSet,jT=new WeakSet,KT=new WeakSet,XT=new WeakSet,qT=new WeakSet,ZT=new WeakSet,QT=new WeakSet,JT=new WeakSet;class KZ extends it{constructor(){super(...arguments),mi(this,JT),mi(this,QT),mi(this,ZT),mi(this,qT),mi(this,XT),mi(this,KT),mi(this,jT),mi(this,zT),mi(this,GT),mi(this,YT),BZ(this,"range",{}),Vs(this,Rt,{writable:!0,value:null}),Vs(this,Xr,{writable:!0,value:null}),Vs(this,Rp,{writable:!0,value:!1}),Vs(this,of,{writable:!0,value:!1}),Vs(this,Yf,{writable:!0,value:{}}),Vs(this,wS,{writable:!0,value:null}),Vs(this,Gf,{writable:!0,value:""})}static get PLUGIN_KEY(){return ac}static get PLUGIN_PRIORITY(){return jZ}isEnabled(){return!!this.hot.getSettings()[ac]}enablePlugin(){this.enabled||(Ze(this,Rt)||co(this,Rt,new mZ(this.hot.rootDocument,this.hot.isRtl())),Ze(this,Xr)||co(this,Xr,new SZ(this.getDisplayDelaySetting())),this.addHook("afterContextMenuDefaultOptions",e=>this.addToContextMenu(e)),this.addHook("afterRenderer",(e,n,r,i,o,s)=>pi(this,jT,QZ).call(this,e,s)),this.addHook("afterScroll",()=>pi(this,JT,iQ).call(this)),this.addHook("afterBeginEditing",()=>this.hide()),this.addHook("afterDocumentKeyDown",e=>pi(this,QT,rQ).call(this,e)),Ze(this,Xr).addLocalHook("hide",()=>this.hide()),Ze(this,Xr).addLocalHook("show",(e,n)=>this.showAtCell(e,n)),this.registerShortcuts(),this.registerListeners(),super.enablePlugin())}updatePlugin(){Ze(this,Xr).updateDelay(this.getDisplayDelaySetting()),super.updatePlugin()}disablePlugin(){this.unregisterShortcuts(),super.disablePlugin()}registerShortcuts(){const e=this.hot.getShortcutManager(),n=e.getContext("grid"),r=e.addContext(pS);n.addShortcut({keys:[["Control","Alt","M"]],callback:()=>{const i=this.hot.getSelectedRangeLast();co(this,of,!0),this.hot.scrollToFocusedCell(()=>{this.setRange(i),this.show(),this.focusEditor(),e.setActiveContextName(pS),this.hot._registerTimeout(()=>{co(this,of,!1)})})},stopPropagation:!0,runOnlyIf:()=>{var i;return((i=this.hot.getSelectedRangeLast())===null||i===void 0?void 0:i.highlight.isCell())&&!Ze(this,Rt).isVisible()},group:ud}),r.addShortcut({keys:[["Escape"]],callback:()=>{Ze(this,Rt).setValue(Ze(this,Gf)),this.hide(),e.setActiveContextName("grid")},runOnlyIf:()=>{var i;return((i=this.hot.getSelectedRangeLast())===null||i===void 0?void 0:i.highlight.isCell())&&Ze(this,Rt).isVisible()},group:ud}),r.addShortcut({keys:[["Control/Meta","Enter"]],callback:()=>{this.hide(),e.setActiveContextName("grid")},runOnlyIf:()=>{var i;return((i=this.hot.getSelectedRangeLast())===null||i===void 0?void 0:i.highlight.isCell())&&Ze(this,Rt).isVisible()},group:ud})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(ud)}registerListeners(){const{rootDocument:e}=this.hot,n=this.getEditorInputElement();this.eventManager.addEventListener(e,"mouseover",r=>pi(this,GT,qZ).call(this,r)),this.eventManager.addEventListener(e,"mousedown",r=>pi(this,YT,XZ).call(this,r)),this.eventManager.addEventListener(e,"mouseup",()=>pi(this,zT,ZZ).call(this)),this.eventManager.addEventListener(n,"focus",()=>pi(this,XT,eQ).call(this)),this.eventManager.addEventListener(n,"blur",()=>pi(this,KT,JZ).call(this)),this.eventManager.addEventListener(n,"mousedown",r=>pi(this,qT,tQ).call(this,r)),this.eventManager.addEventListener(n,"mouseup",r=>pi(this,ZT,nQ).call(this,r))}setRange(e){this.range=e}clearRange(){this.range={}}targetIsCellWithComment(e){const n=cs(e.target,"TD","TBODY");return!!(n&&Ie(n,"htCommentCell")&&cs(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=Ze(this,Rt).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,{[Ku]: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,io),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,Ku)}getCommentAtCell(e,n){return this.getCommentMeta(e,n,Ku)}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 Ze(this,Xr).cancelHiding(),Ze(this,Rt).setValue((e=i[io]?i[io][Ku]:null)!==null&&e!==void 0?e:""),Ze(this,Rt).show(),this.refreshEditor(!0),!0}showAtCell(e,n){return this.setRange({from:this.hot._createCellCoords(e,n)}),this.show()}hide(){Ze(this,Rt).hide()}refreshEditor(){var e,n;if(!(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1)&&(!this.range.from||!Ze(this,Rt).isVisible()))return;const{rowIndexMapper:i,columnIndexMapper:o}=this.hot,{row:s,col:a}=this.range.from;let l=i.getRenderableFromVisualIndex(s),u=o.getRenderableFromVisualIndex(a);const c=l===null;Ze(this,Rt).setPosition(0,0),l===null&&(l=i.getRenderableFromVisualIndex(i.getNearestNotHiddenIndex(s,-1))),u===null&&(u=o.getRenderableFromVisualIndex(o.getNearestNotHiddenIndex(a,-1)));const h=l===null,d=u===null;l=(e=l)!==null&&e!==void 0?e:0,u=(n=u)!==null&&n!==void 0?n:0;const{rootWindow:g,view:{_wt:p}}=this.hot,{wtTable:v}=p,S=p.getCell({row:l,col:u},!0),y=this.getCommentMeta(s,a,qH);y?Ze(this,Rt).setSize(y.width,y.height):Ze(this,Rt).resetSize();const R=d?0:v.getStretchedColumnWidth(u),T=c&&!h?Pt(S):0,{left:N,top:I,width:F,height:B}=S.getBoundingClientRect(),{width:ee,height:U}=Ze(this,Rt).getSize(),{innerWidth:j,innerHeight:re}=this.hot.rootWindow,ie=this.hot.rootDocument.documentElement;let oe=N+g.scrollX+R,ve=I+g.scrollY+T;this.hot.isRtl()&&(oe-=ee+R),this.hot.isLtr()&&N+F+ee>j?oe=N+g.scrollX-ee-1:this.hot.isRtl()&&oe<-(ie.scrollWidth-ie.clientWidth)&&(oe=N+g.scrollX+R+1),I+U>re&&(ve-=U-B+1),Ze(this,Rt).setPosition(oe,ve),Ze(this,Rt).setReadOnlyState(this.getCommentMeta(s,a,rf))}focusEditor(){Ze(this,Rt).focus()}updateCommentMeta(e,n,r){const i=this.hot.getCellMeta(e,n)[io];let o;i?(o=Tn(i),Xc(o,r)):o=r,this.hot.setCellMeta(e,n,io,o)}getCommentMeta(e,n,r){const i=this.hot.getCellMeta(e,n);if(i[io])return i[io][r]}addToContextMenu(e){e.items.push({name:ze},FZ(this),WZ(this),VZ(this))}getDisplayDelaySetting(){const e=this.hot.getSettings()[ac];if(Ve(e))return e.displayDelay}getEditorInputElement(){return Ze(this,Rt).getInputElement()}destroy(){Ze(this,Rt)&&Ze(this,Rt).destroy(),Ze(this,Xr)&&Ze(this,Xr).destroy(),super.destroy()}}function XZ(t){if(!(!this.hot.view||!this.hot.view._wt)&&!Ze(this,Rp)&&!this.targetIsCommentTextArea(t)){const e=cs(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 qZ(t){const{rootDocument:e}=this.hot;if(!(Ze(this,Rp)||Ze(this,Rt).isFocused()||Ie(t.target,"wtBorder")||Ze(this,wS)===t.target||!Ze(this,Rt)))if(co(this,wS,e.elementFromPoint(t.clientX,t.clientY)),this.targetIsCellWithComment(t)){const n=this.hot._createCellRange(this.hot.getCoords(t.target));Ze(this,Xr).show(n)}else os(t.target,e)&&!this.targetIsCommentTextArea(t)&&Ze(this,Xr).hide()}function ZZ(){co(this,Rp,!1)}function QZ(t,e){e[io]&&e[io][Ku]&&q(t,e.commentedCellClassName)}function JZ(){co(this,Gf,""),this.hot.getShortcutManager().setActiveContextName("grid"),this.setComment()}function eQ(){co(this,Gf,this.getComment()),this.hot.listen(),this.hot.getShortcutManager().setActiveContextName(pS)}function tQ(t){co(this,Yf,{width:ft(t.target),height:Pt(t.target)})}function nQ(t){const e=ft(t.target),n=Pt(t.target);(e!==Ze(this,Yf).width+1||n!==Ze(this,Yf).height+2)&&this.updateCommentMeta(this.range.from.row,this.range.from.col,{[qH]:{width:e,height:n}})}function rQ(t){Ze(this,Rt).isVisible()&&Lr(t)}function iQ(){Ze(this,of)||this.hide()}var e_=gg,oQ=TypeError,sQ=function(t,e){if(!delete t[e])throw new oQ("Cannot delete property "+e_(e)+" of "+e_(t))},aQ=Ss,lQ=pg,uQ=Wc,cQ=jI,hQ=sQ,dQ=KI,fQ=[].unshift(0)!==1,gQ=function(){try{Object.defineProperty([],"length",{writable:!1}).unshift()}catch(t){return t instanceof TypeError}},mQ=fQ||!gQ();aQ({target:"Array",proto:!0,arity:1,forced:mQ},{unshift:function(e){var n=lQ(this),r=uQ(n),i=arguments.length;if(i){dQ(r+i);for(var o=r;o--;){var s=o+i;o in n?n[s]=n[o]:hQ(n,s)}for(var a=0;a<i;a++)n[a]=arguments[a]}return cQ(n,r+i)}});function nv(t,e,n){return e=pQ(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function pQ(t){var e=wQ(t,"string");return typeof e=="symbol"?e:String(e)}function wQ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class ZH{constructor(e){nv(this,"hot",void 0),nv(this,"commands",{}),nv(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=vQ(a,l.submenu.items)),l.disabled===!0||typeof l.disabled=="function"&&l.disabled.call(this.hot)===!0||It(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(":")),E(u,c=>c.apply(this.hot,r))}}function vQ(t,e){let n;return E(e,r=>{const i=r.key?r.key.split(":"):null;if(Array.isArray(i)&&i[1]===t)return n=r,!1}),n}function rv(t,e,n){return e=CQ(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function CQ(t){var e=SQ(t,"string");return typeof e=="symbol"?e:String(e)}function SQ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class QH{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;rv(this,"hot",void 0),rv(this,"predefinedItems",jH()),rv(this,"defaultOrderPattern",void 0),this.hot=e,this.defaultOrderPattern=n}setPredefinedItems(e){const n={};this.defaultOrderPattern.length=0,Ye(e,(r,i)=>{let o="";r.name===ze?(n[ze]=r,o=ze):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 yQ(e,this.defaultOrderPattern,this.predefinedItems)}}function yQ(){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),Ve(i)?Ye(i,(o,s)=>{let a=n[typeof o=="string"?o:s];a||(a=o),Ve(o)?jt(a,o):typeof a=="string"&&(a={name:a}),a.key===void 0&&(a.key=s),r.push(a)}):E(i,(o,s)=>{let a=n[o];!a&&$Z.indexOf(o)>=0||(a||(a={name:o,key:`${s}`}),Ve(o)&&jt(a,o),a.key===void 0&&(a.key=s),r.push(a))}),r}function Do(t,e,n){return e=bQ(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function bQ(t){var e=RQ(t,"string");return typeof e=="symbol"?e:String(e)}function RQ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class EQ{constructor(e,n){Do(this,"top",void 0),Do(this,"topRelative",void 0),Do(this,"left",void 0),Do(this,"leftRelative",void 0),Do(this,"scrollTop",void 0),Do(this,"scrollLeft",void 0),Do(this,"cellHeight",void 0),Do(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 yu(t,e,n){TQ(t,e),e.set(t,n)}function TQ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ke(t,e){var n=JH(t,e,"get");return _Q(t,n)}function _Q(t,e){return e.get?e.get.call(t):e.value}function cd(t,e,n){var r=JH(t,e,"set");return MQ(t,r,n),n}function JH(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}function MQ(t,e,n){if(e.set)e.set.call(t,n);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=n}}var Hn=new WeakMap,No=new WeakMap,dn=new WeakMap,iv=new WeakMap,Ba=new WeakMap;class AQ{constructor(e){yu(this,Hn,{writable:!0,value:void 0}),yu(this,No,{writable:!0,value:void 0}),yu(this,dn,{writable:!0,value:void 0}),yu(this,iv,{writable:!0,value:!1}),yu(this,Ba,{writable:!0,value:{above:0,below:0,left:0,right:0}}),cd(this,iv,e)}setOffset(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return Ke(this,Ba)[e]=n,this}setElement(e){return cd(this,Hn,e),this}setParentElement(e){return cd(this,No,e),this}updatePosition(e){cd(this,dn,new EQ(e,Ke(this,Hn).ownerDocument.defaultView)),Ke(this,iv)?(Ke(this,dn).fitsBelow(Ke(this,Hn))?this.setPositionBelowCursor():Ke(this,dn).fitsAbove(Ke(this,Hn))?this.setPositionAboveCursor():this.setPositionBelowCursor(),this.updateHorizontalPosition()):(this.setPositionBelowCursor(),this.setPositionOnRightOfCursor())}updateHorizontalPosition(){Ke(this,Hn).dir==="rtl"?Ke(this,dn).fitsOnLeft(Ke(this,Hn))?this.setPositionOnLeftOfCursor():this.setPositionOnRightOfCursor():Ke(this,dn).fitsOnRight(Ke(this,Hn))?this.setPositionOnRightOfCursor():this.setPositionOnLeftOfCursor()}setPositionAboveCursor(){let e=Ke(this,Ba).above+Ke(this,dn).top-Ke(this,Hn).offsetHeight;Ke(this,No)&&(e=Ke(this,dn).top+Ke(this,dn).cellHeight-Ke(this,Hn).offsetHeight+3),Ke(this,Hn).style.top=`${e}px`}setPositionBelowCursor(){let e=Ke(this,Ba).below+Ke(this,dn).top+1;Ke(this,No)&&(e=Ke(this,dn).top-1),Ke(this,Hn).style.top=`${e}px`}setPositionOnRightOfCursor(){let e=Ke(this,dn).left;if(Ke(this,No)){const{right:n}=Ke(this,No).getBoundingClientRect();e+=Ke(this,dn).cellWidth+n-(Ke(this,dn).left+Ke(this,dn).cellWidth)}else e+=Ke(this,Ba).right;Ke(this,Hn).style.left=`${e}px`}setPositionOnLeftOfCursor(){let e=Ke(this,Ba).left+Ke(this,dn).left-Ke(this,Hn).offsetWidth;if(Ke(this,No)){const{left:n}=Ke(this,No).getBoundingClientRect();e-=Ke(this,dn).left-n}Ke(this,Hn).style.left=`${e}px`}}function eD(t){let{initialPage:e=-1,size:n=()=>0,onItemSelect:r=()=>{},onClear:i=()=>{}}=t;const o=new Set;let s=ir(e,-1,p()-1);function a(S,y){const R=p()-1;return S<0&&(S=R),S>R&&(S=0),o.has(S)?-1:(o.add(S),r(S,!1)===!1&&(S=a(y===1?++S:--S,y)),S)}function l(S){S>-1&&S<p()&&r(S,!0)!==!1&&(s=S)}function u(){return s}function c(){p()>0&&(o.clear(),s=a(0,1))}function h(){p()>0&&(o.clear(),s=a(p()-1,-1))}function d(){p()>0&&(o.clear(),s=a(++s,1))}function g(){p()>0&&(o.clear(),s=a(--s,-1))}function p(){return Math.max(n(),0)}function v(){o.clear(),s=e,i()}return{setCurrentPage:l,getCurrentPage:u,toFirstItem:c,toLastItem:h,toNextItem:d,toPreviousItem:g,getSize:p,clear:v}}function OQ(t){return Ue(t,e=>({start:e.getTopStartCorner(),end:e.getBottomEndCorner()}))}function vS(t){return It(t,"submenu")}function CS(t){return new RegExp(ze,"i").test(t.name)}function sf(t,e){return t.disabled===!0||typeof t.disabled=="function"&&t.disabled.call(e)===!0}function t_(t){return It(t,"disableSelection")}function IQ(t){return Ie(t,"htSeparator")}function PQ(t){return Ie(t,"htSubmenu")}function xQ(t){return Ie(t,"htDisabled")}function HQ(t){return Ie(t,"htSelectionDisabled")}function DQ(t,e){return!t.hidden||!(typeof t.hidden=="function"&&t.hidden.call(e))}function tD(t,e){const n=t.slice(0);for(let r=0;r<n.length&&n[r].name===e;)n.shift();return n}function NQ(t,e){let n=t.slice(0);return n.reverse(),n=tD(n,e),n.reverse(),n}function LQ(t){const e=[];return E(t,(n,r)=>{r>0?e[e.length-1].name!==n.name&&e.push(n):e.push(n)}),e}function $Q(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ze,n=t.slice(0);return n=tD(n,e),n=NQ(n,e),n=LQ(n),n}function kQ(t){return eD({size:()=>t.countRows(),onItemSelect(e,n){const r=t.getCell(e,0);if(!r||IQ(r)||xQ(r)||HQ(r))return!1;t.selectCell(e,0,...n?[e,0,!1,!1]:[])},onClear(){t.deselectCell()}})}function FQ(t){return[{keys:[["Tab"],["Shift","Tab"],["Control/Meta","A"]],forwardToContext:t.hot.getShortcutManager().getContext("grid"),callback:()=>t.close(!0)},{keys:[["Escape"]],callback:()=>t.close()},{keys:[["ArrowDown"]],callback:()=>t.getNavigator().toNextItem()},{keys:[["ArrowUp"]],callback:()=>t.getNavigator().toPreviousItem()},{keys:[["ArrowRight"]],callback:()=>{const e=t.hotMenu.getSelectedLast();if(e){const n=t.openSubMenu(e[0]);n&&n.getNavigator().toFirstItem()}}},{keys:[["ArrowLeft"]],callback:()=>{t.hotMenu.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:e=>{const n=t.hotMenu.getSelectedLast();n&&(t.hotMenu.getSourceDataAtRow(n[0]).submenu?t.openSubMenu(n[0]).getNavigator().toFirstItem():(t.executeCommand(e),t.close(!0)))}},{keys:[["PageUp"]],callback:()=>{t.hotMenu.getSelectedLast()?t.hotMenu.selection.transformStart(-t.hotMenu.countVisibleRows(),0):t.getNavigator().toFirstItem()}},{keys:[["PageDown"]],callback:()=>{t.hotMenu.getSelectedLast()?t.hotMenu.selection.transformStart(t.hotMenu.countVisibleRows(),0):t.getNavigator().toLastItem()}}]}const nD="menu",n_=nD;function WQ(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const n=[];r(FQ(t)),e.forEach(u=>{let{shortcuts:c,contextName:h}=u;i(c,h)});function r(u,c){a(c).addShortcuts(u,{group:nD})}function i(u,c){const h=a(c);u.forEach(d=>{let{keys:g}=d;g.forEach(p=>h.removeShortcutsByKeys(p))}),n.push({shortcuts:u,contextName:c}),r(u,c)}function o(){return[...n]}function s(u){return u?`${n_}:${u}`:n_}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 VQ(t){return(e,n,r,i,o,s)=>{if(n.hasAttribute("ghost-table"))return;const a=e.getSourceDataAtRow(r),l=t.rootDocument.createElement("div"),u=typeof s=="function"?s.call(t):s;if(oi(n),q(l,"htItemWrapper"),t.getSettings().ariaTags){const c=!sf(a,t)&&!t_(a)&&!CS(a);Ee(n,[yG(),Oy(u),...c?[Vl(-1)]:[],...sf(a,t)?[AG()]:[],...vS(a)?[Ir(!1)]:[]])}n.className="",n.appendChild(l),CS(a)?q(n,"htSeparator"):typeof a.renderer=="function"?(q(n,"htCustomMenuRenderer"),n.appendChild(a.renderer(e,l,r,i,o,u))):Sa(l,u),sf(a,t)?q(n,"htDisabled"):t_(a)?q(n,"htSelectionDisabled"):vS(a)&&q(n,"htSubmenu")}}function r_(t,e,n){BQ(t,e),e.set(t,n)}function BQ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function wi(t,e,n){return e=UQ(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function UQ(t){var e=YQ(t,"string");return typeof e=="symbol"?e:String(e)}function YQ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function i_(t,e,n){var r=rD(t,e,"set");return GQ(t,r,n),n}function GQ(t,e,n){if(e.set)e.set.call(t,n);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=n}}function bu(t,e){var n=rD(t,e,"get");return zQ(t,n)}function rD(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}function zQ(t,e){return e.get?e.get.call(t):e.value}const o_=215;var Ru=new WeakMap,hd=new WeakMap;class jl{constructor(e,n){var r=this;wi(this,"hot",void 0),wi(this,"options",void 0),wi(this,"eventManager",new xr(this)),wi(this,"container",void 0),wi(this,"positioner",void 0),wi(this,"hotMenu",null),wi(this,"hotSubMenus",{}),wi(this,"parentMenu",void 0),wi(this,"menuItems",null),wi(this,"origOutsideClickDeselects",null),r_(this,Ru,{writable:!0,value:void 0}),r_(this,hd,{writable:!0,value:void 0}),this.hot=e,this.options=n||{parent:null,name:null,className:"",keepInViewport:!0,standalone:!1,minWidth:o_,container:this.hot.rootDocument.documentElement},this.container=this.createContainer(this.options.name),this.positioner=new AQ(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)})}registerEvents(){let e=this.hot.rootWindow;for(;e;)this.eventManager.addEventListener(e.document,"mousedown",n=>this.onDocumentMouseDown(n)),this.eventManager.addEventListener(e.document,"contextmenu",n=>this.onDocumentContextMenu(n)),e=Ec(e)}setMenuItems(e){this.menuItems=e}getNavigator(){return bu(this,Ru)}getKeyboardShortcutsCtrl(){return bu(this,hd)}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=Lg(a=>this.openSubMenu(a),300),n=this.options.minWidth||o_;let r=!1,i=pr(this.menuItems,a=>(a.key===Pc&&(r=!0),DQ(a,this.hot)));if(i.length<1&&!r)i.push(jH()[Pc]);else if(i.length===0)return;i=$Q(i,ze);let o=!1;const s={data:i,colHeaders:!1,autoColumnSize:!0,autoWrapRow:!1,modifyColWidth(a){return ue(a)&&a<n?n:a},autoRowSize:!1,readOnly:!0,editor:!1,copyPaste:!1,hiddenRows:!0,maxCols:1,columns:[{data:"name",renderer:VQ(this.hot)}],renderAllRows:!0,fragmentSelection:!1,outsideClickDeselects:!1,disableVisualSelection:"area",layoutDirection:this.hot.isRtl()?"rtl":"ltr",ariaTags:!1,beforeOnCellMouseOver:(a,l)=>{bu(this,Ru).setCurrentPage(l.row)},afterOnCellMouseOver:(a,l)=>{this.isAllSubMenusClosed()?e(l.row):this.openSubMenu(l.row)},rowHeights:a=>i[a].name===ze?1:23,afterOnCellContextMenu:a=>{a.preventDefault(),YC()&&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=>{(!YC()||!fs(a))&&o&&this.hasSelectedItem()&&(uo()||Gy()?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(),i_(this,Ru,kQ(this.hotMenu)),i_(this,hd,WQ(this)),bu(this,hd).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(bu(this,Ru).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);Ee(r,[Ir(!1)])}}this.parentMenu.hotMenu.listen()}}}openSubMenu(e){if(!this.hotMenu)return!1;const n=this.hotMenu.getCell(e,0);if(this.closeAllSubMenus(),!n||!PQ(n))return!1;const r=this.hotMenu.getSourceDataAtRow(e),i=new jl(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&&Ee(n,[Ir(!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&&Ee(i,[Ir(!1)])}}closeAllSubMenus(){E(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?OQ(r):[];this.runLocalHooks("executeCommand",n.key,i,e),this.isSubMenu()&&this.parentMenu.runLocalHooks("executeCommand",n.key,i,e)}isCommandPassive(e){return e.isCommand===!1||CS(e)||sf(e,this.hot)||vS(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)}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&&(vt(r)&&(r=r.call(this.hot),r===null||Ct(r)?r="":r=r.toString()),r=r.replace(/[^A-z0-9]/g,"_"),r=`${this.options.className}Sub_${r}`,i=n.querySelector(`.${this.options.className}.${r}`)),i||(i=n.createElement("div"),q(i,`htMenu ${this.options.className}`),r&&q(i,r),this.options.container.appendChild(i)),i}onAfterInit(){const{wtTable:e}=this.hotMenu.view._wt,n=this.hotMenu.getSettings().data,r=e.hider.style,i=e.holder.style,o=parseInt(r.width,10),s=Yt(n,(a,l)=>a+(l.name===ze?1:26),0);i.width=`${o+3}px`,i.height=`${s+3}px`,r.height=i.height,this.hot.getSettings().ariaTags&&Ee(this.hotMenu.rootElement,[SG(),Vl(-1)])}onDocumentMouseDown(e){this.isOpened()&&(this.options.standalone&&this.hotMenu&&!os(e.target,this.hotMenu.rootElement)?this.close(!0):(this.isAllSubMenusClosed()||this.isSubMenu())&&!os(e.target,".htMenu")&&this.close(!0))}onDocumentContextMenu(e){this.isOpened()&&Ie(e.target,"htCore")&&os(e.target,this.hotMenu.rootElement)&&e.preventDefault()}}pt(jl,or);function dd(t,e){jQ(t,e),e.add(t)}function jQ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ov(t,e,n){return e=KQ(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function KQ(t){var e=XQ(t,"string");return typeof e=="symbol"?e:String(e)}function XQ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function fd(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}const Xu="contextMenu",qQ=70,s_=Xu;de.getSingleton().register("afterContextMenuDefaultOptions");de.getSingleton().register("beforeContextMenuShow");de.getSingleton().register("afterContextMenuShow");de.getSingleton().register("afterContextMenuHide");de.getSingleton().register("afterContextMenuExecute");var a_=new WeakSet,l_=new WeakSet,u_=new WeakSet,c_=new WeakSet;class Ep extends it{constructor(){super(...arguments),dd(this,c_),dd(this,u_),dd(this,l_),dd(this,a_),ov(this,"commandExecutor",new ZH(this.hot)),ov(this,"itemsFactory",null),ov(this,"menu",null)}static get PLUGIN_KEY(){return Xu}static get PLUGIN_PRIORITY(){return qQ}static get PLUGIN_DEPS(){return["plugin:AutoColumnSize"]}static get DEFAULT_ITEMS(){return[Sp,yp,ze,ih,oh,ze,Cp,ah,ze,bp,vp,ze,sh,ze,_r]}isEnabled(){return!!this.hot.getSettings()[Xu]}enablePlugin(){var e=this;if(this.enabled)return;const n=this.hot.getSettings()[Xu];typeof n.callback=="function"&&this.commandExecutor.setCommonCallback(n.callback),this.menu=new jl(this.hot,{className:"htContextMenu",keepInViewport:!0,container:n.uiContainer||this.hot.rootDocument.body}),this.menu.addLocalHook("beforeOpen",()=>fd(this,l_,QQ).call(this)),this.menu.addLocalHook("afterOpen",()=>fd(this,u_,JQ).call(this)),this.menu.addLocalHook("afterClose",()=>fd(this,c_,eJ).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=>fd(this,a_,ZQ).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=pp(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:s_})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(s_)}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.prepareMenuItems(),this.menu.open(),Ye(r,(i,o)=>{this.menu.setOffset(o,i)}),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 QH(this.hot,Ep.DEFAULT_ITEMS);const e=this.hot.getSettings()[Xu],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),E(r,i=>this.commandExecutor.registerCommand(i.key,i))}destroy(){this.close(),this.menu&&this.menu.destroy(),super.destroy()}}function ZQ(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(),Ie(o,"handsontableInput")||(t.preventDefault(),t.stopPropagation(),!(n||r)&&!i(o)&&!(Ie(o,"current")&&Ie(o,"wtBorder"))))return;const s=pp(this.menu.container,this.hot.rootDocument);this.open({top:t.clientY+s.top,left:t.clientX+s.left})}function QQ(){this.hot.runHooks("beforeContextMenuShow",this)}function JQ(){this.hot.runHooks("afterContextMenuShow",this)}function eJ(){this.hot.listen(),this.hot.runHooks("afterContextMenuHide",this)}Ep.SEPARATOR={name:ze};function tJ(t){return{key:"copy",name(){return this.getTranslatedPhrase(rm)},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 nJ(t){return{key:"copy_column_headers_only",name(){const e=this.getSelectedRangeLast(),n=e?ir(e.getWidth()-1,0,1):0;return this.getTranslatedPhrase(sm,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 rJ(t){return{key:"copy_with_column_group_headers",name(){const e=this.getSelectedRangeLast(),n=e?ir(e.getWidth()-1,0,1):0;return this.getTranslatedPhrase(om,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 iJ(t){return{key:"copy_with_column_headers",name(){const e=this.getSelectedRangeLast(),n=e?ir(e.getWidth()-1,0,1):0;return this.getTranslatedPhrase(im,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 oJ(t){return{key:"cut",name(){return this.getTranslatedPhrase(am)},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 sJ{constructor(){this.data={}}setData(e,n){this.data[e]=n}getData(e){return this.data[e]||void 0}}class aJ{constructor(){this.clipboardData=new sJ}}function h_(t,e){iD(t,e),e.add(t)}function Ua(t,e,n){iD(t,e),e.set(t,n)}function iD(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function gd(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}function Ln(t,e){var n=oD(t,e,"get");return lJ(t,n)}function lJ(t,e){return e.get?e.get.call(t):e.value}function Ya(t,e,n){var r=oD(t,e,"set");return uJ(t,r,n),n}function oD(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}function uJ(t,e,n){if(e.set)e.set.call(t,n);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=n}}var Lo=new WeakMap,sv=new WeakMap,Eu=new WeakMap,SS=new WeakMap,yS=new WeakMap,Tu=new WeakMap,md=new WeakSet,d_=new WeakSet;class cJ{constructor(e){let{countRows:n,countColumns:r,rowsLimit:i,columnsLimit:o,countColumnHeaders:s}=e;h_(this,d_),h_(this,md),Ua(this,Lo,{writable:!0,value:void 0}),Ua(this,sv,{writable:!0,value:void 0}),Ua(this,Eu,{writable:!0,value:void 0}),Ua(this,SS,{writable:!0,value:void 0}),Ua(this,yS,{writable:!0,value:void 0}),Ua(this,Tu,{writable:!0,value:void 0}),Ya(this,sv,n),Ya(this,Eu,r),Ya(this,SS,i),Ya(this,yS,o),Ya(this,Tu,s)}setSelectedRange(e){Ya(this,Lo,e)}getCellsRange(){if(Ln(this,sv).call(this)===0||Ln(this,Eu).call(this)===0)return null;const{row:e,col:n}=Ln(this,Lo).getTopStartCorner(),{row:r,col:i}=Ln(this,Lo).getBottomEndCorner(),o=gd(this,d_,hJ).call(this,e,r),s=gd(this,md,av).call(this,n,i);return{isRangeTrimmed:r!==o||i!==s,startRow:e,startCol:n,endRow:o,endCol:s}}getMostBottomColumnHeadersRange(){if(Ln(this,Eu).call(this)===0||Ln(this,Tu).call(this)===0)return null;const{col:e}=Ln(this,Lo).getTopStartCorner(),{col:n}=Ln(this,Lo).getBottomEndCorner(),r=gd(this,md,av).call(this,e,n);return{isRangeTrimmed:n!==r,startRow:-1,startCol:e,endRow:-1,endCol:r}}getAllColumnHeadersRange(){if(Ln(this,Eu).call(this)===0||Ln(this,Tu).call(this)===0)return null;const{col:e}=Ln(this,Lo).getTopStartCorner(),{col:n}=Ln(this,Lo).getBottomEndCorner(),r=gd(this,md,av).call(this,e,n);return{isRangeTrimmed:n!==r,startRow:-Ln(this,Tu).call(this),startCol:e,endRow:-1,endCol:r}}}function av(t,e){return Math.min(e,Math.max(t+Ln(this,yS).call(this)-1,t))}function hJ(t,e){return Math.min(e,Math.max(t+Ln(this,SS).call(this)-1,t))}function sD(t){const e=[],n=[];return E(t,r=>{const i=Math.min(r.startRow,r.endRow),o=Math.max(r.startRow,r.endRow);me(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);me(s,a,l=>{n.indexOf(l)===-1&&n.push(l)})}),{rows:e,columns:n}}function vi(t,e){aD(t,e),e.add(t)}function $o(t,e,n){aD(t,e),e.set(t,n)}function aD(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _u(t,e,n){return e=dJ(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function dJ(t){var e=fJ(t,"string");return typeof e=="symbol"?e:String(e)}function fJ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function tr(t,e){var n=lD(t,e,"get");return gJ(t,n)}function gJ(t,e){return e.get?e.get.call(t):e.value}function Rr(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}function Kr(t,e,n){var r=lD(t,e,"set");return mJ(t,r,n),n}function lD(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}function mJ(t,e,n){if(e.set)e.set.call(t,n);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=n}}de.getSingleton().register("afterCopyLimit");de.getSingleton().register("modifyCopyableRange");de.getSingleton().register("beforeCut");de.getSingleton().register("afterCut");de.getSingleton().register("beforePaste");de.getSingleton().register("afterPaste");de.getSingleton().register("beforeCopy");de.getSingleton().register("afterCopy");const pd="copyPaste",pJ=80,wJ=["fragmentSelection"],f_=['<meta name="generator" content="Handsontable"/>','<style type="text/css">td{white-space:normal}br{mso-data-placement:same-cell}</style>'].join("");var bS=new WeakMap,RS=new WeakMap,ES=new WeakMap,Ga=new WeakMap,wd=new WeakMap,vd=new WeakMap,za=new WeakMap,zf=new WeakMap,lv=new WeakSet,g_=new WeakSet,uD=new WeakSet,tR=new WeakSet,m_=new WeakSet,p_=new WeakSet,w_=new WeakSet,v_=new WeakSet,C_=new WeakSet,S_=new WeakSet;class vJ extends it{constructor(){super(...arguments),vi(this,S_),vi(this,C_),vi(this,v_),vi(this,w_),vi(this,p_),vi(this,m_),vi(this,tR),vi(this,uD),vi(this,g_),vi(this,lv),_u(this,"columnsLimit",1/0),_u(this,"rowsLimit",1/0),_u(this,"pasteMode","overwrite"),_u(this,"uiContainer",this.hot.rootDocument.body),$o(this,bS,{writable:!0,value:!1}),$o(this,RS,{writable:!0,value:!1}),$o(this,ES,{writable:!0,value:!1}),$o(this,Ga,{writable:!0,value:"cells-only"}),$o(this,wd,{writable:!0,value:!1}),$o(this,vd,{writable:!0,value:!1}),$o(this,za,{writable:!0,value:new cJ({countRows:()=>this.hot.countRows(),countColumns:()=>this.hot.countCols(),rowsLimit:()=>this.rowsLimit,columnsLimit:()=>this.columnsLimit,countColumnHeaders:()=>this.hot.view.getColumnHeadersCount()})}),$o(this,zf,{writable:!0,value:!1}),_u(this,"copyableRanges",[])}static get PLUGIN_KEY(){return pd}static get SETTING_KEYS(){return[pd,...wJ]}static get PLUGIN_PRIORITY(){return pJ}isEnabled(){return!!this.hot.getSettings()[pd]}enablePlugin(){var e=this;if(this.enabled)return;const{[pd]:n}=this.hot.getSettings();if(typeof n=="object"){var r,i;this.pasteMode=(r=n.pasteMode)!==null&&r!==void 0?r:this.pasteMode,this.rowsLimit=isNaN(n.rowsLimit)?this.rowsLimit:n.rowsLimit,this.columnsLimit=isNaN(n.columnsLimit)?this.columnsLimit:n.columnsLimit,Kr(this,bS,!!n.copyColumnHeaders),Kr(this,RS,!!n.copyColumnGroupHeaders),Kr(this,ES,!!n.copyColumnHeadersOnly),this.uiContainer=(i=n.uiContainer)!==null&&i!==void 0?i:this.uiContainer}this.addHook("afterContextMenuDefaultOptions",o=>Rr(this,m_,yJ).call(this,o)),this.addHook("afterSelection",function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return Rr(e,p_,bJ).call(e,...s)}),this.addHook("afterSelectionEnd",()=>Rr(this,w_,RJ).call(this)),this.eventManager.addEventListener(this.hot.rootDocument,"copy",function(){return e.onCopy(...arguments)}),this.eventManager.addEventListener(this.hot.rootDocument,"cut",function(){return e.onCut(...arguments)}),this.eventManager.addEventListener(this.hot.rootDocument,"paste",function(){return e.onPaste(...arguments)}),Uy()&&(this.eventManager.addEventListener(this.hot.rootDocument.body,"mouseenter",function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return Rr(e,v_,EJ).call(e,...s)}),this.eventManager.addEventListener(this.hot.rootDocument.body,"mouseleave",function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return Rr(e,C_,TJ).call(e,...s)}),this.addHook("afterSelection",()=>Rr(this,S_,_J).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";Kr(this,Ga,e),Kr(this,wd,!0),Rr(this,lv,y_).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(){Kr(this,vd,!0),Rr(this,lv,y_).call(this,"cut")}getRangedCopyableData(e){return ic(this.getRangedData(e))}getRangedData(e){const n=[],{rows:r,columns:i}=sD(e);return E(r,o=>{const s=[];E(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 aJ;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}tr(this,za).setSelectedRange(e);const n=new Map([["headers",null],["cells",null]]);tr(this,Ga)==="column-headers-only"?n.set("headers",tr(this,za).getMostBottomColumnHeadersRange()):(tr(this,Ga)==="with-column-headers"?n.set("headers",tr(this,za).getMostBottomColumnHeadersRange()):tr(this,Ga)==="with-column-group-headers"&&n.set("headers",tr(this,za).getAllColumnHeadersRange()),n.set("cells",tr(this,za).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,g=a;for(;o.length<r||c<=l;){const{skipRowOnPaste:p,visualRow:v}=this.hot.getCellMeta(c,a);if(c=v+1,p===!0)continue;d=v,h=a;const S=[],y=o.length%r;for(;S.length<i||h<=u;){const{skipColumnOnPaste:R,visualCol:T}=this.hot.getCellMeta(s,h);if(h=T+1,R===!0)continue;g=T;const N=S.length%i;S.push(e[y][N])}o.push(S)}return Kr(this,zf,!0),this.hot.populateFromArray(s,a,o,void 0,void 0,"CopyPaste.paste",this.pasteMode),[s,a,d,g]}onCopy(e){if(!this.hot.isListening()&&!tr(this,wd)||this.isEditorOpened())return;this.setCopyableText(),Kr(this,wd,!1);const n=this.getRangedData(this.copyableRanges),r=Rr(this,g_,CJ).call(this,this.copyableRanges);if(!!this.hot.runHooks("beforeCopy",n,this.copyableRanges,r)){const o=ic(n);if(e&&e.clipboardData){const s=KC(n,this.hot.rootDocument);e.clipboardData.setData("text/plain",o),e.clipboardData.setData("text/html",[f_,s].join(""))}else typeof ClipboardEvent>"u"&&this.hot.rootWindow.clipboardData.setData("Text",o);this.hot.runHooks("afterCopy",n,this.copyableRanges,r)}Kr(this,Ga,"cells-only"),e.preventDefault()}onCut(e){if(!this.hot.isListening()&&!tr(this,vd)||this.isEditorOpened())return;this.setCopyableText(),Kr(this,vd,!1);const n=this.getRangedData(this.copyableRanges);if(!!this.hot.runHooks("beforeCut",n,this.copyableRanges)){const i=ic(n);if(e&&e.clipboardData){const o=KC(n,this.hot.rootDocument);e.clipboardData.setData("text/plain",i),e.clipboardData.setData("text/html",[f_,o].join(""))}else typeof ClipboardEvent>"u"&&this.hot.rootWindow.clipboardData.setData("Text",i);this.hot.emptySelectedCells("CopyPaste.cut"),this.hot.runHooks("afterCut",n,this.copyableRanges)}e.preventDefault()}onPaste(e){if(!this.hot.isListening()||this.isEditorOpened()||!this.hot.getSelected())return;e&&e.preventDefault&&e.preventDefault();let n;if(e&&typeof e.clipboardData<"u"){const a=Ig(e.clipboardData.getData("text/html"),{ADD_TAGS:["meta"],ADD_ATTR:["content"],FORCE_BODY:!0});a&&/(<table)|(<TABLE)/g.test(a)?n=qx(a,this.hot.rootDocument).data:n=e.clipboardData.getData("text/plain")}else typeof ClipboardEvent>"u"&&typeof this.hot.rootWindow.clipboardData<"u"&&(n=this.hot.rootWindow.clipboardData.getData("Text"));if(typeof n=="string"&&(n=Eq(n)),n===void 0||n&&n.length===0||this.hot.runHooks("beforePaste",n,this.copyableRanges)===!1)return;const[r,i,o,s]=this.populateValues(n);this.hot.selectCell(r,i,Math.min(this.hot.countRows()-1,o),Math.min(this.hot.countCols()-1,s)),this.hot.runHooks("afterPaste",n,this.copyableRanges)}destroy(){super.destroy()}}function y_(t){if(Uy()){const e=this.hot.getSelectedRangeLast();if(e){const{row:n,col:r}=e.highlight,i=this.hot.getCell(n,r,!0);i&&Tx(i,()=>{this.hot.rootDocument.execCommand(t)})}}else this.hot.rootDocument.execCommand(t)}function CJ(t){const{rows:e}=sD(t);let n=0;for(let r=0;r<e.length&&!(e[r]>=0);r++)n+=1;return{columnHeadersCount:n}}function SJ(){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&&ky(r)}}}function cD(){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")&&Fy(r)}}}function yJ(t){t.items.push({name:"---------"},tJ(this)),tr(this,bS)&&t.items.push(iJ(this)),tr(this,RS)&&t.items.push(rJ(this)),tr(this,ES)&&t.items.push(nJ(this)),t.items.push(oJ(this))}function bJ(t,e,n,r,i){tr(this,zf)&&(i.value=!0),Kr(this,zf,!1)}function RJ(){this.isEditorOpened()||this.hot.getSettings().fragmentSelection||this.setCopyableText()}function EJ(){Rr(this,tR,cD).call(this)}function TJ(){Rr(this,uD,SJ).call(this)}function _J(){Rr(this,tR,cD).call(this)}function hD(t,e){return`border_row${t}col${e}`}function qu(){return{width:1,color:"#000"}}function ho(){return{hide:!0}}function MJ(){return{width:1,color:"#000",cornerVisible:!1}}function uv(t){if(ue(t.start)||ue(t.left)){var e;t.start=(e=t.start)!==null&&e!==void 0?e:t.left}if(ue(t.end)||ue(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 Mu(t){return ue(t.start)&&(t.left=t.start),ue(t.end)&&(t.right=t.end),t}function cv(t,e){return{id:hD(t,e),border:MJ(),row:t,col:e,top:ho(),bottom:ho(),start:ho(),end:ho()}}function AJ(t,e){return It(e,"border")&&e.border&&(t.border=e.border),It(e,"top")&&ue(e.top)&&(e.top?(Ve(e.top)||(e.top=qu()),t.top=e.top):(e.top=ho(),t.top=e.top)),It(e,"bottom")&&ue(e.bottom)&&(e.bottom?(Ve(e.bottom)||(e.bottom=qu()),t.bottom=e.bottom):(e.bottom=ho(),t.bottom=e.bottom)),It(e,"start")&&ue(e.start)&&(e.start?(Ve(e.start)||(e.start=qu()),t.start=e.start):(e.start=ho(),t.start=e.start)),It(e,"end")&&ue(e.end)&&(e.end?(Ve(e.end)||(e.end=qu()),t.end=e.end):(e.end=ho(),t.end=e.end)),t}function Co(t,e){let n=!1;return E(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(!It(s[e],"hide")||s[e].hide===!1)return n=!0,!1}else return n=!0,!1})}),n}function Tp(t){return`<span class="selected">${String.fromCharCode(10003)}</span>${t}`}function OJ(t){return t.some(e=>ue(e.left)||ue(e.right))}function IJ(t){return t.some(e=>ue(e.start)||ue(e.end))}const PJ=new Map([["left","start"],["right","end"]]);function xJ(t){var e;return(e=PJ.get(t))!==null&&e!==void 0?e:t}function HJ(t){return{key:"borders:bottom",name(){let e=this.getTranslatedPhrase(Mm);return Co(this,"bottom")&&(e=Tp(e)),e},callback(e,n){const r=Co(this,"bottom");t.prepareBorder(n,"bottom",r)}}}function DJ(t){const e=t.hot.isRtl()?"end":"start";return{key:"borders:left",name(){let n=this.getTranslatedPhrase(Am);return Co(this,e)&&(n=Tp(n)),n},callback(n,r){const i=Co(this,e);t.prepareBorder(r,e,i)}}}function NJ(t){return{key:"borders:no_borders",name(){return this.getTranslatedPhrase(Om)},callback(e,n){t.prepareBorder(n,"noBorders")},disabled(){return!Co(this)}}}function LJ(t){const e=t.hot.isRtl()?"start":"end";return{key:"borders:right",name(){let n=this.getTranslatedPhrase(_m);return Co(this,e)&&(n=Tp(n)),n},callback(n,r){const i=Co(this,e);t.prepareBorder(r,e,i)}}}function $J(t){return{key:"borders:top",name(){let e=this.getTranslatedPhrase(Tm);return Co(this,"top")&&(e=Tp(e)),e},callback(e,n){const r=Co(this,"top");t.prepareBorder(n,"top",r)}}}function b_(t,e){kJ(t,e),e.add(t)}function kJ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function FJ(t,e,n){return e=WJ(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function WJ(t){var e=VJ(t,"string");return typeof e=="symbol"?e:String(e)}function VJ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function R_(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}const af="customBorders",BJ=90;var E_=new WeakSet,T_=new WeakSet;class UJ extends it{constructor(){super(...arguments),b_(this,T_),b_(this,E_),FJ(this,"savedBorders",[])}static get PLUGIN_KEY(){return af}static get PLUGIN_PRIORITY(){return BJ}isEnabled(){return!!this.hot.getSettings()[af]}enablePlugin(){this.enabled||(this.addHook("afterContextMenuDefaultOptions",e=>R_(this,E_,YJ).call(this,e)),this.addHook("init",()=>R_(this,T_,GJ).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=uv(n));const o=Dl(e),s=Ic(o,{createCellCoords:this.hot._createCellCoords.bind(this.hot),createCellRange:this.hot._createCellRange.bind(this.hot)});E(e,a=>{s(a).forAll((l,u)=>{E(r,c=>{this.prepareBorderFromCustomAdded(l,u,i,xJ(c))})})}),this.hot.view.render()}getBorders(e){if(!Array.isArray(e))return this.savedBorders;const n=Dl(e),r=Ic(n,{createCellCoords:this.hot._createCellCoords.bind(this.hot),createCellRange:this.hot._createCellRange.bind(this.hot)}),i=[];return E(e,o=>{r(o).forAll((s,a)=>{E(this.savedBorders,l=>{l.row===s&&l.col===a&&i.push(Mu(l))})})}),i}clearBorders(e){e?this.setBorders(e):(E(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=cv(e,n);r&&(a=AJ(a,r),E(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",Mu(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);me(e.from.row,r,o=>{me(e.from.col,i,s=>{const a=cv(o,s);let l=0;o===e.from.row&&It(n,"top")&&(l+=1,a.top=n.top),o===e.to.row&&It(n,"bottom")&&(l+=1,a.bottom=n.bottom),s===e.from.col&&It(n,"start")&&(l+=1,a.start=n.start),s===e.to.col&&It(n,"end")&&(l+=1,a.end=n.end),l>0&&(this.hot.setCellMeta(o,s,"borders",Mu(a)),this.insertBorderIntoSettings(a))})})}removeAllBorders(e,n){const r=hD(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=cv(e,n):o=uv(o),i?(o[r]=ho(),this.countHide(o)===4?this.removeAllBorders(e,n):(this.checkCustomSelectionsFromContextMenu(o,r,i)||this.insertBorderIntoSettings(o),this.hot.setCellMeta(e,n,"borders",Mu(o)))):(o[r]=qu(),this.checkCustomSelectionsFromContextMenu(o,r,i)||this.insertBorderIntoSettings(o),this.hot.setCellMeta(e,n,"borders",Mu(o)))}prepareBorder(e,n,r){E(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":me(o.col,s.col,a=>{me(o.row,s.row,l=>{this.removeAllBorders(l,a)})});break;case"top":me(o.col,s.col,a=>{this.setBorder(o.row,a,n,r)});break;case"bottom":me(o.col,s.col,a=>{this.setBorder(s.row,a,n,r)});break;case"start":me(o.row,s.row,a=>{this.setBorder(a,o.col,n,r)});break;case"end":me(o.row,s.row,a=>{this.setBorder(a,s.col,n,r)});break}})}createCustomBorders(e){E(e,n=>{const r=uv(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 Yt([n,r,i,o],(a,l)=>{let u=a;return l&&l.hide&&(u+=1),u},0)}clearBordersFromSelectionSettings(e){const n=Ue(this.hot.selection.highlight.customSelections,r=>r.settings.id).indexOf(e);n>-1&&this.hot.selection.highlight.customSelections[n].clear()}clearNullCellRange(){E(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(){E(this.savedBorders,e=>{this.clearBordersFromSelectionSettings(e.id),this.clearNullCellRange()})}spliceBorder(e){const n=Ue(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):E(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 E(this.hot.selection.highlight.customSelections,o=>{if(e.id===o.settings.id){const s=this.hot.view._wt.selectionManager.getBorderInstances(o);return E(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):E(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);E(a,l=>{l.changeBorderStyle(r,e)})}return o=!0,!1}}),o}changeBorderSettings(){const e=this.hot.getSettings()[af];if(Array.isArray(e)){const n=Tn(e);this.checkSettingsCohesion(n),n.length||(this.savedBorders=n),this.createCustomBorders(n)}else e!==void 0&&this.createCustomBorders(this.savedBorders)}checkSettingsCohesion(e){const n=OJ(e),r=IJ(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 YJ(t){this.hot.getSettings()[af]&&t.items.push({name:"---------"},{key:"borders",name(){return this.getTranslatedPhrase(Em)},disabled(){const e=this.getSelectedRangeLast();return!e||e.isSingleHeader()?!0:this.selection.isSelectedByCorner()},submenu:{items:[$J(this),LJ(this),HJ(this),DJ(this),NJ(this)]}})}function GJ(){this.changeBorderSettings()}function zJ(t,e){jJ(t,e),e.add(t)}function jJ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function hv(t,e,n){return e=KJ(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function KJ(t){var e=XJ(t,"string");return typeof e=="symbol"?e:String(e)}function XJ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function __(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}const M_="dragToScroll",qJ=100;var dv=new WeakSet;class ZJ extends it{constructor(){super(...arguments),zJ(this,dv),hv(this,"boundaries",null),hv(this,"callback",null),hv(this,"listening",!1)}static get PLUGIN_KEY(){return M_}static get PLUGIN_PRIORITY(){return qJ}isEnabled(){return!!this.hot.getSettings()[M_]}enablePlugin(){this.enabled||(this.addHook("afterOnCellMouseDown",e=>__(this,dv,A_).call(this,e)),this.addHook("afterOnCellCornerMouseDown",e=>__(this,dv,A_).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=Ec(n)}unregisterEvents(){this.eventManager.clear()}onMouseMove(e){this.isListening()&&this.check(e.clientX,e.clientY)}destroy(){super.destroy()}}function A_(t){if(fs(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 Bs(t,e){QJ(t,e),e.add(t)}function QJ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function fv(t,e,n){return e=JJ(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function JJ(t){var e=eee(t,"string");return typeof e=="symbol"?e:String(e)}function eee(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function zo(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}de.getSingleton().register("afterDropdownMenuDefaultOptions");de.getSingleton().register("beforeDropdownMenuShow");de.getSingleton().register("afterDropdownMenuShow");de.getSingleton().register("afterDropdownMenuHide");de.getSingleton().register("afterDropdownMenuExecute");const lf="dropdownMenu",tee=230,TS="changeType",gv=lf;var nR=new WeakSet,O_=new WeakSet,I_=new WeakSet,P_=new WeakSet,x_=new WeakSet,H_=new WeakSet,D_=new WeakSet;class _p extends it{static get PLUGIN_KEY(){return lf}static get PLUGIN_PRIORITY(){return tee}static get PLUGIN_DEPS(){return["plugin:AutoColumnSize"]}static get DEFAULT_ITEMS(){return[ih,oh,ze,ah,ze,wp,ze,sh,ze,_r]}constructor(e){super(e),Bs(this,D_),Bs(this,H_),Bs(this,x_),Bs(this,P_),Bs(this,I_),Bs(this,O_),Bs(this,nR),fv(this,"commandExecutor",new ZH(this.hot)),fv(this,"itemsFactory",null),fv(this,"menu",null),this.hot.addHook("afterGetColHeader",(n,r)=>zo(this,I_,ree).call(this,n,r))}isEnabled(){return this.hot.getSettings()[lf]}enablePlugin(){var e=this;if(this.enabled)return;this.itemsFactory=new QH(this.hot,_p.DEFAULT_ITEMS);const n=this.hot.getSettings()[lf],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 jl(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",()=>zo(this,P_,iee).call(this)),this.menu.addLocalHook("afterOpen",()=>zo(this,x_,oee).call(this)),this.menu.addLocalHook("afterSubmenuOpen",o=>zo(this,H_,see).call(this,o)),this.menu.addLocalHook("afterClose",()=>zo(this,D_,aee).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)}),E(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=pp(this.menu.container,this.hot.rootDocument),s=this.hot.getCell(-1,i.col,!0),a=s.getBoundingClientRect();this.open({left:a.left+o.left,top:a.top+s.offsetHeight+o.top},{left:a.width}),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:gv},{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:gv}])}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(gv)}registerEvents(){this.eventManager.addEventListener(this.hot.rootElement,"click",e=>zo(this,O_,nee).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(),Ye(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 dD(t){t.getKeyboardShortcutsCtrl().addCustomShortcuts([{keys:[["Control/Meta","A"]],callback:()=>!1}])}function nee(t){if(t.stopPropagation(),Ie(t.target,TS)){const e=pp(this.menu.container,this.hot.rootDocument),n=t.target.getBoundingClientRect();this.open({left:n.left+e.left,top:n.top+t.target.offsetHeight+3+e.top},{left:n.width})}}function ree(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(`.${TS}`);if(this.enabled&&o)return;if(!this.enabled){o&&o.parentNode.removeChild(o);return}const s=this.hot.rootDocument.createElement("button");s.className=TS,s.type="button",s.tabIndex=-1,this.hot.getSettings().ariaTags&&(Ee(s,[Eo(),Oy(" ")]),Ee(e,[hx("menu")])),s.onclick=function(){return!1},e.firstChild.insertBefore(s,e.firstChild.firstChild)}function iee(){this.hot.runHooks("beforeDropdownMenuShow",this)}function oee(){this.hot.runHooks("afterDropdownMenuShow",this),zo(this,nR,dD).call(this,this.menu)}function see(t){zo(this,nR,dD).call(this,t)}function aee(){this.hot.listen(),this.hot.runHooks("afterDropdownMenuHide",this)}_p.SEPARATOR={name:ze};function N_(t,e,n){return e=lee(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function lee(t){var e=uee(t,"string");return typeof e=="symbol"?e:String(e)}function uee(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class cee{constructor(e){N_(this,"hot",void 0),N_(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 me(e,r,a=>{const l=[];!o.exportHiddenRows&&this._isHiddenRow(a)||(me(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();me(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();me(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))}}const hee=cee;function L_(t,e,n){return e=dee(e),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:String(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||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class rR{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){L_(this,"dataProvider",void 0),L_(this,"options",void 0),this.dataProvider=e,this.options=this._mergeOptions(n),this.dataProvider.setOptions(this.options)}_mergeOptions(e){let n=Vn(this.constructor.DEFAULT_OPTIONS);const r=new Date;return n=jt(Vn(rR.DEFAULT_OPTIONS),n),n=jt(n,e),n.filename=Ay(n.filename,{YYYY:r.getFullYear(),MM:`${r.getMonth()+1}`.padStart(2,"0"),DD:`${r.getDate()}`.padStart(2,"0")}),n}}const gee=rR,mee=String.fromCharCode(13),pee=String.fromCharCode(34),wee=String.fromCharCode(10);class vee extends gee{static get DEFAULT_OPTIONS(){return{mimeType:"text/csv",fileExtension:"csv",bom:!0,columnDelimiter:",",rowDelimiter:`\r
`}}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?String.fromCharCode(65279):"";return i&&(r=Ue(r,l=>this._escapeCell(l,!0)),s&&(a+=e.columnDelimiter),a+=r.join(e.columnDelimiter),a+=e.rowDelimiter),E(n,(l,u)=>{u>0&&(a+=e.rowDelimiter),s&&(a+=this._escapeCell(o[u])+e.columnDelimiter),a+=l.map(c=>this._escapeCell(c)).join(e.columnDelimiter)}),a}_escapeCell(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=Ft(e);return r!==""&&(n||r.indexOf(mee)>=0||r.indexOf(pee)>=0||r.indexOf(wee)>=0||r.indexOf(this.options.columnDelimiter)>=0)&&(r=r.replace(new RegExp('"',"g"),'""'),r=`"${r}"`),r}}const Cee=vee,See="csv",_S={[See]:Cee};function yee(t,e,n){return typeof _S[t]=="function"?new _S[t](e,n):null}const bee="exportFile",Ree=240;class Eee extends it{static get PLUGIN_KEY(){return bee}static get PLUGIN_PRIORITY(){return Ree}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(!_S[e])throw new Error(`Export format type "${e}" is not supported.`);return yee(e,new hee(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 ja(t,e,n){return e=Tee(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Tee(t){var e=_ee(t,"string");return typeof e=="symbol"?e:String(e)}function _ee(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class lh{constructor(e,n){let{id:r,stateless:i=!0}=n;ja(this,"hot",void 0),ja(this,"id",void 0),ja(this,"elements",[]),ja(this,"hidden",!1),ja(this,"stateId",""),ja(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 zg)}getElements(){return this.elements}reset(){E(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(),E(this.elements,e=>e.destroy()),this.state=null,this.elements=null,this.hot=null}}pt(lh,or);const xc={};function ms(t,e){if(!xc[t])throw Error(`Filter condition "${t}" does not exist.`);const{condition:n,descriptor:r}=xc[t];let i=e;return r.inputValuesDecorator&&(i=r.inputValuesDecorator(i)),function(o){return n.apply(o.meta.instance,[].concat([o],[i]))}}function oa(t){if(!xc[t])throw Error(`Filter condition "${t}" does not exist.`);return xc[t].descriptor}function Kt(t,e,n){n.key=t,xc[t]={condition:e,descriptor:n}}const un="none";function Mee(){return!0}Kt(un,Mee,{name:th,inputsCount:0,showOperators:!1});const lc="empty";function Aee(t){return Zt(t.value)}Kt(lc,Aee,{name:Lm,inputsCount:0,showOperators:!0});const uf="not_empty";function Oee(t,e){return!ms(lc,e)(t)}Kt(uf,Oee,{name:$m,inputsCount:0,showOperators:!0});const uc="eq";function Iee(t,e){let[n]=e;return Ft(t.value).toLocaleLowerCase(t.meta.locale)===Ft(n)}Kt(uc,Iee,{name:km,inputsCount:1,showOperators:!0});const cf="neq";function Pee(t,e){return!ms(uc,e)(t)}Kt(cf,Pee,{name:Fm,inputsCount:1,showOperators:!0});const fD="gt";function xee(t,e){let[n]=e,r=n;return t.meta.type==="numeric"&&(r=parseFloat(r,10)),t.value>r}Kt(fD,xee,{name:Ym,inputsCount:1,showOperators:!0});const gD="gte";function Hee(t,e){let[n]=e,r=n;return t.meta.type==="numeric"&&(r=parseFloat(r,10)),t.value>=r}Kt(gD,Hee,{name:Gm,inputsCount:1,showOperators:!0});const mD="lt";function Dee(t,e){let[n]=e,r=n;return t.meta.type==="numeric"&&(r=parseFloat(r,10)),t.value<r}Kt(mD,Dee,{name:zm,inputsCount:1,showOperators:!0});const pD="lte";function Nee(t,e){let[n]=e,r=n;return t.meta.type==="numeric"&&(r=parseFloat(r,10)),t.value<=r}Kt(pD,Nee,{name:jm,inputsCount:1,showOperators:!0});const iR="date_after";function Lee(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}Kt(iR,Lee,{name:qm,inputsCount:1,showOperators:!0});const oR="date_before";function $ee(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}Kt(oR,$ee,{name:Zm,inputsCount:1,showOperators:!0});const jf="between";function kee(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=ms(oR,[o]),a=ms(iR,[i]);return s(t)&&a(t)}return t.value>=i&&t.value<=o}Kt(jf,kee,{name:Km,inputsCount:2,showOperators:!0});const wD="not_between";function Fee(t,e){return!ms(jf,e)(t)}Kt(wD,Fee,{name:Xm,inputsCount:2,showOperators:!0});const vD="begins_with";function Wee(t,e){let[n]=e;return Ft(t.value).toLocaleLowerCase(t.meta.locale).startsWith(Ft(n))}Kt(vD,Wee,{name:Wm,inputsCount:1,showOperators:!0});const CD="ends_with";function Vee(t,e){let[n]=e;return Ft(t.value).toLocaleLowerCase(t.meta.locale).endsWith(Ft(n))}Kt(CD,Vee,{name:Vm,inputsCount:1,showOperators:!0});const sR="contains";function Bee(t,e){let[n]=e;return Ft(t.value).toLocaleLowerCase(t.meta.locale).indexOf(Ft(n))>=0}Kt(sR,Bee,{name:Bm,inputsCount:1,showOperators:!0});const SD="not_contains";function Uee(t,e){return!ms(sR,e)(t)}Kt(SD,Uee,{name:Um,inputsCount:1,showOperators:!0});const yD="date_tomorrow";function Yee(t){const e=X(t.value,t.meta.dateFormat);return e.isValid()?e.isSame(X().subtract(-1,"days").startOf("day"),"d"):!1}Kt(yD,Yee,{name:Jm,inputsCount:0});const bD="date_today";function Gee(t){const e=X(t.value,t.meta.dateFormat);return e.isValid()?e.isSame(X().startOf("day"),"d"):!1}Kt(bD,Gee,{name:Qm,inputsCount:0});const RD="date_yesterday";function zee(t){const e=X(t.value,t.meta.dateFormat);return e.isValid()?e.isSame(X().subtract(1,"days").startOf("day"),"d"):!1}Kt(RD,zee,{name:ep,inputsCount:0});Dx();function jee(t,e){let n=t;return n===""&&(n=`(${e})`),n}const MS=new Set([1]).has(1),Kee=MS&&typeof Array.from=="function";function uh(t){let e=t;return MS&&(e=new Set(e)),function(n){let r;return MS?r=e.has(n):r=!!~e.indexOf(n),r}}function ED(t){return t??""}function AS(t){let e=t;return Kee?e=Array.from(new Set(e)):e=Ty(e),e=e.sort((n,r)=>typeof n=="number"&&typeof r=="number"?n-r:n===r?0:n>r?1:-1),e}function $_(t,e,n,r){const i=[],o=t===e;let s;return o||(s=uh(e)),E(t,a=>{let l=!1;(o||s(a))&&(l=!0);const u={checked:l,value:a,visualValue:jee(a,n)};r&&r(u),i.push(u)}),i}const sa="by_value";function Xee(t,e){let[n]=e;return n(t.value)}Kt(sa,Xee,{name:"By value",inputsCount:0,inputValuesDecorator(t){let[e]=t;return[uh(e)]},showOperators:!1});const Hc={};function qee(t){if(!Hc[t])throw Error(`Operation with id "${t}" does not exist.`);const e=Hc[t].func;return function(n,r){return e(n,r)}}function Zee(t){return Hc[t].name}function aR(t,e,n){Hc[t]={name:e,func:n}}const ls="conjunction",Qee=rp;function Jee(t,e){return t.every(n=>n.func(e))}aR(ls,Qee,Jee);const Kf="disjunction",ete=nh;function tte(t,e){return t.some(n=>n.func(e))}aR(Kf,ete,tte);const lR="disjunctionWithExtraCondition",nte=nh;function rte(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)}aR(lR,nte,rte);const ite="numeric",TD="text",ote="date",k_={[ite]:[un,ze,lc,uf,ze,uc,cf,ze,fD,gD,mD,pD,jf,wD],[TD]:[un,ze,lc,uf,ze,uc,cf,ze,vD,CD,ze,sR,SD],[ote]:[un,ze,lc,uf,ze,uc,cf,ze,oR,iR,jf,ze,yD,bD,RD]};function ste(t){const e=[];let n=t;return k_[n]||(n=TD),E(k_[n],r=>{let i;r===ze?i={name:ze}:i=Vn(oa(r)),e.push(i)}),e}function Au(t,e,n){return e=ate(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ate(t){var e=lte(t,"string");return typeof e=="symbol"?e:String(e)}function lte(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const mv="built",pv="building",F_=["click","input","keydown","keypress","keyup","focus","blur","change"];let ti=class _D{static get DEFAULTS(){return Vn({className:"",value:"",tagName:"div",children:[],wrapIt:!0})}constructor(e,n){Au(this,"hot",void 0),Au(this,"eventManager",new xr(this)),Au(this,"options",void 0),Au(this,"_element",void 0),Au(this,"buildState",void 0),this.hot=e,this.options=jt(_D.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===pv?this._element:this.buildState===mv?(this.update(),this._element):(this.buildState=pv,this.build(),this.buildState=mv,this._element)}isBuilt(){return this.buildState===mv}translateIfPossible(e){return typeof e=="string"&&e.startsWith(Yn)?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=pv),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&&q(this._element,this.options.className),this.options.children.length)E(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),Ye(this.options,(r,i)=>{n[i]!==void 0&&i!=="className"&&i!=="tagName"&&i!=="children"&&(n[i]=this.translateIfPossible(r))}),this._element.appendChild(n),E(F_,r=>e(n,r))}else E(F_,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}};pt(ti,or);function ute(t,e){MD(t,e),e.add(t)}function cte(t,e,n){MD(t,e),e.set(t,n)}function MD(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Cd(t,e){var n=AD(t,e,"get");return hte(t,n)}function hte(t,e){return e.get?e.get.call(t):e.value}function dte(t,e,n){var r=AD(t,e,"set");return fte(t,r,n),n}function AD(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}function fte(t,e,n){if(e.set)e.set.call(t,n);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=n}}function gte(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}var Ka=new WeakMap,W_=new WeakSet;class us extends ti{static get DEFAULTS(){return Vn({placeholder:"",type:"text",tagName:"input",tabIndex:-1})}constructor(e,n){super(e,jt(us.DEFAULTS,n)),ute(this,W_),cte(this,Ka,{writable:!0,value:void 0}),this.registerHooks()}registerHooks(){this.addLocalHook("keyup",e=>gte(this,W_,mte).call(this,e))}build(){super.build();const e=this.hot.rootDocument.createElement("div");dte(this,Ka,this._element.firstChild),q(this._element,"htUIInput"),q(e,"htUIInputIcon"),this._element.appendChild(e),this.update()}update(){this.isBuilt()&&(Cd(this,Ka).type=this.options.type,Cd(this,Ka).placeholder=this.translateIfPossible(this.options.placeholder),Cd(this,Ka).value=this.translateIfPossible(this.options.value))}focus(){this.isBuilt()&&Cd(this,Ka).focus()}}function mte(t){this.options.value=t.target.value}function wv(t,e){OD(t,e),e.add(t)}function Ou(t,e,n){OD(t,e),e.set(t,n)}function OD(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Xa(t,e,n){var r=ID(t,e,"set");return pte(t,r,n),n}function pte(t,e,n){if(e.set)e.set.call(t,n);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=n}}function vv(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}function xt(t,e){var n=ID(t,e,"get");return wte(t,n)}function ID(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}function wte(t,e){return e.get?e.get.call(t):e.value}var Jt=new WeakMap,Sd=new WeakMap,yd=new WeakMap,Cv=new WeakMap,bd=new WeakMap,V_=new WeakSet,B_=new WeakSet,U_=new WeakSet;class Dc extends ti{static get DEFAULTS(){return Vn({className:"htUISelect",wrapIt:!1,tabIndex:-1})}constructor(e,n){super(e,jt(Dc.DEFAULTS,n)),wv(this,U_),wv(this,B_),wv(this,V_),Ou(this,Jt,{writable:!0,value:null}),Ou(this,Sd,{writable:!0,value:[]}),Ou(this,yd,{writable:!0,value:void 0}),Ou(this,Cv,{writable:!0,value:void 0}),Ou(this,bd,{writable:!0,value:void 0}),this.registerHooks()}getMenu(){return xt(this,Jt)}registerHooks(){this.addLocalHook("click",()=>vv(this,U_,Ste).call(this))}setItems(e){Xa(this,Sd,this.translateNames(e)),xt(this,Jt)&&xt(this,Jt).setMenuItems(xt(this,Sd))}translateNames(e){return E(e,n=>{n.name=this.translateIfPossible(n.name)}),e}build(){super.build(),Xa(this,Jt,new jl(this.hot,{className:"htSelectUI htFiltersConditionsMenu",keepInViewport:!1,standalone:!0,container:this.options.menuContainer})),xt(this,Jt).setMenuItems(xt(this,Sd));const e=new ti(this.hot,{className:"htUISelectCaption"}),n=new ti(this.hot,{className:"htUISelectDropdown"});Xa(this,yd,e),Xa(this,Cv,e.element),Xa(this,bd,n),this.hot.getSettings().ariaTags&&(Ee(n.element,[Eo()]),Ee(this._element,[cx()])),E([e,n],r=>this._element.appendChild(r.element)),xt(this,Jt).addLocalHook("select",r=>vv(this,V_,vte).call(this,r)),xt(this,Jt).addLocalHook("afterClose",()=>vv(this,B_,Cte).call(this)),this.update()}update(){if(!this.isBuilt())return;let e;this.options.value?e=this.options.value.name:e=xt(this,Jt).hot.getTranslatedPhrase(th),xt(this,Cv).textContent=e,super.update()}openOptions(){const e=this.element.getBoundingClientRect();xt(this,Jt)&&(xt(this,Jt).open(),xt(this,Jt).setPosition({left:this.hot.isLtr()?e.left-5:e.left-31,top:e.top-1,width:e.width,height:e.height}),xt(this,Jt).getNavigator().toFirstItem(),xt(this,Jt).getKeyboardShortcutsCtrl().addCustomShortcuts([{keys:[["Tab"],["Shift","Tab"]],callback:n=>{this.closeOptions(),this.runLocalHooks("tabKeydown",n)}},{keys:[["Control/Meta","A"]],callback:()=>!1}]))}closeOptions(){xt(this,Jt)&&xt(this,Jt).close()}focus(){this.isBuilt()&&this.element.focus()}destroy(){xt(this,Jt)&&(xt(this,Jt).destroy(),Xa(this,Jt,null)),xt(this,yd)&&xt(this,yd).destroy(),xt(this,bd)&&xt(this,bd).destroy(),super.destroy()}}function vte(t){t.name!==ze&&(this.options.value=t,this.update(),this.runLocalHooks("select",this.options.value))}function Cte(){this.runLocalHooks("afterClose")}function Ste(){this.openOptions()}function Y_(t,e){yte(t,e),e.add(t)}function yte(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function G_(t,e,n){return e=bte(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function bte(t){var e=Rte(t,"string");return typeof e=="symbol"?e:String(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||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function z_(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}var j_=new WeakSet,K_=new WeakSet;class OS extends lh{constructor(e,n){super(e,{id:n.id,stateless:!1}),Y_(this,K_),Y_(this,j_),G_(this,"name",""),G_(this,"addSeparator",!1),this.name=n.name,this.addSeparator=n.addSeparator,this.elements.push(new Dc(this.hot,{menuContainer:n.menuContainer})),this.elements.push(new us(this.hot,{placeholder:up})),this.elements.push(new us(this.hot,{placeholder:cp})),this.registerHooks()}registerHooks(){this.getSelectElement().addLocalHook("select",e=>z_(this,j_,Ete).call(this,e)).addLocalHook("afterClose",()=>this.runLocalHooks("afterClose")).addLocalHook("tabKeydown",e=>this.runLocalHooks("selectTabKeydown",e)),E(this.getInputElements(),e=>{e.addLocalHook("keydown",n=>z_(this,K_,Tte).call(this,n))})}setState(e){if(this.reset(),!e)return;const n=Vn(e.command);n.name.startsWith(Wt)&&(n.name=this.hot.getTranslatedPhrase(n.name)),this.getSelectElement().setValue(n),E(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()||oa(un),n=[];return E(this.getInputElements(),(r,i)=>{e.inputsCount>i&&n.push(r.getValue())}),{command:e,args:n}}updateState(e,n){const r=oa(e?e.name:un);this.state.setValueAtIndex(n,{command:r,args:e?e.args:[]}),e||E(this.getInputElements(),i=>i.setValue(null))}getSelectElement(){return this.elements.filter(e=>e instanceof Dc)[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)=>{q(n.parentNode,"htFiltersMenuCondition"),this.addSeparator&&q(n.parentNode,"border");const a=this.hot.rootDocument.createElement("div");return q(a,"htFiltersMenuLabel"),a.textContent=s,n.appendChild(a),E(this.elements,l=>n.appendChild(l.element)),n}}}reset(){const e=this.hot.getPlugin("filters").getSelectedColumn();let n=[oa(un)];if(e!==null){const{visualIndex:r}=e;n=ste(this.hot.getDataType(0,r,this.hot.countRows(),r))}E(this.getInputElements(),r=>r.hide()),this.getSelectElement().setItems(n),super.reset(),this.getSelectElement().setValue(n[0])}}function Ete(t){E(this.getInputElements(),(e,n)=>{e[t.inputsCount>n?"show":"hide"](),n===0&&this.hot._registerTimeout(()=>e.focus(),10)}),this.runLocalHooks("change",t)}function Tte(t){Ul(t.keyCode,"ESCAPE")&&(this.runLocalHooks("cancel"),Lr(t))}function X_(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 Iu(t,e){var n=PD(t,e,"get");return Mte(t,n)}function Mte(t,e){return e.get?e.get.call(t):e.value}function q_(t,e,n){var r=PD(t,e,"set");return Ate(t,r,n),n}function PD(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}function Ate(t,e,n){if(e.set)e.set.call(t,n);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=n}}var qa=new WeakMap,Sv=new WeakMap;class Xf extends ti{static get DEFAULTS(){return Vn({type:"radio",tagName:"input",className:"htUIRadio",label:{}})}constructor(e,n){super(e,jt(Xf.DEFAULTS,n)),X_(this,qa,{writable:!0,value:void 0}),X_(this,Sv,{writable:!0,value: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),q_(this,Sv,e),q_(this,qa,this._element.firstChild),Iu(this,qa).checked=this.options.checked,this._element.appendChild(e),this.update()}update(){this.isBuilt()&&(Iu(this,Sv).textContent=this.translateIfPossible(this.options.label.textContent))}isChecked(){return this.isBuilt()?Iu(this,qa).checked:!1}setChecked(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.isBuilt()&&(Iu(this,qa).checked=e)}focus(){this.isBuilt()&&Iu(this,qa).focus()}}function Ote(t,e){Ite(t,e),e.add(t)}function Ite(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Pte(t,e,n){return e=xte(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function xte(t){var e=Hte(t,"string");return typeof e=="symbol"?e:String(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||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Dte(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}const Z_=0;var Q_=new WeakSet;class Nte extends lh{constructor(e,n){super(e,{id:n.id,stateless:!1}),Ote(this,Q_),Pte(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)=>(q(n.parentNode,"htFiltersMenuOperators"),E(this.elements,r=>n.appendChild(r.element)),n)}}buildOperatorsElement(){const e=[ls,Kf];E(e,n=>{const r=new Xf(this.hot,{name:"operator",label:{htmlFor:n,textContent:Zee(n)},value:n,checked:n===e[Z_],id:n});r.addLocalHook("change",i=>Dte(this,Q_,Lte).call(this,i)),this.elements.push(r)})}setChecked(e){if(this.elements.length<e)throw Error(ht`Radio button with index ${e} doesn't exist.`);E(this.elements,(n,r)=>{n.setChecked(r===e)})}getActiveOperationId(){const e=this.elements.find(n=>n instanceof Xf&&n.isChecked());return e?e.getValue():ls}getState(){return this.getActiveOperationId()}setState(e){this.reset(),e&&this.getActiveOperationId()!==e&&E(this.elements,n=>{n.setChecked(n.getValue()===e)})}updateState(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ls,n=arguments.length>1?arguments[1]:void 0,r=e;r===lR&&(r=Kf),this.state.setValueAtIndex(n,r)}reset(){this.setChecked(Z_)}}function Lte(t){this.setState(t.target.value)}function $te(t,e,n){kte(t,e),e.set(t,n)}function kte(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function yv(t,e){var n=xD(t,e,"get");return Fte(t,n)}function Fte(t,e){return e.get?e.get.call(t):e.value}function Wte(t,e,n){var r=xD(t,e,"set");return Vte(t,r,n),n}function xD(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}function Vte(t,e,n){if(e.set)e.set.call(t,n);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=n}}var Pu=new WeakMap;class Nc extends ti{static get DEFAULTS(){return Vn({href:"#",tagName:"a",tabIndex:-1,role:"button"})}constructor(e,n){super(e,jt(Nc.DEFAULTS,n)),$te(this,Pu,{writable:!0,value:void 0})}build(){super.build(),Wte(this,Pu,this._element.firstChild)}update(){this.isBuilt()&&(yv(this,Pu).textContent=this.translateIfPossible(this.options.textContent))}focus(){this.isBuilt()&&yv(this,Pu).focus()}activate(){yv(this,Pu).click()}}function Rd(t,e){HD(t,e),e.add(t)}function Za(t,e,n){HD(t,e),e.set(t,n)}function HD(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ed(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}function Ne(t,e){var n=DD(t,e,"get");return Bte(t,n)}function Bte(t,e){return e.get?e.get.call(t):e.value}function Ur(t,e,n){var r=DD(t,e,"set");return Ute(t,r,n),n}function DD(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}function Ute(t,e,n){if(e.set)e.set.call(t,n);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=n}}const J_="multipleSelect.itemBox";var qr=new WeakMap,At=new WeakMap,bv=new WeakMap,Xi=new WeakMap,ko=new WeakMap,Fo=new WeakMap,eM=new WeakSet,tM=new WeakSet,nM=new WeakSet,rM=new WeakSet;class Lc extends ti{static get DEFAULTS(){return Vn({className:"htUIMultipleSelect",value:[]})}constructor(e,n){super(e,jt(Lc.DEFAULTS,n)),Rd(this,rM),Rd(this,nM),Rd(this,tM),Rd(this,eM),Za(this,qr,{writable:!0,value:[]}),Za(this,At,{writable:!0,value:void 0}),Za(this,bv,{writable:!0,value:void 0}),Za(this,Xi,{writable:!0,value:void 0}),Za(this,ko,{writable:!0,value:void 0}),Za(this,Fo,{writable:!0,value:void 0}),Ur(this,Xi,new us(this.hot,{placeholder:lp,className:"htUIMultipleSelectSearch"})),Ur(this,ko,new Nc(this.hot,{textContent:ip,className:"htUISelectAll"})),Ur(this,Fo,new Nc(this.hot,{textContent:op,className:"htUIClearAll"})),this.registerHooks()}getItemsBox(){return Ne(this,At)}registerHooks(){Ne(this,Xi).addLocalHook("keydown",e=>Ed(this,tM,Gte).call(this,e)),Ne(this,Xi).addLocalHook("input",e=>Ed(this,eM,Yte).call(this,e)),Ne(this,ko).addLocalHook("click",e=>Ed(this,nM,zte).call(this,e)),Ne(this,Fo).addLocalHook("click",e=>Ed(this,rM,jte).call(this,e))}setItems(e){Ur(this,qr,e),Ne(this,At)&&Ne(this,At).loadData(Ne(this,qr))}setLocale(e){Ur(this,bv,e)}getLocale(){return Ne(this,bv)}getItems(){return[...Ne(this,qr)]}getValue(){return Xte(Ne(this,qr))}getSearchInputElement(){return Ne(this,Xi)}getSelectAllElement(){return Ne(this,ko)}getClearAllElement(){return Ne(this,Fo)}isSelectedAllValues(){return Ne(this,qr).length===this.getValue().length}build(){super.build();const{rootDocument:e}=this.hot,n=e.createElement("div"),r=new ti(this.hot,{className:"htUISelectionControls",children:[Ne(this,ko),Ne(this,Fo)]});this._element.appendChild(Ne(this,Xi).element),this._element.appendChild(r.element),this._element.appendChild(n);const i=o=>{if(!this._element)return;Ne(this,At)&&Ne(this,At).destroy(),q(o,"htUIMultipleSelectHot"),Ur(this,At,new this.hot.constructor(o,{data:Ne(this,qr),columns:[{data:"checked",type:"checkbox",label:{property:"visualValue",position:"after"}}],beforeRenderer:(l,u,c,h,d,g)=>{l.title=g.instance.getDataAtRowProp(u,g.label.property)},afterListen:()=>{this.runLocalHooks("focus",this)},beforeOnCellMouseUp:()=>{Ne(this,At).listen()},maxCols:1,autoWrapCol:!0,height:110,colWidths:()=>Ne(this,At).container.scrollWidth-nn(e),copyPaste:!1,disableVisualSelection:"area",fillHandle:!1,fragmentSelection:"cell",tabMoves:{row:1,col:0},layoutDirection:this.hot.isRtl()?"rtl":"ltr"})),Ne(this,At).init();const a=Ne(this,At).getShortcutManager().getContext("grid");a.removeShortcutsByKeys(["Tab"]),a.removeShortcutsByKeys(["Shift","Tab"]),a.addShortcut({keys:[["Escape"]],callback:l=>{this.runLocalHooks("keydown",l,this)},group:J_}),a.addShortcut({keys:[["Tab"],["Shift","Tab"]],callback:l=>{Ne(this,At).deselectCell(),this.runLocalHooks("keydown",l,this),this.runLocalHooks("listTabKeydown",l,this)},group:J_})};i(n),this.hot._registerTimeout(()=>i(n),100)}focus(){this.isBuilt()&&Ne(this,At).listen()}reset(){Ne(this,Xi).reset(),Ne(this,ko).reset(),Ne(this,Fo).reset()}update(){this.isBuilt()&&(Ne(this,At).loadData(Kte(Ne(this,qr),this.options.value)),super.update())}destroy(){Ne(this,At)&&Ne(this,At).destroy(),Ne(this,Xi).destroy(),Ne(this,Fo).destroy(),Ne(this,ko).destroy(),Ur(this,Xi,null),Ur(this,Fo,null),Ur(this,ko,null),Ur(this,At,null),Ur(this,qr,null),super.destroy()}}function Yte(t){const e=t.target.value.toLocaleLowerCase(this.getLocale());let n;e===""?n=[...Ne(this,qr)]:n=pr(Ne(this,qr),r=>`${r.value}`.toLocaleLowerCase(this.getLocale()).indexOf(e)>=0),Ne(this,At).loadData(n)}function Gte(t){this.runLocalHooks("keydown",t,this),Wy(Ul,t.keyCode)("ARROW_DOWN")&&(t.preventDefault(),Lr(t),Ne(this,At).listen(),Ne(this,At).selectCell(0,0))}function zte(t){const e=[];t.preventDefault(),E(Ne(this,At).getSourceData(),(n,r)=>{n.checked=!0,e.push(wb(n,r)[0])}),Ne(this,At).setSourceDataAtCell(e)}function jte(t){const e=[];t.preventDefault(),E(Ne(this,At).getSourceData(),(n,r)=>{n.checked=!1,e.push(wb(n,r)[0])}),Ne(this,At).setSourceDataAtCell(e)}function Kte(t,e){const n=uh(e);return Ue(t,r=>(r.checked=n(r.value),r))}function Xte(t){const e=[];return E(t,n=>{n.checked&&e.push(n.value)}),e}function qte(t,e){Zte(t,e),e.add(t)}function Zte(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Qte(t,e,n){return e=Jte(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Jte(t){var e=ene(t,"string");return typeof e=="symbol"?e:String(e)}function ene(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function tne(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}var iM=new WeakSet;class nne extends lh{constructor(e,n){super(e,{id:n.id,stateless:!1}),qte(this,iM),Qte(this,"name",""),this.name=n.name,this.elements.push(new Lc(this.hot)),this.registerHooks()}registerHooks(){this.getMultipleSelectElement().addLocalHook("keydown",e=>tne(this,iM,rne).call(this,e)).addLocalHook("listTabKeydown",e=>this.runLocalHooks("listTabKeydown",e))}getElements(){const e=this.getMultipleSelectElement();return[e.getSearchInputElement(),e.getSelectAllElement(),e.getClearAllElement(),this.getMultipleSelectElement()]}setState(e){if(this.reset(),e&&e.command.key===sa){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?un:sa},args:[e.getValue()],itemsSnapshot:n}}updateState(e){const n=(r,i,o,s,a)=>{const[l]=pr(i,h=>h.name===sa),u={},c=this.hot.getTranslatedPhrase(Oc);if(l){const h=AS(Ue(s(r,a),v=>v.value));o&&(l.args[0]=o);const d=[],g=$_(h,l.args[0],c,v=>{v.checked&&d.push(v.value)}),p=e.editedConditionStack.column;u.locale=this.hot.getCellMeta(0,p).locale,u.args=[d],u.command=oa(sa),u.itemsSnapshot=g}else u.args=[],u.command=oa(un);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 Lc)[0]}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,n,r,i,o,s)=>{q(n.parentNode,"htFiltersMenuValue");const a=this.hot.rootDocument.createElement("div");return q(a,"htFiltersMenuLabel"),a.textContent=s,n.appendChild(a),E(this.elements,l=>n.appendChild(l.element)),n}}}reset(){const e=this.hot.getTranslatedPhrase(Oc),n=AS(this._getColumnVisibleValues()),r=$_(n,n,e);this.getMultipleSelectElement().setItems(r),super.reset(),this.getMultipleSelectElement().setValue(n);const i=this.hot.getPlugin("filters").getSelectedColumn();i!==null&&this.getMultipleSelectElement().setLocale(this.hot.getCellMeta(0,i.visualIndex).locale)}_getColumnVisibleValues(){const e=this.hot.getPlugin("filters").getSelectedColumn();return e===null?[]:Ue(this.hot.getDataAtCol(e.visualIndex),n=>ED(n))}}function rne(t){Ul(t.keyCode,"ESCAPE")&&(this.runLocalHooks("cancel"),Lr(t))}var ND;function ine(t,e){one(t,e),e.add(t)}function one(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function sne(t,e,n){return e=ane(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ane(t){var e=lne(t,"string");return typeof e=="symbol"?e:String(e)}function lne(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function une(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}var oM=new WeakSet;class $c extends lh{static get BUTTON_OK(){return"ok"}static get BUTTON_CANCEL(){return"cancel"}constructor(e,n){super(e,{id:n.id,stateless:!0}),ine(this,oM),sne(this,"name",""),this.name=n.name,this.elements.push(new us(this.hot,{type:"button",value:sp,className:"htUIButton htUIButtonOK",identifier:$c.BUTTON_OK})),this.elements.push(new us(this.hot,{type:"button",value:ap,className:"htUIButton htUIButtonCancel",identifier:$c.BUTTON_CANCEL})),this.registerHooks()}registerHooks(){E(this.elements,e=>{e.addLocalHook("click",(n,r)=>une(this,oM,cne).call(this,n,r))})}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,n)=>(q(n.parentNode,"htFiltersMenuActionBar"),E(this.elements,r=>n.appendChild(r.element)),n)}}accept(){this.runLocalHooks("accept")}cancel(){this.runLocalHooks("cancel")}}ND=$c;function cne(t,e){e.options.identifier===ND.BUTTON_OK?this.accept():this.cancel()}function Rv(t,e,n){return e=hne(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function hne(t){var e=dne(t,"string");return typeof e=="symbol"?e:String(e)}function dne(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const sM="ConditionCollection.filteringStates";class LD{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;Rv(this,"hot",void 0),Rv(this,"isMapRegistrable",void 0),Rv(this,"filteringStates",new zg),this.hot=e,this.isMapRegistrable=n,this.isMapRegistrable===!0?this.hot.columnIndexMapper.registerMap(sM,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]:ls;return e.length?qee(r)(e,n):!0}addCondition(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ls,i=arguments.length>3?arguments[3]:void 0;const o=this.hot.getCellMeta(0,e).locale,s=Ue(n.args,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(ht`The column of index ${e} has been already applied with a \`${l}\`\x20
filter operation. Use \`removeConditions\` to clear the current conditions and then add new ones.\x20
Mind that you cannot mix different types of operations (for instance, if you use \`conjunction\`,\x20
use it consequently for a particular column).`)}else if(Ct(Hc[r]))throw new Error(ht`Unexpected operation named \`${r}\`. Possible ones are\x20
\`disjunction\` and \`conjunction\`.`);const u=this.getConditions(e);u.length===0?this.filteringStates.setValueAtIndex(e,{operation:r,conditions:[{name:a,args:s,func:ms(a,s)}]},i):u.push({name:a,args:s,func:ms(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 Yt(this.filteringStates.getEntries(),(e,n)=>{let[r,{operation:i,conditions:o}]=n;return e.push({column:r,operation:i,conditions:Ue(o,s=>{let{name:a,args:l}=s;return{name:a,args:l}})}),e},[])}importAllConditions(e){this.clean(),E(e,n=>{E(n.conditions,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(sM),this.filteringStates=null,this.clearLocalHooks()}}pt(LD,or);const $D=LD;function aM(t,e,n){return e=fne(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function fne(t){var e=gne(t,"string");return typeof e=="symbol"?e:String(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||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class mne{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:()=>[];aM(this,"conditionCollection",void 0),aM(this,"columnDataFactory",void 0),this.conditionCollection=e,this.columnDataFactory=n}filter(){let e=[];return E(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 E(n,i=>{i!==void 0&&this.conditionCollection.isMatch(i,e)&&r.push(i)}),r}_getIntersectData(e,n){const r=[];return E(n,i=>{const o=i.meta.visualRow;e[o]!==void 0&&(r[o]=e[o])}),r}}const kD=mne;function Ev(t,e){pne(t,e),e.add(t)}function pne(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Us(t,e,n){return e=wne(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function wne(t){var e=vne(t,"string");return typeof e=="symbol"?e:String(e)}function vne(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Tv(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}var lM=new WeakSet,uM=new WeakSet,cM=new WeakSet;class FD{constructor(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:()=>[];Ev(this,cM),Ev(this,uM),Ev(this,lM),Us(this,"hot",void 0),Us(this,"conditionCollection",void 0),Us(this,"columnDataFactory",void 0),Us(this,"changes",[]),Us(this,"grouping",!1),Us(this,"latestEditedColumnPosition",-1),Us(this,"latestOrderStack",[]),this.hot=e,this.conditionCollection=n,this.columnDataFactory=r,this.conditionCollection.addLocalHook("beforeRemove",i=>Tv(this,lM,Cne).call(this,i)),this.conditionCollection.addLocalHook("afterRemove",i=>this.updateStatesAtColumn(i)),this.conditionCollection.addLocalHook("afterAdd",i=>this.updateStatesAtColumn(i)),this.conditionCollection.addLocalHook("beforeClean",()=>Tv(this,uM,Sne).call(this)),this.conditionCollection.addLocalHook("afterClean",()=>Tv(this,cM,yne).call(this))}groupChanges(){this.grouping=!0}flush(){this.grouping=!1,E(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=Mx(function(c,h){let d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];const g=new $D(r.hot,!1),p=[].concat(c,d);g.importAllConditions(p);const v=r.columnDataFactory(h);let S;g.isEmpty()?S=v:S=new kD(g,R=>r.columnDataFactory(R)).filter(),S=Ue(S,R=>R.meta.visualRow);const y=uh(S);return g.destroy(),pr(v,R=>y(R.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(),Ye(this,(e,n)=>{this[n]=null})}}function Cne(t){this.latestEditedColumnPosition=this.conditionCollection.getColumnStackPosition(t)}function Sne(){this.latestOrderStack=this.conditionCollection.getFilteredColumns()}function yne(){E(this.latestOrderStack,t=>{this.updateStatesAtColumn(t)})}pt(FD,or);const bne=FD;function Rne(t){return eD({initialPage:0,size:()=>t.length,onItemSelect:(n,r)=>{const i=t[n];if(i instanceof Lc)return r;if(i.element&&!ds(i.element))return!1;i.focus()}})}const xu="filters";function Ene(t,e){let n=-1;const r=Rne(e),i=l=>()=>{t.isOpened()&&t.getKeyboardShortcutsCtrl().listen(xu),r.setCurrentPage(e.indexOf(l))};e.forEach(l=>{l instanceof ti&&(l.addLocalHook("click",i(l)),l.addLocalHook("focus",i(l)),l.addLocalHook("afterClose",i(l)))}),t.addLocalHook("afterSelectionChange",l=>{l.key.startsWith("filter_")||r.clear()});function o(l){const u=t.getKeyboardShortcutsCtrl(),c=l.getKeyboardShortcutsCtrl();r.clear(),c.addCustomShortcuts([{keys:[["Tab"],["Shift","Tab"]],forwardToContext:u.getContext(xu),callback:()=>{l.isSubMenu()&&l.close(),u.listen(xu)}}]),!l.isSubMenu()&&u.addCustomShortcuts([{keys:[["Tab"],["Shift","Tab"]],callback:h=>{const d=t.getNavigator();d.getCurrentPage()>-1&&(n=d.getCurrentPage()),d.clear(),h.shiftKey?r.toPreviousItem():r.toNextItem()}},{keys:[["Escape"]],callback:()=>{t.close()}},{keys:[["Enter"],["Space"]],preventDefault:!1,callback:h=>{const d=e[r.getCurrentPage()];d instanceof Dc&&(d.openOptions(),h.preventDefault()),d instanceof Nc&&(d.activate(),h.preventDefault()),d instanceof ti||h.preventDefault()}}],xu)}t.addLocalHook("afterSubmenuOpen",o),t.addLocalHook("afterOpen",o);function s(){t.focus(),t.getKeyboardShortcutsCtrl().listen(xu)}function a(){return n}return{...r,listen:s,getLastMenuPage:a}}function qi(t,e){WD(t,e),e.add(t)}function Tne(t,e,n){WD(t,e),e.set(t,n)}function WD(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Hu(t,e,n){return e=_ne(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _ne(t){var e=Mne(t,"string");return typeof e=="symbol"?e:String(e)}function Mne(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ane(t,e,n){var r=VD(t,e,"set");return One(t,r,n),n}function One(t,e,n){if(e.set)e.set.call(t,n);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=n}}function Du(t,e){var n=VD(t,e,"get");return Ine(t,n)}function VD(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}function Ine(t,e){return e.get?e.get.call(t):e.value}function Yr(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}const IS="filters",Pne=250,hM=IS;var Ys=new WeakMap,dM=new WeakSet,fM=new WeakSet,gM=new WeakSet,mM=new WeakSet,_v=new WeakSet,pM=new WeakSet,Mv=new WeakSet,wM=new WeakSet,vM=new WeakSet;class xne extends it{static get PLUGIN_KEY(){return IS}static get PLUGIN_PRIORITY(){return Pne}static get PLUGIN_DEPS(){return["plugin:DropdownMenu","plugin:HiddenRows","cell-type:checkbox"]}constructor(e){super(e),qi(this,vM),qi(this,wM),qi(this,Mv),qi(this,pM),qi(this,_v),qi(this,mM),qi(this,gM),qi(this,fM),qi(this,dM),Hu(this,"dropdownMenuPlugin",null),Hu(this,"conditionCollection",null),Hu(this,"conditionUpdateObserver",null),Hu(this,"components",new Map([["filter_by_condition",null],["filter_operators",null],["filter_by_condition2",null],["filter_by_value",null],["filter_action_bar",null]])),Hu(this,"filtersRowsMap",null),Tne(this,Ys,{writable:!0,value:void 0}),this.hot.addHook("afterGetColHeader",(n,r)=>Yr(this,wM,kne).call(this,n,r))}isEnabled(){return!!this.hot.getSettings()[IS]}enablePlugin(){if(this.enabled)return;this.filtersRowsMap=this.hot.rowIndexMapper.registerMap(this.pluginName,new eh),this.dropdownMenuPlugin=this.hot.getPlugin("dropdownMenu");const e=this.hot.getSettings().dropdownMenu,n=e&&e.uiContainer||this.hot.rootDocument.body,r=s=>(s.addLocalHook("accept",()=>Yr(this,_v,CM).call(this,"accept")),s.addLocalHook("cancel",()=>Yr(this,_v,CM).call(this,"cancel")),s.addLocalHook("change",a=>Yr(this,pM,$ne).call(this,s,a)),s),i=()=>`${this.hot.getTranslatedPhrase(tp)}:`,o=()=>`${this.hot.getTranslatedPhrase(np)}:`;if(!this.components.get("filter_by_condition")){const s=new OS(this.hot,{id:"filter_by_condition",name:i,addSeparator:!1,menuContainer:n});s.addLocalHook("afterClose",()=>Yr(this,Mv,SM).call(this)),this.components.set("filter_by_condition",r(s))}if(this.components.get("filter_operators")||this.components.set("filter_operators",new Nte(this.hot,{id:"filter_operators",name:"Operators"})),!this.components.get("filter_by_condition2")){const s=new OS(this.hot,{id:"filter_by_condition2",name:"",addSeparator:!0,menuContainer:n});s.addLocalHook("afterClose",()=>Yr(this,Mv,SM).call(this)),this.components.set("filter_by_condition2",r(s))}if(this.components.get("filter_by_value")||this.components.set("filter_by_value",r(new nne(this.hot,{id:"filter_by_value",name:o}))),this.components.get("filter_action_bar")||this.components.set("filter_action_bar",r(new $c(this.hot,{id:"filter_action_bar",name:"Action bar"}))),this.conditionCollection||(this.conditionCollection=new $D(this.hot)),this.conditionUpdateObserver||(this.conditionUpdateObserver=new bne(this.hot,this.conditionCollection,s=>this.getDataMapAtColumn(s)),this.conditionUpdateObserver.addLocalHook("update",s=>Yr(this,vM,Fne).call(this,s))),this.components.forEach(s=>s.show()),this.addHook("afterDropdownMenuDefaultOptions",s=>Yr(this,mM,Lne).call(this,s)),this.addHook("afterDropdownMenuShow",()=>Yr(this,fM,Dne).call(this)),this.addHook("afterDropdownMenuHide",()=>Yr(this,gM,Nne).call(this)),this.addHook("afterChange",s=>Yr(this,dM,Hne).call(this,s)),this.hot.getSettings().dropdownMenu&&this.dropdownMenuPlugin&&(this.dropdownMenuPlugin.disablePlugin(),this.dropdownMenuPlugin.enablePlugin()),!Du(this,Ys)&&this.dropdownMenuPlugin.enabled){const s=this.dropdownMenuPlugin.menu,a=[{focus:()=>{const u=s.getNavigator(),c=Du(this,Ys).getLastMenuPage();s.focus(),c>0?u.setCurrentPage(c):u.toFirstItem()}},...Array.from(this.components).map(u=>{let[,c]=u;return c.getElements()}).flat()];Ane(this,Ys,Ene(s,a));const l=u=>{Du(this,Ys).listen(),u.preventDefault(),Ul(u.keyCode,"TAB")&&(u.shiftKey?Du(this,Ys).toPreviousItem():Du(this,Ys).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:hM})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(hM)}addCondition(e,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:ls;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)}}filter(){const{navigableHeaders:e}=this.hot.getSettings(),n=this._createDataFilter(),r=!this.conditionCollection.isEmpty();let i=[];const o=this.conditionCollection.exportAllConditions();if(this.hot.runHooks("beforeFilter",o)!==!1)if(r){const a=[];this.hot.batchExecution(()=>{this.filtersRowsMap.clear(),i=Ue(n.filter(),u=>u.meta.visualRow);const l=uh(i);me(this.hot.countSourceRows()-1,u=>{l(u)||a.push(u)}),E(a,u=>{this.filtersRowsMap.setValueAtIndex(u,!0)})},!0),!e&&!i.length&&this.hot.deselectCell()}else this.filtersRowsMap.clear();this.hot.runHooks("afterFilter",o),this.hot.view.adjustElementsSize(!0),this.hot.render(),this.hot.selection.isSelected()&&this.hot.selectCell(e?-1:0,this.hot.getSelectedRangeLast().highlight.col)}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 E(this.hot.getSourceDataAtCol(n),(i,o)=>{var s;const{row:a,col:l,visualCol:u,visualRow:c,type:h,instance:d,dateFormat:g,locale:p}=this.hot.getCellMeta(o,n),v=(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:g,locale:p},value:ED(v)})}),r}updateValueComponentCondition(e){const n=this.hot.getDataAtCol(e),r=AS(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===Kf&&n.command.key!==un&&r.command.key!==un&&i.command.key!==un?o=lR:i.command.key!==un&&(n.command.key===un||r.command.key===un)&&(o=ls),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 kD(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 E(i,s=>{E(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 Hne(t){t&&E(t,e=>{const[,n]=e,r=this.hot.propToCol(n);this.conditionCollection.hasConditions(r)&&this.updateValueComponentCondition(r)})}function Dne(){this.restoreComponents(Array.from(this.components.values()))}function Nne(){this.components.get("filter_by_condition").getSelectElement().closeOptions(),this.components.get("filter_by_condition2").getSelectElement().closeOptions()}function Lne(t){t.items.push({name:ze}),this.components.forEach(e=>{t.items.push(e.getMenuItemDescriptor())})}function CM(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!==un&&(this.conditionCollection.addCondition(i,o,l,u),s.command.key!==un&&this.conditionCollection.addCondition(i,s,l,u)),a.command.key!==un&&this.conditionCollection.addCondition(i,a,l,u),this.conditionUpdateObserver.flush(),this.components.forEach(c=>c.saveState(i)),this.filtersRowsMap.clear(),this.filter()}(e=this.dropdownMenuPlugin)===null||e===void 0||e.close()}function $ne(t,e){this.updateDependentComponentsVisibility(),t.constructor===OS&&!e.inputsCount&&this.setListeningDropdownMenu()}function SM(){this.setListeningDropdownMenu()}function kne(t,e){const n=this.hot.toPhysicalColumn(t);this.enabled&&this.conditionCollection.hasConditions(n)?q(e,"htFiltersActive"):Le(e,"htFiltersActive")}function Fne(t){var e;if(!((e=this.dropdownMenuPlugin)!==null&&e!==void 0&&e.enabled))return;const{editedConditionStack:{conditions:n,column:r}}=t,i=n.filter(s=>s.name===sa),o=n.filter(s=>s.name!==sa);if(i.length>=2||o.length>=3)gt(ht`The filter conditions have been applied properly, but couldnt be displayed visually.\x20
The overall amount of conditions exceed the capability of the dropdown menu.\x20
For more details see the documentation.`);else{const s=this.conditionCollection.getOperation(r);this.components.get("filter_by_condition").updateState(o[0],r),this.components.get("filter_by_condition2").updateState(o[1],r),this.components.get("filter_operators").updateState(s,r),this.components.get("filter_by_value").updateState(t)}}const BD="internal-use-in-handsontable",PS={licenseKey:BD,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 UD(t){var e;return{maxColumns:t.maxColumns,maxRows:t.maxRows,language:(e=t[bn])===null||e===void 0||(e=e.language)===null||e===void 0?void 0:e.langCode}}function YD(t){return Object.keys(t).reduce((e,n)=>(n!=="hyperformula"&&(e[n]=t[n]),e),{})}function Wne(t){var e;const n=t[bn],r=YD(n!=null&&(e=n.engine)!==null&&e!==void 0&&e.hyperformula?n.engine:{}),i=UD(t);return{...PS,...r,...i}}function Vne(t){var e;const n=t[bn],r=YD(n!=null&&(e=n.engine)!==null&&e!==void 0&&e.hyperformula?n.engine:{}),i=UD(t);return{...r,...i}}function Bne(t,e){return Object.keys(e).some(n=>e[n]!==void 0&&e[n]!==t[n])}function Mp(){const t="engine_relationship",e=ai(bn);return e.hasItem(t)||e.register(t,new Map),e.getItem(t)}function uR(){const t="shared_engine_usage",e=ai(bn);return e.hasItem(t)||e.register(t,new Map),e.getItem(t)}function Une(t){const e=t.getSettings(),n=e[bn],r=n==null?void 0:n.engine;if(n===!0||Ct(r))return null;if(typeof r.hyperformula=="function"||typeof r=="function"){var i;return Yne((i=r.hyperformula)!==null&&i!==void 0?i:r,e,t)}else if(typeof r=="object"&&Ct(r.hyperformula)){const o=Mp(),s=uR().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:BD}),(r.getConfig().leapYear1900!==PS.leapYear1900||$g(r.getConfig().nullDate,PS.nullDate)===!1)&&gt(ht`If you use HyperFormula with Handsontable, keep the default \`leapYear1900\` and \`nullDate\`
settings. Otherwise, HyperFormula's dates may not sync correctly with Handsontable's dates.`),r}return null}function Yne(t,e,n){const r=e[bn],i=Wne(e),o=Mp(),s=uR();Gne(t,r.functions),zne(t,r.language);const a=t.buildEmpty(i);return o.set(a,[n]),s.set(a,[n.guid]),jne(a,r.namedExpressions),a.on("sheetAdded",()=>{a.rebuildAndRecalculate()}),a.on("sheetRemoved",()=>{a.rebuildAndRecalculate()}),a}function yM(t){var e;const n=Mp(),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 bM(t,e){if(t){const n=Mp(),r=n.get(t),i=uR(),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 Gne(t,e){e&&e.forEach(n=>{const{name:r,plugin:i,translations:o}=n;try{t.registerFunction(r,i,o)}catch(s){gt(s.message)}})}function zne(t,e){if(e){const{langCode:n}=e;try{t.registerLanguage(n,e)}catch(r){gt(r.message)}}}function jne(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){gt(a.message)}}),t.resumeEvaluation())}function Kne(t,e){return(Ct(e)||!t.doesSheetExist(e))&&(e=t.addSheet(e)),e}const GD="DD/MM/YYYY";function zD(t){return typeof t=="string"&&t.charAt(0)==="'"&&t.charAt(1)==="="}function Xne(t){return zD(t)?t.substr(1):t}function qne(t){return typeof t=="string"&&t.startsWith("=")}function cR(t,e){return typeof t=="string"&&e==="date"}function jD(t,e){return X(t,e,!0).isValid()}function KD(t,e){return X(t,e,!0).format(GD)}function Zne(t,e){return X(t,GD,!0).format(e)}function XD(t,e){const r=new Date(Date.UTC(0,0,t+-1));return X(r).format(e)}function Gs(t,e,n){Qne(t,e),e.set(t,n)}function Qne(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function bt(t,e){var n=qD(t,e,"get");return Jne(t,n)}function Jne(t,e){return e.get?e.get.call(t):e.value}function Wo(t,e,n){var r=qD(t,e,"set");return ere(t,r,n),n}function qD(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}function ere(t,e,n){if(e.set)e.set.call(t,n);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=n}}var Nu=new WeakMap,Vo=new WeakMap,sr=new WeakMap,Td=new WeakMap,Av=new WeakMap,Ov=new WeakMap,_d=new WeakMap;class tre{constructor(e,n,r){Gs(this,Nu,{writable:!0,value:void 0}),Gs(this,Vo,{writable:!0,value:void 0}),Gs(this,sr,{writable:!0,value:void 0}),Gs(this,Td,{writable:!0,value:[]}),Gs(this,Av,{writable:!0,value:[]}),Gs(this,Ov,{writable:!0,value:void 0}),Gs(this,_d,{writable:!0,value:[]}),Wo(this,Nu,e),Wo(this,Vo,n),Wo(this,sr,r)}setRemovedHfIndexes(e){return Wo(this,_d,e.map(n=>{const r=bt(this,Vo).getVisualFromPhysicalIndex(n);return this.getHfIndexFromVisualIndex(r)})),bt(this,_d)}getRemovedHfIndexes(){return bt(this,_d)}getHfIndexFromVisualIndex(e){const n=bt(this,Vo).getIndexesSequence(),r=bt(this,Vo).getNotTrimmedIndexes();return n.indexOf(r[e])}syncMoves(e){const r=`move${En(bt(this,Nu))}s`;bt(this,sr).getEngine().batch(()=>{e.forEach(i=>{const o=i.from!==i.to,s=i.from+1!==i.to;o&&s&&bt(this,sr).getEngine()[r](bt(this,sr).getSheetId(),i.from,1,i.to)})})}storeMovesInformation(e,n,r){r!==!1&&(Wo(this,Av,e.map(i=>this.getHfIndexFromVisualIndex(i))),Wo(this,Ov,this.getHfIndexFromVisualIndex(n)))}getMoveLine(e,n){const r=bt(this,Vo).getNumberOfIndexes(),i=Array.from(Array(r).keys()).filter(s=>e.includes(s)===!1);if(n===0){var o;return(o=i[n])!==null&&o!==void 0?o:0}return i[n-1]+1}getInitiallyCalculatedMoves(e,n){let r=this.getMoveLine(e,n);const i=[];return e.forEach(o=>{const s={from:o,to:r};i.forEach(a=>{const l=a.from>a.to,u=a.to<=s.from;a.from>s.from&&u&&l&&(s.from+=1)}),s.from>=r&&(r+=1),i.push(s)}),i}adjustedCalculatedMoves(e){return e.forEach((n,r)=>{e.slice(r+1).forEach(o=>{const s=o.from<o.to;o.from>n.from&&s&&(o.from-=1)})}),e}calculateAndSyncMoves(e,n){if(bt(this,sr).isPerformingUndoRedo()||e===!1||n===!1)return;const r=this.adjustedCalculatedMoves(this.getInitiallyCalculatedMoves(bt(this,Av),bt(this,Ov)));bt(this,sr).getSheetId()===null?bt(this,sr).getPostponeAction(()=>this.syncMoves(r)):this.syncMoves(r)}getIndexesChangeSyncMethod(){const e=`set${En(bt(this,Nu))}Order`;return n=>{if(bt(this,sr).isPerformingUndoRedo())return;const r=bt(this,Vo).getIndexesSequence();if(n==="update"){const i=bt(this,Td).map(l=>r.indexOf(l)),o=bt(this,sr).getEngine().getSheetDimensions(bt(this,sr).getSheetId());let s;bt(this,Nu)==="row"?s=o.height:s=o.width;const a=i.length;for(let l=a;l<s;l+=1)i.push(l);bt(this,sr).getEngine()[e](bt(this,sr).getSheetId(),i)}Wo(this,Td,r)}}init(){Wo(this,Td,bt(this,Vo).getIndexesSequence())}}const RM=tre;function zs(t,e,n){nre(t,e),e.set(t,n)}function nre(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Zi(t,e){var n=ZD(t,e,"get");return rre(t,n)}function rre(t,e){return e.get?e.get.call(t):e.value}function js(t,e,n){var r=ZD(t,e,"set");return ire(t,r,n),n}function ZD(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}function ire(t,e,n){if(e.set)e.set.call(t,n);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=n}}var Md=new WeakMap,Ad=new WeakMap,Iv=new WeakMap,Pv=new WeakMap,xv=new WeakMap,Hv=new WeakMap,Dv=new WeakMap;class ore{constructor(e,n,r){zs(this,Md,{writable:!0,value:void 0}),zs(this,Ad,{writable:!0,value:void 0}),zs(this,Iv,{writable:!0,value:void 0}),zs(this,Pv,{writable:!0,value:!1}),zs(this,xv,{writable:!0,value:!1}),zs(this,Hv,{writable:!0,value:null}),zs(this,Dv,{writable:!0,value:null}),js(this,Md,new RM("row",e,this)),js(this,Ad,new RM("column",n,this)),js(this,Iv,r)}getForAxis(e){return e==="row"?Zi(this,Md):Zi(this,Ad)}setPerformUndo(e){js(this,Pv,e)}setPerformRedo(e){js(this,xv,e)}isPerformingUndoRedo(){return Zi(this,Pv)||Zi(this,xv)}getSheetId(){return Zi(this,Dv)}getEngine(){return Zi(this,Hv)}getPostponeAction(){return Zi(this,Iv)}setupSyncEndpoint(e,n){js(this,Hv,e),js(this,Dv,n),Zi(this,Md).init(),Zi(this,Ad).init()}}const sre=ore;function Mt(t,e){QD(t,e),e.add(t)}function Qa(t,e,n){return e=are(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function are(t){var e=lre(t,"string");return typeof e=="symbol"?e:String(e)}function lre(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Nv(t,e,n){QD(t,e),e.set(t,n)}function QD(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ps(t,e,n){var r=JD(t,e,"set");return ure(t,r,n),n}function ure(t,e,n){if(e.set)e.set.call(t,n);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=n}}function Ol(t,e){var n=JD(t,e,"get");return cre(t,n)}function JD(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}function cre(t,e){return e.get?e.get.call(t):e.value}function wt(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}const bn="formulas",hre=["maxRows","maxColumns","language"],dre=260;de.getSingleton().register("afterNamedExpressionAdded");de.getSingleton().register("afterNamedExpressionRemoved");de.getSingleton().register("afterSheetAdded");de.getSingleton().register("afterSheetRemoved");de.getSingleton().register("afterSheetRenamed");de.getSingleton().register("afterFormulasValuesUpdate");const Kl=t=>t==="UndoRedo.undo"||t==="UndoRedo.redo"||t==="auto";var So=new WeakMap,hR=new WeakMap,Lu=new WeakMap,EM=new WeakSet,TM=new WeakSet,Lv=new WeakSet,_M=new WeakSet,$v=new WeakSet,MM=new WeakSet,AM=new WeakSet,kv=new WeakSet,OM=new WeakSet,IM=new WeakSet,PM=new WeakSet,xM=new WeakSet,HM=new WeakSet,DM=new WeakSet,NM=new WeakSet,LM=new WeakSet,$M=new WeakSet,kM=new WeakSet,FM=new WeakSet,WM=new WeakSet,VM=new WeakSet,BM=new WeakSet,UM=new WeakSet,YM=new WeakSet;class fre extends it{constructor(){var e;super(...arguments),e=this,Mt(this,YM),Mt(this,UM),Mt(this,BM),Mt(this,VM),Mt(this,WM),Mt(this,FM),Mt(this,kM),Mt(this,$M),Mt(this,LM),Mt(this,NM),Mt(this,DM),Mt(this,HM),Mt(this,xM),Mt(this,PM),Mt(this,IM),Mt(this,OM),Mt(this,kv),Mt(this,AM),Mt(this,MM),Mt(this,$v),Mt(this,_M),Mt(this,Lv),Mt(this,TM),Mt(this,EM),Nv(this,So,{writable:!0,value:!1}),Nv(this,hR,{writable:!0,value:!1}),Nv(this,Lu,{writable:!0,value:[["valuesUpdated",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return wt(e,FM,Ore).call(e,...r)}],["namedExpressionAdded",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return wt(e,WM,Ire).call(e,...r)}],["namedExpressionRemoved",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return wt(e,VM,Pre).call(e,...r)}],["sheetAdded",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return wt(e,BM,xre).call(e,...r)}],["sheetRenamed",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return wt(e,UM,Hre).call(e,...r)}],["sheetRemoved",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return wt(e,YM,Dre).call(e,...r)}]]}),Qa(this,"staticRegister",ai("formulas")),Qa(this,"engine",null),Qa(this,"sheetName",null),Qa(this,"indexSyncer",null),Qa(this,"rowAxisSyncer",null),Qa(this,"columnAxisSyncer",null)}static get PLUGIN_KEY(){return bn}static get PLUGIN_PRIORITY(){return dre}static get SETTING_KEYS(){return[bn,...hre]}get sheetId(){return this.sheetName===null?null:this.engine.getSheetId(this.sheetName)}isEnabled(){return!!this.hot.getSettings()[bn]}enablePlugin(){var e,n=this;if(!this.enabled){if(this.engine=(e=Une(this.hot))!==null&&e!==void 0?e:this.engine,!this.engine){gt("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&&(this.sheetName=r)}this.addHook("beforeLoadData",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return wt(n,Lv,GM).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 wt(n,$v,zM).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 wt(n,Lv,GM).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 wt(n,$v,zM).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 wt(n,MM,wre).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 wt(n,AM,vre).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 wt(n,EM,gre).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 wt(n,OM,Cre).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 wt(n,kv,jM).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 wt(n,kv,jM).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 wt(n,IM,Sre).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 wt(n,PM,yre).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 wt(n,DM,Ere).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 wt(n,NM,Tre).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 wt(n,xM,bre).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 wt(n,HM,Rre).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 wt(n,LM,_re).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 wt(n,$M,Mre).call(n,...i)}),this.indexSyncer=new sre(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 wt(n,_M,pre).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 wt(n,kM,Are).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 wt(n,TM,mre).call(n,...i)}),Ol(this,Lu).forEach(r=>{let[i,o]=r;return this.engine.on(i,o)}),super.enablePlugin()}}disablePlugin(){Ol(this,Lu).forEach(e=>{let[n,r]=e;return this.engine.off(n,r)}),bM(this.engine,this.hot),this.engine=null,super.disablePlugin()}updatePlugin(e){const n=Vne(this.hot.getSettings());Bne(this.engine.getConfig(),n)&&this.engine.updateConfig(n);const r=this.hot.getSettings()[bn];if(ue(r)&&ue(r.sheetName)&&r.sheetName!==this.sheetName&&this.switchSheet(r.sheetName),!e.data&&this.sheetName===null){const i=this.hot.getSettings()[bn].sheetName;i&&this.engine.doesSheetExist(i)?this.switchSheet(this.sheetName):this.sheetName=this.addSheet(i??void 0,this.hot.getSourceDataArray())}super.updatePlugin(e)}destroy(){Ol(this,Lu).forEach(e=>{var n;let[r,i]=e;return(n=this.engine)===null||n===void 0?void 0:n.off(r,i)}),ps(this,Lu,null),bM(this.engine,this.hot),this.engine=null,super.destroy()}addSheet(e,n){if(ue(n)&&!N1(n))return gt("The provided data should be an array of arrays."),!1;if(e!=null&&this.engine.doesSheetExist(e))return gt("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 gt(r.message),!1}}switchSheet(e){if(!this.engine.doesSheetExist(e)){jy(`The sheet named \`${e}\` does not exist, switch aborted.`);return}this.sheetName=e;const n=this.engine.getSheetSerialized(this.sheetId);n.length>0&&this.hot.loadData(n,`${En(bn)}.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))}),yM(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 ue(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(ue(l)===!1||ue(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=yM(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)){gt(`Not possible to set cell data at ${JSON.stringify(i)}`);return}const o=this.hot.getCellMeta(e,n);return cR(r,o.type)&&(jD(r,o.dateFormat)?r=KD(r,o.dateFormat):qne(r)===!1&&(r=`'${r}`)),this.engine.setCellContents(i,r)}}function gre(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"&&Wn(s)&&(s=XD(s,o.dateFormat)),typeof s=="object"&&s!==null?s.value:s}return t}function mre(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 g=this.engine.getFillRangeData(h,d),{row:p,col:v}=h.start,{row:S,col:y}=h.end,R=S-p+1,T=y-v+1;for(let N=0;N<g.length;N+=1)for(let I=0;I<g[N].length;I+=1){const F=g[N][I],B=N%R,ee=I%T,U=this.hot.getCellMeta(B,ee);cR(F,U.type)&&(F.startsWith("'")?g[N][I]=F.slice(1):this.isFormulaCellType(B,ee,this.sheetId)===!1&&(g[N][I]=Zne(F,U.dateFormat)))}return g}function GM(t,e){(arguments.length>2&&arguments[2]!==void 0?arguments[2]:"").includes(En(bn))||ps(this,hR,Ct(this.hot.getSettings().data))}function pre(){const t=this.hot.getSourceDataArray();let e=!1;t.forEach((n,r)=>{n.forEach((i,o)=>{const s=this.hot.getCellMeta(r,o),a=s.dateFormat;cR(i,s.type)&&(e=!0,jD(i,a)?t[r][o]=KD(i,a):this.isFormulaCellType(r,o)===!1&&(t[r][o]=`'${i}`))})}),e===!0&&(ps(this,So,!0),this.engine.setSheetContent(this.sheetId,t),ps(this,So,!1))}function zM(t,e){if(!(arguments.length>2&&arguments[2]!==void 0?arguments[2]:"").includes(En(bn)))if(this.sheetName=Kne(this.engine,this.hot.getSettings()[bn].sheetName),Ol(this,hR))this.switchSheet(this.sheetName);else{const r=this.hot.getSourceDataArray();if(this.engine.isItPossibleToReplaceSheetContent(this.sheetId,r)){ps(this,So,!0);const i=this.engine.setSheetContent(this.sheetId,r);this.indexSyncer.setupSyncEndpoint(this.engine,this.sheetId),this.renderDependentSheets(i),ps(this,So,!1)}}}function wre(t,e,n,r){if(r!=="get"||Ol(this,So)||this.sheetName===null||!this.engine.doesSheetExist(this.sheetName))return;const i=this.hot.toVisualRow(t);if(i===null||e===null)return;if(!this.isFormulaCellType(i,e)&&this.getCellType(i,e)!=="ARRAY"){zD(n.value)&&(n.value=Xne(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);l.type==="date"&&Wn(a)&&(a=XD(a,l.dateFormat));const u=typeof a=="object"&&a!==null?a.value:a;n.value=u}function vre(t,e,n,r){if(r!=="get"||Ol(this,So)||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||!this.isFormulaCellType(i,o)&&this.getCellType(i,o)!=="ARRAY")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 jM(t,e){if(Kl(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 Cre(t,e){if(Kl(e))return;const n=[],r=[];t.forEach(i=>{let[o,s,,a]=i;const l=this.hot.propToCol(s);if(!Wn(l))return;const u={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(o),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(l),sheet:this.sheetId};if(!this.engine.isItPossibleToSetCellContents(u)){gt(`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 Sre(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 yre(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 bre(t,e,n){return this.rowAxisSyncer.setRemovedHfIndexes(n).every(o=>this.engine.isItPossibleToRemoveRows(this.sheetId,[o,1]))===!1?!1:void 0}function Rre(t,e,n){return this.columnAxisSyncer.setRemovedHfIndexes(n).every(o=>this.engine.isItPossibleToRemoveColumns(this.sheetId,[o,1]))===!1?!1:void 0}function Ere(t,e,n){if(Kl(n))return;const r=this.engine.addRows(this.sheetId,[this.rowAxisSyncer.getHfIndexFromVisualIndex(t),e]);this.renderDependentSheets(r)}function Tre(t,e,n){if(Kl(n))return;const r=this.engine.addColumns(this.sheetId,[this.columnAxisSyncer.getHfIndexFromVisualIndex(t),e]);this.renderDependentSheets(r)}function _re(t,e,n,r){if(Kl(r))return;const i=this.rowAxisSyncer.getRemovedHfIndexes().sort().reverse(),o=this.engine.batch(()=>{i.forEach(s=>{this.engine.removeRows(this.sheetId,[s,1])})});this.renderDependentSheets(o)}function Mre(t,e,n,r){if(Kl(r))return;const i=this.columnAxisSyncer.getRemovedHfIndexes().sort().reverse(),o=this.engine.batch(()=>{i.forEach(s=>{this.engine.removeColumns(this.sheetId,[s,1])})});this.renderDependentSheets(o)}function Are(t,e,n){var r;ps(this,So,!0);const i=this.hot.getSourceDataArray(n,0,n+(((r=e.__children)===null||r===void 0?void 0:r.length)||0),this.hot.countSourceCols());ps(this,So,!1),i.forEach((o,s)=>{o.forEach((a,l)=>{this.engine.setCellContents({col:l,row:n+s,sheet:this.sheetId},[[a]])})})}function Ore(t){this.hot.runHooks("afterFormulasValuesUpdate",t)}function Ire(t,e){this.hot.runHooks("afterNamedExpressionAdded",t,e)}function Pre(t,e){this.hot.runHooks("afterNamedExpressionRemoved",t,e)}function xre(t){this.hot.runHooks("afterSheetAdded",t)}function Hre(t,e){this.hot.runHooks("afterSheetRenamed",t,e)}function Dre(t,e){this.hot.runHooks("afterSheetRemoved",t,e)}function Nre(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(xm,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(!0)},disabled:!1,hidden(){return!(this.selection.isSelectedByColumnHeader()||this.selection.isSelectedByCorner())}}}function Lre(t){const e=[];return{key:"hidden_columns_show",name(){const n=e.length>1?1:0;return this.getTranslatedPhrase(Hm,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(!0),o-i+1===this.countCols()||this.selectColumns(i,o)},disabled:!1,hidden(){const n=Ue(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 g=u.slice(i,o+1);c.push(...g.filter(p=>n.includes(p)))}}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 E(c,h=>{e.push(this.toVisualColumn(h))}),e.length===0}}}function Ja(t,e){eN(t,e),e.add(t)}function KM(t,e,n){eN(t,e),e.set(t,n)}function eN(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function el(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}function fr(t,e){var n=tN(t,e,"get");return $re(t,n)}function $re(t,e){return e.get?e.get.call(t):e.value}function $u(t,e,n){var r=tN(t,e,"set");return kre(t,r,n),n}function tN(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}function kre(t,e,n){if(e.set)e.set.call(t,n);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=n}}de.getSingleton().register("beforeHideColumns");de.getSingleton().register("afterHideColumns");de.getSingleton().register("beforeUnhideColumns");de.getSingleton().register("afterUnhideColumns");const Fv="hiddenColumns",Fre=310;var xi=new WeakMap,Ci=new WeakMap,XM=new WeakSet,qM=new WeakSet,ZM=new WeakSet,QM=new WeakSet,JM=new WeakSet,eA=new WeakSet;class Wre extends it{constructor(){super(...arguments),Ja(this,eA),Ja(this,JM),Ja(this,QM),Ja(this,ZM),Ja(this,qM),Ja(this,XM),KM(this,xi,{writable:!0,value:{}}),KM(this,Ci,{writable:!0,value:null})}static get PLUGIN_KEY(){return Fv}static get PLUGIN_PRIORITY(){return Fre}isEnabled(){return!!this.hot.getSettings()[Fv]}enablePlugin(){var e=this;if(this.enabled)return;const n=this.hot.getSettings()[Fv];Ve(n)&&($u(this,xi,n),Ct(n.copyPasteEnabled)&&(n.copyPasteEnabled=!0)),$u(this,Ci,new Gg),fr(this,Ci).addLocalHook("init",()=>el(this,eA,zre).call(this)),this.hot.columnIndexMapper.registerMap(this.pluginName,fr(this,Ci)),this.addHook("afterContextMenuDefaultOptions",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return el(e,JM,Gre).call(e,...i)}),this.addHook("afterGetCellMeta",(r,i,o)=>el(this,qM,Bre).call(this,r,i,o)),this.addHook("modifyColWidth",(r,i)=>el(this,XM,Vre).call(this,r,i)),this.addHook("afterGetColHeader",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return el(e,QM,Yre).call(e,...i)}),this.addHook("modifyCopyableRange",r=>el(this,ZM,Ure).call(this,r)),super.enablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.hot.columnIndexMapper.unregisterMap(this.pluginName),$u(this,xi,{}),super.disablePlugin(),this.resetCellsMeta()}showColumns(e){const n=this.getHiddenColumns(),r=this.isValidConfig(e);let i=n;const o=fr(this,Ci).getValues().slice(),s=e.length>0;if(r&&s){const l=e.map(u=>this.hot.toPhysicalColumn(u));E(l,u=>{o[u]=!1}),i=Yt(o,(u,c,h)=>(c&&u.push(this.hot.toVisualColumn(h)),u),[])}this.hot.runHooks("beforeUnhideColumns",n,i,r&&s)!==!1&&(r&&s&&fr(this,Ci).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(()=>{E(e,s=>{fr(this,Ci).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 Ue(fr(this,Ci).getHiddenIndexes(),e=>this.hot.toVisualColumn(e))}isHidden(e){return fr(this,Ci).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(){E(this.hot.getCellsMeta(),e=>{e&&(e.skipColumnOnPaste=!1)})}destroy(){$u(this,xi,null),$u(this,Ci,null),super.destroy()}}function Vre(t,e){if(this.isHidden(e))return 0;if(fr(this,xi).indicators&&(this.isHidden(e+1)||this.isHidden(e-1))&&typeof t=="number"&&this.hot.hasColHeaders())return t+15}function Bre(t,e,n){if(fr(this,xi).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 Ure(t){if(fr(this,xi).copyPasteEnabled)return t;const e=[],n=(r,i,o,s)=>{e.push({startRow:r,endRow:i,startCol:o,endCol:s})};return E(t,r=>{let i=!0,o=0;me(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 Yre(t,e){if(!fr(this,xi).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"),q(e,n)}function Gre(t){t.items.push({name:ze},Nre(this),Lre(this))}function zre(){Array.isArray(fr(this,xi).columns)&&this.hideColumns(fr(this,xi).columns)}function jre(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(Dm,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(!0)},disabled:!1,hidden(){return!(this.selection.isSelectedByRowHeader()||this.selection.isSelectedByCorner())}}}function Kre(t){const e=[];return{key:"hidden_rows_show",name(){const n=e.length>1?1:0;return this.getTranslatedPhrase(Nm,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(!0),o-i+1===this.countRows()||this.selectRows(i,o)},disabled:!1,hidden(){const n=Ue(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 g=u.slice(i,o+1);c.push(...g.filter(p=>n.includes(p)))}}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 E(c,h=>{e.push(this.toVisualRow(h))}),e.length===0}}}function tl(t,e){nN(t,e),e.add(t)}function tA(t,e,n){nN(t,e),e.set(t,n)}function nN(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function nl(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}function Ar(t,e){var n=rN(t,e,"get");return Xre(t,n)}function Xre(t,e){return e.get?e.get.call(t):e.value}function ku(t,e,n){var r=rN(t,e,"set");return qre(t,r,n),n}function rN(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}function qre(t,e,n){if(e.set)e.set.call(t,n);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=n}}de.getSingleton().register("beforeHideRows");de.getSingleton().register("afterHideRows");de.getSingleton().register("beforeUnhideRows");de.getSingleton().register("afterUnhideRows");const Wv="hiddenRows",Zre=320;var fo=new WeakMap,Si=new WeakMap,nA=new WeakSet,rA=new WeakSet,iA=new WeakSet,oA=new WeakSet,sA=new WeakSet,aA=new WeakSet;class Qre extends it{constructor(){super(...arguments),tl(this,aA),tl(this,sA),tl(this,oA),tl(this,iA),tl(this,rA),tl(this,nA),tA(this,fo,{writable:!0,value:{}}),tA(this,Si,{writable:!0,value:null})}static get PLUGIN_KEY(){return Wv}static get PLUGIN_PRIORITY(){return Zre}isEnabled(){return!!this.hot.getSettings()[Wv]}enablePlugin(){var e=this;if(this.enabled)return;const n=this.hot.getSettings()[Wv];Ve(n)&&(ku(this,fo,n),Ct(n.copyPasteEnabled)&&(n.copyPasteEnabled=!0)),ku(this,Si,new Gg),Ar(this,Si).addLocalHook("init",()=>nl(this,aA,iie).call(this)),this.hot.rowIndexMapper.registerMap(this.pluginName,Ar(this,Si)),this.addHook("afterContextMenuDefaultOptions",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return nl(e,sA,rie).call(e,...i)}),this.addHook("afterGetCellMeta",(r,i,o)=>nl(this,rA,eie).call(this,r,i,o)),this.addHook("modifyRowHeight",(r,i)=>nl(this,nA,Jre).call(this,r,i)),this.addHook("afterGetRowHeader",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return nl(e,oA,nie).call(e,...i)}),this.addHook("modifyCopyableRange",r=>nl(this,iA,tie).call(this,r)),super.enablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.hot.rowIndexMapper.unregisterMap(this.pluginName),ku(this,fo,{}),super.disablePlugin(),this.resetCellsMeta()}showRows(e){const n=this.getHiddenRows(),r=this.isValidConfig(e);let i=n;const o=Ar(this,Si).getValues().slice(),s=e.length>0;if(r&&s){const l=e.map(u=>this.hot.toPhysicalRow(u));E(l,u=>{o[u]=!1}),i=Yt(o,(u,c,h)=>(c&&u.push(this.hot.toVisualRow(h)),u),[])}this.hot.runHooks("beforeUnhideRows",n,i,r&&s)!==!1&&(r&&s&&Ar(this,Si).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(()=>{E(e,s=>{Ar(this,Si).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 Ue(Ar(this,Si).getHiddenIndexes(),e=>this.hot.toVisualRow(e))}isHidden(e){return Ar(this,Si).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(){E(this.hot.getCellsMeta(),e=>{e&&(e.skipRowOnPaste=!1)})}destroy(){ku(this,fo,null),ku(this,Si,null),super.destroy()}}function Jre(t,e){return this.isHidden(e)?0:t}function eie(t,e,n){if(Ar(this,fo).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 tie(t){if(Ar(this,fo).copyPasteEnabled)return t;const e=[],n=(r,i,o,s)=>{e.push({startRow:r,endRow:i,startCol:o,endCol:s})};return E(t,r=>{let i=!0,o=0;me(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 nie(t,e){if(!Ar(this,fo).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"),q(e,n)}function rie(t){t.items.push({name:ze},jre(this),Kre(this))}function iie(){Array.isArray(Ar(this,fo).rows)&&this.hideRows(Ar(this,fo).rows)}function oie(t){return{key:"freeze_column",name(){return this.getTranslatedPhrase(lm)},callback(e,n){const[{start:{col:r}}]=n;t.freezeColumn(r),this.render(),this.view.adjustElementsSize(!0)},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 sie(t){return{key:"unfreeze_column",name(){return this.getTranslatedPhrase(um)},callback(e,n){const[{start:{col:r}}]=n;t.unfreezeColumn(r),this.render(),this.view.adjustElementsSize(!0)},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 lA(t,e){iN(t,e),e.add(t)}function aie(t,e,n){iN(t,e),e.set(t,n)}function iN(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function xS(t,e){var n=oN(t,e,"get");return lie(t,n)}function lie(t,e){return e.get?e.get.call(t):e.value}function Vv(t,e,n){var r=oN(t,e,"set");return uie(t,r,n),n}function oN(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}function uie(t,e,n){if(e.set)e.set.call(t,n);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=n}}function uA(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}de.getSingleton().register("beforeColumnFreeze");de.getSingleton().register("afterColumnFreeze");de.getSingleton().register("beforeColumnUnfreeze");de.getSingleton().register("afterColumnUnfreeze");const cA="manualColumnFreeze",cie=110;var ea=new WeakMap,hA=new WeakSet,dA=new WeakSet;class hie extends it{constructor(){super(...arguments),lA(this,dA),lA(this,hA),aie(this,ea,{writable:!0,value:!1})}static get PLUGIN_KEY(){return cA}static get PLUGIN_PRIORITY(){return cie}isEnabled(){return!!this.hot.getSettings()[cA]}enablePlugin(){this.enabled||(this.addHook("afterContextMenuDefaultOptions",e=>uA(this,hA,die).call(this,e)),this.addHook("beforeColumnMove",(e,n)=>uA(this,dA,fie).call(this,e,n)),super.enablePlugin())}disablePlugin(){Vv(this,ea,!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;xS(this,ea)||Vv(this,ea,!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;xS(this,ea)||Vv(this,ea,!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 die(t){t.items.push({name:"---------"},oie(this),sie(this))}function fie(t,e){if(xS(this,ea)){const n=this.hot.getSettings().fixedColumnsStart;if(e<n||t.some(r=>r<n))return!1}}function Od(t,e,n){return e=gie(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function gie(t){var e=mie(t,"string");return typeof e=="symbol"?e:String(e)}function mie(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const Bv=0,fA=1,gA=2,rl="px";let pie=class{constructor(e){Od(this,"hot",void 0),Od(this,"_element",null),Od(this,"state",Bv),Od(this,"inlineProperty",void 0),this.hot=e,this.inlineProperty=e.isRtl()?"right":"left"}appendTo(e){e.appendChild(this._element),this.state=gA}build(){this.state===Bv&&(this._element=this.hot.rootDocument.createElement("div"),this.state=fA)}destroy(){this.isAppended()&&this._element.parentElement.removeChild(this._element),this._element=null,this.state=Bv}isAppended(){return this.state===gA}isBuilt(){return this.state>=fA}setPosition(e,n){Wn(e)&&(this._element.style.top=e+rl),Wn(n)&&(this._element.style[this.inlineProperty]=n+rl)}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){Wn(e)&&(this._element.style.width=e+rl),Wn(n)&&(this._element.style.height=n+rl)}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){Wn(e)&&(this._element.style.marginTop=e+rl),Wn(n)&&(this._element.style[`margin${En(this.inlineProperty)}`]=n+rl)}getOffset(){const e=this._element.style,n=`margin${En(this.inlineProperty)}`;return{top:e.marginTop?parseInt(e.marginTop,10):0,start:e[n]?parseInt(e[n],10):0}}};const sN=pie,wie="ht__manualColumnMove--backlight";let vie=class extends sN{build(){super.build(),q(this._element,wie)}};const Cie=vie,Sie="ht__manualColumnMove--guideline";let yie=class extends sN{build(){super.build(),q(this._element,Sie)}};const bie=yie;function il(t,e){aN(t,e),e.add(t)}function Gr(t,e,n){aN(t,e),e.set(t,n)}function aN(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function nr(t,e,n){var r=lN(t,e,"set");return Rie(t,r,n),n}function Rie(t,e,n){if(e.set)e.set.call(t,n);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=n}}function ge(t,e){var n=lN(t,e,"get");return Eie(t,n)}function lN(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}function Eie(t,e){return e.get?e.get.call(t):e.value}function ol(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}de.getSingleton().register("beforeColumnMove");de.getSingleton().register("afterColumnMove");const Uv="manualColumnMove",Tie=120,mA="ht__manualColumnMove",qf="show-ui",HS="on-moving--columns",DS="after-selection--columns";var kn=new WeakMap,Xo=new WeakMap,go=new WeakMap,hf=new WeakMap,ns=new WeakMap,$n=new WeakMap,Id=new WeakMap,Er=new WeakMap,wl=new WeakMap,Zf=new WeakMap,cc=new WeakMap,pA=new WeakSet,wA=new WeakSet,vA=new WeakSet,CA=new WeakSet,SA=new WeakSet,yA=new WeakSet;class _ie extends it{constructor(){super(...arguments),il(this,yA),il(this,SA),il(this,CA),il(this,vA),il(this,wA),il(this,pA),Gr(this,kn,{writable:!0,value:new Cie(this.hot)}),Gr(this,Xo,{writable:!0,value:new bie(this.hot)}),Gr(this,go,{writable:!0,value:[]}),Gr(this,hf,{writable:!0,value:0}),Gr(this,ns,{writable:!0,value:!1}),Gr(this,$n,{writable:!0,value:{}}),Gr(this,Id,{writable:!0,value:void 0}),Gr(this,Er,{writable:!0,value:void 0}),Gr(this,wl,{writable:!0,value:void 0}),Gr(this,Zf,{writable:!0,value:void 0}),Gr(this,cc,{writable:!0,value:void 0})}static get PLUGIN_KEY(){return Uv}static get PLUGIN_PRIORITY(){return Tie}isEnabled(){return!!this.hot.getSettings()[Uv]}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 ol(e,pA,Mie).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 ol(e,vA,Oie).call(e,...r)}),this.addHook("afterScrollVertically",()=>ol(this,SA,Pie).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 ol(e,yA,xie).call(e,...r)}),this.buildPluginUI(),this.registerEvents(),q(this.hot.rootElement,mA),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.moveBySettingsOrLoad(),super.updatePlugin()}disablePlugin(){Le(this.hot.rootElement,mA),this.unregisterEvents(),ge(this,kn).destroy(),ge(this,Xo).destroy(),super.disablePlugin()}moveColumn(e,n){return this.moveColumns([e],n)}moveColumns(e,n){const r=ge(this,Id),i=this.isMovePossible(e,n),o=this.hot.runHooks("beforeColumnMove",e,n,r,i);if(nr(this,Id,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 nr(this,Id,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=Yt(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.getStretchedColumnWidth(s)||0)}return i}moveBySettingsOrLoad(){const e=this.hot.getSettings()[Uv];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 me(e,n,i=>{r.push(i)}),r}refreshPositions(){const e=this.hot.view.getFirstFullyVisibleColumn();this.isFixedColumnsStart(ge(this,Er))&&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,ge(this,Er)-1);const s=n.hider.offsetWidth,a=n.TBODY.offsetLeft,l=ge(this,kn).getOffset().start,u=ge(this,kn).getSize().width;let c=0,h=0;if(this.hot.isRtl()){const p=this.hot.rootWindow,v=ft(this.hot.rootElement),S=p.innerWidth-ge(this,wl)-v;h=p.innerWidth-ge(this,$n).eventPageX-S-(r.scrollX===void 0?i:0)}else h=ge(this,$n).eventPageX-(ge(this,wl)-(r.scrollX===void 0?i:0));if(ge(this,Zf)&&(c=this.hot.view._wt.wtOverlays.inlineStartOverlay.clone.wtTable.getColumnHeader(-1).offsetWidth),this.isFixedColumnsStart(ge(this,Er))&&(o+=i),o+=c,ge(this,Er)<0)ge(this,cc)>0?ge(this,$n).col=0:ge(this,$n).col=e>0?e-1:e;else if(ge(this,$n).TD.offsetWidth/2+o<=h){const p=ge(this,Er)>=ge(this,hf)?ge(this,hf)-1:ge(this,Er);ge(this,$n).col=p+1,o+=ge(this,$n).TD.offsetWidth}else ge(this,$n).col=ge(this,Er);let d=h,g=o;h+u+l>=s?d=s-u-l:h+l<a+c&&(d=a+c+Math.abs(l)),o>=s-1?g=s-1:g===0?g=1:r.scrollX!==void 0&&ge(this,Er)<ge(this,cc)&&(g-=ge(this,wl)<=r.scrollX?ge(this,wl):0),ge(this,kn).setPosition(null,d),ge(this,Xo).setPosition(null,g)}registerEvents(){const{documentElement:e}=this.hot.rootDocument;this.eventManager.addEventListener(e,"mousemove",n=>ol(this,wA,Aie).call(this,n)),this.eventManager.addEventListener(e,"mouseup",()=>ol(this,CA,Iie).call(this))}unregisterEvents(){this.eventManager.clear()}buildPluginUI(){ge(this,kn).build(),ge(this,Xo).build()}destroy(){ge(this,kn).destroy(),ge(this,Xo).destroy(),super.destroy()}}function Mie(t,e,n,r){const i=this.hot.view._wt.wtTable,o=this.hot.selection.isSelectedByColumnHeader(),s=this.hot.getSelectedRangeLast(),a=Ie(t.target,"sortAction");if(!s||!o||ge(this,ns)||t.button!==0||a){nr(this,ns,!1),ge(this,go).length=0,Le(this.hot.rootElement,[HS,qf]);return}const l=ge(this,Xo).isBuilt()&&!ge(this,Xo).isAppended(),u=ge(this,kn).isBuilt()&&!ge(this,kn).isAppended();l&&u&&(ge(this,Xo).appendTo(i.hider),ge(this,kn).appendTo(i.hider));const{from:c,to:h}=s,d=Math.min(c.col,h.col),g=Math.max(c.col,h.col);if(e.row<0&&e.col>=d&&e.col<=g){r.column=!0,nr(this,ns,!0);const p=n.firstChild?Bx(t,n.firstChild).x:t.offsetX;ge(this,$n).eventPageX=t.pageX,nr(this,Er,e.col),ge(this,$n).TD=n,ge(this,$n).col=e.col,nr(this,go,this.prepareColumnsToMoving(d,g)),nr(this,Zf,!!this.hot.getSettings().rowHeaders),nr(this,hf,this.hot.countCols()),nr(this,cc,this.hot.getSettings().fixedColumnsStart),nr(this,wl,en(this.hot.rootElement).left);const v=ge(this,Zf)?-1:0,S=i.holder.scrollTop+i.getColumnHeaderHeight(0)+1,y=e.col<ge(this,cc),R=this.hot.view._wt.wtOverlays.inlineStartOverlay.getOverlayOffset(),T=Math.abs(p-(this.hot.isRtl()?n.offsetWidth:0)),N=this.getColumnsWidth(d,e.col-1)+T,I=this.getColumnsWidth(v,d-1)+(y?R:0)+N;ge(this,kn).setPosition(S,I),ge(this,kn).setSize(this.getColumnsWidth(d,g),i.hider.offsetHeight-S),ge(this,kn).setOffset(null,-N),q(this.hot.rootElement,HS)}else Le(this.hot.rootElement,DS),nr(this,ns,!1),ge(this,go).length=0}function Aie(t){ge(this,ns)&&(ge(this,$n).eventPageX=t.pageX,this.refreshPositions())}function Oie(t,e,n,r){!this.hot.getSelectedRangeLast()||!ge(this,ns)||(ge(this,go).indexOf(e.col)>-1?Le(this.hot.rootElement,qf):q(this.hot.rootElement,qf),r.row=!0,r.column=!0,r.cell=!0,nr(this,Er,e.col),ge(this,$n).TD=n)}function Iie(){const t=ge(this,$n).col,e=ge(this,go).length;if(nr(this,Er,void 0),nr(this,ns,!1),Le(this.hot.rootElement,[HS,qf,DS]),this.hot.selection.isSelectedByColumnHeader()&&q(this.hot.rootElement,DS),e<1||t===void 0)return;const n=ge(this,go)[0],r=this.hot.toPhysicalColumn(n),i=this.dragColumns(ge(this,go),t);if(ge(this,go).length=0,i===!0){this.persistentStateSave(),this.hot.render(),this.hot.view.adjustElementsSize(!0);const o=this.hot.toVisualColumn(r),s=o+e-1;this.hot.selectColumns(o,s)}}function Pie(){const t=this.hot.view._wt.wtTable,e=t.getColumnHeaderHeight(0)+1,n=t.holder.scrollTop,r=e+n;ge(this,kn).setPosition(r),ge(this,kn).setSize(null,t.hider.offsetHeight-r)}function xie(){this.moveBySettingsOrLoad()}function Qi(t,e){uN(t,e),e.add(t)}function wn(t,e,n){uN(t,e),e.set(t,n)}function uN(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ji(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}function Ut(t,e,n){var r=cN(t,e,"set");return Hie(t,r,n),n}function Hie(t,e,n){if(e.set)e.set.call(t,n);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=n}}function ae(t,e){var n=cN(t,e,"get");return Die(t,n)}function cN(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}function Die(t,e){return e.get?e.get.call(t):e.value}const Qf="manualColumnResize",Nie=130,bA="manualColumnWidths";var oo=new WeakMap,Pd=new WeakMap,cr=new WeakMap,Jf=new WeakMap,Ii=new WeakMap,Lie=new WeakMap,Il=new WeakMap,xd=new WeakMap,Zn=new WeakMap,to=new WeakMap,ga=new WeakMap,eg=new WeakMap,hc=new WeakMap,dc=new WeakMap,dr=new WeakMap,fc=new WeakMap,RA=new WeakSet,EA=new WeakSet,TA=new WeakSet,_A=new WeakSet,MA=new WeakSet,AA=new WeakSet,OA=new WeakSet,IA=new WeakSet,PA=new WeakSet;class $ie extends it{static get PLUGIN_KEY(){return Qf}static get PLUGIN_PRIORITY(){return Nie}constructor(e){super(e),Qi(this,PA),Qi(this,IA),Qi(this,OA),Qi(this,AA),Qi(this,MA),Qi(this,_A),Qi(this,TA),Qi(this,EA),Qi(this,RA),wn(this,oo,{writable:!0,value:null}),wn(this,Pd,{writable:!0,value:null}),wn(this,cr,{writable:!0,value:[]}),wn(this,Jf,{writable:!0,value:null}),wn(this,Ii,{writable:!0,value:null}),wn(this,Lie,{writable:!0,value:null}),wn(this,Il,{writable:!0,value:null}),wn(this,xd,{writable:!0,value:null}),wn(this,Zn,{writable:!0,value:this.hot.rootDocument.createElement("DIV")}),wn(this,to,{writable:!0,value:this.hot.rootDocument.createElement("DIV")}),wn(this,ga,{writable:!0,value:null}),wn(this,eg,{writable:!0,value:!1}),wn(this,hc,{writable:!0,value:0}),wn(this,dc,{writable:!0,value:null}),wn(this,dr,{writable:!0,value:void 0}),wn(this,fc,{writable:!0,value:void 0}),q(ae(this,Zn),"manualColumnResizer"),q(ae(this,to),"manualColumnResizerGuide")}get inlineDir(){return this.hot.isRtl()?"right":"left"}isEnabled(){return this.hot.getSettings()[Qf]}enablePlugin(){this.enabled||(Ut(this,dr,new ys),ae(this,dr).addLocalHook("init",()=>Ji(this,RA,kie).call(this)),this.hot.columnIndexMapper.registerMap(this.pluginName,ae(this,dr)),this.addHook("modifyColWidth",(e,n)=>Ji(this,OA,Yie).call(this,e,n)),this.addHook("beforeStretchingColumnWidth",(e,n)=>Ji(this,IA,Gie).call(this,e,n)),this.addHook("beforeColumnResize",(e,n,r)=>Ji(this,PA,zie).call(this,e,n,r)),this.bindEvents(),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){Ut(this,fc,ae(this,dr).getValues()),this.hot.columnIndexMapper.unregisterMap(this.pluginName),super.disablePlugin()}saveManualColumnWidths(){this.hot.runHooks("persistentStateSave",bA,ae(this,dr).getValues())}loadManualColumnWidths(){const e={};return this.hot.runHooks("persistentStateLoad",bA,e),e.value}setManualSize(e,n){const r=Math.max(n,20),i=this.hot.toPhysicalColumn(e);return ae(this,dr).setValueAtIndex(i,r),r}clearManualSize(e){const n=this.hot.toPhysicalColumn(e);ae(this,dr).setValueAtIndex(n,null)}setupHandlePosition(e){if(!e.parentNode)return;Ut(this,oo,e);const{_wt:n}=this.hot.view,r=n.wtTable.getCoords(ae(this,oo)),i=r.col;if(i<0)return;const o=Pt(ae(this,oo)),s=ae(this,oo).getBoundingClientRect(),a=i<n.getSetting("fixedColumnsStart");let l;a&&(l=n.wtOverlays.topInlineStartCornerOverlay.getRelativeCellPosition(ae(this,oo),r.row,r.col)),l||(l=n.wtOverlays.topOverlay.getRelativeCellPosition(ae(this,oo),r.row,r.col)),Ut(this,Pd,this.hot.columnIndexMapper.getVisualFromRenderableIndex(i)),Ut(this,cr,[]);const u=this.hot.selection.isSelectedByCorner()||this.hot.selection.isSelectedByColumnHeader();if(this.hot.selection.isSelected()&&u){const c=this.hot.getSelectedRange();E(c,h=>{const d=h.getTopStartCorner().col,g=h.getBottomEndCorner().col;me(d,g,p=>{ae(this,cr).includes(p)||ae(this,cr).push(p)})})}ae(this,cr).includes(ae(this,Pd))||Ut(this,cr,[ae(this,Pd)]),Ut(this,xd,l.start-6),Ut(this,Il,parseInt(s.width,10)),ae(this,Zn).style.top=`${l.top}px`,ae(this,Zn).style[this.inlineDir]=`${ae(this,xd)+ae(this,Il)}px`,ae(this,Zn).style.height=`${o}px`,this.hot.rootElement.appendChild(ae(this,Zn))}refreshHandlePosition(){ae(this,Zn).style[this.inlineDir]=`${ae(this,xd)+ae(this,Jf)}px`}setupGuidePosition(){const e=parseInt(Pt(ae(this,Zn)),10),n=parseInt(ae(this,Zn).style.top,10)+e,r=parseInt(this.hot.view.maximumVisibleElementHeight(0),10);q(ae(this,Zn),"active"),q(ae(this,to),"active"),ae(this,to).style.top=`${n}px`,this.refreshGuidePosition(),ae(this,to).style.height=`${r-e}px`,this.hot.rootElement.appendChild(ae(this,to))}refreshGuidePosition(){ae(this,to).style[this.inlineDir]=ae(this,Zn).style[this.inlineDir]}hideHandleAndGuide(){Le(ae(this,Zn),"active"),Le(ae(this,to),"active")}checkIfColumnHeader(e){const n=cs(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.forceFullRender=!0,this.hot.view.render(),this.hot.view.adjustElementsSize(!0)},n=(r,i)=>{const o=this.hot.runHooks("beforeColumnResize",ae(this,Ii),r,!0);o!==void 0&&Ut(this,Ii,o),this.hot.getSettings().stretchH==="all"?this.clearManualSize(r):this.setManualSize(r,ae(this,Ii)),this.saveManualColumnWidths(),this.hot.runHooks("afterColumnResize",ae(this,Ii),r,!0),i&&e()};ae(this,hc)>=2&&(ae(this,cr).length>1?(E(ae(this,cr),i=>{n(i)}),e()):E(ae(this,cr),i=>{n(i,!0)})),Ut(this,hc,0),Ut(this,dc,null)}bindEvents(){const{rootWindow:e,rootElement:n}=this.hot;this.eventManager.addEventListener(n,"mouseover",r=>Ji(this,EA,Fie).call(this,r)),this.eventManager.addEventListener(n,"mousedown",r=>Ji(this,TA,Wie).call(this,r)),this.eventManager.addEventListener(e,"mousemove",r=>Ji(this,_A,Vie).call(this,r)),this.eventManager.addEventListener(e,"mouseup",()=>Ji(this,MA,Bie).call(this)),this.eventManager.addEventListener(ae(this,Zn),"contextmenu",()=>Ji(this,AA,Uie).call(this))}destroy(){super.destroy()}}function kie(){const t=this.hot.getSettings()[Qf],e=this.loadManualColumnWidths();typeof e<"u"?this.hot.batchExecution(()=>{e.forEach((n,r)=>{ae(this,dr).setValueAtIndex(r,n)})},!0):Array.isArray(t)?(this.hot.batchExecution(()=>{t.forEach((n,r)=>{ae(this,dr).setValueAtIndex(r,n)})},!0),Ut(this,fc,t)):t===!0&&Array.isArray(ae(this,fc))&&this.hot.batchExecution(()=>{ae(this,fc).forEach((n,r)=>{ae(this,dr).setValueAtIndex(r,n)})},!0)}function Fie(t){if(!$y(t.target)&&ae(this,eg)!==!0&&this.checkIfColumnHeader(t.target)){const e=this.getClosestTHParent(t.target);if(!e)return;const n=e.getAttribute("colspan");e&&(n===null||n==="1")&&(ae(this,ga)||this.setupHandlePosition(e))}}function Wie(t){Ie(t.target,"manualColumnResizer")&&(this.setupHandlePosition(ae(this,oo)),this.setupGuidePosition(),Ut(this,ga,!0),ae(this,dc)===null&&(Ut(this,dc,setTimeout(()=>this.afterMouseDownTimeout(),500)),this.hot._registerTimeout(ae(this,dc))),Ut(this,hc,ae(this,hc)+1),this.startX=t.pageX,Ut(this,Ii,ae(this,Il)))}function Vie(t){if(ae(this,ga)){const e=(t.pageX-this.startX)*this.hot.getDirectionFactor();Ut(this,Jf,ae(this,Il)+e),E(ae(this,cr),n=>{Ut(this,Ii,this.setManualSize(n,ae(this,Jf)))}),this.refreshHandlePosition(),this.refreshGuidePosition()}}function Bie(){const t=()=>{this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.adjustElementsSize(!0)},e=(n,r)=>{this.hot.runHooks("beforeColumnResize",ae(this,Ii),n,!1),r&&t(),this.saveManualColumnWidths(),this.hot.runHooks("afterColumnResize",ae(this,Ii),n,!1)};ae(this,ga)&&(this.hideHandleAndGuide(),Ut(this,ga,!1),ae(this,Ii)!==ae(this,Il)&&(ae(this,cr).length>1?(E(ae(this,cr),r=>{e(r)}),t()):E(ae(this,cr),r=>{e(r,!0)})),this.setupHandlePosition(ae(this,oo)))}function Uie(){this.hideHandleAndGuide(),this.hot.rootElement.removeChild(ae(this,Zn)),this.hot.rootElement.removeChild(ae(this,to)),Ut(this,ga,!1),Ut(this,eg,!0),this.hot._registerImmediate(()=>{Ut(this,eg,!1)})}function Yie(t,e){let n=t;if(this.enabled){const r=this.hot.toPhysicalColumn(e),i=ae(this,dr).getValueAtIndex(r);this.hot.getSettings()[Qf]&&i&&(n=i)}return n}function Gie(t,e){let n=ae(this,dr).getValueAtIndex(e);return n===null&&(n=t),n}function zie(){this.hot.view._wt.wtViewport.resetHasOversizedColumnHeadersMarked()}function Yv(t,e,n){return e=jie(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function jie(t){var e=Kie(t,"string");return typeof e=="symbol"?e:String(e)}function Kie(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const Gv=0,xA=1,HA=2,sl="px";let Xie=class{constructor(e){Yv(this,"hot",void 0),Yv(this,"_element",null),Yv(this,"state",Gv),this.hot=e}appendTo(e){e.appendChild(this._element),this.state=HA}build(){this.state===Gv&&(this._element=this.hot.rootDocument.createElement("div"),this.state=xA)}destroy(){this.isAppended()&&this._element.parentElement.removeChild(this._element),this._element=null,this.state=Gv}isAppended(){return this.state===HA}isBuilt(){return this.state>=xA}setPosition(e,n){e!==void 0&&(this._element.style.top=e+sl),n!==void 0&&(this._element.style.left=n+sl)}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+sl),n&&(this._element.style.height=n+sl)}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+sl),n&&(this._element.style.marginLeft=n+sl)}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 hN=Xie,qie="ht__manualRowMove--backlight";class Zie extends hN{build(){super.build(),q(this._element,qie)}}const Qie=Zie,Jie="ht__manualRowMove--guideline";class eoe extends hN{build(){super.build(),q(this._element,Jie)}}const toe=eoe;function al(t,e){dN(t,e),e.add(t)}function ll(t,e,n){dN(t,e),e.set(t,n)}function dN(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function aa(t,e,n){var r=fN(t,e,"set");return noe(t,r,n),n}function noe(t,e,n){if(e.set)e.set.call(t,n);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=n}}function $e(t,e){var n=fN(t,e,"get");return roe(t,n)}function fN(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}function roe(t,e){return e.get?e.get.call(t):e.value}function ul(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}de.getSingleton().register("beforeRowMove");de.getSingleton().register("afterRowMove");const zv="manualRowMove",ioe=140,DA="ht__manualRowMove",tg="show-ui",NS="on-moving--rows",LS="after-selection--rows";var Fn=new WeakMap,qo=new WeakMap,mo=new WeakMap,rs=new WeakMap,rr=new WeakMap,Hd=new WeakMap,NA=new WeakSet,LA=new WeakSet,$A=new WeakSet,kA=new WeakSet,FA=new WeakSet,WA=new WeakSet;class ooe extends it{constructor(){super(...arguments),al(this,WA),al(this,FA),al(this,kA),al(this,$A),al(this,LA),al(this,NA),ll(this,Fn,{writable:!0,value:new Qie(this.hot)}),ll(this,qo,{writable:!0,value:new toe(this.hot)}),ll(this,mo,{writable:!0,value:[]}),ll(this,rs,{writable:!0,value:void 0}),ll(this,rr,{writable:!0,value:{}}),ll(this,Hd,{writable:!0,value:void 0})}static get PLUGIN_KEY(){return zv}static get PLUGIN_PRIORITY(){return ioe}isEnabled(){return!!this.hot.getSettings()[zv]}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 ul(e,NA,soe).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 ul(e,$A,loe).call(e,...r)}),this.addHook("afterScrollHorizontally",()=>ul(this,FA,coe).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 ul(e,WA,hoe).call(e,...r)}),this.buildPluginUI(),this.registerEvents(),q(this.hot.rootElement,DA),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.moveBySettingsOrLoad(),super.updatePlugin()}disablePlugin(){Le(this.hot.rootElement,DA),this.unregisterEvents(),$e(this,Fn).destroy(),$e(this,qo).destroy(),super.disablePlugin()}moveRow(e,n){return this.moveRows([e],n)}moveRows(e,n){const r=$e(this,Hd),i=this.isMovePossible(e,n),o=this.hot.runHooks("beforeRowMove",e,n,r,i);if(aa(this,Hd,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 aa(this,Hd,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=Yt(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)||23)}return i}moveBySettingsOrLoad(){const e=this.hot.getSettings()[zv];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 me(o,s,a=>{n.push(a)}),n}refreshPositions(){const e=$e(this,rr).coords,n=this.hot.view.getFirstFullyVisibleRow(),r=this.hot.view.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=$e(this,rr).TD,a=this.hot.rootElement,l=en(a),u=ca(a),c=o.holder.scrollTop,h=this.hot.rootWindow!==u?u.scrollTop:0,d=l.top-h,g=$e(this,rr).eventPageY-d+c,p=o.hider.offsetHeight,v=o.TBODY.offsetTop,S=$e(this,Fn).getOffset().top,y=$e(this,Fn).getSize().height,R=s.offsetHeight/2,T=s.offsetHeight;let N=this.hot.view.THEAD.offsetHeight+this.getRowsHeight(0,e.row-1);const I=g>=N+R;this.isFixedRowTop(e.row)&&(N+=this.hot.view._wt.wtOverlays.topOverlay.getOverlayOffset()),e.row<0?$e(this,rr).row=n>0?n-1:n:I?($e(this,rr).row=e.row+1,N+=e.row===0?T-1:T):$e(this,rr).row=e.row;let F=g,B=N;g+y+S>=p?F=p-y-S:g+S<v&&(F=v+Math.abs(S)),N>=p-1&&(B=p-1),$e(this,Fn).setPosition(F),$e(this,qo).setPosition(B)}registerEvents(){const{documentElement:e}=this.hot.rootDocument;this.eventManager.addEventListener(e,"mousemove",n=>ul(this,LA,aoe).call(this,n)),this.eventManager.addEventListener(e,"mouseup",()=>ul(this,kA,uoe).call(this))}unregisterEvents(){this.eventManager.clear()}buildPluginUI(){$e(this,Fn).build(),$e(this,qo).build()}destroy(){$e(this,Fn).destroy(),$e(this,qo).destroy(),super.destroy()}}function soe(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||$e(this,rs)||t.button!==0){aa(this,rs,!1),$e(this,mo).length=0,Le(this.hot.rootElement,[NS,tg]);return}const l=$e(this,qo).isBuilt()&&!$e(this,qo).isAppended(),u=$e(this,Fn).isBuilt()&&!$e(this,Fn).isAppended();l&&u&&($e(this,qo).appendTo(i.hider),$e(this,Fn).appendTo(i.hider));const{from:c,to:h}=a,d=Math.min(c.row,h.row),g=Math.max(c.row,h.row);if(e.col<0&&e.row>=d&&e.row<=g){r.row=!0,aa(this,rs,!0),$e(this,rr).eventPageY=t.pageY,$e(this,rr).coords=e,$e(this,rr).TD=n,aa(this,mo,this.prepareRowsToMoving());const p=i.holder.scrollLeft+o.getRowHeaderWidth(),v=this.getRowsHeight(d,e.row-1)+t.offsetY;$e(this,Fn).setPosition(null,p),$e(this,Fn).setSize(i.hider.offsetWidth-p,this.getRowsHeight(d,g)),$e(this,Fn).setOffset(-v,null),q(this.hot.rootElement,NS),this.refreshPositions()}else Le(this.hot.rootElement,LS),aa(this,rs,!1),$e(this,mo).length=0}function aoe(t){$e(this,rs)&&($e(this,rr).eventPageY=t.pageY,this.refreshPositions())}function loe(t,e,n,r){!this.hot.getSelectedRangeLast()||!$e(this,rs)||($e(this,mo).indexOf(e.row)>-1?Le(this.hot.rootElement,tg):q(this.hot.rootElement,tg),r.row=!0,r.column=!0,r.cell=!0,$e(this,rr).coords=e,$e(this,rr).TD=n)}function uoe(){const t=$e(this,rr).row,e=$e(this,mo).length;if(aa(this,rs,!1),Le(this.hot.rootElement,[NS,tg,LS]),this.hot.selection.isSelectedByRowHeader()&&q(this.hot.rootElement,LS),e<1||t===void 0)return;const n=$e(this,mo)[0],r=this.hot.toPhysicalRow(n),i=this.dragRows($e(this,mo),t);if($e(this,mo).length=0,i===!0){this.persistentStateSave(),this.hot.render(),this.hot.view.adjustElementsSize(!0);const o=this.hot.toVisualRow(r),s=o+e-1;this.hot.selectRows(o,s)}}function coe(){const t=this.hot.view._wt.wtTable,e=this.hot.view._wt.wtViewport.getRowHeaderWidth(),n=t.holder.scrollLeft,r=e+n;$e(this,Fn).setPosition(null,r),$e(this,Fn).setSize(t.hider.offsetWidth-r)}function hoe(){this.moveBySettingsOrLoad()}function Ks(t,e){gN(t,e),e.add(t)}function vn(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 Xs(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}function Lt(t,e,n){var r=mN(t,e,"set");return doe(t,r,n),n}function doe(t,e,n){if(e.set)e.set.call(t,n);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=n}}function se(t,e){var n=mN(t,e,"get");return foe(t,n)}function mN(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}function foe(t,e){return e.get?e.get.call(t):e.value}const ng="manualRowResize",goe=30,VA="manualRowHeights";var Ti=new WeakMap,Dd=new WeakMap,hr=new WeakMap,rg=new WeakMap,Zo=new WeakMap,dR=new WeakMap,Pl=new WeakMap,Nd=new WeakMap,Nn=new WeakMap,Ri=new WeakMap,ma=new WeakMap,ig=new WeakMap,gc=new WeakMap,mc=new WeakMap,Zr=new WeakMap,pc=new WeakMap,BA=new WeakSet,UA=new WeakSet,YA=new WeakSet,GA=new WeakSet,zA=new WeakSet,jA=new WeakSet,KA=new WeakSet;class moe extends it{static get PLUGIN_KEY(){return ng}static get PLUGIN_PRIORITY(){return goe}constructor(e){super(e),Ks(this,KA),Ks(this,jA),Ks(this,zA),Ks(this,GA),Ks(this,YA),Ks(this,UA),Ks(this,BA),vn(this,Ti,{writable:!0,value:null}),vn(this,Dd,{writable:!0,value:null}),vn(this,hr,{writable:!0,value:[]}),vn(this,rg,{writable:!0,value:null}),vn(this,Zo,{writable:!0,value:null}),vn(this,dR,{writable:!0,value:null}),vn(this,Pl,{writable:!0,value:null}),vn(this,Nd,{writable:!0,value:null}),vn(this,Nn,{writable:!0,value:this.hot.rootDocument.createElement("DIV")}),vn(this,Ri,{writable:!0,value:this.hot.rootDocument.createElement("DIV")}),vn(this,ma,{writable:!0,value:!1}),vn(this,ig,{writable:!0,value:!1}),vn(this,gc,{writable:!0,value:0}),vn(this,mc,{writable:!0,value:null}),vn(this,Zr,{writable:!0,value:void 0}),vn(this,pc,{writable:!0,value:void 0}),q(se(this,Nn),"manualRowResizer"),q(se(this,Ri),"manualRowResizerGuide")}get inlineDir(){return this.hot.isRtl()?"right":"left"}isEnabled(){return this.hot.getSettings()[ng]}enablePlugin(){this.enabled||(Lt(this,Zr,new ys),se(this,Zr).addLocalHook("init",()=>Xs(this,KA,boe).call(this)),this.hot.rowIndexMapper.registerMap(this.pluginName,se(this,Zr)),this.addHook("modifyRowHeight",(e,n)=>Xs(this,jA,yoe).call(this,e,n)),this.bindEvents(),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){Lt(this,pc,se(this,Zr).getValues()),this.hot.rowIndexMapper.unregisterMap(this.pluginName),super.disablePlugin()}saveManualRowHeights(){this.hot.runHooks("persistentStateSave",VA,se(this,Zr).getValues())}loadManualRowHeights(){const e={};return this.hot.runHooks("persistentStateLoad",VA,e),e.value}setManualSize(e,n){const r=this.hot.toPhysicalRow(e),i=Math.max(n,Ug.DEFAULT_HEIGHT);return se(this,Zr).setValueAtIndex(r,i),i}setupHandlePosition(e){Lt(this,Ti,e);const{view:n}=this.hot,{_wt:r}=n,i=r.wtTable.getCoords(se(this,Ti)),o=i.row;if(o<0)return;const s=ft(se(this,Ti)),a=se(this,Ti).getBoundingClientRect(),l=o<r.getSetting("fixedRowsTop"),u=o>=n.countNotHiddenRowIndexes(0,1)-r.getSetting("fixedRowsBottom");let c;l?c=r.wtOverlays.topInlineStartCornerOverlay.getRelativeCellPosition(se(this,Ti),i.row,i.col):u&&(c=r.wtOverlays.bottomInlineStartCornerOverlay.getRelativeCellPosition(se(this,Ti),i.row,i.col)),c||(c=r.wtOverlays.inlineStartOverlay.getRelativeCellPosition(se(this,Ti),i.row,i.col)),Lt(this,Dd,this.hot.rowIndexMapper.getVisualFromRenderableIndex(o)),Lt(this,hr,[]);const h=this.hot.selection.isSelectedByCorner()||this.hot.selection.isSelectedByRowHeader();if(this.hot.selection.isSelected()&&h){const d=this.hot.getSelectedRange();E(d,g=>{const p=g.getTopStartCorner().row,v=g.getBottomStartCorner().row;me(p,v,S=>{se(this,hr).includes(S)||se(this,hr).push(S)})})}se(this,hr).includes(se(this,Dd))||Lt(this,hr,[se(this,Dd)]),Lt(this,Nd,c.top-6),Lt(this,Pl,parseInt(a.height,10)),se(this,Nn).style.top=`${se(this,Nd)+se(this,Pl)}px`,se(this,Nn).style[this.inlineDir]=`${c.start}px`,se(this,Nn).style.width=`${s}px`,this.hot.rootElement.appendChild(se(this,Nn))}refreshHandlePosition(){se(this,Nn).style.top=`${se(this,Nd)+se(this,rg)}px`}setupGuidePosition(){const e=parseInt(ft(se(this,Nn)),10),n=parseInt(se(this,Nn).style[this.inlineDir],10)+e,r=parseInt(this.hot.view.maximumVisibleElementWidth(0),10);q(se(this,Nn),"active"),q(se(this,Ri),"active"),se(this,Ri).style.top=se(this,Nn).style.top,se(this,Ri).style[this.inlineDir]=`${n}px`,se(this,Ri).style.width=`${r-e}px`,this.hot.rootElement.appendChild(se(this,Ri))}refreshGuidePosition(){se(this,Ri).style.top=se(this,Nn).style.top}hideHandleAndGuide(){Le(se(this,Nn),"active"),Le(se(this,Ri),"active")}checkIfRowHeader(e){const n=cs(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&&se(this,Zo)<n?n:se(this,Zo)}afterMouseDownTimeout(){const e=()=>{this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.adjustElementsSize(!0)},n=(r,i)=>{const o=this.hot.runHooks("beforeRowResize",this.getActualRowHeight(r),r,!0);o!==void 0&&Lt(this,Zo,o),this.setManualSize(r,se(this,Zo)),this.hot.runHooks("afterRowResize",this.getActualRowHeight(r),r,!0),i&&e()};se(this,gc)>=2&&(se(this,hr).length>1?(E(se(this,hr),i=>{n(i)}),e()):E(se(this,hr),i=>{n(i,!0)})),Lt(this,gc,0),Lt(this,mc,null)}bindEvents(){const{rootElement:e,rootWindow:n}=this.hot;this.eventManager.addEventListener(e,"mouseover",r=>Xs(this,BA,poe).call(this,r)),this.eventManager.addEventListener(e,"mousedown",r=>Xs(this,UA,woe).call(this,r)),this.eventManager.addEventListener(n,"mousemove",r=>Xs(this,YA,voe).call(this,r)),this.eventManager.addEventListener(n,"mouseup",()=>Xs(this,GA,Coe).call(this)),this.eventManager.addEventListener(se(this,Nn),"contextmenu",()=>Xs(this,zA,Soe).call(this))}destroy(){super.destroy()}}function poe(t){if(!$y(t.target)&&se(this,ig)!==!0&&this.checkIfRowHeader(t.target)){const e=this.getClosestTHParent(t.target);e&&(se(this,ma)||this.setupHandlePosition(e))}}function woe(t){Ie(t.target,"manualRowResizer")&&(this.setupHandlePosition(se(this,Ti)),this.setupGuidePosition(),Lt(this,ma,!0),se(this,mc)===null&&(Lt(this,mc,setTimeout(()=>this.afterMouseDownTimeout(),500)),this.hot._registerTimeout(se(this,mc))),Lt(this,gc,se(this,gc)+1),Lt(this,dR,t.pageY),Lt(this,Zo,se(this,Pl)))}function voe(t){se(this,ma)&&(Lt(this,rg,se(this,Pl)+(t.pageY-se(this,dR))),E(se(this,hr),e=>{Lt(this,Zo,this.setManualSize(e,se(this,rg)))}),this.refreshHandlePosition(),this.refreshGuidePosition())}function Coe(){const t=()=>{this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.adjustElementsSize(!0)},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)};se(this,ma)&&(this.hideHandleAndGuide(),Lt(this,ma,!1),se(this,Zo)!==se(this,Pl)&&(se(this,hr).length>1?(E(se(this,hr),r=>{e(r)}),t()):E(se(this,hr),r=>{e(r,!0)})),this.setupHandlePosition(se(this,Ti)))}function Soe(){this.hideHandleAndGuide(),this.hot.rootElement.removeChild(se(this,Nn)),this.hot.rootElement.removeChild(se(this,Ri)),Lt(this,ma,!1),Lt(this,ig,!0),this.hot._registerImmediate(()=>{Lt(this,ig,!1)})}function yoe(t,e){let n=t;if(this.enabled){const r=this.hot.toPhysicalRow(e),i=se(this,Zr).getValueAtIndex(r);this.hot.getSettings()[ng]&&i&&(n=i)}return n}function boe(){const t=this.hot.getSettings()[ng],e=this.loadManualRowHeights();this.hot.batchExecution(()=>{typeof e<"u"?e.forEach((n,r)=>{se(this,Zr).setValueAtIndex(r,n)}):Array.isArray(t)?(t.forEach((n,r)=>{se(this,Zr).setValueAtIndex(r,n)}),Lt(this,pc,t)):t===!0&&Array.isArray(se(this,pc))&&se(this,pc).forEach((n,r)=>{se(this,Zr).setValueAtIndex(r,n)})},!0)}function qs(t,e,n){return e=Roe(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Roe(t){var e=Eoe(t,"string");return typeof e=="symbol"?e:String(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||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Toe{constructor(e,n,r,i,o,s){qs(this,"row",void 0),qs(this,"col",void 0),qs(this,"rowspan",void 0),qs(this,"colspan",void 0),qs(this,"removed",!1),qs(this,"cellCoordsFactory",void 0),qs(this,"cellRangeFactory",void 0),this.row=e,this.col=n,this.rowspan=r,this.colspan=i,this.cellCoordsFactory=o,this.cellRangeFactory=s}static NEGATIVE_VALUES_WARNING(e){return ht`The merged cell declared with {row: ${e.row}, col: ${e.col},\x20
rowspan: ${e.rowspan}, colspan: ${e.colspan}} contains negative values, which is\x20
not supported. It will not be added to the collection.`}static IS_OUT_OF_BOUNDS_WARNING(e){return ht`The merged cell declared at [${e.row}, ${e.col}] is positioned\x20
(or positioned partially) outside of the table range. It was not added to the table, please fix your setup.`}static IS_SINGLE_CELL(e){return ht`The merged cell declared at [${e.row}, ${e.col}] has both "rowspan"\x20
and "colspan" declared as "1", which makes it a single cell. It cannot be added to the collection.`}static ZERO_SPAN_WARNING(e){return ht`The merged cell declared at [${e.row}, ${e.col}] has "rowspan"\x20
or "colspan" declared as "0", which is not supported. It cannot be added to the collection.`}static containsNegativeValues(e){return e.row<0||e.col<0||e.rowspan<0||e.colspan<0}static isSingleCell(e){return e.colspan===1&&e.rowspan===1}static containsZeroSpan(e){return e.colspan===0||e.rowspan===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)}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,!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!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 this.cellRangeFactory(this.cellCoordsFactory(this.row,this.col),this.cellCoordsFactory(this.row,this.col),this.cellCoordsFactory(this.getLastRow(),this.getLastColumn()))}}const _i=Toe;function $S(t,e,n,r){e?e.row===n&&e.col===r?(t.setAttribute("rowspan",e.rowspan.toString()),t.setAttribute("colspan",e.colspan.toString())):(t.removeAttribute("rowspan"),t.removeAttribute("colspan"),t.style.display="none"):(t.removeAttribute("rowspan"),t.removeAttribute("colspan"),t.style.display="")}function jv(t,e,n){return e=_oe(e),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:String(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||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class fR{constructor(e){jv(this,"plugin",void 0),jv(this,"mergedCells",[]),jv(this,"hot",void 0),this.plugin=e,this.hot=e.hot}static IS_OVERLAPPING_WARNING(e){return ht`The merged cell declared at [${e.row}, ${e.col}], overlaps\x20
with the other declared merged cell. The overlapping merged cell was not added to the table, please\x20
fix your setup.`}get(e,n){const r=this.mergedCells;let i=!1;return E(r,o=>o.row<=e&&o.row+o.rowspan-1>=e&&o.col<=n&&o.col+o.colspan-1>=n?(i=o,!1):!0),i}getByRange(e){const n=this.mergedCells;let r=!1;return E(n,i=>i.row<=e.from.row&&i.row+i.rowspan-1>=e.to.row&&i.col<=e.from.col&&i.col+i.colspan-1>=e.to.col?(r=i,r):!0),r}getWithinRange(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const r=this.mergedCells,i=[];let o=e;if(!o.includesRange){const s=this.hot._createCellCoords(o.from.row,o.from.col),a=this.hot._createCellCoords(o.to.row,o.to.col);o=this.hot._createCellRange(s,s,a)}return E(r,s=>{const a=this.hot._createCellCoords(s.row,s.col),l=this.hot._createCellCoords(s.row+s.rowspan-1,s.col+s.colspan-1),u=this.hot._createCellRange(a,a,l);n?o.overlaps(u)&&i.push(s):o.includesRange(u)&&i.push(s)}),i.length?i:!1}add(e){const n=this.mergedCells,r=e.row,i=e.col,o=e.rowspan,s=e.colspan,a=new _i(r,i,o,s,this.hot._createCellCoords,this.hot._createCellRange),l=this.get(r,i),u=this.isOverlapping(a);return!l&&!u?(this.hot&&a.normalize(this.hot),n.push(a),a):(gt(fR.IS_OVERLAPPING_WARNING(a)),!1)}remove(e,n){const r=this.mergedCells,i=this.get(e,n),o=i?this.mergedCells.indexOf(i):-1;return i&&o!==-1?(r.splice(o,1),i):!1}clear(){const e=this.mergedCells,n=[],r=[];E(e,i=>{const o=this.hot.getCell(i.row,i.col);o&&n.push([o,this.get(i.row,i.col),i.row,i.col])}),this.mergedCells.length=0,E(n,(i,o)=>{me(0,i.rowspan-1,s=>{me(0,i.colspan-1,a=>{if(a!==0||s!==0){const l=this.hot.getCell(i.row+s,i.col+a);l&&r.push([l,null,null,null])}})}),n[o][1]=null}),E(n,i=>{$S(...i)}),E(r,i=>{$S(...i)})}isOverlapping(e){const n=this.hot._createCellRange(this.hot._createCellCoords(0,0),this.hot._createCellCoords(e.row,e.col),this.hot._createCellCoords(e.row+e.rowspan-1,e.col+e.colspan-1));let r=!1;return E(this.mergedCells,i=>this.hot._createCellRange(this.hot._createCellCoords(0,0),this.hot._createCellCoords(i.row,i.col),this.hot._createCellCoords(i.row+i.rowspan-1,i.col+i.colspan-1)).overlaps(n)?(r=!0,!1):!0),r}isFirstRenderableMergedCell(e,n){const r=this.get(e,n);return r&&this.hot.rowIndexMapper.getNearestNotHiddenIndex(r.row,1)===e&&this.hot.columnIndexMapper.getNearestNotHiddenIndex(r.col,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)}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}E(this.mergedCells,o=>{o.shift(i,n)}),Pf(this.mergedCells.length-1,0,o=>{const s=this.mergedCells[o];s&&s.removed&&this.mergedCells.splice(this.mergedCells.indexOf(s),1)})}}const Aoe=fR;function Kv(t,e,n){return e=Ooe(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ooe(t){var e=Ioe(t,"string");return typeof e=="symbol"?e:String(e)}function Ioe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Poe{constructor(e){Kv(this,"plugin",void 0),Kv(this,"mergedCellsCollection",void 0),Kv(this,"currentFillData",null),this.plugin=e,this.mergedCellsCollection=this.plugin.mergedCellsCollection}correctSelectionAreaSize(e){if(e[0]===e[2]&&e[1]===e[3]){const n=this.mergedCellsCollection.get(e[0],e[1]);n&&(e[2]=e[0]+n.rowspan-1,e[3]=e[1]+n.colspan-1)}}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,g=Math.floor(s/d)*d,p=s-g,v=this.getFarthestCollection(e,n,r,i);if(v){if(r==="down"){const S=v.row+v.rowspan-a-p;o[2]+S>=this.plugin.hot.countRows()?o[2]-=p:o[2]+=p?S:0}else if(r==="right"){const S=v.col+v.colspan-l-p;o[3]+S>=this.plugin.hot.countCols()?o[3]-=p:o[3]+=p?S:0}else if(r==="up"){const S=u-p-v.row+1;o[0]+S<0?o[0]+=p:o[0]-=p?S:0}else if(r==="left"){const S=c-p-v.col+1;o[1]+S<0?o[1]+=p:o[1]-=p?S:0}}return this.updateCurrentFillCache({baseArea:e,dragDirection:r,foundMergedCells:i,fillSize:s,dragArea:o,cycleLength:d}),o}updateCurrentFillCache(e){this.currentFillData||(this.currentFillData={}),jt(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":return[s+1,o,c,a];case"left":return[l,u,s,o-1];case"right":return[i,a+1,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),g=u?a-o+1:l-s+1,p=Math.floor(d/g)*g,v=d-p;let S=null,y=null,R=null;switch(r){case"up":S="includesVertically",R=c-v+1;break;case"left":S="includesHorizontally",R=c-v+1;break;case"down":S="includesVertically",R=h+v-1;break;case"right":S="includesHorizontally",R=h+v-1;break}return E(i,T=>{T[S](R)&&T.isFarther(y,r)&&(y=T)}),y}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});break;case"down":this.plugin.mergedCellsCollection.add({row:a.row+s,rowspan:a.rowspan,col:a.col,colspan:a.colspan});break;case"left":this.plugin.mergedCellsCollection.add({row:a.row,rowspan:a.rowspan,col:a.col-s,colspan:a.colspan});break;case"right":this.plugin.mergedCellsCollection.add({row:a.row,rowspan:a.rowspan,col:a.col+s,colspan:a.colspan});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 E(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);return!!this.mergedCellsCollection.getWithinRange(h,!0)}}const xoe=Poe;function Xv(t,e,n){return e=Hoe(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Hoe(t){var e=Doe(t,"string");return typeof e=="symbol"?e:String(e)}function Doe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Noe{constructor(e){Xv(this,"plugin",void 0),Xv(this,"hot",void 0),Xv(this,"fullySelectedMergedCellClassName","fullySelectedMergedCell"),this.plugin=e,this.hot=e.hot}snapDelta(e,n,r){const i=n.to,o=i.row+e.row,s=i.col+e.col;e.row?this.jumpOverMergedCell(e,r,o):e.col&&this.jumpOverMergedCell(e,r,s)}jumpOverMergedCell(e,n,r){let i=e.row||e.col,o=null,s=null,a=null;e.row?(o=n.includesVertically(r),s=n.row,a=n.getLastRow()):e.col&&(o=n.includesHorizontally(r),s=n.col,a=n.getLastColumn()),i!==0&&(i>0?o&&r!==s&&(i+=a-r+1):o&&r!==a&&(i-=r-s+1),e.row?e.row=i:e.col&&(e.col=i))}getUpdatedSelectionRange(e,n){return this.hot._createCellRange(e.highlight,e.from,this.hot._createCellCoords(e.to.row+n.row,e.to.col+n.col))}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.plugin.selectionCalculations.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}}const Loe=Noe;function $oe(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(hm)}return this.getTranslatedPhrase(cm)},callback(){t.toggleMergeOnSelection()},disabled(){const e=this.getSelectedLast();return e?_i.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 Bt(t,e){pN(t,e),e.add(t)}function koe(t,e,n){pN(t,e),e.set(t,n)}function pN(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function qv(t,e,n){return e=Foe(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Foe(t){var e=Woe(t,"string");return typeof e=="symbol"?e:String(e)}function Woe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Zv(t,e,n){var r=wN(t,e,"set");return Voe(t,r,n),n}function Voe(t,e,n){if(e.set)e.set.call(t,n);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=n}}function cl(t,e){var n=wN(t,e,"get");return Boe(t,n)}function wN(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}function Boe(t,e){return e.get?e.get.call(t):e.value}function Ht(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}de.getSingleton().register("beforeMergeCells");de.getSingleton().register("afterMergeCells");de.getSingleton().register("beforeUnmergeCells");de.getSingleton().register("afterUnmergeCells");const wc="mergeCells",Uoe=150,XA=wc;var Ei=new WeakMap,qA=new WeakSet,ZA=new WeakSet,QA=new WeakSet,JA=new WeakSet,eO=new WeakSet,tO=new WeakSet,nO=new WeakSet,Qv=new WeakSet,rO=new WeakSet,iO=new WeakSet,oO=new WeakSet,sO=new WeakSet,aO=new WeakSet,lO=new WeakSet,uO=new WeakSet,cO=new WeakSet,hO=new WeakSet,dO=new WeakSet,fO=new WeakSet,gO=new WeakSet,mO=new WeakSet,pO=new WeakSet;class Yoe extends it{constructor(){super(...arguments),Bt(this,pO),Bt(this,mO),Bt(this,gO),Bt(this,fO),Bt(this,dO),Bt(this,hO),Bt(this,cO),Bt(this,uO),Bt(this,lO),Bt(this,aO),Bt(this,sO),Bt(this,oO),Bt(this,iO),Bt(this,rO),Bt(this,Qv),Bt(this,nO),Bt(this,tO),Bt(this,eO),Bt(this,JA),Bt(this,QA),Bt(this,ZA),Bt(this,qA),qv(this,"mergedCellsCollection",null),qv(this,"autofillCalculations",null),qv(this,"selectionCalculations",null),koe(this,Ei,{writable:!0,value:null})}static get PLUGIN_KEY(){return wc}static get PLUGIN_PRIORITY(){return Uoe}isEnabled(){return!!this.hot.getSettings()[wc]}enablePlugin(){var e=this;this.enabled||(this.mergedCellsCollection=new Aoe(this),this.autofillCalculations=new xoe(this),this.selectionCalculations=new Loe(this),this.addHook("afterInit",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Ht(e,qA,Goe).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 Ht(e,QA,joe).call(e,...r)}),this.addHook("afterModifyTransformStart",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Ht(e,gO,use).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 Ht(e,JA,Koe).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 Ht(e,eO,Xoe).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 Ht(e,Qv,wO).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 Ht(e,Qv,wO).call(e,...r)}),this.addHook("beforeSetRangeEnd",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Ht(e,rO,Qoe).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 Ht(e,ZA,zoe).call(e,...r)}),this.addHook("afterRenderer",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Ht(e,nO,Zoe).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 Ht(e,tO,qoe).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 Ht(e,iO,Joe).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 Ht(e,oO,ese).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 Ht(e,sO,tse).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 Ht(e,aO,nse).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 Ht(e,lO,rse).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 Ht(e,uO,ise).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 Ht(e,cO,ose).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 Ht(e,hO,sse).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 Ht(e,dO,ase).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 Ht(e,fO,lse).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 Ht(e,mO,cse).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 Ht(e,pO,hse).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(){const e=this.hot.getSettings()[wc];this.disablePlugin(),this.enablePlugin(),this.generateFromSettings(e),super.updatePlugin()}ifChromeForceRepaint(){if(!By())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=xl(s,"backgroundColor").replace(")",", 0.99)"),e.push(s))})}),this.hot._registerTimeout(()=>{e.forEach(r=>{r.style.background=xl(r,"backgroundColor").replace(", 0.99)",")")})},1)}validateSetting(e){let n=!0;return e?(_i.containsNegativeValues(e)?(gt(_i.NEGATIVE_VALUES_WARNING(e)),n=!1):_i.isOutOfBounds(e,this.hot.countRows(),this.hot.countCols())?(gt(_i.IS_OUT_OF_BOUNDS_WARNING(e)),n=!1):_i.isSingleCell(e)?(gt(_i.IS_SINGLE_CELL(e)),n=!1):_i.containsZeroSpan(e)&&(gt(_i.ZERO_SPAN_WARNING(e)),n=!1),n):!1}generateFromSettings(e){if(Array.isArray(e)){const n=[];if(E(e,r=>{if(!this.validateSetting(r))return;const i=this.hot._createCellCoords(r.row,r.col),o=this.hot._createCellCoords(r.row+r.rowspan-1,r.col+r.colspan-1),s=this.hot._createCellRange(i,i,o);this.mergeRange(s,!0,!0),me(r.row,r.row+r.rowspan-1,a=>{me(r.col,r.col+r.colspan-1,l=>{a===r.row&&l===r.col||n.push([a,l,null])})})}),n.length===0)return;this.hot.setDataAtCell(n)}}clearCollections(){this.mergedCellsCollection.clear()}canMergeRange(e){return(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1)?!0:this.validateSetting(e)}toggleMergeOnSelection(){const e=this.hot.getSelectedRangeLast();if(!e)return;e.setDirection(this.hot.isRtl()?"NE-SW":"NW-SE");const{from:n,to:r}=e;this.toggleMerge(e),this.hot.selectCell(n.row,n.col,r.row,r.col,!1)}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),me(0,s.rowspan-1,c=>{me(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)?(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&&(this.hot.runHooks("beforeUnmergeCells",e,n),E(r,i=>{this.mergedCellsCollection.remove(i.row,i.col),me(0,i.rowspan-1,o=>{me(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 n=this.mergedCellsCollection.get(e.from.row,e.from.col);n.row===e.from.row&&n.col===e.from.col&&n.row+n.rowspan-1===e.to.row&&n.col+n.colspan-1===e.to.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:XA})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(XA)}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(Ve(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(Ve(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(Ve(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(Ve(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 Goe(){this.generateFromSettings(this.hot.getSettings()[wc]),this.hot.render()}function zoe(t){if(t){const e=this.mergedCellsCollection.mergedCells,n=this.hot.getSelectedRangeLast();for(let r=0;r<e.length;r+=1)if(n.from.row===e[r].row&&n.from.col===e[r].col&&n.to.row===e[r].row+e[r].rowspan-1&&n.to.col===e[r].col+e[r].colspan-1)return!1}return t}function joe(t){const e=this.hot.getSelectedRangeLast();let n={row:t.row,col:t.col},r=null;const i=this.hot._createCellCoords(e.highlight.row,e.highlight.col),o=this.mergedCellsCollection.get(i.row,i.col);if(cl(this,Ei)||Zv(this,Ei,this.hot._createCellCoords(null,null)),o){const a=this.hot._createCellCoords(o.row,o.col),l=this.hot._createCellCoords(o.row+o.rowspan-1,o.col+o.colspan-1);this.hot._createCellRange(a,a,l).includes(cl(this,Ei))||Zv(this,Ei,this.hot._createCellCoords(null,null)),n.row=cl(this,Ei).row?cl(this,Ei).row-i.row:n.row,n.col=cl(this,Ei).col?cl(this,Ei).col-i.col:n.col,t.row>0?n.row=o.row+o.rowspan-1-i.row+t.row:t.row<0&&(n.row=i.row-o.row+t.row),t.col>0?n.col=o.col+o.colspan-1-i.col+t.col:t.col<0&&(n.col=i.col-o.col+t.col)}r=this.hot._createCellCoords(e.highlight.row+n.row,e.highlight.col+n.col);const s=this.mergedCellsCollection.get(r.row,r.col);if(s){const a=this.mergedCellsCollection.getFirstRenderableCoords(s.row,s.col);Zv(this,Ei,r),n={row:a.row-i.row,col:a.col-i.col}}n.row!==0&&(t.row=n.row),n.col!==0&&(t.col=n.col)}function Koe(t){const e=this.hot.getSelectedRangeLast(),n=Vn(t),r=this.selectionCalculations.getUpdatedSelectionRange(e,t);let i=Vn(n);const o=this.mergedCellsCollection.getWithinRange(r,!0);do i=Vn(n),this.selectionCalculations.getUpdatedSelectionRange(e,n),E(o,s=>{this.selectionCalculations.snapDelta(n,e,s)});while(n.row!==i.row||n.col!==i.col);t.row=n.row,t.col=n.col}function Xoe(t,e){if(t<0||e<0)return;const n=this.mergedCellsCollection.get(t,e);if(!n)return;const{row:r,col:i,colspan:o,rowspan:s}=n;return[r,i,r+s-1,i+o-1]}function qoe(t){t.items.push({name:"---------"},$oe(this))}function Zoe(t,e,n){const r=this.mergedCellsCollection.get(e,n),i=Ve(r)?Vn(r):void 0;if(Ve(i)){const{rowIndexMapper:o,columnIndexMapper:s}=this.hot,{row:a,col:l,colspan:u,rowspan:c}=i,[h,d]=this.translateMergedCellToRenderable(a,c,l,u),g=o.getRenderableFromVisualIndex(e),p=s.getRenderableFromVisualIndex(n),v=h-g+1,S=d-p+1;i.row=o.getNearestNotHiddenIndex(i.row,1),i.col=s.getNearestNotHiddenIndex(i.col,1),i.rowspan=Math.min(i.rowspan,v),i.colspan=Math.min(i.colspan,S)}$S(t,i,e,n)}function wO(t){if(this.mergedCellsCollection.isFirstRenderableMergedCell(t.row,t.col)){const e=this.mergedCellsCollection.get(t.row,t.col);[t.row,t.col]=[e.row,e.col]}}function Qoe(t){const e=this.hot.getSelectedRangeLast();e.highlight=this.hot._createCellCoords(e.highlight.row,e.highlight.col),e.to=t;let n=!1;if(!(this.hot.selection.isSelectedByColumnHeader()||this.hot.selection.isSelectedByRowHeader()))do{n=!1;for(let r=0;r<this.mergedCellsCollection.mergedCells.length;r+=1){const o=this.mergedCellsCollection.mergedCells[r].getRange();e.expandByRange(o)&&(t.row=e.to.row,t.col=e.to.col,n=!0)}}while(n)}function Joe(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 ese(t){const e=this.hot.countCols();this.modifyViewportRowStart(t,e),this.modifyViewportRowEnd(t,e)}function tse(t){const e=this.hot.countRows();this.modifyViewportColumnStart(t,e),this.modifyViewportColumnEnd(t,e)}function nse(t,e){this.autofillCalculations.correctSelectionAreaSize(e);const n=this.autofillCalculations.getDirection(e,t);let r=t;if(this.autofillCalculations.dragAreaOverlapsCollections(e,r,n))return r=e,r;const i=this.mergedCellsCollection.getWithinRange({from:{row:e[0],col:e[1]},to:{row:e[2],col:e[3]}});return i&&(r=this.autofillCalculations.snapDragArea(e,r,n,i)),r}function rse(t,e){this.mergedCellsCollection.shiftCollections("right",t,e)}function ise(t,e){this.mergedCellsCollection.shiftCollections("left",t,e)}function ose(t,e,n){n!=="auto"&&this.mergedCellsCollection.shiftCollections("down",t,e)}function sse(t,e){this.mergedCellsCollection.shiftCollections("up",t,e)}function ase(t,e){e==="Autofill.fill"&&this.autofillCalculations.recreateAfterDataPopulation(t)}function lse(t,e){if(e&&e==="area"){const n=this.hot.getSelectedRangeLast(),r=this.mergedCellsCollection.getWithinRange(n);E(r,i=>{n.getBottomEndCorner().row===i.getLastRow()&&n.getBottomEndCorner().col===i.getLastColumn()&&(t[2]=i.row,t[3]=i.col)})}}function use(t,e,n){if(!this.enabled)return;const r=this.mergedCellsCollection.get(t.row,t.col);if(!r)return;const i=e>0,o=e<0,s=n<0,a=n>0,l=r.row+r.rowspan-1===this.hot.countRows()-1,u=r.row===0,c=r.col+r.colspan-1===this.hot.countCols()-1,h=r.col===0;(i&&l||o&&u||a&&c||s&&h)&&(t.row=r.row,t.col=r.col)}function cse(t,e,n,r){if(n)return this.selectionCalculations.getSelectedMergedCellClassName(t,e,n,r)}function hse(){return this.selectionCalculations.getSelectedMergedCellClassNameToRemove()}function dse(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,p=(d.compareFunctionFactory?d.compareFunctionFactory:YH(u.type))(l,u,d)(c,h);if(p===Hi){const v=a+1;if(typeof e[v]<"u")return s(v)}return p}(0)}}function vO(){gt(ht`Plugins \`columnSorting\` and \`multiColumnSorting\` should not be enabled simultaneously.
Only \`multiColumnSorting\` will work.`)}const vN="sort";function fse(t,e,n){const r=[];return n===!1||t.isColumnSorted(e)&&t.getNumberOfSortedColumns()>1&&r.push(`${vN}-${t.getIndexOfColumnInSortQueue(e)+1}`),r}function gse(t){const e=t.className.split(" "),n=new RegExp(`^${vN}-[0-9]{1,2}$`);return e.filter(r=>n.test(r))}function mse(t,e,n){return e=pse(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function pse(t){var e=wse(t,"string");return typeof e=="symbol"?e:String(e)}function wse(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const og="multiColumnSorting",vse=170,CO="columnSorting",SO=og;UH(og,dse);class Cse extends GH{constructor(){super(...arguments),mse(this,"pluginKey",og)}static get PLUGIN_KEY(){return og}static get PLUGIN_PRIORITY(){return vse}isEnabled(){return super.isEnabled()}enablePlugin(){!this.enabled&&this.hot.getSettings()[this.pluginKey]&&this.hot.getSettings()[CO]&&vO(),super.enablePlugin()}disablePlugin(){super.disablePlugin()}registerShortcuts(){super.registerShortcuts(),this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Shift","Enter"]],callback:()=>{const{highlight:e}=this.hot.getSelectedRangeLast();e.row===-1&&e.col>=0&&this.sort(this.getNextSortConfig(e.col,Uf))},runOnlyIf:()=>{var e;const n=(e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;return n&&this.hot.selection.isCellVisible(n)&&n.isHeader()},group:SO})}unregisterShortcuts(){super.unregisterShortcuts(),this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(SO)}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),Le(e,gse(e)),this.enabled!==!1&&q(e,fse(...r))}onUpdateSettings(e){this.hot.getSettings()[this.pluginKey]&&this.hot.getSettings()[CO]&&vO(),super.onUpdateSettings(e)}onAfterOnCellMouseDown(e,n){eR(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,Uf))):this.sort(this.getColumnNextConfig(n.col)))}}function yO(t,e,n){return e=Sse(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Sse(t){var e=yse(t,"string");return typeof e=="symbol"?e:String(e)}function yse(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const bse="multipleSelectionHandles",Rse=160;class Ese extends it{constructor(){super(...arguments),yO(this,"dragged",[]),yO(this,"lastSetCell",null)}static get PLUGIN_KEY(){return bse}static get PLUGIN_PRIORITY(){return Rse}isEnabled(){return uo()}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(Ie(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(Ie(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(Ie(i.target,"topSelectionHandle-HitArea"))return r.call(e,"top"),e.touchStartRange=void 0,i.preventDefault(),!1;if(Ie(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 kS(){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}=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}}function CN(){return{label:"",isPlaceholder:!0}}function Tse(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1/0;const n=[];if(e===0)return n;E(t,i=>{const o=[];let s=0;n.push(o),E(i,a=>{const l=kS();if(Ve(a)){const{label:c,colspan:h}=a;l.label=Ft(c),typeof h=="number"&&h>1&&(l.colspan=h,l.origColspan=h)}else l.label=Ft(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(CN());return!u})});const r=Math.max(...Ue(n,i=>i.length));return E(n,i=>{if(i.length<r){const o=Ue(new Array(r-i.length),()=>kS());i.splice(i.length,0,...o)}}),n}function Jv(t,e,n){_se(t,e),e.set(t,n)}function _se(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function zr(t,e){var n=SN(t,e,"get");return Mse(t,n)}function Mse(t,e){return e.get?e.get.call(t):e.value}function Fu(t,e,n){var r=SN(t,e,"set");return Ase(t,r,n),n}function SN(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}function Ase(t,e,n){if(e.set)e.set.call(t,n);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=n}}const bO=["label","collapsible"];var eo=new WeakMap,Zs=new WeakMap,eC=new WeakMap;class Ose{constructor(){Jv(this,eo,{writable:!0,value:[]}),Jv(this,Zs,{writable:!0,value:0}),Jv(this,eC,{writable:!0,value:1/0})}setColumnsLimit(e){Fu(this,eC,e)}setData(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];Fu(this,eo,Tse(e,zr(this,eC))),Fu(this,Zs,zr(this,eo).length)}getData(){return zr(this,eo)}mergeWith(e){E(e,n=>{let{row:r,col:i,...o}=n;const s=this.getHeaderSettings(r,i);s!==null&&jt(s,o,bO)})}map(e){E(zr(this,eo),n=>{E(n,r=>{const i=e({...r});Ve(i)&&jt(r,i,bO)})})}getHeaderSettings(e,n){var r;if(e>=zr(this,Zs)||e<0)return null;const i=zr(this,eo)[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>=zr(this,Zs)||e<0)return i;const o=zr(this,eo)[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 zr(this,Zs)}getColumnsCount(){return zr(this,Zs)>0?zr(this,eo)[0].length:0}clear(){Fu(this,eo,[]),Fu(this,Zs,0)}}function tC(t,e,n){return e=Ise(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ise(t){var e=Pse(t,"string");return typeof e=="symbol"?e:String(e)}function Pse(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const yN="DF-pre-order";function bN(t,e){let n=t.call(e,this);for(let r=0;r<this.childs.length;r++){if(n===!1)return!1;n=bN.call(this.childs[r],t,e)}return n}const xse="DF-post-order";function RN(t,e){for(let n=0;n<this.childs.length;n++)if(RN.call(this.childs[n],t,e)===!1)return!1;return t.call(e,this)}const EN="BF";function Hse(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 Dse=EN,RO=new Map([[yN,bN],[xse,RN],[EN,Hse]]);class sg{constructor(e){tC(this,"data",{}),tC(this,"parent",null),tC(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 sg({...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]:Dse;if(!RO.has(n))throw new Error(`Traversal strategy "${n}" does not exist`);RO.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 nC(t,e,n){Nse(t,e),e.set(t,n)}function Nse(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Dn(t,e){var n=TN(t,e,"get");return Lse(t,n)}function Lse(t,e){return e.get?e.get.call(t):e.value}function $se(t,e,n){var r=TN(t,e,"set");return kse(t,r,n),n}function TN(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}function kse(t,e,n){if(e.set)e.set.call(t,n);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=n}}var hl=new WeakMap,Qs=new WeakMap,dl=new WeakMap;class Fse{constructor(e){nC(this,hl,{writable:!0,value:new Map}),nC(this,Qs,{writable:!0,value:new Map}),nC(this,dl,{writable:!0,value:null}),$se(this,dl,e)}getRoots(){return Array.from(Dn(this,hl).values())}getRootByColumn(e){let n;return Dn(this,Qs).has(e)&&(n=Dn(this,hl).get(Dn(this,Qs).get(e))),n}getNode(e,n){const r=this.getRootByColumn(n);if(!r)return;const i=n-Dn(this,Qs).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;Dn(this,Qs).clear(),E(Dn(this,hl),n=>{let[,{data:{colspan:r}}]=n;for(let i=e;i<e+r;i++)Dn(this,Qs).set(i,e);e+=r})}buildTree(){this.clear();const e=Dn(this,dl).getColumnsCount();let n=0;for(;n<e;){const r=Dn(this,dl).getHeaderSettings(0,n),i=new sg;Dn(this,hl).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=Dn(this,dl).getHeadersSettings(r,n,i);r+=1,E(o,s=>{const a={...s,headerLevel:r-1,columnIndex:n};let l;r===1?(e.data=a,l=e):(l=new sg(a),e.addChild(l)),r<Dn(this,dl).getLayersCount()&&this.buildLeaves(l,n,r,s.origColspan),n+=s.origColspan})}clear(){Dn(this,hl).clear(),Dn(this,Qs).clear()}}function _N(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 ag(t,e){let{childs:n}=t;if(n.length!==0)return n[0].data[e]}function lg(t){return ag(t,"origColspan")===t.data.origColspan}function gR(t){const{data:e,childs:n}=t;if(!e.isCollapsed||e.isHidden||e.origColspan<=1)return{rollbackModification:()=>{},affectedColumns:[],colspanCompensation:0};if(lg(t))return gR(n[0]);e.isCollapsed=!1;const i=n.slice(1),o=new Set;let s=0;if(i.length>0)E(i,a=>{a.replaceTreeWith(a.data.clonedTree),a.data.clonedTree=null;const l=a.data;s+=l.colspan,_N(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):lg(a)&&(l.isCollapsed=ag(a,"isCollapsed"))}),{rollbackModification:()=>mR(t),affectedColumns:Array.from(o),colspanCompensation:s}}function mR(t){var e;const{data:n,childs:r}=t;if(n.isCollapsed||n.isHidden||n.origColspan<=1)return{rollbackModification:()=>{},affectedColumns:[],colspanCompensation:0};if(lg(t))return mR(r[0]);n.isCollapsed=!0;const o=r.slice(1),s=new Set;if(o.length>0)E(o,l=>{_N(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=ag(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):lg(l)&&(u.isCollapsed=ag(l,"isCollapsed"))}),{rollbackModification:()=>gR(t),affectedColumns:Array.from(s),colspanCompensation:a}}function Wse(t,e){if(!Number.isInteger(e))throw new Error("The passed gridColumnIndex argument has invalid type.");if(t.childs.length>0)throw new Error(ht`The passed node is not the last node on the tree. Only for\x20
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 Vse(t,e){if(!Number.isInteger(e))throw new Error("The passed gridColumnIndex argument has invalid type.");if(t.childs.length>0)throw new Error(ht`The passed node is not the last node on the tree. Only for\x20
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 EO=new Map([["collapse",mR],["expand",gR],["hide-column",Wse],["show-column",Vse]]);function Bse(t,e,n){if(!EO.has(t))throw new Error(`The node modifier action ("${t}") does not exist.`);return EO.get(t)(e,n)}function Ld(t){const e=[];return E(t,n=>{n.walkDown(r=>{const i=r.data,{origColspan:o,columnIndex:s,headerLevel:a,crossHiddenColumns:l}=i,u=Yse(e,a);let c=!1;for(let h=s;h<s+o;h++)if(l.includes(h)||c)u.push(CN());else{const g=Use(i);g.isRoot=!0,u.push(g),c=!0}})}),e}function Use(t){const{crossHiddenColumns:e,...n}=kS(t);return n}function Yse(t,e){let n;return Array.isArray(t[e])?n=t[e]:(n=[],t[e]=n),n}function rC(t,e,n){Gse(t,e),e.set(t,n)}function Gse(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Wu(t,e,n){var r=MN(t,e,"set");return zse(t,r,n),n}function zse(t,e,n){if(e.set)e.set.call(t,n);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=n}}function Dt(t,e){var n=MN(t,e,"get");return jse(t,n)}function MN(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}function jse(t,e){return e.get?e.get.call(t):e.value}var yi=new WeakMap,Kn=new WeakMap,Js=new WeakMap;class Kse{constructor(){rC(this,yi,{writable:!0,value:new Ose}),rC(this,Kn,{writable:!0,value:new Fse(Dt(this,yi))}),rC(this,Js,{writable:!0,value:[[]]})}setState(e){Dt(this,yi).setData(e);let n=!1;try{Dt(this,Kn).buildTree()}catch{Dt(this,Kn).clear(),Dt(this,yi).clear(),n=!0}return Wu(this,Js,Ld(Dt(this,Kn).getRoots())),n}setColumnsLimit(e){Dt(this,yi).setColumnsLimit(e)}mergeStateWith(e){const n=Ue(e,r=>{let{row:i,...o}=r;return{row:i<0?this.rowCoordsToLevel(i):i,...o}});Dt(this,yi).mergeWith(n),Dt(this,Kn).buildTree(),Wu(this,Js,Ld(Dt(this,Kn).getRoots()))}mapState(e){Dt(this,yi).map(e),Dt(this,Kn).buildTree(),Wu(this,Js,Ld(Dt(this,Kn).getRoots()))}mapNodes(e){return Yt(Dt(this,Kn).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=Dt(this,Kn).getNode(n,r);let o;return i&&(o=Bse(e,i,r),Wu(this,Js,Ld(Dt(this,Kn).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=Dt(this,Js)[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=Dt(this,Kn).getNode(e,n);return r||null}findTopMostEntireHeaderLevel(e){var n;let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e;const i=r-e+1;let o=!1,s=null;for(let a=e;a<=r;a++){const l=Dt(this,Kn).getRootByColumn(a);if(!l)break;o=!0,l.walkDown(u=>{const{columnIndex:c,headerLevel:h,origColspan:d,isHidden:g}=u.data;g||d<=i&&c>=e&&c+d-1<=r&&(s===null||h<s)&&(s=h)},yN)}return o&&s===null?-1:this.levelToRowCoords((n=s)!==null&&n!==void 0?n: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 Dt(this,yi).getLayersCount()}getColumnsCount(){return Dt(this,yi).getColumnsCount()}clear(){Wu(this,Js,[]),Dt(this,yi).clear(),Dt(this,Kn).clear()}}function Vu(t,e,n){return e=Xse(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Xse(t){var e=qse(t,"string");return typeof e=="symbol"?e:String(e)}function qse(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Zse{constructor(e,n){Vu(this,"hot",void 0),Vu(this,"nestedHeaderSettingsGetter",void 0),Vu(this,"layersCount",0),Vu(this,"container",void 0),Vu(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(){this.container=this.hot.rootDocument.createElement("div"),this.container.classList.add("handsontable","htGhostTable","htAutoSize"),this._buildGhostTable(this.container),this.hot.rootDocument.body.appendChild(this.container);const e=this.container.querySelectorAll("tr:last-of-type th"),n=e.length;this.widthsMap.clear();for(let r=0;r<n;r++){const i=this.hot.columnIndexMapper.getVisualFromRenderableIndex(r),o=this.hot.toPhysicalColumn(i);this.widthsMap.setValueAtIndex(o,e[r].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"),g=this.nestedHeaderSettingsGetter(l,h);if(g&&(!g.isPlaceholder||g.isHidden)){let p=g.label;s&&(p+='<button class="changeType"></button>'),Sa(d,p),d.colSpan=g.colspan,u.appendChild(d)}}o.appendChild(u)}i.appendChild(o),e.appendChild(i)}clear(){this.widthsMap.clear(),this.container=null}}const Qse=Zse;function ln(t,e){AN(t,e),e.add(t)}function TO(t,e,n){return e=Jse(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Jse(t){var e=eae(t,"string");return typeof e=="symbol"?e:String(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||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function $d(t,e,n){AN(t,e),e.set(t,n)}function AN(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function la(t,e,n){var r=ON(t,e,"set");return tae(t,r,n),n}function tae(t,e,n){if(e.set)e.set.call(t,n);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=n}}function et(t,e){var n=ON(t,e,"get");return nae(t,n)}function ON(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}function nae(t,e){return e.get?e.get.call(t):e.value}function Xt(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}const _O="nestedHeaders",rae=280;var dt=new WeakMap,Bo=new WeakMap,vc=new WeakMap,Ap=new WeakMap,kd=new WeakSet,MO=new WeakSet,AO=new WeakSet,OO=new WeakSet,IO=new WeakSet,PO=new WeakSet,xO=new WeakSet,HO=new WeakSet,DO=new WeakSet,NO=new WeakSet,LO=new WeakSet,$O=new WeakSet,kO=new WeakSet,FO=new WeakSet,WO=new WeakSet,VO=new WeakSet,BO=new WeakSet,UO=new WeakSet;class iae extends it{constructor(){super(...arguments),ln(this,UO),ln(this,BO),ln(this,VO),ln(this,WO),ln(this,FO),ln(this,kO),ln(this,$O),ln(this,LO),ln(this,NO),ln(this,DO),ln(this,HO),ln(this,xO),ln(this,PO),ln(this,IO),ln(this,OO),ln(this,AO),ln(this,MO),ln(this,kd),$d(this,dt,{writable:!0,value:new Kse}),$d(this,Bo,{writable:!0,value:null}),$d(this,vc,{writable:!0,value:null}),$d(this,Ap,{writable:!0,value:!1}),TO(this,"ghostTable",new Qse(this.hot,(e,n)=>this.getHeaderSettings(e,n))),TO(this,"detectedOverlappedHeaders",!1)}static get PLUGIN_KEY(){return _O}static get PLUGIN_PRIORITY(){return rae}isEnabled(){return!!this.hot.getSettings()[_O]}enablePlugin(){var e=this;if(this.enabled)return;const{nestedHeaders:n}=this.hot.getSettings();(!Array.isArray(n)||!Array.isArray(n[0]))&&gt(ht`Your Nested Headers plugin configuration is invalid. The settings has to be\x20
passed as an array of arrays e.q. [['A1', { label: 'A2', colspan: 2 }]]`),this.addHook("init",()=>Xt(this,BO,Sae).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 Xt(e,UO,yae).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 Xt(e,IO,lae).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 Xt(e,PO,uae).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 Xt(e,xO,cae).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 Xt(e,HO,hae).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 Xt(e,DO,dae).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 Xt(e,NO,fae).call(e,...i)}),this.addHook("afterSelection",()=>Xt(this,kd,iC).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 Xt(e,MO,oae).call(e,...i)}),this.addHook("afterGetColumnHeaderRenderers",r=>Xt(this,$O,mae).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 Xt(e,FO,wae).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 Xt(e,WO,vae).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 Xt(e,AO,sae).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 Xt(e,OO,aae).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 Xt(e,LO,gae).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 Xt(e,kO,pae).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 Xt(e,VO,Cae).call(e,...i)}),this.hot.columnIndexMapper.addLocalHook("cacheUpdated",()=>Xt(this,kd,iC).call(this)),this.hot.rowIndexMapper.addLocalHook("cacheUpdated",()=>Xt(this,kd,iC).call(this)),super.enablePlugin(),this.updatePlugin()}updatePlugin(){if(!this.hot.view)return;const{nestedHeaders:e}=this.hot.getSettings();et(this,dt).setColumnsLimit(this.hot.countCols()),Array.isArray(e)&&(this.detectedOverlappedHeaders=et(this,dt).setState(e)),this.detectedOverlappedHeaders&&gt(ht`Your Nested Headers plugin setup contains overlapping headers. This kind of configuration\x20
is currently not supported.`),this.enabled&&this.hot.columnIndexMapper.hidingMapsCollection.getMergedValues().forEach((n,r)=>{const i=n===!0?"hide-column":"show-column";et(this,dt).triggerColumnModification(i,r)}),!et(this,Bo)&&this.enabled&&la(this,Bo,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";et(this,dt).triggerColumnModification(a,o)}}),this.ghostTable.buildWidthsMap()})),this.ghostTable.setLayersCount(this.getLayersCount()).buildWidthsMap(),super.updatePlugin()}disablePlugin(){this.clearColspans(),et(this,dt).clear(),et(this,Bo).unsubscribe(),la(this,Bo,null),this.ghostTable.clear(),super.disablePlugin()}getStateManager(){return et(this,dt)}getLayersCount(){return et(this,dt).getLayersCount()}getHeaderSettings(e,n){return et(this,dt).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"),Le(a.childNodes[c],"hiddenHeader"),l&&l.childNodes[c]&&(l.childNodes[c].removeAttribute("colspan"),Le(l.childNodes[c],"hiddenHeader")),o&&u&&u.childNodes[c]&&(u.childNodes[c].removeAttribute("colspan"),Le(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"),Le(o,"hiddenHeader");const{colspan:c,isHidden:h,isPlaceholder:d}=(s=et(this,dt).getHeaderSettings(e,u))!==null&&s!==void 0?s:{label:""};if(d||h)q(o,"hiddenHeader");else if(c>1){var g,p;const{wtOverlays:v}=l._wt,S=(g=v.topInlineStartCornerOverlay)===null||g===void 0?void 0:g.clone.wtTable.THEAD.contains(o),y=(p=v.inlineStartOverlay)===null||p===void 0?void 0:p.clone.wtTable.THEAD.contains(o),R=S||y?Math.min(c,r-i):c;R>1&&o.setAttribute("colspan",R)}this.hot.view.appendColHeader(u,o,function(){return n.getColumnHeaderValue(...arguments)},e)}}getColumnHeaderValue(e,n){var r;const{isHidden:i,isPlaceholder:o}=(r=et(this,dt).getHeaderSettings(n,e))!==null&&r!==void 0?r:{};return o||i?"":this.hot.getColHeader(e,n)}destroy(){la(this,dt,null),et(this,Bo)!==null&&(et(this,Bo).unsubscribe(),la(this,Bo,null)),super.destroy()}_getHeaderTreeNodeDataByCoords(e){if(!(e.row>=0||e.col<0))return et(this,dt).getHeaderTreeNodeData(e.row,e.col)}}function iC(){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=et(this,dt).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 oae(t){const e=this.hot.getSelectedRangeLast();if(!e)return t;const{highlight:n}=e;if(!(n.isHeader()&&n.col>=0))return t;const i=this.hot.view.getFirstFullyVisibleColumn(),o=this.hot.view.getLastFullyVisibleColumn(),s=et(this,dt).findLeftMostColumnIndex(n.row,n.col),a=et(this,dt).findRightMostColumnIndex(n.row,n.col);return s<i&&a>o?t:s<i?s:a}function sae(t,e,n){const r=et(this,dt).getHeaderTreeNodeData(e,t);if(!r)return t;const{columnCursor:i,selectionType:o,selectionWidth:s}=n,{isRoot:a,colspan:l}=et(this,dt).getHeaderSettings(e,t);if(o===lb){if(!a)return r.columnIndex}else if(o===R1&&(l>s-i||!a))return null;return t}function aae(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 g=s;g<=l;g++){var i;const p=c+g,v=d-a;if(v===0)continue;((i=et(this,dt).getHeaderTreeNodeData(g,d))===null||i===void 0?void 0:i.isRoot)===!1&&(t[p][v]="")}}}function lae(t,e,n,r){this._getHeaderTreeNodeDataByCoords(e)&&(r.column=!0)}function uae(t,e){const n=this._getHeaderTreeNodeDataByCoords(e);if(!n)return;la(this,vc,e.clone()),la(this,Ap,!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):(Wg(t)||fs(t)&&l)&&o.push(s,s+a-1,e.row),r.selectColumns(...o)}function cae(t,e,n,r){if(!this.hot.view.isMouseDown())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=ir(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 hae(){la(this,Ap,!1)}function dae(){const{navigableHeaders:t}=this.hot.getSettings();if(!this.hot.view.isMouseDown()||!et(this,Ap)||!t)return;const e=this.hot.getSelectedRangeLast(),n=e.getTopStartCorner().col,r=e.getBottomEndCorner().col,{columnIndex:i,origColspan:o}=et(this,dt).getHeaderTreeNodeData(et(this,vc).row,et(this,vc).col);if(e.setHighlight(et(this,vc)),o>e.getWidth()||i<n||i+o-1>r){const s=et(this,dt).findTopMostEntireHeaderLevel(ir(n,i,i+o-1),ir(r,i,i+o-1));e.highlight.row=s,e.highlight.col=e.from.col}}function fae(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=et(this,dt).findLeftMostColumnIndex(n.row,n.col),o=et(this,dt).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 gae(t,e){const n=t.row,r=this._getHeaderTreeNodeDataByCoords({row:n,col:t.col}),i=this._getHeaderTreeNodeDataByCoords({row:n,col:e.col});e.col<t.col?(r&&(t.col=r.columnIndex+r.origColspan-1),i&&(e.col=i.columnIndex)):e.col>=t.col&&(r&&(t.col=r.columnIndex),i&&(e.col=i.columnIndex+i.origColspan-1))}function mae(t){t.length=0;for(let e=0;e<et(this,dt).getLayersCount();e++)t.push(this.headerRendererFactory(e))}function pae(t){const e=et(this,dt).getLayersCount();let n=t.startColumn,r=!!e;for(let i=0;i<e;i++){const o=et(this,dt).findLeftMostColumnIndex(i,t.startColumn),s=this.hot.columnIndexMapper.getRenderableFromVisualIndex(o);if(o>=0&&(r=!1),Wn(s)&&s<t.startColumn){n=s;break}}t.startColumn=r?et(this,dt).getHeaderTreeNodeData(0,n).columnIndex:n}function wae(t,e){const n=this.ghostTable.getWidth(e);return t>n?t:n}function vae(t,e,n){var r;const{label:i}=(r=et(this,dt).getHeaderTreeNodeData(n,e))!==null&&r!==void 0?r:{label:""};return i}function Cae(t,e){if(t<0)return this.hot.getCell(t,et(this,dt).findLeftMostColumnIndex(t,e),!0)}function Sae(){this.updatePlugin()}function yae(t,e){e||this.updatePlugin()}function Bu(t,e,n){return e=bae(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function bae(t){var e=Rae(t,"string");return typeof e=="symbol"?e:String(e)}function Rae(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Eae{constructor(e,n){Bu(this,"hot",void 0),Bu(this,"data",null),Bu(this,"plugin",void 0),Bu(this,"parentReference",new WeakMap),Bu(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},me(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)&&E(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&&E(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 Ye(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:(E(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)?(me(e[0],e[2],d=>{const g=this.translateTrimmedRow(d);i.push(this.getDataObject(g))}),me(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 g=this.getChild(u,this.countChildren(u)-1),p=this.getRowIndex(g);this.hot.runHooks("beforeCreateRow",p+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=[];E(r,o=>{i.push(this.getDataObject(o))}),E(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=null;do r=this.getRowParent(r),r!==null&&(n=r);while(r!==null);this.plugin.disableCoreAPIModifiers(),this.hot.setSourceDataAtCell(this.getRowIndex(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}}const Tae=Eae;function YO(t,e,n){return e=_ae(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _ae(t){var e=Mae(t,"string");return typeof e=="symbol"?e:String(e)}function Mae(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Aae{constructor(e,n){YO(this,"hot",void 0),YO(this,"plugin",void 0),this.hot=n,this.plugin=e}}const pR=Aae;class so extends pR{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(E(l,c=>{c&&s.removeChild(c)}),q(n,so.CSS_CLASSES.indicatorContainer),i){const{rootDocument:c}=this.hot,h=a.cloneNode(!0);s.innerHTML="",me(0,i-1,()=>{const d=c.createElement("SPAN");q(d,so.CSS_CLASSES.emptyIndicator),s.appendChild(d)}),s.appendChild(h)}if(this.dataManager.hasChildren(o)){const c=this.hot.rootDocument.createElement("DIV");u&&Ee(c,[Eo()]),q(n,so.CSS_CLASSES.parent),this.collapsingUI.areChildrenCollapsed(r)?(q(c,`${so.CSS_CLASSES.button} ${so.CSS_CLASSES.expandButton}`),u&&Ee(n,[Ir(!1)])):(q(c,`${so.CSS_CLASSES.button} ${so.CSS_CLASSES.collapseButton}`),u&&Ee(n,[Ir(!0)])),s.appendChild(c)}}updateRowHeaderWidth(e){let n=e;n||(n=this.dataManager.cache.levelCount),this.rowHeaderWidthCache=Math.max(50,11+10*n+25),this.hot.render()}}const IN=so;class Oae extends pR{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),E(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)=>{me(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)&&E(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=[];E(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 E(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);E(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 E(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);E(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)&&E(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=[];E(e,o=>{i.push(...this.expandChildren(o,!1,!1))}),r&&this.untrimRows(i),n&&this.renderAndAdjust()}collapseAll(){const e=this.dataManager.getData(),n=[];E(e,r=>{this.dataManager.hasChildren(r)&&n.push(r)}),this.collapseMultipleChildren(n),this.renderAndAdjust()}expandAll(){const e=this.dataManager.getData(),n=[];E(e,r=>{this.dataManager.hasChildren(r)&&n.push(r)}),this.expandMultipleChildren(n),this.renderAndAdjust()}trimRows(e){this.hot.batchExecution(()=>{E(e,n=>{this.plugin.collapsedRowsMap.setValueAtIndex(n,!0)})},!0)}untrimRows(e){this.hot.batchExecution(()=>{E(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)&&E(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);Ie(e.target,IN.CSS_CLASSES.button)&&(this.areChildrenCollapsed(r)?this.expandChildren(r):this.collapseChildren(r),Lr(e))}translateTrimmedRow(e){return this.hot.toPhysicalRow(e)}untranslateTrimmedRow(e){return this.hot.toVisualRow(e)}renderAndAdjust(){this.hot.render(),this.hot.view.adjustElementsSize()}}const Iae=Oae;function Pae(t,e,n){xae(t,e),e.set(t,n)}function xae(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Hae(t,e,n){return e=Dae(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Dae(t){var e=Nae(t,"string");return typeof e=="symbol"?e:String(e)}function Nae(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Lae(t,e){var n=$ae(t,e,"get");return kae(t,n)}function $ae(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}function kae(t,e){return e.get?e.get.call(t):e.value}var GO=new WeakMap;class Fae extends pR{constructor(){super(...arguments),Hae(this,"dataManager",this.plugin.dataManager),Pae(this,GO,{writable:!0,value:{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(Im)},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(Pm)},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 me(0,e.items.length-1,r=>{if(r===0)return E(n,(i,o)=>{e.items.splice(r+o,0,i)}),!1}),this.modifyRowInsertingOptions(e)}modifyRowInsertingOptions(e){return me(0,e.items.length-1,n=>{const r=Lae(this,GO)[e.items[n].key];r!=null&&(e.items[n].callback=r)}),e}}const Wae=Fae;function Fd(t,e,n){return e=Vae(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Vae(t){var e=Bae(t,"string");return typeof e=="symbol"?e:String(e)}function Bae(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Uae{constructor(e){Fd(this,"plugin",void 0),Fd(this,"hot",void 0),Fd(this,"dataManager",void 0),Fd(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(p=>{if(!l)return!1;const v=this.dataManager.translateTrimmedRow(p);return l=this.shouldAllowMoving(v,a),v}),c=u.indexOf(a)===-1;if(!l||!c)return!1;const h=this.getBaseParent(u),d=this.getTargetParent(s,a),g=h===d;return this.movedToCollapsed=this.collapsingUI.areChildrenCollapsed(d),this.collapsingUI.collapsedRowsStash.stash(),this.shiftCollapsibleParentsLocations(u,a,g),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 Ct(i)&&(gt(ht`Since version 8.0.0 of the Handsontable the 'moveRows' method isn't used for moving rows\x20
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,s=null,a=null;if(this.movedToCollapsed){let l=null;e[r-1]<n?l=this.dataManager.translateTrimmedRow(n-r):l=this.dataManager.translateTrimmedRow(n);const u=this.dataManager.getRowParent(l===null?this.hot.countSourceRows()-1:l-1),c=this.dataManager.getRowIndex(u);i=this.dataManager.untranslateTrimmedRow(c),o=i}else e[r-1]<n?(o=n-1,i=o-r+1):(i=n,o=i+r-1);s=this.hot.selection,a=this.hot.countCols()-1,s.setRangeStart(this.hot._createCellCoords(i,0)),s.setRangeEnd(this.hot._createCellCoords(o,a),!0)}isRowOrderChanged(e,n){return e.some((r,i)=>r-i!==n)}}function Cn(t,e){PN(t,e),e.add(t)}function zO(t,e,n){PN(t,e),e.set(t,n)}function PN(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=Yae(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Yae(t){var e=Gae(t,"string");return typeof e=="symbol"?e:String(e)}function Gae(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function df(t,e){var n=xN(t,e,"get");return zae(t,n)}function zae(t,e){return e.get?e.get.call(t):e.value}function ug(t,e,n){var r=xN(t,e,"set");return jae(t,r,n),n}function xN(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}function jae(t,e,n){if(e.set)e.set.call(t,n);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=n}}function fn(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}const cg="nestedRows",Kae=300,jO=cg,Xae="The Nested Rows plugin requires an Array of Objects as a dataset to be provided. The plugin has been disabled.";var Op=new WeakMap,fl=new WeakMap,KO=new WeakSet,XO=new WeakSet,qO=new WeakSet,ZO=new WeakSet,QO=new WeakSet,JO=new WeakSet,eI=new WeakSet,tI=new WeakSet,nI=new WeakSet,rI=new WeakSet,iI=new WeakSet,oI=new WeakSet,sI=new WeakSet,aI=new WeakSet,lI=new WeakSet,sC=new WeakSet;class qae extends it{constructor(){super(...arguments),Cn(this,sC),Cn(this,lI),Cn(this,aI),Cn(this,sI),Cn(this,oI),Cn(this,iI),Cn(this,rI),Cn(this,nI),Cn(this,tI),Cn(this,eI),Cn(this,JO),Cn(this,QO),Cn(this,ZO),Cn(this,qO),Cn(this,XO),Cn(this,KO),oC(this,"dataManager",null),oC(this,"headersUI",null),oC(this,"collapsedRowsMap",null),zO(this,Op,{writable:!0,value:!1}),zO(this,fl,{writable:!0,value:!1})}static get PLUGIN_KEY(){return cg}static get PLUGIN_PRIORITY(){return Kae}isEnabled(){return!!this.hot.getSettings()[cg]}enablePlugin(){var e=this;this.enabled||(this.collapsedRowsMap=this.hot.rowIndexMapper.registerMap("nestedRows",new eh),this.dataManager=new Tae(this,this.hot),this.collapsingUI=new Iae(this,this.hot),this.headersUI=new IN(this,this.hot),this.contextMenuUI=new Wae(this,this.hot),this.rowMoveController=new Uae(this),this.addHook("afterInit",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return fn(e,aI,cle).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 fn(e,lI,hle).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 fn(e,qO,Jae).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 fn(e,ZO,ele).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 fn(e,QO,tle).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 fn(e,XO,Qae).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 fn(e,tI,ile).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 fn(e,eI,rle).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 fn(e,nI,ole).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 fn(e,rI,sle).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 fn(e,iI,ale).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 fn(e,oI,lle).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 fn(e,JO,nle).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 fn(e,sI,ule).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 fn(e,KO,Zae).call(e,...r)}),this.addHook("beforeLoadData",n=>fn(this,sC,uI).call(this,n)),this.addHook("beforeUpdateData",n=>fn(this,sC,uI).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();if(e.col===-1&&e.row>=0){const n=this.collapsingUI.translateTrimmedRow(e.row);this.collapsingUI.areChildrenCollapsed(n)?this.collapsingUI.expandChildren(n):this.collapsingUI.collapseChildren(n)}},runOnlyIf:()=>{var e;const n=(e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;return n&&this.hot.selection.isCellVisible(n)&&n.isHeader()},group:jO})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(jO)}disableCoreAPIModifiers(){ug(this,fl,!0)}enableCoreAPIModifiers(){ug(this,fl,!1)}onModifyRowData(e){if(!df(this,fl))return this.dataManager.getDataObject(e)}onModifySourceLength(){if(!df(this,fl))return this.dataManager.countAllRows()}onBeforeDataSplice(e,n,r){return df(this,fl)||this.dataManager.isRowHighestLevel(e)?!0:(this.dataManager.spliceData(e,n,r),!1)}destroy(){super.destroy()}}function Zae(t,e,n,r){return this.rowMoveController.onBeforeRowMove(t,e,n,r)}function Qae(t,e,n){this.collapsingUI.toggleState(t,e,n)}function Jae(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),ug(this,Op,!0),this.dataManager.getData().slice()}function ele(t){return this.contextMenuUI.appendOptions(t)}function tle(t,e){this.headersUI.appendLevelIndicators(t,e)}function nle(t){return Math.max(this.headersUI.rowHeaderWidthCache,t)}function rle(t,e,n,r){r!==this.pluginName&&this.hot._registerTimeout(()=>{ug(this,Op,!1),this.headersUI.updateRowHeaderWidth(),this.collapsingUI.collapsedRowsStash.applyStash()})}function ile(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 ole(){this.collapsingUI.collapsedRowsStash.stash()}function sle(t,e){this.collapsingUI.collapsedRowsStash.shiftStash(this.dataManager.getRowIndex(e)),this.collapsingUI.collapsedRowsStash.applyStash(),this.headersUI.updateRowHeaderWidth()}function ale(){this.collapsingUI.collapsedRowsStash.stash()}function lle(t,e,n){this.collapsingUI.collapsedRowsStash.shiftStash(n,null,-1),this.collapsingUI.collapsedRowsStash.applyStash(),this.headersUI.updateRowHeaderWidth()}function ule(){this.dataManager.rewriteCache()}function cle(){this.headersUI.updateRowHeaderWidth()}function hle(t,e){df(this,Op)&&(e.skipRender=!0)}function uI(t){if(!L1(t)){jy(Xae),this.hot.getSettings()[cg]=!1,this.disablePlugin();return}this.dataManager.setData(t),this.dataManager.rewriteCache()}function aC(t,e,n){return e=dle(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function dle(t){var e=fle(t,"string");return typeof e=="symbol"?e:String(e)}function fle(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class gle{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:window;aC(this,"rootWindow",void 0),aC(this,"prefix",void 0),aC(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(){E(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()}}const mle=gle;function ple(t,e,n){return e=wle(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function wle(t){var e=vle(t,"string");return typeof e=="symbol"?e:String(e)}function vle(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}de.getSingleton().register("persistentStateSave");de.getSingleton().register("persistentStateLoad");de.getSingleton().register("persistentStateReset");const cI="persistentState",Cle=0;class Sle extends it{constructor(){super(...arguments),ple(this,"storage",void 0)}static get PLUGIN_KEY(){return cI}static get PLUGIN_PRIORITY(){return Cle}isEnabled(){return!!this.hot.getSettings()[cI]}enablePlugin(){this.enabled||(this.storage||(this.storage=new mle(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 yle(t,e){ble(t,e),e.add(t)}function ble(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function lC(t,e,n){return e=Rle(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Rle(t){var e=Ele(t,"string");return typeof e=="symbol"?e:String(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||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function hI(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}const uC="search",Tle=190,_le="htSearchResult",Mle=function(t,e,n,r,i){t.getCellMeta(e,n).isSearchResult=i},Ale=function(t,e,n){return Ct(t)||t===null||!t.toLocaleLowerCase||t.length===0||Ct(e)||e===null?!1:e.toString().toLocaleLowerCase(n.locale).indexOf(t.toLocaleLowerCase(n.locale))!==-1};var cC=new WeakSet;class Ole extends it{constructor(){super(...arguments),yle(this,cC),lC(this,"callback",Mle),lC(this,"queryMethod",Ale),lC(this,"searchResultClass",_le)}static get PLUGIN_KEY(){return uC}static get PLUGIN_PRIORITY(){return Tle}isEnabled(){return this.hot.getSettings()[uC]}enablePlugin(){var e=this;if(this.enabled)return;const n=this.hot.getSettings()[uC];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 hI(e,cC,dI).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 hI(e,cC,dI).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 me(0,i-1,l=>{me(0,o-1,u=>{const c=this.hot.getDataAtCell(l,u),h=this.hot.getCellMeta(l,u),d=h.search.callback||n,p=(h.search.queryMethod||r)(e,c,h);if(p){const v={row:l,col:u,data:c};s.push(v)}d&&d(a,l,u,c,p)})}),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){Ve(e)&&(e.searchResultClass&&this.setSearchResultClass(e.searchResultClass),e.queryMethod&&this.setQueryMethod(e.queryMethod),e.callback&&this.setCallback(e.callback))}destroy(){super.destroy()}}function dI(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 hC(t,e){Ile(t,e),e.add(t)}function Ile(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Wd(t,e,n){return e=Ple(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ple(t){var e=xle(t,"string");return typeof e=="symbol"?e:String(e)}function xle(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function dC(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}const Hle="touchScroll",Dle=200;var fI=new WeakSet,gI=new WeakSet,mI=new WeakSet;class Nle extends it{constructor(){super(...arguments),hC(this,mI),hC(this,gI),hC(this,fI),Wd(this,"scrollbars",[]),Wd(this,"clones",[]),Wd(this,"lockedCollection",!1),Wd(this,"freezeOverlays",!1)}static get PLUGIN_KEY(){return Hle}static get PLUGIN_PRIORITY(){return Dle}static get SETTING_KEYS(){return!0}isEnabled(){return Vy()}enablePlugin(){this.enabled||(this.addHook("afterViewRender",()=>dC(this,fI,Lle).call(this)),this.registerEvents(),super.enablePlugin())}updatePlugin(){this.lockedCollection=!1,super.updatePlugin()}disablePlugin(){super.disablePlugin()}registerEvents(){this.addHook("beforeTouchScroll",()=>dC(this,gI,$le).call(this)),this.addHook("afterMomentumScroll",()=>dC(this,mI,kle).call(this))}}function Lle(){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 $le(){this.freezeOverlays=!0,E(this.clones,t=>{q(t,"hide-tween")})}function kle(){this.freezeOverlays=!1,E(this.clones,t=>{Le(t,"hide-tween"),q(t,"show-tween")}),this.hot._registerTimeout(()=>{E(this.clones,t=>{Le(t,"show-tween")})},400),E(this.scrollbars,t=>{t.refresh(),t.resetFixedPosition()}),this.hot.view._wt.wtOverlays.syncScrollWithMaster()}function Fle(t,e){Wle(t,e),e.add(t)}function Wle(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Vle(t,e,n){return e=Ble(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ble(t){var e=Ule(t,"string");return typeof e=="symbol"?e:String(e)}function Ule(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Yle(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}const ff="trimRows",Gle=330;var pI=new WeakSet;class zle extends it{constructor(){super(...arguments),Fle(this,pI),Vle(this,"trimmedRowsMap",null)}static get PLUGIN_KEY(){return ff}static get PLUGIN_PRIORITY(){return Gle}isEnabled(){return!!this.hot.getSettings()[ff]}enablePlugin(){this.enabled||(this.trimmedRowsMap=this.hot.rowIndexMapper.registerMap("trimRows",new eh),this.trimmedRowsMap.addLocalHook("init",()=>Yle(this,pI,jle).call(this)),super.enablePlugin())}updatePlugin(){const e=this.hot.getSettings()[ff];Array.isArray(e)&&this.hot.batchExecution(()=>{this.trimmedRowsMap.clear(),E(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(()=>{E(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&&(E(e,l=>{o[l]=!1}),i=Yt(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 jle(){const t=this.hot.getSettings()[ff];Array.isArray(t)&&this.hot.batchExecution(()=>{E(t,e=>{this.trimmedRowsMap.setValueAtIndex(e,!0)})},!0)}var HN={},Kle=kl,Xle=HN,qle=Kle("iterator"),Zle=Array.prototype,Qle=function(t){return t!==void 0&&(Xle.Array===t||Zle[qle]===t)},Jle=QI,wI=zS,eue=VS,tue=HN,nue=kl,rue=nue("iterator"),DN=function(t){if(!eue(t))return wI(t,rue)||wI(t,"@@iterator")||tue[Jle(t)]},iue=pa,oue=mg,sue=Cs,aue=gg,lue=DN,uue=TypeError,cue=function(t,e){var n=arguments.length<2?lue(t):e;if(oue(n))return sue(iue(n,t));throw new uue(aue(t)+" is not iterable")},hue=pa,vI=Cs,due=zS,fue=function(t,e,n){var r,i;vI(t);try{if(r=due(t,"return"),!r){if(e==="throw")throw n;return n}r=hue(r,t)}catch(o){i=!0,r=o}if(e==="throw")throw n;if(i)throw r;return vI(r),n},gue=iP,mue=pa,pue=Cs,wue=gg,vue=Qle,Cue=Wc,CI=BS,Sue=cue,yue=DN,SI=fue,bue=TypeError,gf=function(t,e){this.stopped=t,this.result=e},yI=gf.prototype,Rue=function(t,e,n){var r=n&&n.that,i=!!(n&&n.AS_ENTRIES),o=!!(n&&n.IS_RECORD),s=!!(n&&n.IS_ITERATOR),a=!!(n&&n.INTERRUPTED),l=gue(e,r),u,c,h,d,g,p,v,S=function(R){return u&&SI(u,"normal",R),new gf(!0,R)},y=function(R){return i?(pue(R),a?l(R[0],R[1],S):l(R[0],R[1])):a?l(R,S):l(R)};if(o)u=t.iterator;else if(s)u=t;else{if(c=yue(t),!c)throw new bue(wue(t)+" is not iterable");if(vue(c)){for(h=0,d=Cue(t);d>h;h++)if(g=y(t[h]),g&&CI(yI,g))return g;return new gf(!1)}u=Sue(t,c)}for(p=o?t.next:u.next;!(v=mue(p,u)).done;){try{g=y(v.value)}catch(R){SI(u,"throw",R)}if(typeof g=="object"&&g&&CI(yI,g))return g}return new gf(!1)},Eue=XS,Tue=vs,_ue=dg,Mue=function(t,e,n){var r=Eue(e);r in t?Tue.f(t,r,_ue(0,n)):t[r]=n},Aue=Ss,Oue=Rue,Iue=Mue;Aue({target:"Object",stat:!0},{fromEntries:function(e){var n={};return Oue(e,function(r,i){Iue(n,r,i)},{AS_ENTRIES:!0}),n}});const NN="undoRedo",Pue="undoRedo";function ce(t){const e=this;this.instance=t,this.doneActions=[],this.undoneActions=[],this.ignoreNewActions=!1,this.enabled=!1,t.addHook("afterChange",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),[]);E(l,c=>{c[1]=t.propToCol(c[1])});const u=o>1?this.getSelected():[[l[0][0],l[0][1]]];return new ce.ChangeAction(l,u)};e.done(a,i)}),t.addHook("afterCreateRow",(r,i,o)=>{e.done(()=>new ce.CreateRowAction(r,i),o)});const n=(r,i,o,s)=>{const a=["visualRow","visualCol","row","col","prop"],l=a.length,u=[];return me(o,s,c=>{me(r,i,h=>{const d=t.getCellMeta(h,c);if(Object.keys(d).length!==l){const g=Object.fromEntries(Object.entries(d).filter(p=>{let[v]=p;return a.includes(v)===!1}));u.push([d.visualRow,d.visualCol,g])}})}),u};t.addHook("beforeRemoveRow",(r,i,o,s)=>{const a=()=>{const l=t.toPhysicalRow(r),u=l+i-1,c=Tn(e.instance.getSourceData(l,0,l+i-1,e.instance.countSourceCols()-1));return new ce.RemoveRowAction(l,c,t.getSettings().fixedRowsBottom,t.getSettings().fixedRowsTop,t.rowIndexMapper.getIndexesSequence(),n(l,u,0,t.countCols()-1))};e.done(a,s)}),t.addHook("afterCreateCol",(r,i,o)=>{e.done(()=>new ce.CreateColumnAction(r,i),o)}),t.addHook("beforeRemoveCol",(r,i,o,s)=>{const a=()=>{const l=e.instance.getSourceDataArray(),u=(e.instance.countCols()+r)%e.instance.countCols(),c=u+i-1,h=[],d=[],g=[];me(l.length-1,S=>{const y=[],R=l[S];me(u,c,T=>{y.push(R[t.toPhysicalColumn(T)])}),h.push(y)}),me(i-1,S=>{g.push(t.toPhysicalColumn(u+S))}),Array.isArray(t.getSettings().colHeaders)&&me(i-1,S=>{d.push(t.getSettings().colHeaders[t.toPhysicalColumn(u+S)]||null)});const p=t.columnIndexMapper.getIndexesSequence(),v=t.rowIndexMapper.getIndexesSequence();return new ce.RemoveColumnAction(u,g,h,d,p,v,t.getSettings().fixedColumnsStart,n(0,t.countRows(),u,c))};e.done(a,s)}),t.addHook("beforeCellAlignment",(r,i,o,s)=>{e.done(()=>new ce.CellAlignmentAction(r,i,o,s))}),t.addHook("beforeFilter",r=>{e.done(()=>new ce.FiltersAction(r))}),t.addHook("beforeRowMove",(r,i)=>{r!==!1&&e.done(()=>new ce.RowMoveAction(r,i))}),t.addHook("beforeMergeCells",(r,i)=>{i||e.done(()=>new ce.MergeCellsAction(t,r))}),t.addHook("afterUnmergeCells",(r,i)=>{i||e.done(()=>new ce.UnmergeCellsAction(t,r))}),t.addHook("afterInit",()=>{e.init()})}ce.prototype.done=function(t,e){if(this.ignoreNewActions||e==="UndoRedo.undo"||e==="UndoRedo.redo"||e==="auto")return;const r=this.doneActions.slice();if(this.instance.runHooks("beforeUndoStackChange",r,e)===!1)return;const o=t(),s=this.undoneActions.slice();this.doneActions.push(o),this.instance.runHooks("afterUndoStackChange",r,this.doneActions.slice()),this.instance.runHooks("beforeRedoStackChange",s),this.undoneActions.length=0,this.instance.runHooks("afterRedoStackChange",s,this.undoneActions.slice())};ce.prototype.undo=function(){if(this.isUndoAvailable()){const t=this.doneActions.slice();this.instance.runHooks("beforeUndoStackChange",t);const e=this.doneActions.pop();this.instance.runHooks("afterUndoStackChange",t,this.doneActions.slice());const n=Tn(e);if(this.instance.runHooks("beforeUndo",n)===!1)return;this.ignoreNewActions=!0;const i=this,o=this.undoneActions.slice();this.instance.runHooks("beforeRedoStackChange",o),e.undo(this.instance,()=>{i.ignoreNewActions=!1,i.undoneActions.push(e)}),this.instance.runHooks("afterRedoStackChange",o,this.undoneActions.slice()),this.instance.runHooks("afterUndo",n)}};ce.prototype.redo=function(){if(this.isRedoAvailable()){const t=this.undoneActions.slice();this.instance.runHooks("beforeRedoStackChange",t);const e=this.undoneActions.pop();this.instance.runHooks("afterRedoStackChange",t,this.undoneActions.slice());const n=Tn(e);if(this.instance.runHooks("beforeRedo",n)===!1)return;this.ignoreNewActions=!0;const i=this,o=this.doneActions.slice();this.instance.runHooks("beforeUndoStackChange",o),e.redo(this.instance,()=>{i.ignoreNewActions=!1,i.doneActions.push(e)}),this.instance.runHooks("afterUndoStackChange",o,this.doneActions.slice()),this.instance.runHooks("afterRedo",n)}};ce.prototype.isUndoAvailable=function(){return this.doneActions.length>0};ce.prototype.isRedoAvailable=function(){return this.undoneActions.length>0};ce.prototype.clear=function(){this.doneActions.length=0,this.undoneActions.length=0};ce.prototype.isEnabled=function(){return this.enabled};ce.prototype.enable=function(){if(this.isEnabled())return;const t=this.instance;this.enabled=!0,Due(t),this.registerShortcuts(),t.addHook("afterChange",LN)};ce.prototype.disable=function(){if(!this.isEnabled())return;const t=this.instance;this.enabled=!1,Nue(t),this.unregisterShortcuts(),t.removeHook("afterChange",LN)};ce.prototype.destroy=function(){this.clear(),this.instance=null,this.doneActions=null,this.undoneActions=null};ce.Action=function(){};ce.Action.prototype.undo=function(){};ce.Action.prototype.redo=function(){};ce.ChangeAction=function(t,e){this.changes=t,this.selected=e,this.actionType="change"};To(ce.ChangeAction,ce.Action);ce.ChangeAction.prototype.undo=function(t,e){const n=Tn(this.changes),r=t.countEmptyRows(!0),i=t.countEmptyCols(!0);for(let s=0,a=n.length;s<a;s++)n[s].splice(3,1);t.addHookOnce("afterChange",e),t.setDataAtCell(n,null,null,"UndoRedo.undo");for(let s=0,a=n.length;s<a;s++){const[l,u]=n[s];t.getSettings().minSpareRows&&l+1+t.getSettings().minSpareRows===t.countRows()&&r===t.getSettings().minSpareRows&&(t.alter("remove_row",parseInt(l+1,10),t.getSettings().minSpareRows),t.undoRedo.doneActions.pop()),t.getSettings().minSpareCols&&u+1+t.getSettings().minSpareCols===t.countCols()&&i===t.getSettings().minSpareCols&&(t.alter("remove_col",parseInt(u+1,10),t.getSettings().minSpareCols),t.undoRedo.doneActions.pop())}const o=t.getSelectedLast();if(o!==void 0){const[s,a]=n[0],[l,u]=o,c=t.view.getFirstFullyVisibleRow(),h=t.view.getFirstFullyVisibleColumn(),d=s>=c,g=a>=h;if((d&&g)===!1&&(l!==s||u!==a)===!0){const S={row:s,col:a};d===!1&&(S.verticalSnap="top"),g===!1&&(S.horizontalSnap="start"),t.scrollViewportTo(S)}}t.selectCells(this.selected,!1,!1)};ce.ChangeAction.prototype.redo=function(t,e){const n=Tn(this.changes);for(let r=0,i=n.length;r<i;r++)n[r].splice(2,1);t.addHookOnce("afterChange",e),t.setDataAtCell(n,null,null,"UndoRedo.redo"),this.selected&&t.selectCells(this.selected,!1,!1)};ce.CreateRowAction=function(t,e){this.index=t,this.amount=e,this.actionType="insert_row"};To(ce.CreateRowAction,ce.Action);ce.CreateRowAction.prototype.undo=function(t,e){const n=t.countRows(),r=t.getSettings().minSpareRows;this.index>=n&&this.index-r<n&&(this.index-=r),t.addHookOnce("afterRemoveRow",e),t.alter("remove_row",this.index,this.amount,"UndoRedo.undo")};ce.CreateRowAction.prototype.redo=function(t,e){t.addHookOnce("afterCreateRow",e),t.alter("insert_row_above",this.index,this.amount,"UndoRedo.redo")};ce.RemoveRowAction=function(t,e,n,r,i,o){this.index=t,this.data=e,this.actionType="remove_row",this.fixedRowsBottom=n,this.fixedRowsTop=r,this.rowIndexesSequence=i,this.removedCellMetas=o};To(ce.RemoveRowAction,ce.Action);ce.RemoveRowAction.prototype.undo=function(t,e){const n=t.getSettings(),r=[];n.fixedRowsBottom=this.fixedRowsBottom,n.fixedRowsTop=this.fixedRowsTop,this.data.forEach((i,o)=>{Object.keys(i).forEach(s=>{const a=parseInt(s,10);r.push([this.index+o,isNaN(a)?s:a,i[s]])})}),t.alter("insert_row_above",this.index,this.data.length,"UndoRedo.undo"),this.removedCellMetas.forEach(i=>{let[o,s,a]=i;t.setCellMetaObject(o,s,a)}),t.addHookOnce("afterViewRender",e),t.setSourceDataAtCell(r,null,null,"UndoRedo.undo"),t.rowIndexMapper.setIndexesSequence(this.rowIndexesSequence)};ce.RemoveRowAction.prototype.redo=function(t,e){t.addHookOnce("afterRemoveRow",e),t.alter("remove_row",this.index,this.data.length,"UndoRedo.redo")};ce.CreateColumnAction=function(t,e){this.index=t,this.amount=e,this.actionType="insert_col"};To(ce.CreateColumnAction,ce.Action);ce.CreateColumnAction.prototype.undo=function(t,e){t.addHookOnce("afterRemoveCol",e),t.alter("remove_col",this.index,this.amount,"UndoRedo.undo")};ce.CreateColumnAction.prototype.redo=function(t,e){t.addHookOnce("afterCreateCol",e),t.alter("insert_col_start",this.index,this.amount,"UndoRedo.redo")};ce.RemoveColumnAction=function(t,e,n,r,i,o,s,a){this.index=t,this.indexes=e,this.data=n,this.amount=this.data[0].length,this.headers=r,this.columnPositions=i.slice(0),this.rowPositions=o.slice(0),this.actionType="remove_col",this.fixedColumnsStart=s,this.removedCellMetas=a};To(ce.RemoveColumnAction,ce.Action);ce.RemoveColumnAction.prototype.undo=function(t,e){const n=t.getSettings();n.fixedColumnsStart=this.fixedColumnsStart;const r=this.indexes.slice(0).sort(),i=(u,c,h)=>h[this.indexes.indexOf(r[c])],o=this.data.length,s=[];for(let u=0;u<o;u++)s.push(Ue(this.data[u],i));const a=Ue(this.headers,i),l=[];t.alter("insert_col_start",this.indexes[0],this.indexes.length,"UndoRedo.undo"),E(t.getSourceDataArray(),(u,c)=>{E(r,(h,d)=>{u[h]=s[c][d],l.push([c,h,u[h]])})}),t.setSourceDataAtCell(l,void 0,void 0,"UndoRedo.undo"),typeof this.headers<"u"&&E(a,(u,c)=>{t.getSettings().colHeaders[r[c]]=u}),this.removedCellMetas.forEach(u=>{let[c,h,d]=u;t.setCellMetaObject(c,h,d)}),t.batchExecution(()=>{t.rowIndexMapper.setIndexesSequence(this.rowPositions),t.columnIndexMapper.setIndexesSequence(this.columnPositions)},!0),t.addHookOnce("afterViewRender",e),t.render()};ce.RemoveColumnAction.prototype.redo=function(t,e){t.addHookOnce("afterRemoveCol",e),t.alter("remove_col",this.index,this.amount,"UndoRedo.redo")};ce.CellAlignmentAction=function(t,e,n,r){this.stateBefore=t,this.range=e,this.type=n,this.alignment=r};ce.CellAlignmentAction.prototype.undo=function(t,e){E(this.range,n=>{n.forAll((r,i)=>{r>=0&&i>=0&&t.setCellMeta(r,i,"className",this.stateBefore[r][i]||" htLeft")})}),t.addHookOnce("afterViewRender",e),t.render()};ce.CellAlignmentAction.prototype.redo=function(t,e){Yo(this.range,this.type,this.alignment,(n,r)=>t.getCellMeta(n,r),(n,r,i,o)=>t.setCellMeta(n,r,i,o)),t.addHookOnce("afterViewRender",e),t.render()};ce.FiltersAction=function(t){this.conditionsStack=t,this.actionType="filter"};To(ce.FiltersAction,ce.Action);ce.FiltersAction.prototype.undo=function(t,e){const n=t.getPlugin("filters");t.addHookOnce("afterViewRender",e),n.conditionCollection.importAllConditions(this.conditionsStack.slice(0,this.conditionsStack.length-1)),n.filter()};ce.FiltersAction.prototype.redo=function(t,e){const n=t.getPlugin("filters");t.addHookOnce("afterViewRender",e),n.conditionCollection.importAllConditions(this.conditionsStack),n.filter()};class xue extends ce.Action{constructor(e,n){super(),this.cellRange=n;const r=this.cellRange.getTopStartCorner(),i=this.cellRange.getBottomEndCorner();this.rangeData=e.getData(r.row,r.col,i.row,i.col)}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.rangeData,void 0,void 0,"MergeCells")}redo(e,n){const r=e.getPlugin("mergeCells");e.addHookOnce("afterViewRender",n),r.mergeRange(this.cellRange)}}ce.MergeCellsAction=xue;class Hue extends ce.Action{constructor(e,n){super(),this.cellRange=n}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()}}ce.UnmergeCellsAction=Hue;ce.RowMoveAction=function(t,e){this.rows=t.slice(),this.finalIndex=e,this.actionType="row_move"};To(ce.RowMoveAction,ce.Action);ce.RowMoveAction.prototype.undo=function(t,e){const n=t.getPlugin("manualRowMove"),r=[].concat(this.rows),i=r.filter(a=>a>this.finalIndex),o=r.filter(a=>a<=this.finalIndex),s=i.sort((a,l)=>l-a).concat(o.sort((a,l)=>a-l));t.addHookOnce("afterViewRender",e);for(let a=0;a<s.length;a+=1){const l=t.toVisualRow(s[a]);n.moveRow(l,s[a])}t.render(),t.deselectCell(),t.selectRows(this.rows[0],this.rows[0]+this.rows.length-1)};ce.RowMoveAction.prototype.redo=function(t,e){const n=t.getPlugin("manualRowMove");t.addHookOnce("afterViewRender",e),n.moveRows(this.rows.slice(),this.finalIndex),t.render(),t.deselectCell(),t.selectRows(this.finalIndex,this.finalIndex+this.rows.length-1)};ce.prototype.init=function(){const t=this.instance.getSettings().undo,e=typeof t>"u"||t;this.instance.undoRedo||(this.instance.undoRedo=this),e?this.instance.undoRedo.enable():this.instance.undoRedo.disable()};ce.prototype.registerShortcuts=function(){const e=this.instance.getShortcutManager().getContext("grid"),r={runOnlyIf:i=>!i.altKey,group:NN};e.addShortcuts([{keys:[["Control/Meta","z"]],callback:()=>{this.undo()}},{keys:[["Control/Meta","y"],["Control/Meta","Shift","z"]],callback:()=>{this.redo()}}],r)};ce.prototype.unregisterShortcuts=function(){this.instance.getShortcutManager().getContext("grid").removeShortcutsByGroup(NN)};function LN(t,e){const n=this;if(e==="loadData")return n.undoRedo.clear()}function Due(t){t.undo=function(){return t.undoRedo.undo()},t.redo=function(){return t.undoRedo.redo()},t.isUndoAvailable=function(){return t.undoRedo.isUndoAvailable()},t.isRedoAvailable=function(){return t.undoRedo.isRedoAvailable()},t.clearUndo=function(){return t.undoRedo.clear()}}function Nue(t){delete t.undo,delete t.redo,delete t.isUndoAvailable,delete t.isRedoAvailable,delete t.clearUndo}const ch=de.getSingleton();ch.add("afterUpdateSettings",function(){var t;(t=this.getPlugin("undoRedo"))===null||t===void 0||t.init()});ch.register("beforeUndo");ch.register("afterUndo");ch.register("beforeRedo");ch.register("afterRedo");ce.PLUGIN_KEY=Pue;ce.SETTING_KEYS=!0;function Lue(){tt(oc),tt(x8),tt(sc),tt(u5),tt(v5),tt(GH),tt(uZ),tt(KZ),tt(Ep),tt(vJ),tt(UJ),tt(ZJ),tt(_p),tt(Eee),tt(xne),tt(fre),tt(Wre),tt(Qre),tt(hie),tt(_ie),tt($ie),tt(ooe),tt(moe),tt(Yoe),tt(Cse),tt(Ese),tt(iae),tt(qae),tt(Sle),tt(Ole),tt(Nle),tt(zle),tt(ce)}function $ue(){n7(),S7(),O7(),X7(),Lue()}function kue(t){const e=typeof window>"u"?!1:window.jQuery;e&&(e.fn.handsontable=function(n){const r=this.first();let i=r.data("handsontable");if(typeof n!="string"){const u=n||{};return i?i.updateSettings(u):(i=new t.Core(r[0],u),r.data("handsontable",i),i.init()),r}let o;if(i)if(typeof i[n]<"u"){for(var s=arguments.length,a=new Array(s>1?s-1:0),l=1;l<s;l++)a[l-1]=arguments[l];o=i[n].call(i,...a),n==="destroy"&&r.removeData()}else throw new Error(`Handsontable do not provide action: ${n}`);return o})}var fC,gC,mC,pC,wC;$ue();kue(Ae);Ae.__GhostTable=Qb;Ae._getListenersCounter=Lz;Ae._getRegisteredMapsCounter=c4;Ae.EventManager=xr;const Fue=[uG,wz,qX,b7,gz,ZG,fG,Qz,fz,mG,Sz,Zz],Wue=[jG,yz];Ae.helper={};Ae.dom={};E(Fue,t=>{E(Object.getOwnPropertyNames(t),e=>{e.charAt(0)!=="_"&&(Ae.helper[e]=t[e])})});E(Wue,t=>{E(Object.getOwnPropertyNames(t),e=>{e.charAt(0)!=="_"&&(Ae.dom[e]=t[e])})});Ae.cellTypes=(fC=Ae.cellTypes)!==null&&fC!==void 0?fC:{};E(Iq(),t=>{Ae.cellTypes[t]=xb(t)});Ae.cellTypes.registerCellType=br;Ae.cellTypes.getCellType=xb;Ae.editors=(gC=Ae.editors)!==null&&gC!==void 0?gC:{};E(Oz(),t=>{Ae.editors[`${En(t)}Editor`]=Of(t)});Ae.editors.registerEditor=Jn;Ae.editors.getEditor=Of;Ae.renderers=(mC=Ae.renderers)!==null&&mC!==void 0?mC:{};E(fj(),t=>{const e=xf(t);t==="base"&&(Ae.renderers.cellDecorator=e),Ae.renderers[`${En(t)}Renderer`]=e});Ae.renderers.registerRenderer=lr;Ae.renderers.getRenderer=xf;Ae.validators=(pC=Ae.validators)!==null&&pC!==void 0?pC:{};E(pj(),t=>{Ae.validators[`${En(t)}Validator`]=Qy(t)});Ae.validators.registerValidator=ta;Ae.validators.getValidator=Qy;Ae.plugins=(wC=Ae.plugins)!==null&&wC!==void 0?wC:{};E(Zy(),t=>{Ae.plugins[t]=qc(t)});Ae.plugins[`${En(it.PLUGIN_KEY)}Plugin`]=it;Ae.plugins.registerPlugin=tt;Ae.plugins.getPlugin=qc;/**
* @preserve
* Authors: soakit, HChenZi
* Last updated: Mar 09, 2023
*
* Description: Definition file for Chinese - China language-country.
*/const Vue={languageCode:"zh-CN",[jg]:"上方插入行",[Kg]:"下方插入行",[Xg]:"左方插入列",[qg]:"右方插入列",[Zg]:["移除该行","移除多行"],[Qg]:["移除该列","移除多列"],[Jg]:"撤销",[em]:"恢复",[tm]:"只读",[nm]:"清空该列",[pm]:"对齐",[wm]:"左对齐",[vm]:"水平居中",[Cm]:"右对齐",[Sm]:"两端对齐",[ym]:"顶端对齐",[bm]:"垂直居中",[Rm]:"底端对齐",[lm]:"冻结该列",[um]:"取消冻结",[Em]:"边框",[Tm]:"上",[_m]:"右",[Mm]:"下",[Am]:"左",[Om]:"移除边框",[dm]:"插入批注",[fm]:"编辑批注",[gm]:"删除批注",[mm]:"只读批注",[cm]:"合并",[hm]:"取消合并",[rm]:"复制",[im]:"带标题的复制",[om]:"带标题组的复制",[sm]:"仅复制标题",[am]:"剪切",[Im]:"插入子行",[Pm]:"与母行分离",[xm]:["隐藏该列","隐藏多列"],[Hm]:["显示该列","显示多列"],[Dm]:["隐藏该行","隐藏多行"],[Nm]:["显示该行","显示多行"],[th]:"无",[Lm]:"为空",[$m]:"不为空",[km]:"等于",[Fm]:"不等于",[Wm]:"开头是",[Vm]:"结尾是",[Bm]:"包含",[Um]:"不包含",[Ym]:"大于",[Gm]:"大于或等于",[zm]:"小于",[jm]:"小于或等于",[Km]:"在此范围",[Xm]:"不在此范围",[qm]:"之后",[Zm]:"之前",[Qm]:"今天",[Jm]:"明天",[ep]:"昨天",[Oc]:"空白单元格",[tp]:"按条件过滤",[np]:"按值过滤",[rp]:"且",[nh]:"或",[ip]:"全选",[op]:"清除",[sp]:"确认",[ap]:"取消",[lp]:"搜索",[up]:"值",[cp]:"第二值"},Bue=Vue;Ob(Bue);const Uue=function(t,e,n,r,i,o,s){if(Ae.renderers.getRenderer("text")(t,e,n,r,i,o,s),s.style){const a=e.style;Object.assign(a,s.style)}};Ae.renderers.registerRenderer("styleRender",Uue);const Yue=t=>{const e=Rl(!0),n=t(),r={emit:(a,l)=>{e.value=!0,n==null||n.postMessage({type:a,payload:l})}},i={},o=[],s=[];return n==null||n.addEventListener("message",a=>{const{type:l,payload:u}=a.data,c=i[l];c!=null&&c.length&&c.forEach(h=>h(u)),o.forEach(h=>h(a))}),n==null||n.addEventListener("error",a=>{console.error(a),s.forEach(l=>l(a))}),GN(()=>{n==null||n.terminate()}),{loading:e,worker:r,onWorkerMessage:a=>o.push(a),onWorkerError:a=>s.push(a),onWorkerEvent:(a,l)=>{let u=i[a];u||(u=i[a]=[]),u.push(l)},mapEvents:a=>Array.isArray(a)?a.reduce((l,u)=>(l[u]=c=>r.emit(u,c),l),{}):Object.keys(a).reduce((l,u)=>{const c=a[u];return l[c]=h=>r.emit(u,h),l},{})}},$N=t=>(tL("data-v-7789e35a"),t=t(),nL(),t),Gue={class:"excel-wrapper"},zue={key:0,class:"loading"},jue=$N(()=>mf("img",{class:"lg",src:sL,alt:"xlsx"},null,-1)),Kue=$N(()=>mf("img",{class:"sm",src:aL,alt:"loading"},null,-1)),Xue={class:"table-wrapper"},que={class:"btn-group"},Zue=["onClick"],Que=FS({__name:"XlsxTable",props:{data:{},type:{}},setup(t){const e=t,n=Rl(null),r=Rl([]),i=Rl(0);let o;const s={language:"zh-CN",colHeaders:!0,rowHeaders:!0,autoRowSize:!1,autoColumnSize:!1,height:"100%",cells(p,v){const S=o==null?void 0:o.cell;return S&&Object.keys(S).length?S[_9(p,v)]:{}},columns(p){const v=o==null?void 0:o.columns;return v!=null&&v.length?v[p]:{}},colWidths(p){const v=o==null?void 0:o.colWidths;return typeof v=="number"?v:v&&v[p]||(o==null?void 0:o.defaults.colWidth)},rowHeights(p){const v=o==null?void 0:o.rowHeights;return typeof v=="number"?v:v&&v[p]||(o==null?void 0:o.defaults.rowHeight)},outsideClickDeselects:!1,licenseKey:"non-commercial-and-evaluation"},a=zN(()=>{var p;return(p=n.value)==null?void 0:p.hotInstance}),l=()=>e.type==="binary"?A9.create():M9.create(),{loading:u,worker:c,onWorkerEvent:h}=Yue(l),d=p=>{i.value!==p&&(i.value=p,c.emit("parseSheet",{sheet:i.value??r.value[0].id}))},g=()=>eL(()=>{setTimeout(()=>{var p;(p=a.value)==null||p.updateSettings({data:o==null?void 0:o.data,mergeCells:o==null?void 0:o.merge})},0)});return h("sheets",({sheets:p})=>{if(r.value=p,p.length){const[{id:v}]=p;i.value=v,c.emit("parseSheet",{sheet:i.value})}}),h("parseSheet",({sheetData:p})=>{o=p,g()}),jN(()=>e.data,()=>{c.emit("parseWorkbook",{workbook:e.data})}),KN(async()=>{var p;(p=a.value)==null||p.addHook("afterUpdateSettings",()=>u.value=!1),c.emit("parseWorkbook",{workbook:e.data})}),(p,v)=>(Uu(),Yu("div",Gue,[TR(u)?(Uu(),Yu("div",zue,[jue,Kue,XN(" 加载中,请耐心等待... ")])):qN("",!0),mf("div",Xue,[ZN(TR(Db),{ref_key:"table",ref:n,settings:s},null,512)]),mf("div",que,[(Uu(!0),Yu(QN,null,JN(r.value,S=>(Uu(),Yu("button",{key:S.id,style:{padding:"0 30px"},class:rL({active:i.value===S.id}),onClick:y=>d(S.id)},iL(S.name),11,Zue))),128))])]))}});const pce=oL(Que,[["__scopeId","data-v-7789e35a"]]);export{pce as default};